@pellux/goodvibes-agent 1.0.4 → 1.0.6

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, top-level CLI mirrors, fixed shortcuts, configurable keybindings, slash commands, command policy metadata, model tools, settings, local registries, and connected-host capability boundaries are model-visible through Agent-owned tools. Mutations remain explicit and confirmation-gated.
25
+ - User-facing Agent workspace actions, built-in panels, modal/overlay/picker UI surfaces, top-level CLI mirrors, fixed shortcuts, configurable keybindings, slash commands, command policy metadata, model tools, settings, local registries, and connected-host capability boundaries are model-visible through Agent-owned tools. 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.
@@ -56,6 +56,8 @@ Agent does not own connected-host lifecycle. It does not provide commands to ins
56
56
 
57
57
  The model can inspect this boundary with `agent_harness` mode `connected_host`. That report includes the configured base URL, token presence, token path, allowed route families, first-class Agent tool capabilities, tool availability, and blocked capabilities. Allowed capabilities are limited to read-only operator briefing, explicit allowlisted approval/automation/schedule actions, isolated Agent Knowledge read/ingest, confirmed channel or notification delivery, confirmed reminder schedules, and configured media generation. Blocked capabilities include connected-host lifecycle, listener mutation, default or non-Agent knowledge fallback, hidden background Agent jobs, implicit delegated review, route/account creation, and arbitrary connected-host mutations.
58
58
 
59
+ The model can inspect live connected-host readiness with `agent_harness` mode `connected_host_status`. That report uses the same read-only status probe as the CLI: it checks the connected-host status route, verifies the SDK version pin, checks the isolated Agent Knowledge status route when token and version posture allow it, reports endpoint bindings and token posture without printing token values, and returns actionable findings. It is diagnostic only and does not expose host start, stop, restart, install, listener, or account-management operations.
60
+
59
61
  Agent Knowledge is its own product segment. Agent uses `/api/goodvibes-agent/knowledge/*` only and must not fall back to default knowledge or other product-specific knowledge routes.
60
62
 
61
63
  Normal assistant chat uses companion chat. Build/fix/review work is delegated explicitly to GoodVibes TUI through public runtime/session contracts, and delegated review is requested only when explicitly asked for build/fix/review work.
@@ -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, 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, settings inspection/mutation, and connected-host 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. 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. 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, 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, settings inspection/mutation, connected-host capability inventory, 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, context, bookmarks, model/provider pickers, session/profile pickers, 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. 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
 
@@ -122,7 +122,7 @@ Use `/channels` inside the TUI for channel readiness and exact confirmed sends.
122
122
 
123
123
  The main assistant conversation can perform narrow confirmed operator actions when the user explicitly asks for a specific target: approve/deny/cancel one approval, run/pause/resume one automation job, cancel/retry one automation run, or run one schedule. Those calls use only public connected-host routes, require confirmation, and do not create, edit, or delete automation definitions.
124
124
 
125
- When the main assistant conversation needs to change Agent settings, change Agent keybindings, or run a user-facing harness action, it should use `agent_harness` rather than generic SDK context/settings tools. Setting descriptors report writability, workspace visibility, and lock reasons; keybinding descriptors report fixed shortcuts, resolved bindings, defaults, custom state, and config path; secret-backed settings store raw values through the secret manager; connected-host lifecycle settings stay read-only in Agent; and destructive local record deletion requires explicit confirmation.
125
+ When the main assistant conversation needs to change Agent settings, change Agent keybindings, open a visible UI surface, or run a user-facing harness action, it should use `agent_harness` rather than generic SDK context/settings tools. Setting descriptors report writability, workspace visibility, and lock reasons; keybinding descriptors report fixed shortcuts, resolved bindings, defaults, custom state, and config path; UI surface descriptors report the visible shell opener, preferred model route, and confirmation policy; secret-backed settings store raw values through the secret manager; connected-host lifecycle settings stay read-only in Agent; and destructive local record deletion requires explicit confirmation.
126
126
 
127
127
  ## Connected GoodVibes Host
128
128
 
