@pellux/goodvibes-agent 1.0.1 → 1.0.3
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 +14 -0
- package/README.md +8 -4
- package/dist/package/main.js +14321 -12304
- package/docs/README.md +4 -2
- package/docs/channels-remote-and-api.md +4 -0
- package/docs/connected-host.md +2 -0
- package/docs/getting-started.md +6 -2
- package/docs/knowledge-artifacts-and-multimodal.md +5 -3
- package/docs/project-planning.md +3 -1
- package/docs/providers-and-routing.md +3 -0
- package/docs/release-and-publishing.md +7 -6
- package/docs/tools-and-commands.md +101 -2
- package/docs/voice-and-live-tts.md +2 -0
- package/package.json +1 -1
- package/src/agent/harness-control.ts +266 -0
- package/src/cli/help.ts +26 -0
- package/src/config/agent-settings-policy.ts +44 -0
- package/src/input/agent-workspace-activation.ts +14 -6
- package/src/input/commands/operator-runtime.ts +139 -3
- package/src/input/settings-modal-agent-policy.ts +5 -44
- package/src/runtime/bootstrap.ts +3 -0
- package/src/tools/agent-harness-cli-metadata.ts +152 -0
- package/src/tools/agent-harness-local-operations.ts +233 -0
- package/src/tools/agent-harness-metadata.ts +408 -0
- package/src/tools/agent-harness-model-tool-catalog.ts +36 -0
- package/src/tools/agent-harness-panel-metadata.ts +121 -0
- package/src/tools/agent-harness-tool.ts +798 -0
- package/src/tools/agent-local-registry-requirements.ts +18 -0
- package/src/tools/agent-local-registry-tool.ts +88 -34
- package/src/version.ts +1 -1
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
2
|
+
import type { CommandContext } from '../input/command-registry.ts';
|
|
3
|
+
import { resolveAgentConnectedHostConnection } from '../agent/routine-schedule-promotion.ts';
|
|
4
|
+
|
|
5
|
+
export interface CommandExecutionPolicy {
|
|
6
|
+
readonly effect: 'read-only' | 'local-state' | 'connected-host-state' | 'external-network' | 'ui-navigation' | 'session-lifecycle' | 'delegated-work' | 'mixed' | 'unknown';
|
|
7
|
+
readonly confirmation: string;
|
|
8
|
+
readonly preferredModelTool?: string;
|
|
9
|
+
readonly boundary: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function describeCommandPolicy(commandName: string): CommandExecutionPolicy {
|
|
13
|
+
const root = commandName.replace(/^\//, '').trim().toLowerCase();
|
|
14
|
+
const confirmation = 'agent_harness mode:"run_command" requires confirm:true and explicitUserRequest for every slash command invocation.';
|
|
15
|
+
if (
|
|
16
|
+
root === 'memory'
|
|
17
|
+
|| root === 'memories'
|
|
18
|
+
|| root === 'note'
|
|
19
|
+
|| root === 'notes'
|
|
20
|
+
|| root === 'persona'
|
|
21
|
+
|| root === 'personas'
|
|
22
|
+
|| root === 'skill'
|
|
23
|
+
|| root === 'skills'
|
|
24
|
+
|| root === 'routine'
|
|
25
|
+
|| root === 'routines'
|
|
26
|
+
) {
|
|
27
|
+
return {
|
|
28
|
+
effect: 'local-state',
|
|
29
|
+
confirmation,
|
|
30
|
+
preferredModelTool: 'agent_local_registry',
|
|
31
|
+
boundary: 'Agent-local library records only unless the invoked command explicitly promotes to a connected schedule or Agent Knowledge source.',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (root === 'knowledge') {
|
|
35
|
+
return {
|
|
36
|
+
effect: 'mixed',
|
|
37
|
+
confirmation,
|
|
38
|
+
preferredModelTool: 'agent_knowledge or agent_knowledge_ingest',
|
|
39
|
+
boundary: 'Agent Knowledge only. Do not use default knowledge or non-Agent knowledge spaces.',
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (root === 'settings') {
|
|
43
|
+
return {
|
|
44
|
+
effect: 'mixed',
|
|
45
|
+
confirmation,
|
|
46
|
+
preferredModelTool: 'agent_harness settings/get_setting/set_setting/reset_setting',
|
|
47
|
+
boundary: 'Model-writable settings can be changed through agent_harness. Connected-host lifecycle/listener settings remain read-only.',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if (root === 'approval' || root === 'approvals' || root === 'automation') {
|
|
51
|
+
return {
|
|
52
|
+
effect: 'connected-host-state',
|
|
53
|
+
confirmation,
|
|
54
|
+
preferredModelTool: 'agent_operator_action',
|
|
55
|
+
boundary: 'Only explicit allowlisted approval and automation operator actions should be performed from the model.',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (root === 'schedule' || root === 'remind' || root === 'reminder') {
|
|
59
|
+
return {
|
|
60
|
+
effect: 'connected-host-state',
|
|
61
|
+
confirmation,
|
|
62
|
+
preferredModelTool: 'agent_reminder_schedule or agent_operator_action',
|
|
63
|
+
boundary: 'Connected schedules require an explicit user request and do not create hidden Agent jobs or local schedulers.',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (root === 'channels' || root === 'channel' || root === 'notify') {
|
|
67
|
+
return {
|
|
68
|
+
effect: 'external-network',
|
|
69
|
+
confirmation,
|
|
70
|
+
preferredModelTool: root === 'notify' ? 'agent_notify' : 'agent_channel_send',
|
|
71
|
+
boundary: 'External delivery requires an explicit target and direct user authorization.',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (root === 'media' || root === 'image') {
|
|
75
|
+
return {
|
|
76
|
+
effect: 'external-network',
|
|
77
|
+
confirmation,
|
|
78
|
+
preferredModelTool: 'agent_media_generate',
|
|
79
|
+
boundary: 'Media generation uses configured Agent media providers and writes normal artifacts only.',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (root === 'workplan' || root === 'plan' || root === 'task' || root === 'tasks') {
|
|
83
|
+
return {
|
|
84
|
+
effect: 'local-state',
|
|
85
|
+
confirmation,
|
|
86
|
+
preferredModelTool: 'agent_work_plan',
|
|
87
|
+
boundary: 'Work planning stays in the current Agent/project planning surfaces unless the command explicitly calls connected-host operator routes.',
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (root === 'delegate') {
|
|
91
|
+
return {
|
|
92
|
+
effect: 'delegated-work',
|
|
93
|
+
confirmation,
|
|
94
|
+
boundary: 'Delegation is explicit user-directed work only; no hidden background review or separate Agent job should be created implicitly.',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (root === 'session' || root === 'conversation' || root === 'clear' || root === 'quit' || root === 'exit') {
|
|
98
|
+
return {
|
|
99
|
+
effect: 'session-lifecycle',
|
|
100
|
+
confirmation,
|
|
101
|
+
boundary: 'Session and conversation commands operate on the visible harness session lifecycle.',
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
if (root === 'agent-workspace' || root === 'workspace' || root === 'help' || root === 'shortcuts') {
|
|
105
|
+
return {
|
|
106
|
+
effect: 'ui-navigation',
|
|
107
|
+
confirmation,
|
|
108
|
+
preferredModelTool: 'agent_harness workspace/workspace_actions/workspace_action',
|
|
109
|
+
boundary: 'Navigation and discovery commands should be inspected through agent_harness when possible.',
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (
|
|
113
|
+
root === 'profile'
|
|
114
|
+
|| root === 'agent-profile'
|
|
115
|
+
|| root === 'provider'
|
|
116
|
+
|| root === 'providers'
|
|
117
|
+
|| root === 'auth'
|
|
118
|
+
|| root === 'secret'
|
|
119
|
+
|| root === 'secrets'
|
|
120
|
+
|| root === 'mcp'
|
|
121
|
+
|| root === 'voice'
|
|
122
|
+
|| root === 'subscription'
|
|
123
|
+
) {
|
|
124
|
+
return {
|
|
125
|
+
effect: 'mixed',
|
|
126
|
+
confirmation,
|
|
127
|
+
boundary: 'Harness-owned configuration, auth, provider, MCP, and profile commands are available through the command bridge with explicit confirmation.',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
effect: 'unknown',
|
|
132
|
+
confirmation,
|
|
133
|
+
boundary: 'Inspect the command description, usage, and workspace action metadata before invoking through run_command.',
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function describeCliCommandPolicy(commandName: string): CommandExecutionPolicy {
|
|
138
|
+
const root = commandName.trim().toLowerCase();
|
|
139
|
+
const confirmation = 'agent_harness CLI command modes are discovery-only. Use first-class model tools, workspace actions, slash-command mirrors, or an explicit external shell request to execute equivalent CLI workflows.';
|
|
140
|
+
if ([
|
|
141
|
+
'app',
|
|
142
|
+
'bridge',
|
|
143
|
+
'control-plane',
|
|
144
|
+
'controlplane',
|
|
145
|
+
'cp',
|
|
146
|
+
'daemon',
|
|
147
|
+
'http-listener',
|
|
148
|
+
'launch',
|
|
149
|
+
'listener',
|
|
150
|
+
'remote',
|
|
151
|
+
'serve',
|
|
152
|
+
'server',
|
|
153
|
+
'service',
|
|
154
|
+
'services',
|
|
155
|
+
'start',
|
|
156
|
+
'surface',
|
|
157
|
+
'surfaces',
|
|
158
|
+
'web',
|
|
159
|
+
'webhook',
|
|
160
|
+
].includes(root)) {
|
|
161
|
+
return {
|
|
162
|
+
effect: 'unknown',
|
|
163
|
+
confirmation,
|
|
164
|
+
boundary: 'Blocked package CLI token. Agent can launch its own TUI and use public connected-host routes, but it does not manage connected-host lifecycle, listeners, servers, bridges, remotes, web surfaces, or webhook listeners.',
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
if (root === 'tui' || root === 'onboarding' || root === 'help' || root === 'version' || root === 'completion') {
|
|
168
|
+
return {
|
|
169
|
+
effect: root === 'tui' || root === 'onboarding' ? 'ui-navigation' : 'read-only',
|
|
170
|
+
confirmation,
|
|
171
|
+
preferredModelTool: root === 'onboarding' || root === 'tui' ? 'agent_harness workspace/workspace_actions' : 'agent_harness cli_commands/cli_command',
|
|
172
|
+
boundary: 'Top-level CLI launch, setup, help, version, and completion commands are package entrypoint surfaces; use in-process workspace and slash-command bridges from the model when operating inside the TUI.',
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (root === 'run') {
|
|
176
|
+
return {
|
|
177
|
+
effect: 'mixed',
|
|
178
|
+
confirmation,
|
|
179
|
+
boundary: 'The CLI run command starts a non-interactive Agent turn from a process entrypoint. Do not create hidden nested turns from agent_harness; answer the user directly in the current conversation.',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (root === 'status' || root === 'doctor' || root === 'auth' || root === 'compat' || root === 'models' || root === 'providers' || root === 'tasks') {
|
|
183
|
+
return {
|
|
184
|
+
effect: 'read-only',
|
|
185
|
+
confirmation,
|
|
186
|
+
preferredModelTool: root === 'tasks' ? 'agent_operator_briefing' : 'agent_harness connected_host/settings/tools',
|
|
187
|
+
boundary: 'Diagnostics and posture commands are readable from Agent-owned settings, provider, model, and connected-host capability surfaces without taking connected-host lifecycle ownership.',
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
if (root === 'profiles' || root === 'personas' || root === 'skills' || root === 'memory' || root === 'routines' || root === 'sessions' || root === 'bundle') {
|
|
191
|
+
return {
|
|
192
|
+
effect: 'local-state',
|
|
193
|
+
confirmation,
|
|
194
|
+
preferredModelTool: root === 'profiles' ? 'agent_harness workspace_actions/run_workspace_action' : 'agent_local_registry',
|
|
195
|
+
boundary: 'Local library/profile/session/bundle CLI commands operate on Agent-local data. Mutations require explicit user intent and should use first-class Agent-local tools where available.',
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
if (root === 'knowledge' || root === 'ask' || root === 'search') {
|
|
199
|
+
return {
|
|
200
|
+
effect: 'mixed',
|
|
201
|
+
confirmation,
|
|
202
|
+
preferredModelTool: root === 'knowledge' ? 'agent_knowledge or agent_knowledge_ingest' : 'agent_knowledge',
|
|
203
|
+
boundary: 'Agent Knowledge CLI commands must stay on isolated Agent Knowledge routes and never fall back to default or non-Agent knowledge spaces.',
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
if (root === 'delegate') {
|
|
207
|
+
return {
|
|
208
|
+
effect: 'delegated-work',
|
|
209
|
+
confirmation,
|
|
210
|
+
boundary: 'Delegation is explicit user-directed work only; no hidden background review or separate Agent job should be created implicitly.',
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
if (root === 'subscription' || root === 'secrets' || root === 'pair') {
|
|
214
|
+
return {
|
|
215
|
+
effect: root === 'pair' ? 'external-network' : 'mixed',
|
|
216
|
+
confirmation,
|
|
217
|
+
boundary: 'Provider subscription, secret, and pairing flows can expose credentials or external account state. Use only explicit user-directed flows and prefer secret refs over raw values.',
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
effect: 'unknown',
|
|
222
|
+
confirmation,
|
|
223
|
+
boundary: 'Inspect the CLI help, parser result, and preferred model routes before using an equivalent command path.',
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function toolIsAvailable(toolRegistry: ToolRegistry, toolName: string): boolean {
|
|
228
|
+
return toolRegistry.getToolDefinitions().some((tool) => tool.name === toolName);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function connectedHostCapabilityMap(toolRegistry: ToolRegistry): readonly Record<string, unknown>[] {
|
|
232
|
+
const withAvailability = (capability: Record<string, unknown> & { readonly modelTools: readonly string[] }): Record<string, unknown> => ({
|
|
233
|
+
...capability,
|
|
234
|
+
available: capability.modelTools.every((toolName) => toolIsAvailable(toolRegistry, toolName)),
|
|
235
|
+
});
|
|
236
|
+
return [
|
|
237
|
+
withAvailability({
|
|
238
|
+
id: 'operator-briefing',
|
|
239
|
+
effect: 'read-only-network',
|
|
240
|
+
modelTools: ['agent_operator_briefing'],
|
|
241
|
+
workspaceCategories: ['home', 'work', 'host', 'automation'],
|
|
242
|
+
slashCommandFamilies: ['approval', 'automation', 'schedule'],
|
|
243
|
+
purpose: 'Read pending work, approvals, automation, schedules, and scheduler capacity from public operator routes.',
|
|
244
|
+
}),
|
|
245
|
+
withAvailability({
|
|
246
|
+
id: 'operator-actions',
|
|
247
|
+
effect: 'confirmed-connected-host-state',
|
|
248
|
+
modelTools: ['agent_operator_action'],
|
|
249
|
+
workspaceCategories: ['automation', 'host'],
|
|
250
|
+
allowedActions: [
|
|
251
|
+
'approvals.approve',
|
|
252
|
+
'approvals.deny',
|
|
253
|
+
'approvals.cancel',
|
|
254
|
+
'automation.jobs.run',
|
|
255
|
+
'automation.jobs.pause',
|
|
256
|
+
'automation.jobs.resume',
|
|
257
|
+
'automation.runs.cancel',
|
|
258
|
+
'automation.runs.retry',
|
|
259
|
+
'schedules.run',
|
|
260
|
+
],
|
|
261
|
+
purpose: 'Perform one explicit allowlisted approval, automation, run, or schedule action.',
|
|
262
|
+
}),
|
|
263
|
+
withAvailability({
|
|
264
|
+
id: 'agent-knowledge-read',
|
|
265
|
+
effect: 'read-only-network',
|
|
266
|
+
modelTools: ['agent_knowledge'],
|
|
267
|
+
workspaceCategories: ['knowledge', 'research'],
|
|
268
|
+
slashCommandFamilies: ['knowledge'],
|
|
269
|
+
allowedActions: ['status', 'ask', 'search'],
|
|
270
|
+
purpose: 'Read only isolated Agent Knowledge through the Agent route family.',
|
|
271
|
+
}),
|
|
272
|
+
withAvailability({
|
|
273
|
+
id: 'agent-knowledge-ingest',
|
|
274
|
+
effect: 'confirmed-agent-knowledge-write',
|
|
275
|
+
modelTools: ['agent_knowledge_ingest'],
|
|
276
|
+
workspaceCategories: ['knowledge', 'research'],
|
|
277
|
+
slashCommandFamilies: ['knowledge'],
|
|
278
|
+
sourceKinds: ['url', 'file', 'urls_file', 'bookmarks_file', 'browser_history', 'connector'],
|
|
279
|
+
purpose: 'Ingest explicit user-approved sources into isolated Agent Knowledge.',
|
|
280
|
+
}),
|
|
281
|
+
withAvailability({
|
|
282
|
+
id: 'channels',
|
|
283
|
+
effect: 'confirmed-external-delivery',
|
|
284
|
+
modelTools: ['agent_channel_send'],
|
|
285
|
+
workspaceCategories: ['channels'],
|
|
286
|
+
slashCommandFamilies: ['channels', 'channel'],
|
|
287
|
+
targetKinds: ['channel', 'route', 'webhook', 'link'],
|
|
288
|
+
purpose: 'Send one explicit message through a configured Agent delivery target.',
|
|
289
|
+
}),
|
|
290
|
+
withAvailability({
|
|
291
|
+
id: 'notifications',
|
|
292
|
+
effect: 'confirmed-external-delivery',
|
|
293
|
+
modelTools: ['agent_notify'],
|
|
294
|
+
workspaceCategories: ['channels'],
|
|
295
|
+
slashCommandFamilies: ['notify'],
|
|
296
|
+
purpose: 'Send one explicit notification using configured notification routes.',
|
|
297
|
+
}),
|
|
298
|
+
withAvailability({
|
|
299
|
+
id: 'reminders-and-schedules',
|
|
300
|
+
effect: 'confirmed-connected-host-state',
|
|
301
|
+
modelTools: ['agent_reminder_schedule'],
|
|
302
|
+
workspaceCategories: ['automation', 'routines'],
|
|
303
|
+
slashCommandFamilies: ['schedule', 'reminder'],
|
|
304
|
+
scheduleKinds: ['at', 'every', 'cron'],
|
|
305
|
+
purpose: 'Create one connected reminder schedule from a direct user request.',
|
|
306
|
+
}),
|
|
307
|
+
withAvailability({
|
|
308
|
+
id: 'voice-media',
|
|
309
|
+
effect: 'provider-network-and-artifacts',
|
|
310
|
+
modelTools: ['agent_media_generate'],
|
|
311
|
+
workspaceCategories: ['voice-media', 'artifacts'],
|
|
312
|
+
slashCommandFamilies: ['media', 'image'],
|
|
313
|
+
purpose: 'Generate media through configured Agent media providers and normal artifact storage.',
|
|
314
|
+
}),
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function connectedHostRouteFamilies(): readonly Record<string, unknown>[] {
|
|
319
|
+
return [
|
|
320
|
+
{
|
|
321
|
+
id: 'agent-knowledge',
|
|
322
|
+
prefixes: ['/api/goodvibes-agent/knowledge/*'],
|
|
323
|
+
modelTools: ['agent_knowledge', 'agent_knowledge_ingest'],
|
|
324
|
+
boundary: 'Agent-owned knowledge segment only; no fallback to default or non-Agent knowledge.',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: 'operator-read',
|
|
328
|
+
routes: [
|
|
329
|
+
'/api/projects/planning/work-plan',
|
|
330
|
+
'/api/approvals',
|
|
331
|
+
'/api/automation',
|
|
332
|
+
'/api/automation/schedules',
|
|
333
|
+
'/api/runtime/scheduler',
|
|
334
|
+
],
|
|
335
|
+
modelTools: ['agent_operator_briefing'],
|
|
336
|
+
boundary: 'Read-only public operator briefing routes.',
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
id: 'operator-actions',
|
|
340
|
+
routes: ['public operator action methods for approvals, automation jobs, automation runs, and schedules'],
|
|
341
|
+
modelTools: ['agent_operator_action'],
|
|
342
|
+
boundary: 'Allowlisted confirmed mutations only; no arbitrary route invocation.',
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
id: 'delivery',
|
|
346
|
+
routes: ['configured channel, notification, and delivery targets'],
|
|
347
|
+
modelTools: ['agent_channel_send', 'agent_notify'],
|
|
348
|
+
boundary: 'Explicit user-approved delivery only; no route/account creation.',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: 'connected-schedules',
|
|
352
|
+
routes: ['public schedule creation/run routes'],
|
|
353
|
+
modelTools: ['agent_reminder_schedule', 'agent_operator_action'],
|
|
354
|
+
boundary: 'Connected schedules only; no hidden local scheduler or separate Agent job.',
|
|
355
|
+
},
|
|
356
|
+
];
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export function connectedHostSummary(context: CommandContext, toolRegistry: ToolRegistry): Record<string, unknown> {
|
|
360
|
+
const shellPaths = context.workspace.shellPaths;
|
|
361
|
+
const homeDirectory = shellPaths?.homeDirectory ?? context.platform.configManager.getHomeDirectory() ?? '';
|
|
362
|
+
const connection = resolveAgentConnectedHostConnection(context.platform.configManager, homeDirectory);
|
|
363
|
+
return {
|
|
364
|
+
baseUrl: connection.baseUrl,
|
|
365
|
+
operatorToken: connection.token ? 'configured' : 'missing',
|
|
366
|
+
tokenPath: connection.tokenPath,
|
|
367
|
+
ownership: 'external-connected-host',
|
|
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
|
+
routeFamilies: connectedHostRouteFamilies(),
|
|
370
|
+
capabilities: connectedHostCapabilityMap(toolRegistry),
|
|
371
|
+
blockedCapabilities: blockedConnectedHostCapabilities(),
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export function blockedConnectedHostCapabilities(): readonly Record<string, unknown>[] {
|
|
376
|
+
return [
|
|
377
|
+
{
|
|
378
|
+
id: 'connected-host-lifecycle',
|
|
379
|
+
blocked: ['start', 'stop', 'restart', 'install', 'upgrade', 'expose-listener', 'mutate-listener'],
|
|
380
|
+
reason: 'The connected host and listener are externally owned by GoodVibes; Agent can use public operator routes but not manage hosting.',
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
id: 'non-agent-knowledge',
|
|
384
|
+
blocked: ['default-knowledge', 'non-agent-knowledge-segments', 'fallback-knowledge'],
|
|
385
|
+
reason: 'Agent model tools must stay inside the isolated Agent Knowledge route family.',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: 'hidden-background-work',
|
|
389
|
+
blocked: ['separate-agent-jobs', 'implicit-delegated-review', 'local-schedulers'],
|
|
390
|
+
reason: 'All model work is serial and visible unless the user explicitly requests delegation through an exposed surface.',
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
id: 'arbitrary-connected-host-mutations',
|
|
394
|
+
blocked: ['route-discovery-mutation', 'account-creation', 'automation-definition-creation'],
|
|
395
|
+
reason: 'Only the documented allowlisted model tools and slash-command bridges are exposed.',
|
|
396
|
+
},
|
|
397
|
+
];
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export function settingsPolicySummary(): Record<string, unknown> {
|
|
401
|
+
return {
|
|
402
|
+
discovery: 'Use mode:"settings" for the setting catalog and mode:"get_setting" for one key. Hidden/scriptable settings require includeHidden:true.',
|
|
403
|
+
mutation: 'Use mode:"set_setting" or mode:"reset_setting" with confirm:true and explicitUserRequest.',
|
|
404
|
+
secretHandling: 'Raw secret values are persisted through the secret manager; config receives only a secret reference and tool output is redacted.',
|
|
405
|
+
writablePolicy: 'Each setting descriptor includes writable, visibleInWorkspace, and lockReason when applicable.',
|
|
406
|
+
readOnlyHostOwnedPrefixes: ['service.*', 'controlPlane.*', 'httpListener.*', 'web.*', 'danger.daemon.*', 'danger.httpListener.*'],
|
|
407
|
+
};
|
|
408
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
2
|
+
|
|
3
|
+
export interface AgentHarnessModelToolCatalogArgs {
|
|
4
|
+
readonly query?: unknown;
|
|
5
|
+
readonly includeParameters?: unknown;
|
|
6
|
+
readonly limit?: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function readString(value: unknown): string {
|
|
10
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function readLimit(value: unknown, fallback: number): number {
|
|
14
|
+
const parsed = typeof value === 'string' && value.trim() ? Number(value) : value;
|
|
15
|
+
if (typeof parsed !== 'number' || !Number.isFinite(parsed)) return fallback;
|
|
16
|
+
return Math.max(1, Math.min(500, Math.trunc(parsed)));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function listHarnessModelTools(toolRegistry: ToolRegistry, args: AgentHarnessModelToolCatalogArgs): readonly Record<string, unknown>[] {
|
|
20
|
+
const query = readString(args.query).toLowerCase();
|
|
21
|
+
const includeParameters = args.includeParameters === true;
|
|
22
|
+
const limit = readLimit(args.limit, 200);
|
|
23
|
+
return toolRegistry.getToolDefinitions()
|
|
24
|
+
.filter((tool) => !query || [tool.name, tool.description, ...(tool.sideEffects ?? [])].join('\n').toLowerCase().includes(query))
|
|
25
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
26
|
+
.slice(0, limit)
|
|
27
|
+
.map((tool) => ({
|
|
28
|
+
name: tool.name,
|
|
29
|
+
description: tool.description,
|
|
30
|
+
sideEffects: tool.sideEffects ?? [],
|
|
31
|
+
concurrency: tool.concurrency ?? 'parallel',
|
|
32
|
+
supportsProgress: tool.supportsProgress ?? false,
|
|
33
|
+
supportsStreamingOutput: tool.supportsStreamingOutput ?? false,
|
|
34
|
+
...(includeParameters ? { parameters: tool.parameters } : {}),
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { CommandContext } from '../input/command-registry.ts';
|
|
2
|
+
import { agentWorkspaceCategoryForPanel, agentWorkspaceCommandForPanel } from '../input/agent-workspace-panel-route.ts';
|
|
3
|
+
import type { PanelRegistration } from '../panels/types.ts';
|
|
4
|
+
|
|
5
|
+
export interface AgentHarnessPanelArgs {
|
|
6
|
+
readonly query?: unknown;
|
|
7
|
+
readonly panelId?: unknown;
|
|
8
|
+
readonly category?: unknown;
|
|
9
|
+
readonly limit?: unknown;
|
|
10
|
+
readonly pane?: unknown;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function readString(value: unknown): string {
|
|
14
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function readLimit(value: unknown, fallback: number): number {
|
|
18
|
+
const parsed = typeof value === 'string' && value.trim() ? Number(value) : value;
|
|
19
|
+
if (typeof parsed !== 'number' || !Number.isFinite(parsed)) return fallback;
|
|
20
|
+
return Math.max(1, Math.min(500, Math.trunc(parsed)));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function panelManager(context: CommandContext) {
|
|
24
|
+
return context.workspace.panelManager ?? null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function panelMatches(panel: Record<string, unknown>, query: string): boolean {
|
|
28
|
+
if (!query) return true;
|
|
29
|
+
return [
|
|
30
|
+
panel.id,
|
|
31
|
+
panel.name,
|
|
32
|
+
panel.category,
|
|
33
|
+
panel.description,
|
|
34
|
+
panel.workspaceRoute,
|
|
35
|
+
].map((value) => String(value ?? '')).join('\n').toLowerCase().includes(query.toLowerCase());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function describePanelRegistration(context: CommandContext, registration: PanelRegistration): Record<string, unknown> {
|
|
39
|
+
const manager = panelManager(context);
|
|
40
|
+
const openPanel = manager?.getPanel(registration.id) ?? null;
|
|
41
|
+
const pane = manager?.getPaneOf(registration.id) ?? null;
|
|
42
|
+
const activePanel = manager?.getActivePanel() ?? null;
|
|
43
|
+
return {
|
|
44
|
+
id: registration.id,
|
|
45
|
+
name: registration.name,
|
|
46
|
+
icon: registration.icon,
|
|
47
|
+
category: registration.category,
|
|
48
|
+
description: registration.description,
|
|
49
|
+
preload: registration.preload === true,
|
|
50
|
+
open: openPanel !== null,
|
|
51
|
+
pane,
|
|
52
|
+
active: activePanel?.id === registration.id,
|
|
53
|
+
focused: activePanel?.id === registration.id,
|
|
54
|
+
workspaceRoute: {
|
|
55
|
+
categoryId: agentWorkspaceCategoryForPanel(registration.id),
|
|
56
|
+
command: agentWorkspaceCommandForPanel(registration.id),
|
|
57
|
+
},
|
|
58
|
+
policy: {
|
|
59
|
+
effect: 'ui-navigation',
|
|
60
|
+
confirmation: 'agent_harness mode:"open_panel" requires confirm:true and explicitUserRequest.',
|
|
61
|
+
boundary: 'Panels are Agent/TUI operator views. The model can inspect panel catalog/open state; panel routing uses the existing Agent workspace bridge and does not mutate connected-host lifecycle.',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function totalHarnessPanels(context: CommandContext): number {
|
|
67
|
+
return panelManager(context)?.getRegisteredTypes().length ?? 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function listHarnessPanels(context: CommandContext, args: AgentHarnessPanelArgs): readonly Record<string, unknown>[] {
|
|
71
|
+
const manager = panelManager(context);
|
|
72
|
+
if (!manager) return [];
|
|
73
|
+
const query = readString(args.query);
|
|
74
|
+
const category = readString(args.category);
|
|
75
|
+
const limit = readLimit(args.limit, 200);
|
|
76
|
+
return manager.getRegisteredTypes()
|
|
77
|
+
.map((registration) => describePanelRegistration(context, registration))
|
|
78
|
+
.filter((panel) => !category || panel.category === category)
|
|
79
|
+
.filter((panel) => panelMatches(panel, query))
|
|
80
|
+
.sort((a, b) => String(a.id).localeCompare(String(b.id)))
|
|
81
|
+
.slice(0, limit);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function describeHarnessPanel(context: CommandContext, args: AgentHarnessPanelArgs): Record<string, unknown> | null {
|
|
85
|
+
const manager = panelManager(context);
|
|
86
|
+
if (!manager) return null;
|
|
87
|
+
const panelId = readString(args.panelId || args.query);
|
|
88
|
+
if (!panelId) return null;
|
|
89
|
+
const registration = manager.getRegisteredTypes().find((panel) => (
|
|
90
|
+
panel.id === panelId
|
|
91
|
+
|| panel.name.toLowerCase() === panelId.toLowerCase()
|
|
92
|
+
));
|
|
93
|
+
return registration ? describePanelRegistration(context, registration) : null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function openHarnessPanel(context: CommandContext, args: AgentHarnessPanelArgs): Record<string, unknown> {
|
|
97
|
+
const panel = describeHarnessPanel(context, args);
|
|
98
|
+
if (!panel) {
|
|
99
|
+
return {
|
|
100
|
+
status: 'unknown_panel',
|
|
101
|
+
panelId: readString(args.panelId || args.query) || '<missing>',
|
|
102
|
+
availablePanels: listHarnessPanels(context, { limit: 50 }).map((entry) => entry.id),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const requestedPane = readString(args.pane);
|
|
106
|
+
const pane = requestedPane === 'bottom' || requestedPane === 'top' ? requestedPane : undefined;
|
|
107
|
+
if (!context.showPanel) {
|
|
108
|
+
return {
|
|
109
|
+
status: 'route_unavailable',
|
|
110
|
+
panel,
|
|
111
|
+
note: 'The current runtime did not provide showPanel. Use the returned workspaceRoute from the TUI.',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
context.showPanel(String(panel.id), pane);
|
|
115
|
+
return {
|
|
116
|
+
status: 'routed',
|
|
117
|
+
panel,
|
|
118
|
+
pane: pane ?? 'default',
|
|
119
|
+
note: 'Panel routing was handed to the current Agent shell bridge.',
|
|
120
|
+
};
|
|
121
|
+
}
|