@pellux/goodvibes-agent 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/README.md CHANGED
@@ -22,7 +22,7 @@ Important baseline constraints:
22
22
  - Agent depends on `@pellux/goodvibes-sdk@0.33.35`.
23
23
  - Agent connects to a GoodVibes host owned outside this product.
24
24
  - Agent does not start, stop, restart, install, uninstall, or own the connected GoodVibes host.
25
- - User-facing Agent workspace actions, built-in panels, modal/overlay/picker UI surfaces, named operator surfaces, top-level CLI mirrors, fixed shortcuts, configurable keybindings, slash commands, command policy metadata, model tools and individual model tool schemas, settings, local registries, connected-host capability boundaries, single connected-host capability inspection, and live connected-host readiness are model-visible through Agent-owned tools. Visible UI routing includes the command browser, reasoning-effort picker, live process output, runtime activity, settings, workspaces, and pickers the user can open. Local memory, note, persona, skill, and routine create editors can also run through confirmed workspace actions. Mutations and visible UI routing remain explicit and confirmation-gated.
25
+ - User-facing Agent workspace actions, single workspace-action lookup, built-in panels, modal/overlay/picker UI surfaces, named operator surfaces, top-level CLI mirrors, fixed shortcuts, configurable keybindings, slash commands, single-command lookup with policy metadata, model tools and individual model tool schemas, settings, local registries, connected-host capability boundaries, single connected-host capability inspection, and live connected-host readiness are model-visible through Agent-owned tools. Visible UI routing includes the command browser, reasoning-effort picker, live process output, runtime activity, settings, workspaces, and pickers the user can open. Local memory, note, persona, skill, and routine create editors can also run through confirmed workspace actions. Mutations and visible UI routing remain explicit and confirmation-gated.
26
26
  - Agent Knowledge uses only `/api/goodvibes-agent/knowledge/*`; there is no default knowledge or non-Agent product fallback.
27
27
  - Agent supports isolated Agent homes with `GOODVIBES_AGENT_HOME=<path>` and named profile homes with `goodvibes-agent profiles create <name> --template <starter> --yes` plus `--agent-profile <name>`.
28
28
  - Agent supports connected-host URL overrides with `--runtime-url http://host:port` or `GOODVIBES_AGENT_RUNTIME_URL=http://host:port`; these only change the Agent connection target.
@@ -44,7 +44,7 @@ After setup has been applied once, the TUI opens directly into the Agent operato
44
44
 
45
45
  Press `/` inside the Agent workspace to search every workspace action by name, category, command, or detail. Use that finder before reaching for shell commands; CLI subcommands are scriptable mirrors of these TUI workflows.
46
46
 