@@ -138,7 +138,7 @@ If the GoodVibes API is not on `http://127.0.0.1:3421`, pass `--runtime-url http
138
138
 
139
139
  Agent Knowledge is an Agent-owned product segment. Agent commands must not fall back to default knowledge or other product-specific knowledge spaces.
140
140
 
141
- Host lifecycle commands are not part of GoodVibes Agent. Use Agent Workspace -> Home -> Host compatibility, Doctor diagnostics, and Review health for diagnostics. CLI status/doctor/compat commands are scriptable mirrors for install checks. The model-visible `connected_host` harness report lists usable Agent route families, first-class tool capabilities, and blocked lifecycle/non-Agent surfaces without exposing host start/stop/restart/install operations.
141
+ Host lifecycle commands are not part of GoodVibes Agent. Use Agent Workspace -> Home -> Host compatibility, Doctor diagnostics, and Review health for diagnostics. CLI status/doctor/compat commands are scriptable mirrors for install checks. The model-visible `connected_host` harness report lists usable Agent route families, first-class tool capabilities, and blocked lifecycle/non-Agent surfaces. The model-visible `connected_host_status` report performs the live read-only connected-host status and isolated Agent Knowledge readiness checks, reports SDK compatibility, token posture, endpoint bindings, route readiness, and actionable findings, and still does not expose host start/stop/restart/install operations.
142
142
 
143
143
  ## Current Product Notes
144
144
 
@@ -43,14 +43,16 @@ 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 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, inspect or change Agent settings/keybindings, and inspect connected-host posture.
46
+ - `agent_harness`: inspect workspace categories/actions, inspect built-in panels, inspect modal/overlay/picker UI 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, inspect or change Agent settings/keybindings, inspect connected-host capability boundaries, 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; `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` can inline model tool JSON schemas with `includeParameters:true`; `settings` returns setting descriptors plus setting policy; and `connected_host` returns the connected-host route families, allowed capabilities, blocked capabilities, and first-class tool availability.
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` can inline model tool JSON schemas with `includeParameters:true`; `settings` returns setting descriptors plus setting policy; `connected_host` returns the connected-host route families, allowed capabilities, blocked capabilities, and first-class tool availability; 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
+
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 pickers, session/profile pickers, bookmarks, context inspector, 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.
54
56
 
55
57
  `set_keybinding` and `reset_keybinding` are confirmation-gated control modes. They write the same Agent `keybindings.json` file exposed by `/keybindings`, reload the runtime keybinding manager, and leave fixed runtime/editor shortcuts read-only.
56
58
 
@@ -58,7 +60,7 @@ The main Agent model has an Agent-owned harness bridge rather than generic SDK s
58
60
 
59
61
  CLI mirror modes are catalog and parser inspection only. When the user asks the model to operate from inside the main conversation, use the returned first-class model tool, workspace action, setting mode, or confirmed slash-command mirror instead of launching a hidden nested `goodvibes-agent` process.
60
62
 
61
- Setting writes, setting resets, keybinding writes/resets, slash-command invocation, workspace-action invocation, local record deletion, channel sends, notifications, reminders, media generation, and connected-host operator mutations require explicit user request and confirmation. Secret-backed settings are stored through the secret manager, and connected-host lifecycle/listener settings remain read-only in Agent.
63
+ Setting writes, setting resets, keybinding writes/resets, UI surface routing, slash-command invocation, workspace-action invocation, local record deletion, channel sends, notifications, reminders, media generation, and connected-host operator mutations require explicit user request and confirmation. Secret-backed settings are stored through the secret manager, and connected-host lifecycle/listener settings remain read-only in Agent.
62
64
 
63
65
  Selection-based local workspace actions use the same bridge. `agent_harness` reports the required model tool for each local action; for actions that depend on the TUI selection, call `run_workspace_action` with the selected local `recordId`. Note promotion actions can prefill and create memory, personas, skills, routines, or isolated Agent Knowledge URL ingests through the matching first-class model tool. Profile creation schemas include the current runtime starter-template inventory, and routine schedule schemas prefill the selected routine when `recordId` or a `routineId` field matches a local routine.
