Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

feat(ok): ACP slash-command recognition in the composer + environment note (PRD-7842) (#3396)

mike-inkeepc89793867558
diff --git a/.changeset/acp-slash-commands.md b/.changeset/acp-slash-commands.md
new file mode 100644
index 000000000..b8c6bdb63
--- /dev/null
+++ b/.changeset/acp-slash-commands.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+The agent-thread composer now recognizes slash commands. Typing `/` at the start of a message opens a searchable, keyboard-navigable picker of the commands the agent advertises over ACP; a recognized `/command` renders as a highlighted token while an unrecognized one gets a dashed underline and a hint explaining it will be sent as plain text. Agents that advertise no commands say so honestly — the picker never implies support that isn't there. Each agent is also now told, at the start of every new session, that it is running inside OpenKnowledge over ACP rather than in its own terminal app, which reduces confident recommendations of host-only features (like Claude's `/tasks` or `Ctrl+O`) that don't exist here.
diff --git a/packages/app/src/components/acp/ThreadView.tsx b/packages/app/src/components/acp/ThreadView.tsx
index 963d28d2b..87342e1e4 100644
--- a/packages/app/src/components/acp/ThreadView.tsx
+++ b/packages/app/src/components/acp/ThreadView.tsx
@@ -2937,6 +2937,11 @@ function ThreadComposer({
: t`Message ${agentName}`
}
disabled={composerDisabled}
+ // The advertised slash-command corpus: null until the agent's
+ // `available_commands_update` arrives, then the live list. Passing it
+ // (vs omitting) is what mounts the `/` autocomplete — only this
+ // surface dispatches to an agent that can execute commands.
+ slashCommands={info.availableCommands ?? null}
// The wrapper alone renders the field chrome and focus ring; this is a
// bare scrolling text region sized to the old textarea (single slim
// line at rest, capped growth). Full width — the action bar sits on
diff --git a/packages/app/src/components/acp/composer-mention-input.test-helper.tsx b/packages/app/src/components/acp/composer-mention-input.test-helper.tsx
index 6b80773e5..162fad263 100644
--- a/packages/app/src/components/acp/composer-mention-input.test-helper.tsx
+++ b/packages/app/src/components/acp/composer-mention-input.test-helper.tsx
@@ -46,6 +46,12 @@ export function MockComposerMentionInput({
const notify = () => onEmptyChange((localRef.current?.value.trim() ?? '') === '');
useImperativeHandle(ref, () => ({
focus: () => localRef.current?.focus(),
+ focusEnd: () => {
+ const el = localRef.current;
+ if (!el) return;
+ el.focus();
+ el.setSelectionRange(el.value.length, el.value.length);
+ },
blur: () => localRef.current?.blur(),
clear: () => {
if (localRef.current) localRef.current.value = '';
diff --git a/packages/app/src/components/focus-composer-on-card-pointer.dom.test.ts b/packages/app/src/components/focus-composer-on-card-pointer.dom.test.ts
index 8949c330a..0d1e0c24d 100644
--- a/packages/app/src/components/focus-composer-on-card-pointer.dom.test.ts
+++ b/packages/app/src/components/focus-composer-on-card-pointer.dom.test.ts
@@ -26,7 +26,10 @@ function harness() {
let prevented = 0;
let focused = 0;
- const inputRef = { current: { focus: () => (focused += 1) } };
+ let focusedEnd = 0;
+ const inputRef: { current: { focus: () => void; focusEnd?: () => void } } = {
+ current: { focus: () => (focused += 1) },
+ };
const press = (target: HTMLElement) => {
focusComposerInputOnCardPointer(
{ target, currentTarget: card, preventDefault: () => (prevented += 1) },
@@ -39,7 +42,10 @@ function harness() {
control,
portaledRow,
press,
- counts: () => ({ prevented, focused }),
+ withFocusEnd: () => {
+ inputRef.current.focusEnd = () => (focusedEnd += 1);
+ },
+ counts: () => ({ prevented, focused, focusedEnd }),
};
}
@@ -53,13 +59,23 @@ describe('the composer card pointer affordance', () => {
// text-selection drag starts on the padding.
const { padding, press, counts } = harness();
press(padding);
- expect(counts()).toEqual({ prevented: 1, focused: 1 });
+ expect(counts()).toEqual({ prevented: 1, focused: 1, focusedEnd: 0 });
+ });
+
+ test('a handle offering focusEnd gets the caret-at-end path, not plain focus', () => {
+ // Clicking dead space means "continue typing" — the real composer handle
+ // (which offers focusEnd) must land the caret at the END of the draft,
+ // never wherever the last selection sat (e.g. before a leading pill).
+ const { padding, press, withFocusEnd, counts } = harness();
+ withFocusEnd();
+ press(padding);
+ expect(counts()).toEqual({ prevented: 1, focused: 0, focusedEnd: 1 });
});
test("a press on a control the card owns is the control's", () => {
const { control, press, counts } = harness();
press(control);
- expect(counts()).toEqual({ prevented: 0, focused: 0 });
+ expect(counts()).toEqual({ prevented: 0, focused: 0, focusedEnd: 0 });
});
test('a press inside a portaled floater is left alone', () => {
@@ -67,6 +83,6 @@ describe('the composer card pointer affordance', () => {
// submenu layer before the row's `click` landed — so the pick was lost.
const { portaledRow, press, counts } = harness();
press(portaledRow);
- expect(counts()).toEqual({ prevented: 0, focused: 0 });
+ expect(counts()).toEqual({ prevented: 0, focused: 0, focusedEnd: 0 });
});
});
diff --git a/packages/app/src/components/focus-composer-on-card-pointer.ts b/packages/app/src/components/focus-composer-on-card-pointer.ts
index 42c817ab4..a2585d3d6 100644
--- a/packages/app/src/components/focus-composer-on-card-pointer.ts
+++ b/packages/app/src/components/focus-composer-on-card-pointer.ts
@@ -42,7 +42,7 @@ export function focusComposerInputOnCardPointer(
// Any focusable input handle — in practice the ProseMirror
// `ComposerMentionInputHandle`; typed structurally so any `focus()`-bearing
// handle works.
- inputRef: RefObject<{ focus: () => void } | null>,
+ inputRef: RefObject<{ focus: () => void; focusEnd?: () => void } | null>,
): void {
if (!(event.target instanceof HTMLElement)) return;
// React portals bubble synthetic events along the REACT tree, not the DOM
@@ -61,5 +61,12 @@ export function focusComposerInputOnCardPointer(
}
if (event.target.closest(INTERACTIVE_TARGET_SELECTOR)) return;
event.preventDefault();
- inputRef.current?.focus();
+ const handle = inputRef.current;
+ if (handle === null) return;
+ // Clicking dead space means "continue typing" — caret at the END, the
+ // chat-composer convention. Plain focus() restores the last selection,
+ // which after a blur can sit anywhere (including before a leading command
+ // pill). Handles without focusEnd keep the old restore behavior.
+ if (handle.focusEnd !== undefined) handle.focusEnd();
+ else handle.focus();
}
diff --git a/packages/app/src/editor/ComposerMentionInput.dom.test.tsx b/packages/app/src/editor/ComposerMentionInput.dom.test.tsx
index 1b93822b3..5963f55d3 100644
--- a/packages/app/src/editor/ComposerMentionInput.dom.test.tsx
+++ b/packages/app/src/editor/ComposerMentionInput.dom.test.tsx
@@ -26,6 +26,7 @@ import {
isComposerEmpty,
serializeComposerContent,
} from './composer-mention/composer-mention';
+import { suggestionHasSelectableItem } from './extensions/suggestion-floating-ui';
function makeEditor(content?: Content) {
return new Editor({ extensions: composerMentionExtensions(), content });
@@ -114,6 +115,27 @@ describe('serializeComposerContent / isComposerEmpty', () => {
}
});
+ test('a picked command pill serializes to /name and counts as content on EVERY surface', () => {
+ // The pill node is registered in the shared schema even for surfaces that
+ // can't create one (this editor has no slash corpus) — a draft holding a
+ // pill must restore and serialize everywhere, never drop to empty.
+ const editor = makeEditor(
+ paragraph(
+ { type: 'composerCommand', attrs: { name: 'review', description: '', hint: '' } },
+ { type: 'text', text: ' the diff' },
+ ),
+ );
+ try {
+ expect(serializeComposerContent(editor)).toEqual({
+ instruction: '/review the diff',
+ mentions: [],
+ });
+ expect(isComposerEmpty(editor)).toBe(false);
+ } finally {
+ editor.destroy();
+ }
+ });
+
test('plain prose carries no mentions', () => {
const editor = makeEditor(paragraph({ type: 'text', text: 'just words' }));
try {
@@ -146,6 +168,27 @@ describe('ComposerMentionInput (component)', () => {
expect(onSubmit).toHaveBeenCalledTimes(1);
});
+ test('focusEnd places the caret at the end of the draft', () => {
+ // The card-whitespace affordance: clicking dead space means "continue
+ // typing", so the caret must land AFTER existing content — plain focus()
+ // restores the last selection, which after a blur can sit anywhere
+ // (including before a leading command pill).
+ const ref = createRef<ComposerMentionInputHandle>();
+ render(
+ <ComposerMentionInput
+ ref={ref}
+ ariaLabel="Ask AI"
+ onEmptyChange={() => {}}
+ onSubmit={() => {}}
+ initialDoc={paragraph({ type: 'text', text: 'draft text' }) as JSONContent}
+ />,
+ );
+ const box = screen.getByRole('textbox', { name: 'Ask AI' });
+ const editor = getComposerEditor(box);
+ ref.current?.focusEnd();
+ expect(editor.state.selection.from).toBe(editor.state.doc.content.size - 1);
+ });
+
test('setText replaces the field with plain text (read back via getContent)', () => {
const ref = createRef<ComposerMentionInputHandle>();
render(
@@ -422,16 +465,26 @@ describe('ComposerMentionInput — Enter defers to the @-mention popup', () => {
let fetchSpy: ReturnType<typeof vi.spyOn>;
beforeEach(() => {
- // The suggestion's async `items` step calls `fetch('/api/pages')`; jsdom has
- // no backend, so stub it to an empty corpus. The plugin's `active` state
- // does not depend on the fetch resolving — it is computed synchronously from
- // the inserted `@`-trigger — so the empty corpus does not affect the assertion.
+ // The suggestion's async `items` step calls `fetch('/api/pages')`; jsdom
+ // has no backend, so stub a one-page corpus that matches the `@foo`
+ // trigger — deferral is keyed on the popup having a SELECTABLE item, so
+ // the tests below need the fetch to actually produce one.
fetchSpy = vi.spyOn(globalThis, 'fetch').mockImplementation(
async () =>
- new Response(JSON.stringify({ pages: [], documents: [] }), {
- status: 200,
- headers: { 'content-type': 'application/json' },
- }),
+ new Response(
+ JSON.stringify({
+ pages: [
+ {
+ docName: 'foo',
+ title: 'Foo',
+ docExt: '.md',
+ size: 1,
+ modified: '2026-01-01T00:00:00.000Z',
+ },
+ ],
+ }),
+ { status: 200, headers: { 'content-type': 'application/json' } },
+ ),
);
});
@@ -446,6 +499,16 @@ describe('ComposerMentionInput — Enter defers to the @-mention popup', () => {
return state?.active ?? false;
}
+ /** Wait for the async corpus fetch to land in the popup's item list — the
+ * published selectable count is exactly what the Enter guard reads. */
+ async function waitForSelectableItem(editor: Editor): Promise<void> {
+ for (let i = 0; i < 50; i++) {
+ if (suggestionHasSelectableItem(editor.view)) return;
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ }
+ throw new Error('mention popup never produced a selectable item');
+ }
+
test('Enter submits while the popup is closed', () => {
const onSubmit = vi.fn(() => {});
render(
@@ -459,7 +522,7 @@ describe('ComposerMentionInput — Enter defers to the @-mention popup', () => {
expect(onSubmit).toHaveBeenCalledTimes(1);
});
- test('Enter does NOT submit while the @-popup is open (defers to the suggestion plugin)', () => {
+ test('Enter does NOT submit while the @-popup holds a selectable item', async () => {
const onSubmit = vi.fn(() => {});
render(
<ComposerMentionInput ariaLabel="Ask AI" onEmptyChange={() => {}} onSubmit={onSubmit} />,
@@ -467,15 +530,38 @@ describe('ComposerMentionInput — Enter defers to the @-mention popup', () => {
const box = screen.getByRole('textbox', { name: 'Ask AI' });
const editor = getComposerEditor(box);
- // Typing `@foo` opens the mention popup (plugin `active` flips synchronously).
+ // Typing `@foo` opens the mention popup (plugin `active` flips synchronously);
+ // deferral additionally waits on the corpus resolving a selectable item.
editor.commands.insertContent('@foo');
expect(isSuggestionActive(editor)).toBe(true);
+ await waitForSelectableItem(editor);
fireEvent.keyDown(box, { key: 'Enter' });
expect(onSubmit).toHaveBeenCalledTimes(0);
});
- test('Enter resumes submitting once the popup closes', () => {
+ test('Enter over an open @-popup with NO selectable item submits — never splits', async () => {
+ // A zero-hit query (or a still-loading corpus) keeps `active` true over an
+ // empty list; a blanket defer would fall through to TipTap's core
+ // splitBlock and turn "Enter to send" into a blank line.
+ const onSubmit = vi.fn(() => {});
+ render(
+ <ComposerMentionInput ariaLabel="Ask AI" onEmptyChange={() => {}} onSubmit={onSubmit} />,
+ );
+ const box = screen.getByRole('textbox', { name: 'Ask AI' });
+ const editor = getComposerEditor(box);
+
+ editor.commands.insertContent('@zzz');
+ expect(isSuggestionActive(editor)).toBe(true);
+ // Let the corpus fetch resolve to a zero-hit list.
+ for (let i = 0; i < 10; i++) await new Promise((resolve) => setTimeout(resolve, 0));
+
+ fireEvent.keyDown(box, { key: 'Enter' });
+ expect(onSubmit).toHaveBeenCalledTimes(1);
+ expect(editor.state.doc.childCount).toBe(1);
+ });
+
+ test('Enter resumes submitting once the popup closes', async () => {
const onSubmit = vi.fn(() => {});
render(
<ComposerMentionInput ariaLabel="Ask AI" onEmptyChange={() => {}} onSubmit={onSubmit} />,
@@ -485,6 +571,7 @@ describe('ComposerMentionInput — Enter defers to the @-mention popup', () => {
editor.commands.insertContent('@foo');
expect(isSuggestionActive(editor)).toBe(true);
+ await waitForSelectableItem(editor);
fireEvent.keyDown(box, { key: 'Enter' });
expect(onSubmit).toHaveBeenCalledTimes(0);
diff --git a/packages/app/src/editor/ComposerMentionInput.tsx b/packages/app/src/editor/ComposerMentionInput.tsx
index 5d4a1b8ab..8a6bb932a 100644
--- a/packages/app/src/editor/ComposerMentionInput.tsx
+++ b/packages/app/src/editor/ComposerMentionInput.tsx
@@ -17,9 +17,10 @@
* placeholder + send-enabled state.
*/
+import { useLingui } from '@lingui/react/macro';
import type { JSONContent } from '@tiptap/core';
import { EditorContent, useEditor } from '@tiptap/react';
-import { type Ref, useEffect, useImperativeHandle, useRef } from 'react';
+import { type Ref, useEffect, useImperativeHandle, useRef, useState } from 'react';
import { clearComposerDraft } from '@/components/composer-draft-store';
import {
composerMentionExtensions,
@@ -27,6 +28,16 @@ import {
isComposerEmpty,
serializeComposerContent,
} from '@/editor/composer-mention/composer-mention';
+import {
+ composerFirstLineText,
+ composerSlashSuggestionKey,
+ getSlashCommands,
+ resolveSlashTokenHint,
+ type SlashCommandItem,
+ type SlashTokenHint,
+ setSlashCommands,
+} from '@/editor/composer-mention/composer-slash-command';
+import { suggestionHasSelectableItem } from '@/editor/extensions/suggestion-floating-ui';
import { cn } from '@/lib/utils';
/** Whether a seed document has any node with inline content — mirrors the
@@ -52,6 +63,11 @@ interface ComposerEditorView {
export interface ComposerMentionInputHandle {
focus: () => void;
+ /** Focus with the caret at the END of the draft — the card-whitespace
+ * affordance ("click the dead space, continue typing"), matching the
+ * chat-composer convention. Plain `focus()` restores the last selection,
+ * which after a blur can sit anywhere (including before a leading pill). */
+ focusEnd: () => void;
blur: () => void;
clear: () => void;
/** Replace the field's content with plain text (no chips) — used to prefill a
@@ -92,6 +108,7 @@ export function ComposerMentionInput({
initialDoc,
disabled = false,
testId,
+ slashCommands,
}: {
ref?: Ref<ComposerMentionInputHandle>;
ariaLabel: string;
@@ -143,7 +160,26 @@ export function ComposerMentionInput({
* sessions dock's focus routing address the real textbox. Applied once at
* editor creation (it never changes). */
testId?: string;
+ /**
+ * The host's slash-command corpus — mounts the `/` typeahead + token-state
+ * affordance. Omitted (`undefined`), `/` stays inert text: only surfaces
+ * whose dispatch target can execute commands pass this (the agent-thread
+ * composer). `null` means the corpus is expected but not yet advertised
+ * ("not yet known" — neutral UI); `[]` means the agent advertised zero
+ * commands (an honest "none"). Whether the affordance exists is fixed at
+ * mount; the list itself is live and may change on any render.
+ */
+ slashCommands?: SlashCommandItem[] | null;
}) {
+ const { t } = useLingui();
+ // What the composer should say about the draft's leading `/token`, resolved
+ // against the live advertised-command list (null = no token, or no slash
+ // affordance on this surface). Recomputed on every edit and on command-list
+ // updates; rendered as the hint line under the field — the textual channel
+ // that says "unsupported" BEFORE submission (the token decoration is the
+ // visual one).
+ const [slashHint, setSlashHint] = useState<SlashTokenHint | null>(null);
+
// Refs carry the latest callbacks into the editor's once-created handlers so
// they never go stale, without re-creating the editor (and writing the refs in
// an effect, not during render, keeps React Compiler happy).
@@ -161,7 +197,7 @@ export function ComposerMentionInput({
});
const editor = useEditor({
- extensions: composerMentionExtensions({ placeholder }),
+ extensions: composerMentionExtensions({ placeholder, slashCommands }),
content: initialDoc ?? undefined,
immediatelyRender: true,
editable: !disabled,
@@ -178,9 +214,12 @@ export function ComposerMentionInput({
},
handleKeyDown: (view, event) => {
if (event.key === 'Escape') {
- // While the `@`-popup is open, Escape closes it (suggestion plugin
- // owns that) and must not blur the field; otherwise it dismisses.
- const suggestionActive = composerMentionSuggestionKey.getState(view.state)?.active;
+ // While the `@`- or `/`-popup is open, Escape closes it (the owning
+ // suggestion plugin handles that) and must not blur the field;
+ // otherwise it dismisses.
+ const suggestionActive =
+ composerMentionSuggestionKey.getState(view.state)?.active ||
+ composerSlashSuggestionKey.getState(view.state)?.active;
if (suggestionActive) return false;
if (onEscapeRef.current !== undefined) {
onEscapeRef.current();
@@ -192,11 +231,18 @@ export function ComposerMentionInput({
// Enter submits; Shift+Enter is left to the hardBreak shortcut. Guard IME
// composition so a CJK commit Enter does not fire the prompt.
if (event.key === 'Enter' && !event.shiftKey && !event.isComposing && !view.composing) {
- // While the `@`-popup is open, Enter commits the highlighted item (the
- // suggestion plugin's onKeyDown owns that) and must not submit the
- // prompt; returning false lets that handler run.
- const suggestionActive = composerMentionSuggestionKey.getState(view.state)?.active;
- if (suggestionActive) return false;
+ // While the `@`- or `/`-popup is open WITH something to commit,
+ // Enter selects the highlighted item (the owning suggestion plugin's
+ // onKeyDown does that) and must not submit the prompt; returning
+ // false lets that handler run. Over an EMPTY picker (unknown `/`
+ // command, zero-hit `@` query) the plugin's handler declines Enter,
+ // and deferring anyway would fall through to TipTap's core
+ // `splitBlock` — a blank line where the user expected a send. The
+ // pickers publish their live item count for exactly this guard.
+ const suggestionActive =
+ composerMentionSuggestionKey.getState(view.state)?.active ||
+ composerSlashSuggestionKey.getState(view.state)?.active;
+ if (suggestionActive && suggestionHasSelectableItem(view)) return false;
// Claimed here rather than left to the document's hardBreak binding:
// this is the composer's own editor instance, so ⌘Enter never reaches
// the surrounding document keymap.
@@ -210,6 +256,10 @@ export function ComposerMentionInput({
onEmptyChangeRef.current(isComposerEmpty(editor));
onContentChangeRef.current?.(editor.getJSON());
onMentionsChangeRef.current?.(serializeComposerContent(editor).mentions);
+ // Live command list read through the extension's storage (never a
+ // captured copy) so a mid-draft `available_commands_update` still
+ // resolves the token correctly. No-op surfaces without the extension.
+ setSlashHint(resolveSlashTokenHint(composerFirstLineText(editor), getSlashCommands(editor)));
},
});
@@ -266,6 +316,24 @@ export function ComposerMentionInput({
else view.dom.removeAttribute('aria-disabled');
}, [editor, disabled]);
+ // Carry command-list updates into the live editor: the extension list is
+ // built once, so a mid-session `available_commands_update` swaps the slash
+ // extension's storage (its live channel — options writes land on the fresh
+ // copy TipTap's options getter returns) and dispatches a no-op transaction
+ // so the token decoration recomputes — decorations only refresh on a
+ // transaction, and a list change dispatches none of its own. The hint
+ // re-resolves for the same reason.
+ useEffect(() => {
+ if (!editor || editor.isDestroyed) return;
+ if (setSlashCommands(editor, slashCommands ?? null)) {
+ const view = (editor as unknown as { editorView?: ComposerEditorView }).editorView;
+ // Changes no document state — cannot enter undo history or fire the
+ // host's onUpdate content callbacks.
+ if (view) view.dispatch(editor.state.tr.setMeta('addToHistory', false));
+ }
+ setSlashHint(resolveSlashTokenHint(composerFirstLineText(editor), getSlashCommands(editor)));
+ }, [editor, slashCommands]);
+
// Seed the host's empty-state from the initial draft text. `useEditor` does
// not fire `onUpdate` for the `content` seed, so without this a restored draft
// would leave the placeholder showing + Send disabled until the first
@@ -292,6 +360,7 @@ export function ComposerMentionInput({
ref,
() => ({
focus: () => editor?.commands.focus(),
+ focusEnd: () => editor?.commands.focus('end'),
blur: () => editor?.commands.blur(),
clear: () => editor?.commands.clearContent(true),
setText: (text: string) => {
@@ -302,6 +371,9 @@ export function ComposerMentionInput({
// prefilled starter brief wouldn't carry to the other placement.
onContentChangeRef.current?.(editor.getJSON());
onMentionsChangeRef.current?.(serializeComposerContent(editor).mentions);
+ setSlashHint(
+ resolveSlashTokenHint(composerFirstLineText(editor), getSlashCommands(editor)),
+ );
},
appendText: (text: string) => {
if (!editor || text === '') return;
@@ -321,6 +393,9 @@ export function ComposerMentionInput({
onEmptyChangeRef.current(isComposerEmpty(editor));
onContentChangeRef.current?.(editor.getJSON());
onMentionsChangeRef.current?.(serializeComposerContent(editor).mentions);
+ setSlashHint(
+ resolveSlashTokenHint(composerFirstLineText(editor), getSlashCommands(editor)),
+ );
},
getContent: () =>
editor ? serializeComposerContent(editor) : { instruction: '', mentions: [] },
@@ -328,6 +403,37 @@ export function ComposerMentionInput({
[editor],
);
- // biome-ignore lint/plugin/no-unportaled-editor-content: standalone single-instance composer editor — not an Activity-pool document editor, and EditorContent is the sole child of its wrapper, so the H6 cross-doc DOM vacuum the portal guards against (precedent #44) cannot apply here.
- return <EditorContent editor={editor} className={className} />;
+ return (
+ <>
+ {/* biome-ignore lint/plugin/no-unportaled-editor-content: standalone single-instance composer editor — not an Activity-pool document editor. EditorContent's own wrapper element still exclusively parents view.dom (the slash hint below is a sibling of that wrapper, never inside it), so the H6 cross-doc DOM vacuum the portal guards against (precedent #44) cannot apply here. */}
+ <EditorContent editor={editor} className={className} />
+ {/* The textual token-state channel for the UNRECOGNIZED case only: says
+ "isn't a command / unsupported" BEFORE submission (the in-field
+ decoration is shape+color only). A recognized command needs no line
+ here — its argument hint renders as in-field ghost text (the
+ terminal-CLI idiom) that disappears once arguments are typed. The
+ region is PRE-REGISTERED — mounted empty whenever the surface has a
+ slash corpus — because screen readers generally ignore a live region
+ that is inserted and populated in the same tick, and the first
+ population (the warning) is exactly the one that must land. Empty it
+ carries no padding, so it costs no height at rest. */}
+ {slashCommands !== undefined ? (
+ <p
+ className={cn(
+ 'truncate px-2.5 text-xs text-muted-foreground',
+ slashHint?.kind === 'unknown' && 'pb-1',
+ )}
+ aria-live="polite"
+ aria-atomic="true"
+ data-testid="composer-slash-hint"
+ >
+ {slashHint?.kind !== 'unknown'
+ ? null
+ : slashHint.agentHasCommands
+ ? t`/${slashHint.name} isn't a command this agent offers — it will be sent as plain text`
+ : t`This agent doesn't offer slash commands — your message will be sent as plain text`}
+ </p>
+ ) : null}
+ </>
+ );
}
diff --git a/packages/app/src/editor/composer-mention/ComposerMentionMenu.tsx b/packages/app/src/editor/composer-mention/ComposerMentionMenu.tsx
index b0aa138cf..4b6ad8fe0 100644
--- a/packages/app/src/editor/composer-mention/ComposerMentionMenu.tsx
+++ b/packages/app/src/editor/composer-mention/ComposerMentionMenu.tsx
@@ -86,7 +86,7 @@ export function ComposerMentionMenu({
id={listboxId}
aria-label={t`Doc mention suggestions`}
tabIndex={-1}
- className="max-h-64 overflow-y-auto subtle-scrollbar"
+ className="max-h-64 overflow-y-auto overscroll-contain subtle-scrollbar"
>
{/*
Live region announces the selected item on arrow navigation.
diff --git a/packages/app/src/editor/composer-mention/ComposerSlashMenu.dom.test.tsx b/packages/app/src/editor/composer-mention/ComposerSlashMenu.dom.test.tsx
new file mode 100644
index 000000000..035985905
--- /dev/null
+++ b/packages/app/src/editor/composer-mention/ComposerSlashMenu.dom.test.tsx
@@ -0,0 +1,114 @@
+/**
+ * Tier-3 tests for the composer's `/` slash-command dropdown: row layout,
+ * selection affordances, and — load-bearing — the three DISTINCT empty states.
+ * "Hasn't announced yet" (null corpus), "advertised zero" (empty corpus), and
+ * "no match for this query" are different answers, and the picker must never
+ * imply support that isn't there (nor "unsupported" while the handshake is
+ * still resolving).
+ */
+
+import { cleanup, fireEvent, render, screen } from '@testing-library/react';
+import { afterEach, describe, expect, test, vi } from 'vitest';
+import { ComposerSlashMenu } from './ComposerSlashMenu';
+import type { SlashCommandItem } from './composer-slash-command';
+
+afterEach(cleanup);
+
+const COMMANDS: SlashCommandItem[] = [
+ { name: 'review', description: 'Review the current diff' },
+ { name: 'create_plan', description: 'Draft an implementation plan' },
+];
+
+describe('ComposerSlashMenu — rows', () => {
+ test('renders each command as /name plus its description', () => {
+ render(
+ <ComposerSlashMenu
+ items={COMMANDS}
+ query=""
+ selectedIndex={0}
+ onSelect={() => {}}
+ commandsKnown
+ />,
+ );
+ const review = screen.getByTestId('composer-slash-option-review');
+ expect(review.textContent).toContain('/review');
+ expect(review.textContent).toContain('Review the current diff');
+ expect(screen.getByTestId('composer-slash-option-create_plan').textContent).toContain(
+ '/create_plan',
+ );
+ });
+
+ test('the selected row carries aria-selected and the active marker', () => {
+ render(
+ <ComposerSlashMenu
+ items={COMMANDS}
+ query=""
+ selectedIndex={1}
+ onSelect={() => {}}
+ commandsKnown
+ />,
+ );
+ expect(screen.getByTestId('composer-slash-option-review').getAttribute('aria-selected')).toBe(
+ 'false',
+ );
+ const active = screen.getByTestId('composer-slash-option-create_plan');
+ expect(active.getAttribute('aria-selected')).toBe('true');
+ expect(active.dataset.active).toBe('true');
+ });
+
+ test('mousedown selects (so the editor never loses focus first)', () => {
+ const onSelect = vi.fn((_item: SlashCommandItem) => {});
+ render(
+ <ComposerSlashMenu
+ items={COMMANDS}
+ query=""
+ selectedIndex={0}
+ onSelect={onSelect}
+ commandsKnown
+ />,
+ );
+ fireEvent.mouseDown(screen.getByTestId('composer-slash-option-create_plan'));
+ expect(onSelect).toHaveBeenCalledWith(COMMANDS[1]);
+ });
+});
+
+describe('ComposerSlashMenu — the three empty states', () => {
+ test('null corpus: neutral "not yet announced" copy, never "doesn\'t offer"', () => {
+ render(
+ <ComposerSlashMenu
+ items={[]}
+ query=""
+ selectedIndex={0}
+ onSelect={() => {}}
+ commandsKnown={false}
+ />,
+ );
+ const menu = screen.getByTestId('composer-slash-menu');
+ expect(menu.textContent).toContain("hasn't announced");
+ expect(menu.textContent).not.toContain("doesn't offer");
+ });
+
+ test('advertised-empty corpus: honest "doesn\'t offer slash commands"', () => {
+ render(
+ <ComposerSlashMenu items={[]} query="" selectedIndex={0} onSelect={() => {}} commandsKnown />,
+ );
+ expect(screen.getByTestId('composer-slash-menu').textContent).toContain(
+ "doesn't offer slash commands",
+ );
+ });
+
+ test('a query with no match reads as "no match", not as no support', () => {
+ render(
+ <ComposerSlashMenu
+ items={[]}
+ query="zzz"
+ selectedIndex={0}
+ onSelect={() => {}}
+ commandsKnown
+ />,
+ );
+ const menu = screen.getByTestId('composer-slash-menu');
+ expect(menu.textContent).toContain('No matching commands');
+ expect(menu.textContent).not.toContain("doesn't offer");
+ });
+});
diff --git a/packages/app/src/editor/composer-mention/ComposerSlashMenu.tsx b/packages/app/src/editor/composer-mention/ComposerSlashMenu.tsx
new file mode 100644
index 000000000..6dc03253d
--- /dev/null
+++ b/packages/app/src/editor/composer-mention/ComposerSlashMenu.tsx
@@ -0,0 +1,113 @@
+/**
+ * Typeahead menu for the composer's `/` slash-command picker — the command
+ * sibling of `ComposerMentionMenu`, driven by the same `@tiptap/suggestion`
+ * render lifecycle (in `composer-slash-command.ts`); the menu is a pure render
+ * of the current items + selection.
+ *
+ * The two empty states are deliberately distinct: an agent that hasn't
+ * advertised yet gets neutral "not yet known" copy, an agent that advertised
+ * zero commands gets an honest "doesn't offer" — the picker must never imply
+ * support that isn't there.
+ */
+import { useLingui } from '@lingui/react/macro';
+import { useEffect, useId, useRef } from 'react';
+import type { SlashCommandItem } from './composer-slash-command';
+
+interface ComposerSlashMenuProps {
+ items: SlashCommandItem[];
+ query: string;
+ selectedIndex: number;
+ onSelect: (item: SlashCommandItem) => void;
+ /** False while the agent hasn't advertised a command list yet (`null`
+ * corpus) — "not yet known" renders differently than "advertised none". */
+ commandsKnown: boolean;
+}
+
+export function ComposerSlashMenu({
+ items,
+ query,
+ selectedIndex,
+ onSelect,
+ commandsKnown,
+}: ComposerSlashMenuProps) {
+ const { t } = useLingui();
+ const listboxId = useId();
+ const containerRef = useRef<HTMLDivElement>(null);
+
+ // Keep the active option scrolled into view as the user arrows through.
+ useEffect(() => {
+ const options = containerRef.current?.querySelectorAll('[role="option"]');
+ options?.item(selectedIndex)?.scrollIntoView({ block: 'nearest' });
+ }, [selectedIndex]);
+
+ const selectedItem =
+ selectedIndex >= 0 && selectedIndex < items.length ? items[selectedIndex] : null;
+
+ return (
+ // Much wider than the `@`-mention menu on purpose: command rows pair a
+ // long mono name with a sentence-length description, and at narrow
+ // widths most rows wrap to three lines. The only hard ceiling is the
+ // viewport (the min() keeps narrow windows safe).
+ <div
+ ref={containerRef}
+ data-testid="composer-slash-menu"
+ className="w-[42rem] max-w-[min(42rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md"
+ >
+ {items.length === 0 ? (
+ <p className="px-2 py-1.5 text-sm text-muted-foreground" aria-live="polite">
+ {!commandsKnown
+ ? t`This agent hasn't announced its commands yet`
+ : query.trim() === ''
+ ? t`This agent doesn't offer slash commands`
+ : t`No matching commands`}
+ </p>
+ ) : (
+ <div
+ role="listbox"
+ id={listboxId}
+ aria-label={t`Slash command suggestions`}
+ tabIndex={-1}
+ className="max-h-64 overflow-y-auto overscroll-contain subtle-scrollbar"
+ >
+ {/*
+ Live region announces the selected item on arrow navigation.
+ Required because aria-activedescendant on the listbox is inert here —
+ focus stays in ProseMirror's contentEditable, and screen readers only
+ announce activedescendant on the focused element.
+ */}
+ <span className="sr-only" aria-live="polite" aria-atomic="true">
+ {selectedItem ? `/${selectedItem.name}` : ''}
+ </span>
+ {items.map((item, index) => {
+ const active = index === selectedIndex;
+ return (
+ <button
+ key={item.name}
+ id={`${listboxId}-option-${index}`}
+ type="button"
+ role="option"
+ aria-selected={active}
+ data-active={active}
+ data-testid={`composer-slash-option-${item.name}`}
+ className={`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5 text-left ${
+ active ? 'bg-accent text-accent-foreground' : ''
+ }`}
+ // Insert on mousedown rather than click so the editor never
+ // loses focus to the menu button before the text lands.
+ onMouseDown={(event) => {
+ event.preventDefault();
+ onSelect(item);
+ }}
+ >
+ <span className="shrink-0 font-mono text-sm font-medium">/{item.name}</span>
+ <span className="line-clamp-2 min-w-0 flex-1 text-xs text-muted-foreground">
+ {item.description}
+ </span>
+ </button>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/packages/app/src/editor/composer-mention/composer-mention.ts b/packages/app/src/editor/composer-mention/composer-mention.ts
index 634a8aa07..496ca6fa3 100644
--- a/packages/app/src/editor/composer-mention/composer-mention.ts
+++ b/packages/app/src/editor/composer-mention/composer-mention.ts
@@ -24,13 +24,20 @@ import { X } from 'lucide-react';
import { fileEntryPathIconToSvgString } from '@/components/file-entry-icon';
import { docNameToRelativePath } from '@/lib/workspace-paths';
import {
+ clearSuggestionSelectableCount,
createSuggestionPopup,
destroySuggestionPopup,
type SuggestionPositionState,
+ setSuggestionSelectableCount,
} from '../extensions/suggestion-floating-ui';
import { fetchPages, filterPages, type PageItem } from '../extensions/wiki-link-suggestion';
import { lucideIconToSvgString } from '../registry/lucide-svg';
import { ComposerMentionMenu } from './ComposerMentionMenu';
+import {
+ ComposerCommand,
+ ComposerSlashCommand,
+ type SlashCommandItem,
+} from './composer-slash-command';
/** A resolved mention suggestion: the doc identity, its display title, and the
* workspace-relative `@path` the chip serializes to. */
@@ -232,8 +239,14 @@ const ComposerMention = Node.create({
/** The full extension list for the composer's TipTap editor. An optional
* `placeholder` adds the TipTap Placeholder decoration shown while the field is
* empty — the bottom composer overlays its own rotating placeholder and passes
- * none; the create composer passes a static string. */
-export function composerMentionExtensions(options?: { placeholder?: string }) {
+ * none; the create composer passes a static string. `slashCommands` (even
+ * `null` — "corpus expected, not yet advertised") mounts the `/` slash-command
+ * extension; omitting it keeps `/` inert text, which is every surface except
+ * the agent-thread composer. */
+export function composerMentionExtensions(options?: {
+ placeholder?: string;
+ slashCommands?: SlashCommandItem[] | null;
+}) {
return [
ComposerDoc,
ComposerParagraph,
@@ -241,6 +254,15 @@ export function composerMentionExtensions(options?: { placeholder?: string }) {
ComposerHardBreak,
ComposerHistory,
ComposerMention,
+ // The picked-command pill NODE is registered for every surface even
+ // though only slash-enabled hosts can create one — the shared draft
+ // store restores drafts across composer placements, and a host-gated
+ // schema node would silently drop pill-bearing drafts on the surfaces
+ // whose schema lacked it.
+ ComposerCommand,
+ ...(options?.slashCommands !== undefined
+ ? [ComposerSlashCommand.configure({ commands: options.slashCommands })]
+ : []),
// Seeds the mount-time value only. Extensions are built once, so the host
// re-points `options.placeholder` on this instance when the interface
// language changes — see `ComposerMentionInput`. `showOnlyWhenEditable:
@@ -362,11 +384,22 @@ function configureComposerMentionSuggestion(editor: Editor) {
const posState: SuggestionPositionState = { popup: null, stopAutoUpdate: null };
let doPosition: (() => void) | null = null;
let reveal: (() => void) | null = null;
+ // The view the count was published against, held for onExit —
+ // `currentProps` is nulled before the clear could read it.
+ let publishedView: object | null = null;
const onSelect = (item: MentionItem) => {
currentProps?.command(item);
};
+ // Tell the composer's Enter guard whether this picker has anything to
+ // commit — over an empty list (zero-hit query, corpus still loading)
+ // Enter must submit the prompt, not fall through to a paragraph split.
+ const publishSelectableCount = (props: SuggestionProps<MentionItem>) => {
+ publishedView = props.editor.view;
+ setSuggestionSelectableCount(publishedView, (props.items ?? []).length);
+ };
+
const computeMenuProps = (props: SuggestionProps<MentionItem>) => {
const items = props.items ?? [];
const { loaded, error } = corpus.snapshot();
@@ -392,6 +425,7 @@ function configureComposerMentionSuggestion(editor: Editor) {
onBeforeStart(props: SuggestionProps<MentionItem>) {
currentProps = props;
selectedIndex = 0;
+ publishSelectableCount(props);
const result = createSuggestionPopup(() => currentProps, 'composer-mention');
posState.popup = result.popup;
doPosition = result.doPosition;
@@ -407,6 +441,7 @@ function configureComposerMentionSuggestion(editor: Editor) {
onStart(props: SuggestionProps<MentionItem>) {
currentProps = props;
selectedIndex = 0;
+ publishSelectableCount(props);
rerender();
reveal?.();
},
@@ -414,6 +449,7 @@ function configureComposerMentionSuggestion(editor: Editor) {
onUpdate(props: SuggestionProps<MentionItem>) {
currentProps = props;
selectedIndex = Math.min(selectedIndex, Math.max(0, props.items.length - 1));
+ publishSelectableCount(props);
rerender();
doPosition?.();
},
@@ -450,6 +486,10 @@ function configureComposerMentionSuggestion(editor: Editor) {
renderer = null;
currentProps = null;
selectedIndex = 0;
+ if (publishedView !== null) {
+ clearSuggestionSelectableCount(publishedView);
+ publishedView = null;
+ }
// Re-fetch on the next `@` so a freshly-created doc shows up.
corpus.reset();
},
@@ -484,6 +524,10 @@ export function serializeComposerContent(editor: Editor): {
mentions.push(path);
}
}
+ } else if (inline.type.name === 'composerCommand') {
+ // The picked pill serializes back to the invocation text the agent's
+ // prefix-based dispatch expects.
+ line += `/${String(inline.attrs.name ?? '')}`;
} else if (inline.isText) {
line += inline.text ?? '';
} else if (inline.type.name === 'hardBreak') {
diff --git a/packages/app/src/editor/composer-mention/composer-slash-command.test.ts b/packages/app/src/editor/composer-mention/composer-slash-command.test.ts
new file mode 100644
index 000000000..6d4009400
--- /dev/null
+++ b/packages/app/src/editor/composer-mention/composer-slash-command.test.ts
@@ -0,0 +1,110 @@
+/**
+ * Unit tests for the composer slash-command surface's pure logic: the picker's
+ * ranking filter, the leading-token parser, and the token-state resolver whose
+ * three-way answer (known / unknown / no-claim) the hint line and decoration
+ * both render. The suggestion + decoration plumbing is covered in
+ * `composer-slash-input.dom.test.tsx`.
+ */
+
+import { describe, expect, test } from 'vitest';
+import {
+ filterSlashCommands,
+ leadingSlashToken,
+ resolveSlashTokenHint,
+ type SlashCommandItem,
+} from './composer-slash-command';
+
+const COMMANDS: SlashCommandItem[] = [
+ { name: 'review', description: 'Review the current diff' },
+ { name: 'create_plan', description: 'Draft an implementation plan' },
+ { name: 'research_codebase', description: 'Deep-dive the codebase for planning' },
+];
+
+describe('filterSlashCommands', () => {
+ test('an empty query returns every command in advertised order', () => {
+ expect(filterSlashCommands(COMMANDS, '')).toEqual(COMMANDS);
+ expect(filterSlashCommands(COMMANDS, ' ')).toEqual(COMMANDS);
+ });
+
+ test('name-prefix matches rank ahead of name-substring and description matches', () => {
+ const ranked = filterSlashCommands(COMMANDS, 're');
+ // `review` and `research_codebase` are prefix hits (advertised order kept);
+ // `create_plan` only matches `re` inside its name, so it ranks after them.
+ expect(ranked.map((c) => c.name)).toEqual(['review', 'research_codebase', 'create_plan']);
+ });
+
+ test('description-only matches still surface, last', () => {
+ expect(filterSlashCommands(COMMANDS, 'diff').map((c) => c.name)).toEqual(['review']);
+ expect(filterSlashCommands(COMMANDS, 'planning').map((c) => c.name)).toEqual([
+ 'research_codebase',
+ ]);
+ });
+
+ test('matching is case-insensitive', () => {
+ expect(filterSlashCommands(COMMANDS, 'REV').map((c) => c.name)).toEqual(['review']);
+ });
+
+ test('no match returns empty', () => {
+ expect(filterSlashCommands(COMMANDS, 'zzz')).toEqual([]);
+ });
+});
+
+describe('leadingSlashToken', () => {
+ test('parses the leading /name and its length', () => {
+ expect(leadingSlashToken('/review the diff')).toEqual({ name: 'review', length: 7 });
+ expect(leadingSlashToken('/create_plan')).toEqual({ name: 'create_plan', length: 12 });
+ });
+
+ test('a bare slash is not a token', () => {
+ expect(leadingSlashToken('/')).toBeNull();
+ expect(leadingSlashToken('/ review')).toBeNull();
+ });
+
+ test('a slash later in the text is prose, not a command', () => {
+ expect(leadingSlashToken('use /review')).toBeNull();
+ expect(leadingSlashToken('and/or')).toBeNull();
+ expect(leadingSlashToken('')).toBeNull();
+ });
+});
+
+describe('resolveSlashTokenHint', () => {
+ test('no leading token resolves to null', () => {
+ expect(resolveSlashTokenHint('plain prose', COMMANDS)).toBeNull();
+ expect(resolveSlashTokenHint('', COMMANDS)).toBeNull();
+ });
+
+ test('a not-yet-advertised corpus (null) makes no claim either way', () => {
+ // "Not yet known" must not render as "unsupported" — the composer is
+ // typable while the handshake is still resolving.
+ expect(resolveSlashTokenHint('/review', null)).toBeNull();
+ });
+
+ test('an advertised command resolves known, with its description', () => {
+ expect(resolveSlashTokenHint('/review args here', COMMANDS)).toEqual({
+ kind: 'known',
+ name: 'review',
+ description: 'Review the current diff',
+ });
+ });
+
+ test('command names match exactly — no case folding or prefixing', () => {
+ expect(resolveSlashTokenHint('/Review', COMMANDS)).toMatchObject({ kind: 'unknown' });
+ expect(resolveSlashTokenHint('/rev', COMMANDS)).toMatchObject({ kind: 'unknown' });
+ });
+
+ test('an unknown token against a real corpus reports the agent HAS commands', () => {
+ expect(resolveSlashTokenHint('/tasks', COMMANDS)).toEqual({
+ kind: 'unknown',
+ name: 'tasks',
+ agentHasCommands: true,
+ });
+ });
+
+ test('an unknown token against an advertised-empty corpus reports none exist', () => {
+ expect(resolveSlashTokenHint('/tasks', [])).toEqual({
+ kind: 'unknown',
+ name: 'tasks',
+ agentHasCommands: false,
+ });
+ });
+});
diff --git a/packages/app/src/editor/composer-mention/composer-slash-command.ts b/packages/app/src/editor/composer-mention/composer-slash-command.ts
new file mode 100644
index 000000000..270746506
--- /dev/null
+++ b/packages/app/src/editor/composer-mention/composer-slash-command.ts
@@ -0,0 +1,551 @@
+/**
+ * The composer's `/` slash-command surface: a typeahead over the commands the
+ * host's agent advertised, plus a token decoration that tells the user — before
+ * submission — whether the leading `/name` they typed is a command the agent
+ * recognizes.
+ *
+ * Deliberately decoration-based, not a chip node like `composerMention`: the
+ * command corpus is per-host (only the agent-thread composer has one) and a
+ * host-gated schema node would fork the composer schema between surfaces —
+ * the shared draft store would then drop chip-bearing drafts on the surfaces
+ * whose schema lacks the node. Decorations style the text without touching the
+ * document, so one schema serves every surface and serialization is untouched:
+ * the instruction already carries `/name args` as plain text, which is exactly
+ * what an ACP agent expects to receive.
+ *
+ * Command-list semantics mirror `ThreadInfo.availableCommands`: `null` means
+ * the agent hasn't advertised yet ("not yet known" — the UI stays neutral),
+ * `[]` means the agent said it has zero commands (an honest "none"), and the
+ * list is live — the host swaps the extension's storage via `setSlashCommands`
+ * when an `available_commands_update` arrives mid-session.
+ */
+
+import { type Editor, Extension, mergeAttributes, Node } from '@tiptap/core';
+import type { Node as PmNode } from '@tiptap/pm/model';
+import { PluginKey, Plugin as PmPlugin } from '@tiptap/pm/state';
+import { Decoration, DecorationSet } from '@tiptap/pm/view';
+import { ReactRenderer } from '@tiptap/react';
+import Suggestion, { type SuggestionKeyDownProps, type SuggestionProps } from '@tiptap/suggestion';
+import {
+ clearSuggestionSelectableCount,
+ createSuggestionPopup,
+ destroySuggestionPopup,
+ type SuggestionPositionState,
+ setSuggestionSelectableCount,
+} from '../extensions/suggestion-floating-ui';
+import { ComposerSlashMenu } from './ComposerSlashMenu';
+
+/** One advertised command, trimmed to what the composer renders. Structurally
+ * satisfied by the SDK's `AvailableCommand`, so hosts pass the advertised
+ * list straight through. */
+export interface SlashCommandItem {
+ readonly name: string;
+ readonly description: string;
+ /** ACP's unstructured-input hint — "a hint to display when the input hasn't
+ * been provided yet" (e.g. Claude's `[error message | failing test]`).
+ * Preferred over `description` for the in-field ghost text. */
+ readonly input?: { readonly hint: string } | null;
+}
+
+export const composerSlashSuggestionKey = new PluginKey('composerSlashSuggestion');
+
+/**
+ * A command PICKED from the `/` menu, as an atomic pill — the caret can never
+ * land inside it, one arrow press crosses it whole, backspace removes it
+ * whole, and re-picking replaces it wholesale. A command the user merely
+ * TYPES stays plain text (styled by the token decoration): promotion to a
+ * pill is the picker's act of commitment, exactly the terminal-CLI split.
+ *
+ * Registered in the shared composer schema for EVERY surface (see
+ * `composerMentionExtensions`) even though only slash-enabled hosts can
+ * create one — a host-gated schema node would make the shared draft store
+ * drop pill-bearing drafts on surfaces whose schema lacked it.
+ *
+ * `description` / `hint` ride as attrs so the in-field ghost renders from
+ * the pill itself — the advertised list can churn after the pick without
+ * un-documenting a command the user already committed to.
+ */
+export const ComposerCommand = Node.create({
+ name: 'composerCommand',
+ group: 'inline',
+ inline: true,
+ atom: true,
+ // Non-selectable so horizontal arrow movement hops STRAIGHT across the
+ // pill — selectable atoms take a NodeSelection layover (caret vanishes,
+ // node highlights) between the two sides. Backspace still deletes the
+ // atom whole.
+ selectable: false,
+
+ addAttributes() {
+ return {
+ name: { default: '' },
+ description: { default: '' },
+ hint: { default: '' },
+ };
+ },
+
+ parseHTML() {
+ return [{ tag: 'span[data-composer-command]' }];
+ },
+
+ renderHTML({ node, HTMLAttributes }) {
+ const name = String(node.attrs.name ?? '');
+ return [
+ 'span',
+ mergeAttributes(HTMLAttributes, {
+ 'data-composer-command': name,
+ // The picked pill wears the same recognized-token styling the typed
+ // form gets from the decoration — one visual system.
+ class: 'composer-slash-token composer-slash-token-known',
+ }),
+ `/${name}`,
+ ];
+ },
+
+ renderText({ node }) {
+ return `/${node.attrs.name}`;
+ },
+});
+
+const slashDecorationKey = new PluginKey<DecorationSet>('composerSlashToken');
+
+const EXTENSION_NAME = 'composerSlashCommand';
+
+interface SlashCommandOptions {
+ /** Mount-time seed for {@link SlashCommandStorage.commands} — the corpus the
+ * host holds when the editor is created. */
+ commands: SlashCommandItem[] | null;
+}
+
+interface SlashCommandStorage {
+ /** The LIVE advertised-command list. Storage, not options, is the mutable
+ * channel: TipTap's `extension.options` getter returns a fresh copy on
+ * every access, so an options write lands on a throwaway object — while
+ * `editor.storage[name]` is the one per-editor object both the plugins and
+ * the host share by reference. Updated via {@link setSlashCommands}. */
+ commands: SlashCommandItem[] | null;
+}
+
+function slashStorage(editor: Editor): SlashCommandStorage | undefined {
+ return (editor.storage as unknown as Partial<Record<string, SlashCommandStorage>>)[
+ EXTENSION_NAME
+ ];
+}
+
+/** The live advertised-command list. Null when the editor has no slash
+ * extension (surfaces without a `/` affordance) or nothing advertised yet. */
+export function getSlashCommands(editor: Editor): SlashCommandItem[] | null {
+ return slashStorage(editor)?.commands ?? null;
+}
+
+/**
+ * Re-point the live command list (an `available_commands_update` arrived).
+ * Returns true when the stored REFERENCE changed — sufficient because every
+ * producer replaces the array wholesale (`ThreadInfo.availableCommands` is
+ * swapped per update, never mutated in place); an in-place mutation of the
+ * same array would go undetected by design. The caller then owes the editor
+ * a repaint transaction: decorations only recompute on a transaction, and a
+ * list swap dispatches none of its own. False when the editor has no slash
+ * extension or the reference is already current.
+ */
+export function setSlashCommands(editor: Editor, commands: SlashCommandItem[] | null): boolean {
+ const storage = slashStorage(editor);
+ if (storage === undefined || storage.commands === commands) return false;
+ storage.commands = commands;
+ return true;
+}
+
+/**
+ * Rank the advertised commands against the picker query: name-prefix matches
+ * first (the muscle-memory path — typing `/rev` should surface `/review` at
+ * the top), then name-substring, then description-substring. Case-insensitive;
+ * relative order within a tier stays the agent's advertised order.
+ */
+export function filterSlashCommands(
+ commands: readonly SlashCommandItem[],
+ query: string,
+): SlashCommandItem[] {
+ const q = query.trim().toLowerCase();
+ if (q === '') return [...commands];
+ const prefix: SlashCommandItem[] = [];
+ const nameSub: SlashCommandItem[] = [];
+ const descSub: SlashCommandItem[] = [];
+ for (const command of commands) {
+ const name = command.name.toLowerCase();
+ if (name.startsWith(q)) prefix.push(command);
+ else if (name.includes(q)) nameSub.push(command);
+ else if (command.description.toLowerCase().includes(q)) descSub.push(command);
+ }
+ return [...prefix, ...nameSub, ...descSub];
+}
+
+/** The leading `/name` token of a message, or null when the text doesn't open
+ * with one. `text` is the first paragraph's text; the token ends at the first
+ * whitespace (`\S+` deliberately admits punctuation — `/review,` parses as
+ * the token `review,`, which then simply fails recognition, exactly how the
+ * agent's own prefix-based dispatch would read it). A bare `/` is not a
+ * token. */
+export function leadingSlashToken(text: string): { name: string; length: number } | null {
+ const match = /^\/(\S+)/.exec(text);
+ if (match === null) return null;
+ return { name: match[1] ?? '', length: match[0].length };
+}
+
+/**
+ * What the composer should say about the draft's leading slash token, resolved
+ * against the live command list. Null when there is no leading token — or when
+ * the list hasn't arrived yet (`commands === null`): "not yet known" must not
+ * render as "unsupported".
+ */
+export type SlashTokenHint =
+ | { kind: 'known'; name: string; description: string }
+ | { kind: 'unknown'; name: string; agentHasCommands: boolean };
+
+export function resolveSlashTokenHint(
+ firstLineText: string,
+ commands: readonly SlashCommandItem[] | null,
+): SlashTokenHint | null {
+ const token = leadingSlashToken(firstLineText);
+ if (token === null || commands === null) return null;
+ const command = commands.find((c) => c.name === token.name);
+ if (command !== undefined) {
+ return { kind: 'known', name: command.name, description: command.description };
+ }
+ return { kind: 'unknown', name: token.name, agentHasCommands: commands.length > 0 };
+}
+
+/**
+ * The text the message actually OPENS with: the first paragraph's leading text
+ * node, or '' when the paragraph opens with anything else. Deliberately not
+ * `textContent` — an atomic `@`-mention chip contributes nothing to
+ * `textContent`, so a draft shaped `[chip]/review` would read as a leading
+ * `/review` that is not at message start (and its decoration range would land
+ * on the chip). Agents parse commands at message start only, so a token after
+ * a chip is prose either way.
+ */
+export function composerFirstLineText(editor: Editor): string {
+ return leadingTextOfBlock(editor.state.doc.firstChild);
+}
+
+function leadingTextOfBlock(block: { firstChild: PmNode | null } | null): string {
+ const inline = block?.firstChild ?? null;
+ return inline?.isText ? (inline.text ?? '') : '';
+}
+
+/**
+ * Decoration classes for the leading token. Both states pair a shape cue with
+ * the color so the distinction never rides color alone: recognized gets a
+ * filled pill, unrecognized a dashed underline (see globals.css).
+ *
+ * A recognized command with NOTHING typed after it additionally gets in-field
+ * ghost text (the terminal-CLI idiom): the command's argument hint — ACP's
+ * `input.hint`, else its description — rendered as an inert widget after the
+ * caret, gone the moment the user types an argument. This replaces any
+ * under-field line for the recognized case; only the unrecognized warning
+ * renders below the field.
+ */
+function slashTokenDecorations(
+ doc: Editor['state']['doc'],
+ commands: SlashCommandItem[] | null,
+): DecorationSet {
+ const paragraph = doc.firstChild;
+ const leadInline = paragraph?.firstChild ?? null;
+
+ // A PICKED pill leads the draft: the node styles itself, so only the
+ // argument-hint ghost applies — from the pill's own attrs, so a later
+ // corpus churn can't un-document a command already committed to.
+ if (leadInline !== null && leadInline.type.name === 'composerCommand') {
+ if (!draftIsBarePill(doc)) return DecorationSet.empty;
+ const hint = String(leadInline.attrs.hint ?? '');
+ const description = String(leadInline.attrs.description ?? '');
+ const ghostText = hint !== '' ? hint : description !== '' ? `— ${description}` : '';
+ if (ghostText === '') return DecorationSet.empty;
+ return DecorationSet.create(doc, [
+ ghostWidget(1 + (paragraph?.content.size ?? 0), ghostText, String(leadInline.attrs.name)),
+ ]);
+ }
+
+ if (commands === null) return DecorationSet.empty;
+ const token = leadingSlashToken(leadingTextOfBlock(doc.firstChild));
+ if (token === null) return DecorationSet.empty;
+ const command = commands.find((c) => c.name === token.name);
+ // The first block's content starts at doc position 1, and the token comes
+ // from its leading TEXT node (leadingTextOfBlock), so [1, 1 + token length)
+ // always lies inside that text node — never across a chip.
+ const decorations: Decoration[] = [
+ Decoration.inline(1, 1 + token.length, {
+ class:
+ command !== undefined
+ ? 'composer-slash-token composer-slash-token-known'
+ : 'composer-slash-token composer-slash-token-unknown',
+ }),
+ ];
+ if (command !== undefined && draftIsBareCommand(doc, token.length)) {
+ const ghostText =
+ command.input?.hint != null && command.input.hint !== ''
+ ? command.input.hint
+ : `— ${command.description}`;
+ if (command.description !== '' || command.input?.hint) {
+ decorations.push(
+ ghostWidget(1 + (doc.firstChild?.firstChild?.nodeSize ?? 0), ghostText, command.name),
+ );
+ }
+ }
+ return DecorationSet.create(doc, decorations);
+}
+
+function ghostWidget(pos: number, ghostText: string, key: string): Decoration {
+ return Decoration.widget(
+ pos,
+ () => {
+ const span = document.createElement('span');
+ span.className = 'composer-slash-ghost';
+ // Inert scaffolding, not content: never read to AT, never a click
+ // target (a click lands in the editor text behind it).
+ span.setAttribute('aria-hidden', 'true');
+ span.textContent = ghostText;
+ return span;
+ },
+ // After the caret, so typing stays visually ahead of the ghost; a stable
+ // key keeps the widget from re-mounting per keystroke.
+ { side: 1, key: `slash-ghost:${key}` },
+ );
+}
+
+/** True when the whole draft is exactly the leading `/command` (plus at most
+ * one trailing space): one paragraph, one text node, nothing else typed —
+ * the only state where the argument-hint ghost belongs. */
+function draftIsBareCommand(doc: Editor['state']['doc'], tokenLength: number): boolean {
+ if (doc.childCount !== 1) return false;
+ const paragraph = doc.firstChild;
+ if (paragraph === null || paragraph.childCount !== 1) return false;
+ const inline = paragraph.firstChild;
+ if (inline === null || !inline.isText) return false;
+ const text = inline.text ?? '';
+ return text.length <= tokenLength + 1 && (text.length === tokenLength || text.endsWith(' '));
+}
+
+/** The pill twin of {@link draftIsBareCommand}: one paragraph whose content is
+ * the pill alone, or the pill plus whitespace-only text (the picker inserts a
+ * trailing space) — nothing else typed yet. */
+function draftIsBarePill(doc: Editor['state']['doc']): boolean {
+ if (doc.childCount !== 1) return false;
+ const paragraph = doc.firstChild;
+ if (paragraph === null) return false;
+ if (paragraph.childCount === 1) return true;
+ if (paragraph.childCount !== 2) return false;
+ const second = paragraph.child(1);
+ return second.isText && /^\s*$/.test(second.text ?? '');
+}
+
+/**
+ * The `/` typeahead + token-state extension. Included in the composer's
+ * extension list only when the host supplies a command corpus (the agent-thread
+ * composer); every other surface omits it and `/` stays inert text.
+ */
+export const ComposerSlashCommand = Extension.create<SlashCommandOptions, SlashCommandStorage>({
+ name: EXTENSION_NAME,
+
+ addOptions() {
+ return { commands: null };
+ },
+
+ addStorage() {
+ // Seed the live (mutable) storage from the mount-time configured corpus;
+ // later updates land through `setSlashCommands`.
+ return { commands: this.options.commands };
+ },
+
+ addProseMirrorPlugins() {
+ const storage = this.storage;
+ // Read through the shared storage object on EVERY call — the host swaps
+ // `storage.commands` when `available_commands_update` arrives, and a
+ // captured copy would pin the picker to the mount-time list.
+ const liveCommands = (): SlashCommandItem[] | null => storage.commands ?? null;
+
+ const tokenPlugin = new PmPlugin<DecorationSet>({
+ key: slashDecorationKey,
+ state: {
+ init: (_config, state) => slashTokenDecorations(state.doc, liveCommands()),
+ // Recomputed on every transaction, not just `docChanged`: a command-list
+ // update reaches the editor as an empty repaint transaction (the same
+ // mechanism the locale repaint uses), and the token's state can flip
+ // without the document changing. The computation only reads the first
+ // block's leading text, so it's cheap enough to run unconditionally.
+ apply: (tr) => slashTokenDecorations(tr.doc, liveCommands()),
+ },
+ props: {
+ decorations(state) {
+ return this.getState(state);
+ },
+ },
+ });
+
+ const suggestion = Suggestion<SlashCommandItem>({
+ editor: this.editor,
+ pluginKey: composerSlashSuggestionKey,
+ char: '/',
+ // Message start only: agents parse commands at the head of the prompt,
+ // so a `/` anywhere else is prose (paths, "and/or") and must not pop the
+ // picker. `startOfLine` prunes mid-line matches cheaply; the `allow`
+ // check pins the match to the FIRST block (position 1 is the first text
+ // position of the first paragraph).
+ startOfLine: true,
+ allow: ({ range }) => range.from === 1,
+
+ items: ({ query }) => {
+ const commands = liveCommands();
+ if (commands === null || commands.length === 0) return [];
+ return filterSlashCommands(commands, query);
+ },
+
+ command: ({ editor, range, props: item }) => {
+ // Replace the ENTIRE leading token, not just the matched range: with
+ // the caret mid-token (`/ana|lyze`) the suggestion range ends at the
+ // caret, and deleting only that much would leave the token's tail
+ // (`lyze`) as junk after the inserted pill.
+ const leading = editor.state.doc.firstChild?.firstChild ?? null;
+ const tokenLength = leading?.isText
+ ? (leadingSlashToken(leading.text ?? '')?.length ?? 0)
+ : 0;
+ try {
+ // Picking promotes the command to an atomic pill (serializes back
+ // to `/name` via renderText); the trailing space ends the
+ // suggestion match and leaves the caret ready for arguments. One
+ // chain — one transaction (precedent #58).
+ editor
+ .chain()
+ .focus()
+ .deleteRange({ from: range.from, to: Math.max(range.to, 1 + tokenLength) })
+ .insertContent([
+ {
+ type: 'composerCommand',
+ attrs: {
+ name: item.name,
+ description: item.description,
+ hint: item.input?.hint ?? '',
+ },
+ },
+ { type: 'text', text: ' ' },
+ ])
+ .run();
+ } catch (err) {
+ // TipTap chains are atomic, so a partial insert cannot occur;
+ // surface the failure for diagnostics and let the user retry.
+ console.error('[composer-slash-command] insert failed', { item, range }, err);
+ }
+ },
+
+ render: () => {
+ let renderer: ReactRenderer<typeof ComposerSlashMenu> | null = null;
+ let currentProps: SuggestionProps<SlashCommandItem> | null = null;
+ let selectedIndex = 0;
+ const posState: SuggestionPositionState = { popup: null, stopAutoUpdate: null };
+ let doPosition: (() => void) | null = null;
+ // The view the count was published against, held for onExit —
+ // `currentProps` is nulled before the clear could read it.
+ let publishedView: object | null = null;
+
+ const onSelect = (item: SlashCommandItem) => {
+ currentProps?.command(item);
+ };
+
+ // Tell the composer's Enter guard whether this picker has anything to
+ // commit — over an empty list (unknown command, advertised-none corpus)
+ // Enter must submit the prompt, not sit on a popup that can't act.
+ const publishSelectableCount = (props: SuggestionProps<SlashCommandItem>) => {
+ publishedView = props.editor.view;
+ setSuggestionSelectableCount(publishedView, (props.items ?? []).length);
+ };
+
+ const computeMenuProps = (props: SuggestionProps<SlashCommandItem>) => ({
+ items: props.items ?? [],
+ query: props.query ?? '',
+ selectedIndex,
+ onSelect,
+ // Distinguishes the two empty corpora for the menu's copy: null =
+ // nothing advertised yet, [] = the agent said "none".
+ commandsKnown: liveCommands() !== null,
+ });
+
+ const rerender = () => {
+ if (!renderer || !currentProps) return;
+ renderer.updateProps(computeMenuProps(currentProps));
+ };
+
+ return {
+ onBeforeStart(props: SuggestionProps<SlashCommandItem>) {
+ currentProps = props;
+ selectedIndex = 0;
+ publishSelectableCount(props);
+ const result = createSuggestionPopup(() => currentProps, 'composer-slash');
+ posState.popup = result.popup;
+ doPosition = result.doPosition;
+ renderer = new ReactRenderer(ComposerSlashMenu, {
+ props: computeMenuProps(props),
+ editor: props.editor,
+ });
+ result.popup.appendChild(renderer.element);
+ posState.stopAutoUpdate = result.startAutoUpdate();
+ // Sync menu — content is final by the time the popup positions.
+ result.reveal();
+ },
+
+ onStart(props: SuggestionProps<SlashCommandItem>) {
+ currentProps = props;
+ selectedIndex = 0;
+ publishSelectableCount(props);
+ rerender();
+ },
+
+ onUpdate(props: SuggestionProps<SlashCommandItem>) {
+ currentProps = props;
+ selectedIndex = Math.min(selectedIndex, Math.max(0, props.items.length - 1));
+ publishSelectableCount(props);
+ rerender();
+ doPosition?.();
+ },
+
+ onKeyDown({ event }: SuggestionKeyDownProps) {
+ if (!currentProps) return false;
+ const items = currentProps.items;
+ if (event.key === 'ArrowDown') {
+ if (items.length === 0) return false;
+ selectedIndex = (selectedIndex + 1) % items.length;
+ rerender();
+ return true;
+ }
+ if (event.key === 'ArrowUp') {
+ if (items.length === 0) return false;
+ selectedIndex = (selectedIndex - 1 + items.length) % items.length;
+ rerender();
+ return true;
+ }
+ if (event.key === 'Enter' || event.key === 'Tab') {
+ const item = items[selectedIndex];
+ if (!item) return false;
+ currentProps.command(item);
+ return true;
+ }
+ return false;
+ },
+
+ onExit() {
+ destroySuggestionPopup(posState);
+ doPosition = null;
+ renderer?.destroy();
+ renderer = null;
+ currentProps = null;
+ selectedIndex = 0;
+ if (publishedView !== null) {
+ clearSuggestionSelectableCount(publishedView);
+ publishedView = null;
+ }
+ },
+ };
+ },
+ });
+
+ return [tokenPlugin, suggestion];
+ },
+});
diff --git a/packages/app/src/editor/composer-mention/composer-slash-input.dom.test.tsx b/packages/app/src/editor/composer-mention/composer-slash-input.dom.test.tsx
new file mode 100644
index 000000000..2b4d38fbd
--- /dev/null
+++ b/packages/app/src/editor/composer-mention/composer-slash-input.dom.test.tsx
@@ -0,0 +1,365 @@
+/**
+ * Tier-3 tests for the composer's `/` slash-command surface end to end through
+ * `ComposerMentionInput`: host gating (no corpus prop → `/` stays inert), the
+ * token decoration's recognized/unresolved states, the hint line's three-way
+ * copy, live command-list updates re-resolving both, the picker's suggestion
+ * lifecycle (message-start trigger, keyboard selection), and the
+ * one-transaction insertion pin (precedent #58).
+ */
+
+import { cleanup, fireEvent, render, screen } from '@testing-library/react';
+import type { Editor } from '@tiptap/core';
+import { act, createRef } from 'react';
+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
+import { ComposerMentionInput, type ComposerMentionInputHandle } from '../ComposerMentionInput';
+import {
+ composerSlashSuggestionKey,
+ getSlashCommands,
+ type SlashCommandItem,
+} from './composer-slash-command';
+
+const COMMANDS: SlashCommandItem[] = [
+ { name: 'review', description: 'Review the current diff' },
+ { name: 'create_plan', description: 'Draft an implementation plan' },
+ {
+ name: 'debug',
+ description: 'Root-cause a failure',
+ input: { hint: '[error message | failing test]' },
+ },
+];
+
+let consoleErrorSpy: ReturnType<typeof vi.spyOn>;
+
+beforeEach(() => {
+ // The editor's async mount emits act() warnings under jsdom; real failures
+ // still surface as missing-element assertion failures.
+ consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
+});
+
+afterEach(() => {
+ cleanup();
+ // Suggestion popups portal to document.body and can outlive an unmounted
+ // editor; clear them so the next test's queries start clean.
+ for (const node of document.querySelectorAll('[data-suggestion-popup]')) node.remove();
+ consoleErrorSpy.mockRestore();
+});
+
+/** Reach the live editor from the rendered textbox — TipTap's EditorContent
+ * tags the contenteditable host node with the instance. */
+function getComposerEditor(box: HTMLElement): Editor {
+ return (box as unknown as { editor: Editor }).editor;
+}
+
+function renderComposer(props?: {
+ slashCommands?: SlashCommandItem[] | null;
+ onSubmit?: () => void;
+}) {
+ const ref = createRef<ComposerMentionInputHandle>();
+ const utils = render(
+ <ComposerMentionInput
+ ref={ref}
+ ariaLabel="Message Agent"
+ onEmptyChange={() => {}}
+ onSubmit={props?.onSubmit ?? (() => {})}
+ slashCommands={props && 'slashCommands' in props ? props.slashCommands : undefined}
+ />,
+ );
+ const box = screen.getByRole('textbox', { name: 'Message Agent' });
+ return { ref, box, editor: getComposerEditor(box), ...utils };
+}
+
+/** Deliver a key to the slash Suggestion plugin's own `handleKeyDown` — the
+ * same entry point ProseMirror's keydown dispatch uses — so the production
+ * `render().onKeyDown` runs against the live picker state. */
+function pressKeyOnSlashSuggestion(editor: Editor, key: string): boolean {
+ const plugin = composerSlashSuggestionKey.get(editor.state);
+ const handleKeyDown = plugin?.props.handleKeyDown;
+ if (!plugin || !handleKeyDown) return false;
+ const event = new KeyboardEvent('keydown', { key, bubbles: true });
+ return handleKeyDown.call(plugin, editor.view, event) === true;
+}
+
+/** The suggestion `items()` resolves through the plugin's own microtask
+ * plumbing even for a sync corpus — poll a macrotask tick until the picker
+ * answers the key. */
+async function pressKeyOnceItemsLoad(editor: Editor, key: string): Promise<boolean> {
+ for (let i = 0; i < 50; i++) {
+ if (pressKeyOnSlashSuggestion(editor, key)) return true;
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ }
+ return false;
+}
+
+describe('host gating — surfaces without a corpus prop', () => {
+ test('omitting slashCommands mounts no slash plugin, no decoration, no hint', () => {
+ const { ref, box, editor } = renderComposer();
+ expect(composerSlashSuggestionKey.get(editor.state)).toBeUndefined();
+ expect(getSlashCommands(editor)).toBeNull();
+ act(() => ref.current?.setText('/review the diff'));
+ expect(box.querySelector('.composer-slash-token')).toBeNull();
+ expect(screen.queryByTestId('composer-slash-hint')).toBeNull();
+ });
+});
+
+describe('token decoration + hint line', () => {
+ test('a recognized command with arguments decorates as known — no ghost, no hint line', () => {
+ const { ref, box } = renderComposer({ slashCommands: COMMANDS });
+ act(() => ref.current?.setText('/review the diff'));
+ const token = box.querySelector('.composer-slash-token-known');
+ expect(token).not.toBeNull();
+ expect(token?.textContent).toBe('/review');
+ // Arguments are typed: the ghost is gone and the under-field region stays
+ // empty — a recognized command never renders a persistent line below.
+ expect(box.querySelector('.composer-slash-ghost')).toBeNull();
+ expect(screen.getByTestId('composer-slash-hint').textContent).toBe('');
+ });
+
+ test('a bare recognized command shows its description as in-field ghost text', () => {
+ const { ref, box } = renderComposer({ slashCommands: COMMANDS });
+ act(() => ref.current?.setText('/review'));
+ const ghost = box.querySelector('.composer-slash-ghost');
+ expect(ghost).not.toBeNull();
+ expect(ghost?.textContent).toBe('— Review the current diff');
+ // Inert scaffolding: hidden from AT (the region below covers warnings)
+ // and never a pointer target.
+ expect(ghost?.getAttribute('aria-hidden')).toBe('true');
+ expect(screen.getByTestId('composer-slash-hint').textContent).toBe('');
+ });
+
+ test("the ghost prefers the command's argument hint and vanishes once arguments arrive", () => {
+ const { ref, box } = renderComposer({ slashCommands: COMMANDS });
+ act(() => ref.current?.setText('/debug '));
+ expect(box.querySelector('.composer-slash-ghost')?.textContent).toBe(
+ '[error message | failing test]',
+ );
+ act(() => ref.current?.setText('/debug the flaky boot test'));
+ expect(box.querySelector('.composer-slash-ghost')).toBeNull();
+ expect(box.querySelector('.composer-slash-token-known')).not.toBeNull();
+ });
+
+ test('an unrecognized command decorates as unresolved and says so before submission', () => {
+ const { ref, box } = renderComposer({ slashCommands: COMMANDS });
+ act(() => ref.current?.setText('/tasks'));
+ const token = box.querySelector('.composer-slash-token-unknown');
+ expect(token).not.toBeNull();
+ expect(token?.textContent).toBe('/tasks');
+ expect(screen.getByTestId('composer-slash-hint').textContent).toContain(
+ "isn't a command this agent offers",
+ );
+ });
+
+ test('an advertised-empty corpus says the agent has no commands at all', () => {
+ const { ref } = renderComposer({ slashCommands: [] });
+ act(() => ref.current?.setText('/tasks'));
+ expect(screen.getByTestId('composer-slash-hint').textContent).toContain(
+ "doesn't offer slash commands",
+ );
+ });
+
+ test('a null corpus (not yet advertised) makes no claim either way', () => {
+ const { ref, box } = renderComposer({ slashCommands: null });
+ act(() => ref.current?.setText('/review'));
+ expect(box.querySelector('.composer-slash-token')).toBeNull();
+ // The live region is pre-registered (mounted empty) so its FIRST real
+ // announcement isn't dropped — no-claim renders as empty, not absent.
+ expect(screen.getByTestId('composer-slash-hint').textContent).toBe('');
+ });
+
+ test('a slash mid-message never decorates — commands live at message start', () => {
+ const { ref, box } = renderComposer({ slashCommands: COMMANDS });
+ act(() => ref.current?.setText('use /review please'));
+ expect(box.querySelector('.composer-slash-token')).toBeNull();
+ expect(screen.getByTestId('composer-slash-hint').textContent).toBe('');
+ });
+
+ test('a slash after a leading @-mention chip is prose, not a command', () => {
+ // An atomic chip contributes nothing to textContent, so a naive
+ // "first line text" read would see `[chip]/review` as a leading /review —
+ // and its decoration range would land on the chip. The token must come
+ // from a leading TEXT node only.
+ const ref = createRef<ComposerMentionInputHandle>();
+ render(
+ <ComposerMentionInput
+ ref={ref}
+ ariaLabel="Message Agent"
+ onEmptyChange={() => {}}
+ onSubmit={() => {}}
+ slashCommands={COMMANDS}
+ initialDoc={{
+ type: 'doc',
+ content: [
+ {
+ type: 'paragraph',
+ content: [
+ { type: 'composerMention', attrs: { path: 'notes.md', label: 'Notes' } },
+ { type: 'text', text: '/review' },
+ ],
+ },
+ ],
+ }}
+ />,
+ );
+ const box = screen.getByRole('textbox', { name: 'Message Agent' });
+ expect(box.querySelector('.composer-slash-token')).toBeNull();
+ expect(screen.getByTestId('composer-slash-hint').textContent).toBe('');
+ });
+
+ test('a live command-list update re-resolves the token and hint in place', () => {
+ const { ref, box, rerender } = renderComposer({ slashCommands: null });
+ act(() => ref.current?.setText('/review the diff'));
+ expect(box.querySelector('.composer-slash-token')).toBeNull();
+ // The agent's `available_commands_update` arrives mid-draft.
+ rerender(
+ <ComposerMentionInput
+ ref={ref}
+ ariaLabel="Message Agent"
+ onEmptyChange={() => {}}
+ onSubmit={() => {}}
+ slashCommands={COMMANDS}
+ />,
+ );
+ expect(box.querySelector('.composer-slash-token-known')).not.toBeNull();
+ // Arguments are present in this draft, so recognition shows as the pill
+ // alone — no ghost, empty region.
+ expect(screen.getByTestId('composer-slash-hint').textContent).toBe('');
+ });
+});
+
+describe('picker lifecycle', () => {
+ test('typing / at message start opens the picker; Enter inserts a pill in ONE transaction', async () => {
+ const { editor, ref, box } = renderComposer({ slashCommands: COMMANDS });
+ editor.commands.focus('end');
+ editor.commands.insertContent('/rev');
+
+ let docChangingCount = 0;
+ editor.on('transaction', ({ transaction }) => {
+ if (transaction.docChanged) docChangingCount += 1;
+ });
+
+ // Precondition: the picker became selectable (menu is live).
+ expect(await pressKeyOnceItemsLoad(editor, 'Enter')).toBe(true);
+ // The selection replaced the `/rev` range with an ATOMIC pill node + a
+ // trailing space, as exactly one doc-changing transaction (precedent #58 —
+ // a split delete+insert can remap onto adjacent nodes and destroy them).
+ expect(docChangingCount).toBe(1);
+ const lead = editor.state.doc.firstChild?.firstChild;
+ expect(lead?.type.name).toBe('composerCommand');
+ expect(lead?.attrs.name).toBe('review');
+ // Atomic: one unit for arrows/backspace, no caret positions inside.
+ expect(lead?.isAtom).toBe(true);
+ // The pill renders as the recognized token and serializes back to the
+ // invocation text the agent's prefix-based dispatch expects.
+ expect(box.querySelector('[data-composer-command="review"]')?.textContent).toBe('/review');
+ expect(ref.current?.getContent().instruction).toBe('/review');
+ });
+
+ test('picking with the caret mid-token replaces the WHOLE token — no tail junk', async () => {
+ const { editor, ref } = renderComposer({ slashCommands: COMMANDS });
+ editor.commands.focus('end');
+ editor.commands.insertContent('/create_plan');
+ // Park the caret inside the typed token (`/cr|eate_plan`) and re-open the
+ // picker there. Selecting must consume the token's tail too — deleting
+ // only up to the caret would leave `eate_plan` as junk after the pill.
+ editor.commands.setTextSelection(4);
+ expect(await pressKeyOnceItemsLoad(editor, 'Enter')).toBe(true);
+ const { instruction } = ref.current?.getContent() ?? { instruction: '' };
+ expect(instruction).toBe('/create_plan');
+ expect(editor.state.doc.textContent).not.toContain('eate_plan');
+ });
+
+ test('a picked bare pill shows the ghost from its own attrs; typing arguments clears it', async () => {
+ const { editor, box } = renderComposer({ slashCommands: COMMANDS });
+ editor.commands.focus('end');
+ editor.commands.insertContent('/deb');
+ expect(await pressKeyOnceItemsLoad(editor, 'Enter')).toBe(true);
+ // Bare pill (+ the picker's trailing space): the argument hint shows.
+ expect(box.querySelector('.composer-slash-ghost')?.textContent).toBe(
+ '[error message | failing test]',
+ );
+ editor.commands.insertContent('the flaky boot');
+ expect(box.querySelector('.composer-slash-ghost')).toBeNull();
+ });
+
+ test('the menu lists advertised commands and arrow keys move the selection', async () => {
+ const { editor } = renderComposer({ slashCommands: COMMANDS });
+ editor.commands.focus('end');
+ editor.commands.insertContent('/');
+
+ expect(await pressKeyOnceItemsLoad(editor, 'ArrowDown')).toBe(true);
+ const menu = screen.getByTestId('composer-slash-menu');
+ expect(menu.textContent).toContain('/review');
+ expect(menu.textContent).toContain('/create_plan');
+ // ArrowDown moved the highlight off row 0 onto row 1.
+ expect(
+ screen.getByTestId('composer-slash-option-create_plan').getAttribute('aria-selected'),
+ ).toBe('true');
+ });
+
+ test('Enter while the picker is open never submits the prompt', async () => {
+ const onSubmit = vi.fn(() => {});
+ const { editor, box } = renderComposer({ slashCommands: COMMANDS, onSubmit });
+ editor.commands.focus('end');
+ editor.commands.insertContent('/rev');
+ // Wait for the picker to become live, then route Enter through the
+ // component's own keydown path (the submit guard under test).
+ await pressKeyOnceItemsLoad(editor, 'ArrowDown');
+ fireEvent.keyDown(box, { key: 'Enter' });
+ expect(onSubmit).not.toHaveBeenCalled();
+ });
+
+ test('Enter over an EMPTY picker submits the prompt — never splits the paragraph', async () => {
+ // The suggestion plugin's `active` flag is regex-derived and stays true
+ // over an empty result list; a blanket defer would fall through to
+ // TipTap's core splitBlock and reward "press Enter to send" with a blank
+ // line. The pickers publish their selectable count so the guard defers
+ // only when Enter has something to commit.
+ const onSubmit = vi.fn(() => {});
+ const { editor, box } = renderComposer({ slashCommands: COMMANDS, onSubmit });
+ editor.commands.focus('end');
+ editor.commands.insertContent('/zzz');
+ // Let the picker open and resolve its (empty) item list.
+ for (let i = 0; i < 10; i++) await new Promise((resolve) => setTimeout(resolve, 0));
+ expect(composerSlashSuggestionKey.getState(editor.state)?.active).toBe(true);
+ expect(screen.getByTestId('composer-slash-menu').textContent).toContain('No matching commands');
+ fireEvent.keyDown(box, { key: 'Enter' });
+ expect(onSubmit).toHaveBeenCalledTimes(1);
+ // The document was not mutated by a fallthrough splitBlock.
+ expect(editor.state.doc.childCount).toBe(1);
+ expect(editor.state.doc.textContent).toBe('/zzz');
+ });
+
+ test('Escape while the picker is open dismisses it — never fires onEscape', async () => {
+ // The agent-thread composer wires onEscape to turn cancellation; an
+ // Escape meant to close the picker must not reach it.
+ const onEscape = vi.fn(() => {});
+ const ref = createRef<ComposerMentionInputHandle>();
+ render(
+ <ComposerMentionInput
+ ref={ref}
+ ariaLabel="Message Agent"
+ onEmptyChange={() => {}}
+ onSubmit={() => {}}
+ onEscape={onEscape}
+ slashCommands={COMMANDS}
+ />,
+ );
+ const box = screen.getByRole('textbox', { name: 'Message Agent' });
+ const editor = getComposerEditor(box);
+ editor.commands.focus('end');
+ editor.commands.insertContent('/rev');
+ await pressKeyOnceItemsLoad(editor, 'ArrowDown');
+ expect(composerSlashSuggestionKey.getState(editor.state)?.active).toBe(true);
+ fireEvent.keyDown(box, { key: 'Escape' });
+ expect(onEscape).not.toHaveBeenCalled();
+ });
+
+ test('a slash mid-text does not open the picker', async () => {
+ const { editor } = renderComposer({ slashCommands: COMMANDS });
+ editor.commands.focus('end');
+ editor.commands.insertContent('see /rev');
+ // Give the plugin its microtask room, then confirm it never went live.
+ await new Promise((resolve) => setTimeout(resolve, 20));
+ expect(composerSlashSuggestionKey.getState(editor.state)?.active).toBeFalsy();
+ expect(screen.queryByTestId('composer-slash-menu')).toBeNull();
+ });
+});
diff --git a/packages/app/src/editor/extensions/suggestion-floating-ui.ts b/packages/app/src/editor/extensions/suggestion-floating-ui.ts
index 1fead32c1..ce1c7f41f 100644
--- a/packages/app/src/editor/extensions/suggestion-floating-ui.ts
+++ b/packages/app/src/editor/extensions/suggestion-floating-ui.ts
@@ -6,6 +6,33 @@ export interface SuggestionPositionState {
stopAutoUpdate: (() => void) | null;
}
+/**
+ * How many selectable items the currently-open suggestion picker holds, keyed
+ * by the ProseMirror view it is attached to. The COMPOSER pickers (`@` and
+ * `/`) publish this so the composer's Enter guard can defer to the picker only
+ * when there is something to commit: the suggestion plugin's `active` state is
+ * regex-derived and stays true over an EMPTY result list, and a deferred Enter
+ * with nothing to select falls through to TipTap's core `splitBlock` — the
+ * user reads "press Enter to send", presses it, and gets a blank line instead.
+ * At most one picker is open per view (distinct trigger chars), so a single
+ * slot per view suffices. Document-editor pickers don't publish: their Enter
+ * fallthrough is a real newline, which is correct there.
+ */
+const suggestionSelectableCounts = new WeakMap<object, number>();
+
+export function setSuggestionSelectableCount(view: object, count: number): void {
+ suggestionSelectableCounts.set(view, count);
+}
+
+export function clearSuggestionSelectableCount(view: object): void {
+ suggestionSelectableCounts.delete(view);
+}
+
+/** True when the open picker on this view has at least one selectable item. */
+export function suggestionHasSelectableItem(view: object): boolean {
+ return (suggestionSelectableCounts.get(view) ?? 0) > 0;
+}
+
/**
* Create a positioned suggestion popup element and its positioning helpers.
* Shared by slash-command and wiki-link suggestion menus.
diff --git a/packages/app/src/globals.css b/packages/app/src/globals.css
index e823ffb53..d7cb667d8 100644
--- a/packages/app/src/globals.css
+++ b/packages/app/src/globals.css
@@ -1383,6 +1383,39 @@
text-overflow: ellipsis; /* truncate */
}
+/* The composer's leading `/command` token (decoration-styled text, not a chip
+ node — see composer-slash-command.ts). Both states pair a SHAPE cue with the
+ color so recognized vs unrecognized never rides color alone: recognized is a
+ filled pill (like a chip), unrecognized a dashed underline (the "unresolved
+ reference" idiom); the hint line under the field carries the textual
+ explanation. */
+.composer-slash-token {
+ border-radius: var(--radius-sm);
+ font-family: var(--font-mono);
+ font-size: 0.9em;
+}
+.composer-slash-token-known {
+ background-color: color-mix(in oklab, var(--primary) 14%, transparent);
+ box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 28%, transparent);
+ color: var(--foreground);
+ padding: 0.0625rem 0.125rem;
+}
+.composer-slash-token-unknown {
+ color: var(--muted-foreground);
+ text-decoration: underline dashed;
+ text-underline-offset: 3px;
+}
+/* In-field argument-hint ghost after a bare recognized /command (the
+ terminal-CLI idiom): inert, dimmed, never a pointer target, gone the moment
+ an argument is typed (the decoration recomputes per transaction). */
+.composer-slash-ghost {
+ margin-left: 0.5ch;
+ color: color-mix(in oklab, var(--muted-foreground) 75%, transparent);
+ pointer-events: none;
+ user-select: none;
+ white-space: pre-wrap;
+}
+
.ProseMirror [data-mark-view-content] {
@apply truncate;
}
diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.json
index f59b5e2b9..63b0905ba 100644
--- a/packages/app/src/locales/ar/messages.json
+++ b/packages/app/src/locales/ar/messages.json
@@ -488,6 +488,7 @@
"62bOuM": ["آخر تعديل"],
"636K3K": ["حذف الرقاقة المجاورة"],
"64sesb": ["تلفت المربعات التنبيهية الانتباه إلى المعلومات الأساسية."],
+ "67Dpmh": ["اقتراحات أوامر الشرطة المائلة"],
"67TEhP": [
"مجلدات مهاراتك على مستوى المستخدم — متاحة في كل مشروع على هذا الجهاز. وتتحكم قائمة التثبيت لكل مهارة في مكان وجودها."
],
@@ -723,6 +724,7 @@
"9KooKn": ["شغّل مراجعة مشروع من لوحة المشكلات."],
"9NJWgv": ["الروابط الخلفية"],
"9OIqw4": ["ليس لديك صلاحية الكتابة في هذا المستودع."],
+ "9OPs7U": ["لم يعلن هذا الوكيل عن أوامره بعد"],
"9PQysm": ["إخفاء المتقدم"],
"9R7pRC": ["لا توجد وسوم تطابق «", ["trimmed"], "». تابع الكتابة لإنشاء واحد."],
"9UQ730": ["استنساخ"],
@@ -2008,6 +2010,7 @@
"Q7cNKe": ["أصبحت المهارات مشتركة. أودع .ok/skills لمشاركتها مع فريقك."],
"Q7xfEj": ["تم"],
"Q8A-U_": ["متصل بـ"],
+ "Q9AxTM": ["هذا الوكيل لا يقدم أوامر الشرطة المائلة — سترسل رسالتك كنص عادي"],
"QASTNu": [
"يحتوي مجلد ",
["editor"],
@@ -2055,6 +2058,7 @@
"QlAG4m": ["أخبرنا المزيد (اختياري)"],
"QlkiD5": ["إعادة الوضع على النص المحدد"],
"QlxHAH": ["تُعرض نتائج «", ["semanticResultsLabel"], "»"],
+ "QohqVL": ["هذا الوكيل لا يقدم أوامر الشرطة المائلة"],
"QpSqAP": [
"الصدفة الحقيقية معطّلة لهذا المشروع. تشغيلها يجعل الأوامر تُنفَّذ بكامل صلاحيات حساب المستخدم الخاص بك."
],
@@ -3815,6 +3819,7 @@
"m2T1Xj": ["الوسم #", ["tagValue"], "، ", ["uses"]],
"m6YGpY": ["يظهر هنا محتوى اللوحة النشطة للتبويب المحدد."],
"mAzs2H": ["تعطيل ", ["file"]],
+ "mBK8zm": ["/", ["0"], " ليس أمرًا يقدمه هذا الوكيل — سيُرسل كنص عادي"],
"mBltnd": ["اقتراحات المسارات"],
"mCB6Je": ["تحديد الكل"],
"mGaZwZ": ["اطّلع على دليل التثبيت الكامل"],
@@ -4026,6 +4031,7 @@
],
"oYepHb": ["الطرفية معطّلة لهذا المشروع. أعد تشغيلها لتنفيذ الأوامر هنا."],
"oZUYMv": ["تعذّرت استعادة ", ["0"], ". هذا الاسم مستخدم بالفعل."],
+ "odYWGJ": ["لا توجد أوامر مطابقة"],
"of3tF-": [
"اخترت ~/Documents. سيفهرس OpenKnowledge كل ملف Markdown تحته. إن كنت تريد إدارة مجلد فرعي فقط، فاختر نطاقًا أصغر."
],
diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.po
index 5ae9c9548..29313daec 100644
--- a/packages/app/src/locales/ar/messages.po
+++ b/packages/app/src/locales/ar/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}، {tabCount, plural, zero {# تبويب متزامن} one {ت
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, zero {كلمات} one {كلمة} two {كلمتان} few {كلمات} many {كلمةً} other {كلمة}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} ليس أمرًا يقدمه هذا الوكيل — سيُرسل كنص عادي"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// ملاحظة"
@@ -7876,6 +7881,10 @@ msgstr "لا توجد تطابقات. بعض الملفات مستثناة من
msgid "No matching branches."
msgstr "لا توجد فروع مطابقة."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "لا توجد أوامر مطابقة"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "لا توجد أوامر مطابقة."
@@ -11230,6 +11239,10 @@ msgstr "تم تخطي تنزيل {0}."
msgid "Slash command menu"
msgstr "قائمة أوامر الشرطة المائلة"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "اقتراحات أوامر الشرطة المائلة"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "أوامر الشرطة المائلة"
@@ -12308,6 +12321,18 @@ msgstr "شُورك هذا {targetNoun} من الفرع <0>{shareBranch}</0>. و
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "شُورك هذا {targetNoun} من الفرع <0>{shareBranch}</0>. وأنت حاليًا على <1>{currentLabel}</1>."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "هذا الوكيل لا يقدم أوامر الشرطة المائلة"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "هذا الوكيل لا يقدم أوامر الشرطة المائلة — سترسل رسالتك كنص عادي"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "لم يعلن هذا الوكيل عن أوامره بعد"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "يحتاج هذا الوكيل إلى تسجيل دخولك أولًا — انظر الإشعار أدناه."
diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.json
index 91d536b36..99c7ef10a 100644
--- a/packages/app/src/locales/bn/messages.json
+++ b/packages/app/src/locales/bn/messages.json
@@ -425,6 +425,7 @@
"62bOuM": ["সর্বশেষ সম্পাদনা"],
"636K3K": ["পাশের চিপ মুছুন"],
"64sesb": ["কলআউট মূল তথ্যের দিকে মনোযোগ আকর্ষণ করে।"],
+ "67Dpmh": ["স্ল্যাশ কমান্ডের প্রস্তাবনা"],
"67TEhP": [
"আপনার ব্যবহারকারী-স্তরের স্কিল ফোল্ডার — এই মেশিনের প্রতিটি প্রকল্পে পাওয়া যায়। প্রতিটি স্কিলের ইনস্টল মেনু ঠিক করে সেটি কোথায় থাকবে।"
],
@@ -629,6 +630,7 @@
"9KooKn": ["Problems প্যানেল থেকে একটি প্রকল্প নিরীক্ষা চালান।"],
"9NJWgv": ["ব্যাকলিংক"],
"9OIqw4": ["এই রিপোজিটরিতে আপনার লেখার প্রবেশাধিকার নেই।"],
+ "9OPs7U": ["এই এজেন্ট এখনও তার কমান্ড ঘোষণা করেনি"],
"9PQysm": ["উন্নত লুকান"],
"9R7pRC": ["\"", ["trimmed"], "\"-এর সঙ্গে কোনো ট্যাগ মেলে না। একটি তৈরি করতে লিখতে থাকুন।"],
"9UQ730": ["ক্লোন করুন"],
@@ -1740,6 +1742,7 @@
"Q7cNKe": ["স্কিল এখন ভাগ করা। আপনার দলের সঙ্গে ভাগ করতে .ok/skills কমিট করুন।"],
"Q7xfEj": ["সম্পন্ন"],
"Q8A-U_": ["যার সঙ্গে যুক্ত"],
+ "Q9AxTM": ["এই এজেন্ট স্ল্যাশ কমান্ড দেয় না — আপনার বার্তা সাধারণ টেক্সট হিসেবে পাঠানো হবে"],
"QASTNu": [
["editor"],
" ফোল্ডারে এই স্কিলের একটি ভিন্ন সংস্করণ আছে। কোনটি থাকবে তা বাছুন, নয়তো দুটোই আলাদা নামে রাখুন। আপনি যা-ই বদলান, তার আগে ব্যাকআপ নেওয়া হয়।"
@@ -1780,6 +1783,7 @@
"QlAG4m": ["আরও বলুন (ঐচ্ছিক)"],
"QlkiD5": ["নির্বাচিত লেখার উপর আবার বসান"],
"QlxHAH": ["\"", ["semanticResultsLabel"], "\"-এর ফলাফল দেখানো হচ্ছে"],
+ "QohqVL": ["এই এজেন্ট স্ল্যাশ কমান্ড দেয় না"],
"QpSqAP": [
"এই প্রকল্পের জন্য আসল শেল বন্ধ আছে। চালু করলে কমান্ডগুলো আপনার ইউজার অ্যাকাউন্টের পূর্ণ অ্যাক্সেস নিয়ে চলে।"
],
@@ -3305,6 +3309,7 @@
"m2T1Xj": ["ট্যাগ #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["নির্বাচিত ট্যাবের সক্রিয় প্যানেলের বিষয়বস্তু এখানে দেখা যায়।"],
"mAzs2H": [["file"], " নিষ্ক্রিয় করুন"],
+ "mBK8zm": ["/", ["0"], " এই এজেন্টের দেওয়া কোনো কমান্ড নয় — এটি সাধারণ টেক্সট হিসেবে পাঠানো হবে"],
"mBltnd": ["পথের পরামর্শ"],
"mCB6Je": ["সব নির্বাচন করুন"],
"mGaZwZ": ["পূর্ণ ইনস্টল নির্দেশিকা দেখুন"],
@@ -3481,6 +3486,7 @@
],
"oYepHb": ["এই প্রকল্পের জন্য টার্মিনাল বন্ধ। এখানে কমান্ড চালাতে সেটি আবার চালু করুন।"],
"oZUYMv": [["0"], " পুনরুদ্ধার করা যায়নি। ওই নামটি ইতিমধ্যে ব্যবহৃত হচ্ছে।"],
+ "odYWGJ": ["কোনো মিলে যাওয়া কমান্ড নেই"],
"of3tF-": [
"আপনি ~/Documents বেছেছেন। OpenKnowledge এর নিচের প্রতিটি markdown ফাইল সূচিভুক্ত করবে। আপনি যদি কেবল একটি উপ-ফোল্ডার সামলাতে চান, তবে ছোট একটি পরিসর বাছুন।"
],
diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.po
index bc4ef85ad..4830760d0 100644
--- a/packages/app/src/locales/bn/messages.po
+++ b/packages/app/src/locales/bn/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}, {tabCount, plural, one {# একযোগে ট্যাব
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, one {শব্দ} other {শব্দ}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} এই এজেন্টের দেওয়া কোনো কমান্ড নয় — এটি সাধারণ টেক্সট হিসেবে পাঠানো হবে"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// নোট"
@@ -7872,6 +7877,10 @@ msgstr "কোনো মিল নেই। কিছু ফাইল অনু
msgid "No matching branches."
msgstr "মিলে যাওয়া কোনো ব্রাঞ্চ নেই।"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "কোনো মিলে যাওয়া কমান্ড নেই"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "মিলে যাওয়া কোনো কমান্ড নেই।"
@@ -11226,6 +11235,10 @@ msgstr "{0} ডাউনলোড এড়িয়ে যাওয়া হ
msgid "Slash command menu"
msgstr "স্ল্যাশ কমান্ড মেনু"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "স্ল্যাশ কমান্ডের প্রস্তাবনা"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "স্ল্যাশ কমান্ড"
@@ -12304,6 +12317,18 @@ msgstr "এই {targetNoun} ব্রাঞ্চ <0>{shareBranch}</0> থেক
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "এই {targetNoun} ব্রাঞ্চ <0>{shareBranch}</0> থেকে ভাগ করা হয়েছিল। আপনি এখন <1>{currentLabel}</1>-এ আছেন।"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "এই এজেন্ট স্ল্যাশ কমান্ড দেয় না"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "এই এজেন্ট স্ল্যাশ কমান্ড দেয় না — আপনার বার্তা সাধারণ টেক্সট হিসেবে পাঠানো হবে"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "এই এজেন্ট এখনও তার কমান্ড ঘোষণা করেনি"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "এই এজেন্টের জন্য আপনাকে আগে সাইন ইন করতে হবে — নিচের বিজ্ঞপ্তিটি দেখুন।"
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 48db44d16..71e3d688f 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -434,6 +434,7 @@
"62bOuM": ["Latest edit"],
"636K3K": ["Delete adjacent chip"],
"64sesb": ["Callouts draw attention to key information."],
+ "67Dpmh": ["Slash command suggestions"],
"67TEhP": [
"Your user-level skill folders — available in every project on this machine. Each skill's install menu controls where it lives."
],
@@ -650,6 +651,7 @@
"9KooKn": ["Run a project audit from the Problems panel."],
"9NJWgv": ["Backlinks"],
"9OIqw4": ["You don't have write access to this repo."],
+ "9OPs7U": ["This agent hasn't announced its commands yet"],
"9PQysm": ["Hide advanced"],
"9R7pRC": ["No tags match \"", ["trimmed"], "\". Continue typing to create one."],
"9UQ730": ["Clone"],
@@ -1788,6 +1790,7 @@
"Q7cNKe": ["Skills are now shared. Commit .ok/skills to share them with your team."],
"Q7xfEj": ["done"],
"Q8A-U_": ["Connected to"],
+ "Q9AxTM": ["This agent doesn't offer slash commands — your message will be sent as plain text"],
"QASTNu": [
"The ",
["editor"],
@@ -1828,6 +1831,7 @@
"QlAG4m": ["Tell us more (optional)"],
"QlkiD5": ["Re-place on selected text"],
"QlxHAH": ["Showing results for \"", ["semanticResultsLabel"], "\""],
+ "QohqVL": ["This agent doesn't offer slash commands"],
"QpSqAP": [
"A real shell is off for this project. Turning it on runs commands with the full access of your user account."
],
@@ -3402,6 +3406,7 @@
"m2T1Xj": ["Tag #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["Active panel content for the selected tab shows here."],
"mAzs2H": ["Disable ", ["file"]],
+ "mBK8zm": ["/", ["0"], " isn't a command this agent offers — it will be sent as plain text"],
"mBltnd": ["Path suggestions"],
"mCB6Je": ["Select All"],
"mGaZwZ": ["See the full install guide"],
@@ -3589,6 +3594,7 @@
"The terminal is turned off for this project. Turn it back on to run commands here."
],
"oZUYMv": ["Couldn’t restore ", ["0"], ". That name is already in use."],
+ "odYWGJ": ["No matching commands"],
"of3tF-": [
"You picked ~/Documents. OpenKnowledge will index every markdown file under it. If you only want to manage a sub-folder, choose a smaller scope."
],
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index 32a4068b0..3698d0be4 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurren
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, one {word} other {words}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} isn't a command this agent offers — it will be sent as plain text"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// note"
@@ -7876,6 +7881,10 @@ msgstr "No matches. Some files are excluded from search (hidden or ignored files
msgid "No matching branches."
msgstr "No matching branches."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "No matching commands"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "No matching commands."
@@ -11230,6 +11239,10 @@ msgstr "Skipped downloading {0}."
msgid "Slash command menu"
msgstr "Slash command menu"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "Slash command suggestions"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "Slash commands"
@@ -12308,6 +12321,18 @@ msgstr "This {targetNoun} was shared from branch <0>{shareBranch}</0>. It doesn'
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "This agent doesn't offer slash commands"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "This agent doesn't offer slash commands — your message will be sent as plain text"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "This agent hasn't announced its commands yet"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "This agent needs you to sign in first — see the notice below."
diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.json
index 74ddfd0bd..bf0793f42 100644
--- a/packages/app/src/locales/es/messages.json
+++ b/packages/app/src/locales/es/messages.json
@@ -501,6 +501,7 @@
"62bOuM": ["Última edición"],
"636K3K": ["Eliminar el chip contiguo"],
"64sesb": ["Los avisos destacan la información clave."],
+ "67Dpmh": ["Sugerencias de comandos de barra"],
"67TEhP": [
"Tus carpetas de habilidades de nivel de usuario: disponibles en todos los proyectos de este equipo. El menú de instalación de cada habilidad controla dónde vive."
],
@@ -745,6 +746,7 @@
"9KooKn": ["Ejecuta una auditoría del proyecto desde el panel Problemas."],
"9NJWgv": ["Retroenlaces"],
"9OIqw4": ["No tienes acceso de escritura a este repositorio."],
+ "9OPs7U": ["Este agente aún no ha anunciado sus comandos"],
"9PQysm": ["Ocultar opciones avanzadas"],
"9R7pRC": [
"Ninguna etiqueta coincide con \"",
@@ -2045,6 +2047,9 @@
],
"Q7xfEj": ["listo"],
"Q8A-U_": ["Conectado a"],
+ "Q9AxTM": [
+ "Este agente no ofrece comandos de barra — tu mensaje se enviará como texto sin formato"
+ ],
"QASTNu": [
"La carpeta de ",
["editor"],
@@ -2093,6 +2098,7 @@
"QlAG4m": ["Cuéntanos más (opcional)"],
"QlkiD5": ["Volver a colocar sobre el texto seleccionado"],
"QlxHAH": ["Mostrando resultados de \"", ["semanticResultsLabel"], "\""],
+ "QohqVL": ["Este agente no ofrece comandos de barra"],
"QpSqAP": [
"El shell real está desactivado para este proyecto. Al activarlo, los comandos se ejecutan con todo el acceso de tu cuenta de usuario."
],
@@ -3923,6 +3929,11 @@
"m2T1Xj": ["Etiqueta #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["Aquí se muestra el contenido del panel activo de la pestaña seleccionada."],
"mAzs2H": ["Desactivar ", ["file"]],
+ "mBK8zm": [
+ "/",
+ ["0"],
+ " no es un comando que ofrezca este agente — se enviará como texto sin formato"
+ ],
"mBltnd": ["Sugerencias de rutas"],
"mCB6Je": ["Seleccionar todo"],
"mGaZwZ": ["Ver la guía de instalación completa"],
@@ -4130,6 +4141,7 @@
"La terminal está desactivada en este proyecto. Vuelve a activarla para ejecutar comandos aquí."
],
"oZUYMv": ["No se pudo restaurar ", ["0"], ". Ese nombre ya está en uso."],
+ "odYWGJ": ["No hay comandos coincidentes"],
"of3tF-": [
"Elegiste ~/Documents. OpenKnowledge indexará todos los archivos markdown que haya debajo. Si solo quieres gestionar una subcarpeta, elige un alcance más pequeño."
],
diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.po
index 731a1e6ba..54692eb21 100644
--- a/packages/app/src/locales/es/messages.po
+++ b/packages/app/src/locales/es/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}, {tabCount, plural, one {# pestaña simultánea} many {# pest
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, one {palabra} many {palabras} other {palabras}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} no es un comando que ofrezca este agente — se enviará como texto sin formato"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// nota"
@@ -7876,6 +7881,10 @@ msgstr "Sin coincidencias. Algunos archivos quedan fuera de la búsqueda (archiv
msgid "No matching branches."
msgstr "Ninguna rama coincide."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "No hay comandos coincidentes"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "Ningún comando coincide."
@@ -11230,6 +11239,10 @@ msgstr "Se omitió la descarga de {0}."
msgid "Slash command menu"
msgstr "Menú de comandos de barra"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "Sugerencias de comandos de barra"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "Comandos de barra"
@@ -12308,6 +12321,18 @@ msgstr "Este {targetNoun} se compartió desde la rama <0>{shareBranch}</0>. No e
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "Este {targetNoun} se compartió desde la rama <0>{shareBranch}</0>. Ahora mismo estás en <1>{currentLabel}</1>."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "Este agente no ofrece comandos de barra"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "Este agente no ofrece comandos de barra — tu mensaje se enviará como texto sin formato"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "Este agente aún no ha anunciado sus comandos"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "Este agente necesita que inicies sesión primero; mira el aviso de abajo."
diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.json
index 39673a5bd..1656b4231 100644
--- a/packages/app/src/locales/fr/messages.json
+++ b/packages/app/src/locales/fr/messages.json
@@ -523,6 +523,7 @@
"62bOuM": ["Dernière modification"],
"636K3K": ["Supprimer la puce adjacente"],
"64sesb": ["Les encadrés attirent l'attention sur les informations essentielles."],
+ "67Dpmh": ["Suggestions de commandes slash"],
"67TEhP": [
"Vos dossiers de compétences au niveau utilisateur — disponibles dans tous les projets de cette machine. Le menu d'installation de chaque compétence détermine où elle réside."
],
@@ -773,6 +774,7 @@
"9KooKn": ["Lancez un audit du projet depuis le panneau Problèmes."],
"9NJWgv": ["Rétroliens"],
"9OIqw4": ["Vous n'avez pas d'accès en écriture à ce dépôt."],
+ "9OPs7U": ["Cet agent n'a pas encore annoncé ses commandes"],
"9PQysm": ["Masquer les options avancées"],
"9R7pRC": [
"Aucune étiquette ne correspond à « ",
@@ -2076,6 +2078,9 @@
],
"Q7xfEj": ["terminé"],
"Q8A-U_": ["Connecté à"],
+ "Q9AxTM": [
+ "Cet agent ne propose pas de commandes slash — votre message sera envoyé comme texte brut"
+ ],
"QASTNu": [
"Le dossier ",
["editor"],
@@ -2122,6 +2127,7 @@
"QlAG4m": ["Dites-nous en plus (facultatif)"],
"QlkiD5": ["Replacer sur le texte sélectionné"],
"QlxHAH": ["Résultats pour « ", ["semanticResultsLabel"], " »"],
+ "QohqVL": ["Cet agent ne propose pas de commandes slash"],
"QpSqAP": [
"Le vrai shell est désactivé pour ce projet. L'activer exécute les commandes avec tous les droits de votre compte utilisateur."
],
@@ -3964,6 +3970,11 @@
"m2T1Xj": ["Étiquette #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["Le contenu du panneau actif de l'onglet sélectionné s'affiche ici."],
"mAzs2H": ["Désactiver ", ["file"]],
+ "mBK8zm": [
+ "/",
+ ["0"],
+ " n'est pas une commande proposée par cet agent — elle sera envoyée comme texte brut"
+ ],
"mBltnd": ["Suggestions de chemins"],
"mCB6Je": ["Tout sélectionner"],
"mGaZwZ": ["Voir le guide d'installation complet"],
@@ -4169,6 +4180,7 @@
"Le terminal est désactivé pour ce projet. Réactivez-le pour exécuter des commandes ici."
],
"oZUYMv": ["Impossible de restaurer ", ["0"], ". Ce nom est déjà utilisé."],
+ "odYWGJ": ["Aucune commande correspondante"],
"of3tF-": [
"Vous avez choisi ~/Documents. OpenKnowledge indexera chaque fichier markdown qui s'y trouve. Si vous ne voulez gérer qu'un sous-dossier, choisissez une portée plus restreinte."
],
diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.po
index 2cfb9e6c0..cb5ca933b 100644
--- a/packages/app/src/locales/fr/messages.po
+++ b/packages/app/src/locales/fr/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}, {tabCount, plural, one {# onglet simultané} many {# onglets
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, one {mot} many {mots} other {mots}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} n'est pas une commande proposée par cet agent — elle sera envoyée comme texte brut"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// note"
@@ -7876,6 +7881,10 @@ msgstr "Aucune correspondance. Certains fichiers sont exclus de la recherche (fi
msgid "No matching branches."
msgstr "Aucune branche correspondante."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "Aucune commande correspondante"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "Aucune commande correspondante."
@@ -11230,6 +11239,10 @@ msgstr "Téléchargement de {0} ignoré."
msgid "Slash command menu"
msgstr "Menu des commandes slash"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "Suggestions de commandes slash"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "Commandes slash"
@@ -12308,6 +12321,18 @@ msgstr "Ce {targetNoun} a été partagé depuis la branche <0>{shareBranch}</0>.
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "Ce {targetNoun} a été partagé depuis la branche <0>{shareBranch}</0>. Vous êtes actuellement sur <1>{currentLabel}</1>."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "Cet agent ne propose pas de commandes slash"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "Cet agent ne propose pas de commandes slash — votre message sera envoyé comme texte brut"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "Cet agent n'a pas encore annoncé ses commandes"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "Cet agent nécessite que vous vous connectiez d'abord — voyez l'avis ci-dessous."
diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.json
index 7186c4e80..803024c0e 100644
--- a/packages/app/src/locales/hi/messages.json
+++ b/packages/app/src/locales/hi/messages.json
@@ -423,6 +423,7 @@
"62bOuM": ["नवीनतम संपादन"],
"636K3K": ["बगल का चिप हटाएँ"],
"64sesb": ["कॉलआउट मुख्य जानकारी की ओर ध्यान खींचते हैं।"],
+ "67Dpmh": ["स्लैश कमांड सुझाव"],
"67TEhP": [
"आपके उपयोगकर्ता-स्तर के स्किल फ़ोल्डर — इस मशीन के हर प्रोजेक्ट में उपलब्ध। हर स्किल का इंस्टॉल मेन्यू तय करता है कि वह कहाँ रहेगी।"
],
@@ -625,6 +626,7 @@
"9KooKn": ["Problems पैनल से एक प्रोजेक्ट ऑडिट चलाएँ।"],
"9NJWgv": ["बैकलिंक"],
"9OIqw4": ["इस रिपॉज़िटरी में आपके पास लिखने की पहुँच नहीं है।"],
+ "9OPs7U": ["इस एजेंट ने अभी तक अपने कमांड घोषित नहीं किए हैं"],
"9PQysm": ["उन्नत छिपाएँ"],
"9R7pRC": ["\"", ["trimmed"], "\" से कोई टैग मेल नहीं खाता। एक बनाने के लिए लिखते रहें।"],
"9UQ730": ["क्लोन करें"],
@@ -1734,6 +1736,7 @@
"Q7cNKe": ["स्किल अब साझा हैं। अपनी टीम के साथ साझा करने के लिए .ok/skills कमिट करें।"],
"Q7xfEj": ["पूर्ण"],
"Q8A-U_": ["इससे जुड़ा"],
+ "Q9AxTM": ["यह एजेंट स्लैश कमांड नहीं देता — आपका संदेश सादे टेक्स्ट के रूप में भेजा जाएगा"],
"QASTNu": [
["editor"],
" फ़ोल्डर में इस स्किल का एक अलग संस्करण है। चुनें कि कौन सा रहेगा, या दोनों को अलग-अलग नामों से रखें। आप जो भी बदलते हैं उसका पहले बैकअप ले लिया जाता है।"
@@ -1770,6 +1773,7 @@
"QlAG4m": ["हमें और बताएँ (वैकल्पिक)"],
"QlkiD5": ["चयनित पाठ पर फिर से रखें"],
"QlxHAH": ["\"", ["semanticResultsLabel"], "\" के परिणाम दिखाए जा रहे हैं"],
+ "QohqVL": ["यह एजेंट स्लैश कमांड नहीं देता"],
"QpSqAP": [
"इस प्रोजेक्ट के लिए असली शेल बंद है। इसे चालू करने पर कमांड आपके उपयोगकर्ता खाते की पूरी पहुँच के साथ चलते हैं।"
],
@@ -3288,6 +3292,7 @@
"m2T1Xj": ["टैग #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["चयनित टैब की सक्रिय पैनल सामग्री यहाँ दिखती है।"],
"mAzs2H": [["file"], " अक्षम करें"],
+ "mBK8zm": ["/", ["0"], " इस एजेंट द्वारा दिया जाने वाला कमांड नहीं है — इसे सादे टेक्स्ट के रूप में भेजा जाएगा"],
"mBltnd": ["पथ सुझाव"],
"mCB6Je": ["सब चुनें"],
"mGaZwZ": ["पूरी इंस्टॉल मार्गदर्शिका देखें"],
@@ -3467,6 +3472,7 @@
],
"oYepHb": ["इस प्रोजेक्ट के लिए टर्मिनल बंद है। यहाँ कमांड चलाने के लिए इसे वापस चालू करें।"],
"oZUYMv": [["0"], " बहाल नहीं किया जा सका। वह नाम पहले से उपयोग में है।"],
+ "odYWGJ": ["कोई मेल खाता कमांड नहीं"],
"of3tF-": [
"आपने ~/Documents चुना। OpenKnowledge उसके नीचे की हर markdown फ़ाइल अनुक्रमित करेगा। यदि आप केवल किसी उप-फ़ोल्डर को सँभालना चाहते हैं, तो कोई छोटा दायरा चुनें।"
],
diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.po
index 69492b0d7..e6725c865 100644
--- a/packages/app/src/locales/hi/messages.po
+++ b/packages/app/src/locales/hi/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}, {tabCount, plural, one {# समवर्ती टैब} o
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, one {शब्द} other {शब्द}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} इस एजेंट द्वारा दिया जाने वाला कमांड नहीं है — इसे सादे टेक्स्ट के रूप में भेजा जाएगा"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// नोट"
@@ -7872,6 +7877,10 @@ msgstr "कोई मेल नहीं। कुछ फ़ाइलें ख
msgid "No matching branches."
msgstr "कोई मेल खाती ब्रांच नहीं।"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "कोई मेल खाता कमांड नहीं"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "कोई मेल खाता कमांड नहीं।"
@@ -11226,6 +11235,10 @@ msgstr "{0} डाउनलोड करना छोड़ दिया गय
msgid "Slash command menu"
msgstr "स्लैश कमांड मेन्यू"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "स्लैश कमांड सुझाव"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "स्लैश कमांड"
@@ -12304,6 +12317,18 @@ msgstr "यह {targetNoun} ब्रांच <0>{shareBranch}</0> से स
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "यह {targetNoun} ब्रांच <0>{shareBranch}</0> से साझा किया गया था। आप फ़िलहाल <1>{currentLabel}</1> पर हैं।"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "यह एजेंट स्लैश कमांड नहीं देता"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "यह एजेंट स्लैश कमांड नहीं देता — आपका संदेश सादे टेक्स्ट के रूप में भेजा जाएगा"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "इस एजेंट ने अभी तक अपने कमांड घोषित नहीं किए हैं"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "इस एजेंट के लिए पहले आपका साइन इन करना ज़रूरी है — नीचे दी सूचना देखें।"
diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.json
index 96afd4ea9..161911e1a 100644
--- a/packages/app/src/locales/id/messages.json
+++ b/packages/app/src/locales/id/messages.json
@@ -435,6 +435,7 @@
"62bOuM": ["Suntingan terakhir"],
"636K3K": ["Hapus chip di sebelahnya"],
"64sesb": ["Kotak sorot menarik perhatian ke informasi penting."],
+ "67Dpmh": ["Saran perintah garis miring"],
"67TEhP": [
"Folder keterampilan tingkat pengguna Anda — tersedia di setiap proyek pada komputer ini. Menu pemasangan tiap keterampilan menentukan di mana ia berada."
],
@@ -653,6 +654,7 @@
"9KooKn": ["Jalankan audit proyek dari panel Masalah."],
"9NJWgv": ["Tautan balik"],
"9OIqw4": ["Anda tidak punya akses tulis ke repo ini."],
+ "9OPs7U": ["Agen ini belum mengumumkan perintahnya"],
"9PQysm": ["Sembunyikan opsi lanjutan"],
"9R7pRC": [
"Tidak ada tag yang cocok dengan \"",
@@ -1799,6 +1801,9 @@
],
"Q7xfEj": ["selesai"],
"Q8A-U_": ["Terhubung ke"],
+ "Q9AxTM": [
+ "Agen ini tidak menawarkan perintah garis miring — pesan Anda akan dikirim sebagai teks biasa"
+ ],
"QASTNu": [
"Folder ",
["editor"],
@@ -1841,6 +1846,7 @@
"QlAG4m": ["Ceritakan lebih banyak (opsional)"],
"QlkiD5": ["Tempatkan ulang pada teks terpilih"],
"QlxHAH": ["Menampilkan hasil untuk \"", ["semanticResultsLabel"], "\""],
+ "QohqVL": ["Agen ini tidak menawarkan perintah garis miring"],
"QpSqAP": [
"Shell asli dinonaktifkan untuk proyek ini. Mengaktifkannya membuat perintah berjalan dengan akses penuh akun pengguna Anda."
],
@@ -3440,6 +3446,11 @@
"m2T1Xj": ["Tag #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["Isi panel aktif untuk tab yang dipilih muncul di sini."],
"mAzs2H": ["Nonaktifkan ", ["file"]],
+ "mBK8zm": [
+ "/",
+ ["0"],
+ " bukan perintah yang ditawarkan agen ini — akan dikirim sebagai teks biasa"
+ ],
"mBltnd": ["Saran jalur"],
"mCB6Je": ["Pilih Semua"],
"mGaZwZ": ["Lihat panduan pemasangan lengkap"],
@@ -3621,6 +3632,7 @@
"Terminal dimatikan untuk proyek ini. Nyalakan lagi untuk menjalankan perintah di sini."
],
"oZUYMv": [["0"], " tidak dapat dipulihkan. Nama itu sudah digunakan."],
+ "odYWGJ": ["Tidak ada perintah yang cocok"],
"of3tF-": [
"Anda memilih ~/Documents. OpenKnowledge akan mengindeks setiap berkas markdown di bawahnya. Jika Anda hanya ingin mengelola sebuah subfolder, pilih cakupan yang lebih kecil."
],
diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.po
index 7da5cae54..14f788d1c 100644
--- a/packages/app/src/locales/id/messages.po
+++ b/packages/app/src/locales/id/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}, {tabCount, plural, other {# tab bersamaan}}"
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, other {kata}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} bukan perintah yang ditawarkan agen ini — akan dikirim sebagai teks biasa"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// catatan"
@@ -7872,6 +7877,10 @@ msgstr "Tidak ada kecocokan. Sebagian berkas dikecualikan dari pencarian (berkas
msgid "No matching branches."
msgstr "Tidak ada cabang yang cocok."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "Tidak ada perintah yang cocok"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "Tidak ada perintah yang cocok."
@@ -11226,6 +11235,10 @@ msgstr "Unduhan {0} dilewati."
msgid "Slash command menu"
msgstr "Menu perintah garis miring"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "Saran perintah garis miring"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "Perintah garis miring"
@@ -12304,6 +12317,18 @@ msgstr "{targetNoun} ini dibagikan dari cabang <0>{shareBranch}</0>. Ia tidak ad
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "{targetNoun} ini dibagikan dari cabang <0>{shareBranch}</0>. Anda sekarang berada di <1>{currentLabel}</1>."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "Agen ini tidak menawarkan perintah garis miring"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "Agen ini tidak menawarkan perintah garis miring — pesan Anda akan dikirim sebagai teks biasa"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "Agen ini belum mengumumkan perintahnya"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "Agen ini memerlukan Anda masuk dulu — lihat pemberitahuan di bawah."
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index 27a52d191..9a4838278 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -434,6 +434,7 @@
"62bOuM": ["Ĺàţēśţ ēďĩţ"],
"636K3K": ["Ďēĺēţē àďĴàćēńţ ćĥĩƥ"],
"64sesb": ["Ćàĺĺōũţś ďŕàŵ àţţēńţĩōń ţō ķēŷ ĩńƒōŕḿàţĩōń."],
+ "67Dpmh": ["Śĺàśĥ ćōḿḿàńď śũĝĝēśţĩōńś"],
"67TEhP": [
"Ŷōũŕ ũśēŕ-ĺēvēĺ śķĩĺĺ ƒōĺďēŕś — àvàĩĺàƀĺē ĩń ēvēŕŷ ƥŕōĴēćţ ōń ţĥĩś ḿàćĥĩńē. Ēàćĥ śķĩĺĺ'ś ĩńśţàĺĺ ḿēńũ ćōńţŕōĺś ŵĥēŕē ĩţ ĺĩvēś."
],
@@ -650,6 +651,7 @@
"9KooKn": ["Ŕũń à ƥŕōĴēćţ àũďĩţ ƒŕōḿ ţĥē Ƥŕōƀĺēḿś ƥàńēĺ."],
"9NJWgv": ["ßàćķĺĩńķś"],
"9OIqw4": ["Ŷōũ ďōń'ţ ĥàvē ŵŕĩţē àććēśś ţō ţĥĩś ŕēƥō."],
+ "9OPs7U": ["Ţĥĩś àĝēńţ ĥàśń'ţ àńńōũńćēď ĩţś ćōḿḿàńďś ŷēţ"],
"9PQysm": ["Ĥĩďē àďvàńćēď"],
"9R7pRC": ["Ńō ţàĝś ḿàţćĥ \"", ["trimmed"], "\". Ćōńţĩńũē ţŷƥĩńĝ ţō ćŕēàţē ōńē."],
"9UQ730": ["Ćĺōńē"],
@@ -1788,6 +1790,7 @@
"Q7cNKe": ["Śķĩĺĺś àŕē ńōŵ śĥàŕēď. Ćōḿḿĩţ .ōķ/śķĩĺĺś ţō śĥàŕē ţĥēḿ ŵĩţĥ ŷōũŕ ţēàḿ."],
"Q7xfEj": ["ďōńē"],
"Q8A-U_": ["Ćōńńēćţēď ţō"],
+ "Q9AxTM": ["Ţĥĩś àĝēńţ ďōēśń'ţ ōƒƒēŕ śĺàśĥ ćōḿḿàńďś — ŷōũŕ ḿēśśàĝē ŵĩĺĺ ƀē śēńţ àś ƥĺàĩń ţēxţ"],
"QASTNu": [
"Ţĥē ",
["editor"],
@@ -1828,6 +1831,7 @@
"QlAG4m": ["Ţēĺĺ ũś ḿōŕē (ōƥţĩōńàĺ)"],
"QlkiD5": ["Ŕē-ƥĺàćē ōń śēĺēćţēď ţēxţ"],
"QlxHAH": ["Śĥōŵĩńĝ ŕēśũĺţś ƒōŕ \"", ["semanticResultsLabel"], "\""],
+ "QohqVL": ["Ţĥĩś àĝēńţ ďōēśń'ţ ōƒƒēŕ śĺàśĥ ćōḿḿàńďś"],
"QpSqAP": [
"À ŕēàĺ śĥēĺĺ ĩś ōƒƒ ƒōŕ ţĥĩś ƥŕōĴēćţ. Ţũŕńĩńĝ ĩţ ōń ŕũńś ćōḿḿàńďś ŵĩţĥ ţĥē ƒũĺĺ àććēśś ōƒ ŷōũŕ ũśēŕ àććōũńţ."
],
@@ -3402,6 +3406,7 @@
"m2T1Xj": ["Ţàĝ #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["Àćţĩvē ƥàńēĺ ćōńţēńţ ƒōŕ ţĥē śēĺēćţēď ţàƀ śĥōŵś ĥēŕē."],
"mAzs2H": ["Ďĩśàƀĺē ", ["file"]],
+ "mBK8zm": ["/", ["0"], " ĩśń'ţ à ćōḿḿàńď ţĥĩś àĝēńţ ōƒƒēŕś — ĩţ ŵĩĺĺ ƀē śēńţ àś ƥĺàĩń ţēxţ"],
"mBltnd": ["Ƥàţĥ śũĝĝēśţĩōńś"],
"mCB6Je": ["Śēĺēćţ Àĺĺ"],
"mGaZwZ": ["Śēē ţĥē ƒũĺĺ ĩńśţàĺĺ ĝũĩďē"],
@@ -3589,6 +3594,7 @@
"Ţĥē ţēŕḿĩńàĺ ĩś ţũŕńēď ōƒƒ ƒōŕ ţĥĩś ƥŕōĴēćţ. Ţũŕń ĩţ ƀàćķ ōń ţō ŕũń ćōḿḿàńďś ĥēŕē."
],
"oZUYMv": ["Ćōũĺďń’ţ ŕēśţōŕē ", ["0"], ". Ţĥàţ ńàḿē ĩś àĺŕēàďŷ ĩń ũśē."],
+ "odYWGJ": ["Ńō ḿàţćĥĩńĝ ćōḿḿàńďś"],
"of3tF-": [
"Ŷōũ ƥĩćķēď ~/Ďōćũḿēńţś. ŌƥēńĶńōŵĺēďĝē ŵĩĺĺ ĩńďēx ēvēŕŷ ḿàŕķďōŵń ƒĩĺē ũńďēŕ ĩţ. Ĩƒ ŷōũ ōńĺŷ ŵàńţ ţō ḿàńàĝē à śũƀ-ƒōĺďēŕ, ćĥōōśē à śḿàĺĺēŕ śćōƥē."
],
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 28b6306b8..7f3997452 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -886,6 +886,11 @@ msgstr ""
msgid "{words, plural, one {word} other {words}}"
msgstr ""
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr ""
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr ""
@@ -7872,6 +7877,10 @@ msgstr ""
msgid "No matching branches."
msgstr ""
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr ""
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr ""
@@ -11226,6 +11235,10 @@ msgstr ""
msgid "Slash command menu"
msgstr ""
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr ""
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr ""
@@ -12304,6 +12317,18 @@ msgstr ""
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr ""
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr ""
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr ""
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr ""
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr ""
diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.json
index 4fcc93e5f..aa1cf2d76 100644
--- a/packages/app/src/locales/pt-BR/messages.json
+++ b/packages/app/src/locales/pt-BR/messages.json
@@ -499,6 +499,7 @@
"62bOuM": ["Última edição"],
"636K3K": ["Excluir o chip ao lado"],
"64sesb": ["Os destaques chamam atenção para as informações principais."],
+ "67Dpmh": ["Sugestões de comandos de barra"],
"67TEhP": [
"Suas pastas de habilidades de nível de usuário — disponíveis em todos os projetos deste computador. O menu de instalação de cada habilidade controla onde ela fica."
],
@@ -741,6 +742,7 @@
"9KooKn": ["Rode uma auditoria do projeto pelo painel Problemas."],
"9NJWgv": ["Retrolinks"],
"9OIqw4": ["Você não tem acesso de escrita a este repositório."],
+ "9OPs7U": ["Este agente ainda não anunciou seus comandos"],
"9PQysm": ["Ocultar as opções avançadas"],
"9R7pRC": [
"Nenhuma tag corresponde a \"",
@@ -2023,6 +2025,9 @@
],
"Q7xfEj": ["pronto"],
"Q8A-U_": ["Conectado a"],
+ "Q9AxTM": [
+ "Este agente não oferece comandos de barra — sua mensagem será enviada como texto simples"
+ ],
"QASTNu": [
"A pasta do ",
["editor"],
@@ -2069,6 +2074,7 @@
"QlAG4m": ["Conte mais (opcional)"],
"QlkiD5": ["Reposicionar no texto selecionado"],
"QlxHAH": ["Mostrando resultados de \"", ["semanticResultsLabel"], "\""],
+ "QohqVL": ["Este agente não oferece comandos de barra"],
"QpSqAP": [
"O shell real está desativado para este projeto. Ativá-lo faz os comandos rodarem com todo o acesso da sua conta de usuário."
],
@@ -3847,6 +3853,11 @@
"m2T1Xj": ["Tag #", ["tagValue"], ", ", ["uses"]],
"m6YGpY": ["O conteúdo do painel ativo da aba selecionada aparece aqui."],
"mAzs2H": ["Desativar ", ["file"]],
+ "mBK8zm": [
+ "/",
+ ["0"],
+ " não é um comando oferecido por este agente — será enviado como texto simples"
+ ],
"mBltnd": ["Sugestões de caminho"],
"mCB6Je": ["Selecionar tudo"],
"mGaZwZ": ["Ver o guia de instalação completo"],
@@ -4052,6 +4063,7 @@
],
"oYepHb": ["O terminal está desligado neste projeto. Ligue de novo para rodar comandos aqui."],
"oZUYMv": ["Não foi possível restaurar ", ["0"], ". Esse nome já está em uso."],
+ "odYWGJ": ["Nenhum comando correspondente"],
"of3tF-": [
"Você escolheu ~/Documents. O OpenKnowledge vai indexar todos os arquivos markdown que estiverem lá dentro. Se quiser cuidar só de uma subpasta, escolha um escopo menor."
],
diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.po
index 78f8d01e4..102cc5303 100644
--- a/packages/app/src/locales/pt-BR/messages.po
+++ b/packages/app/src/locales/pt-BR/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}, {tabCount, plural, one {# aba simultânea} many {# abas simu
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, one {palavra} many {palavras} other {palavras}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} não é um comando oferecido por este agente — será enviado como texto simples"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// nota"
@@ -7872,6 +7877,10 @@ msgstr "Sem correspondências. Alguns arquivos ficam fora da busca (arquivos ocu
msgid "No matching branches."
msgstr "Nenhum ramo corresponde."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "Nenhum comando correspondente"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "Nenhum comando corresponde."
@@ -11226,6 +11235,10 @@ msgstr "O download de {0} foi pulado."
msgid "Slash command menu"
msgstr "Menu de comandos de barra"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "Sugestões de comandos de barra"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "Comandos de barra"
@@ -12304,6 +12317,18 @@ msgstr "Este {targetNoun} foi compartilhado a partir do ramo <0>{shareBranch}</0
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "Este {targetNoun} foi compartilhado a partir do ramo <0>{shareBranch}</0>. Você está agora em <1>{currentLabel}</1>."
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "Este agente não oferece comandos de barra"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "Este agente não oferece comandos de barra — sua mensagem será enviada como texto simples"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "Este agente ainda não anunciou seus comandos"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "Este agente precisa que você entre primeiro — veja o aviso abaixo."
diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.json
index 332f888e2..545a822ac 100644
--- a/packages/app/src/locales/ur/messages.json
+++ b/packages/app/src/locales/ur/messages.json
@@ -441,6 +441,7 @@
"62bOuM": ["تازہ ترین ترمیم"],
"636K3K": ["ملحقہ چِپ حذف کریں"],
"64sesb": ["کال آؤٹ اہم معلومات کی طرف توجہ دلاتے ہیں۔"],
+ "67Dpmh": ["سلیش کمانڈ کی تجاویز"],
"67TEhP": [
"آپ کے صارف سطح کے مہارت فولڈرز — اس مشین کے ہر پروجیکٹ میں دستیاب۔ ہر مہارت کا تنصیبی مینو طے کرتا ہے کہ وہ کہاں رہے۔"
],
@@ -657,6 +658,7 @@
"9KooKn": ["مسائل کے پینل سے پروجیکٹ کا آڈٹ چلائیں۔"],
"9NJWgv": ["بیک لنکس"],
"9OIqw4": ["آپ کو اس ریپو میں لکھنے کی رسائی نہیں۔"],
+ "9OPs7U": ["اس ایجنٹ نے ابھی تک اپنی کمانڈز کا اعلان نہیں کیا"],
"9PQysm": ["اعلیٰ آپشنز چھپائیں"],
"9R7pRC": ["«", ["trimmed"], "» سے کوئی ٹیگ مماثل نہیں۔ ایک بنانے کے لیے لکھتے رہیں۔"],
"9UQ730": ["کلون"],
@@ -1827,6 +1829,7 @@
],
"Q7xfEj": ["مکمل"],
"Q8A-U_": ["منسلک ہے"],
+ "Q9AxTM": ["یہ ایجنٹ سلیش کمانڈ پیش نہیں کرتا — آپ کا پیغام سادہ متن کے طور پر بھیجا جائے گا"],
"QASTNu": [
["editor"],
" فولڈر میں اس مہارت کا ایک مختلف ورژن ہے۔ منتخب کریں کہ کون سا غالب رہے، یا دونوں کو مختلف ناموں سے رکھیں۔ آپ جو بھی بدلیں گے اس کا پہلے بیک اپ لے لیا جاتا ہے۔"
@@ -1867,6 +1870,7 @@
"QlAG4m": ["ہمیں مزید بتائیں (اختیاری)"],
"QlkiD5": ["منتخب متن پر دوبارہ رکھیں"],
"QlxHAH": ["«", ["semanticResultsLabel"], "» کے نتائج دکھائے جا رہے ہیں"],
+ "QohqVL": ["یہ ایجنٹ سلیش کمانڈ پیش نہیں کرتا"],
"QpSqAP": [
"اس پروجیکٹ کے لیے اصل شیل بند ہے۔ اسے آن کرنے پر کمانڈز آپ کے صارف اکاؤنٹ کی مکمل رسائی کے ساتھ چلتی ہیں۔"
],
@@ -3483,6 +3487,11 @@
"m2T1Xj": ["ٹیگ #", ["tagValue"], "، ", ["uses"]],
"m6YGpY": ["منتخب ٹیب کے فعال پینل کا مواد یہاں دکھایا جاتا ہے۔"],
"mAzs2H": [["file"], " بند کریں"],
+ "mBK8zm": [
+ "/",
+ ["0"],
+ " اس ایجنٹ کی پیش کردہ کمانڈ نہیں ہے — اسے سادہ متن کے طور پر بھیجا جائے گا"
+ ],
"mBltnd": ["راستے کی تجاویز"],
"mCB6Je": ["سب منتخب کریں"],
"mGaZwZ": ["مکمل تنصیبی رہنما دیکھیں"],
@@ -3669,6 +3678,7 @@
],
"oYepHb": ["اس پروجیکٹ کے لیے ٹرمینل بند ہے۔ یہاں کمانڈز چلانے کے لیے اسے دوبارہ فعال کریں۔"],
"oZUYMv": [["0"], " بحال نہیں کیا جا سکا۔ یہ نام پہلے سے استعمال ہو رہا ہے۔"],
+ "odYWGJ": ["کوئی مماثل کمانڈ نہیں"],
"of3tF-": [
"آپ نے ~/Documents منتخب کیا۔ OpenKnowledge اس کے تحت ہر Markdown فائل اشاریہ بند کرے گا۔ اگر آپ صرف کوئی ذیلی فولڈر سنبھالنا چاہتے ہیں تو چھوٹا دائرہ کار منتخب کریں۔"
],
diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.po
index 16c9c021f..c718a3e61 100644
--- a/packages/app/src/locales/ur/messages.po
+++ b/packages/app/src/locales/ur/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName}، {tabCount, plural, one {# بیک وقت ٹیب} other {# ب
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, one {لفظ} other {الفاظ}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} اس ایجنٹ کی پیش کردہ کمانڈ نہیں ہے — اسے سادہ متن کے طور پر بھیجا جائے گا"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// نوٹ"
@@ -7876,6 +7881,10 @@ msgstr "کوئی مماثلت نہیں۔ کچھ فائلیں تلاش سے خا
msgid "No matching branches."
msgstr "کوئی مماثل برانچ نہیں۔"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "کوئی مماثل کمانڈ نہیں"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "کوئی مماثل کمانڈ نہیں۔"
@@ -11230,6 +11239,10 @@ msgstr "{0} کا ڈاؤن لوڈ چھوڑ دیا گیا۔"
msgid "Slash command menu"
msgstr "سلیش کمانڈ کا مینو"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "سلیش کمانڈ کی تجاویز"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "سلیش کمانڈز"
@@ -12308,6 +12321,18 @@ msgstr "یہ {targetNoun} برانچ <0>{shareBranch}</0> سے شیئر ہوا
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "یہ {targetNoun} برانچ <0>{shareBranch}</0> سے شیئر ہوا تھا۔ آپ اس وقت <1>{currentLabel}</1> پر ہیں۔"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "یہ ایجنٹ سلیش کمانڈ پیش نہیں کرتا"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "یہ ایجنٹ سلیش کمانڈ پیش نہیں کرتا — آپ کا پیغام سادہ متن کے طور پر بھیجا جائے گا"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "اس ایجنٹ نے ابھی تک اپنی کمانڈز کا اعلان نہیں کیا"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "اس ایجنٹ کے لیے آپ کا پہلے سائن اِن کرنا ضروری ہے — نیچے دی گئی اطلاع دیکھیں۔"
diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.json
index 18a670cbe..0b201e819 100644
--- a/packages/app/src/locales/zh-Hans/messages.json
+++ b/packages/app/src/locales/zh-Hans/messages.json
@@ -400,6 +400,7 @@
"62bOuM": ["最近一次编辑"],
"636K3K": ["删除相邻的标记块"],
"64sesb": ["标注框用于突出关键信息。"],
+ "67Dpmh": ["斜杠命令建议"],
"67TEhP": [
"你的用户级技能文件夹——在这台电脑的每个项目中都可用。每个技能的安装菜单决定它保存在哪里。"
],
@@ -591,6 +592,7 @@
"9KooKn": ["在「问题」面板中运行一次项目审查。"],
"9NJWgv": ["反向链接"],
"9OIqw4": ["你没有这个仓库的写入权限。"],
+ "9OPs7U": ["此智能体尚未公布其命令"],
"9PQysm": ["隐藏高级选项"],
"9R7pRC": ["没有标签匹配 \"", ["trimmed"], "\"。继续输入即可新建一个。"],
"9UQ730": ["克隆"],
@@ -1589,6 +1591,7 @@
"Q7cNKe": ["技能现在已共享。提交 .ok/skills 即可分享给你的团队。"],
"Q7xfEj": ["完成"],
"Q8A-U_": ["已连接到"],
+ "Q9AxTM": ["此智能体不提供斜杠命令 — 你的消息将作为纯文本发送"],
"QASTNu": [
["editor"],
" 文件夹中有这个技能的另一个版本。请选择保留哪一个,或者用不同的名字都保留。被替换的内容会先备份。"
@@ -1624,6 +1627,7 @@
"QlAG4m": ["再多说一些(可选)"],
"QlkiD5": ["重新定位到选中的文本上"],
"QlxHAH": ["正在显示 \"", ["semanticResultsLabel"], "\" 的结果"],
+ "QohqVL": ["此智能体不提供斜杠命令"],
"QpSqAP": ["本项目未启用真实 shell。启用后,命令将以你的用户账户的完整权限运行。"],
"Qpfxa1": [["secs"], "秒"],
"QqBQu1": ["标签 <0>(可见的链接文本)</0>"],
@@ -3035,6 +3039,7 @@
"m2T1Xj": ["标签 #", ["tagValue"], ",", ["uses"]],
"m6YGpY": ["所选标签页的活动面板内容显示在这里。"],
"mAzs2H": ["禁用 ", ["file"]],
+ "mBK8zm": ["/", ["0"], " 不是此智能体提供的命令 — 将作为纯文本发送"],
"mBltnd": ["路径建议"],
"mCB6Je": ["全选"],
"mGaZwZ": ["查看完整的安装指南"],
@@ -3181,6 +3186,7 @@
],
"oYepHb": ["这个项目关闭了终端。重新开启后才能在这里运行命令。"],
"oZUYMv": ["无法恢复 ", ["0"], "。该名称已被使用。"],
+ "odYWGJ": ["没有匹配的命令"],
"of3tF-": [
"你选择了 ~/Documents。OpenKnowledge 会索引它下面的每个 markdown 文件。如果你只想管理某个子文件夹,请选择更小的范围。"
],
diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.po
index 8967c3440..bae9d871a 100644
--- a/packages/app/src/locales/zh-Hans/messages.po
+++ b/packages/app/src/locales/zh-Hans/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName},{tabCount, plural, other {# 个并发标签页}}"
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, other {词}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} 不是此智能体提供的命令 — 将作为纯文本发送"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// 注释"
@@ -7876,6 +7881,10 @@ msgstr "没有匹配项。部分文件不参与搜索(隐藏或被忽略的文
msgid "No matching branches."
msgstr "没有匹配的分支。"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "没有匹配的命令"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "没有匹配的命令。"
@@ -11230,6 +11239,10 @@ msgstr "已跳过下载 {0}。"
msgid "Slash command menu"
msgstr "斜杠命令菜单"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "斜杠命令建议"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "斜杠命令"
@@ -12308,6 +12321,18 @@ msgstr "这个{targetNoun}是从 <0>{shareBranch}</0> 分支共享的。它在
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "这个{targetNoun}是从 <0>{shareBranch}</0> 分支共享的。你当前在 <1>{currentLabel}</1> 上。"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "此智能体不提供斜杠命令"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "此智能体不提供斜杠命令 — 你的消息将作为纯文本发送"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "此智能体尚未公布其命令"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "这个智能体需要你先登录——请看下方的提示。"
diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.json
index ff8400f48..dabb6a725 100644
--- a/packages/app/src/locales/zh-Hant/messages.json
+++ b/packages/app/src/locales/zh-Hant/messages.json
@@ -402,6 +402,7 @@
"62bOuM": ["最近一次編輯"],
"636K3K": ["刪除相鄰的標記塊"],
"64sesb": ["標註框用於突顯關鍵資訊。"],
+ "67Dpmh": ["斜線指令建議"],
"67TEhP": [
"你的使用者層級技能資料夾——在這台電腦的每個專案中都能用。每個技能的安裝選單決定它放在哪裡。"
],
@@ -593,6 +594,7 @@
"9KooKn": ["在「問題」面板中執行一次專案稽核。"],
"9NJWgv": ["反向連結"],
"9OIqw4": ["你沒有這個儲存庫的寫入權限。"],
+ "9OPs7U": ["此智慧代理尚未公布其指令"],
"9PQysm": ["隱藏進階選項"],
"9R7pRC": ["沒有標籤符合「", ["trimmed"], "」。繼續輸入就能建立一個。"],
"9UQ730": ["複製"],
@@ -1609,6 +1611,7 @@
"Q7cNKe": ["技能現在已分享。提交 .ok/skills 就能分享給你的團隊。"],
"Q7xfEj": ["完成"],
"Q8A-U_": ["已連接到"],
+ "Q9AxTM": ["此智慧代理不提供斜線指令 — 你的訊息將以純文字傳送"],
"QASTNu": [
["editor"],
" 資料夾裡有這個技能的另一個版本。請選要以哪一個為準,或者用不同名稱兩個都保留。被取代的內容會先備份。"
@@ -1644,6 +1647,7 @@
"QlAG4m": ["再多說一些(選填)"],
"QlkiD5": ["重新定位到選取的文字上"],
"QlxHAH": ["正在顯示「", ["semanticResultsLabel"], "」的結果"],
+ "QohqVL": ["此智慧代理不提供斜線指令"],
"QpSqAP": ["本專案未啟用真實 shell。啟用後,命令會以你的使用者帳戶的完整權限執行。"],
"Qpfxa1": [["secs"], "秒"],
"QqBQu1": ["標籤 <0>(可見的連結文字)</0>"],
@@ -3059,6 +3063,7 @@
"m2T1Xj": ["標籤 #", ["tagValue"], ",", ["uses"]],
"m6YGpY": ["所選分頁的作用中面板內容會顯示在這裡。"],
"mAzs2H": ["停用 ", ["file"]],
+ "mBK8zm": ["/", ["0"], " 不是此智慧代理提供的指令 — 將以純文字傳送"],
"mBltnd": ["路徑建議"],
"mCB6Je": ["全選"],
"mGaZwZ": ["查看完整的安裝指南"],
@@ -3207,6 +3212,7 @@
],
"oYepHb": ["這個專案關閉了終端機。重新開啟後才能在這裡執行指令。"],
"oZUYMv": ["無法還原 ", ["0"], "。這個名稱已在使用中。"],
+ "odYWGJ": ["沒有相符的指令"],
"of3tF-": [
"你選了 ~/Documents。OpenKnowledge 會把它底下的每個 markdown 檔案都建立索引。如果你只想管理某個子資料夾,請選一個更小的範圍。"
],
diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.po
index da2994ba3..57a10d391 100644
--- a/packages/app/src/locales/zh-Hant/messages.po
+++ b/packages/app/src/locales/zh-Hant/messages.po
@@ -886,6 +886,11 @@ msgstr "{userName},{tabCount, plural, other {# 個同時開啟的分頁}}"
msgid "{words, plural, one {word} other {words}}"
msgstr "{words, plural, other {字詞}}"
+#. placeholder {0}: slashHint.name
+#: src/editor/ComposerMentionInput.tsx
+msgid "/{0} isn't a command this agent offers — it will be sent as plain text"
+msgstr "/{0} 不是此智慧代理提供的指令 — 將以純文字傳送"
+
#: src/components/settings/ThemePreviewCanvas.tsx
msgid "// note"
msgstr "// 註解"
@@ -7876,6 +7881,10 @@ msgstr "沒有相符項。有些檔案不會納入搜尋(隱藏或被忽略的
msgid "No matching branches."
msgstr "沒有相符的分支。"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "No matching commands"
+msgstr "沒有相符的指令"
+
#: src/components/CommandPalette.tsx
msgid "No matching commands."
msgstr "沒有相符的指令。"
@@ -11230,6 +11239,10 @@ msgstr "已略過下載 {0}。"
msgid "Slash command menu"
msgstr "斜線指令選單"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "Slash command suggestions"
+msgstr "斜線指令建議"
+
#: src/editor/slash-command/SlashCommandMenu.tsx
msgid "Slash commands"
msgstr "斜線指令"
@@ -12308,6 +12321,18 @@ msgstr "這個{targetNoun}是從 <0>{shareBranch}</0> 分支分享的。它在
msgid "This {targetNoun} was shared from branch <0>{shareBranch}</0>. You're currently on <1>{currentLabel}</1>."
msgstr "這個{targetNoun}是從 <0>{shareBranch}</0> 分支分享的。你目前在 <1>{currentLabel}</1> 上。"
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent doesn't offer slash commands"
+msgstr "此智慧代理不提供斜線指令"
+
+#: src/editor/ComposerMentionInput.tsx
+msgid "This agent doesn't offer slash commands — your message will be sent as plain text"
+msgstr "此智慧代理不提供斜線指令 — 你的訊息將以純文字傳送"
+
+#: src/editor/composer-mention/ComposerSlashMenu.tsx
+msgid "This agent hasn't announced its commands yet"
+msgstr "此智慧代理尚未公布其指令"
+
#: src/components/acp/ThreadView.tsx
msgid "This agent needs you to sign in first — see the notice below."
msgstr "這個代理需要你先登入——請看下面的提示。"
diff --git a/packages/core/src/acp/thread-protocol.ts b/packages/core/src/acp/thread-protocol.ts
index 2593409ca..91ed66620 100644
--- a/packages/core/src/acp/thread-protocol.ts
+++ b/packages/core/src/acp/thread-protocol.ts
@@ -17,6 +17,7 @@
*/
import type {
+ AvailableCommand,
ContentBlock,
PermissionOption,
PromptCapabilities,
@@ -161,6 +162,15 @@ export interface ThreadInfo {
* `config_option_update` / set response replaces it wholesale.
*/
configOptions?: SessionConfigOption[] | null;
+ /**
+ * Slash commands the agent advertised over `available_commands_update`
+ * (the composer's `/` autocomplete corpus). Each update replaces the list
+ * wholesale — it is the agent's authoritative current set. `[]` means the
+ * agent said it has zero commands; null or absent means no update has
+ * arrived yet — "not yet known" is a different answer than "none", and the
+ * composer renders the two differently.
+ */
+ availableCommands?: AvailableCommand[] | null;
/** Last event seq in the server's retained log (replay upper bound). */
lastSeq: number;
/**
@@ -658,6 +668,7 @@ export function parseThreadClientFrame(raw: string): ThreadClientFrame | null {
/** Type-only re-exports the app's renderer needs alongside the frames. */
export type {
+ AvailableCommand,
ContentBlock,
PermissionOption,
PromptCapabilities,
diff --git a/packages/core/src/acp/thread-protocol.typelock.ts b/packages/core/src/acp/thread-protocol.typelock.ts
index 84e146935..ba0d6185f 100644
--- a/packages/core/src/acp/thread-protocol.typelock.ts
+++ b/packages/core/src/acp/thread-protocol.typelock.ts
@@ -10,6 +10,7 @@
import type {
AuthMethod,
+ AvailableCommand,
ClientCapabilities,
CreateTerminalRequest,
EnvVariable,
@@ -51,6 +52,25 @@ export type PinSessionUpdateKinds = Expect<
>
>;
+// Dependents: the thread manager forwards `availableCommands` verbatim onto
+// `ThreadInfo.availableCommands`, and the composer's `/` autocomplete filters
+// on `name` and renders `description` per row. `name` going optional would
+// break token recognition; a reshaped update would silently stop the capture.
+type AvailableCommandsUpdate = Extract<
+ SessionUpdate,
+ { sessionUpdate: 'available_commands_update' }
+>;
+export type PinAvailableCommandsList = Expect<
+ Equal<AvailableCommandsUpdate['availableCommands'], AvailableCommand[]>
+>;
+export type PinAvailableCommandName = Expect<Equal<AvailableCommand['name'], string>>;
+export type PinAvailableCommandDescription = Expect<Equal<AvailableCommand['description'], string>>;
+// The composer's in-field ghost text prefers `input.hint` (ACP's "hint to
+// display when the input hasn't been provided yet") over the description.
+export type PinAvailableCommandInputHint = Expect<
+ Equal<Extract<NonNullable<AvailableCommand['input']>, { hint: string }>['hint'], string>
+>;
+
// Dependents: `resolvePermissionOutcome` classifies by kind PREFIX
// (`startsWith('allow')` → approved, `startsWith('reject')` → denied,
// anything else → dismissed), and the permission card renders its own Deny
diff --git a/packages/server/src/acp/thread-manager.integration.test.ts b/packages/server/src/acp/thread-manager.integration.test.ts
index ebf0532e9..ac70bdbed 100644
--- a/packages/server/src/acp/thread-manager.integration.test.ts
+++ b/packages/server/src/acp/thread-manager.integration.test.ts
@@ -26,7 +26,7 @@ import type { AgentSessionManager } from '../agent-sessions.ts';
import { getLogger } from '../logger.ts';
import { AcpPermissionStore } from './permissions.ts';
import { AcpRegistry } from './registry.ts';
-import { AcpThreadManager, MAX_QUEUED_PROMPTS } from './thread-manager.ts';
+import { ACP_ENVIRONMENT_NOTE, AcpThreadManager, MAX_QUEUED_PROMPTS } from './thread-manager.ts';
const log = getLogger('acp-thread-test');
@@ -537,6 +537,155 @@ process.stdin.on('data', (chunk) => {
await manager.closeThread(info.threadId);
}, 30_000);
+
+ test('available commands: captured from available_commands_update; env note rides only the first wire prompt', async () => {
+ const contentDir = tmp();
+ const localDir = tmp();
+ // Minimal stdio ACP agent that advertises slash commands right after
+ // session/new, echoes each prompt's WIRE text back as a message chunk (so
+ // the test can see exactly what the agent received), and re-advertises a
+ // grown command list after the first turn (the wholesale-replace contract).
+ const agentPath = join(localDir, 'commands-agent.mjs');
+ writeFileSync(
+ agentPath,
+ `
+const write = (msg) => process.stdout.write(JSON.stringify(msg) + '\\n');
+const notify = (update) =>
+ write({ jsonrpc: '2.0', method: 'session/update', params: { sessionId: 's1', update } });
+let prompts = 0;
+let buffer = '';
+process.stdin.setEncoding('utf8');
+process.stdin.on('data', (chunk) => {
+ buffer += chunk;
+ let idx = buffer.indexOf('\\n');
+ while (idx !== -1) {
+ const line = buffer.slice(0, idx);
+ buffer = buffer.slice(idx + 1);
+ idx = buffer.indexOf('\\n');
+ if (line.trim() === '') continue;
+ const msg = JSON.parse(line);
+ const reply = (result) =>
+ process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id: msg.id, result }) + '\\n');
+ if (msg.method === 'initialize') {
+ reply({ protocolVersion: 1, agentCapabilities: {} });
+ } else if (msg.method === 'session/new') {
+ reply({ sessionId: 's1' });
+ notify({
+ sessionUpdate: 'available_commands_update',
+ availableCommands: [
+ { name: 'review', description: 'Review the current diff' },
+ ],
+ });
+ } else if (msg.method === 'session/prompt') {
+ prompts += 1;
+ notify({
+ sessionUpdate: 'agent_message_chunk',
+ content: { type: 'text', text: 'received:' + msg.params.prompt[0].text },
+ });
+ if (prompts === 1) {
+ notify({
+ sessionUpdate: 'available_commands_update',
+ availableCommands: [
+ { name: 'review', description: 'Review the current diff' },
+ { name: 'plan', description: 'Draft a plan' },
+ ],
+ });
+ }
+ reply({ stopReason: 'end_turn' });
+ } else if (msg.id !== undefined) {
+ reply({});
+ }
+ }
+});
+`,
+ );
+ writeFileSync(
+ join(localDir, 'acp-agents.json'),
+ JSON.stringify([
+ { id: 'commands-agent', name: 'Commands Agent', command: 'node', args: [agentPath] },
+ ]),
+ );
+ const manager = makeManager(contentDir, localDir);
+
+ const info = await manager.createThread({ agent: { source: 'custom', id: 'commands-agent' } });
+ // Not yet advertised is null — a different answer than "advertised none".
+ expect(info.availableCommands).toBeNull();
+
+ const events: Array<{ seq: number; event: ThreadEvent }> = [];
+ await manager.subscribe(info.threadId, 0, (frame: ThreadServerFrame) => {
+ if (frame.op === 'event') events.push({ seq: frame.seq, event: frame.event });
+ if (frame.op === 'events') {
+ for (const [i, event] of frame.events.entries()) {
+ events.push({ seq: frame.fromSeq + i, event });
+ }
+ }
+ });
+ const waitFor = async (pred: () => boolean, ms: number): Promise<void> => {
+ const deadline = Date.now() + ms;
+ while (!pred()) {
+ if (Date.now() > deadline) {
+ throw new Error(`timed out; info: ${JSON.stringify(manager.getInfo(info.threadId))}`);
+ }
+ await new Promise((r) => setTimeout(r, 50));
+ }
+ };
+
+ await waitFor(() => manager.getInfo(info.threadId)?.status === 'ready', 15_000);
+ await waitFor(
+ () => (manager.getInfo(info.threadId)?.availableCommands ?? []).length > 0,
+ 10_000,
+ );
+ expect(manager.getInfo(info.threadId)?.availableCommands).toEqual([
+ { name: 'review', description: 'Review the current diff' },
+ ]);
+
+ const receivedTexts = () =>
+ events
+ .map((e) => e.event)
+ .filter((e) => e.kind === 'session_update')
+ .map((e) => (e.update as { content?: { text?: string } }).content?.text ?? '')
+ .filter((text) => text.startsWith('received:'));
+
+ // A first message that IS a command invocation must reach the agent with
+ // `/` as its first byte — ACP command dispatch is prefix-based, so the
+ // environment note defers rather than break the command.
+ manager.sendPrompt(info.threadId, '/review the diff');
+ await waitFor(() => receivedTexts().length === 1, 15_000);
+ expect(receivedTexts()[0]).toBe('received:/review the diff');
+
+ // The mid-turn re-advertisement replaced the list wholesale.
+ await waitFor(
+ () => (manager.getInfo(info.threadId)?.availableCommands ?? []).length === 2,
+ 10_000,
+ );
+
+ await waitFor(() => manager.getInfo(info.threadId)?.status === 'ready', 15_000);
+ // The note survives ANY number of consecutive command-first prompts —
+ // deferral is per-prompt, not one-shot.
+ manager.sendPrompt(info.threadId, '/plan the rollout');
+ await waitFor(() => receivedTexts().length === 2, 15_000);
+ expect(receivedTexts()[1]).toBe('received:/plan the rollout');
+
+ await waitFor(() => manager.getInfo(info.threadId)?.status === 'ready', 15_000);
+ // The deferred note rides the first NON-command prompt: wire text = note +
+ // user text; the transcript echo stays the user's.
+ manager.sendPrompt(info.threadId, 'first hello');
+ await waitFor(() => receivedTexts().length === 3, 15_000);
+ expect(receivedTexts()[2]).toBe(`received:${ACP_ENVIRONMENT_NOTE}\n\nfirst hello`);
+ const userMessages = events
+ .map((e) => e.event)
+ .filter((e) => e.kind === 'user_message')
+ .map((e) => e.content);
+ expect(userMessages).toEqual(['/review the diff', '/plan the rollout', 'first hello']);
+
+ await waitFor(() => manager.getInfo(info.threadId)?.status === 'ready', 15_000);
+ manager.sendPrompt(info.threadId, 'second hello');
+ await waitFor(() => receivedTexts().length === 4, 15_000);
+ // Consumed: the note never rides a later prompt of the same session.
+ expect(receivedTexts()[3]).toBe('received:second hello');
+
+ await manager.closeThread(info.threadId);
+ }, 30_000);
});
/**
@@ -575,6 +724,10 @@ process.stdin.on('data', (chunk) => {
reply({ protocolVersion: 1, agentCapabilities });
} else if (msg.method === 'session/new') {
reply({ sessionId: 'sess-fixed' });
+ notify({
+ sessionUpdate: 'available_commands_update',
+ availableCommands: [{ name: 'fresh_only', description: 'advertised on session/new only' }],
+ });
} else if (msg.method === 'session/prompt') {
notify({
sessionUpdate: 'agent_message_chunk',
@@ -665,14 +818,20 @@ describe('AcpThreadManager persistence + resume', () => {
}
};
const kinds = (events: Collected): string[] => events.map((e) => e.event.kind);
+ /** The wire echo of the FIRST prompt of a new session: dispatch prepends the
+ * environment note (wire-only; the `user_message` event keeps the user's
+ * text). Later prompts — including everything sent over a resumed session —
+ * echo bare. */
+ const notedEcho = (text: string): string => `echo:${ACP_ENVIRONMENT_NOTE}\n\n${text}`;
const agentChunks = (events: Collected): string[] =>
events
.map((e) => e.event)
.filter((e) => e.kind === 'session_update')
- .map((e) => {
- const update = (e as { update?: { content?: { text?: string } } }).update;
- return update?.content?.text ?? '';
- });
+ .map(
+ (e) => (e as { update?: { sessionUpdate?: string; content?: { text?: string } } }).update,
+ )
+ .filter((update) => update?.sessionUpdate === 'agent_message_chunk')
+ .map((update) => update?.content?.text ?? '');
async function runOneTurn(
manager: AcpThreadManager,
@@ -771,7 +930,7 @@ describe('AcpThreadManager persistence + resume', () => {
expect(replayed.length).toBeGreaterThanOrEqual(liveEvents.length);
expect(replayed.map((e) => e.seq)).toEqual(replayed.map((_, i) => i));
expect(kinds(replayed)).toContain('user_message');
- expect(agentChunks(replayed)).toContain('echo:hello there');
+ expect(agentChunks(replayed)).toContain(notedEcho('hello there'));
}, 45_000);
test('closing a never-prompted thread discards it instead of archiving', async () => {
@@ -869,6 +1028,10 @@ describe('AcpThreadManager persistence + resume', () => {
const manager = makeManager(contentDir, localDir);
await manager.init();
const threadId = await runOneTurn(manager, 'fake-resume', 'first message');
+ // The fixture advertises commands after session/new — captured pre-close.
+ expect(manager.getInfo(threadId)?.availableCommands).toEqual([
+ { name: 'fresh_only', description: 'advertised on session/new only' },
+ ]);
await manager.closeThread(threadId);
expect(manager.getInfo(threadId)?.archived).toBe(true);
@@ -893,7 +1056,11 @@ describe('AcpThreadManager persistence + resume', () => {
.filter((e): e is Extract<ThreadEvent, { kind: 'user_message' }> => e.kind === 'user_message')
.map((e) => e.content);
expect(userMessages).toEqual(['first message', 'second message']);
- expect(agentChunks(replayed)).toEqual(['echo:first message', 'echo:second message']);
+ expect(agentChunks(replayed)).toEqual([notedEcho('first message'), 'echo:second message']);
+ // session/resume never re-runs session/new, and the fixture advertises
+ // only there — so the pre-archive list must have been RESET to "not yet
+ // known", not carried over as if this session had advertised it.
+ expect(manager.getInfo(threadId)?.availableCommands).toBeNull();
await manager.closeThread(threadId);
}, 45_000);
@@ -923,7 +1090,7 @@ describe('AcpThreadManager persistence + resume', () => {
await manager.subscribe(threadId, 0, collector(replayed));
// The fixture replayed 'old-user'/'old-agent' chunks during session/load —
// they duplicate the retained log and must NOT appear as new events.
- expect(agentChunks(replayed)).toEqual(['echo:first message', 'echo:second message']);
+ expect(agentChunks(replayed)).toEqual([notedEcho('first message'), 'echo:second message']);
expect(agentChunks(replayed)).not.toContain('old-user');
expect(agentChunks(replayed)).not.toContain('old-agent');
@@ -954,7 +1121,7 @@ describe('AcpThreadManager persistence + resume', () => {
// The transcript survived both failed attempts.
const replayed: Collected = [];
await manager.subscribe(threadId, 0, collector(replayed));
- expect(agentChunks(replayed)).toContain('echo:first message');
+ expect(agentChunks(replayed)).toContain(notedEcho('first message'));
}, 45_000);
test('delete refuses live threads, removes archived ones and their files', async () => {
@@ -1001,7 +1168,7 @@ describe('AcpThreadManager persistence + resume', () => {
);
const replayed: Collected = [];
await manager2.subscribe(threadId, 0, collector(replayed));
- expect(agentChunks(replayed)).toContain('echo:survives shutdown');
+ expect(agentChunks(replayed)).toContain(notedEcho('survives shutdown'));
await manager2.closeThread(threadId);
}, 45_000);
});
diff --git a/packages/server/src/acp/thread-manager.ts b/packages/server/src/acp/thread-manager.ts
index 06f111a92..d2bb50696 100644
--- a/packages/server/src/acp/thread-manager.ts
+++ b/packages/server/src/acp/thread-manager.ts
@@ -180,6 +180,25 @@ const RESUME_REPLAY_MAX_WAIT_MS = 3_000;
*/
const AUTH_REQUIRED_CODE = -32000;
+/**
+ * Environment note prepended (on the wire only — the transcript echoes the
+ * user's text) to the first NON-COMMAND prompt of every NEW agent session.
+ * Agents assume they run inside their own terminal app and confidently
+ * recommend host features that don't exist here (Claude suggesting `/tasks`,
+ * `Ctrl+O`). Telling the agent where it actually runs reduces those bad
+ * recommendations — it cannot eliminate them (steering a model, not
+ * sandboxing it). A prompt opening with `/` defers the note (ACP command
+ * dispatch is prefix-based; prepending would break the invocation), and
+ * resumed sessions are skipped: their first turn already carried it.
+ */
+export const ACP_ENVIRONMENT_NOTE =
+ 'Note on your environment: you are running inside the OpenKnowledge app, ' +
+ 'connected over ACP (Agent Client Protocol) — not inside your own terminal app. ' +
+ "Your host CLI's terminal UI is not present, so its built-in slash commands " +
+ '(such as /tasks or /bashes) and keyboard shortcuts (such as Ctrl+O) do not ' +
+ 'exist here; never recommend them. The only slash commands available to the ' +
+ 'user are the ones you advertise over ACP.';
+
export class ThreadOpError extends Error {
readonly code:
| 'unknown-thread'
@@ -307,6 +326,13 @@ interface ThreadRecord {
* falls back to the prompt content.
*/
titleHint?: string;
+ /**
+ * The next dispatched prompt is the first of a NEW agent session and must
+ * carry {@link ACP_ENVIRONMENT_NOTE} on the wire. Set when `session/new`
+ * succeeds, consumed by the first dispatch, never set on resume/load — a
+ * resumed session's first turn already carried the note.
+ */
+ envNotePending: boolean;
}
/** A `probeHarnessManagedMcpEntry` hit — where OK's own managed entry was found. */
@@ -623,6 +649,7 @@ export class AcpThreadManager {
promptCapabilities: null,
modes: null,
configOptions: null,
+ availableCommands: null,
lastSeq: -1,
archived: false,
},
@@ -661,6 +688,7 @@ export class AcpThreadManager {
closed: false,
hadUserMessage: false,
titleHint: params.titleHint,
+ envNotePending: false,
};
this.threads.set(threadId, record);
this.emitStatus(record, 'installing');
@@ -1286,6 +1314,10 @@ export class AcpThreadManager {
init: InitializeResponse,
settings?: { config?: Record<string, string | boolean>; modeId?: string },
): Promise<boolean> {
+ // A fresh session invalidates whatever a previous one advertised (retry
+ // and post-authenticate reopen reach here with a dead session's list) —
+ // back to "not yet known" until this session's update arrives.
+ record.info.availableCommands = null;
const mcpServers = await this.buildMcpServers(record, init);
try {
const session = await conn.agent.request(acpMethods.agent.session.new, {
@@ -1293,6 +1325,8 @@ export class AcpThreadManager {
mcpServers,
});
record.sessionId = session.sessionId;
+ // A brand-new session: its first prompt carries the environment note.
+ record.envNotePending = true;
this.persistence.queueMetaWrite(record.info.threadId, this.buildMeta(record));
if (session.modes !== undefined && session.modes !== null) {
record.info.modes = session.modes;
@@ -1383,6 +1417,10 @@ export class AcpThreadManager {
}
t.info.agent = agentInfo;
t.info.archived = false;
+ // The pre-archive command list described a session that no longer
+ // exists — back to "not yet known" until the respawned agent advertises
+ // (there is no resume-response field for commands, unlike modes).
+ t.info.availableCommands = null;
t.stderrTail = [];
if (t.midTurnOnDisk) {
// The persisted log ended inside a turn (crash mid-stream) — close
@@ -1946,6 +1984,19 @@ export class AcpThreadManager {
if (opts.echo) {
this.echoUserMessage(t, content);
}
+ // Wire-only injection: the transcript (echo above) keeps the user's text;
+ // the agent additionally receives the environment note ahead of the first
+ // prompt of a new session. After the echo, so title derivation and the
+ // `user_message` event never see the note. A prompt that OPENS with `/`
+ // is skipped — ACP command dispatch is prefix-based (adapters gate on the
+ // first text block starting with `/`), so prepending anything would turn
+ // a command invocation into prose; the note stays pending and rides the
+ // next non-command prompt instead.
+ let wireText = content;
+ if (t.envNotePending && !content.startsWith('/')) {
+ t.envNotePending = false;
+ wireText = `${ACP_ENVIRONMENT_NOTE}\n\n${content}`;
+ }
t.turnActive = true;
t.cancelRequested = false;
this.appendEvent(t, { kind: 'turn_started', ts: Date.now() });
@@ -1955,7 +2006,7 @@ export class AcpThreadManager {
t.conn.agent
.request(acpMethods.agent.session.prompt, {
sessionId,
- prompt: [{ type: 'text', text: content }],
+ prompt: [{ type: 'text', text: wireText }],
})
.then((response) => {
t.turnActive = false;
@@ -2456,6 +2507,10 @@ export class AcpThreadManager {
record.info.configOptions = update.configOptions;
this.emitInfo(record);
}
+ if (update.sessionUpdate === 'available_commands_update') {
+ record.info.availableCommands = update.availableCommands;
+ this.emitInfo(record);
+ }
if (record.suppressUpdates) {
// A session/load replay — every update duplicates the retained log
// (which is richer: permission events, statuses). Live state above
@@ -2924,6 +2979,7 @@ function rehydratedRecord(meta: PersistedThreadMeta): ThreadRecord {
// without a fresh prompt must archive again, never discard. Treat every
// rehydrated record as having received a message.
hadUserMessage: true,
+ envNotePending: false,
};
}