47
- The model can inspect and use the same harness surface through Agent-owned tools. `agent_harness` exposes workspace action discovery, built-in panel discovery/routing, modal/overlay/picker UI surface discovery/routing, top-level CLI mirror discovery, fixed shortcut and configurable keybinding discovery, keybinding mutation with confirmation, slash-command discovery, command policy metadata, command execution with confirmation, model tool discovery and single-tool schema inspection, settings inspection/mutation, connected-host capability inventory, single connected-host capability inspection, and live connected-host readiness posture. CLI mirror modes are read-only catalog/parser inspection and point the model to the matching in-process tool, workspace action, setting mode, or slash-command mirror. Panel modes expose catalog/open state and route visible panel/workspace changes through the current Agent shell bridge with confirmation. UI surface modes expose help, shortcuts, command browser, conversation search, prompt-history search, slash-command mode, file picker, block actions, context, runtime activity, live process output, bookmarks, model/provider/reasoning-effort pickers, TTS provider/voice pickers, session/profile pickers, the panel-picker compatibility route, security/knowledge/subscription operator surfaces, settings, MCP workspace, onboarding, and Agent workspace entrypoints; `open_ui_surface` is confirmation-gated and only performs visible shell navigation. Shortcut modes expose the fixed runtime/editor shortcuts and the live keybindings table; confirmed keybinding edits write the same `keybindings.json` file the user edits and reload the runtime manager. Workspace action discovery can include editor field schemas with `includeParameters:true`, including starter-template defaults for profile creation and selected-routine defaults for routine schedule promotion when `recordId` is supplied. Selection-based local workspace actions accept a local `recordId`, so the model can use the same note promotion and local registry flows as the TUI. Direct local create editors for memory, notes, personas, skills, and routines can execute from submitted fields through `run_workspace_action` and `agent_local_registry` with confirmation. First-class model tools cover the main product workflows directly: Agent Knowledge, Agent Knowledge ingest, Agent-local memory/notes/personas/skills/routines, operator actions, notifications, channel sends, reminders, generated media, and work plans.
47
+ The model can inspect and use the same harness surface through Agent-owned tools. `agent_harness` exposes workspace action discovery, single workspace-action inspection by action id, command, or lookup text, built-in panel discovery/routing, modal/overlay/picker UI surface discovery/routing, top-level CLI mirror discovery, fixed shortcut and configurable keybinding discovery, keybinding mutation with confirmation, slash-command discovery, single slash-command inspection by typed command or lookup text, command policy metadata, command execution with confirmation, model tool discovery and single-tool schema inspection, settings inspection/mutation, connected-host capability inventory, single connected-host capability inspection, and live connected-host readiness posture. CLI mirror modes are read-only catalog/parser inspection and point the model to the matching in-process tool, workspace action, setting mode, or slash-command mirror. Panel modes expose catalog/open state and route visible panel/workspace changes through the current Agent shell bridge with confirmation. UI surface modes expose help, shortcuts, command browser, conversation search, prompt-history search, slash-command mode, file picker, block actions, context, runtime activity, live process output, bookmarks, model/provider/reasoning-effort pickers, TTS provider/voice pickers, session/profile pickers, the panel-picker compatibility route, security/knowledge/subscription operator surfaces, settings, MCP workspace, onboarding, and Agent workspace entrypoints; `open_ui_surface` is confirmation-gated and only performs visible shell navigation. Shortcut modes expose the fixed runtime/editor shortcuts and the live keybindings table; confirmed keybinding edits write the same `keybindings.json` file the user edits and reload the runtime manager. Workspace action discovery can include editor field schemas with `includeParameters:true`, including starter-template defaults for profile creation and selected-routine defaults for routine schedule promotion when `recordId` is supplied; single-action lookup uses the same user-facing search fields and returns lookup metadata plus the editor schema. Selection-based local workspace actions accept a local `recordId`, so the model can use the same note promotion and local registry flows as the TUI. Direct local create editors for memory, notes, personas, skills, and routines can execute from submitted fields through `run_workspace_action` and `agent_local_registry` with confirmation. First-class model tools cover the main product workflows directly: Agent Knowledge, Agent Knowledge ingest, Agent-local memory/notes/personas/skills/routines, operator actions, notifications, channel sends, reminders, generated media, and work plans.
48
48
 
49
49
  Use the Artifacts area for concrete files and generated output: attach images to prompts, export conversations or saved sessions, ingest local source files and URL lists into Agent Knowledge, import bookmarks or browser history, inspect source records, and generate media artifacts from confirmed prompts.
50
50
 
@@ -43,14 +43,14 @@ Host-management and coding-first commands that would imply connected-host lifecy
43
43
 
44
44
  The main Agent model has an Agent-owned harness bridge rather than generic SDK settings/context control. Use these model tools as the supported parity layer:
45
45
 
46
- - `agent_harness`: inspect workspace categories/actions, inspect built-in panels, inspect modal/overlay/picker UI surfaces and named operator surfaces, inspect top-level CLI mirrors, inspect fixed shortcuts and configurable keybindings, inspect slash commands and command policy metadata, run concrete workspace or slash-command mirrors with confirmation, inspect model tools or one model tool schema, inspect or change Agent settings/keybindings, inspect connected-host capability boundaries or one connected-host capability, and inspect live connected-host readiness.
46
+ - `agent_harness`: inspect workspace categories/actions and one workspace action by action id, command, or lookup text, inspect built-in panels, inspect modal/overlay/picker UI surfaces and named operator surfaces, inspect top-level CLI mirrors, inspect fixed shortcuts and configurable keybindings, inspect slash commands and one slash command by typed command or lookup text with policy metadata, run concrete workspace or slash-command mirrors with confirmation, inspect model tools or one model tool schema, inspect or change Agent settings/keybindings, inspect connected-host capability boundaries or one connected-host capability, and inspect live connected-host readiness.
47
47
  - `agent_local_registry`: inspect and maintain Agent-local memory, notes, personas, skills, skill bundles, and routines. Deleting local records requires `confirm:true` and `explicitUserRequest`.
48
48
  - `agent_knowledge` and `agent_knowledge_ingest`: ask/search and ingest into the isolated Agent Knowledge segment.
49
49
  - `agent_operator_briefing` and `agent_operator_action`: inspect connected work/approval/automation posture, or run exact confirmed approval/automation actions.
50
50
  - `agent_work_plan`: keep the visible Agent-local work plan current from the conversation.
51
51
  - `agent_channel_send`, `agent_notify`, `agent_reminder_schedule`, and `agent_media_generate`: perform confirmed external delivery, notification, reminder, or media actions when the user explicitly asks.
