@pellux/goodvibes-agent 1.0.2 → 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 +7 -0
- package/README.md +2 -2
- package/dist/package/main.js +809 -346
- package/docs/README.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/tools-and-commands.md +6 -2
- package/package.json +1 -1
- package/src/cli/help.ts +26 -0
- package/src/tools/agent-harness-cli-metadata.ts +152 -0
- package/src/tools/agent-harness-metadata.ts +108 -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 +71 -47
- package/src/version.ts +1 -1
|
@@ -17,11 +17,12 @@ import type {
|
|
|
17
17
|
AgentWorkspaceRuntimeSnapshot,
|
|
18
18
|
} from '../input/agent-workspace-types.ts';
|
|
19
19
|
import { parseSlashCommand } from '../input/slash-command-parser.ts';
|
|
20
|
+
import { blockedHarnessCliCommandTokens, describeHarnessCliCommand, listHarnessCliCommands, totalHarnessCliCommands } from './agent-harness-cli-metadata.ts';
|
|
21
|
+
import { describeHarnessPanel, listHarnessPanels, openHarnessPanel, totalHarnessPanels } from './agent-harness-panel-metadata.ts';
|
|
20
22
|
import { describeLocalWorkspaceModelExecution, runLocalWorkspaceAction } from './agent-harness-local-operations.ts';
|
|
23
|
+
import { listHarnessModelTools } from './agent-harness-model-tool-catalog.ts';
|
|
21
24
|
import {
|
|
22
|
-
|
|
23
|
-
connectedHostCapabilityMap,
|
|
24
|
-
connectedHostRouteFamilies,
|
|
25
|
+
connectedHostSummary,
|
|
25
26
|
describeCommandPolicy,
|
|
26
27
|
settingsPolicySummary,
|
|
27
28
|
} from './agent-harness-metadata.ts';
|
|
@@ -32,10 +33,14 @@ import {
|
|
|
32
33
|
resetHarnessSetting,
|
|
33
34
|
setHarnessSetting,
|
|
34
35
|
} from '../agent/harness-control.ts';
|
|
35
|
-
import { resolveAgentConnectedHostConnection } from '../agent/routine-schedule-promotion.ts';
|
|
36
36
|
|
|
37
37
|
type AgentHarnessMode =
|
|
38
38
|
| 'summary'
|
|
39
|
+
| 'cli_commands'
|
|
40
|
+
| 'cli_command'
|
|
41
|
+
| 'panels'
|
|
42
|
+
| 'panel'
|
|
43
|
+
| 'open_panel'
|
|
39
44
|
| 'commands'
|
|
40
45
|
| 'command'
|
|
41
46
|
| 'run_command'
|
|
@@ -55,9 +60,11 @@ interface AgentHarnessToolArgs {
|
|
|
55
60
|
readonly mode?: unknown;
|
|
56
61
|
readonly query?: unknown;
|
|
57
62
|
readonly command?: unknown;
|
|
63
|
+
readonly cliCommand?: unknown;
|
|
58
64
|
readonly commandName?: unknown;
|
|
59
65
|
readonly args?: unknown;
|
|
60
66
|
readonly categoryId?: unknown;
|
|
67
|
+
readonly panelId?: unknown;
|
|
61
68
|
readonly actionId?: unknown;
|
|
62
69
|
readonly recordId?: unknown;
|
|
63
70
|
readonly fields?: unknown;
|
|
@@ -68,6 +75,7 @@ interface AgentHarnessToolArgs {
|
|
|
68
75
|
readonly includeHidden?: unknown;
|
|
69
76
|
readonly includeParameters?: unknown;
|
|
70
77
|
readonly limit?: unknown;
|
|
78
|
+
readonly pane?: unknown;
|
|
71
79
|
readonly confirm?: unknown;
|
|
72
80
|
readonly explicitUserRequest?: unknown;
|
|
73
81
|
}
|
|
@@ -85,6 +93,11 @@ interface WorkspaceEditorContext {
|
|
|
85
93
|
|
|
86
94
|
const MODES: readonly AgentHarnessMode[] = [
|
|
87
95
|
'summary',
|
|
96
|
+
'cli_commands',
|
|
97
|
+
'cli_command',
|
|
98
|
+
'panels',
|
|
99
|
+
'panel',
|
|
100
|
+
'open_panel',
|
|
88
101
|
'commands',
|
|
89
102
|
'command',
|
|
90
103
|
'run_command',
|
|
@@ -307,28 +320,6 @@ function listCommands(commandRegistry: CommandRegistry, args: AgentHarnessToolAr
|
|
|
307
320
|
.map(describeCommand);
|
|
308
321
|
}
|
|
309
322
|
|
|
310
|
-
function listTools(toolRegistry: ToolRegistry, args: AgentHarnessToolArgs): readonly Record<string, unknown>[] {
|
|
311
|
-
const query = readString(args.query).toLowerCase();
|
|
312
|
-
const includeParameters = args.includeParameters === true;
|
|
313
|
-
const limit = readLimit(args.limit, 200);
|
|
314
|
-
return toolRegistry.getToolDefinitions()
|
|
315
|
-
.filter((tool) => {
|
|
316
|
-
if (!query) return true;
|
|
317
|
-
return [tool.name, tool.description, ...(tool.sideEffects ?? [])].join('\n').toLowerCase().includes(query);
|
|
318
|
-
})
|
|
319
|
-
.sort((a, b) => a.name.localeCompare(b.name))
|
|
320
|
-
.slice(0, limit)
|
|
321
|
-
.map((tool) => ({
|
|
322
|
-
name: tool.name,
|
|
323
|
-
description: tool.description,
|
|
324
|
-
sideEffects: tool.sideEffects ?? [],
|
|
325
|
-
concurrency: tool.concurrency ?? 'parallel',
|
|
326
|
-
supportsProgress: tool.supportsProgress ?? false,
|
|
327
|
-
supportsStreamingOutput: tool.supportsStreamingOutput ?? false,
|
|
328
|
-
...(includeParameters ? { parameters: tool.parameters } : {}),
|
|
329
|
-
}));
|
|
330
|
-
}
|
|
331
|
-
|
|
332
323
|
function requireConfirmedAction(args: AgentHarnessToolArgs, action: string): string | null {
|
|
333
324
|
const explicitUserRequest = readString(args.explicitUserRequest);
|
|
334
325
|
if (!explicitUserRequest) return `${action} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
|
|
@@ -544,29 +535,13 @@ async function runWorkspaceAction(
|
|
|
544
535
|
});
|
|
545
536
|
}
|
|
546
537
|
|
|
547
|
-
function connectedHostSummary(context: CommandContext, toolRegistry: ToolRegistry): Record<string, unknown> {
|
|
548
|
-
const shellPaths = context.workspace.shellPaths;
|
|
549
|
-
const homeDirectory = shellPaths?.homeDirectory ?? context.platform.configManager.getHomeDirectory() ?? '';
|
|
550
|
-
const connection = resolveAgentConnectedHostConnection(context.platform.configManager, homeDirectory);
|
|
551
|
-
return {
|
|
552
|
-
baseUrl: connection.baseUrl,
|
|
553
|
-
operatorToken: connection.token ? 'configured' : 'missing',
|
|
554
|
-
tokenPath: connection.tokenPath,
|
|
555
|
-
ownership: 'external-connected-host',
|
|
556
|
-
lifecycle: 'GoodVibes Agent can use public connected-host operator routes, but does not start, stop, restart, install, expose, or mutate the host listener.',
|
|
557
|
-
routeFamilies: connectedHostRouteFamilies(),
|
|
558
|
-
capabilities: connectedHostCapabilityMap(toolRegistry),
|
|
559
|
-
blockedCapabilities: blockedConnectedHostCapabilities(),
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
|
|
563
538
|
export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
564
539
|
return {
|
|
565
540
|
definition: {
|
|
566
541
|
name: 'agent_harness',
|
|
567
542
|
description: [
|
|
568
543
|
'Discover and operate the GoodVibes Agent harness from the main conversation.',
|
|
569
|
-
'Use this tool to inspect Agent workspace actions, 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.',
|
|
544
|
+
'Use this tool to inspect Agent workspace actions, built-in panels, top-level CLI mirrors, 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.',
|
|
570
545
|
'Discovery modes are read-only. Setting writes, resets, slash command invocation, and workspace action invocation require confirm:true plus explicitUserRequest.',
|
|
571
546
|
'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.',
|
|
572
547
|
].join(' '),
|
|
@@ -584,11 +559,15 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
584
559
|
},
|
|
585
560
|
command: {
|
|
586
561
|
type: 'string',
|
|
587
|
-
description: 'Full slash command string for mode run_command, for example "/settings get provider.model".',
|
|
562
|
+
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".',
|
|
563
|
+
},
|
|
564
|
+
cliCommand: {
|
|
565
|
+
type: 'string',
|
|
566
|
+
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.',
|
|
588
567
|
},
|
|
589
568
|
commandName: {
|
|
590
569
|
type: 'string',
|
|
591
|
-
description: 'Slash command root without the leading slash for mode command or run_command.',
|
|
570
|
+
description: 'Slash command root without the leading slash for mode command or run_command, or a top-level CLI command token for cli_command.',
|
|
592
571
|
},
|
|
593
572
|
args: {
|
|
594
573
|
type: 'array',
|
|
@@ -599,6 +578,10 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
599
578
|
type: 'string',
|
|
600
579
|
description: 'Agent workspace category id for workspace action filtering.',
|
|
601
580
|
},
|
|
581
|
+
panelId: {
|
|
582
|
+
type: 'string',
|
|
583
|
+
description: 'Built-in panel id for panel or open_panel modes.',
|
|
584
|
+
},
|
|
602
585
|
actionId: {
|
|
603
586
|
type: 'string',
|
|
604
587
|
description: 'Agent workspace action id for workspace_action or run_workspace_action.',
|
|
@@ -644,9 +627,14 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
644
627
|
type: 'number',
|
|
645
628
|
description: 'Maximum catalog entries to return.',
|
|
646
629
|
},
|
|
630
|
+
pane: {
|
|
631
|
+
type: 'string',
|
|
632
|
+
enum: ['top', 'bottom'],
|
|
633
|
+
description: 'Preferred panel pane for open_panel when the current shell supports panel routing.',
|
|
634
|
+
},
|
|
647
635
|
confirm: {
|
|
648
636
|
type: 'boolean',
|
|
649
|
-
description: 'Required true for set_setting, reset_setting, run_command, and mutating run_workspace_action calls after an explicit user request.',
|
|
637
|
+
description: 'Required true for set_setting, reset_setting, run_command, open_panel, and mutating run_workspace_action calls after an explicit user request.',
|
|
650
638
|
},
|
|
651
639
|
explicitUserRequest: {
|
|
652
640
|
type: 'string',
|
|
@@ -665,12 +653,17 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
665
653
|
try {
|
|
666
654
|
if (args.mode === 'summary') {
|
|
667
655
|
return output({
|
|
656
|
+
cliCommands: totalHarnessCliCommands(),
|
|
657
|
+
blockedCliCommandTokens: blockedHarnessCliCommandTokens(),
|
|
658
|
+
panels: totalHarnessPanels(deps.commandContext),
|
|
668
659
|
commands: deps.commandRegistry.list().length,
|
|
669
660
|
settings: deps.commandContext.platform.configManager.getSchema().length,
|
|
670
661
|
workspaceCategories: AGENT_WORKSPACE_CATEGORIES.length,
|
|
671
662
|
workspaceActions: allWorkspaceActions().length,
|
|
672
663
|
tools: deps.toolRegistry.getToolDefinitions().length,
|
|
673
664
|
modelAccess: {
|
|
665
|
+
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.',
|
|
666
|
+
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.',
|
|
674
667
|
slashCommands: 'Use mode:"commands" and mode:"command" to inspect; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
|
|
675
668
|
workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" for editor schemas; set includeParameters:true on workspace_actions to inline editor schemas.',
|
|
676
669
|
settings: 'Use mode:"settings", mode:"get_setting", mode:"set_setting", and mode:"reset_setting".',
|
|
@@ -681,6 +674,37 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
681
674
|
connectedHost: connectedHostSummary(deps.commandContext, deps.toolRegistry),
|
|
682
675
|
});
|
|
683
676
|
}
|
|
677
|
+
if (args.mode === 'cli_commands') {
|
|
678
|
+
const commands = listHarnessCliCommands(args);
|
|
679
|
+
return output({
|
|
680
|
+
commands,
|
|
681
|
+
returned: commands.length,
|
|
682
|
+
total: totalHarnessCliCommands(),
|
|
683
|
+
blockedTokens: blockedHarnessCliCommandTokens(),
|
|
684
|
+
policy: 'CLI modes are read-only discovery. Use first-class model tools, workspace actions, settings modes, or confirmed slash-command mirrors for in-process operation.',
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
if (args.mode === 'cli_command') {
|
|
688
|
+
return output(describeHarnessCliCommand(args));
|
|
689
|
+
}
|
|
690
|
+
if (args.mode === 'panels') {
|
|
691
|
+
const panels = listHarnessPanels(deps.commandContext, args);
|
|
692
|
+
return output({
|
|
693
|
+
panels,
|
|
694
|
+
returned: panels.length,
|
|
695
|
+
total: totalHarnessPanels(deps.commandContext),
|
|
696
|
+
policy: 'Panel modes expose Agent/TUI operator view catalog and open state. open_panel is confirmation-gated and routes through the current Agent shell bridge.',
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
if (args.mode === 'panel') {
|
|
700
|
+
const panel = describeHarnessPanel(deps.commandContext, args);
|
|
701
|
+
return panel ? output(panel) : error(`Unknown panel ${readString(args.panelId || args.query) || '<missing>'}.`);
|
|
702
|
+
}
|
|
703
|
+
if (args.mode === 'open_panel') {
|
|
704
|
+
const confirmationError = requireConfirmedAction(args, 'Panel routing');
|
|
705
|
+
if (confirmationError) return error(confirmationError);
|
|
706
|
+
return output(openHarnessPanel(deps.commandContext, args));
|
|
707
|
+
}
|
|
684
708
|
if (args.mode === 'commands') {
|
|
685
709
|
const commands = listCommands(deps.commandRegistry, args);
|
|
686
710
|
return output({ commands, returned: commands.length, total: deps.commandRegistry.list().length });
|
|
@@ -749,7 +773,7 @@ export function createAgentHarnessTool(deps: AgentHarnessToolDeps): Tool {
|
|
|
749
773
|
}
|
|
750
774
|
if (args.mode === 'run_workspace_action') return runWorkspaceAction(deps, args);
|
|
751
775
|
if (args.mode === 'tools') {
|
|
752
|
-
const tools =
|
|
776
|
+
const tools = listHarnessModelTools(deps.toolRegistry, args);
|
|
753
777
|
return output({ tools, returned: tools.length, total: deps.toolRegistry.getToolDefinitions().length });
|
|
754
778
|
}
|
|
755
779
|
if (args.mode === 'connected_host') return output(connectedHostSummary(deps.commandContext, deps.toolRegistry));
|
package/src/version.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from 'node:path';
|
|
|
6
6
|
// The prebuild script updates the fallback value before compilation.
|
|
7
7
|
// Uses import.meta.dir (Bun) to locate package.json relative to this file,
|
|
8
8
|
// which is correct regardless of the process working directory.
|
|
9
|
-
let _version = '1.0.
|
|
9
|
+
let _version = '1.0.3';
|
|
10
10
|
let _sdkVersion = '0.33.35';
|
|
11
11
|
try {
|
|
12
12
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf-8')) as {
|