Restructure dash (#372)
* Restructure dash * WIP * WIP * refactor trigger UI: extract PR summary card, add mentions section, rename labels Co-authored-by: Cursor <cursoragent@cursor.com> * clean up console UI: remove info icons from section descriptions, rename mentions trigger Co-authored-by: Cursor <cursoragent@cursor.com> * fix review feedback: layout, terminology, form scope - extract console sidebar sections to module-level constant - align three-column layout breakpoints to xl (match sidebar visibility) - fix mixed shell/bash terminology in beta page - scope FormProvider to trigger sections only, restore autoComplete="off" Co-authored-by: Cursor <cursoragent@cursor.com> * Bump --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
pullfrog[bot]
parent
b8a0d799ee
commit
a7bd746f21
+15
-15
@@ -8,7 +8,7 @@ import { validateCompatibility } from "./versioning.ts";
|
||||
|
||||
// tool permission enum types for inputs
|
||||
const ToolPermissionInput = type.enumerated("disabled", "enabled");
|
||||
const BashPermissionInput = type.enumerated("disabled", "restricted", "enabled");
|
||||
const ShellPermissionInput = type.enumerated("disabled", "restricted", "enabled");
|
||||
const PushPermissionInput = type.enumerated("disabled", "restricted", "enabled");
|
||||
|
||||
// schema for JSON payload passed via prompt (internal dispatch invocation)
|
||||
@@ -51,7 +51,7 @@ export const Inputs = type({
|
||||
"web?": ToolPermissionInput.or("undefined"),
|
||||
"search?": ToolPermissionInput.or("undefined"),
|
||||
"push?": PushPermissionInput.or("undefined"),
|
||||
"bash?": BashPermissionInput.or("undefined"),
|
||||
"shell?": ShellPermissionInput.or("undefined"),
|
||||
"cwd?": type.string.or("undefined"),
|
||||
});
|
||||
|
||||
@@ -105,7 +105,7 @@ function resolveNonPromptInputs() {
|
||||
web: core.getInput("web") || undefined,
|
||||
search: core.getInput("search") || undefined,
|
||||
push: core.getInput("push") || undefined,
|
||||
bash: core.getInput("bash") || undefined,
|
||||
shell: core.getInput("shell") || undefined,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -138,26 +138,26 @@ export function resolvePayload(
|
||||
const resolvedAgent: AgentName | undefined =
|
||||
agent ?? (jsonAgent !== undefined && isAgentName(jsonAgent) ? jsonAgent : undefined);
|
||||
|
||||
// determine bash permission - strictest setting wins
|
||||
// determine shell permission - strictest setting wins
|
||||
// precedence: disabled > restricted > enabled
|
||||
// non-collaborators always get at least "restricted"
|
||||
const isNonCollaborator = !isCollaborator(event);
|
||||
const repoBash = repoSettings.bash ?? "restricted";
|
||||
const inputBash = inputs.bash;
|
||||
const repoShell = repoSettings.shell ?? "restricted";
|
||||
const inputShell = inputs.shell;
|
||||
|
||||
// resolve bash: start with repo setting, then apply restrictions
|
||||
let resolvedBash = repoBash;
|
||||
// resolve shell: start with repo setting, then apply restrictions
|
||||
let resolvedShell = repoShell;
|
||||
|
||||
// input can only make it stricter (disabled > restricted > enabled)
|
||||
if (inputBash === "disabled") {
|
||||
resolvedBash = "disabled";
|
||||
} else if (inputBash === "restricted" && resolvedBash === "enabled") {
|
||||
resolvedBash = "restricted";
|
||||
if (inputShell === "disabled") {
|
||||
resolvedShell = "disabled";
|
||||
} else if (inputShell === "restricted" && resolvedShell === "enabled") {
|
||||
resolvedShell = "restricted";
|
||||
}
|
||||
|
||||
// non-collaborators get at least "restricted" (can't have "enabled")
|
||||
if (isNonCollaborator && resolvedBash === "enabled") {
|
||||
resolvedBash = "restricted";
|
||||
if (isNonCollaborator && resolvedShell === "enabled") {
|
||||
resolvedShell = "restricted";
|
||||
}
|
||||
|
||||
// build payload - precedence: inputs > repoSettings > fallbacks
|
||||
@@ -183,7 +183,7 @@ export function resolvePayload(
|
||||
web: inputs.web ?? repoSettings.web ?? "enabled",
|
||||
search: inputs.search ?? repoSettings.search ?? "enabled",
|
||||
push: inputs.push ?? repoSettings.push ?? "restricted",
|
||||
bash: resolvedBash,
|
||||
shell: resolvedShell,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user