@bastani/atomic 0.9.28 → 0.9.29-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +6 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +2 -2
- package/dist/builtin/workflows/src/index.js +2 -2
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +2 -4
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -1
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +7 -0
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +31 -0
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +2 -6
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/builtin-resource-loader.d.ts.map +1 -1
- package/dist/core/builtin-resource-loader.js +8 -0
- package/dist/core/builtin-resource-loader.js.map +1 -1
- package/dist/core/execution-model-router.d.ts +1 -1
- package/dist/core/execution-model-router.d.ts.map +1 -1
- package/dist/core/execution-model-router.js +37 -15
- package/dist/core/execution-model-router.js.map +1 -1
- package/dist/core/model-routing-constraints.d.ts +2 -0
- package/dist/core/model-routing-constraints.d.ts.map +1 -1
- package/dist/core/model-routing-constraints.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +3 -2
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/service-tier-warnings.d.ts +4 -0
- package/dist/core/service-tier-warnings.d.ts.map +1 -0
- package/dist/core/service-tier-warnings.js +7 -0
- package/dist/core/service-tier-warnings.js.map +1 -0
- package/dist/core/settings-manager-basic-accessors.js +8 -4
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +5 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tool-selection.d.ts +18 -0
- package/dist/core/tool-selection.d.ts.map +1 -1
- package/dist/core/tool-selection.js +20 -0
- package/dist/core/tool-selection.js.map +1 -1
- package/dist/core/tool-status.d.ts +61 -0
- package/dist/core/tool-status.d.ts.map +1 -0
- package/dist/core/tool-status.js +156 -0
- package/dist/core/tool-status.js.map +1 -0
- package/dist/extensions/default-builtins.d.ts +4 -0
- package/dist/extensions/default-builtins.d.ts.map +1 -0
- package/dist/extensions/default-builtins.js +14 -0
- package/dist/extensions/default-builtins.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +2 -6
- package/dist/extensions/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +5 -0
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +10 -0
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +22 -0
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +3 -0
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +4 -0
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +5 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +3 -0
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +4 -0
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +3 -0
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +10 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/codemode.md +1 -1
- package/docs/models/model-selection.md +1 -1
- package/docs/models/reference.md +2 -2
- package/docs/providers.md +6 -4
- package/docs/rpc/protocol.md +61 -0
- package/docs/sdk/reference.md +45 -0
- package/docs/settings.md +18 -6
- package/docs/subagents/reference.md +4 -4
- package/docs/tools.md +4 -0
- package/docs/usage.md +1 -0
- package/docs/workflows/api-reference.md +4 -4
- package/docs/workflows/authoring.md +4 -0
- package/docs/workflows/operations.md +1 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA8BxC,MAAM,0BAA0B,GAAuB;IACtD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,mCAAmC,EAAE;IACzF,EAAE,KAAK,EAAE,SAAS,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"@earendil-works/pi-tui\";\nimport { APP_NAME } from \"../config.js\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\targumentHint?: string;\n\tgetArgumentCompletions?: (argumentPrefix: string) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;\n}\n\ntype WorkflowInputCompletionMetadata = {\n\tdescription: string;\n\tkind?: \"boolean\" | \"number\" | \"string\";\n};\n\ntype WorkflowCompletionMetadata = {\n\tname: string;\n\tdescription: string;\n\tinputs: Record<string, WorkflowInputCompletionMetadata>;\n};\n\nconst WORKFLOW_ADMIN_COMPLETIONS: AutocompleteItem[] = [\n\t{ value: \"connect \", label: \"connect\", description: \"Attach to a run (picker if no id)\" },\n\t{ value: \"attach \", label: \"attach\", description: \"Open the in-place attach pane on a node\" },\n\t{ value: \"list \", label: \"list\", description: \"List registered workflows\" },\n\t{ value: \"status \", label: \"status\", description: \"List current-session active and retained terminal runs\" },\n\t{ value: \"pause \", label: \"pause\", description: \"Pause a run\" },\n\t{ value: \"quit \", label: \"quit\", description: \"Quit a run and keep it resumable\" },\n\t{ value: \"resume \", label: \"resume\", description: \"Re-open overlay for a run\" },\n\t{ value: \"inputs \", label: \"inputs\", description: \"Show a workflow's input schema\" },\n\t{ value: \"reload \", label: \"reload\", description: \"Reload workflow resources\" },\n];\n\nconst BUNDLED_WORKFLOW_COMPLETION_METADATA: WorkflowCompletionMetadata[] = [\n\t{\n\t\tname: \"adversarial-verification\",\n\t\tdescription:\n\t\t\t\"Produce a candidate, score independent per-criterion verifier reports, and apply a deterministic mean-and-veto gate with bounded repairs.\",\n\t\tinputs: {\n\t\t\ttask: { description: \"Task whose candidate result must be independently verified.\", kind: \"string\" },\n\t\t\tverifier_count: {\n\t\t\t\tdescription: \"Number of independent verifiers for each criterion per round.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tmax_repairs: { description: \"Maximum candidate repair rounds before rejection.\", kind: \"number\" },\n\t\t\tcriteria: { description: \"Criteria record of name-to-description entries, or criteria.md markdown.\" },\n\t\t\taccept_mean: {\n\t\t\t\tdescription: \"Mean score required for acceptance on the 1–20 verification scale.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\treask_limit: { description: \"Maximum bounded re-ask waves for invalid criterion reports.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"classify-and-act\",\n\t\tdescription:\n\t\t\t\"Classify a task with structured confidence, route deterministically to an isolated category action, and ask for human selection when confidence is low.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Task to classify and execute.\", kind: \"string\" },\n\t\t\tcategories: { description: \"Ordered action categories available to the classifier and fallback chooser.\" },\n\t\t\tconfidence_threshold: {\n\t\t\t\tdescription: \"Minimum structured confidence required to route without human selection.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"fan-out-and-synthesize\",\n\t\tdescription:\n\t\t\t\"Partition a task, run bounded independent artifact branches, then synthesize all evidence at an explicit barrier.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Task to partition, investigate, and synthesize.\", kind: \"string\" },\n\t\t\tmax_branches: {\n\t\t\t\tdescription: \"Maximum number of independent partitions produced and executed.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tmax_concurrency: { description: \"Maximum number of branch agents running concurrently.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"generate-and-filter\",\n\t\tdescription:\n\t\t\t\"Generate more independent candidates than needed, deduplicate and filter them by rubric, optionally judge them, and return a parent-consumable shortlist.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Prompt for candidate generation and selection.\", kind: \"string\" },\n\t\t\tnum_candidates: { description: \"Number of independent candidates to generate.\", kind: \"number\" },\n\t\t\tshortlist_size: { description: \"Maximum number of candidates in the final shortlist.\", kind: \"number\" },\n\t\t\tuse_judge: { description: \"Whether an independent judge reviews the filtered shortlist.\", kind: \"boolean\" },\n\t\t\tmax_concurrency: { description: \"Maximum simultaneous generator stages.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"goal\",\n\t\tdescription:\n\t\t\t\"Goal Runner workflow with bounded sub-agent orchestration turns, immutable acceptance criteria, ledger artifacts, parallel reviewers, and reducer-gated completion. When launching follow-up goal runs from review findings, pass the ORIGINAL task text as acceptance_criteria so deltas cannot drift from the literal contract. If the task includes submitting a pull request (or MR/review), remove that final action from the objective text and set create_pr=true instead when preparing the workflow inputs.\",\n\t\tinputs: {\n\t\t\tobjective: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"The objective or delta for this Goal Runner workflow run. Do not include PR/MR submission instructions here; strip them from the task text and request them via create_pr=true instead.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tacceptance_criteria: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Original immutable task contract this run must remain consistent with. Defaults to objective. Orchestrators launching follow-up runs from reviewer findings should pass the ORIGINAL task text here.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tmax_turns: {\n\t\t\t\tdescription: \"Maximum orchestrator/review turns before Goal Runner stops as needs_human.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tbase_branch: {\n\t\t\t\tdescription: \"Optional branch reviewers compare the current code delta against (default origin/main).\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tgit_worktree_dir: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional Git worktree path. Leave at the default unless the user explicitly requested worktree isolation — stages never create git worktrees on their own. Must start inside a Git repo; absolute paths are used as-is, relative paths resolve from the repo root, existing Git worktrees from the invoking repository are reused/shared as-is, and missing paths are created from base_branch.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tcreate_pr: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Whether to run the final pull-request creation stage after reviewer/reducer approval. Defaults to false; prompt text alone does not opt in. If the task asks to submit a PR/MR/review, remove that from the objective text and set this to true — only the final stage then attempts provider-appropriate PR/MR/review creation after Goal completes.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"loop-until-done\",\n\t\tdescription:\n\t\t\t\"Repeat evidence-producing work and independent completion evaluation against a durable ledger until done or an inspectable iteration-limit failure.\",\n\t\tinputs: {\n\t\t\tprompt: {\n\t\t\t\tdescription: \"Objective whose explicit completion condition controls the bounded loop.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tmax_iterations: {\n\t\t\t\tdescription: \"Maximum work/evaluation iterations before returning an inspectable failed status (1-20).\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tprogress_scoring: {\n\t\t\t\tdescription: \"Enable advisory progress scoring after each completed iteration.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t\tprogress_repeats: {\n\t\t\t\tdescription: \"Number of advisory progress-scoring repeats per iteration.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"open-claude-design\",\n\t\tdescription:\n\t\t\t\"AI-powered design workflow: combined discovery/init → design-system/reference research → curated reference discovery → HTML generation → one live review session → rich HTML handoff. The discovery stage asks what to build, the output type, and which references to emulate, then runs impeccable init for PRODUCT.md/DESIGN.md (references take precedence over project context). The user reviews the generated HTML in one live session.\",\n\t\tinputs: {\n\t\t\tprompt: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"What to design (for example, a dashboard, page, component, or prototype). The discovery stage refines this into a confirmed brief and asks for the output type and references.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tdiscover_references: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Discover beautiful, current reference designs from notable design websites (Awwwards, recent.design, Dribbble, Monet, Motionsites) and feed them to generation. Set false to skip the network/browser reference pass.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"ralph\",\n\t\tdescription:\n\t\t\t\"Raw prompt → research-prompt-refinement → research → orchestrate → multi-model parallel review loop with bounded iteration and immutable acceptance criteria. When launching follow-up ralph runs from review findings, pass the ORIGINAL task text as acceptance_criteria so deltas cannot drift from the literal contract. If the task includes submitting a pull request (or MR/review), remove that final action from the prompt text and set create_pr=true instead when preparing the workflow inputs.\",\n\t\tinputs: {\n\t\t\tprompt: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"The task or goal to research, execute, and refine. Do not include PR/MR submission instructions here; strip them from the task text and request them via create_pr=true instead.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tacceptance_criteria: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Original immutable task contract this run must remain consistent with. Defaults to prompt. Orchestrators launching follow-up runs from reviewer findings should pass the ORIGINAL task text here.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tmax_loops: { description: \"Maximum research/orchestrate/review iterations (default 10).\", kind: \"number\" },\n\t\t\tbase_branch: {\n\t\t\t\tdescription: \"Branch reviewers compare the current code delta against (default origin/main).\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tgit_worktree_dir: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional Git worktree path. Leave at the default unless the user explicitly requested worktree isolation — stages never create git worktrees on their own. Must start inside a Git repo; absolute paths are used as-is, relative paths resolve from the repo root, existing Git worktrees from the invoking repository are reused/shared as-is, and missing paths are created from base_branch.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tcreate_pr: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Whether to run the final pull-request creation stage. Defaults to false; prompt text alone does not opt in. If the task asks to submit a PR/MR/review, remove that from the prompt text and set this to true — only the final stage then attempts provider-appropriate PR/MR/review creation.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"tournament\",\n\t\tdescription:\n\t\t\t\"Run independent whole-task attempts through a soft-scored pivot-pairing schedule and return an auditable ranking.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Task every competing agent must attempt independently.\", kind: \"string\" },\n\t\t\tnum_attempts: { description: \"Number of independent whole-task attempts (2-8).\", kind: \"number\" },\n\t\t\tmax_concurrency: {\n\t\t\t\tdescription: \"Maximum simultaneously active attempts or pairwise judges (1-8).\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tn_evaluations: {\n\t\t\t\tdescription: \"Number of repeated evaluations per criterion and directed pair.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tpivots: {\n\t\t\t\tdescription: \"Number of pivot candidates used for the second comparison phase.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tseed: { description: \"Seed for the deterministic comparison schedule.\", kind: \"number\" },\n\t\t\tcriteria: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional V1 judge criteria; accepts a markdown rubric, record, string list, or CriterionInput list; omitted uses the default three-criterion rubric.\",\n\t\t\t},\n\t\t\tmodels: { description: \"Optional ordered model ids assigned round-robin to attempt slots.\" },\n\t\t},\n\t},\n];\n\nfunction completeWorkflowToken(argumentText: string, candidates: AutocompleteItem[]): AutocompleteItem[] | null {\n\tconst tokenStart = /\\s$/.test(argumentText)\n\t\t? argumentText.length\n\t\t: Math.max(argumentText.lastIndexOf(\" \"), argumentText.lastIndexOf(\"\\t\")) + 1;\n\tconst head = argumentText.slice(0, tokenStart);\n\tconst token = argumentText.slice(tokenStart);\n\tconst normalizedToken = token.trimEnd();\n\tconst filtered = candidates\n\t\t.filter((candidate) => candidate.value.startsWith(token) && candidate.value.trimEnd() !== normalizedToken)\n\t\t.map((candidate) => ({ ...candidate, value: `${head}${candidate.value}` }));\n\treturn filtered.length > 0 ? filtered : null;\n}\n\nfunction bundledWorkflowNameItems(): AutocompleteItem[] {\n\treturn BUNDLED_WORKFLOW_COMPLETION_METADATA.map((workflow) => ({\n\t\tvalue: `${workflow.name} `,\n\t\tlabel: workflow.name,\n\t\tdescription: `Run workflow: ${workflow.name}`,\n\t}));\n}\n\nexport function getBundledWorkflowArgumentCompletions(argumentPrefix: string): AutocompleteItem[] | null {\n\tconst parts = argumentPrefix.trim().split(/\\s+/).filter(Boolean);\n\tconst subcommand = parts[0] ?? \"\";\n\tconst workflowItems = bundledWorkflowNameItems();\n\tif (!argumentPrefix.includes(\" \")) {\n\t\treturn completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\t}\n\tif (subcommand === \"inputs\") return completeWorkflowToken(argumentPrefix, workflowItems);\n\tif (subcommand === \"pause\") {\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: \"--all \", label: \"--all\", description: \"Pause all in-flight runs\" },\n\t\t\t{ value: \"--yes \", label: \"--yes\", description: \"Skip confirmation\" },\n\t\t\t{ value: \"-y \", label: \"-y\", description: \"Skip confirmation\" },\n\t\t]);\n\t}\n\tif (subcommand === \"quit\") {\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: \"--all \", label: \"--all\", description: \"Quit and keep all in-flight runs resumable\" },\n\t\t]);\n\t}\n\tif (!subcommand) return completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\n\tconst workflow = BUNDLED_WORKFLOW_COMPLETION_METADATA.find((candidate) => candidate.name === subcommand);\n\tif (!workflow) return null;\n\tconst tokenStart = /\\s$/.test(argumentPrefix)\n\t\t? argumentPrefix.length\n\t\t: Math.max(argumentPrefix.lastIndexOf(\" \"), argumentPrefix.lastIndexOf(\"\\t\")) + 1;\n\tconst token = argumentPrefix.slice(tokenStart);\n\tconst equalsIndex = token.indexOf(\"=\");\n\tif (equalsIndex > 0) {\n\t\tconst inputName = token.slice(0, equalsIndex);\n\t\tconst input = workflow.inputs[inputName];\n\t\tif (input?.kind !== \"boolean\") return null;\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: `${inputName}=true `, label: \"true\", description: inputName },\n\t\t\t{ value: `${inputName}=false `, label: \"false\", description: inputName },\n\t\t]);\n\t}\n\n\treturn completeWorkflowToken(argumentPrefix, [\n\t\t{ value: \"--no-picker \", label: \"--no-picker\", description: \"Skip interactive input picker\" },\n\t\t{ value: \"--help \", label: \"--help\", description: \"Show this workflow's input schema\" },\n\t\t...Object.entries(workflow.inputs).map(([name, input]) => ({\n\t\t\tvalue: `${name}=`,\n\t\t\tlabel: name,\n\t\t\tdescription: input.description,\n\t\t})),\n\t]);\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\", argumentHint: \"<provider/model>\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"thinking\", description: \"Set thinking level\", argumentHint: \"<level>\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for ctrl+p cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"tasks\", description: \"Inspect agents and shells, view output, and manage running tasks\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Compact older context with verbatim line ranges\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Exit ${APP_NAME}` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n\nexport const BUNDLED_EXTENSION_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"agents\", description: \"Browse available subagents and inspect their configuration\" },\n\t{\n\t\tname: \"workflow\",\n\t\tdescription:\n\t\t\t\"Run or inspect Atomic workflows. Usage: /workflow <name> [key=value…] | /workflow [list|status|connect|attach|quit|pause|resume|inputs|reload] [args]\",\n\t\tgetArgumentCompletions: getBundledWorkflowArgumentCompletions,\n\t},\n\t{ name: \"mcp\", description: \"Show MCP server status\" },\n\t{ name: \"mcp-auth\", description: \"Authenticate with an MCP server (OAuth)\" },\n\t{ name: \"curator\", description: \"Toggle or configure the search curator workflow\" },\n\t{ name: \"google-account\", description: \"Show the active Google account for Gemini Web\" },\n\t{ name: \"search\", description: \"Browse stored web search results\" },\n\t{ name: \"websearch\", description: \"Open web search curator\" },\n\t{ name: \"intercom\", description: \"Open session intercom overlay\" },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA8BxC,MAAM,0BAA0B,GAAuB;IACtD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,mCAAmC,EAAE;IACzF,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;IAC7F,EAAE,KAAK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-tui\";\nimport { APP_NAME } from \"../config.js\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\targumentHint?: string;\n\tgetArgumentCompletions?: (argumentPrefix: string) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;\n}\n\ntype WorkflowInputCompletionMetadata = {\n\tdescription: string;\n\tkind?: \"boolean\" | \"number\" | \"string\";\n};\n\ntype WorkflowCompletionMetadata = {\n\tname: string;\n\tdescription: string;\n\tinputs: Record<string, WorkflowInputCompletionMetadata>;\n};\n\nconst WORKFLOW_ADMIN_COMPLETIONS: AutocompleteItem[] = [\n\t{ value: \"connect \", label: \"connect\", description: \"Attach to a run (picker if no id)\" },\n\t{ value: \"attach \", label: \"attach\", description: \"Open the in-place attach pane on a node\" },\n\t{ value: \"list \", label: \"list\", description: \"List registered workflows\" },\n\t{ value: \"status \", label: \"status\", description: \"List current-session active and retained terminal runs\" },\n\t{ value: \"pause \", label: \"pause\", description: \"Pause a run\" },\n\t{ value: \"quit \", label: \"quit\", description: \"Quit a run and keep it resumable\" },\n\t{ value: \"resume \", label: \"resume\", description: \"Re-open overlay for a run\" },\n\t{ value: \"inputs \", label: \"inputs\", description: \"Show a workflow's input schema\" },\n\t{ value: \"reload \", label: \"reload\", description: \"Reload workflow resources\" },\n];\n\nconst BUNDLED_WORKFLOW_COMPLETION_METADATA: WorkflowCompletionMetadata[] = [\n\t{\n\t\tname: \"adversarial-verification\",\n\t\tdescription:\n\t\t\t\"Produce a candidate, score independent per-criterion verifier reports, and apply a deterministic mean-and-veto gate with bounded repairs.\",\n\t\tinputs: {\n\t\t\ttask: { description: \"Task whose candidate result must be independently verified.\", kind: \"string\" },\n\t\t\tverifier_count: {\n\t\t\t\tdescription: \"Number of independent verifiers for each criterion per round.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tmax_repairs: { description: \"Maximum candidate repair rounds before rejection.\", kind: \"number\" },\n\t\t\tcriteria: { description: \"Criteria record of name-to-description entries, or criteria.md markdown.\" },\n\t\t\taccept_mean: {\n\t\t\t\tdescription: \"Mean score required for acceptance on the 1–20 verification scale.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\treask_limit: { description: \"Maximum bounded re-ask waves for invalid criterion reports.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"classify-and-act\",\n\t\tdescription:\n\t\t\t\"Classify a task with structured confidence, route deterministically to an isolated category action, and ask for human selection when confidence is low.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Task to classify and execute.\", kind: \"string\" },\n\t\t\tcategories: { description: \"Ordered action categories available to the classifier and fallback chooser.\" },\n\t\t\tconfidence_threshold: {\n\t\t\t\tdescription: \"Minimum structured confidence required to route without human selection.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"fan-out-and-synthesize\",\n\t\tdescription:\n\t\t\t\"Partition a task, run bounded independent artifact branches, then synthesize all evidence at an explicit barrier.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Task to partition, investigate, and synthesize.\", kind: \"string\" },\n\t\t\tmax_branches: {\n\t\t\t\tdescription: \"Maximum number of independent partitions produced and executed.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tmax_concurrency: { description: \"Maximum number of branch agents running concurrently.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"generate-and-filter\",\n\t\tdescription:\n\t\t\t\"Generate more independent candidates than needed, deduplicate and filter them by rubric, optionally judge them, and return a parent-consumable shortlist.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Prompt for candidate generation and selection.\", kind: \"string\" },\n\t\t\tnum_candidates: { description: \"Number of independent candidates to generate.\", kind: \"number\" },\n\t\t\tshortlist_size: { description: \"Maximum number of candidates in the final shortlist.\", kind: \"number\" },\n\t\t\tuse_judge: { description: \"Whether an independent judge reviews the filtered shortlist.\", kind: \"boolean\" },\n\t\t\tmax_concurrency: { description: \"Maximum simultaneous generator stages.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"goal\",\n\t\tdescription:\n\t\t\t\"Goal Runner workflow with bounded sub-agent orchestration turns, immutable acceptance criteria, ledger artifacts, parallel reviewers, and reducer-gated completion. When launching follow-up goal runs from review findings, pass the ORIGINAL task text as acceptance_criteria so deltas cannot drift from the literal contract. If the task includes submitting a pull request (or MR/review), remove that final action from the objective text and set create_pr=true instead when preparing the workflow inputs.\",\n\t\tinputs: {\n\t\t\tobjective: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"The objective or delta for this Goal Runner workflow run. Do not include PR/MR submission instructions here; strip them from the task text and request them via create_pr=true instead.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tacceptance_criteria: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Original immutable task contract this run must remain consistent with. Defaults to objective. Orchestrators launching follow-up runs from reviewer findings should pass the ORIGINAL task text here.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tmax_turns: {\n\t\t\t\tdescription: \"Maximum orchestrator/review turns before Goal Runner stops as needs_human.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tbase_branch: {\n\t\t\t\tdescription: \"Optional branch reviewers compare the current code delta against (default origin/main).\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tgit_worktree_dir: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional Git worktree path. Leave at the default unless the user explicitly requested worktree isolation — stages never create git worktrees on their own. Must start inside a Git repo; absolute paths are used as-is, relative paths resolve from the repo root, existing Git worktrees from the invoking repository are reused/shared as-is, and missing paths are created from base_branch.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tcreate_pr: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Whether to run the final pull-request creation stage after reviewer/reducer approval. Defaults to false; prompt text alone does not opt in. If the task asks to submit a PR/MR/review, remove that from the objective text and set this to true — only the final stage then attempts provider-appropriate PR/MR/review creation after Goal completes.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"loop-until-done\",\n\t\tdescription:\n\t\t\t\"Repeat evidence-producing work and independent completion evaluation against a durable ledger until done or an inspectable iteration-limit failure.\",\n\t\tinputs: {\n\t\t\tprompt: {\n\t\t\t\tdescription: \"Objective whose explicit completion condition controls the bounded loop.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tmax_iterations: {\n\t\t\t\tdescription: \"Maximum work/evaluation iterations before returning an inspectable failed status (1-20).\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tprogress_scoring: {\n\t\t\t\tdescription: \"Enable advisory progress scoring after each completed iteration.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t\tprogress_repeats: {\n\t\t\t\tdescription: \"Number of advisory progress-scoring repeats per iteration.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"open-claude-design\",\n\t\tdescription:\n\t\t\t\"AI-powered design workflow: combined discovery/init → design-system/reference research → curated reference discovery → HTML generation → one live review session → rich HTML handoff. The discovery stage asks what to build, the output type, and which references to emulate, then runs impeccable init for PRODUCT.md/DESIGN.md (references take precedence over project context). The user reviews the generated HTML in one live session.\",\n\t\tinputs: {\n\t\t\tprompt: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"What to design (for example, a dashboard, page, component, or prototype). The discovery stage refines this into a confirmed brief and asks for the output type and references.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tdiscover_references: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Discover beautiful, current reference designs from notable design websites (Awwwards, recent.design, Dribbble, Monet, Motionsites) and feed them to generation. Set false to skip the network/browser reference pass.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"ralph\",\n\t\tdescription:\n\t\t\t\"Raw prompt → research-prompt-refinement → research → orchestrate → multi-model parallel review loop with bounded iteration and immutable acceptance criteria. When launching follow-up ralph runs from review findings, pass the ORIGINAL task text as acceptance_criteria so deltas cannot drift from the literal contract. If the task includes submitting a pull request (or MR/review), remove that final action from the prompt text and set create_pr=true instead when preparing the workflow inputs.\",\n\t\tinputs: {\n\t\t\tprompt: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"The task or goal to research, execute, and refine. Do not include PR/MR submission instructions here; strip them from the task text and request them via create_pr=true instead.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tacceptance_criteria: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Original immutable task contract this run must remain consistent with. Defaults to prompt. Orchestrators launching follow-up runs from reviewer findings should pass the ORIGINAL task text here.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tmax_loops: { description: \"Maximum research/orchestrate/review iterations (default 10).\", kind: \"number\" },\n\t\t\tbase_branch: {\n\t\t\t\tdescription: \"Branch reviewers compare the current code delta against (default origin/main).\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tgit_worktree_dir: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional Git worktree path. Leave at the default unless the user explicitly requested worktree isolation — stages never create git worktrees on their own. Must start inside a Git repo; absolute paths are used as-is, relative paths resolve from the repo root, existing Git worktrees from the invoking repository are reused/shared as-is, and missing paths are created from base_branch.\",\n\t\t\t\tkind: \"string\",\n\t\t\t},\n\t\t\tcreate_pr: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Whether to run the final pull-request creation stage. Defaults to false; prompt text alone does not opt in. If the task asks to submit a PR/MR/review, remove that from the prompt text and set this to true — only the final stage then attempts provider-appropriate PR/MR/review creation.\",\n\t\t\t\tkind: \"boolean\",\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tname: \"tournament\",\n\t\tdescription:\n\t\t\t\"Run independent whole-task attempts through a soft-scored pivot-pairing schedule and return an auditable ranking.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Task every competing agent must attempt independently.\", kind: \"string\" },\n\t\t\tnum_attempts: { description: \"Number of independent whole-task attempts (2-8).\", kind: \"number\" },\n\t\t\tmax_concurrency: {\n\t\t\t\tdescription: \"Maximum simultaneously active attempts or pairwise judges (1-8).\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tn_evaluations: {\n\t\t\t\tdescription: \"Number of repeated evaluations per criterion and directed pair.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tpivots: {\n\t\t\t\tdescription: \"Number of pivot candidates used for the second comparison phase.\",\n\t\t\t\tkind: \"number\",\n\t\t\t},\n\t\t\tseed: { description: \"Seed for the deterministic comparison schedule.\", kind: \"number\" },\n\t\t\tcriteria: {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional V1 judge criteria; accepts a markdown rubric, record, string list, or CriterionInput list; omitted uses the default three-criterion rubric.\",\n\t\t\t},\n\t\t\tmodels: { description: \"Optional ordered model ids assigned round-robin to attempt slots.\" },\n\t\t},\n\t},\n];\n\nfunction completeWorkflowToken(argumentText: string, candidates: AutocompleteItem[]): AutocompleteItem[] | null {\n\tconst tokenStart = /\\s$/.test(argumentText)\n\t\t? argumentText.length\n\t\t: Math.max(argumentText.lastIndexOf(\" \"), argumentText.lastIndexOf(\"\\t\")) + 1;\n\tconst head = argumentText.slice(0, tokenStart);\n\tconst token = argumentText.slice(tokenStart);\n\tconst normalizedToken = token.trimEnd();\n\tconst filtered = candidates\n\t\t.filter((candidate) => candidate.value.startsWith(token) && candidate.value.trimEnd() !== normalizedToken)\n\t\t.map((candidate) => ({ ...candidate, value: `${head}${candidate.value}` }));\n\treturn filtered.length > 0 ? filtered : null;\n}\n\nfunction bundledWorkflowNameItems(): AutocompleteItem[] {\n\treturn BUNDLED_WORKFLOW_COMPLETION_METADATA.map((workflow) => ({\n\t\tvalue: `${workflow.name} `,\n\t\tlabel: workflow.name,\n\t\tdescription: `Run workflow: ${workflow.name}`,\n\t}));\n}\n\nexport function getBundledWorkflowArgumentCompletions(argumentPrefix: string): AutocompleteItem[] | null {\n\tconst parts = argumentPrefix.trim().split(/\\s+/).filter(Boolean);\n\tconst subcommand = parts[0] ?? \"\";\n\tconst workflowItems = bundledWorkflowNameItems();\n\tif (!argumentPrefix.includes(\" \")) {\n\t\treturn completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\t}\n\tif (subcommand === \"inputs\") return completeWorkflowToken(argumentPrefix, workflowItems);\n\tif (subcommand === \"pause\") {\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: \"--all \", label: \"--all\", description: \"Pause all in-flight runs\" },\n\t\t\t{ value: \"--yes \", label: \"--yes\", description: \"Skip confirmation\" },\n\t\t\t{ value: \"-y \", label: \"-y\", description: \"Skip confirmation\" },\n\t\t]);\n\t}\n\tif (subcommand === \"quit\") {\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: \"--all \", label: \"--all\", description: \"Quit and keep all in-flight runs resumable\" },\n\t\t]);\n\t}\n\tif (!subcommand) return completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\n\tconst workflow = BUNDLED_WORKFLOW_COMPLETION_METADATA.find((candidate) => candidate.name === subcommand);\n\tif (!workflow) return null;\n\tconst tokenStart = /\\s$/.test(argumentPrefix)\n\t\t? argumentPrefix.length\n\t\t: Math.max(argumentPrefix.lastIndexOf(\" \"), argumentPrefix.lastIndexOf(\"\\t\")) + 1;\n\tconst token = argumentPrefix.slice(tokenStart);\n\tconst equalsIndex = token.indexOf(\"=\");\n\tif (equalsIndex > 0) {\n\t\tconst inputName = token.slice(0, equalsIndex);\n\t\tconst input = workflow.inputs[inputName];\n\t\tif (input?.kind !== \"boolean\") return null;\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: `${inputName}=true `, label: \"true\", description: inputName },\n\t\t\t{ value: `${inputName}=false `, label: \"false\", description: inputName },\n\t\t]);\n\t}\n\n\treturn completeWorkflowToken(argumentPrefix, [\n\t\t{ value: \"--no-picker \", label: \"--no-picker\", description: \"Skip interactive input picker\" },\n\t\t{ value: \"--help \", label: \"--help\", description: \"Show this workflow's input schema\" },\n\t\t...Object.entries(workflow.inputs).map(([name, input]) => ({\n\t\t\tvalue: `${name}=`,\n\t\t\tlabel: name,\n\t\t\tdescription: input.description,\n\t\t})),\n\t]);\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\", argumentHint: \"<provider/model>\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"thinking\", description: \"Set thinking level\", argumentHint: \"<level>\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for ctrl+p cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"tools\", description: \"Show which tools are active, inactive (and why), or missing\" },\n\t{ name: \"tasks\", description: \"Inspect agents and shells, view output, and manage running tasks\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Compact older context with verbatim line ranges\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Exit ${APP_NAME}` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n\nexport const BUNDLED_EXTENSION_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"agents\", description: \"Browse available subagents and inspect their configuration\" },\n\t{\n\t\tname: \"workflow\",\n\t\tdescription:\n\t\t\t\"Run or inspect Atomic workflows. Usage: /workflow <name> [key=value…] | /workflow [list|status|connect|attach|quit|pause|resume|inputs|reload] [args]\",\n\t\tgetArgumentCompletions: getBundledWorkflowArgumentCompletions,\n\t},\n\t{ name: \"mcp\", description: \"Show MCP server status\" },\n\t{ name: \"mcp-auth\", description: \"Authenticate with an MCP server (OAuth)\" },\n\t{ name: \"curator\", description: \"Toggle or configure the search curator workflow\" },\n\t{ name: \"google-account\", description: \"Show the active Google account for Gemini Web\" },\n\t{ name: \"search\", description: \"Browse stored web search results\" },\n\t{ name: \"websearch\", description: \"Open web search curator\" },\n\t{ name: \"intercom\", description: \"Open session intercom overlay\" },\n];\n"]}
|
|
@@ -9,5 +9,23 @@ interface ToolSelection {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function isRegisteredToolAllowed(selection: ToolSelection, name: string): boolean;
|
|
11
11
|
export declare function isToolActivatable(selection: ToolSelection, name: string, exposure: string, hasToolSearch: boolean): boolean;
|
|
12
|
+
interface SelectedTools {
|
|
13
|
+
_usesDefaultTools: boolean;
|
|
14
|
+
_appliedDefaultTools: ReadonlySet<string>;
|
|
15
|
+
_allowedToolNames?: ReadonlySet<string>;
|
|
16
|
+
_initialActiveToolNames?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
/** Tool names the session's selection asked for, whether or not a tool with each name has registered yet. */
|
|
19
|
+
export declare function selectedToolNames(selection: SelectedTools): ReadonlySet<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Default-active tools activate whenever they register. An opt-in tool (`defaultActive: false`)
|
|
22
|
+
* activates only on its first registration, and only when the selection names it, such as
|
|
23
|
+
* `defaultTools: ["+codemode"]` whose extension loads after the session starts. A reload keeps
|
|
24
|
+
* whatever activation the session has given an already registered opt-in tool since.
|
|
25
|
+
*/
|
|
26
|
+
export declare function activatesOnRegistration(selection: SelectedTools, name: string, definition: {
|
|
27
|
+
exposure?: string;
|
|
28
|
+
defaultActive?: boolean;
|
|
29
|
+
} | undefined, alreadyRegistered: boolean): boolean;
|
|
12
30
|
export {};
|
|
13
31
|
//# sourceMappingURL=tool-selection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-selection.d.ts","sourceRoot":"","sources":["../../src/core/tool-selection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAgB1F;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKnD;AAED,UAAU,aAAa;IACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,eAAe,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM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EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,CAG/E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,EACtE,iBAAiB,EAAE,OAAO,GACxB,OAAO,CAKT"}
|
|
@@ -40,4 +40,24 @@ export function isToolActivatable(selection, name, exposure, hasToolSearch) {
|
|
|
40
40
|
return true;
|
|
41
41
|
return exposure !== "direct" && exposure !== "hidden" && hasToolSearch;
|
|
42
42
|
}
|
|
43
|
+
/** Tool names the session's selection asked for, whether or not a tool with each name has registered yet. */
|
|
44
|
+
export function selectedToolNames(selection) {
|
|
45
|
+
if (selection._usesDefaultTools)
|
|
46
|
+
return selection._appliedDefaultTools;
|
|
47
|
+
return new Set(selection._allowedToolNames ?? selection._initialActiveToolNames ?? []);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Default-active tools activate whenever they register. An opt-in tool (`defaultActive: false`)
|
|
51
|
+
* activates only on its first registration, and only when the selection names it, such as
|
|
52
|
+
* `defaultTools: ["+codemode"]` whose extension loads after the session starts. A reload keeps
|
|
53
|
+
* whatever activation the session has given an already registered opt-in tool since.
|
|
54
|
+
*/
|
|
55
|
+
export function activatesOnRegistration(selection, name, definition, alreadyRegistered) {
|
|
56
|
+
const exposure = definition?.exposure ?? "direct";
|
|
57
|
+
if (exposure !== "direct" && exposure !== "model-only")
|
|
58
|
+
return false;
|
|
59
|
+
if (definition?.defaultActive !== false)
|
|
60
|
+
return true;
|
|
61
|
+
return !alreadyRegistered && selectedToolNames(selection).has(name);
|
|
62
|
+
}
|
|
43
63
|
//# sourceMappingURL=tool-selection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-selection.js","sourceRoot":"","sources":["../../src/core/tool-sel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AC,IAAI,CAAC;QAC5C,SAAS,CAAC,aAAa;QACvB,aAAa,CAAC,IAAI,CAAC;QACnB,CAAC,SAAS,CAAC,iBAAiB,EAAE,GAAG,CAAC,IAAI,CAAC;QAEvC,OAAO,KAAK,CAAC;IACd,IAAI,CAAC,SAAS,CAAC,aAAa,IAAI,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3E,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/D,OAAO,CACN,CAAC,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI;QACnC,CAAC,CAAC,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC5E,aAAa,CAAC,IAAI,CAAC,CACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAChC,SAAwB,EACxB,IAAY,EACZ,QAAgB,EAChB,aAAsB;IAEtB,IAAI,CAAC,SAAS,CAAC,aAAa,IAAI,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnG,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,QAAQ,IAAI,aAAa,CAAC;AACxE,CAAC","sourcesContent":["import {\n\tLIST_MCP_RESOURCE_TEMPLATES_TOOL,\n\tLIST_MCP_RESOURCES_TOOL,\n\tREAD_MCP_RESOURCE_TOOL,\n} from \"../extensions/mcp/resources.js\";\nimport type { SubagentChildPolicy } from \"./extensions/types.ts\";\n\nexport function createToolNameMatcher(entries: Iterable<string>): (name: string) => boolean {\n\tconst names = new Set<string>();\n\tconst patterns: RegExp[] = [];\n\tfor (const entry of entries) {\n\t\tif (!entry.includes(\"*\")) names.add(entry);\n\t\telse\n\t\t\tpatterns.push(\n\t\t\t\tnew RegExp(\n\t\t\t\t\t`^${entry\n\t\t\t\t\t\t.split(\"*\")\n\t\t\t\t\t\t.map((part) => part.replace(/[.+?^${}()|[\\]\\\\]/g, \"\\\\$&\"))\n\t\t\t\t\t\t.join(\".*\")}$`,\n\t\t\t\t),\n\t\t\t);\n\t}\n\treturn (name) => names.has(name) || patterns.some((pattern) => pattern.test(name));\n}\n\nexport function isMcpToolName(name: string): boolean {\n\treturn (\n\t\tname.startsWith(\"mcp__\") ||\n\t\t[LIST_MCP_RESOURCES_TOOL, LIST_MCP_RESOURCE_TEMPLATES_TOOL, READ_MCP_RESOURCE_TOOL].includes(name)\n\t);\n}\n\ninterface ToolSelection {\n\t_allowedToolNames?: Set<string>;\n\t_allowedTools?: (name: string) => boolean;\n\t_excludedTools?: (name: string) => boolean;\n\t_subagentPolicy?: SubagentChildPolicy;\n}\n\nexport function isRegisteredToolAllowed(selection: ToolSelection, name: string): boolean {\n\tif (selection._excludedTools?.(name)) return false;\n\tif (\n\t\t(selection._subagentPolicy?.depth ?? 0) >= 1 &&\n\t\tselection._allowedTools &&\n\t\tisMcpToolName(name) &&\n\t\t!selection._allowedToolNames?.has(name)\n\t)\n\t\treturn false;\n\tif (!selection._allowedTools || selection._allowedTools(name)) return true;\n\tif ((selection._subagentPolicy?.depth ?? 0) >= 1) return false;\n\treturn (\n\t\t!!selection._allowedToolNames?.size &&\n\t\t![...selection._allowedToolNames].some((entry) => entry.startsWith(\"mcp__\")) &&\n\t\tisMcpToolName(name)\n\t);\n}\n\nexport function isToolActivatable(\n\tselection: ToolSelection,\n\tname: string,\n\texposure: string,\n\thasToolSearch: boolean,\n): boolean {\n\tif (!selection._allowedTools || selection._allowedTools(name) || !isMcpToolName(name)) return true;\n\tif ((selection._subagentPolicy?.depth ?? 0) >= 1) return true;\n\treturn exposure !== \"direct\" && exposure !== \"hidden\" && hasToolSearch;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tool-selection.js","sourceRoot":"","sources":["../../src/core/tool-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gCAAgC,EAChC,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,gCAAgC,CAAC;AAGxC,MAAM,UAAU,qBAAqB,CAAC,OAAyB;IAC9D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;;YAE1C,QAAQ,CAAC,IAAI,CACZ,IAAI,MAAM,CACT,IAAI,KAAK;iBACP,KAAK,CAAC,GAAG,CAAC;iBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;iBACzD,IAAI,CAAC,IAAI,CAAC,GAAG,CACf,CACD,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACzC,OAAO,CACN,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QACxB,CAAC,uBAAuB,EAAE,gCAAgC,EAAE,sBAAsB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAClG,CAAC;AACH,CAAC;AASD,MAAM,UAAU,uBAAuB,CAAC,SAAwB,EAAE,IAA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,IAAI,SAAS,CAAC,iBAAiB;QAAE,OAAO,SAAS,CAAC,oBAAoB,CAAC;IACvE,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,iBAAiB,IAAI,SAAS,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;AACxF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACtC,SAAwB,EACxB,IAAY,EACZ,UAAsE,EACtE,iBAA0B;IAE1B,MAAM,QAAQ,GAAG,UAAU,EAAE,QAAQ,IAAI,QAAQ,CAAC;IAClD,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,YAAY;QAAE,OAAO,KAAK,CAAC;IACrE,IAAI,UAAU,EAAE,aAAa,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACrD,OAAO,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import {\n\tLIST_MCP_RESOURCE_TEMPLATES_TOOL,\n\tLIST_MCP_RESOURCES_TOOL,\n\tREAD_MCP_RESOURCE_TOOL,\n} from \"../extensions/mcp/resources.js\";\nimport type { SubagentChildPolicy } from \"./extensions/types.ts\";\n\nexport function createToolNameMatcher(entries: Iterable<string>): (name: string) => boolean {\n\tconst names = new Set<string>();\n\tconst patterns: RegExp[] = [];\n\tfor (const entry of entries) {\n\t\tif (!entry.includes(\"*\")) names.add(entry);\n\t\telse\n\t\t\tpatterns.push(\n\t\t\t\tnew RegExp(\n\t\t\t\t\t`^${entry\n\t\t\t\t\t\t.split(\"*\")\n\t\t\t\t\t\t.map((part) => part.replace(/[.+?^${}()|[\\]\\\\]/g, \"\\\\$&\"))\n\t\t\t\t\t\t.join(\".*\")}$`,\n\t\t\t\t),\n\t\t\t);\n\t}\n\treturn (name) => names.has(name) || patterns.some((pattern) => pattern.test(name));\n}\n\nexport function isMcpToolName(name: string): boolean {\n\treturn (\n\t\tname.startsWith(\"mcp__\") ||\n\t\t[LIST_MCP_RESOURCES_TOOL, LIST_MCP_RESOURCE_TEMPLATES_TOOL, READ_MCP_RESOURCE_TOOL].includes(name)\n\t);\n}\n\ninterface ToolSelection {\n\t_allowedToolNames?: Set<string>;\n\t_allowedTools?: (name: string) => boolean;\n\t_excludedTools?: (name: string) => boolean;\n\t_subagentPolicy?: SubagentChildPolicy;\n}\n\nexport function isRegisteredToolAllowed(selection: ToolSelection, name: string): boolean {\n\tif (selection._excludedTools?.(name)) return false;\n\tif (\n\t\t(selection._subagentPolicy?.depth ?? 0) >= 1 &&\n\t\tselection._allowedTools &&\n\t\tisMcpToolName(name) &&\n\t\t!selection._allowedToolNames?.has(name)\n\t)\n\t\treturn false;\n\tif (!selection._allowedTools || selection._allowedTools(name)) return true;\n\tif ((selection._subagentPolicy?.depth ?? 0) >= 1) return false;\n\treturn (\n\t\t!!selection._allowedToolNames?.size &&\n\t\t![...selection._allowedToolNames].some((entry) => entry.startsWith(\"mcp__\")) &&\n\t\tisMcpToolName(name)\n\t);\n}\n\nexport function isToolActivatable(\n\tselection: ToolSelection,\n\tname: string,\n\texposure: string,\n\thasToolSearch: boolean,\n): boolean {\n\tif (!selection._allowedTools || selection._allowedTools(name) || !isMcpToolName(name)) return true;\n\tif ((selection._subagentPolicy?.depth ?? 0) >= 1) return true;\n\treturn exposure !== \"direct\" && exposure !== \"hidden\" && hasToolSearch;\n}\n\ninterface SelectedTools {\n\t_usesDefaultTools: boolean;\n\t_appliedDefaultTools: ReadonlySet<string>;\n\t_allowedToolNames?: ReadonlySet<string>;\n\t_initialActiveToolNames?: readonly string[];\n}\n\n/** Tool names the session's selection asked for, whether or not a tool with each name has registered yet. */\nexport function selectedToolNames(selection: SelectedTools): ReadonlySet<string> {\n\tif (selection._usesDefaultTools) return selection._appliedDefaultTools;\n\treturn new Set(selection._allowedToolNames ?? selection._initialActiveToolNames ?? []);\n}\n\n/**\n * Default-active tools activate whenever they register. An opt-in tool (`defaultActive: false`)\n * activates only on its first registration, and only when the selection names it, such as\n * `defaultTools: [\"+codemode\"]` whose extension loads after the session starts. A reload keeps\n * whatever activation the session has given an already registered opt-in tool since.\n */\nexport function activatesOnRegistration(\n\tselection: SelectedTools,\n\tname: string,\n\tdefinition: { exposure?: string; defaultActive?: boolean } | undefined,\n\talreadyRegistered: boolean,\n): boolean {\n\tconst exposure = definition?.exposure ?? \"direct\";\n\tif (exposure !== \"direct\" && exposure !== \"model-only\") return false;\n\tif (definition?.defaultActive !== false) return true;\n\treturn !alreadyRegistered && selectedToolNames(selection).has(name);\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ToolDefinition, ToolExposure } from "./extensions/tool-types.ts";
|
|
2
|
+
import { type SourceInfo } from "./source-info.ts";
|
|
3
|
+
export type ToolSelectionSource = "default-tools-setting" | "built-in-defaults" | "tools-allowlist" | "explicit-selection" | "no-built-in-tools" | "no-tools";
|
|
4
|
+
/** Where the session's starting tool selection came from and what it contained. */
|
|
5
|
+
export interface ToolSelectionStatus {
|
|
6
|
+
source: ToolSelectionSource;
|
|
7
|
+
/** Human-readable origin, for example `the defaultTools setting with +codemode`. */
|
|
8
|
+
description: string;
|
|
9
|
+
/** Tool names the selection asked for, in order. */
|
|
10
|
+
names: string[];
|
|
11
|
+
/** `+name`/`-name` entries applied on top of the defaults by the `tools` option or `--tools`. */
|
|
12
|
+
modifiers: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface ToolStatus {
|
|
15
|
+
name: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
exposure: ToolExposure;
|
|
18
|
+
/** Human-readable owner, for example `built-in`, `built-in extension "codemode"`, or `extension ./ext.ts`. */
|
|
19
|
+
source: string;
|
|
20
|
+
/** Raw source path: `<builtin:read>`, `builtin:codemode`, an extension file, or `<sdk:name>`. */
|
|
21
|
+
sourcePath: string | undefined;
|
|
22
|
+
/** First line of the tool description. */
|
|
23
|
+
summary: string;
|
|
24
|
+
/** Why the tool is not active and how to enable it. Absent for active tools. */
|
|
25
|
+
inactiveReason?: string;
|
|
26
|
+
}
|
|
27
|
+
/** A selected tool name with no registered tool behind it, and why. */
|
|
28
|
+
export interface UnavailableToolStatus {
|
|
29
|
+
name: string;
|
|
30
|
+
reason: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ToolStatusReport {
|
|
33
|
+
selection: ToolSelectionStatus;
|
|
34
|
+
/** Every registered tool: active ones first, then inactive ones, each group in registration order. */
|
|
35
|
+
tools: ToolStatus[];
|
|
36
|
+
/** Selected names that no built-in, extension, SDK custom tool, or MCP server registered. */
|
|
37
|
+
missing: UnavailableToolStatus[];
|
|
38
|
+
/** Selected names removed by an exclusion before they could register. */
|
|
39
|
+
excluded: UnavailableToolStatus[];
|
|
40
|
+
}
|
|
41
|
+
export interface ToolStatusInput {
|
|
42
|
+
tools: ReadonlyArray<{
|
|
43
|
+
definition: Pick<ToolDefinition, "name" | "description" | "exposure" | "namespace" | "defaultActive">;
|
|
44
|
+
sourceInfo?: SourceInfo;
|
|
45
|
+
}>;
|
|
46
|
+
activeToolNames: readonly string[];
|
|
47
|
+
selection: ToolSelectionStatus;
|
|
48
|
+
isExcluded?: (name: string) => boolean;
|
|
49
|
+
/** Present only when the session runs from an explicit tool allowlist. */
|
|
50
|
+
isAllowed?: (name: string) => boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function describeToolSelection(source: ToolSelectionSource, modifiers: readonly string[]): string;
|
|
53
|
+
export declare function buildToolStatusReport(input: ToolStatusInput): ToolStatusReport;
|
|
54
|
+
export interface ToolStatusFormatStyle {
|
|
55
|
+
heading(text: string): string;
|
|
56
|
+
dim(text: string): string;
|
|
57
|
+
warning(text: string): string;
|
|
58
|
+
}
|
|
59
|
+
/** Render a report as plain multi-line text; pass a style to add terminal colors. */
|
|
60
|
+
export declare function formatToolStatus(report: ToolStatusReport, style?: ToolStatusFormatStyle): string;
|
|
61
|
+
//# sourceMappingURL=tool-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AE,aAAa,CAAC;QACpB,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,eAAe,CAAC,CAAC;QACtG,UAAU,CAAC,EAAE,UAAU,CAAC;KACxB,CAAC,CAAC;IACH,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACtC;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAUvG;AAuFD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CA6B9E;AAED,MAAM,WAAW,qBAAqB;IACrC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAID,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,GAAE,qBAAkC,GAAG,MAAM,CAwB5G"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
import { BUILTIN_PATH_PREFIX } from "./source-info.js";
|
|
3
|
+
export function describeToolSelection(source, modifiers) {
|
|
4
|
+
const origin = {
|
|
5
|
+
"default-tools-setting": "the defaultTools setting",
|
|
6
|
+
"built-in-defaults": "Atomic's default tool set",
|
|
7
|
+
"tools-allowlist": "the --tools allowlist",
|
|
8
|
+
"explicit-selection": "the tools passed to the session",
|
|
9
|
+
"no-built-in-tools": "--no-builtin-tools",
|
|
10
|
+
"no-tools": "--no-tools",
|
|
11
|
+
}[source];
|
|
12
|
+
return modifiers.length > 0 ? `${origin} with ${modifiers.join(" ")}` : origin;
|
|
13
|
+
}
|
|
14
|
+
function describeSource(sourceInfo, namespace) {
|
|
15
|
+
const owner = (() => {
|
|
16
|
+
if (!sourceInfo)
|
|
17
|
+
return "unknown";
|
|
18
|
+
const { path, source, origin, configurationOrigin } = sourceInfo;
|
|
19
|
+
if (path.startsWith("<builtin:"))
|
|
20
|
+
return "built-in";
|
|
21
|
+
if (path.startsWith(BUILTIN_PATH_PREFIX))
|
|
22
|
+
return `built-in extension "${path.slice(BUILTIN_PATH_PREFIX.length)}"`;
|
|
23
|
+
if (source === "sdk")
|
|
24
|
+
return "SDK custom tool";
|
|
25
|
+
if (source === "inline")
|
|
26
|
+
return `inline extension ${path}`;
|
|
27
|
+
if (configurationOrigin === "bundled")
|
|
28
|
+
return `bundled package "${basename(source)}"`;
|
|
29
|
+
if (origin === "package")
|
|
30
|
+
return `package ${source}`;
|
|
31
|
+
return `extension ${path}`;
|
|
32
|
+
})();
|
|
33
|
+
return namespace ? `${owner}, namespace "${namespace}"` : owner;
|
|
34
|
+
}
|
|
35
|
+
const EXCLUDED_REASON = "excluded for this session by --exclude-tools, the excludedTools option, or a mode without user input";
|
|
36
|
+
function enableHint(name, selection) {
|
|
37
|
+
return selection.names.includes(name)
|
|
38
|
+
? `"${name}" is selected by ${selection.description} but was deactivated during this session`
|
|
39
|
+
: `add "+${name}" to defaultTools or --tools to enable it`;
|
|
40
|
+
}
|
|
41
|
+
function inactiveReason(tool, input, active) {
|
|
42
|
+
const { name, defaultActive } = tool.definition;
|
|
43
|
+
const exposure = tool.definition.exposure ?? "direct";
|
|
44
|
+
if (input.isExcluded?.(name))
|
|
45
|
+
return EXCLUDED_REASON;
|
|
46
|
+
if (input.isAllowed && !input.isAllowed(name))
|
|
47
|
+
return `not in the --tools allowlist; add "${name}" to it to enable it`;
|
|
48
|
+
if (exposure === "hidden")
|
|
49
|
+
return "hidden: never offered to the model";
|
|
50
|
+
if (exposure === "codemode") {
|
|
51
|
+
return active.has("codemode")
|
|
52
|
+
? "callable only from codemode scripts"
|
|
53
|
+
: `callable only from codemode scripts, and codemode is not active; ${enableHint("codemode", input.selection)}`;
|
|
54
|
+
}
|
|
55
|
+
if (exposure === "deferred") {
|
|
56
|
+
return active.has("tool_search")
|
|
57
|
+
? "deferred: the model activates it on demand through tool_search"
|
|
58
|
+
: `deferred until tool_search activates it, and tool_search is not active; ${enableHint("tool_search", input.selection)}`;
|
|
59
|
+
}
|
|
60
|
+
if (input.selection.names.includes(name)) {
|
|
61
|
+
return `selected by ${input.selection.description}, but deactivated during this session`;
|
|
62
|
+
}
|
|
63
|
+
if (defaultActive === false)
|
|
64
|
+
return `opt-in; ${enableHint(name, input.selection)}`;
|
|
65
|
+
if (tool.sourceInfo?.path.startsWith("<builtin:"))
|
|
66
|
+
return `not selected; ${enableHint(name, input.selection)}`;
|
|
67
|
+
return "deactivated during this session";
|
|
68
|
+
}
|
|
69
|
+
function normalizedName(name) {
|
|
70
|
+
return name.toLowerCase().replace(/[-_\s]/g, "");
|
|
71
|
+
}
|
|
72
|
+
function editDistance(left, right) {
|
|
73
|
+
let previous = Array.from({ length: right.length + 1 }, (_, index) => index);
|
|
74
|
+
for (let row = 1; row <= left.length; row++) {
|
|
75
|
+
const current = [row];
|
|
76
|
+
for (let column = 1; column <= right.length; column++) {
|
|
77
|
+
const substitution = previous[column - 1] + (left[row - 1] === right[column - 1] ? 0 : 1);
|
|
78
|
+
current.push(Math.min(previous[column] + 1, current[column - 1] + 1, substitution));
|
|
79
|
+
}
|
|
80
|
+
previous = current;
|
|
81
|
+
}
|
|
82
|
+
return previous[right.length];
|
|
83
|
+
}
|
|
84
|
+
function closestName(name, candidates) {
|
|
85
|
+
const target = normalizedName(name);
|
|
86
|
+
const ranked = candidates
|
|
87
|
+
.map((candidate) => ({ candidate, distance: editDistance(target, normalizedName(candidate)) }))
|
|
88
|
+
.filter(({ distance }) => distance <= Math.min(2, Math.floor(target.length / 3)))
|
|
89
|
+
.sort((left, right) => left.distance - right.distance);
|
|
90
|
+
return ranked[0]?.candidate;
|
|
91
|
+
}
|
|
92
|
+
function missingReason(name, selection, registered) {
|
|
93
|
+
const reason = `selected by ${selection.description}, but no built-in, extension, SDK custom tool, or MCP server has registered a tool named "${name}"`;
|
|
94
|
+
const suggestion = closestName(name, registered);
|
|
95
|
+
return suggestion ? `${reason}; did you mean "${suggestion}"?` : reason;
|
|
96
|
+
}
|
|
97
|
+
export function buildToolStatusReport(input) {
|
|
98
|
+
const active = new Set(input.activeToolNames);
|
|
99
|
+
const statuses = input.tools.map((tool) => {
|
|
100
|
+
const { name, description, namespace } = tool.definition;
|
|
101
|
+
const isActive = active.has(name);
|
|
102
|
+
return {
|
|
103
|
+
name,
|
|
104
|
+
active: isActive,
|
|
105
|
+
exposure: tool.definition.exposure ?? "direct",
|
|
106
|
+
source: describeSource(tool.sourceInfo, namespace?.name),
|
|
107
|
+
sourcePath: tool.sourceInfo?.path,
|
|
108
|
+
summary: description.split("\n")[0]?.trim() ?? "",
|
|
109
|
+
...(isActive ? {} : { inactiveReason: inactiveReason(tool, input, active) }),
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
const registered = input.tools.map((tool) => tool.definition.name);
|
|
113
|
+
const unregistered = [...new Set(input.selection.names)].filter((name) => !name.includes("*") && !registered.includes(name));
|
|
114
|
+
return {
|
|
115
|
+
selection: input.selection,
|
|
116
|
+
tools: [...statuses.filter((tool) => tool.active), ...statuses.filter((tool) => !tool.active)],
|
|
117
|
+
missing: unregistered
|
|
118
|
+
.filter((name) => !input.isExcluded?.(name))
|
|
119
|
+
.map((name) => ({ name, reason: missingReason(name, input.selection, registered) })),
|
|
120
|
+
excluded: unregistered
|
|
121
|
+
.filter((name) => input.isExcluded?.(name))
|
|
122
|
+
.map((name) => ({ name, reason: EXCLUDED_REASON })),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const plainStyle = { heading: (text) => text, dim: (text) => text, warning: (text) => text };
|
|
126
|
+
/** Render a report as plain multi-line text; pass a style to add terminal colors. */
|
|
127
|
+
export function formatToolStatus(report, style = plainStyle) {
|
|
128
|
+
const nameWidth = Math.max(0, ...report.tools.map((tool) => tool.name.length));
|
|
129
|
+
const exposureWidth = Math.max(0, ...report.tools.map((tool) => tool.exposure.length));
|
|
130
|
+
const row = (tool) => ` ${tool.name.padEnd(nameWidth)} ${style.dim(tool.exposure.padEnd(exposureWidth))} ${style.dim(tool.source)}`;
|
|
131
|
+
const lines = [`${style.heading("Tool selection:")} ${report.selection.description}`];
|
|
132
|
+
lines.push(` ${report.selection.names.length > 0 ? report.selection.names.join(", ") : style.dim("(empty)")}`);
|
|
133
|
+
const activeTools = report.tools.filter((tool) => tool.active);
|
|
134
|
+
const inactiveTools = report.tools.filter((tool) => !tool.active);
|
|
135
|
+
if (report.tools.length === 0)
|
|
136
|
+
lines.push("", style.dim("No tools are registered."));
|
|
137
|
+
if (activeTools.length > 0)
|
|
138
|
+
lines.push("", style.heading(`Active (${activeTools.length})`), ...activeTools.map(row));
|
|
139
|
+
if (inactiveTools.length > 0) {
|
|
140
|
+
lines.push("", style.heading(`Inactive (${inactiveTools.length})`));
|
|
141
|
+
for (const tool of inactiveTools)
|
|
142
|
+
lines.push(row(tool), ` ${style.dim(tool.inactiveReason ?? "")}`);
|
|
143
|
+
}
|
|
144
|
+
if (report.excluded.length > 0) {
|
|
145
|
+
lines.push("", style.heading(`Excluded (${report.excluded.length})`));
|
|
146
|
+
for (const tool of report.excluded)
|
|
147
|
+
lines.push(` ${tool.name}`, ` ${style.dim(tool.reason)}`);
|
|
148
|
+
}
|
|
149
|
+
if (report.missing.length > 0) {
|
|
150
|
+
lines.push("", style.warning(`Missing (${report.missing.length})`));
|
|
151
|
+
for (const tool of report.missing)
|
|
152
|
+
lines.push(` ${style.warning(tool.name)}`, ` ${style.dim(tool.reason)}`);
|
|
153
|
+
}
|
|
154
|
+
return lines.join("\n");
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=tool-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-status.js","sourceRoot":"","sources":["../../src/core/tool-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAmB,MAAM,kBAAkB,CAAC;AA+DxE,MAAM,UAAU,qBAAqB,CAAC,MAA2B,EAAE,SAA4B;IAC9F,MAAM,MAAM,GAAG;QACd,uBAAuB,EAAE,0BAA0B;QACnD,mBAAmB,EAAE,2BAA2B;QAChD,iBAAiB,EAAE,uBAAuB;QAC1C,oBAAoB,EAAE,iCAAiC;QACvD,mBAAmB,EAAE,oBAAoB;QACzC,UAAU,EAAE,YAAY;KACxB,CAAC,MAAM,CAAC,CAAC;IACV,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AAChF,CAAC;AAED,SAAS,cAAc,CAAC,UAAkC,EAAE,SAA6B;IACxF,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,UAAU;YAAE,OAAO,SAAS,CAAC;QAClC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,UAAU,CAAC;QACjE,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YAAE,OAAO,UAAU,CAAC;QACpD,IAAI,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;YAAE,OAAO,uBAAuB,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,CAAC;QAClH,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,iBAAiB,CAAC;QAC/C,IAAI,MAAM,KAAK,QAAQ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AAI,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACnG,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import { basename } from \"node:path\";\nimport type { ToolDefinition, ToolExposure } from \"./extensions/tool-types.ts\";\nimport { BUILTIN_PATH_PREFIX, type SourceInfo } from \"./source-info.ts\";\n\nexport type ToolSelectionSource =\n\t| \"default-tools-setting\"\n\t| \"built-in-defaults\"\n\t| \"tools-allowlist\"\n\t| \"explicit-selection\"\n\t| \"no-built-in-tools\"\n\t| \"no-tools\";\n\n/** Where the session's starting tool selection came from and what it contained. */\nexport interface ToolSelectionStatus {\n\tsource: ToolSelectionSource;\n\t/** Human-readable origin, for example `the defaultTools setting with +codemode`. */\n\tdescription: string;\n\t/** Tool names the selection asked for, in order. */\n\tnames: string[];\n\t/** `+name`/`-name` entries applied on top of the defaults by the `tools` option or `--tools`. */\n\tmodifiers: string[];\n}\n\nexport interface ToolStatus {\n\tname: string;\n\tactive: boolean;\n\texposure: ToolExposure;\n\t/** Human-readable owner, for example `built-in`, `built-in extension \"codemode\"`, or `extension ./ext.ts`. */\n\tsource: string;\n\t/** Raw source path: `<builtin:read>`, `builtin:codemode`, an extension file, or `<sdk:name>`. */\n\tsourcePath: string | undefined;\n\t/** First line of the tool description. */\n\tsummary: string;\n\t/** Why the tool is not active and how to enable it. Absent for active tools. */\n\tinactiveReason?: string;\n}\n\n/** A selected tool name with no registered tool behind it, and why. */\nexport interface UnavailableToolStatus {\n\tname: string;\n\treason: string;\n}\n\nexport interface ToolStatusReport {\n\tselection: ToolSelectionStatus;\n\t/** Every registered tool: active ones first, then inactive ones, each group in registration order. */\n\ttools: ToolStatus[];\n\t/** Selected names that no built-in, extension, SDK custom tool, or MCP server registered. */\n\tmissing: UnavailableToolStatus[];\n\t/** Selected names removed by an exclusion before they could register. */\n\texcluded: UnavailableToolStatus[];\n}\n\nexport interface ToolStatusInput {\n\ttools: ReadonlyArray<{\n\t\tdefinition: Pick<ToolDefinition, \"name\" | \"description\" | \"exposure\" | \"namespace\" | \"defaultActive\">;\n\t\tsourceInfo?: SourceInfo;\n\t}>;\n\tactiveToolNames: readonly string[];\n\tselection: ToolSelectionStatus;\n\tisExcluded?: (name: string) => boolean;\n\t/** Present only when the session runs from an explicit tool allowlist. */\n\tisAllowed?: (name: string) => boolean;\n}\n\nexport function describeToolSelection(source: ToolSelectionSource, modifiers: readonly string[]): string {\n\tconst origin = {\n\t\t\"default-tools-setting\": \"the defaultTools setting\",\n\t\t\"built-in-defaults\": \"Atomic's default tool set\",\n\t\t\"tools-allowlist\": \"the --tools allowlist\",\n\t\t\"explicit-selection\": \"the tools passed to the session\",\n\t\t\"no-built-in-tools\": \"--no-builtin-tools\",\n\t\t\"no-tools\": \"--no-tools\",\n\t}[source];\n\treturn modifiers.length > 0 ? `${origin} with ${modifiers.join(\" \")}` : origin;\n}\n\nfunction describeSource(sourceInfo: SourceInfo | undefined, namespace: string | undefined): string {\n\tconst owner = (() => {\n\t\tif (!sourceInfo) return \"unknown\";\n\t\tconst { path, source, origin, configurationOrigin } = sourceInfo;\n\t\tif (path.startsWith(\"<builtin:\")) return \"built-in\";\n\t\tif (path.startsWith(BUILTIN_PATH_PREFIX)) return `built-in extension \"${path.slice(BUILTIN_PATH_PREFIX.length)}\"`;\n\t\tif (source === \"sdk\") return \"SDK custom tool\";\n\t\tif (source === \"inline\") return `inline extension ${path}`;\n\t\tif (configurationOrigin === \"bundled\") return `bundled package \"${basename(source)}\"`;\n\t\tif (origin === \"package\") return `package ${source}`;\n\t\treturn `extension ${path}`;\n\t})();\n\treturn namespace ? `${owner}, namespace \"${namespace}\"` : owner;\n}\n\nconst EXCLUDED_REASON =\n\t\"excluded for this session by --exclude-tools, the excludedTools option, or a mode without user input\";\n\nfunction enableHint(name: string, selection: ToolSelectionStatus): string {\n\treturn selection.names.includes(name)\n\t\t? `\"${name}\" is selected by ${selection.description} but was deactivated during this session`\n\t\t: `add \"+${name}\" to defaultTools or --tools to enable it`;\n}\n\nfunction inactiveReason(\n\ttool: ToolStatusInput[\"tools\"][number],\n\tinput: ToolStatusInput,\n\tactive: ReadonlySet<string>,\n): string {\n\tconst { name, defaultActive } = tool.definition;\n\tconst exposure = tool.definition.exposure ?? \"direct\";\n\tif (input.isExcluded?.(name)) return EXCLUDED_REASON;\n\tif (input.isAllowed && !input.isAllowed(name))\n\t\treturn `not in the --tools allowlist; add \"${name}\" to it to enable it`;\n\tif (exposure === \"hidden\") return \"hidden: never offered to the model\";\n\tif (exposure === \"codemode\") {\n\t\treturn active.has(\"codemode\")\n\t\t\t? \"callable only from codemode scripts\"\n\t\t\t: `callable only from codemode scripts, and codemode is not active; ${enableHint(\"codemode\", input.selection)}`;\n\t}\n\tif (exposure === \"deferred\") {\n\t\treturn active.has(\"tool_search\")\n\t\t\t? \"deferred: the model activates it on demand through tool_search\"\n\t\t\t: `deferred until tool_search activates it, and tool_search is not active; ${enableHint(\"tool_search\", input.selection)}`;\n\t}\n\tif (input.selection.names.includes(name)) {\n\t\treturn `selected by ${input.selection.description}, but deactivated during this session`;\n\t}\n\tif (defaultActive === false) return `opt-in; ${enableHint(name, input.selection)}`;\n\tif (tool.sourceInfo?.path.startsWith(\"<builtin:\")) return `not selected; ${enableHint(name, input.selection)}`;\n\treturn \"deactivated during this session\";\n}\n\nfunction normalizedName(name: string): string {\n\treturn name.toLowerCase().replace(/[-_\\s]/g, \"\");\n}\n\nfunction editDistance(left: string, right: string): number {\n\tlet previous = Array.from({ length: right.length + 1 }, (_, index) => index);\n\tfor (let row = 1; row <= left.length; row++) {\n\t\tconst current = [row];\n\t\tfor (let column = 1; column <= right.length; column++) {\n\t\t\tconst substitution = previous[column - 1]! + (left[row - 1] === right[column - 1] ? 0 : 1);\n\t\t\tcurrent.push(Math.min(previous[column]! + 1, current[column - 1]! + 1, substitution));\n\t\t}\n\t\tprevious = current;\n\t}\n\treturn previous[right.length]!;\n}\n\nfunction closestName(name: string, candidates: readonly string[]): string | undefined {\n\tconst target = normalizedName(name);\n\tconst ranked = candidates\n\t\t.map((candidate) => ({ candidate, distance: editDistance(target, normalizedName(candidate)) }))\n\t\t.filter(({ distance }) => distance <= Math.min(2, Math.floor(target.length / 3)))\n\t\t.sort((left, right) => left.distance - right.distance);\n\treturn ranked[0]?.candidate;\n}\n\nfunction missingReason(name: string, selection: ToolSelectionStatus, registered: readonly string[]): string {\n\tconst reason = `selected by ${selection.description}, but no built-in, extension, SDK custom tool, or MCP server has registered a tool named \"${name}\"`;\n\tconst suggestion = closestName(name, registered);\n\treturn suggestion ? `${reason}; did you mean \"${suggestion}\"?` : reason;\n}\n\nexport function buildToolStatusReport(input: ToolStatusInput): ToolStatusReport {\n\tconst active = new Set(input.activeToolNames);\n\tconst statuses = input.tools.map((tool): ToolStatus => {\n\t\tconst { name, description, namespace } = tool.definition;\n\t\tconst isActive = active.has(name);\n\t\treturn {\n\t\t\tname,\n\t\t\tactive: isActive,\n\t\t\texposure: tool.definition.exposure ?? \"direct\",\n\t\t\tsource: describeSource(tool.sourceInfo, namespace?.name),\n\t\t\tsourcePath: tool.sourceInfo?.path,\n\t\t\tsummary: description.split(\"\\n\")[0]?.trim() ?? \"\",\n\t\t\t...(isActive ? {} : { inactiveReason: inactiveReason(tool, input, active) }),\n\t\t};\n\t});\n\tconst registered = input.tools.map((tool) => tool.definition.name);\n\tconst unregistered = [...new Set(input.selection.names)].filter(\n\t\t(name) => !name.includes(\"*\") && !registered.includes(name),\n\t);\n\treturn {\n\t\tselection: input.selection,\n\t\ttools: [...statuses.filter((tool) => tool.active), ...statuses.filter((tool) => !tool.active)],\n\t\tmissing: unregistered\n\t\t\t.filter((name) => !input.isExcluded?.(name))\n\t\t\t.map((name) => ({ name, reason: missingReason(name, input.selection, registered) })),\n\t\texcluded: unregistered\n\t\t\t.filter((name) => input.isExcluded?.(name))\n\t\t\t.map((name) => ({ name, reason: EXCLUDED_REASON })),\n\t};\n}\n\nexport interface ToolStatusFormatStyle {\n\theading(text: string): string;\n\tdim(text: string): string;\n\twarning(text: string): string;\n}\n\nconst plainStyle: ToolStatusFormatStyle = { heading: (text) => text, dim: (text) => text, warning: (text) => text };\n\n/** Render a report as plain multi-line text; pass a style to add terminal colors. */\nexport function formatToolStatus(report: ToolStatusReport, style: ToolStatusFormatStyle = plainStyle): string {\n\tconst nameWidth = Math.max(0, ...report.tools.map((tool) => tool.name.length));\n\tconst exposureWidth = Math.max(0, ...report.tools.map((tool) => tool.exposure.length));\n\tconst row = (tool: ToolStatus) =>\n\t\t` ${tool.name.padEnd(nameWidth)} ${style.dim(tool.exposure.padEnd(exposureWidth))} ${style.dim(tool.source)}`;\n\tconst lines = [`${style.heading(\"Tool selection:\")} ${report.selection.description}`];\n\tlines.push(` ${report.selection.names.length > 0 ? report.selection.names.join(\", \") : style.dim(\"(empty)\")}`);\n\tconst activeTools = report.tools.filter((tool) => tool.active);\n\tconst inactiveTools = report.tools.filter((tool) => !tool.active);\n\tif (report.tools.length === 0) lines.push(\"\", style.dim(\"No tools are registered.\"));\n\tif (activeTools.length > 0) lines.push(\"\", style.heading(`Active (${activeTools.length})`), ...activeTools.map(row));\n\tif (inactiveTools.length > 0) {\n\t\tlines.push(\"\", style.heading(`Inactive (${inactiveTools.length})`));\n\t\tfor (const tool of inactiveTools) lines.push(row(tool), ` ${style.dim(tool.inactiveReason ?? \"\")}`);\n\t}\n\tif (report.excluded.length > 0) {\n\t\tlines.push(\"\", style.heading(`Excluded (${report.excluded.length})`));\n\t\tfor (const tool of report.excluded) lines.push(` ${tool.name}`, ` ${style.dim(tool.reason)}`);\n\t}\n\tif (report.missing.length > 0) {\n\t\tlines.push(\"\", style.warning(`Missing (${report.missing.length})`));\n\t\tfor (const tool of report.missing) lines.push(` ${style.warning(tool.name)}`, ` ${style.dim(tool.reason)}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InlineExtension } from "../core/extensions/types.ts";
|
|
2
|
+
export declare const defaultBuiltinExtensions: readonly InlineExtension[];
|
|
3
|
+
export declare function withDefaultBuiltinExtensions(factories: readonly InlineExtension[]): InlineExtension[];
|
|
4
|
+
//# sourceMappingURL=default-builtins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-builtins.d.ts","sourceRoot":"","sources":["../../src/extensions/default-builtins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAKnE,eAAO,MAAM,wBAAwB,EAAE,SAAS,eAAe,EAI9D,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAIrG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import codemodeExtension from "./codemode/index.js";
|
|
2
|
+
import llamaExtension from "./llama/index.js";
|
|
3
|
+
import toolSearchExtension from "./tool-search/index.js";
|
|
4
|
+
export const defaultBuiltinExtensions = [
|
|
5
|
+
{ name: "llama.cpp", factory: llamaExtension, builtin: true, bundled: true },
|
|
6
|
+
{ name: "codemode", factory: codemodeExtension, builtin: true, replaceable: true, bundled: true },
|
|
7
|
+
{ name: "tool-search", factory: toolSearchExtension, builtin: true, replaceable: true, bundled: true },
|
|
8
|
+
];
|
|
9
|
+
export function withDefaultBuiltinExtensions(factories) {
|
|
10
|
+
const named = new Set(factories.flatMap((input) => (typeof input === "function" ? [] : [input.name])));
|
|
11
|
+
const missing = defaultBuiltinExtensions.filter((input) => typeof input === "function" || !named.has(input.name));
|
|
12
|
+
return [...factories, ...missing];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=default-builtins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-builtins.js","sourceRoot":"","sources":["../../src/extensions/default-builtins.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,MAAM,CAAC,MAAM,wBAAwB,GAA+B;IACnE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;IAC5E,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;IACjG,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;CACtG,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,SAAqC;IACjF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACvG,MAAM,OAAO,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,UAAU,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAClH,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import type { InlineExtension } from \"../core/extensions/types.ts\";\nimport codemodeExtension from \"./codemode/index.js\";\nimport llamaExtension from \"./llama/index.js\";\nimport toolSearchExtension from \"./tool-search/index.js\";\n\nexport const defaultBuiltinExtensions: readonly InlineExtension[] = [\n\t{ name: \"llama.cpp\", factory: llamaExtension, builtin: true, bundled: true },\n\t{ name: \"codemode\", factory: codemodeExtension, builtin: true, replaceable: true, bundled: true },\n\t{ name: \"tool-search\", factory: toolSearchExtension, builtin: true, replaceable: true, bundled: true },\n];\n\nexport function withDefaultBuiltinExtensions(factories: readonly InlineExtension[]): InlineExtension[] {\n\tconst named = new Set(factories.flatMap((input) => (typeof input === \"function\" ? [] : [input.name])));\n\tconst missing = defaultBuiltinExtensions.filter((input) => typeof input === \"function\" || !named.has(input.name));\n\treturn [...factories, ...missing];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAInE,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAG9C,CAAC"}
|
package/dist/extensions/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defaultBuiltinExtensions } from "./default-builtins.js";
|
|
2
2
|
import herdrExtension from "./herdr/index.js";
|
|
3
|
-
import llamaExtension from "./llama/index.js";
|
|
4
|
-
import toolSearchExtension from "./tool-search/index.js";
|
|
5
3
|
export const builtInExtensions = [
|
|
6
|
-
|
|
7
|
-
{ name: "codemode", factory: codemodeExtension, builtin: true, replaceable: true, bundled: true },
|
|
8
|
-
{ name: "tool-search", factory: toolSearchExtension, builtin: true, replaceable: true, bundled: true },
|
|
4
|
+
...defaultBuiltinExtensions,
|
|
9
5
|
{ name: "Herdr", factory: herdrExtension, hidden: true, bundled: true },
|
|
10
6
|
];
|
|
11
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IACnD,GAAG,wBAAwB;IAC3B,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;CACvE,CAAC","sourcesContent":["import type { InlineExtension } from \"../core/extensions/types.ts\";\nimport { defaultBuiltinExtensions } from \"./default-builtins.js\";\nimport herdrExtension from \"./herdr/index.js\";\n\nexport const builtInExtensions: InlineExtension[] = [\n\t...defaultBuiltinExtensions,\n\t{ name: \"Herdr\", factory: herdrExtension, hidden: true, bundled: true },\n];\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export { formatSkillsForPrompt, type LoadSkillsFromDirOptions, type LoadSkillsRe
|
|
|
65
65
|
export { createSyntheticSourceInfo } from "./core/source-info.ts";
|
|
66
66
|
export { generateStructuredOutput, type StructuredOutputRequest, type StructuredOutputResult, } from "./core/structured-output/index.js";
|
|
67
67
|
export type { NormalizedBuildSystemPromptOptions } from "./core/system-prompt.ts";
|
|
68
|
+
export { formatToolStatus, type ToolSelectionSource, type ToolSelectionStatus, type ToolStatus, type ToolStatusFormatStyle, type ToolStatusReport, type UnavailableToolStatus, } from "./core/tool-status.js";
|
|
68
69
|
export { type EditDiffResult, generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.ts";
|
|
69
70
|
export { BASH_SHELL_PRESENTATION, type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, bashToolSystemPromptContribution, createAskUserQuestionToolDefinition, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createKillTool, createKillToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createSearchToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, editToolSystemPromptContribution, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, findToolSystemPromptContribution, formatSize, type KillToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, lsToolSystemPromptContribution, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, readToolSystemPromptContribution, type SearchToolDetails, type SearchToolInput, type SearchToolOptions, type ShellToolPresentation, searchToolSystemPromptContribution, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteFileOptions, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, writeToolSystemPromptContribution, } from "./core/tools/index.js";
|
|
70
71
|
export { hasProjectTrustInputs, hasTrustRequiringProjectResources, type ProjectTrustDecision, ProjectTrustStore, type ProjectTrustStoreEntry, type ProjectTrustUpdate, TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES, } from "./core/trust-manager.ts";
|