52
52
 
53
- `agent_harness` discovery modes are read-only. `summary` reports the model access map; `panels` and `panel` return the built-in panel catalog, current open/focused state, and each panel's matching Agent workspace route; `ui_surfaces` and `ui_surface` return modal, overlay, picker, and workspace entrypoints with shell-opener availability and preferred model routes; `cli_commands` and `cli_command` return top-level package CLI mirror metadata, parser output, blocked command tokens, and preferred in-process model routes; `shortcuts` returns fixed runtime/editor shortcuts plus configurable keybindings; `keybindings` and `keybinding` return the live resolved keybinding table, default bindings, custom state, and config path; `commands` and `command` return slash-command descriptions plus effect/confirmation/preferred-tool/boundary policy metadata; `workspace_actions` lists Agent workspace actions and can inline editor field schemas with `includeParameters:true`; `workspace_action` returns one action with its editor schema; `tools` lists model tool definitions and can inline JSON schemas with `includeParameters:true`; `tool` returns one model tool schema by `toolName`, `target`, or `query`; `settings` returns setting descriptors plus setting policy; `connected_host` returns the connected-host route families, allowed capabilities, blocked capabilities, and first-class tool availability; `connected_host_capability` returns one allowed or blocked connected-host capability by `capabilityId`, `target`, or `query` with related route families and boundary text; and `connected_host_status` performs a live read-only check of the connected-host status and Agent Knowledge status routes and reports endpoint bindings, token posture, SDK compatibility, route readiness, and findings without printing token values.
53
+ `agent_harness` discovery modes are read-only. `summary` reports the model access map; `panels` and `panel` return the built-in panel catalog, current open/focused state, and each panel's matching Agent workspace route; `ui_surfaces` and `ui_surface` return modal, overlay, picker, and workspace entrypoints with shell-opener availability and preferred model routes; `cli_commands` and `cli_command` return top-level package CLI mirror metadata, parser output, blocked command tokens, and preferred in-process model routes; `shortcuts` returns fixed runtime/editor shortcuts plus configurable keybindings; `keybindings` and `keybinding` return the live resolved keybinding table, default bindings, custom state, and config path; `commands` lists slash-command descriptions; `command` returns one slash-command detail by `command`, `commandName`, `target`, or `query`, including parsed arguments plus effect/confirmation/preferred-tool/boundary policy metadata; `workspace_actions` lists Agent workspace actions and can inline editor field schemas with `includeParameters:true`; `workspace_action` returns one action by `actionId`, `command`, `target`, or `query`, using the same user-facing action-search fields and returning lookup metadata plus its editor schema; `tools` lists model tool definitions and can inline JSON schemas with `includeParameters:true`; `tool` returns one model tool schema by `toolName`, `target`, or `query`; `settings` returns setting descriptors plus setting policy; `connected_host` returns the connected-host route families, allowed capabilities, blocked capabilities, and first-class tool availability; `connected_host_capability` returns one allowed or blocked connected-host capability by `capabilityId`, `target`, or `query` with related route families and boundary text; and `connected_host_status` performs a live read-only check of the connected-host status and Agent Knowledge status routes and reports endpoint bindings, token posture, SDK compatibility, route readiness, and findings without printing token values.
54
54
 
55
55
  `open_ui_surface` is a confirmation-gated visible navigation mode for the same shell surfaces the user can open: Agent workspace, settings, MCP workspace, model/provider/reasoning-effort pickers, TTS provider/voice pickers, session/profile pickers, the panel-picker compatibility route, security/knowledge/subscription operator surfaces, conversation search, prompt-history search, slash-command mode, command browser, file picker, block actions, bookmarks, context inspector, runtime activity monitor, live process output, help, shortcuts, and onboarding. It does not perform hidden operations; use first-class model tools, settings modes, workspace actions, or confirmed slash-command mirrors for actual state changes.
56
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-agent",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "private": false,
5
5
  "description": "GoodVibes personal operator assistant TUI with a proactive Agent product brain, isolated Agent Knowledge, local profiles, routines, skills, personas, and explicit build delegation.",
6
6
  "type": "module",