64
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-agent",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
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,146 @@
1
+ import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
2
+ import { resolveRuntimeEndpointBinding } from '../cli/endpoints.ts';
3
+ import { inspectCliExternalRuntime, type CliExternalRuntimeSnapshot } from '../cli/external-runtime.ts';
4
+ import type { CommandContext } from '../input/command-registry.ts';
5
+ import { connectedHostOperatorTokenFingerprint, readConnectedHostOperatorToken } from '../runtime/connected-host-auth.ts';
6
+ import {
7
+ blockedConnectedHostCapabilities,
8
+ connectedHostCapabilityMap,
9
+ connectedHostRouteFamilies,
10
+ } from './agent-harness-metadata.ts';
11
+
12
+ const CONNECTED_HOST_STATUS_TIMEOUT_MS = 1500;
13
+
14
+ function resolveHomeDirectory(context: CommandContext): string {
15
+ return context.workspace.shellPaths?.homeDirectory
16
+ ?? context.platform.configManager.getHomeDirectory()
17
+ ?? '';
18
+ }
19
+
20
+ function resolveWorkingDirectory(context: CommandContext): string {
21
+ return context.workspace.shellPaths?.workingDirectory
22
+ ?? context.platform.configManager.getWorkingDirectory()
23
+ ?? '';
24
+ }
25
+
26
+ function connectedHostFindings(
27
+ runtime: CliExternalRuntimeSnapshot,
28
+ tokenUsable: boolean,
29
+ ): readonly Record<string, unknown>[] {
30
+ const findings: Record<string, unknown>[] = [];
31
+
32
+ if (!runtime.reachable) {
33
+ findings.push({
34
+ id: 'connected-host-unreachable',
35
+ severity: 'warning',
36
+ summary: 'Connected host is not reachable.',
37
+ cause: runtime.error ?? `No response from ${runtime.baseUrl}.`,
38
+ action: 'Start or repair the owning GoodVibes host outside Agent, then recheck connected-host status.',
39
+ });
40
+ } else if (!runtime.compatible) {
41
+ findings.push({
42
+ id: 'connected-host-version-mismatch',
43
+ severity: 'warning',
44
+ summary: 'Connected host SDK version does not match Agent.',
45
+ cause: `Connected host reports SDK ${runtime.version}; Agent expects ${runtime.expectedVersion}.`,
46
+ action: 'Update the owning GoodVibes host so its /status route reports the Agent SDK pin.',
47
+ });
48
+ }
49
+
50
+ if (!tokenUsable) {
51
+ findings.push({
52
+ id: 'connected-host-token-missing',
53
+ severity: 'warning',
54
+ summary: 'Connected-host operator token is missing or unreadable.',
55
+ cause: `No usable operator token was found at ${runtime.operatorToken.path}.`,
56
+ action: 'Provision or repair connected-host access through the owning GoodVibes host.',
57
+ });
58
+ }
59
+
60
+ if (runtime.reachable && tokenUsable && !runtime.agentKnowledge.ready) {
61
+ findings.push({
62
+ id: 'agent-knowledge-route-not-ready',
63
+ severity: 'warning',
64
+ summary: 'Isolated Agent Knowledge route is not ready.',
65
+ cause: `${runtime.agentKnowledge.route} returned ${runtime.agentKnowledge.kind}${runtime.agentKnowledge.statusCode === null ? '' : ` (${runtime.agentKnowledge.statusCode})`}.`,
66
+ action: 'Update or repair the connected host, then recheck Agent Knowledge compatibility.',
67
+ });
68
+ }
69
+
70
+ return findings;
71
+ }
72
+
73
+ export async function connectedHostStatusSummary(
74
+ context: CommandContext,
75
+ toolRegistry: ToolRegistry,
76
+ ): Promise<Record<string, unknown>> {
77
+ const homeDirectory = resolveHomeDirectory(context);
78
+ const workingDirectory = resolveWorkingDirectory(context);
79
+ const token = readConnectedHostOperatorToken(homeDirectory);
80
+ const runtime = await inspectCliExternalRuntime({
81
+ configManager: context.platform.configManager,
82
+ homeDirectory,
83
+ timeoutMs: CONNECTED_HOST_STATUS_TIMEOUT_MS,
84
+ });
85
+ const tokenUsable = Boolean(token.token);
86
+
87
+ return {
88
+ ownership: 'external-connected-host',
89
+ readOnly: true,
90
+ timeoutMs: CONNECTED_HOST_STATUS_TIMEOUT_MS,
91
+ lifecycle: 'GoodVibes Agent can inspect connected-host readiness and use public operator routes, but does not start, stop, restart, install, expose, or mutate the host listener.',
92
+ paths: {
93
+ workingDirectory,
94
+ homeDirectory,
95
+ },
96
+ endpoints: {
97
+ controlPlane: {
98
+ enabled: context.platform.configManager.get('controlPlane.enabled'),
99
+ ...resolveRuntimeEndpointBinding(context.platform.configManager, 'controlPlane'),
100
+ },
101
+ httpListener: {
102
+ enabled: context.platform.configManager.get('danger.httpListener'),
103
+ ...resolveRuntimeEndpointBinding(context.platform.configManager, 'httpListener'),
104
+ },
105
+ web: {
106
+ enabled: context.platform.configManager.get('web.enabled'),
107
+ ...resolveRuntimeEndpointBinding(context.platform.configManager, 'web'),
108
+ },
109
+ },
110
+ operatorToken: {
111
+ present: token.present,
112
+ usable: tokenUsable,
113
+ path: token.path,
114
+ fingerprint: token.token ? `sha256:${connectedHostOperatorTokenFingerprint(token.token)}` : null,
115
+ error: token.error ?? null,
116
+ },
117
+ liveStatus: runtime,
118
+ routeReadiness: [
119
+ {
120
+ id: 'status',
121
+ route: '/status',
122
+ reachable: runtime.reachable,
123
+ statusCode: runtime.statusCode,
124
+ sdkVersion: runtime.version,
125
+ expectedSdkVersion: runtime.expectedVersion,
126
+ compatible: runtime.compatible,
127
+ },
128
+ {
129
+ id: 'agent-knowledge',
130
+ route: runtime.agentKnowledge.route,
131
+ ready: runtime.agentKnowledge.ready,
132
+ kind: runtime.agentKnowledge.kind,
133
+ statusCode: runtime.agentKnowledge.statusCode,
134
+ },
135
+ ],
136
+ findings: connectedHostFindings(runtime, tokenUsable),
137
+ modelAccess: {
138
+ diagnostics: 'Use mode:"connected_host_status" for live read-only host readiness. Use mode:"connected_host" for capability and boundary inventory.',
139
+ cliMirrors: ['goodvibes-agent status --json', 'goodvibes-agent doctor', 'goodvibes-agent compat'],
140
+ tuiMirrors: ['Agent Workspace -> Home -> Host compatibility', 'Agent Workspace -> Home -> Doctor diagnostics', 'Agent Workspace -> Home -> Review health'],
141
+ },
142
+ routeFamilies: connectedHostRouteFamilies(),
143
+ capabilities: connectedHostCapabilityMap(toolRegistry),
144
+ blockedCapabilities: blockedConnectedHostCapabilities(),
145
+ };
146
+ }
@@ -366,6 +366,7 @@ export function connectedHostSummary(context: CommandContext, toolRegistry: Tool
366
366
  tokenPath: connection.tokenPath,
367
367
  ownership: 'external-connected-host',
368
368
  lifecycle: 'GoodVibes Agent can use public connected-host operator routes, but does not start, stop, restart, install, expose, or mutate the host listener.',
369
+ statusMode: 'Use agent_harness mode:"connected_host_status" for live read-only reachability, SDK compatibility, token posture, and Agent Knowledge route readiness.',
369
370
  routeFamilies: connectedHostRouteFamilies(),
370
371
  capabilities: connectedHostCapabilityMap(toolRegistry),
371
372
  blockedCapabilities: blockedConnectedHostCapabilities(),
@@ -0,0 +1,127 @@
1
+ export const AGENT_HARNESS_MODES = [
2
+ 'summary', 'cli_commands', 'cli_command', 'panels', 'panel', 'open_panel',
3
+ 'ui_surfaces', 'ui_surface', 'open_ui_surface',
4
+ 'shortcuts', 'keybindings', 'keybinding', 'set_keybinding', 'reset_keybinding',
5
+ 'commands', 'command', 'run_command', 'settings', 'get_setting', 'set_setting',
6
+ 'reset_setting', 'workspace', 'workspace_categories', 'workspace_actions',
7
+ 'workspace_action', 'run_workspace_action', 'tools', 'connected_host', 'connected_host_status',
8
+ ] as const;
9
+
10
+ const KEY_COMBO_PARAMETER_SCHEMA = {
11
+ type: 'object',
12
+ properties: { key: { type: 'string' }, ctrl: { type: 'boolean' }, shift: { type: 'boolean' }, alt: { type: 'boolean' } },
13
+ required: ['key'],
14
+ additionalProperties: false,
15
+ } as const;
16
+
17
+ export const AGENT_HARNESS_PARAMETER_PROPERTIES = {
18
+ mode: {
19
+ type: 'string',
20
+ enum: AGENT_HARNESS_MODES,
21
+ description: 'Harness operation to perform.',
22
+ },
23
+ query: {
24
+ type: 'string',
25
+ description: 'Search text for command, setting, tool, or UI surface catalogs.',
26
+ },
27
+ command: {
28
+ type: 'string',
29
+ 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
+ },
31
+ cliCommand: {
32
+ type: 'string',
33
+ description: 'Top-level CLI command string for mode cli_command, for example "goodvibes-agent status --json" or "profiles list". This mode is read-only metadata/parse inspection.',
34
+ },
35
+ commandName: {
36
+ type: 'string',
37
+ description: 'Slash command root without the leading slash for mode command or run_command, or a top-level CLI command token for cli_command.',
38
+ },
39
+ args: {
40
+ type: 'array',
41
+ items: { type: 'string' },
42
+ description: 'Slash command argument tokens for mode run_command when commandName is used.',
43
+ },
44
+ categoryId: {
45
+ type: 'string',
46
+ description: 'Agent workspace category id for workspace action filtering or ui surface routing.',
47
+ },
48
+ surfaceId: {
49
+ type: 'string',
50
+ description: 'UI surface id for ui_surface or open_ui_surface modes.',
51
+ },
52
+ panelId: {
53
+ type: 'string',
54
+ description: 'Built-in panel id for panel or open_panel modes.',
55
+ },
56
+ actionId: {
57
+ type: 'string',
58
+ description: 'Agent workspace action id for workspace_action or run_workspace_action, or keybinding action id for keybinding/set_keybinding/reset_keybinding.',
59
+ },
60
+ fields: {
61
+ type: 'object',
62
+ additionalProperties: { type: 'string' },
63
+ description: 'Field values for run_workspace_action when the workspace action opens an editor form.',
64
+ },
65
+ combo: {
66
+ ...KEY_COMBO_PARAMETER_SCHEMA,
67
+ description: 'Single key combo for set_keybinding, for example { "key": "g", "ctrl": true }.',
68
+ },
69
+ combos: {
70
+ type: 'array',
71
+ items: KEY_COMBO_PARAMETER_SCHEMA,
72
+ description: 'Multiple key combos for set_keybinding.',
73
+ },
74
+ recordId: {
75
+ type: 'string',
76
+ description: 'Selected Agent-local record id for selection-based local workspace operations.',
77
+ },
78
+ key: {
79
+ type: 'string',
80
+ description: 'Agent setting key for get_setting, set_setting, or reset_setting.',
81
+ },
82
+ value: {
83
+ anyOf: [
84
+ { type: 'string' },
85
+ { type: 'number' },
86
+ { type: 'boolean' },
87
+ ],
88
+ description: 'Setting value for set_setting. Strings, booleans, numbers, and enum strings are accepted.',
89
+ },
90
+ target: {
91
+ type: 'string',
92
+ description: 'Optional UI target, such as a model-picker target or settings target key.',
93
+ },
94
+ category: {
95
+ type: 'string',
96
+ description: 'Setting category filter such as provider, behavior, tools, ui, tts, permissions, automation, or surfaces.',
97
+ },
98
+ prefix: {
99
+ type: 'string',
100
+ description: 'Setting key prefix filter such as surfaces.slack.',
101
+ },
102
+ includeHidden: {
103
+ type: 'boolean',
104
+ description: 'Include settings hidden from the Agent workspace because they are host-owned or non-Agent lifecycle settings.',
105
+ },
106
+ includeParameters: {
107
+ type: 'boolean',
108
+ description: 'Include model tool JSON schemas in tools mode, or workspace editor field schemas in workspace_actions mode.',
109
+ },
110
+ limit: {
111
+ type: 'number',
112
+ description: 'Maximum catalog entries to return.',
113
+ },
114
+ pane: {
115
+ type: 'string',
116
+ enum: ['top', 'bottom'],
117
+ description: 'Preferred panel pane for open_panel when the current shell supports panel routing.',
118
+ },
119
+ confirm: {
120
+ type: 'boolean',
121
+ description: 'Required true for set_setting, reset_setting, run_command, open_panel, open_ui_surface, and mutating run_workspace_action calls after an explicit user request.',
122
+ },
123
+ explicitUserRequest: {
124
+ type: 'string',
125
+ description: 'Exact user request or faithful short summary authorizing a setting mutation or harness UI/command invocation.',
126
+ },
127
+ } as const;
@@ -20,8 +20,11 @@ import { parseSlashCommand } from '../input/slash-command-parser.ts';
20
20
  import { blockedHarnessCliCommandTokens, describeHarnessCliCommand, listHarnessCliCommands, totalHarnessCliCommands } from './agent-harness-cli-metadata.ts';
21
21
  import { describeHarnessKeybinding, listHarnessKeybindings, listHarnessShortcuts, resetHarnessKeybinding, setHarnessKeybinding, totalHarnessKeybindings, totalHarnessShortcuts } from './agent-harness-keybinding-metadata.ts';
22
22
  import { describeHarnessPanel, listHarnessPanels, openHarnessPanel, totalHarnessPanels } from './agent-harness-panel-metadata.ts';
23
+ import { connectedHostStatusSummary } from './agent-harness-connected-host-status.ts';
23
24
  import { describeLocalWorkspaceModelExecution, runLocalWorkspaceAction } from './agent-harness-local-operations.ts';
24
25
  import { listHarnessModelTools } from './agent-harness-model-tool-catalog.ts';
26
+ import { AGENT_HARNESS_MODES, AGENT_HARNESS_PARAMETER_PROPERTIES } from './agent-harness-tool-schema.ts';
27
+ import { describeHarnessUiSurface, listHarnessUiSurfaces, openHarnessUiSurface, totalHarnessUiSurfaces } from './agent-harness-ui-surface-metadata.ts';
25
28
  import {
26
29
  connectedHostSummary,
27
30
  describeCommandPolicy,
@@ -35,15 +38,7 @@ import {
35
38
  setHarnessSetting,
36
39
  } from '../agent/harness-control.ts';
37
40
 
38
- const MODES = [
39
- 'summary', 'cli_commands', 'cli_command', 'panels', 'panel', 'open_panel',
40
- 'shortcuts', 'keybindings', 'keybinding', 'set_keybinding', 'reset_keybinding',
41
- 'commands', 'command', 'run_command', 'settings', 'get_setting', 'set_setting',
42
- 'reset_setting', 'workspace', 'workspace_categories', 'workspace_actions',
43
- 'workspace_action', 'run_workspace_action', 'tools', 'connected_host',
44
- ] as const;
45
-
46
- type AgentHarnessMode = typeof MODES[number];
41
+ type AgentHarnessMode = typeof AGENT_HARNESS_MODES[number];
47
42
 
48
43
  interface AgentHarnessToolArgs {
49
44
  readonly mode?: unknown;
@@ -59,8 +54,10 @@ interface AgentHarnessToolArgs {
59
54
  readonly fields?: unknown;
60
55
  readonly combo?: unknown;
61
56
  readonly combos?: unknown;
57
+ readonly surfaceId?: unknown;
62
58
  readonly key?: unknown;
63
59
  readonly value?: unknown;
60
+ readonly target?: unknown;
64
61
  readonly category?: unknown;
65
62
  readonly prefix?: unknown;
66
63
  readonly includeHidden?: unknown;
@@ -83,7 +80,7 @@ interface WorkspaceEditorContext {
83
80
  }
84
81
 
85
82
  function isMode(value: unknown): value is AgentHarnessMode {
86
- return typeof value === 'string' && MODES.includes(value as AgentHarnessMode);
83
+ return typeof value === 'string' && AGENT_HARNESS_MODES.includes(value as AgentHarnessMode);
87
84
  }
88
85
 
89
86
  function readString(value: unknown): string {
@@ -115,13 +112,6 @@ function output(value: unknown): { readonly success: true; readonly output: stri
115
112
 
116
113
  function error(message: string): { readonly success: false; readonly error: string } { return { success: false, error: message }; }
117
114
 
118
- const KEY_COMBO_PARAMETER_SCHEMA = {
119
- type: 'object',
120
- properties: { key: { type: 'string' }, ctrl: { type: 'boolean' }, shift: { type: 'boolean' }, alt: { type: 'boolean' } },
121
- required: ['key'],
122
- additionalProperties: false,
123
- } as const;
124
-
125
115
  function commandMatches(command: SlashCommand, query: string): boolean {
126
116
  if (!query) return true;
127
117
  const haystack = [
@@ -514,115 +504,13 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
514
504
  name: 'agent_harness',
515
505
  description: [
516
506
  'Discover and operate the GoodVibes Agent harness from the main conversation.',
517
- 'Use this tool to inspect Agent workspace actions, built-in panels, top-level CLI mirrors, keybindings, slash commands with policy metadata, model tools, connected-host capabilities, and Agent settings, or to invoke a workspace action/command through the same in-process command registry the user uses in the TUI.',
518
- 'Discovery modes are read-only. Setting/keybinding writes, resets, slash command invocation, and workspace action invocation require confirm:true plus explicitUserRequest.',
507
+ 'Use this tool to inspect Agent workspace actions, built-in panels, top-level CLI mirrors, UI surfaces, keybindings, slash commands with policy metadata, model tools, connected-host capabilities, and Agent settings, or to invoke a workspace action/command through the same in-process command registry the user uses in the TUI.',
508
+ 'Discovery modes are read-only. Setting/keybinding writes, resets, UI routing, slash command invocation, and workspace action invocation require confirm:true plus explicitUserRequest.',
519
509
  'This tool preserves Agent product boundaries: connected-host lifecycle and listener posture stay externally owned, connected-host mode reports allowed and blocked route families, and secret-backed settings store raw values through the secret manager while config receives only a secret reference.',
520
510
  ].join(' '),
521
511
  parameters: {
522
512
  type: 'object',
523
- properties: {
524
- mode: {
525
- type: 'string',
526
- enum: MODES,
527
- description: 'Harness operation to perform.',
528
- },
529
- query: {
530
- type: 'string',
531
- description: 'Search text for command, setting, or tool catalogs.',
532
- },
533
- command: {
534
- type: 'string',
535
- 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".',
536
- },
537
- cliCommand: {
538
- type: 'string',
539
- description: 'Top-level CLI command string for mode cli_command, for example "goodvibes-agent status --json" or "profiles list". This mode is read-only metadata/parse inspection.',
540
- },
541
- commandName: {
542
- type: 'string',
543
- description: 'Slash command root without the leading slash for mode command or run_command, or a top-level CLI command token for cli_command.',
544
- },
545
- args: {
546
- type: 'array',
547
- items: { type: 'string' },
548
- description: 'Slash command argument tokens for mode run_command when commandName is used.',
549
- },
550
- categoryId: {
551
- type: 'string',
552
- description: 'Agent workspace category id for workspace action filtering.',
553
- },
554
- panelId: {
555
- type: 'string',
556
- description: 'Built-in panel id for panel or open_panel modes.',
557
- },
558
- actionId: {
559
- type: 'string',
560
- description: 'Agent workspace action id for workspace_action or run_workspace_action, or keybinding action id for keybinding/set_keybinding/reset_keybinding.',
561
- },
562
- fields: {
563
- type: 'object',
564
- additionalProperties: { type: 'string' },
565
- description: 'Field values for run_workspace_action when the workspace action opens an editor form.',
566
- },
567
- combo: {
568
- ...KEY_COMBO_PARAMETER_SCHEMA,
569
- description: 'Single key combo for set_keybinding, for example { "key": "g", "ctrl": true }.',
570
- },
571
- combos: {
572
- type: 'array',
573
- items: KEY_COMBO_PARAMETER_SCHEMA,
574
- description: 'Multiple key combos for set_keybinding.',
575
- },
576
- recordId: {
577
- type: 'string',
578
- description: 'Selected Agent-local record id for selection-based local workspace operations.',
579
- },
580
- key: {
581
- type: 'string',
582
- description: 'Agent setting key for get_setting, set_setting, or reset_setting.',
583
- },
584
- value: {
585
- anyOf: [
586
- { type: 'string' },
587
- { type: 'number' },
588
- { type: 'boolean' },
589
- ],
590
- description: 'Setting value for set_setting. Strings, booleans, numbers, and enum strings are accepted.',
591
- },
592
- category: {
593
- type: 'string',
594
- description: 'Setting category filter such as provider, behavior, tools, ui, tts, permissions, automation, or surfaces.',
595
- },
596
- prefix: {
597
- type: 'string',
598
- description: 'Setting key prefix filter such as surfaces.slack.',
599
- },
600
- includeHidden: {
601
- type: 'boolean',
602
- description: 'Include settings hidden from the Agent workspace because they are host-owned or non-Agent lifecycle settings.',
603
- },
604
- includeParameters: {
605
- type: 'boolean',
606
- description: 'Include model tool JSON schemas in tools mode, or workspace editor field schemas in workspace_actions mode.',
607
- },
608
- limit: {
609
- type: 'number',
610
- description: 'Maximum catalog entries to return.',
611
- },
612
- pane: {
613
- type: 'string',
614
- enum: ['top', 'bottom'],
615
- description: 'Preferred panel pane for open_panel when the current shell supports panel routing.',
616
- },
617
- confirm: {
618
- type: 'boolean',
619
- description: 'Required true for set_setting, reset_setting, run_command, open_panel, and mutating run_workspace_action calls after an explicit user request.',
620
- },
621
- explicitUserRequest: {
622
- type: 'string',
623
- description: 'Exact user request or faithful short summary authorizing a setting mutation or slash command invocation.',
624
- },
625
- },
513
+ properties: AGENT_HARNESS_PARAMETER_PROPERTIES,
626
514
  required: ['mode'],
627
515
  additionalProperties: false,
628
516
  },
@@ -638,6 +526,7 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
638
526
  cliCommands: totalHarnessCliCommands(),
639
527
  blockedCliCommandTokens: blockedHarnessCliCommandTokens(),
640
528
  panels: totalHarnessPanels(deps.commandContext),
529
+ uiSurfaces: totalHarnessUiSurfaces(),
641
530
  shortcuts: totalHarnessShortcuts(deps.commandContext),
642
531
  keybindings: totalHarnessKeybindings(deps.commandContext),
643
532
  commands: deps.commandRegistry.list().length,
@@ -648,12 +537,14 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
648
537
  modelAccess: {
649
538
  cliCommands: 'Use mode:"cli_commands" and mode:"cli_command" to inspect package CLI mirrors and their preferred in-process model routes. CLI modes are discovery-only.',
650
539
  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.',
540
+ 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.',
651
541
  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.',
652
542
  slashCommands: 'Use mode:"commands" and mode:"command" to inspect; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
653
543
  workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" for editor schemas; set includeParameters:true on workspace_actions to inline editor schemas.',
654
544
  settings: 'Use mode:"settings", mode:"get_setting", mode:"set_setting", and mode:"reset_setting".',
655
545
  tools: 'Use mode:"tools" with includeParameters:true to inspect first-class model tool schemas.',
656
546
  connectedHost: 'Use mode:"connected_host" for the connected-host capability map and blocked boundaries.',
547
+ connectedHostStatus: 'Use mode:"connected_host_status" for live read-only host reachability, SDK compatibility, token posture, and Agent Knowledge route readiness.',
657
548
  },
658
549
  settingsPolicy: settingsPolicySummary(),
659
550
  connectedHost: connectedHostSummary(deps.commandContext, deps.toolRegistry),
@@ -690,6 +581,19 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
690
581
  if (confirmationError) return error(confirmationError);
691
582
  return output(openHarnessPanel(deps.commandContext, args));
692
583
  }
584
+ if (args.mode === 'ui_surfaces') {
585
+ const surfaces = listHarnessUiSurfaces(deps.commandContext, args);
586
+ return output({ surfaces, returned: surfaces.length, total: totalHarnessUiSurfaces() });
587
+ }
588
+ if (args.mode === 'ui_surface') {
589
+ const surface = describeHarnessUiSurface(deps.commandContext, args);
590
+ return surface ? output(surface) : error(`Unknown UI surface ${readString(args.surfaceId || args.query) || '<missing>'}.`);
591
+ }
592
+ if (args.mode === 'open_ui_surface') {
593
+ const confirmationError = requireConfirmedAction(args, 'UI surface routing');
594
+ if (confirmationError) return error(confirmationError);
595
+ return output(openHarnessUiSurface(deps.commandContext, args));
596
+ }
693
597
  if (args.mode === 'shortcuts') return output(listHarnessShortcuts(deps.commandContext, args));
694
598
  if (args.mode === 'keybindings') return output(listHarnessKeybindings(deps.commandContext, args));
695
599
  if (args.mode === 'keybinding') {
@@ -778,6 +682,7 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
778
682
  return output({ tools, returned: tools.length, total: deps.toolRegistry.getToolDefinitions().length });
779
683
  }
780
684
  if (args.mode === 'connected_host') return output(connectedHostSummary(deps.commandContext, deps.toolRegistry));
685
+ if (args.mode === 'connected_host_status') return output(await connectedHostStatusSummary(deps.commandContext, deps.toolRegistry));
781
686
  return error(`Unhandled agent_harness mode: ${args.mode}`);
782
687
  } catch (err) {
783
688
  return error(formatHarnessError(err));