@f5-sales-demo/xcsh 21.39.0 → 21.40.0
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/package.json +8 -8
- package/src/extensibility/extensions/loader.ts +2 -0
- package/src/extensibility/extensions/runner.ts +30 -2
- package/src/internal-urls/build-info.generated.ts +8 -8
- package/src/internal-urls/docs-index.generated.ts +1 -1
- package/src/modes/components/plugins/plugin-dashboard.ts +22 -6
- package/src/modes/components/question-transcript.ts +133 -0
- package/src/modes/components/request-user-input.ts +82 -34
- package/src/modes/controllers/event-controller.ts +23 -2
- package/src/modes/controllers/selector-controller.ts +11 -3
- package/src/modes/interactive-mode.ts +5 -4
- package/src/modes/types.ts +1 -1
- package/src/modes/utils/ui-helpers.ts +35 -0
- package/src/session/agent-session.ts +28 -1
- package/src/slash-commands/builtin-registry.ts +8 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@f5-sales-demo/xcsh",
|
|
4
|
-
"version": "21.
|
|
4
|
+
"version": "21.40.0",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://github.com/f5-sales-demo/xcsh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
67
|
-
"@f5-sales-demo/pi-agent-core": "21.
|
|
68
|
-
"@f5-sales-demo/pi-ai": "21.
|
|
69
|
-
"@f5-sales-demo/pi-natives": "21.
|
|
70
|
-
"@f5-sales-demo/pi-resource-management": "21.
|
|
71
|
-
"@f5-sales-demo/pi-tui": "21.
|
|
72
|
-
"@f5-sales-demo/pi-utils": "21.
|
|
73
|
-
"@f5-sales-demo/xcsh-stats": "21.
|
|
67
|
+
"@f5-sales-demo/pi-agent-core": "21.40.0",
|
|
68
|
+
"@f5-sales-demo/pi-ai": "21.40.0",
|
|
69
|
+
"@f5-sales-demo/pi-natives": "21.40.0",
|
|
70
|
+
"@f5-sales-demo/pi-resource-management": "21.40.0",
|
|
71
|
+
"@f5-sales-demo/pi-tui": "21.40.0",
|
|
72
|
+
"@f5-sales-demo/pi-utils": "21.40.0",
|
|
73
|
+
"@f5-sales-demo/xcsh-stats": "21.40.0",
|
|
74
74
|
"@mozilla/readability": "^0.6",
|
|
75
75
|
"@sinclair/typebox": "0.34.52",
|
|
76
76
|
"@tobilu/qmd": "2.8.3",
|
|
@@ -388,6 +388,8 @@ async function loadExtension(
|
|
|
388
388
|
|
|
389
389
|
return { extension, error: null };
|
|
390
390
|
} catch (err) {
|
|
391
|
+
integrationRegistry.unregisterOwner(resolvedPath);
|
|
392
|
+
personProfileService.unregisterProfileCollectorsByRegistrant(resolvedPath);
|
|
391
393
|
const message = err instanceof Error ? err.message : String(err);
|
|
392
394
|
return { extension: null, error: `Failed to load extension: ${message}` };
|
|
393
395
|
}
|
|
@@ -6,8 +6,10 @@ import type { ImageContent, Model } from "@f5-sales-demo/pi-ai";
|
|
|
6
6
|
import type { KeyId } from "@f5-sales-demo/pi-tui";
|
|
7
7
|
import { logger } from "@f5-sales-demo/pi-utils";
|
|
8
8
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
9
|
+
import { integrationRegistry } from "../../integrations/registry";
|
|
9
10
|
import type { IntegrationHandle } from "../../integrations/types";
|
|
10
11
|
import { type Theme, theme } from "../../modes/theme/theme";
|
|
12
|
+
import { personProfileService } from "../../person-profile/service";
|
|
11
13
|
import type { SessionManager } from "../../session/session-manager";
|
|
12
14
|
import type {
|
|
13
15
|
BeforeAgentStartEvent,
|
|
@@ -188,10 +190,18 @@ export class ExtensionRunner {
|
|
|
188
190
|
#shutdownHandler: ShutdownHandler = () => {};
|
|
189
191
|
#commandDiagnostics: Array<{ type: string; message: string; path: string }> = [];
|
|
190
192
|
#advisoriesByOwner = new Map<string, Map<string, RegisteredToolAdvisory>>();
|
|
193
|
+
#initialization:
|
|
194
|
+
| {
|
|
195
|
+
actions: ExtensionActions;
|
|
196
|
+
contextActions: ExtensionContextActions;
|
|
197
|
+
commandContextActions?: ExtensionCommandContextActions;
|
|
198
|
+
uiContext?: ExtensionUIContext;
|
|
199
|
+
}
|
|
200
|
+
| undefined;
|
|
191
201
|
|
|
192
202
|
constructor(
|
|
193
|
-
private
|
|
194
|
-
private
|
|
203
|
+
private extensions: Extension[],
|
|
204
|
+
private runtime: ExtensionRuntime,
|
|
195
205
|
private readonly cwd: string,
|
|
196
206
|
private readonly sessionManager: SessionManager,
|
|
197
207
|
private readonly modelRegistry: ModelRegistry,
|
|
@@ -207,6 +217,7 @@ export class ExtensionRunner {
|
|
|
207
217
|
commandContextActions?: ExtensionCommandContextActions,
|
|
208
218
|
uiContext?: ExtensionUIContext,
|
|
209
219
|
): void {
|
|
220
|
+
this.#initialization = { actions, contextActions, commandContextActions, uiContext };
|
|
210
221
|
// Copy actions into the shared runtime (all extension APIs reference this)
|
|
211
222
|
this.runtime.sendMessage = actions.sendMessage;
|
|
212
223
|
this.runtime.sendUserMessage = actions.sendUserMessage;
|
|
@@ -244,6 +255,23 @@ export class ExtensionRunner {
|
|
|
244
255
|
this.#uiContext = uiContext ?? noOpUIContext;
|
|
245
256
|
}
|
|
246
257
|
|
|
258
|
+
/** Replace every registration surface after marketplace state changes. */
|
|
259
|
+
reloadExtensions(extensions: readonly Extension[], runtime: ExtensionRuntime): void {
|
|
260
|
+
const activeOwners = new Set(extensions.map(extension => extension.resolvedPath));
|
|
261
|
+
for (const extension of this.extensions) {
|
|
262
|
+
if (activeOwners.has(extension.resolvedPath)) continue;
|
|
263
|
+
integrationRegistry.unregisterOwner(extension.resolvedPath);
|
|
264
|
+
personProfileService.unregisterProfileCollectorsByRegistrant(extension.resolvedPath);
|
|
265
|
+
}
|
|
266
|
+
this.extensions = [...extensions];
|
|
267
|
+
this.runtime = runtime;
|
|
268
|
+
this.reloadAdvisories(extensions);
|
|
269
|
+
if (this.#initialization) {
|
|
270
|
+
const { actions, contextActions, commandContextActions, uiContext } = this.#initialization;
|
|
271
|
+
this.initialize(actions, contextActions, commandContextActions, uiContext);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
247
275
|
getUIContext(): ExtensionUIContext {
|
|
248
276
|
return this.#uiContext;
|
|
249
277
|
}
|
|
@@ -17,17 +17,17 @@ export interface BuildInfo {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const BUILD_INFO: BuildInfo = {
|
|
20
|
-
"version": "21.
|
|
21
|
-
"commit": "
|
|
22
|
-
"shortCommit": "
|
|
20
|
+
"version": "21.40.0",
|
|
21
|
+
"commit": "7a20b23290f9eec1025c8f8e73a6ef6f4231c439",
|
|
22
|
+
"shortCommit": "7a20b23",
|
|
23
23
|
"branch": "main",
|
|
24
|
-
"tag": "v21.
|
|
25
|
-
"commitDate": "2026-09-
|
|
26
|
-
"buildDate": "2026-09-
|
|
24
|
+
"tag": "v21.40.0",
|
|
25
|
+
"commitDate": "2026-09-23T03:40:13+00:00",
|
|
26
|
+
"buildDate": "2026-09-23T05:05:34.811Z",
|
|
27
27
|
"dirty": true,
|
|
28
28
|
"prNumber": "",
|
|
29
29
|
"repoUrl": "https://github.com/f5-sales-demo/xcsh",
|
|
30
30
|
"repoSlug": "f5-sales-demo/xcsh",
|
|
31
|
-
"commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/
|
|
32
|
-
"releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.
|
|
31
|
+
"commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/7a20b23290f9eec1025c8f8e73a6ef6f4231c439",
|
|
32
|
+
"releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.40.0"
|
|
33
33
|
};
|
|
@@ -15,7 +15,7 @@ export const EMBEDDED_DOCS: Readonly<Record<string, string>> = {
|
|
|
15
15
|
"en/architecture-contribution/storage-artifacts.mdx": "---\ntitle: \"Storage, blobs, and artifacts\"\ndescription: \"Trace configuration roots, session JSONL, binary blobs, text artifacts, scan caches, and move semantics.\"\nsidebar:\n order: 2\n label: \"Storage and artifacts\"\n---\n\nxcsh separates append-only conversation state from large or generated payloads. Session JSON Lines (JSONL) preserves the event graph; blob and artifact stores keep bulky data addressable without inflating every session entry.\n\n## How are stored values allocated and resolved?\n\nStorage helpers choose user or project roots, allocate collision-resistant identifiers, and record names separately from content addresses. Text artifacts remain inspectable; binary blobs are externalized and referenced by uniform resource locator (URL)-like identifiers. URL handlers validate the scheme and authority before opening the backing object.\n\n## How do resume, fork, and move treat state?\n\nResume rebuilds context from the selected session leaf. Forking creates a new branch without rewriting the source branch. Moves must update the session reference and its dependent stored values as one operation or leave the original valid; partial copies are not a successful move.\n\n## How is filesystem discovery cached?\n\nThe scan cache partitions keys by root and discovery options, evicts by freshness policy, and uses a short empty-result recheck so a newly created configuration file is noticed. Mutating code owns invalidation. A new consumer must define its cache key, freshness need, and invalidation points explicitly.\n\nRead `packages/coding-agent/src/session` for the append-only event graph and `packages/coding-agent/src/discovery` for the scan cache.\n\nTreat a session reference as durable only after its referenced artifact is readable. A failed move\nor fork must leave the original graph usable and must not publish a half-written destination. To\nverify a storage change, create a session with a text artifact and a binary blob, resume its leaf,\nfork it, and confirm that both branches resolve their own references. Remove only the temporary test\nroot after those reads succeed.\n",
|
|
16
16
|
"en/architecture-contribution/tool-runtime.mdx": "---\ntitle: \"Tool runtime\"\ndescription: \"Trace Bash, notebook, deferred-action, custom-tool, context, and task-agent execution boundaries.\"\nsidebar:\n order: 3\n label: \"Tool runtime\"\n---\n\nThe agent loop sees a common tool contract, but each runtime owns its validation, cancellation, output, and side effects.\n\n## How do shell and notebook work execute?\n\nThe Bash tool validates the request, launches through the configured shell boundary, streams bounded output, and spills oversized results to an artifact. Notebook editing changes cell structure; kernel execution is a separate Python gateway operation with its own environment and Multipurpose Internet Mail Extensions (MIME) rendering.\n\n## How are deferred actions resolved?\n\nDeferred actions are pushed onto a last-in, first-out stack and resolved only at the runtime checkpoint that owns them. Custom tools use the host application programming interface (API) to register actions; they must pair cancellation and cleanup with any external resource they create.\n\n## How are commands and task agents discovered?\n\nSlash-command templates and agent definitions are discovered from normalized user, project, plugin, and bundled providers. Precedence resolves duplicate identifiers before execution. Argument expansion produces prompt input; it must not bypass tool policy or agent execution guardrails.\n\nRead `packages/coding-agent/src/tools/bash.ts` for the shell boundary, `packages/coding-agent/src/tools/notebook.ts` for cell editing, and `packages/coding-agent/src/slash-commands/builtin-registry.ts` for command discovery.\n\nTool completion has three independent outcomes: the process or handler settles, bounded output is\nstored, and the agent loop receives a normalized result. Cancellation must settle all three without\na second completion. Test successful output, nonzero exit, oversized output, cancellation, and\ncleanup. Any tool that writes files, starts a process, or calls a service owns that side effect; the\nrenderer only displays the recorded request and result.\n",
|
|
17
17
|
"en/architecture-contribution/tui-runtime.mdx": "---\ntitle: \"TUI runtime\"\ndescription: \"Trace component contracts, differential rendering, terminal input, modal UI, and custom tool renderers.\"\nsidebar:\n order: 8\n label: \"TUI runtime\"\n---\n\nThe terminal user interface (TUI) renders session and runtime state through components. Components return terminal cells and semantic styles; the renderer computes a differential update instead of repainting unrelated rows.\n\n## How are input and rendering routed?\n\nTerminal decoding turns bytes and escape sequences into key events. Focused overlays receive input before the prompt editor and global actions. State changes schedule a render, layout produces the next frame, and the diff layer emits only changed terminal regions.\n\n## How do I extend interactive surfaces?\n\nExtensions can open a modal through `ctx.ui.custom` only when an interactive UI host exists. Custom tools may provide renderers for calls and results while preserving a plain-text representation for headless clients. A renderer must not become the only copy of durable tool output.\n\nRead `packages/tui/src` for the component and rendering contracts, and `packages/coding-agent/src/tui` for the session-aware components built on them.\n\nUse the [TUI interaction style guide](/xcsh/en/architecture-contribution/tui-style-guide/) when adding a selector or manager. It\ndefines the shared frame, responsive density, search and escape behavior, plain-text state semantics,\nand asynchronous feedback expected from interactive surfaces.\n\n## How are development native prerequisites kept current?\n\n`bun run dev`, `bun run test:ts`, and the coding-agent package's `bun run test` prepare the\nsource-matched native addon automatically. The bootstrap checks a fingerprint of native sources,\nbuild inputs, and the host binary, then validates all runtime exports declared by the generated\nbindings in a fresh subprocess. Changed sources, missing artifacts, or incompatible bindings trigger\na build; readiness is recorded only after the rebuilt addon passes another fresh-process check.\nAn unchanged, verified checkout does not rebuild on every invocation.\n\nFor direct `bun test <file>` or direct source CLI invocation, first run\n`bun scripts/ensure-dev-native.ts`. Bare `bun test` does not run package lifecycle scripts.\nDo not patch a JavaScript stub to add `PowerAssertion` or another missing export: the source and\nnative addon must match. A failed bootstrap reports the build or compatibility error and exits\nnonzero; follow the Rust/Zig prerequisites in `DEVELOPING.md`. Development checks require a host\nbuild, so unset cross-compilation targets before running them.\n\nValidate visual changes in a real pseudo-terminal at narrow and wide widths, in light and dark\nthemes, and with keyboard focus visible. A component must clip or wrap to the width it receives,\nrestore terminal modes after failure, and expose the same durable result to headless clients. When\nan overlay closes, focus returns to the prior owner; when the terminal disconnects, cleanup must\nremain safe to run again.\n",
|
|
18
|
-
"en/architecture-contribution/tui-style-guide.mdx": "---\ntitle: \"TUI interaction style guide\"\ndescription: \"Build predictable selectors with shared structure, navigation, semantics, and feedback.\"\nsidebar:\n order: 9\n label: \"TUI interaction style\"\nhead:\n - tag: style\n content: |\n .sl-markdown-content .expressive-code { max-width: 100%; overflow-x: auto; }\n .sl-markdown-content table { display: block; max-width: 100%; overflow-x: auto; }\n---\n\nUse this guide for interactive terminal user interface (TUI) selectors and managers. It defines a\nshared interaction contract and adaptable presentation defaults. It does not require unrelated\nscreens to be redesigned in the same change.\n\n## What flow should an interactive manager use?\n\nPrefer one stable, single-column flow:\n\n```text\nbrowse → inspect → choose an explicitly labeled action → see its outcome\n```\n\nGive the frame a clear title. Add a purpose only when the title and choices do not explain the task.\nKeep navigation in a stable position, make the choices searchable, summarize the selected choice\nbriefly, and show contextual keyboard hints.\nPut long descriptions and secondary metadata in a detail view rather than beside the list.\n\nThe `/login` provider list follows this pattern by opening connection management before changing a\nsaved connection. `/model` separates model selection from scope and reasoning choices. `/plugin`\nuses the same pattern for install, update, enable, disable, and removal actions.\n\n## How should a selector look?\n\nUse `selectorFrame` and its adaptive gutters. The shared frame provides rounded Unicode borders,\nan ASCII fallback, joined section dividers, and a maximum width of 100 columns. Keep every rendered\nrow the same width so selection highlighting reaches both inside edges without breaking the border.\n\nUse two spaces between aligned columns. Keep headings subdued and reserve emphasis for selection,\nstate, and outcomes. Color may reinforce meaning, but plain text must carry it:\n\n```text\nPlugin Status Scope\n› source-control Enabled project\n observability Update 2.1.0 user\n cloud-tools Available —\n```\n\nAt narrow widths, keep the name in the row and move status, scope, version, and other secondary\ncolumns into the selected summary. Remove optional blank rows before hiding choices, controls, or\nselected information.\n\n## How should input and navigation behave?\n\nTreat familiar terminal conventions as the default interaction vocabulary. Avoid \"captain obvious\"\nindicators: instructions that merely repeat what a recognizable control already communicates.\nMake the layout self-descriptive before adding instructional copy. Removing a hint is appropriate\nonly when the control, its state, and its outcome remain discoverable.\n\nThe following manifest defines the expectations xcsh should consistently support. These are design\ncommitments for this interface, not a claim that every person has identical experience. Preserve\naccessible labels and provide help for unfamiliar or remapped controls.\n\n| Visible situation | Expected human intuition | Interface commitment | Hint policy |\n| --- | --- | --- | --- |\n| A highlighted menu item | Arrows move selection; Enter opens or activates it. | Show one clear selection and make the label predict the result. | Omit `Up/Down: navigate` and `Enter: choose action`. |\n| An item naming a plugin, provider, or other object | Opening it reveals information or choices about that object. | Open details before a management mutation. | Let the object label and detail title explain the transition. |\n| An action naming a verb and target | Activating it performs that named action or opens its clearly labeled review. | Use `Disable plugin`, `Review installation`, or `Remove from project scope`; avoid ambiguous `Select` or `Continue`. | Explain consequences or scope when they affect the decision, not how to press Enter. |\n| A search field | Typing searches; normal editing and paste work. | Keep search visibly associated with its list and preserve editor behavior. | Use a field label; omit `Type to search` when the field already says Search. |\n| A nested menu | Escape returns to the parent. | Return one level and retain the parent's query and selection. | A compact `Esc: back` can clarify the hierarchy; never advertise Ctrl+C as Back. |\n| An active search in a list | Escape clears the search before leaving the list. | Clear the query on the first Escape, then return on the next. | Show `Esc: clear search` only while a query exists. |\n| Section tabs | Changing sections preserves a stable navigation structure. | Keep tab order and selected section visible; use Tab and Shift+Tab consistently here. | A compact section-switching hint is useful because Tab behavior varies between interfaces. |\n| Content longer than the viewport | Navigation reveals the remaining content. | Use available space first; keep selection visible and make all details reachable. | Show paging controls only during overflow, especially when arrows move actions instead of details. |\n| A destructive confirmation | Cancel is safe; the destructive choice names the effect. | Select Cancel initially and show the exact target and scope. | Keep consequence text; omit instructions to select a choice. |\n| An operation underway | Work is proceeding, and another activation should not duplicate it. | Show progress, prevent duplicate submission, and report whether interruption is supported. | Reserve Ctrl+C for interruption; never imply cancellation unless work actually stopped. |\n| An operation completes or fails | The state reflects the outcome and recovery is apparent. | Update the affected item; keep failure context and a usable retry path. | Report the result and any remaining work, not `Action selected` or `Press Enter to continue`. |\n\nUse the shared `Input` component for search. Forward ordinary input to it so spaces, Unicode,\nbracketed paste, cursor movement, deletion, undo, and configured editor bindings work together.\nDo not reserve printable letters as hidden actions while search is active.\n\n- Typing edits the active search; Up and Down move through the filtered choices.\n- Enter inspects a choice, or activates the action whose label is visibly selected.\n- Escape returns one level. In a list it clears an active search before closing the selector.\n- Ctrl+C is reserved for interruption; it must not act as Back or close a menu.\n\nFirst-party extension select/input dialogs use the shared frame and editable input. Selection search\naccepts printable letters; Tab/Shift+Tab changes supplied sections while arrows edit search. Escape\nclears search before closing. Selection timeout closes without activating an option; explicit caller\ntimeout policies remain separate. Confirmation starts on No, and plan approval starts on Stay in plan\nmode. Callback signatures and return types are unchanged.\n\nChoosing `Approve and execute` is an action request, not final consent. Follow it with one Cancel-first\nreview that names the planning session, new execution-session destination, draft and finalized plan\npaths, restored tool scope, prompt submission, and execution consequences. Revalidate plan bytes,\nsession identity, and destination before committing. Extension veto happens before old-session mutation;\npartial session persistence retries the same identity. Do not open a nested `/new` review or continue\nexecution when any approval review is cancelled.\n\nA typed `/plan <prompt>` uses the same review and lifecycle adapters. When planning is already active,\nreview the prompt without toggling or pausing the mode; persist outstanding session state before\nqueueing it, then distinguish queued/model-pending from completion. If an enable save is unresolved,\nshow prompt replacement as old→new. If a pause save is unresolved, review the combined recovery,\npersist the pause, re-enable and persist plan mode, and only then queue the prompt. Never silently drop\nan argument because a prior mode transition is awaiting persistence.\n\nThe application and standalone editor now default `app.interrupt` to Ctrl+C. Idle Ctrl+C retains\ndraft clearing, while double-Escape navigation remains separate from execution. Existing explicit\ninterrupt remaps (including disabled bindings) are respected; there is no configuration migration.\nActive-work hints must display the configured key, not hardcode Escape. Cooperative actions receive\nan abort signal, but an interrupt request alone does not establish cancellation: keep the operation\nvisible until it acknowledges interruption or completes. Normal completion after an interrupt request\nis still success. Unaccounted-for partial failures remain unresolved rather than being labelled cancelled.\n\n- Tab and Shift+Tab move through stable categories when a manager has categories.\n- Page Up and Page Down make long detail content reachable.\n\nHints should explain non-obvious controls, not narrate familiar interaction. Omit `Enter: choose\naction`, `Up/Down: navigate`, and purpose text such as `Browse, inspect, choose an action, and review\nits outcome`. Keep compact hints for section switching, refresh or retry, and the Escape hierarchy.\nShow a paging hint only when content actually exceeds the available space; use the terminal's\navailable height before introducing scrolling. A short detail view needs no scroll instructions.\n\nDocument an exception beside the component when its task genuinely requires different behavior.\nRemapped selector bindings must continue to work; do not hardcode only one escape sequence.\n\nReview each proposed hint against three questions: does it reveal a control that is otherwise\nundiscoverable, explain an exception to these conventions, or clarify a consequence or recovery\nstep? If none applies, remove it. If a conventional interaction needs a paragraph of instructions,\nfirst repair the label, grouping, focus, or navigation behavior. Do not use explanatory copy to\ncompensate for an inconsistent menu.\n\nRead the screen without its keyboard footer. Its title should identify the current task or object;\nhighlighting should identify the active choice; action labels should identify what happens next;\ngrouping should distinguish navigation, actions, facts, and outcomes. Use the same words and order\nfor the same concepts across screens. Keep the affected object identifiable after an operation,\nand explain a change of section when an item moves out of the current list.\n\n## Which states must the copy distinguish?\n\nAvailability, installation, enabled state, scope, and update availability are separate facts. Use\nspecific phrases such as `Available`, `Installed · Disabled`, `project scope`, and\n`Update 2.1.0`. Avoid unexplained symbols and avoid treating an item that exists in a catalog as an\ninstalled or enabled item.\n\nFeedback also needs distinct language and styling:\n\n| State | Copy pattern | Required next step |\n| --- | --- | --- |\n| Loading | `Refreshing plugin catalogs…` | Keep navigation and cached data visible. |\n| Progress | `Installation in progress…` | Prevent duplicate submission. |\n| Success | `Installation completed.` | Show the updated state. |\n| Warning | `Installed 2 of 3 plugins. 1 failed.` | Name remaining work. |\n| Failure | `Refresh failed: catalog unavailable.` | Offer Retry and retain context. |\n| Empty | `No plugins match “trace”.` | Explain how to clear or broaden the search. |\n\nClosing a view does not mean an asynchronous operation was cancelled. Ignore stale completions from\nsuperseded refreshes, keep retry context after failure, and describe continuing work accurately.\n\nDialog creation and teardown are part of this lifecycle contract. A synchronous factory exception,\nrejected asynchronous factory, or failed presentation must settle the caller with an error and\nrelease duplicate-operation guards. Do not replace the draft before a component is ready. Attempt\nremaining cleanup even if one disposal step fails, and report that failure rather than leaving a\nhidden command pending. These internal safeguards must preserve extension callback signatures.\n\n## How do confirmation and review screens work?\n\nEnter from a browse list opens details; it must not install, remove, or toggle the selected item.\nDetails list only actions backed by a persistent manager operation.\n\nInstallation review identifies the source, destination scope, and declared prerequisites before an\ninstall action is available. Removal confirmation starts on `Cancel removal`, not on the destructive\nchoice. A bulk action is a visible row such as `Review recommended setup…`; its review lists every\naffected plugin, the destination scope, prerequisite commands, and partial failures.\n\nClipboard reviews identify the source and replacement effect without reading existing clipboard data.\nExplain that clipboard-history services may retain the text. Wait for the backing copy operation;\nan OSC 52 terminal request has no delivery acknowledgement and must be described as unverified,\nnot as a confirmed copy. On Linux without a clipboard manager, clipboard text may disappear when\nxcsh exits. `/dump`, typed `/copy` subcommands and transcript-selector picks share this review\nand feedback adapter. Other clipboard surfaces must adopt it before candidate acceptance.\n\n## What should reviewers check?\n\n- The title, purpose, choices, selected summary, and controls remain understandable without color.\n- With keyboard hints hidden, the task, selection, action consequences, and current state are clear.\n- Every remaining hint reveals a non-obvious control, an exception, a consequence, or recovery;\n none merely narrates Enter, arrows, selection, or an already labeled search field.\n- The intuition manifest holds across parent and child menus: consistent labels, stable focus,\n Escape hierarchy, retained context, and feedback tied to the affected object.\n- Scrolling hints disappear when content fits; Ctrl+C never substitutes for Back.\n- The frame is continuous in Unicode and ASCII, each row has equal width, and highlighting stays\n inside both borders.\n- Width never exceeds 100 columns; 60×20 still keeps the selected choice and recovery controls.\n- Search handles spaces, Unicode, paste, cursor edits, and no-match results.\n- Enter opens details before mutation; destructive confirmation starts on Cancel.\n- Selection uses the full stable identity, including source, identifier, and scope.\n- Empty, loading, progress, success, warning, failure, retry, and partial failure are\n distinguishable.\n- Refresh and resize retain tab, query, selection, and available data.\n- Duplicate operations and stale asynchronous updates cannot produce a second or misleading outcome.\n- Long details remain reachable and exceptions to the shared contract are documented.\n\n## Where should the guide be adopted next?\n\nUse focused improvement passes rather than a repository-wide redesign:\n\n1. Keep `/login`, `/model`, and `/plugin` as the reference implementations and regression baseline.\n2. Move settings and extension management to the shared frame and escape hierarchy.\n3. Align session, tree, and agent dashboards where they contain inspectable choices and actions.\n4. Review one-off confirmation and input dialogs for explicit labels, outcome feedback, and narrow\n terminal behavior.\n5. Document intentional exceptions after usability evidence shows the shared contract is unsuitable.\n\n## What did the slash-command library review identify?\n\nThis inventory covers every built-in entry in `src/slash-commands/builtin-registry.ts`, its\nregistered subcommands, and the extension-command discovery surfaces. The coverage regression\nrequires new built-ins to receive an entry here. It is a source review, not a claim that every\ncommand has received live visual acceptance. Do not exercise cloud mutations, credential removal,\npublication, or session deletion merely to review presentation; use isolated fixtures.\n\nPriorities: P0 protects consequential actions and truthful outcomes; P1 improves everyday navigation;\nP2 improves discovery and presentation. “Next” means proposed work, not completed adoption.\n\n| Command | Surface and enhancement opportunity | Priority / adoption |\n| --- | --- | --- |\n| `/settings` | Tabbed settings and nested editors: shared Escape default and concise hints applied; next, shared frame, retained submenu context, and saved-value feedback. | P1 / partial |\n| `/questions` | Opens pending asynchronous questions through the shared session interaction owner. | Focused interaction tests pass; actual terminal qualification is outstanding. |\n| `/plan` | Enable, pause, typed prompts, and approval use session-qualified Cancel-first review, fresh plan and destination validation, veto-before-mutation, same-identity save retry, and truthful queued or completed outcomes. | Focused tests and the 16-variant terminal matrix pass. |\n| `/model` | Browse with stable tabs, editable search, exact identity, explicit scope, and reasoning steps. Mutations use Cancel-first review, fresh catalog resolution, persistence-before-success, and exact no-op handling; `/models` shares this path. | Focused tests and the 16-variant terminal matrix pass. |\n| `/fast` | Offer Cancel, Enable, and Disable. Typed `on`, `off`, and `toggle` use the same session-scoped review; `status` is read-only. Persist before success; cancellation, status, and unchanged requests do not write. | Focused tests and the 16-variant terminal matrix pass. |\n| `/export` | Transcript export: show destination, format, overwrite implications, and an actionable failure. | P1 / next |\n| `/dump` | Cancel-first conversation-to-clipboard review; session/content revalidation; awaited delivery, duplicate rejection, unresolved retry. Distinguish completed local copy from an unverified terminal clipboard request. | Adapter and 16-variant actual-terminal visual/readback/persistence matrix pass; complete-candidate gate pending |\n| `/share` | Publication: review destination, visibility, and content before external submission. | P0 / next |\n| `/browser` | Cancel, headless, visible, and typed paths share a saved-default and effective-state review. Status and no-op are read-only; save precedes optional reset, and retry repeats only unresolved work. | Focused tests and the 16-variant terminal matrix pass. |\n| `/chrome` | Status probes the selected loopback endpoint. Relaunch review identifies endpoint, executable, profiles, authentication uncertainty, and restart impact; stale targets renew review and failures remain unresolved. | Focused tests and the 16-variant terminal matrix pass. |\n| `/copy` | Typed and selector copies share Cancel-first review, fresh source resolution, and delivery feedback. Framed search preserves identity and parent context while history loading and details paging remain explicit. | Focused tests and the 16-variant terminal matrix pass. |\n| `/open` | External opener: identify selected artifact and recovery when no suitable opener exists. | P2 / next |\n| `/remote` | Read-only native remote-host status: report relay reachability and the current live terminal-session count without changing runtime state. | Focused remote-control tests pass; full terminal UAT pending. |\n| `/session` | Info/delete: retain target identity through cancellation and show the actual deletion outcome. | P0 / next |\n| `/jobs` | Current-session queued/running/completed/failed work uses the bounded report frame, with distinct unavailable and empty states, overflow-only paging, Escape closure, and Ctrl+C kept separate from Back. | Focused state regressions and a directly judged 16-variant actual-terminal empty-state matrix pass; complete-candidate job integration remains pending |\n| `/usage` | Non-cancellable provider refresh rejects duplicates, retains cached data after failure, distinguishes empty/unavailable/error states, and renders complete account identities in responsive one/two-column layouts. | Focused lifecycle regressions and a directly judged 16-variant local-provider/unchanged-credential matrix pass; complete-candidate gate pending |\n| `/changelog` | Recent and explicit `full` reports use responsive Markdown in the bounded pager; unrelated arguments fail, long content remains complete, and paging narration appears only during overflow. | Focused paging/parser regressions and a directly judged 16-variant actual-terminal recent/full/invalid matrix pass; complete-candidate gate pending |\n| `/hotkeys` | The intentional instructional exception now uses the shared bounded pager, reports configured/disabled bindings, groups controls by context, and only shows paging controls on overflow. | Focused binding regressions and a directly judged 16-variant first/final-page matrix pass; complete-candidate gate pending |\n| `/tools` | The active-model tool inventory uses bounded responsive Markdown and paging while keeping availability, enabled state, provenance, and configuration requirements explicit. | Focused tests and the 16-variant terminal matrix pass. |\n| `/extensions` | Split inventory/inspector: Ctrl+C no longer closes; next, shared search without j/k/space collisions, inspect-before-toggle, stable tabs, and single-column details. | P1 / partial |\n| `/agents` | Dashboard: redundant arrow hint removed; next, replace letter shortcuts that collide with search and label persistent actions. | P1 / partial |\n| `/branch` | Tree or message selector: explain branch destination and distinguish navigation from creating a fork. | P1 / next |\n| `/fork` | Session mutation: identify source and new session, preserving a clear route back. | P1 / next |\n| `/tree` | Tree navigation: Ctrl+C no longer closes; next, show page controls only for overflow and preserve node identity. | P1 / partial |\n| `/login` | Configured providers and the full catalog use framed identity-qualified search with retained parent context. Typed and menu setup share masked Cancel-first review and distinguish saved configuration, authentication, validation, and catalog readiness. | Focused tests and the 16-variant terminal matrix pass. |\n| `/logout` | Stored-credential removal names provider and credential-store scope, masks the old value, starts on Cancel and refreshes only after deletion. A failed refresh warns without denying completed removal; empty storage is explicit. | Focused review/outcome tests and a directly judged 16-variant actual-terminal database-reopen matrix pass; complete-candidate gate pending |\n| `/mcp` | Add/list/authentication/configuration/resource commands: wizard hints simplified; next, consistent server identity, retry, connection state, and removal review. | P0 / partial |\n| `/ssh` | Connection add/list/remove: scope-qualified identity, removal review, and clear distinction between saved configuration and a tested connection. | P0 / next |\n| `/media` | Play/pause/stop: identify the media target and report unsupported or unavailable playback. | P2 / next |\n| `/new` | Cancel-first review identifies old session, destination, queued prompts and interruption consequences. UI resets only after confirmed persistence; veto preserves view; in-dialog partial-save retry retains the created identity. | P1 / full UAT pending |\n| `/compact` | Default and typed instructions share a stale-checked session review. Escape navigates and Ctrl+C requests interruption; completed output survives persistence failure for save-only retry. Too-small and unchanged requests do not write. | Focused tests and the 16-variant terminal matrix pass. |\n| `/handoff` | Context transfer: preview destination and report what was transferred or omitted. | P1 / next |\n| `/resume` | Session picker: Ctrl+C no longer exits; retain deletion hint; next, contextual search-clear and stable selected identity. | P1 / partial |\n| `/btw` | Side question: make its separation from the main conversation and completion state visible. | P2 / next |\n| `/background` | Transfer running work without review: identify stable session/work, state non-cancellation, stop UI activity, and detach streams before suspension. `bg` continues, `fg` waits, reopen returns, and `/jobs` inspects work. | Focused tests and the 16-variant terminal matrix pass. |\n| `/debug` | Diagnostic selector: concise choices and safe export boundaries; shared cancel default applies. | P2 / partial |\n| `/memory` | Read-only view is pageable and distinguishes populated, empty, and unavailable states. Clear/reset and enqueue/rebuild use stale-checked reviews with exact project/database scope and report persisted requests rather than worker completion. | Focused tests and the 16-variant terminal matrix pass. |\n| `/rename` | Prefilled editor when omitted; typed/editor names share cancel-first review, session identity revalidation, unchanged no-write, persistence-before-success and retry tracking. Disposable session cancel/reopen tests pass. | P2 / full UAT pending |\n| `/move` | Required destination: offer destination review, collision feedback, and resulting session location. | P1 / next |\n| `/exit` | Clean sessions exit immediately. Outstanding work opens one session-qualified Cancel-first review; confirmation interrupts supported work, waits for settlement, flushes state, clears transient UI, and returns the shell. | Focused tests and the 16-variant terminal matrix pass. |\n| `/plugin` | Canonical commands and aliases share one framed dashboard. Mutations use exact-version Cancel-first review, fresh catalog/target validation, duplicate and stale guards, explicit partial/offline outcomes, and unresolved-only retry. `--force` is replacement, not consent. | Focused tests and the 16-variant terminal matrix pass. |\n| `/reload-plugins` | Clear capability and plugin-root caches, refresh command/skill/hook/tool/agent/MCP metadata in the current process, reject duplicates, and distinguish completion from restart. | Focused lifecycle tests and a directly judged 16-variant actual-terminal refreshed-command discovery matrix pass; complete-candidate gate pending |\n| `/force` | Argument-free use opens searchable active-tool actions with Cancel first. Typed colon/space syntax remains supported. Feedback describes one forced tool call followed by no tools, queued behind any earlier directives—not immediate execution. No persistent setting is changed; stale session choices, removed tools and duplicate selectors are rejected. | P1 / full UAT pending |\n| `/quit` | Exact alias of the `/exit` review, revalidation, settlement, persistence, and shell-return contract. | Shared focused and actual-terminal evidence passes; complete-candidate gate pending |\n| `/apply` | Resource mutation: review tenant, namespace, target, and diff; separate dry-run from applied results. | P0 / next |\n| `/create` | Resource mutation: identify target and scope, distinguish validation from creation and existing-resource conflicts. | P0 / next |\n| `/delete` | Resource deletion: cancel-first target review, explicit force semantics, and partial-result feedback. | P0 / next |\n| `/describe` | Resource details: scrollable long output, stable identity, and actionable missing-context errors. | P1 / next |\n| `/diff` | Change preview: distinguish no changes from unavailable comparison and prevent preview implying application. | P0 / next |\n| `/get` | Resource inventory: aligned responsive columns, readable empty results, and distinct failure styling. | P1 / next |\n| `/manifest` | Resource export: destination/overwrite review, partial-export warning, and error styling instead of ordinary status. | P0 / next |\n| `/context` | Context list/activation/wizard and configuration subcommands: concise wizard hints applied; next, masked identity, scope, confirmation, and retained validation failures. | P0 / partial |\n| `/route` | Strict paths distinguish saved, project, runtime, and effective policy. Mutations use stale-checked reviews, bounded preparation, exact no-op handling, unresolved-save retry, and unavailable-catalog recovery. | Focused tests and the 16-variant terminal matrix pass. |\n\nAliases share their canonical command's review: `models` → `model`, `status` → `extensions`,\n`bg` → `background`, and `marketplace`/`plugins` → `plugin`. Keep explicit-argument paths efficient:\nthe browse → inspect → act contract applies to menus, not an extra mandatory menu for every typed verb.\n\nThe library is also extensible. `extensibility/slash-commands.ts`, `capability/slash-command.ts`,\nand embedded task templates contribute extension, prompt, skill, and file-based commands. Review\ntheir discovery contract: show source and user/project scope, explain shadowed names, preserve\nargument completion, and distinguish a prompt expansion from an immediately executable action.\nTheir installed contents vary by workspace; do not claim an exhaustive live inventory from the\nbuilt-in registry alone. Apply this checklist when each command is introduced or changed.\n\nThe complete source-derived inventory is verified by focused regressions and current-source terminal\nmatrices. Keep simple text reports simple; enrich them only where inspection, recovery, or\ndecision-making benefits from interaction, and require the same evidence whenever a surface changes.\n",
|
|
18
|
+
"en/architecture-contribution/tui-style-guide.mdx": "---\ntitle: \"TUI interaction style guide\"\ndescription: \"Build predictable selectors with shared structure, navigation, semantics, and feedback.\"\nsidebar:\n order: 9\n label: \"TUI interaction style\"\nhead:\n - tag: style\n content: |\n .sl-markdown-content .expressive-code { max-width: 100%; overflow-x: auto; }\n .sl-markdown-content table { display: block; max-width: 100%; overflow-x: auto; }\n---\n\nUse this guide for interactive terminal user interface (TUI) selectors and managers. It defines a\nshared interaction contract and adaptable presentation defaults. It does not require unrelated\nscreens to be redesigned in the same change.\n\n## What flow should an interactive manager use?\n\nPrefer one stable, single-column flow:\n\n```text\nbrowse → inspect → choose an explicitly labeled action → see its outcome\n```\n\nGive the frame a clear title. Add a purpose only when the title and choices do not explain the task.\nKeep navigation in a stable position, make the choices searchable, summarize the selected choice\nbriefly, and show contextual keyboard hints.\nPut long descriptions and secondary metadata in a detail view rather than beside the list.\n\nThe `/login` provider list follows this pattern by opening connection management before changing a\nsaved connection. `/model` separates model selection from scope and reasoning choices. `/plugin`\nuses the same pattern for install, update, enable, disable, and removal actions.\n\n## How should a selector look?\n\nUse `selectorFrame` and its adaptive gutters. The shared frame provides rounded Unicode borders,\nan ASCII fallback, joined section dividers, and a maximum width of 100 columns. Keep every rendered\nrow the same width so selection highlighting reaches both inside edges without breaking the border.\n\nUse two spaces between aligned columns. Keep headings subdued and reserve emphasis for selection,\nstate, and outcomes. Color may reinforce meaning, but plain text must carry it:\n\n```text\nPlugin Status Scope\n› source-control Enabled project\n observability Update 2.1.0 user\n cloud-tools Available —\n```\n\nAt narrow widths, keep the name in the row and move status, scope, version, and other secondary\ncolumns into the selected summary. Remove optional blank rows before hiding choices, controls, or\nselected information.\n\n## How should input and navigation behave?\n\nTreat familiar terminal conventions as the default interaction vocabulary. Avoid \"captain obvious\"\nindicators: instructions that merely repeat what a recognizable control already communicates.\nMake the layout self-descriptive before adding instructional copy. Removing a hint is appropriate\nonly when the control, its state, and its outcome remain discoverable.\n\nThe following manifest defines the expectations xcsh should consistently support. These are design\ncommitments for this interface, not a claim that every person has identical experience. Preserve\naccessible labels and provide help for unfamiliar or remapped controls.\n\n| Visible situation | Expected human intuition | Interface commitment | Hint policy |\n| --- | --- | --- | --- |\n| A highlighted menu item | Arrows move selection; Enter opens or activates it. | Show one clear selection and make the label predict the result. | Omit `Up/Down: navigate` and `Enter: choose action`. |\n| An item naming a plugin, provider, or other object | Opening it reveals information or choices about that object. | Open details before a management mutation. | Let the object label and detail title explain the transition. |\n| An action naming a verb and target | Activating it performs that named action or opens its clearly labeled review. | Use `Disable plugin`, `Review installation`, or `Remove from project scope`; avoid ambiguous `Select` or `Continue`. | Explain consequences or scope when they affect the decision, not how to press Enter. |\n| A search field | Typing searches; normal editing and paste work. | Keep search visibly associated with its list and preserve editor behavior. | Use a field label; omit `Type to search` when the field already says Search. |\n| A nested menu | Escape returns to the parent. | Return one level and retain the parent's query and selection. | A compact `Esc: back` can clarify the hierarchy; never advertise Ctrl+C as Back. |\n| An active search in a list | Escape clears the search before leaving the list. | Clear the query on the first Escape, then return on the next. | Show `Esc: clear search` only while a query exists. |\n| Section tabs | Changing sections preserves a stable navigation structure. | Keep tab order and selected section visible; use Tab and Shift+Tab consistently here. | A compact section-switching hint is useful because Tab behavior varies between interfaces. |\n| Content longer than the viewport | Navigation reveals the remaining content. | Use available space first; keep selection visible and make all details reachable. | Show paging controls only during overflow, especially when arrows move actions instead of details. |\n| A destructive confirmation | Cancel is safe; the destructive choice names the effect. | Select Cancel initially and show the exact target and scope. | Keep consequence text; omit instructions to select a choice. |\n| An operation underway | Work is proceeding, and another activation should not duplicate it. | Show progress, prevent duplicate submission, and report whether interruption is supported. | Reserve Ctrl+C for interruption; never imply cancellation unless work actually stopped. |\n| An operation completes or fails | The state reflects the outcome and recovery is apparent. | Update the affected item; keep failure context and a usable retry path. | Report the result and any remaining work, not `Action selected` or `Press Enter to continue`. |\n\nUse the shared `Input` component for search. Forward ordinary input to it so spaces, Unicode,\nbracketed paste, cursor movement, deletion, undo, and configured editor bindings work together.\nDo not reserve printable letters as hidden actions while search is active.\n\n- Typing edits the active search; Up and Down move through the filtered choices.\n- Enter inspects a choice, or activates the action whose label is visibly selected.\n- Escape returns one level. In a list it clears an active search before closing the selector.\n- Ctrl+C is reserved for interruption; it must not act as Back or close a menu.\n\nFirst-party extension select/input dialogs use the shared frame and editable input. Selection search\naccepts printable letters; Tab/Shift+Tab changes supplied sections while arrows edit search. Escape\nclears search before closing. Selection timeout closes without activating an option; explicit caller\ntimeout policies remain separate. Confirmation starts on No, and plan approval starts on Stay in plan\nmode. Callback signatures and return types are unchanged.\n\nChoosing `Approve and execute` is an action request, not final consent. Follow it with one Cancel-first\nreview that names the planning session, new execution-session destination, draft and finalized plan\npaths, restored tool scope, prompt submission, and execution consequences. Revalidate plan bytes,\nsession identity, and destination before committing. Extension veto happens before old-session mutation;\npartial session persistence retries the same identity. Do not open a nested `/new` review or continue\nexecution when any approval review is cancelled.\n\nA typed `/plan <prompt>` uses the same review and lifecycle adapters. When planning is already active,\nreview the prompt without toggling or pausing the mode; persist outstanding session state before\nqueueing it, then distinguish queued/model-pending from completion. If an enable save is unresolved,\nshow prompt replacement as old→new. If a pause save is unresolved, review the combined recovery,\npersist the pause, re-enable and persist plan mode, and only then queue the prompt. Never silently drop\nan argument because a prior mode transition is awaiting persistence.\n\nThe application and standalone editor now default `app.interrupt` to Ctrl+C. Idle Ctrl+C retains\ndraft clearing, while double-Escape navigation remains separate from execution. Existing explicit\ninterrupt remaps (including disabled bindings) are respected; there is no configuration migration.\nActive-work hints must display the configured key, not hardcode Escape. Cooperative actions receive\nan abort signal, but an interrupt request alone does not establish cancellation: keep the operation\nvisible until it acknowledges interruption or completes. Normal completion after an interrupt request\nis still success. Unaccounted-for partial failures remain unresolved rather than being labelled cancelled.\n\n- Tab and Shift+Tab move through stable categories when a manager has categories.\n- Page Up and Page Down make long detail content reachable.\n\nHints should explain non-obvious controls, not narrate familiar interaction. Omit `Enter: choose\naction`, `Up/Down: navigate`, and purpose text such as `Browse, inspect, choose an action, and review\nits outcome`. Keep compact hints for section switching, refresh or retry, and the Escape hierarchy.\nShow a paging hint only when content actually exceeds the available space; use the terminal's\navailable height before introducing scrolling. A short detail view needs no scroll instructions.\n\nDocument an exception beside the component when its task genuinely requires different behavior.\nRemapped selector bindings must continue to work; do not hardcode only one escape sequence.\n\nReview each proposed hint against three questions: does it reveal a control that is otherwise\nundiscoverable, explain an exception to these conventions, or clarify a consequence or recovery\nstep? If none applies, remove it. If a conventional interaction needs a paragraph of instructions,\nfirst repair the label, grouping, focus, or navigation behavior. Do not use explanatory copy to\ncompensate for an inconsistent menu.\n\n## How do question-and-answer flows work?\n\nBlocking and asynchronous questions use the same framed, theme-aware presentation as other\nfirst-party selectors. Show one question at a time with its position and unanswered count. The\nhighlight spans the full choice row, while checkbox state distinguishes a highlighted draft from a\ncommitted answer without relying on color. Numbered shortcuts submit their matching choice. Omit a\ndescription row when the option has no description.\n\nKeep notes and free-text answers inside the question frame. Secret input is masked by grapheme in\nevery render, including resize, and the visible transcript must never disclose the secret. Preserve\nthe current question and draft when the terminal resizes. Keep the highlighted choice visible when\nheight is constrained and show scrolling guidance only when content actually overflows.\n\nUnanswered confirmation uses the same frame and keeps `Proceed` as the existing default. Escape\nreturns to the first unanswered question. Hints are contextual and derived from the active selector\nand interrupt bindings; hardcoded hints are limited to controls that are not configurable.\n\nAsynchronous announcements are compact question summaries with a visible `/questions` action.\nCompleted replies remain the exact structured `user_input_reply` payload in model context and\nsession persistence, but the terminal correlates that payload with the preceding question item and\nrenders a friendly answer summary. Correlation IDs and transport envelopes are never visible. A\nmessage that does not correlate to an existing async question is rendered normally rather than\nbeing mistaken for an internal reply.\n\nRead the screen without its keyboard footer. Its title should identify the current task or object;\nhighlighting should identify the active choice; action labels should identify what happens next;\ngrouping should distinguish navigation, actions, facts, and outcomes. Use the same words and order\nfor the same concepts across screens. Keep the affected object identifiable after an operation,\nand explain a change of section when an item moves out of the current list.\n\n## Which states must the copy distinguish?\n\nAvailability, installation, enabled state, scope, and update availability are separate facts. Use\nspecific phrases such as `Available`, `Installed · Disabled`, `project scope`, and\n`Update 2.1.0`. Avoid unexplained symbols and avoid treating an item that exists in a catalog as an\ninstalled or enabled item.\n\nFeedback also needs distinct language and styling:\n\n| State | Copy pattern | Required next step |\n| --- | --- | --- |\n| Loading | `Refreshing plugin catalogs…` | Keep navigation and cached data visible. |\n| Progress | `Installation in progress…` | Prevent duplicate submission. |\n| Success | `Installation completed.` | Show the updated state. |\n| Warning | `Installed 2 of 3 plugins. 1 failed.` | Name remaining work. |\n| Failure | `Refresh failed: catalog unavailable.` | Offer Retry and retain context. |\n| Empty | `No plugins match “trace”.` | Explain how to clear or broaden the search. |\n\nClosing a view does not mean an asynchronous operation was cancelled. Ignore stale completions from\nsuperseded refreshes, keep retry context after failure, and describe continuing work accurately.\n\nDialog creation and teardown are part of this lifecycle contract. A synchronous factory exception,\nrejected asynchronous factory, or failed presentation must settle the caller with an error and\nrelease duplicate-operation guards. Do not replace the draft before a component is ready. Attempt\nremaining cleanup even if one disposal step fails, and report that failure rather than leaving a\nhidden command pending. These internal safeguards must preserve extension callback signatures.\n\n## How do confirmation and review screens work?\n\nEnter from a browse list opens details; it must not install, remove, or toggle the selected item.\nDetails list only actions backed by a persistent manager operation.\n\nInstallation review identifies the source, destination scope, and declared prerequisites before an\ninstall action is available. Removal confirmation starts on `Cancel removal`, not on the destructive\nchoice. A bulk action is a visible row such as `Review recommended setup…`; its review lists every\naffected plugin, the destination scope, prerequisite commands, and partial failures.\n\nClipboard reviews identify the source and replacement effect without reading existing clipboard data.\nExplain that clipboard-history services may retain the text. Wait for the backing copy operation;\nan OSC 52 terminal request has no delivery acknowledgement and must be described as unverified,\nnot as a confirmed copy. On Linux without a clipboard manager, clipboard text may disappear when\nxcsh exits. `/dump`, typed `/copy` subcommands and transcript-selector picks share this review\nand feedback adapter. Other clipboard surfaces must adopt it before candidate acceptance.\n\n## What should reviewers check?\n\n- The title, purpose, choices, selected summary, and controls remain understandable without color.\n- With keyboard hints hidden, the task, selection, action consequences, and current state are clear.\n- Every remaining hint reveals a non-obvious control, an exception, a consequence, or recovery;\n none merely narrates Enter, arrows, selection, or an already labeled search field.\n- The intuition manifest holds across parent and child menus: consistent labels, stable focus,\n Escape hierarchy, retained context, and feedback tied to the affected object.\n- Scrolling hints disappear when content fits; Ctrl+C never substitutes for Back.\n- The frame is continuous in Unicode and ASCII, each row has equal width, and highlighting stays\n inside both borders.\n- Width never exceeds 100 columns; 60×20 still keeps the selected choice and recovery controls.\n- Search handles spaces, Unicode, paste, cursor edits, and no-match results.\n- Enter opens details before mutation; destructive confirmation starts on Cancel.\n- Selection uses the full stable identity, including source, identifier, and scope.\n- Empty, loading, progress, success, warning, failure, retry, and partial failure are\n distinguishable.\n- Refresh and resize retain tab, query, selection, and available data.\n- Duplicate operations and stale asynchronous updates cannot produce a second or misleading outcome.\n- Long details remain reachable and exceptions to the shared contract are documented.\n\n## Where should the guide be adopted next?\n\nUse focused improvement passes rather than a repository-wide redesign:\n\n1. Keep `/login`, `/model`, and `/plugin` as the reference implementations and regression baseline.\n2. Move settings and extension management to the shared frame and escape hierarchy.\n3. Align session, tree, and agent dashboards where they contain inspectable choices and actions.\n4. Review one-off confirmation and input dialogs for explicit labels, outcome feedback, and narrow\n terminal behavior.\n5. Document intentional exceptions after usability evidence shows the shared contract is unsuitable.\n\n## What did the slash-command library review identify?\n\nThis inventory covers every built-in entry in `src/slash-commands/builtin-registry.ts`, its\nregistered subcommands, and the extension-command discovery surfaces. The coverage regression\nrequires new built-ins to receive an entry here. It is a source review, not a claim that every\ncommand has received live visual acceptance. Do not exercise cloud mutations, credential removal,\npublication, or session deletion merely to review presentation; use isolated fixtures.\n\nPriorities: P0 protects consequential actions and truthful outcomes; P1 improves everyday navigation;\nP2 improves discovery and presentation. “Next” means proposed work, not completed adoption.\n\n| Command | Surface and enhancement opportunity | Priority / adoption |\n| --- | --- | --- |\n| `/settings` | Tabbed settings and nested editors: shared Escape default and concise hints applied; next, shared frame, retained submenu context, and saved-value feedback. | P1 / partial |\n| `/questions` | Opens pending asynchronous questions through the shared session interaction owner; announcements, framed answers, automatic handoff, and correlated transcript summaries share the question presentation. | Focused protocol, interaction, renderer, privacy, and 16-variant terminal tests pass. |\n| `/plan` | Enable, pause, typed prompts, and approval use session-qualified Cancel-first review, fresh plan and destination validation, veto-before-mutation, same-identity save retry, and truthful queued or completed outcomes. | Focused tests and the 16-variant terminal matrix pass. |\n| `/model` | Browse with stable tabs, editable search, exact identity, explicit scope, and reasoning steps. Mutations use Cancel-first review, fresh catalog resolution, persistence-before-success, and exact no-op handling; `/models` shares this path. | Focused tests and the 16-variant terminal matrix pass. |\n| `/fast` | Offer Cancel, Enable, and Disable. Typed `on`, `off`, and `toggle` use the same session-scoped review; `status` is read-only. Persist before success; cancellation, status, and unchanged requests do not write. | Focused tests and the 16-variant terminal matrix pass. |\n| `/export` | Transcript export: show destination, format, overwrite implications, and an actionable failure. | P1 / next |\n| `/dump` | Cancel-first conversation-to-clipboard review; session/content revalidation; awaited delivery, duplicate rejection, unresolved retry. Distinguish completed local copy from an unverified terminal clipboard request. | Adapter and 16-variant actual-terminal visual/readback/persistence matrix pass; complete-candidate gate pending |\n| `/share` | Publication: review destination, visibility, and content before external submission. | P0 / next |\n| `/browser` | Cancel, headless, visible, and typed paths share a saved-default and effective-state review. Status and no-op are read-only; save precedes optional reset, and retry repeats only unresolved work. | Focused tests and the 16-variant terminal matrix pass. |\n| `/chrome` | Status probes the selected loopback endpoint. Relaunch review identifies endpoint, executable, profiles, authentication uncertainty, and restart impact; stale targets renew review and failures remain unresolved. | Focused tests and the 16-variant terminal matrix pass. |\n| `/copy` | Typed and selector copies share Cancel-first review, fresh source resolution, and delivery feedback. Framed search preserves identity and parent context while history loading and details paging remain explicit. | Focused tests and the 16-variant terminal matrix pass. |\n| `/open` | External opener: identify selected artifact and recovery when no suitable opener exists. | P2 / next |\n| `/remote` | Read-only native remote-host status: report relay reachability and the current live terminal-session count without changing runtime state. | Focused remote-control tests pass; full terminal UAT pending. |\n| `/session` | Info/delete: retain target identity through cancellation and show the actual deletion outcome. | P0 / next |\n| `/jobs` | Current-session queued/running/completed/failed work uses the bounded report frame, with distinct unavailable and empty states, overflow-only paging, Escape closure, and Ctrl+C kept separate from Back. | Focused state regressions and a directly judged 16-variant actual-terminal empty-state matrix pass; complete-candidate job integration remains pending |\n| `/usage` | Non-cancellable provider refresh rejects duplicates, retains cached data after failure, distinguishes empty/unavailable/error states, and renders complete account identities in responsive one/two-column layouts. | Focused lifecycle regressions and a directly judged 16-variant local-provider/unchanged-credential matrix pass; complete-candidate gate pending |\n| `/changelog` | Recent and explicit `full` reports use responsive Markdown in the bounded pager; unrelated arguments fail, long content remains complete, and paging narration appears only during overflow. | Focused paging/parser regressions and a directly judged 16-variant actual-terminal recent/full/invalid matrix pass; complete-candidate gate pending |\n| `/hotkeys` | The intentional instructional exception now uses the shared bounded pager, reports configured/disabled bindings, groups controls by context, and only shows paging controls on overflow. | Focused binding regressions and a directly judged 16-variant first/final-page matrix pass; complete-candidate gate pending |\n| `/tools` | The active-model tool inventory uses bounded responsive Markdown and paging while keeping availability, enabled state, provenance, and configuration requirements explicit. | Focused tests and the 16-variant terminal matrix pass. |\n| `/extensions` | Split inventory/inspector: Ctrl+C no longer closes; next, shared search without j/k/space collisions, inspect-before-toggle, stable tabs, and single-column details. | P1 / partial |\n| `/agents` | Dashboard: redundant arrow hint removed; next, replace letter shortcuts that collide with search and label persistent actions. | P1 / partial |\n| `/branch` | Tree or message selector: explain branch destination and distinguish navigation from creating a fork. | P1 / next |\n| `/fork` | Session mutation: identify source and new session, preserving a clear route back. | P1 / next |\n| `/tree` | Tree navigation: Ctrl+C no longer closes; next, show page controls only for overflow and preserve node identity. | P1 / partial |\n| `/login` | Configured providers and the full catalog use framed identity-qualified search with retained parent context. Typed and menu setup share masked Cancel-first review and distinguish saved configuration, authentication, validation, and catalog readiness. | Focused tests and the 16-variant terminal matrix pass. |\n| `/logout` | Stored-credential removal names provider and credential-store scope, masks the old value, starts on Cancel and refreshes only after deletion. A failed refresh warns without denying completed removal; empty storage is explicit. | Focused review/outcome tests and a directly judged 16-variant actual-terminal database-reopen matrix pass; complete-candidate gate pending |\n| `/mcp` | Add/list/authentication/configuration/resource commands: wizard hints simplified; next, consistent server identity, retry, connection state, and removal review. | P0 / partial |\n| `/ssh` | Connection add/list/remove: scope-qualified identity, removal review, and clear distinction between saved configuration and a tested connection. | P0 / next |\n| `/media` | Play/pause/stop: identify the media target and report unsupported or unavailable playback. | P2 / next |\n| `/new` | Cancel-first review identifies old session, destination, queued prompts and interruption consequences. UI resets only after confirmed persistence; veto preserves view; in-dialog partial-save retry retains the created identity. | P1 / full UAT pending |\n| `/compact` | Default and typed instructions share a stale-checked session review. Escape navigates and Ctrl+C requests interruption; completed output survives persistence failure for save-only retry. Too-small and unchanged requests do not write. | Focused tests and the 16-variant terminal matrix pass. |\n| `/handoff` | Context transfer: preview destination and report what was transferred or omitted. | P1 / next |\n| `/resume` | Session picker: Ctrl+C no longer exits; retain deletion hint; next, contextual search-clear and stable selected identity. | P1 / partial |\n| `/btw` | Side question: make its separation from the main conversation and completion state visible. | P2 / next |\n| `/background` | Transfer running work without review: identify stable session/work, state non-cancellation, stop UI activity, and detach streams before suspension. `bg` continues, `fg` waits, reopen returns, and `/jobs` inspects work. | Focused tests and the 16-variant terminal matrix pass. |\n| `/debug` | Diagnostic selector: concise choices and safe export boundaries; shared cancel default applies. | P2 / partial |\n| `/memory` | Read-only view is pageable and distinguishes populated, empty, and unavailable states. Clear/reset and enqueue/rebuild use stale-checked reviews with exact project/database scope and report persisted requests rather than worker completion. | Focused tests and the 16-variant terminal matrix pass. |\n| `/rename` | Prefilled editor when omitted; typed/editor names share cancel-first review, session identity revalidation, unchanged no-write, persistence-before-success and retry tracking. Disposable session cancel/reopen tests pass. | P2 / full UAT pending |\n| `/move` | Required destination: offer destination review, collision feedback, and resulting session location. | P1 / next |\n| `/exit` | Clean sessions exit immediately. Outstanding work opens one session-qualified Cancel-first review; confirmation interrupts supported work, waits for settlement, flushes state, clears transient UI, and returns the shell. | Focused tests and the 16-variant terminal matrix pass. |\n| `/plugin` | Canonical commands and aliases share one framed dashboard. Mutations use exact-version Cancel-first review, fresh catalog/target validation, duplicate and stale guards, explicit partial/offline outcomes, and unresolved-only retry. `--force` is replacement, not consent. | Focused tests and the 16-variant terminal matrix pass. |\n| `/reload-plugins` | Clear capability and plugin-root caches, refresh command/skill/hook/tool/agent/MCP metadata in the current process, reject duplicates, and distinguish completion from restart. | Focused lifecycle tests and a directly judged 16-variant actual-terminal refreshed-command discovery matrix pass; complete-candidate gate pending |\n| `/force` | Argument-free use opens searchable active-tool actions with Cancel first. Typed colon/space syntax remains supported. Feedback describes one forced tool call followed by no tools, queued behind any earlier directives—not immediate execution. No persistent setting is changed; stale session choices, removed tools and duplicate selectors are rejected. | P1 / full UAT pending |\n| `/quit` | Exact alias of the `/exit` review, revalidation, settlement, persistence, and shell-return contract. | Shared focused and actual-terminal evidence passes; complete-candidate gate pending |\n| `/apply` | Resource mutation: review tenant, namespace, target, and diff; separate dry-run from applied results. | P0 / next |\n| `/create` | Resource mutation: identify target and scope, distinguish validation from creation and existing-resource conflicts. | P0 / next |\n| `/delete` | Resource deletion: cancel-first target review, explicit force semantics, and partial-result feedback. | P0 / next |\n| `/describe` | Resource details: scrollable long output, stable identity, and actionable missing-context errors. | P1 / next |\n| `/diff` | Change preview: distinguish no changes from unavailable comparison and prevent preview implying application. | P0 / next |\n| `/get` | Resource inventory: aligned responsive columns, readable empty results, and distinct failure styling. | P1 / next |\n| `/manifest` | Resource export: destination/overwrite review, partial-export warning, and error styling instead of ordinary status. | P0 / next |\n| `/context` | Context list/activation/wizard and configuration subcommands: concise wizard hints applied; next, masked identity, scope, confirmation, and retained validation failures. | P0 / partial |\n| `/route` | Strict paths distinguish saved, project, runtime, and effective policy. Mutations use stale-checked reviews, bounded preparation, exact no-op handling, unresolved-save retry, and unavailable-catalog recovery. | Focused tests and the 16-variant terminal matrix pass. |\n\nAliases share their canonical command's review: `models` → `model`, `status` → `extensions`,\n`bg` → `background`, and `marketplace`/`plugins` → `plugin`. Keep explicit-argument paths efficient:\nthe browse → inspect → act contract applies to menus, not an extra mandatory menu for every typed verb.\n\nThe library is also extensible. `extensibility/slash-commands.ts`, `capability/slash-command.ts`,\nand embedded task templates contribute extension, prompt, skill, and file-based commands. Review\ntheir discovery contract: show source and user/project scope, explain shadowed names, preserve\nargument completion, and distinguish a prompt expansion from an immediately executable action.\nTheir installed contents vary by workspace; do not claim an exhaustive live inventory from the\nbuilt-in registry alone. Apply this checklist when each command is introduced or changed.\n\nThe complete source-derived inventory is verified by focused regressions and current-source terminal\nmatrices. Keep simple text reports simple; enrich them only where inspection, recovery, or\ndecision-making benefits from interaction, and require the same evidence whenever a surface changes.\n",
|
|
19
19
|
"en/architecture-contribution/upstream-pi.mdx": "---\ntitle: \"Relationship to pi\"\ndescription: \"Understand what xcsh inherits from pi and where the project deliberately specializes.\"\nsidebar:\n order: 9\n label: \"Relationship to pi\"\n---\n\nxcsh is derived from the open-source pi coding agent and adds F5 Distributed Cloud resource workflows, integrations, packaging, and project-specific governance.\n\n## Which upstream range was reviewed?\n\nThe last proven sync with `can1357/oh-my-pi` was `d350ea60e` on April 9, 2026. The first-pass\nsecurity and shared-runtime audit reviewed the divergent line through `b2f25dbfe1` on September 5,\n2026. The second-pass TUI and renderer audit extends that lineage through the frozen tip\n`6d3bc569d16cd7351073eaa767caed51021befbb` on September 6, 2026.\nThe third-pass terminal-interaction audit extends the reviewed lineage through\n`a1b254047d12e143b7c6011536e918c6c35c5906`, also frozen on September 6, 2026.\nThe fourth-pass hyperlink, login-launch, and transcript-copy audit extends the reviewed lineage\nthrough `6e48b5ce564aa1d7eff60ffe92748f451385ad7d`, frozen on September 7, 2026.\nBecause the repositories no longer share a usable linear history, accepted changes are semantic\nports with adapted regressions rather than merges or ancestry-based cherry-picks.\n\n## Which changes were accepted?\n\nThe four implementation waves accepted these upstream pull requests:\n\n| Wave | Upstream pull requests | xcsh delivery |\n| --- | --- | --- |\n| Provider and prompt security | #2147, the opaque-thinking portion of #3239, #7067, and #8727 | #3710 |\n| Configuration and execution security | #7362 and #5636 | #3720 |\n| Core runtime | #7743, #10415, #10523, #10325, and #10550 | #3723 |\n| Terminal and platform | #10613, #10997, #10492, #9233, and #7634 | #3724 |\n| TUI and renderer crash containment | #1989, #4497, #4529, #2047, #5837, and #6788 | #3743 |\n| Herdr, signals, and mouse interaction | #7810, #8433, #11054, #4121, #3463, #3402, and #11045 | #3748 |\n| Hyperlinks, login launch, and copy picker | #10196, #10606, #11002, #10922, #11086, #5887, and #6282 | #3758 |\n\nThese ports protect provider-bound secrets and compaction boundaries, enforce exact-case\nenvironment references and complete protocol tails, repair Responses replay and shared MCP\nresults, improve rate-limit and retained-string behavior, chain directory completion, extend\npower assertions across supported platforms, and harden stats persistence and network exposure.\nThe source pull requests remain attributable to `can1357/oh-my-pi`; the xcsh deliveries link the\nexact commits and regression evidence.\n\nThe second-pass renderer work normalizes malformed task result data, accepts only strings at path\nboundaries, bounds ANSI-heavy rows before width measurement, and treats terminal disconnect\ncleanup as best effort before SIGHUP. Upstream #5438 is equivalent because `Container.render()`\nalready isolates child-render exceptions; its richer fallback display remains deferred.\n\nThe third-pass work adds a shared fullscreen/mouse framework, applies it to the session picker,\nextension dashboard, and debug-log viewer, and keeps terminal state restoration idempotent across\nnormal exit, resize, disconnect, and emergency cleanup. Herdr pane identity now participates in\nmultiplexer redraw decisions, while notifications use validated argv-only `herdr notification show`\ndelivery with terminal fallback. Interactive and signal exits share one draft-preserving teardown,\nand POSIX Ctrl-Z suspends only the xcsh process with `SIGSTOP`.\n\nThe fourth-pass work applies an immutable startup capability snapshot to `off`, `auto`, and\n`always` hyperlink policy; safely renders and physically wraps OSC 8 spans; launches local Vertex\nlogin through an HTTP(S)-only opener while retaining manual recovery; and projects the bounded copy\npicker directly from xcsh `SessionMessageEntry` history. The semantic ports correspond to upstream\nmerge commits `db2f55888b9f500b51010d7958a9cc8712e19f5c`,\n`4d13034f5dc70e93a6dad502ea7313792480760e`,\n`72767b81bd2911ebd650cfd0fdd5f92afc7470a6`,\n`4a56732e45c6b13b01e72aeaab113d0a257df0bd`,\n`43a2913d1ee2e88ceff0851a9ed9d0345f12d8c6`,\n`c081dedd3a696c872fd818f89d2b8c6c81a45b1e`, and\n`d1979782e7851b46451e956a5855d69e7781a5f5`.\n\n| Third-pass candidate | Disposition |\n| --- | --- |\n| Herdr #7810, #8433, and #11054 | Ported: scrollback-safe rendering, resize behavior, and notification delivery |\n| Herdr #10356 and #10479 | Equivalent: explicit `HERDR_KITTY_GRAPHICS` gating and synchronized rendering already cover the behavior |\n| Herdr #7554 | Not applicable: xcsh uses its compiled executable and dedicated launcher |\n| Signal #4121 (`73a12c7e`) | Ported: shared idempotent teardown and one-shot draft recovery |\n| Signal #3463 (`8506fbdf`) | Ported: interactive self-`SIGSTOP`; deliberate background process-group `SIGTSTP` remains unchanged |\n| Mouse #3402 and #11045 | Ported: shared SGR parsing/routing and horizontal-wheel rejection |\n| `cffb804d`, `27ed9f7a`, and log-viewer portion of `5fbe8876` | Ported to the session picker, extension dashboard, and debug-log viewer |\n| `7eca774c` and raw-SSE portion of `5fbe8876` | Not applicable: those surfaces do not exist in xcsh |\n| Plan Review `2976847e` | Deferred: xcsh retains its compact plan-review selector |\n| MCP, OpenCode, and unrelated renderer/UI changes | Excluded from this pass |\n\n## Where does xcsh deliberately diverge?\n\nxcsh retains its own:\n\n- F5-scoped packages, prompts-as-files, tool factories, and capability discovery;\n- SQLite multi-credential storage, multi-account authentication, and provider routing;\n- MCP, SSH, F5 Distributed Cloud, Office, and browser integrations;\n- Bun-first runtime, session semantics, release pipeline, branding, and governance.\n\nPublic interfaces use prerelease clean breaks. In this wave,\n`MacOSPowerAssertion`/`MacOSPowerAssertionOptions` became\n`PowerAssertion`/`PowerAssertionOptions` without aliases, and `power.sleepPrevention` was added with\nan `idle` default.\n\n## What remains excluded or deferred?\n\nUpstream workflows, branding, release machinery, generated model catalogs, compatibility shims,\nnew packages, and large unrelated subsystems are excluded. The security-scan subsystem in #7048\nand the native minimizer in #2176 remain deferred. The range-dashboard optimization in #9327 and\nearendil-works/pi-only fullscreen transcript, mouse, clipboard, and renderer subsystems also remain\noutside this campaign. MCP, OpenCode, Herdr, #10625, and #10491 were explicitly excluded from the\nsecond-pass batch; the Herdr work is now covered by the third pass. Commits after the new frozen\nsource tip require a later audit.\n\n## How do I decide where a fix belongs?\n\nTrace the affected module and compare it with the pinned upstream lineage. A generic agent-loop\ndefect may belong upstream; an xcsh resource command, integration, or packaging change belongs\nhere.\n\n## How do I preserve attribution?\n\nKeep upstream license notices and document imported changes. Avoid copying a patch blindly across\ndiverged modules; port the behavior with tests against the current xcsh architecture.\n\nAn upstream commit is evidence of intent, not a patch that is safe to apply unchanged. Freeze the\nreviewed upstream commit, identify the xcsh modules that implement the same contract, port the\nbehavior with a regression test, and record deliberate differences. A candidate remains excluded\nuntil its prerequisites and product fit are reviewed; omission from one batch does not imply\nacceptance or rejection in a later audit.\n",
|
|
20
20
|
"en/automate-extend/extensions-custom-tools.mdx": "---\ntitle: \"Build extensions and custom tools\"\ndescription: \"Add TypeScript behavior, slash commands, providers, or schema-validated tools.\"\nsidebar:\n order: 3\n label: \"Extensions and tools\"\n---\n\nExtensions load TypeScript behavior with `--extension` or `--hook`; project discovery can also load extensions, tools, hooks, commands, and rules under `.xcsh/`.\n\n## How do I test an extension boundary?\n\nLoad one explicit file with `-e <PATH>` and disable discovery with `--no-extensions`. Confirm its registered command or tool, then test shutdown and error handling.\n\n## Where do hooks and rules belong?\n\nHooks observe or alter lifecycle events; rules add durable instructions. Keep each rule narrow and each hook deterministic. Use `--no-rules` to prove whether a rule changes the result.\n\nStart from a temporary extension that registers one uniquely named capability. Launch `xcsh\n--no-extensions -e ./path/to/extension.ts`, invoke that capability, and then exit the session to\nexercise teardown. The extension runs with the xcsh process account and can create the same local or\nremote side effects as its code; review it before loading. Delete the temporary file and repeat\nwithout `-e` to confirm discovery no longer exposes it.\n",
|
|
21
21
|
"en/automate-extend/headless-protocols.mdx": "---\ntitle: \"Headless modes\"\ndescription: \"Integrate xcsh with scripts through print, JSON, JSON-RPC, agent client protocol, manager, and worker modes.\"\nsidebar:\n order: 1\n label: \"Headless modes\"\nhead:\n - tag: style\n content: |\n .sl-markdown-content .expressive-code { max-width: 100%; overflow-x: auto; }\n .sl-markdown-content table { display: block; max-width: 100%; overflow-x: auto; }\n---\n\nHeadless integrations select `json`, `rpc`, or `acp` with `--mode`: a JavaScript Object Notation (JSON) event stream, JSON remote procedure call (RPC), or the agent client protocol (ACP). Each mode has a different framing contract; consumers must parse that protocol rather than decorated terminal text.\n\n## How do I start with the smallest surface?\n\n```bash\nxcsh --mode json --no-session --no-tools -p \"Return one sentence\"\n```\n\nCapture stdout as protocol data and stderr as diagnostics. Pin the xcsh version in automation and test framing against the exact release.\n\n## How do I retain and resume a JSON-mode session?\n\nUse a dedicated session directory when the JSON stream must survive process loss:\n\n```bash\nxcsh --mode json --session-dir /var/lib/my-controller/xcsh-sessions -p \"Return one sentence\"\n```\n\nThe first stdout line is a `SessionHeader`. Its `id` is a 16-character lowercase hexadecimal xcsh session ID.\nWith `--session-dir`, xcsh atomically writes and fsyncs the matching `<timestamp>_<id>.jsonl` file before\nemitting that header. The header's persisted `cwd`, `id`, and timestamp are the resumable record. Keep the path\ndiscovered in the session directory (or resolve the ID there), then continue through the documented resume argument:\n\n```bash\nxcsh --resume /var/lib/my-controller/xcsh-sessions/<timestamp>_<id>.jsonl \"Continue the task\"\n```\n\n`--no-session` deliberately produces no resumable file or session header. The stream's wire-only `model`, `provider`, and `thinking` fields describe the launch; they are not additional persisted session-header fields.\n\n## When do I use the software development kit (SDK) instead?\n\nUse the SDK when the host process needs in-memory session control, tool registration, or provider events. See [SDK automation](/xcsh/en/automate-extend/sdk/).\n\nChoose the boundary by ownership: JSON is a one-way event transcript, RPC supports a controlling\nclient, ACP integrates an editor or agent host, and the SDK shares a process. Never parse progress\ntext as protocol data. On shutdown, wait for the protocol's terminal event, close the input stream,\nand verify the child exits. Remove the dedicated session directory only when its retained transcript\nis no longer needed.\n",
|
|
@@ -88,9 +88,14 @@ function emptyState(initialTab: PluginTabId): PluginDashboardState {
|
|
|
88
88
|
function pluginStatus(plugin: DashboardPlugin): string {
|
|
89
89
|
if (!plugin.installed) return plugin.recommended ? "Recommended" : "Available";
|
|
90
90
|
if (plugin.hasUpdate) return plugin.updateVersion ? `Update ${plugin.updateVersion}` : "Update available";
|
|
91
|
+
if (plugin.enabled && plugin.lifecycle?.setupRequired) return "Enabled · setup managed";
|
|
91
92
|
return plugin.enabled ? "Enabled" : "Disabled";
|
|
92
93
|
}
|
|
93
94
|
|
|
95
|
+
function reviewIdentity(identity: string): string {
|
|
96
|
+
return identity.split("\0").filter(Boolean).join(" · ");
|
|
97
|
+
}
|
|
98
|
+
|
|
94
99
|
function pluginScope(plugin: DashboardPlugin): string {
|
|
95
100
|
return plugin.scope ?? (plugin.installed ? "user" : "—");
|
|
96
101
|
}
|
|
@@ -130,6 +135,7 @@ export class PluginDashboard extends Container {
|
|
|
130
135
|
#projectScopeAvailable: boolean;
|
|
131
136
|
|
|
132
137
|
onClose?: () => void;
|
|
138
|
+
onPrepareSetup?: (pluginName: string) => void;
|
|
133
139
|
onRequestRender?: () => void;
|
|
134
140
|
|
|
135
141
|
private constructor(
|
|
@@ -430,6 +436,9 @@ export class PluginDashboard extends Container {
|
|
|
430
436
|
#detailsActions(plugin: DashboardPlugin): string[] {
|
|
431
437
|
if (!plugin.installed) return ["Review installation"];
|
|
432
438
|
return [
|
|
439
|
+
...(plugin.enabled && plugin.source === "marketplace" && plugin.lifecycle?.setupRequired
|
|
440
|
+
? ["Check readiness / setup"]
|
|
441
|
+
: []),
|
|
433
442
|
plugin.enabled ? "Disable plugin" : "Enable plugin",
|
|
434
443
|
"Refresh plugin status",
|
|
435
444
|
...(plugin.hasUpdate && plugin.source === "marketplace" ? ["Upgrade plugin"] : []),
|
|
@@ -561,6 +570,9 @@ export class PluginDashboard extends Container {
|
|
|
561
570
|
if (action === "Review installation") {
|
|
562
571
|
this.#view = "install-review";
|
|
563
572
|
this.#actionIndex = 0;
|
|
573
|
+
} else if (action === "Check readiness / setup") {
|
|
574
|
+
this.#closed = true;
|
|
575
|
+
this.onPrepareSetup?.(marketplacePluginName(plugin));
|
|
564
576
|
} else if (action === "Remove plugin") {
|
|
565
577
|
this.#view = "remove-confirm";
|
|
566
578
|
this.#actionIndex = 0;
|
|
@@ -758,13 +770,17 @@ export class PluginDashboard extends Container {
|
|
|
758
770
|
if (wide) body.push(selectorRow(["Plugin", "Status", "Scope"], [inner - 33, 18, 9], false, "muted"));
|
|
759
771
|
for (let index = 0; index < this.#state.searchFiltered.length; index++) {
|
|
760
772
|
const plugin = this.#state.searchFiltered[index]!;
|
|
773
|
+
const baseName = plugin.displayName || plugin.name;
|
|
774
|
+
const duplicateName = this.#state.searchFiltered.some(
|
|
775
|
+
(candidate, candidateIndex) =>
|
|
776
|
+
candidateIndex !== index && (candidate.displayName || candidate.name) === baseName,
|
|
777
|
+
);
|
|
778
|
+
const listName = duplicateName && plugin.marketplace ? `${baseName} · ${plugin.marketplace}` : baseName;
|
|
761
779
|
const selected = index === this.#state.selectedIndex;
|
|
762
780
|
if (selected) selectedBodyIndex = body.length;
|
|
763
781
|
body.push(
|
|
764
782
|
selectorRow(
|
|
765
|
-
wide
|
|
766
|
-
? [plugin.displayName || plugin.name, pluginStatus(plugin), pluginScope(plugin)]
|
|
767
|
-
: [plugin.displayName || plugin.name],
|
|
783
|
+
wide ? [listName, pluginStatus(plugin), pluginScope(plugin)] : [listName],
|
|
768
784
|
wide ? [inner - 33, 18, 9] : [inner - 2],
|
|
769
785
|
selected,
|
|
770
786
|
plugin.installed && !plugin.enabled ? "muted" : "text",
|
|
@@ -928,7 +944,7 @@ export class PluginDashboard extends Container {
|
|
|
928
944
|
selectorRow([action], [inner - 2], index === this.#actionIndex),
|
|
929
945
|
),
|
|
930
946
|
[
|
|
931
|
-
`Target: ${review.identity
|
|
947
|
+
`Target: ${reviewIdentity(review.identity)}`,
|
|
932
948
|
`Scope: ${review.scope}`,
|
|
933
949
|
...review.changes.map(change => `${change.field}: ${change.before} → ${change.after}`),
|
|
934
950
|
review.consequence,
|
|
@@ -954,7 +970,7 @@ export class PluginDashboard extends Container {
|
|
|
954
970
|
[],
|
|
955
971
|
actions.map((action, index) => selectorRow([action], [inner - 2], index === this.#actionIndex)),
|
|
956
972
|
[
|
|
957
|
-
`Target: ${review.identity
|
|
973
|
+
`Target: ${reviewIdentity(review.identity)}`,
|
|
958
974
|
`Destination: ${this.#actionIndex === 2 ? "project scope" : this.#actionIndex === 1 ? "user scope" : "user scope (Cancel selected)"}`,
|
|
959
975
|
...review.changes.map(change => `${change.field}: ${change.before} → ${change.after}`),
|
|
960
976
|
review.consequence,
|
|
@@ -977,7 +993,7 @@ export class PluginDashboard extends Container {
|
|
|
977
993
|
[],
|
|
978
994
|
actions.map((action, index) => selectorRow([action], [inner - 2], index === this.#actionIndex)),
|
|
979
995
|
[
|
|
980
|
-
`Target: ${review.identity
|
|
996
|
+
`Target: ${reviewIdentity(review.identity)}`,
|
|
981
997
|
`Scope: ${review.scope}`,
|
|
982
998
|
...review.changes.map(change => `${change.field}: ${change.before} → ${change.after}`),
|
|
983
999
|
review.consequence,
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { Component } from "@f5-sales-demo/pi-tui";
|
|
2
|
+
import type { AsyncInputQuestion, AsyncQuestionItem } from "../../../../chat-ui/src/interactions/contract";
|
|
3
|
+
import { theme } from "../theme/theme";
|
|
4
|
+
import { selectorFrame, selectorFrameContentWidth, selectorRow } from "./selector-frame";
|
|
5
|
+
|
|
6
|
+
export interface AsyncInputReply {
|
|
7
|
+
type: "user_input_reply";
|
|
8
|
+
itemId: string;
|
|
9
|
+
questionId: string;
|
|
10
|
+
answer: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ResolvedAsyncQuestionReply {
|
|
14
|
+
reply: AsyncInputReply;
|
|
15
|
+
question: AsyncInputQuestion & { isSecret?: boolean };
|
|
16
|
+
position: number;
|
|
17
|
+
total: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function record(value: unknown): value is Record<string, unknown> {
|
|
21
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function parseAsyncInputReply(text: string): AsyncInputReply | undefined {
|
|
25
|
+
let value: unknown;
|
|
26
|
+
try {
|
|
27
|
+
value = JSON.parse(text);
|
|
28
|
+
} catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
if (
|
|
32
|
+
!record(value) ||
|
|
33
|
+
value.type !== "user_input_reply" ||
|
|
34
|
+
typeof value.itemId !== "string" ||
|
|
35
|
+
typeof value.questionId !== "string" ||
|
|
36
|
+
typeof value.answer !== "string"
|
|
37
|
+
)
|
|
38
|
+
return undefined;
|
|
39
|
+
return { type: "user_input_reply", itemId: value.itemId, questionId: value.questionId, answer: value.answer };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function resolveAsyncQuestionReply(
|
|
43
|
+
messages: readonly unknown[],
|
|
44
|
+
reply: AsyncInputReply,
|
|
45
|
+
): ResolvedAsyncQuestionReply | undefined {
|
|
46
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
47
|
+
const message = messages[index];
|
|
48
|
+
if (!record(message) || message.role !== "custom" || message.customType !== "async-user-input") continue;
|
|
49
|
+
const details = message.details;
|
|
50
|
+
if (!record(details) || !record(details.item) || details.item.id !== reply.itemId) continue;
|
|
51
|
+
if (!Array.isArray(details.questionIds) || !Array.isArray(details.item.questions)) continue;
|
|
52
|
+
return resolveAsyncQuestionReplyFromItem(
|
|
53
|
+
details.item as unknown as AsyncQuestionItem,
|
|
54
|
+
details.questionIds,
|
|
55
|
+
reply,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function resolveAsyncQuestionReplyFromItem(
|
|
62
|
+
item: AsyncQuestionItem,
|
|
63
|
+
questionIds: readonly unknown[],
|
|
64
|
+
reply: AsyncInputReply,
|
|
65
|
+
): ResolvedAsyncQuestionReply | undefined {
|
|
66
|
+
if (item.id !== reply.itemId || !Array.isArray(item.questions)) return undefined;
|
|
67
|
+
const position = questionIds.indexOf(reply.questionId);
|
|
68
|
+
const question = item.questions[position];
|
|
69
|
+
if (position < 0 || !record(question) || typeof question.title !== "string") return undefined;
|
|
70
|
+
return {
|
|
71
|
+
reply,
|
|
72
|
+
question: {
|
|
73
|
+
title: question.title,
|
|
74
|
+
...(Array.isArray(question.options) && question.options.every(option => typeof option === "string")
|
|
75
|
+
? { options: question.options }
|
|
76
|
+
: {}),
|
|
77
|
+
...(question.isSecret === true ? { isSecret: true } : {}),
|
|
78
|
+
},
|
|
79
|
+
position,
|
|
80
|
+
total: item.questions.length,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class QuestionTranscriptComponent implements Component {
|
|
85
|
+
private constructor(
|
|
86
|
+
private readonly state:
|
|
87
|
+
| { kind: "pending"; item: AsyncQuestionItem }
|
|
88
|
+
| { kind: "answered"; resolved: ResolvedAsyncQuestionReply },
|
|
89
|
+
) {}
|
|
90
|
+
|
|
91
|
+
static pending(item: AsyncQuestionItem): QuestionTranscriptComponent {
|
|
92
|
+
return new QuestionTranscriptComponent({ kind: "pending", item });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static answered(resolved: ResolvedAsyncQuestionReply): QuestionTranscriptComponent {
|
|
96
|
+
return new QuestionTranscriptComponent({ kind: "answered", resolved });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
render(width: number): string[] {
|
|
100
|
+
const inner = selectorFrameContentWidth(width);
|
|
101
|
+
if (this.state.kind === "pending") {
|
|
102
|
+
const count = this.state.item.questions.length;
|
|
103
|
+
return selectorFrame(
|
|
104
|
+
width,
|
|
105
|
+
Math.max(8, count + 7),
|
|
106
|
+
"Questions pending",
|
|
107
|
+
`${count} ${count === 1 ? "question" : "questions"} · Work continues while you answer`,
|
|
108
|
+
[],
|
|
109
|
+
this.state.item.questions.map((question, index) =>
|
|
110
|
+
selectorRow([`${index + 1}. ${question.title}`], [inner - 2], false),
|
|
111
|
+
),
|
|
112
|
+
[],
|
|
113
|
+
[`${theme.fg("contentAccent", "/questions")} to answer`],
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
const { question, reply, position, total } = this.state.resolved;
|
|
117
|
+
const answer = question.isSecret
|
|
118
|
+
? theme.fg("muted", "Answer hidden")
|
|
119
|
+
: reply.answer.replace(/^user_note:\s*/, "");
|
|
120
|
+
return selectorFrame(
|
|
121
|
+
width,
|
|
122
|
+
8,
|
|
123
|
+
"Answer recorded",
|
|
124
|
+
`Question ${position + 1} of ${total}`,
|
|
125
|
+
[question.title],
|
|
126
|
+
[{ content: `${theme.symbol("checkbox.checked")} ${answer}`, selected: false }],
|
|
127
|
+
[],
|
|
128
|
+
[],
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
invalidate(): void {}
|
|
133
|
+
}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { type Component, Editor, getKeybindings, matchesKey, type TUI, wrapTextWithAnsi } from "@f5-sales-demo/pi-tui";
|
|
2
2
|
import { INPUT_COPY, type InputQuestion, type InputResponse } from "../../../../chat-ui/src/interactions/contract";
|
|
3
3
|
import { QuestionForm } from "../../../../chat-ui/src/interactions/question-form";
|
|
4
|
-
import { getEditorTheme } from "../theme/theme";
|
|
4
|
+
import { getEditorTheme, theme } from "../theme/theme";
|
|
5
|
+
import { keyHint, rawKeyHint } from "./keybinding-hints";
|
|
6
|
+
import {
|
|
7
|
+
matchesSelectorKey,
|
|
8
|
+
type SelectorFrameLine,
|
|
9
|
+
selectorCancelHint,
|
|
10
|
+
selectorFrame,
|
|
11
|
+
selectorFrameContentWidth,
|
|
12
|
+
selectorKeys,
|
|
13
|
+
selectorRow,
|
|
14
|
+
} from "./selector-frame";
|
|
5
15
|
|
|
6
16
|
const graphemes = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
7
17
|
|
|
@@ -47,43 +57,81 @@ export class RequestUserInputComponent implements Component {
|
|
|
47
57
|
this.#editor.invalidate();
|
|
48
58
|
}
|
|
49
59
|
render(width: number): string[] {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
60
|
+
const height = this.tui.terminal.rows || 24;
|
|
61
|
+
const inner = selectorFrameContentWidth(width);
|
|
52
62
|
if (this.form.confirming) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
`
|
|
63
|
+
const body: SelectorFrameLine[] = [
|
|
64
|
+
selectorRow([`1. ${INPUT_COPY.proceed}`], [inner - 2], this.#confirmation === 0),
|
|
65
|
+
{ content: theme.fg("muted", ` Submit with unanswered questions.`), selected: false },
|
|
66
|
+
selectorRow([`2. ${INPUT_COPY.back}`], [inner - 2], this.#confirmation === 1),
|
|
67
|
+
{ content: theme.fg("muted", ` ${INPUT_COPY.backDescription}`), selected: false },
|
|
68
|
+
];
|
|
69
|
+
return selectorFrame(
|
|
70
|
+
width,
|
|
71
|
+
height,
|
|
72
|
+
"Submit answers?",
|
|
73
|
+
`${this.form.unanswered} unanswered ${this.form.unanswered === 1 ? "question" : "questions"}`,
|
|
74
|
+
[],
|
|
75
|
+
body,
|
|
76
|
+
[],
|
|
77
|
+
[`${keyHint("tui.select.confirm", "choose")} · ${selectorCancelHint("return")}`],
|
|
78
|
+
{ selectedBodyIndex: this.#confirmation * 2 },
|
|
57
79
|
);
|
|
58
|
-
add(`${this.#confirmation === 1 ? ">" : " "} 2. ${INPUT_COPY.back}`);
|
|
59
|
-
add(` ${INPUT_COPY.backDescription}`);
|
|
60
|
-
return lines;
|
|
61
80
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
65
|
-
add(this.form.question.header);
|
|
66
|
-
add(this.form.question.question);
|
|
67
|
-
add("");
|
|
81
|
+
const body: SelectorFrameLine[] = [];
|
|
82
|
+
let selectedBodyIndex: number | undefined;
|
|
68
83
|
for (const [index, option] of this.form.options.entries()) {
|
|
69
|
-
|
|
70
|
-
|
|
84
|
+
const highlighted = index === this.form.draft.highlighted;
|
|
85
|
+
if (highlighted) selectedBodyIndex = body.length;
|
|
86
|
+
const committed = highlighted && this.form.draft.committed;
|
|
87
|
+
body.push(
|
|
88
|
+
selectorRow(
|
|
89
|
+
[`${theme.symbol(committed ? "checkbox.checked" : "checkbox.unchecked")} ${index + 1}. ${option.label}`],
|
|
90
|
+
[inner - 2],
|
|
91
|
+
highlighted,
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
if (option.description.trim())
|
|
95
|
+
body.push({ content: theme.fg("muted", ` ${option.description}`), selected: false });
|
|
71
96
|
}
|
|
97
|
+
const details: string[] = [];
|
|
72
98
|
if (this.form.notesVisible) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
lines.push(
|
|
99
|
+
details.push(theme.bold(this.form.options.length ? INPUT_COPY.notes : INPUT_COPY.answer));
|
|
100
|
+
this.#editor.setMaxHeight(Math.max(1, height - 12));
|
|
101
|
+
details.push(
|
|
77
102
|
...(this.form.question.isSecret
|
|
78
|
-
? maskedEditorLines(this.#editor.getText(),
|
|
79
|
-
: this.#editor.render(
|
|
103
|
+
? maskedEditorLines(this.#editor.getText(), inner)
|
|
104
|
+
: this.#editor.render(inner)),
|
|
80
105
|
);
|
|
81
106
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
107
|
+
const submitLabel =
|
|
108
|
+
this.form.index === this.form.questions.length - 1 && this.form.questions.length > 1 ? "submit all" : "submit";
|
|
109
|
+
const interruptKeys = getKeybindings().getKeys("app.interrupt").join("/") || "Ctrl+C";
|
|
110
|
+
const footer = [
|
|
111
|
+
[
|
|
112
|
+
...(this.form.options.length
|
|
113
|
+
? [rawKeyHint(`1–${Math.min(9, this.form.options.length)}`, "answer"), rawKeyHint("Space", "commit")]
|
|
114
|
+
: []),
|
|
115
|
+
rawKeyHint("Tab", this.form.notesVisible ? "clear notes" : "notes"),
|
|
116
|
+
keyHint("tui.select.confirm", submitLabel),
|
|
117
|
+
...(this.form.questions.length > 1 && !this.form.notesVisible ? [rawKeyHint("←/→", "question")] : []),
|
|
118
|
+
this.form.notesVisible ? rawKeyHint(interruptKeys, "interrupt") : selectorCancelHint("interrupt"),
|
|
119
|
+
].join(" · "),
|
|
120
|
+
];
|
|
121
|
+
return selectorFrame(
|
|
122
|
+
width,
|
|
123
|
+
height,
|
|
124
|
+
"Answer questions",
|
|
125
|
+
`Question ${this.form.index + 1} of ${this.form.questions.length} · ${this.form.unanswered} unanswered`,
|
|
126
|
+
[theme.fg("contentAccent", this.form.question.header), this.form.question.question],
|
|
127
|
+
body,
|
|
128
|
+
details,
|
|
129
|
+
footer,
|
|
130
|
+
{
|
|
131
|
+
selectedBodyIndex,
|
|
132
|
+
overflowHint: `${selectorKeys("up")}/${selectorKeys("down")}: scroll choices`,
|
|
133
|
+
},
|
|
85
134
|
);
|
|
86
|
-
return lines;
|
|
87
135
|
}
|
|
88
136
|
#restore(): void {
|
|
89
137
|
const callback = this.#editor.onChange;
|
|
@@ -95,19 +143,19 @@ export class RequestUserInputComponent implements Component {
|
|
|
95
143
|
if (this.#closed) return;
|
|
96
144
|
this.form.interact();
|
|
97
145
|
const keys = getKeybindings();
|
|
98
|
-
const enter =
|
|
146
|
+
const enter = matchesSelectorKey(data, "confirm");
|
|
99
147
|
if (this.form.confirming) {
|
|
100
|
-
if (
|
|
148
|
+
if (matchesSelectorKey(data, "cancel") || matchesKey(data, "backspace")) this.form.goBack();
|
|
101
149
|
else if (enter) {
|
|
102
150
|
if (this.#confirmation === 0) this.#finish(this.form.finish());
|
|
103
151
|
else this.form.goBack();
|
|
104
152
|
} else if (matchesKey(data, "up") || matchesKey(data, "down") || data === "j" || data === "k")
|
|
105
153
|
this.#confirmation = 1 - this.#confirmation;
|
|
106
154
|
else if (data === "1" || data === "2") this.#confirmation = Number(data) - 1;
|
|
107
|
-
} else if (
|
|
155
|
+
} else if (matchesSelectorKey(data, "cancel")) {
|
|
108
156
|
if (this.form.escape() === "interrupted") this.#finish(undefined);
|
|
109
157
|
this.#restore();
|
|
110
|
-
} else if (
|
|
158
|
+
} else if (keys.matches(data, "app.interrupt")) {
|
|
111
159
|
if (this.form.notesVisible && this.form.draft.notes) {
|
|
112
160
|
this.form.editNotes("");
|
|
113
161
|
this.#restore();
|
|
@@ -135,8 +183,8 @@ export class RequestUserInputComponent implements Component {
|
|
|
135
183
|
this.form.moveQuestion(1);
|
|
136
184
|
this.#restore();
|
|
137
185
|
} else if (this.form.notesVisible) this.#editor.handleInput(data);
|
|
138
|
-
else if (
|
|
139
|
-
else if (
|
|
186
|
+
else if (matchesSelectorKey(data, "up")) this.form.moveOption(-1);
|
|
187
|
+
else if (matchesSelectorKey(data, "down")) this.form.moveOption(1);
|
|
140
188
|
else if (/^[1-9]$/.test(data) && Number(data) <= this.form.options.length) {
|
|
141
189
|
this.form.selectOption(Number(data) - 1);
|
|
142
190
|
this.#submit();
|
|
@@ -11,6 +11,11 @@ import {
|
|
|
11
11
|
createToolGutter,
|
|
12
12
|
type GutterBlock,
|
|
13
13
|
} from "../../modes/components/gutter-block";
|
|
14
|
+
import {
|
|
15
|
+
parseAsyncInputReply,
|
|
16
|
+
QuestionTranscriptComponent,
|
|
17
|
+
resolveAsyncQuestionReplyFromItem,
|
|
18
|
+
} from "../../modes/components/question-transcript";
|
|
14
19
|
import { ReadToolGroupComponent } from "../../modes/components/read-tool-group";
|
|
15
20
|
import { TodoReminderComponent } from "../../modes/components/todo-reminder";
|
|
16
21
|
import { ToolExecutionComponent } from "../../modes/components/tool-execution";
|
|
@@ -36,6 +41,10 @@ export class EventController {
|
|
|
36
41
|
#backgroundCompletionPending = false;
|
|
37
42
|
#pendingGutters = new Map<string, GutterBlock<any>>();
|
|
38
43
|
#readGroupAggregator = new ReadGroupOutcomeAggregator();
|
|
44
|
+
#asyncQuestionBatches = new Map<
|
|
45
|
+
string,
|
|
46
|
+
{ item: Extract<AgentSessionEvent, { type: "async_user_input" }>["item"]; questionIds: string[] }
|
|
47
|
+
>();
|
|
39
48
|
// streamingAssistantGutter is stored on ctx for cross-controller access (e.g. thinking toggle)
|
|
40
49
|
constructor(private ctx: InteractiveModeContext) {}
|
|
41
50
|
|
|
@@ -147,7 +156,11 @@ export class EventController {
|
|
|
147
156
|
if (!this.ctx.session.getPlanModeState()?.enabled) await this.ctx.setRemoteCollaborationMode("default");
|
|
148
157
|
break;
|
|
149
158
|
case "async_user_input":
|
|
150
|
-
this.
|
|
159
|
+
this.#asyncQuestionBatches.set(event.item.id, { item: event.item, questionIds: event.questionIds });
|
|
160
|
+
this.ctx.chatContainer.addChild(
|
|
161
|
+
createSystemGutter(this.ctx.ui, QuestionTranscriptComponent.pending(event.item)),
|
|
162
|
+
);
|
|
163
|
+
this.ctx.ui.requestRender();
|
|
151
164
|
break;
|
|
152
165
|
case "plan_available": {
|
|
153
166
|
void this.ctx
|
|
@@ -222,6 +235,10 @@ export class EventController {
|
|
|
222
235
|
this.ctx.ui.requestRender();
|
|
223
236
|
} else if (event.message.role === "user") {
|
|
224
237
|
const textContent = this.ctx.getUserMessageText(event.message);
|
|
238
|
+
const reply = parseAsyncInputReply(textContent);
|
|
239
|
+
const batch = reply ? this.#asyncQuestionBatches.get(reply.itemId) : undefined;
|
|
240
|
+
const resolved =
|
|
241
|
+
reply && batch ? resolveAsyncQuestionReplyFromItem(batch.item, batch.questionIds, reply) : undefined;
|
|
225
242
|
const imageCount =
|
|
226
243
|
typeof event.message.content === "string"
|
|
227
244
|
? 0
|
|
@@ -230,7 +247,11 @@ export class EventController {
|
|
|
230
247
|
|
|
231
248
|
this.#resetReadGroup();
|
|
232
249
|
if (this.ctx.optimisticUserMessageSignature !== signature) {
|
|
233
|
-
|
|
250
|
+
if (resolved) {
|
|
251
|
+
this.ctx.chatContainer.addChild(
|
|
252
|
+
createSystemGutter(this.ctx.ui, QuestionTranscriptComponent.answered(resolved)),
|
|
253
|
+
);
|
|
254
|
+
} else this.ctx.addMessageToChat(event.message);
|
|
234
255
|
}
|
|
235
256
|
this.ctx.optimisticUserMessageSignature = undefined;
|
|
236
257
|
|
|
@@ -577,7 +577,7 @@ export class SelectorController {
|
|
|
577
577
|
this.showSelector(done => {
|
|
578
578
|
dashboard.onClose = () => {
|
|
579
579
|
done();
|
|
580
|
-
void this.ctx.refreshSlashCommandState(undefined, {
|
|
580
|
+
void this.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
|
|
581
581
|
this.ctx.ui.requestRender();
|
|
582
582
|
};
|
|
583
583
|
dashboard.onRequestRender = () => {
|
|
@@ -594,10 +594,18 @@ export class SelectorController {
|
|
|
594
594
|
initialTab,
|
|
595
595
|
);
|
|
596
596
|
this.showSelector(done => {
|
|
597
|
-
|
|
597
|
+
const close = (setupPlugin?: string) => {
|
|
598
598
|
done();
|
|
599
|
-
this.ctx.
|
|
599
|
+
void this.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true }).finally(() => {
|
|
600
|
+
if (setupPlugin) this.ctx.editor.setText(`/plugin setup ${setupPlugin}`);
|
|
601
|
+
this.ctx.ui.setFocus(this.ctx.editor);
|
|
602
|
+
this.ctx.ui.requestRender();
|
|
603
|
+
});
|
|
604
|
+
};
|
|
605
|
+
dashboard.onClose = () => {
|
|
606
|
+
close();
|
|
600
607
|
};
|
|
608
|
+
dashboard.onPrepareSetup = pluginName => close(pluginName);
|
|
601
609
|
dashboard.onRequestRender = () => {
|
|
602
610
|
this.ctx.ui.requestRender();
|
|
603
611
|
};
|
|
@@ -491,13 +491,14 @@ export class InteractiveMode implements InteractiveModeContext {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
/** Reload slash commands and autocomplete for the provided working directory. */
|
|
494
|
-
async refreshSlashCommandState(cwd?: string, options?: {
|
|
494
|
+
async refreshSlashCommandState(cwd?: string, options?: { reloadExtensions?: boolean }): Promise<void> {
|
|
495
495
|
const basePath = cwd ?? this.sessionManager.getCwd();
|
|
496
|
-
if (options?.
|
|
496
|
+
if (options?.reloadExtensions && this.session.extensionRunner) {
|
|
497
497
|
const result = await discoverAndLoadExtensions([], basePath);
|
|
498
|
-
this.session.extensionRunner.
|
|
498
|
+
this.session.extensionRunner.reloadExtensions(result.extensions, result.runtime);
|
|
499
|
+
await this.session.refreshExtensionTools();
|
|
499
500
|
for (const error of result.errors) {
|
|
500
|
-
logger.warn("Plugin
|
|
501
|
+
logger.warn("Plugin extension reload skipped an extension", error);
|
|
501
502
|
}
|
|
502
503
|
}
|
|
503
504
|
const fileCommands = await loadSlashCommands({ cwd: basePath });
|
package/src/modes/types.ts
CHANGED
|
@@ -203,7 +203,7 @@ export interface InteractiveModeContext {
|
|
|
203
203
|
executeCompaction(customInstructionsOrOptions?: string | CompactOptions, isAuto?: boolean): Promise<void>;
|
|
204
204
|
openInBrowser(urlOrPath: string): void;
|
|
205
205
|
openHttpUrl(url: string): Promise<OpenHttpUrlResult>;
|
|
206
|
-
refreshSlashCommandState(cwd?: string, options?: {
|
|
206
|
+
refreshSlashCommandState(cwd?: string, options?: { reloadExtensions?: boolean }): Promise<void>;
|
|
207
207
|
|
|
208
208
|
// Selector handling
|
|
209
209
|
showSettingsSelector(): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AgentMessage } from "@f5-sales-demo/pi-agent-core";
|
|
2
2
|
import type { AssistantMessage, ImageContent, Message } from "@f5-sales-demo/pi-ai";
|
|
3
3
|
import { Spacer, Text, TruncatedText } from "@f5-sales-demo/pi-tui";
|
|
4
|
+
import type { AsyncQuestionItem } from "../../../../chat-ui/src/interactions/contract";
|
|
4
5
|
import { settings } from "../../config/settings";
|
|
5
6
|
import { createMarkdownMediaOptions } from "../../media/markdown-resolver";
|
|
6
7
|
import { AssistantMessageComponent } from "../../modes/components/assistant-message";
|
|
@@ -16,6 +17,11 @@ import {
|
|
|
16
17
|
} from "../../modes/components/gutter-block";
|
|
17
18
|
import { MediaMessageComponent } from "../../modes/components/media-message";
|
|
18
19
|
import { PythonExecutionComponent } from "../../modes/components/python-execution";
|
|
20
|
+
import {
|
|
21
|
+
parseAsyncInputReply,
|
|
22
|
+
QuestionTranscriptComponent,
|
|
23
|
+
resolveAsyncQuestionReplyFromItem,
|
|
24
|
+
} from "../../modes/components/question-transcript";
|
|
19
25
|
import { ReadToolGroupComponent } from "../../modes/components/read-tool-group";
|
|
20
26
|
import { SkillMessageComponent } from "../../modes/components/skill-message";
|
|
21
27
|
import { ToolExecutionComponent } from "../../modes/components/tool-execution";
|
|
@@ -35,6 +41,7 @@ type QueuedMessages = {
|
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
export class UiHelpers {
|
|
44
|
+
#asyncQuestionBatches = new Map<string, { item: AsyncQuestionItem; questionIds: string[] }>();
|
|
38
45
|
constructor(private ctx: InteractiveModeContext) {}
|
|
39
46
|
|
|
40
47
|
/** Extract text content from a user message */
|
|
@@ -108,7 +115,24 @@ export class UiHelpers {
|
|
|
108
115
|
}
|
|
109
116
|
case "hookMessage":
|
|
110
117
|
case "custom": {
|
|
118
|
+
if (message.customType === "async-user-input") {
|
|
119
|
+
const details = message.details as { item?: AsyncQuestionItem; questionIds?: unknown[] } | undefined;
|
|
120
|
+
if (details?.item && details.questionIds?.every(id => typeof id === "string"))
|
|
121
|
+
this.#asyncQuestionBatches.set(details.item.id, {
|
|
122
|
+
item: details.item,
|
|
123
|
+
questionIds: details.questionIds as string[],
|
|
124
|
+
});
|
|
125
|
+
}
|
|
111
126
|
if (message.display) {
|
|
127
|
+
if (message.customType === "async-user-input") {
|
|
128
|
+
const details = message.details as { item?: AsyncQuestionItem } | undefined;
|
|
129
|
+
if (details?.item) {
|
|
130
|
+
this.ctx.chatContainer.addChild(
|
|
131
|
+
createSystemGutter(this.ctx.ui, QuestionTranscriptComponent.pending(details.item)),
|
|
132
|
+
);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
112
136
|
if (message.customType === "async-result") {
|
|
113
137
|
const details = (
|
|
114
138
|
message as CustomMessage<{
|
|
@@ -187,6 +211,16 @@ export class UiHelpers {
|
|
|
187
211
|
case "developer": {
|
|
188
212
|
const textContent = this.ctx.getUserMessageText(message);
|
|
189
213
|
if (textContent) {
|
|
214
|
+
const reply = message.role === "user" ? parseAsyncInputReply(textContent) : undefined;
|
|
215
|
+
const batch = reply ? this.#asyncQuestionBatches.get(reply.itemId) : undefined;
|
|
216
|
+
const resolved =
|
|
217
|
+
reply && batch ? resolveAsyncQuestionReplyFromItem(batch.item, batch.questionIds, reply) : undefined;
|
|
218
|
+
if (resolved) {
|
|
219
|
+
this.ctx.chatContainer.addChild(
|
|
220
|
+
createSystemGutter(this.ctx.ui, QuestionTranscriptComponent.answered(resolved)),
|
|
221
|
+
);
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
190
224
|
const isSynthetic = message.role === "developer" ? true : (message.synthetic ?? false);
|
|
191
225
|
const userComponent = new UserMessageComponent(textContent, isSynthetic);
|
|
192
226
|
this.ctx.chatContainer.addChild(userComponent);
|
|
@@ -235,6 +269,7 @@ export class UiHelpers {
|
|
|
235
269
|
options: { updateFooter?: boolean; populateHistory?: boolean } = {},
|
|
236
270
|
): void {
|
|
237
271
|
this.ctx.optimisticUserMessageSignature = undefined;
|
|
272
|
+
this.#asyncQuestionBatches.clear();
|
|
238
273
|
this.ctx.pendingTools.clear();
|
|
239
274
|
|
|
240
275
|
if (options.updateFooter) {
|
|
@@ -112,7 +112,7 @@ import type {
|
|
|
112
112
|
UserPromptKind,
|
|
113
113
|
} from "../extensibility/extensions";
|
|
114
114
|
import type { CompactOptions, ContextUsage } from "../extensibility/extensions/types";
|
|
115
|
-
import { ExtensionToolWrapper } from "../extensibility/extensions/wrapper";
|
|
115
|
+
import { ExtensionToolWrapper, wrapRegisteredTools } from "../extensibility/extensions/wrapper";
|
|
116
116
|
import type { HookCommandContext } from "../extensibility/hooks/types";
|
|
117
117
|
import type { Skill, SkillWarning } from "../extensibility/skills";
|
|
118
118
|
import { expandSlashCommand, type FileSlashCommand } from "../extensibility/slash-commands";
|
|
@@ -644,6 +644,7 @@ export class AgentSession {
|
|
|
644
644
|
#discoverableToolSearchIndex: DiscoverableMCPSearchIndex | null = null;
|
|
645
645
|
#selectedMCPToolNames = new Set<string>();
|
|
646
646
|
#rpcHostToolNames = new Set<string>();
|
|
647
|
+
#extensionToolNames = new Set<string>();
|
|
647
648
|
#defaultSelectedMCPServerNames = new Set<string>();
|
|
648
649
|
#defaultSelectedMCPToolNames = new Set<string>();
|
|
649
650
|
#sessionDefaultSelectedMCPToolNames = new Map<string, string[]>();
|
|
@@ -718,6 +719,9 @@ export class AgentSession {
|
|
|
718
719
|
this.#promptTemplates = config.promptTemplates ?? [];
|
|
719
720
|
this.#slashCommands = config.slashCommands ?? [];
|
|
720
721
|
this.#extensionRunner = config.extensionRunner;
|
|
722
|
+
this.#extensionToolNames = new Set(
|
|
723
|
+
config.extensionRunner?.getAllRegisteredTools?.().map(tool => tool.definition.name) ?? [],
|
|
724
|
+
);
|
|
721
725
|
this.#skills = config.skills ?? [];
|
|
722
726
|
this.#skillWarnings = config.skillWarnings ?? [];
|
|
723
727
|
this.#customCommands = config.customCommands ?? [];
|
|
@@ -3216,6 +3220,29 @@ export class AgentSession {
|
|
|
3216
3220
|
await this.#applyActiveToolsByName(nextActive, { previousSelectedMCPToolNames });
|
|
3217
3221
|
}
|
|
3218
3222
|
|
|
3223
|
+
/** Replace extension-owned tools after plugin installation, upgrade, disablement, or removal. */
|
|
3224
|
+
async refreshExtensionTools(): Promise<void> {
|
|
3225
|
+
if (!this.#extensionRunner) return;
|
|
3226
|
+
const previousActiveToolNames = this.getActiveToolNames();
|
|
3227
|
+
const previousExtensionToolNames = new Set(this.#extensionToolNames);
|
|
3228
|
+
for (const name of this.#extensionToolNames) this.#toolRegistry.delete(name);
|
|
3229
|
+
|
|
3230
|
+
const wrapped = wrapRegisteredTools(this.#extensionRunner.getAllRegisteredTools(), this.#extensionRunner).map(
|
|
3231
|
+
tool => new ExtensionToolWrapper(tool, this.#extensionRunner!) as AgentTool,
|
|
3232
|
+
);
|
|
3233
|
+
this.#extensionToolNames = new Set(wrapped.map(tool => tool.name));
|
|
3234
|
+
for (const tool of wrapped) this.#toolRegistry.set(tool.name, tool);
|
|
3235
|
+
|
|
3236
|
+
this.#setDiscoverableTools();
|
|
3237
|
+
const preserved = previousActiveToolNames.filter(
|
|
3238
|
+
name => !previousExtensionToolNames.has(name) || this.#extensionToolNames.has(name),
|
|
3239
|
+
);
|
|
3240
|
+
const newlyAvailable = wrapped
|
|
3241
|
+
.filter(tool => !tool.hidden && !previousActiveToolNames.includes(tool.name))
|
|
3242
|
+
.map(tool => tool.name);
|
|
3243
|
+
await this.#applyActiveToolsByName([...new Set([...preserved, ...newlyAvailable])]);
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3219
3246
|
/**
|
|
3220
3247
|
* Replace RPC host-owned tools and refresh the active tool set before the next model call.
|
|
3221
3248
|
*/
|
|
@@ -1501,7 +1501,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
|
|
|
1501
1501
|
});
|
|
1502
1502
|
if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
|
|
1503
1503
|
else if (outcome === "succeeded") {
|
|
1504
|
-
await runtime.ctx.refreshSlashCommandState(undefined, {
|
|
1504
|
+
await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
|
|
1505
1505
|
const setupResult = await executeInstallAuthorizedSetup({
|
|
1506
1506
|
plugin: name,
|
|
1507
1507
|
lifecycle: prepared.target,
|
|
@@ -1535,7 +1535,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
|
|
|
1535
1535
|
});
|
|
1536
1536
|
if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
|
|
1537
1537
|
else if (outcome === "succeeded") {
|
|
1538
|
-
await runtime.ctx.refreshSlashCommandState(undefined, {
|
|
1538
|
+
await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
|
|
1539
1539
|
runtime.ctx.showStatus(
|
|
1540
1540
|
t("commands.plugin.uninstalled", {
|
|
1541
1541
|
pluginId: uninstArgs.pluginId,
|
|
@@ -1574,7 +1574,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
|
|
|
1574
1574
|
});
|
|
1575
1575
|
if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
|
|
1576
1576
|
else if (outcome === "succeeded") {
|
|
1577
|
-
await runtime.ctx.refreshSlashCommandState(undefined, {
|
|
1577
|
+
await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
|
|
1578
1578
|
runtime.ctx.showStatus(
|
|
1579
1579
|
isEnable
|
|
1580
1580
|
? t("commands.plugin.enabled", { pluginId: parsed.pluginId })
|
|
@@ -1610,7 +1610,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
|
|
|
1610
1610
|
});
|
|
1611
1611
|
if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
|
|
1612
1612
|
else if (outcome === "succeeded") {
|
|
1613
|
-
await runtime.ctx.refreshSlashCommandState(undefined, {
|
|
1613
|
+
await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
|
|
1614
1614
|
showPluginStatus(
|
|
1615
1615
|
t("commands.plugin.upgraded", {
|
|
1616
1616
|
pluginId: upArgs.pluginId,
|
|
@@ -1640,7 +1640,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
|
|
|
1640
1640
|
else if (outcome === "unresolved")
|
|
1641
1641
|
runtime.ctx.showError("Plugin upgrades remain unresolved; retry from a fresh review.");
|
|
1642
1642
|
else if (outcome === "succeeded" && result) {
|
|
1643
|
-
await runtime.ctx.refreshSlashCommandState(undefined, {
|
|
1643
|
+
await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
|
|
1644
1644
|
const lines = result.completed.map(
|
|
1645
1645
|
update => ` ${update.pluginId} [${update.scope}]: ${update.from} -> ${update.to}`,
|
|
1646
1646
|
);
|
|
@@ -1819,7 +1819,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
|
|
|
1819
1819
|
|
|
1820
1820
|
pluginMetadataRefreshes.add(runtime.ctx);
|
|
1821
1821
|
runtime.ctx.showStatus(
|
|
1822
|
-
"Refreshing plugin metadata and
|
|
1822
|
+
"Refreshing plugin metadata and extension registrations… Running plugin processes will not be restarted.",
|
|
1823
1823
|
);
|
|
1824
1824
|
try {
|
|
1825
1825
|
// Invalidate the fs content cache for all registry files so
|
|
@@ -1830,9 +1830,9 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
|
|
|
1830
1830
|
const projectPath = await resolveActiveProjectRegistryPath(runtime.ctx.sessionManager.getCwd());
|
|
1831
1831
|
if (projectPath) invalidateFsCache(projectPath);
|
|
1832
1832
|
clearXcshPluginRootsCache();
|
|
1833
|
-
await runtime.ctx.refreshSlashCommandState(undefined, {
|
|
1833
|
+
await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
|
|
1834
1834
|
runtime.ctx.showStatus(
|
|
1835
|
-
"Plugin metadata and
|
|
1835
|
+
"Plugin metadata and extension registrations refreshed. Commands, integrations, profile collectors, hooks, tools, skills, agents, advisories, and MCP metadata now use the latest discovered files. Running plugin processes were not restarted.",
|
|
1836
1836
|
);
|
|
1837
1837
|
} catch (error) {
|
|
1838
1838
|
const message = error instanceof Error ? error.message : String(error);
|