@@ -0,0 +1,149 @@
1
+ import type { CommandRegistry, SlashCommand } from '../input/command-registry.ts';
2
+ import { parseSlashCommand } from '../input/slash-command-parser.ts';
3
+ import { describeCommandPolicy } from './agent-harness-metadata.ts';
4
+
5
+ export interface AgentHarnessCommandCatalogArgs {
6
+ readonly query?: unknown;
7
+ readonly command?: unknown;
8
+ readonly commandName?: unknown;
9
+ readonly args?: unknown;
10
+ readonly target?: unknown;
11
+ readonly limit?: unknown;
12
+ }
13
+
14
+ interface CommandDetailLookup {
15
+ readonly source: 'command' | 'commandName' | 'target' | 'query';
16
+ readonly input: string;
17
+ readonly parsedName: string;
18
+ readonly parsedArgs: readonly string[];
19
+ readonly resolvedBy: 'name' | 'alias' | 'case-insensitive-name' | 'case-insensitive-alias' | 'description' | 'prefix';
20
+ }
21
+
22
+ function readString(value: unknown): string {
23
+ return typeof value === 'string' ? value.trim() : '';
24
+ }
25
+
26
+ function readLimit(value: unknown, fallback: number): number {
27
+ const parsed = typeof value === 'string' && value.trim() ? Number(value) : value;
28
+ if (typeof parsed !== 'number' || !Number.isFinite(parsed)) return fallback;
29
+ return Math.max(1, Math.min(500, Math.trunc(parsed)));
30
+ }
31
+
32
+ function readStringArray(value: unknown): readonly string[] {
33
+ if (!Array.isArray(value)) return [];
34
+ return value.map((entry) => typeof entry === 'string' ? entry : String(entry));
35
+ }
36
+
37
+ function commandMatches(command: SlashCommand, query: string): boolean {
38
+ if (!query) return true;
39
+ const haystack = [
40
+ command.name,
41
+ ...(command.aliases ?? []),
42
+ command.description,
43
+ command.usage ?? '',
44
+ command.argsHint ?? '',
45
+ ].join('\n').toLowerCase();
46
+ return haystack.includes(query.toLowerCase());
47
+ }
48
+
49
+ function describeCommand(command: SlashCommand, lookup?: CommandDetailLookup): Record<string, unknown> {
50
+ return {
51
+ name: command.name,
52
+ slash: `/${command.name}`,
53
+ aliases: command.aliases ?? [],
54
+ description: command.description,
55
+ usage: command.usage ?? '',
56
+ argsHint: command.argsHint ?? command.usage ?? '',
57
+ ...(lookup ? {
58
+ lookup: {
59
+ source: lookup.source,
60
+ input: lookup.input,
61
+ parsedName: lookup.parsedName,
62
+ parsedArgs: lookup.parsedArgs,
63
+ resolvedBy: lookup.resolvedBy,
64
+ },
65
+ } : {}),
66
+ policy: describeCommandPolicy(command.name),
67
+ };
68
+ }
69
+
70
+ function commandDetailLookupFromArgs(args: AgentHarnessCommandCatalogArgs): Omit<CommandDetailLookup, 'resolvedBy'> | null {
71
+ const rawCommand = readString(args.command);
72
+ if (rawCommand) {
73
+ const parsed = parseSlashCommand(rawCommand);
74
+ return { source: 'command', input: rawCommand, parsedName: parsed.name, parsedArgs: parsed.args };
75
+ }
76
+ const rawCommandName = readString(args.commandName);
77
+ if (rawCommandName) {
78
+ const parsed = parseSlashCommand(rawCommandName);
79
+ const explicitArgs = readStringArray(args.args);
80
+ return {
81
+ source: 'commandName',
82
+ input: rawCommandName,
83
+ parsedName: parsed.name,
84
+ parsedArgs: explicitArgs.length > 0 ? explicitArgs : parsed.args,
85
+ };
86
+ }
87
+ const rawTarget = readString(args.target);
88
+ if (rawTarget) {
89
+ const parsed = parseSlashCommand(rawTarget);
90
+ return { source: 'target', input: rawTarget, parsedName: parsed.name, parsedArgs: parsed.args };
91
+ }
92
+ const rawQuery = readString(args.query);
93
+ if (rawQuery) {
94
+ const parsed = parseSlashCommand(rawQuery);
95
+ return { source: 'query', input: rawQuery, parsedName: parsed.name, parsedArgs: parsed.args };
96
+ }
97
+ return null;
98
+ }
99
+
100
+ function resolveCommandDetail(commandRegistry: CommandRegistry, args: AgentHarnessCommandCatalogArgs): { readonly command: SlashCommand; readonly lookup: CommandDetailLookup } | null {
101
+ const lookup = commandDetailLookupFromArgs(args);
102
+ if (!lookup?.parsedName) return null;
103
+ const direct = commandRegistry.get(lookup.parsedName);
104
+ if (direct) {
105
+ return {
106
+ command: direct,
107
+ lookup: {
108
+ ...lookup,
109
+ resolvedBy: direct.name === lookup.parsedName ? 'name' : 'alias',
110
+ },
111
+ };
112
+ }
113
+
114
+ const normalized = lookup.parsedName.toLowerCase();
115
+ for (const command of commandRegistry.list()) {
116
+ if (command.name.toLowerCase() === normalized) {
117
+ return { command, lookup: { ...lookup, resolvedBy: 'case-insensitive-name' } };
118
+ }
119
+ if ((command.aliases ?? []).some((alias) => alias.toLowerCase() === normalized)) {
120
+ return { command, lookup: { ...lookup, resolvedBy: 'case-insensitive-alias' } };
121
+ }
122
+ }
123
+
124
+ const descriptionMatches = commandRegistry.list().filter((command) => commandMatches(command, lookup.input));
125
+ if (descriptionMatches.length === 1) {
126
+ return { command: descriptionMatches[0]!, lookup: { ...lookup, resolvedBy: 'description' } };
127
+ }
128
+
129
+ const prefixMatches = commandRegistry.fuzzyMatch(lookup.parsedName).filter((entry) => entry.score >= 80);
130
+ if (prefixMatches.length === 1) {
131
+ return { command: prefixMatches[0]!.command, lookup: { ...lookup, resolvedBy: 'prefix' } };
132
+ }
133
+ return null;
134
+ }
135
+
136
+ export function listHarnessCommands(commandRegistry: CommandRegistry, args: AgentHarnessCommandCatalogArgs): readonly Record<string, unknown>[] {
137
+ const query = readString(args.query);
138
+ const limit = readLimit(args.limit, 200);
139
+ return commandRegistry.list()
140
+ .filter((command) => commandMatches(command, query))
141
+ .sort((a, b) => a.name.localeCompare(b.name))
142
+ .slice(0, limit)
143
+ .map((command) => describeCommand(command));
144
+ }
145
+
146
+ export function describeHarnessCommand(commandRegistry: CommandRegistry, args: AgentHarnessCommandCatalogArgs): Record<string, unknown> | null {
147
+ const detail = resolveCommandDetail(commandRegistry, args);
148
+ return detail ? describeCommand(detail.command, detail.lookup) : null;
149
+ }
@@ -23,11 +23,11 @@ export const AGENT_HARNESS_PARAMETER_PROPERTIES = {
23
23
  },
