@pellux/goodvibes-agent 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/dist/package/main.js +498 -152
- package/docs/README.md +1 -1
- package/docs/getting-started.md +2 -2
- package/docs/tools-and-commands.md +5 -3
- package/package.json +1 -1
- package/src/tools/agent-harness-tool-schema.ts +127 -0
- package/src/tools/agent-harness-tool.ts +24 -122
- package/src/tools/agent-harness-ui-surface-metadata.ts +343 -0
- package/src/version.ts +1 -1
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.
|
package/docs/getting-started.md
CHANGED
|
@@ -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, 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. 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
|
|
|
@@ -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, and inspect connected-host posture.
|
|
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; and `connected_host` returns the connected-host route families, allowed capabilities, blocked capabilities, and first-class tool availability.
|
|
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.
|
|
3
|
+
"version": "1.0.5",
|
|
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,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',
|
|
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;
|
|
@@ -22,6 +22,8 @@ import { describeHarnessKeybinding, listHarnessKeybindings, listHarnessShortcuts
|
|
|
22
22
|
import { describeHarnessPanel, listHarnessPanels, openHarnessPanel, totalHarnessPanels } from './agent-harness-panel-metadata.ts';
|
|
23
23
|
import { describeLocalWorkspaceModelExecution, runLocalWorkspaceAction } from './agent-harness-local-operations.ts';
|
|
24
24
|
import { listHarnessModelTools } from './agent-harness-model-tool-catalog.ts';
|
|
25
|
+
import { AGENT_HARNESS_MODES, AGENT_HARNESS_PARAMETER_PROPERTIES } from './agent-harness-tool-schema.ts';
|
|
26
|
+
import { describeHarnessUiSurface, listHarnessUiSurfaces, openHarnessUiSurface, totalHarnessUiSurfaces } from './agent-harness-ui-surface-metadata.ts';
|
|
25
27
|
import {
|
|
26
28
|
connectedHostSummary,
|
|
27
29
|
describeCommandPolicy,
|
|
@@ -35,15 +37,7 @@ import {
|
|
|
35
37
|
setHarnessSetting,
|
|
36
38
|
} from '../agent/harness-control.ts';
|
|
37
39
|
|
|
38
|
-
|
|
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];
|
|
40
|
+
type AgentHarnessMode = typeof AGENT_HARNESS_MODES[number];
|
|
47
41
|
|
|
48
42
|
interface AgentHarnessToolArgs {
|
|
49
43
|
readonly mode?: unknown;
|
|
@@ -59,8 +53,10 @@ interface AgentHarnessToolArgs {
|
|
|
59
53
|
readonly fields?: unknown;
|
|
60
54
|
readonly combo?: unknown;
|
|
61
55
|
readonly combos?: unknown;
|
|
56
|
+
readonly surfaceId?: unknown;
|
|
62
57
|
readonly key?: unknown;
|
|
63
58
|
readonly value?: unknown;
|
|
59
|
+
readonly target?: unknown;
|
|
64
60
|
readonly category?: unknown;
|
|
65
61
|
readonly prefix?: unknown;
|
|
66
62
|
readonly includeHidden?: unknown;
|
|
@@ -83,7 +79,7 @@ interface WorkspaceEditorContext {
|
|
|
83
79
|
}
|
|
84
80
|
|
|
85
81
|
function isMode(value: unknown): value is AgentHarnessMode {
|
|
86
|
-
return typeof value === 'string' &&
|
|
82
|
+
return typeof value === 'string' && AGENT_HARNESS_MODES.includes(value as AgentHarnessMode);
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
function readString(value: unknown): string {
|
|
@@ -115,13 +111,6 @@ function output(value: unknown): { readonly success: true; readonly output: stri
|
|
|
115
111
|
|
|
116
112
|
function error(message: string): { readonly success: false; readonly error: string } { return { success: false, error: message }; }
|
|
117
113
|
|
|
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
114
|
function commandMatches(command: SlashCommand, query: string): boolean {
|
|
126
115
|
if (!query) return true;
|
|
127
116
|
const haystack = [
|
|
@@ -514,115 +503,13 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
514
503
|
name: 'agent_harness',
|
|
515
504
|
description: [
|
|
516
505
|
'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.',
|
|
506
|
+
'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.',
|
|
507
|
+
'Discovery modes are read-only. Setting/keybinding writes, resets, UI routing, slash command invocation, and workspace action invocation require confirm:true plus explicitUserRequest.',
|
|
519
508
|
'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
509
|
].join(' '),
|
|
521
510
|
parameters: {
|
|
522
511
|
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
|
-
},
|
|
512
|
+
properties: AGENT_HARNESS_PARAMETER_PROPERTIES,
|
|
626
513
|
required: ['mode'],
|
|
627
514
|
additionalProperties: false,
|
|
628
515
|
},
|
|
@@ -638,6 +525,7 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
638
525
|
cliCommands: totalHarnessCliCommands(),
|
|
639
526
|
blockedCliCommandTokens: blockedHarnessCliCommandTokens(),
|
|
640
527
|
panels: totalHarnessPanels(deps.commandContext),
|
|
528
|
+
uiSurfaces: totalHarnessUiSurfaces(),
|
|
641
529
|
shortcuts: totalHarnessShortcuts(deps.commandContext),
|
|
642
530
|
keybindings: totalHarnessKeybindings(deps.commandContext),
|
|
643
531
|
commands: deps.commandRegistry.list().length,
|
|
@@ -648,6 +536,7 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
648
536
|
modelAccess: {
|
|
649
537
|
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
538
|
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.',
|
|
539
|
+
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
540
|
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
541
|
slashCommands: 'Use mode:"commands" and mode:"command" to inspect; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
|
|
653
542
|
workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" for editor schemas; set includeParameters:true on workspace_actions to inline editor schemas.',
|
|
@@ -690,6 +579,19 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
690
579
|
if (confirmationError) return error(confirmationError);
|
|
691
580
|
return output(openHarnessPanel(deps.commandContext, args));
|
|
692
581
|
}
|
|
582
|
+
if (args.mode === 'ui_surfaces') {
|
|
583
|
+
const surfaces = listHarnessUiSurfaces(deps.commandContext, args);
|
|
584
|
+
return output({ surfaces, returned: surfaces.length, total: totalHarnessUiSurfaces() });
|
|
585
|
+
}
|
|
586
|
+
if (args.mode === 'ui_surface') {
|
|
587
|
+
const surface = describeHarnessUiSurface(deps.commandContext, args);
|
|
588
|
+
return surface ? output(surface) : error(`Unknown UI surface ${readString(args.surfaceId || args.query) || '<missing>'}.`);
|
|
589
|
+
}
|
|
590
|
+
if (args.mode === 'open_ui_surface') {
|
|
591
|
+
const confirmationError = requireConfirmedAction(args, 'UI surface routing');
|
|
592
|
+
if (confirmationError) return error(confirmationError);
|
|
593
|
+
return output(openHarnessUiSurface(deps.commandContext, args));
|
|
594
|
+
}
|
|
693
595
|
if (args.mode === 'shortcuts') return output(listHarnessShortcuts(deps.commandContext, args));
|
|
694
596
|
if (args.mode === 'keybindings') return output(listHarnessKeybindings(deps.commandContext, args));
|
|
695
597
|
if (args.mode === 'keybinding') {
|