24
24
  query: {
25
25
  type: 'string',
26
- description: 'Search text for command, setting, tool, or UI surface catalogs.',
26
+ description: 'Search text for command, workspace action, setting, tool, or UI surface catalogs; also a slash-command lookup for mode command.',
27
27
  },
28
28
  command: {
29
29
  type: 'string',
30
- description: 'Full slash command string for mode run_command, for example "/settings get provider.model". In cli_command mode this may also hold a top-level CLI string such as "goodvibes-agent status --json".',
30
+ description: 'Full slash command string for mode command, workspace_action lookup, or run_command, for example "/settings get provider.model". In cli_command mode this may also hold a top-level CLI string such as "goodvibes-agent status --json".',
31
31
  },
32
32
  cliCommand: {
33
33
  type: 'string',
@@ -90,7 +90,7 @@ export const AGENT_HARNESS_PARAMETER_PROPERTIES = {
90
90
  },
91
91
  target: {
92
92
  type: 'string',
93
- description: 'Optional lookup target, such as a model-picker target, settings key, model tool name, or connected-host capability id.',
93
+ description: 'Optional lookup target, such as a model-picker target, workspace action id/search text, slash command root or invocation, settings key, model tool name, or connected-host capability id.',
94
94
  },
95
95
  capabilityId: {
96
96
  type: 'string',
@@ -1,6 +1,6 @@
1
1
  import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
2
2
  import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
3
- import type { CommandContext, CommandRegistry, SlashCommand } from '../input/command-registry.ts';
3
+ import type { CommandContext, CommandRegistry } from '../input/command-registry.ts';
4
4
  import { buildAgentWorkspaceCommandEditorSubmission, isAgentWorkspaceCommandEditorKind } from '../input/agent-workspace-command-editor.ts';
5
5
  import { createAgentWorkspaceEditor } from '../input/agent-workspace-activation.ts';
6
6
  import { AGENT_WORKSPACE_CATEGORIES } from '../input/agent-workspace-categories.ts';
@@ -18,6 +18,7 @@ import type {
18
18
  } from '../input/agent-workspace-types.ts';
19
19
  import { parseSlashCommand } from '../input/slash-command-parser.ts';
20
20
  import { blockedHarnessCliCommandTokens, describeHarnessCliCommand, listHarnessCliCommands, totalHarnessCliCommands } from './agent-harness-cli-metadata.ts';
21
+ import { describeHarnessCommand, listHarnessCommands } from './agent-harness-command-catalog.ts';
21
22
  import { describeHarnessKeybinding, listHarnessKeybindings, listHarnessShortcuts, resetHarnessKeybinding, setHarnessKeybinding, totalHarnessKeybindings, totalHarnessShortcuts } from './agent-harness-keybinding-metadata.ts';
22
23
  import { describeHarnessPanel, listHarnessPanels, openHarnessPanel, totalHarnessPanels } from './agent-harness-panel-metadata.ts';
23
24
  import { connectedHostStatusSummary } from './agent-harness-connected-host-status.ts';
@@ -28,7 +29,6 @@ import { describeHarnessUiSurface, listHarnessUiSurfaces, openHarnessUiSurface,
28
29
  import {
29
30
  connectedHostSummary,
30
31
  describeConnectedHostCapability,
31
- describeCommandPolicy,
32
32
  settingsPolicySummary,
33
33
  } from './agent-harness-metadata.ts';
34
34
  import {
@@ -82,6 +82,25 @@ interface WorkspaceEditorContext {
82
82
  readonly selectedRoutine: AgentWorkspaceLocalLibraryItem | null;
83
83
  }
84
84
 
85
+ interface WorkspaceActionLookup {
86
+ readonly source: 'actionId' | 'command' | 'target' | 'query';
87
+ readonly input: string;
88
+ readonly resolvedBy: 'id' | 'case-insensitive-id' | 'label' | 'case-insensitive-label' | 'command' | 'search';
89
+ }
90
+
91
+ type WorkspaceActionResolution =
92
+ | {
93
+ readonly status: 'found';
94
+ readonly category: AgentWorkspaceCategory;
95
+ readonly action: AgentWorkspaceAction;
96
+ readonly lookup: WorkspaceActionLookup;
97
+ }
98
+ | {
99
+ readonly status: 'ambiguous';
100
+ readonly input: string;
101
+ readonly candidates: readonly { readonly actionId: string; readonly categoryId: string; readonly label: string; readonly command?: string }[];
102
+ };
103
+
85
104
  function isMode(value: unknown): value is AgentHarnessMode {
86
105
  return typeof value === 'string' && AGENT_HARNESS_MODES.includes(value as AgentHarnessMode);
87
106
  }
@@ -115,30 +134,6 @@ function output(value: unknown): { readonly success: true; readonly output: stri
115
134
 
116
135
  function error(message: string): { readonly success: false; readonly error: string } { return { success: false, error: message }; }
117
136
 
118
- function commandMatches(command: SlashCommand, query: string): boolean {
119
- if (!query) return true;
120
- const haystack = [
121
- command.name,
122
- ...(command.aliases ?? []),
123
- command.description,
124
- command.usage ?? '',
125
- command.argsHint ?? '',
126
- ].join('\n').toLowerCase();
127
- return haystack.includes(query.toLowerCase());
128
- }
129
-
130
- function describeCommand(command: SlashCommand): Record<string, unknown> {
131
- return {
132
- name: command.name,
133
- slash: `/${command.name}`,
134
- aliases: command.aliases ?? [],
135
- description: command.description,
136
- usage: command.usage ?? '',
137
- argsHint: command.argsHint ?? command.usage ?? '',
138
- policy: describeCommandPolicy(command.name),
139
- };
140
- }
141
-
142
137
  function allWorkspaceActions(): ReadonlyArray<{
143
138
  readonly category: AgentWorkspaceCategory;
144
139
  readonly action: AgentWorkspaceAction;
@@ -213,7 +208,7 @@ function createWorkspaceEditor(
213
208
  function describeWorkspaceAction(
214
209
  category: AgentWorkspaceCategory,
215
210
  action: AgentWorkspaceAction,
216
- options: { readonly includeEditor?: boolean; readonly editorContext?: WorkspaceEditorContext | null } = {},
211
+ options: { readonly includeEditor?: boolean; readonly editorContext?: WorkspaceEditorContext | null; readonly lookup?: WorkspaceActionLookup } = {},
217
212
  ): Record<string, unknown> {
218
213
  const editor = options.includeEditor && action.editorKind ? createWorkspaceEditor(action.editorKind, options.editorContext ?? null) : null;
219
214
  return {
@@ -230,6 +225,7 @@ function describeWorkspaceAction(
230
225
  ...(action.editorKind ? { editorKind: action.editorKind } : {}),
231
226
  ...(action.localKind ? { localKind: action.localKind } : {}),
232
227
  ...(action.localOperation ? { localOperation: action.localOperation } : {}),
228
+ ...(options.lookup ? { lookup: options.lookup } : {}),
233
229
  ...(editor ? { editor: describeWorkspaceEditor(editor) } : {}),
234
230
  ...(action.kind === 'local-selection' || action.kind === 'local-operation' ? {
235
231
  modelExecution: describeLocalWorkspaceModelExecution(action),
@@ -276,14 +272,54 @@ function findWorkspaceAction(args: AgentHarnessToolArgs): { readonly category: A
276
272
  }) ?? null;
277
273
  }
278
274
 
279
- function listCommands(commandRegistry: CommandRegistry, args: AgentHarnessToolArgs): readonly Record<string, unknown>[] {
275
+ function workspaceActionLookupFromArgs(args: AgentHarnessToolArgs): { readonly source: WorkspaceActionLookup['source']; readonly input: string } | null {
276
+ const actionId = readString(args.actionId);
277
+ if (actionId) return { source: 'actionId', input: actionId };
278
+ const command = readString(args.command);
279
+ if (command) return { source: 'command', input: command };
280
+ const target = readString(args.target);
281
+ if (target) return { source: 'target', input: target };
280
282
  const query = readString(args.query);
281
- const limit = readLimit(args.limit, 200);
282
- return commandRegistry.list()
283
- .filter((command) => commandMatches(command, query))
284
- .sort((a, b) => a.name.localeCompare(b.name))
285
- .slice(0, limit)
286
- .map(describeCommand);
283
+ return query ? { source: 'query', input: query } : null;
284
+ }
285
+
286
+ function describeWorkspaceActionCandidates(
287
+ entries: readonly { readonly category: AgentWorkspaceCategory; readonly action: AgentWorkspaceAction }[],
288
+ ): readonly { readonly actionId: string; readonly categoryId: string; readonly label: string; readonly command?: string }[] {
289
+ return entries.slice(0, 8).map((entry) => ({
290
+ actionId: entry.action.id,
291
+ categoryId: entry.category.id,
292
+ label: entry.action.label,
293
+ ...(entry.action.command ? { command: entry.action.command } : {}),
294
+ }));
295
+ }
296
+
297
+ function resolveWorkspaceActionDetail(args: AgentHarnessToolArgs): WorkspaceActionResolution | null {
298
+ const lookup = workspaceActionLookupFromArgs(args);
299
+ const categoryId = readString(args.categoryId || args.category);
300
+ if (!lookup) return null;
301
+ const entries = allWorkspaceActions().filter((entry) => !categoryId || entry.category.id === categoryId);
302
+ const normalized = lookup.input.toLowerCase();
303
+ const commandInput = lookup.source === 'command' ? lookup.input.trim() : '';
304
+
305
+ const exactId = entries.find((entry) => entry.action.id === lookup.input);
306
+ if (exactId) return { status: 'found', ...exactId, lookup: { ...lookup, resolvedBy: 'id' } };
307
+ const exactLabel = entries.find((entry) => entry.action.label === lookup.input);
308
+ if (exactLabel) return { status: 'found', ...exactLabel, lookup: { ...lookup, resolvedBy: 'label' } };
309
+ const exactCommand = commandInput ? entries.find((entry) => entry.action.command === commandInput) : null;
310
+ if (exactCommand) return { status: 'found', ...exactCommand, lookup: { ...lookup, resolvedBy: 'command' } };
311
+
312
+ const insensitiveId = entries.find((entry) => entry.action.id.toLowerCase() === normalized);
313
+ if (insensitiveId) return { status: 'found', ...insensitiveId, lookup: { ...lookup, resolvedBy: 'case-insensitive-id' } };
314
+ const insensitiveLabel = entries.find((entry) => entry.action.label.toLowerCase() === normalized);
315
+ if (insensitiveLabel) return { status: 'found', ...insensitiveLabel, lookup: { ...lookup, resolvedBy: 'case-insensitive-label' } };
316
+
317
+ const searched = searchAgentWorkspaceActions(AGENT_WORKSPACE_CATEGORIES, lookup.input)
318
+ .map((result) => ({ category: result.category, action: result.action }))
319
+ .filter((entry) => !categoryId || entry.category.id === categoryId);
320
+ if (searched.length === 1) return { status: 'found', ...searched[0]!, lookup: { ...lookup, resolvedBy: 'search' } };
321
+ if (searched.length > 1) return { status: 'ambiguous', input: lookup.input, candidates: describeWorkspaceActionCandidates(searched) };
322
+ return null;
287
323
  }
288
324
 
289
325
  function requireConfirmedAction(args: AgentHarnessToolArgs, action: string): string | null {
@@ -551,8 +587,8 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
551
587
  panels: 'Use mode:"panels" and mode:"panel" to inspect built-in panel catalog/open state; use mode:"open_panel" with confirm:true plus explicitUserRequest to route a visible panel/workspace change.',
552
588
  uiSurfaces: 'Use mode:"ui_surfaces" and mode:"ui_surface" to inspect modal/overlay/picker/workspace surfaces; use mode:"open_ui_surface" with confirm:true plus explicitUserRequest to route visible UI navigation.',
553
589
  shortcuts: 'Use mode:"shortcuts" to inspect fixed shortcuts plus configurable keybindings. Use mode:"set_keybinding" and mode:"reset_keybinding" with confirm:true plus explicitUserRequest to edit the same config file the user edits.',
554
- slashCommands: 'Use mode:"commands" and mode:"command" to inspect; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
555
- workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" for editor schemas; set includeParameters:true on workspace_actions to inline editor schemas.',
590
+ slashCommands: 'Use mode:"commands" to list slash commands and mode:"command" with command, commandName, target, or query to inspect one command; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
591
+ workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" with actionId, command, target, or query for one action and editor schema; set includeParameters:true on workspace_actions to inline editor schemas.',
556
592
  settings: 'Use mode:"settings", mode:"get_setting", mode:"set_setting", and mode:"reset_setting".',
557
593
  tools: 'Use mode:"tools" to list first-class model tools, or mode:"tool" with toolName, target, or query to inspect one schema.',
558
594
  connectedHost: 'Use mode:"connected_host" for the connected-host capability map and blocked boundaries. Use mode:"connected_host_capability" with capabilityId, target, or query for one allowed or blocked capability.',
@@ -623,13 +659,15 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
623
659
  return output(resetHarnessKeybinding(deps.commandContext, args));
624
660
  }
625
661
  if (args.mode === 'commands') {
626
- const commands = listCommands(deps.commandRegistry, args);
662
+ const commands = listHarnessCommands(deps.commandRegistry, args);
627
663
  return output({ commands, returned: commands.length, total: deps.commandRegistry.list().length });
628
664
  }
629
665
  if (args.mode === 'command') {
630
- const name = readString(args.commandName).replace(/^\//, '');
631
- const command = name ? deps.commandRegistry.get(name) : null;
632
- return command ? output(describeCommand(command)) : error(`Unknown slash command /${name || '<missing>'}.`);
666
+ const detail = describeHarnessCommand(deps.commandRegistry, args);
667
+ const query = readString(args.command || args.commandName || args.target || args.query);
668
+ return detail
669
+ ? output(detail)
670
+ : error(`Unknown slash command ${query || '<missing>'}. Use mode:"commands" to inspect available commands.`);
633
671
  }
634
672
  if (args.mode === 'run_command') return runCommand(deps, args);
635
673
  if (args.mode === 'settings') {
@@ -682,11 +720,15 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
682
720
  return output({ actions, returned: actions.length, total: allWorkspaceActions().length });
683
721
  }
684
722
  if (args.mode === 'workspace_action') {
685
- const found = findWorkspaceAction(args);
723
+ const resolved = resolveWorkspaceActionDetail(args);
686
724
  const editorContext = buildWorkspaceEditorContext(deps.commandContext, args);
687
- return found
688
- ? output(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext }))
689
- : error(`Unknown Agent workspace action ${readString(args.actionId || args.query) || '<missing>'}.`);
725
+ if (resolved?.status === 'found') {
726
+ return output(describeWorkspaceAction(resolved.category, resolved.action, { includeEditor: true, editorContext, lookup: resolved.lookup }));
727
+ }
728
+ if (resolved?.status === 'ambiguous') {
729
+ return error(`Ambiguous Agent workspace action ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
730
+ }
731
+ return error(`Unknown Agent workspace action ${readString(args.actionId || args.command || args.target || args.query) || '<missing>'}. Use mode:"workspace_actions" to inspect available actions.`);
690
732
  }
691
733
  if (args.mode === 'run_workspace_action') return runWorkspaceAction(deps, args);
692
734
  if (args.mode === 'tools') {
package/src/version.ts CHANGED
@@ -6,7 +6,7 @@ import { join } from 'node:path';
6
6
  // The prebuild script updates the fallback value before compilation.
7
7
  // Uses import.meta.dir (Bun) to locate package.json relative to this file,
8
8
  // which is correct regardless of the process working directory.
9
- let _version = '1.0.14';
9
+ let _version = '1.0.16';
10
10
  let _sdkVersion = '0.33.35';
11
11
  try {
12
12
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf-8')) as {