@pellux/goodvibes-agent 1.1.6 → 1.2.0

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.
Files changed (256) hide show
  1. package/CHANGELOG.md +176 -0
  2. package/README.md +46 -30
  3. package/dist/package/{ast-grep-napi.linux-x64-gnu-mkk8xwww.node → ast-grep-napi.linux-x64-gnu-swtppvy9.node} +0 -0
  4. package/dist/package/{ast-grep-napi.linux-x64-musl-ryqtgdv6.node → ast-grep-napi.linux-x64-musl-ttfcdtap.node} +0 -0
  5. package/dist/package/main.js +132662 -91399
  6. package/docs/README.md +14 -7
  7. package/docs/channels-remote-and-api.md +8 -5
  8. package/docs/connected-host.md +14 -12
  9. package/docs/getting-started.md +56 -30
  10. package/docs/knowledge-artifacts-and-multimodal.md +7 -5
  11. package/docs/project-planning.md +2 -2
  12. package/docs/providers-and-routing.md +11 -3
  13. package/docs/tools-and-commands.md +114 -45
  14. package/docs/voice-and-live-tts.md +3 -1
  15. package/package.json +3 -2
  16. package/release/release-notes.md +130 -5
  17. package/release/release-readiness.json +120 -90
  18. package/src/agent/assistant-cockpit.ts +247 -0
  19. package/src/agent/autonomy-schedule-format.ts +96 -0
  20. package/src/agent/autonomy-schedule.ts +514 -0
  21. package/src/agent/channel-delivery-receipts.ts +292 -0
  22. package/src/agent/competitive-feature-inventory.ts +296 -0
  23. package/src/agent/document-registry-types.ts +106 -0
  24. package/src/agent/document-registry.ts +734 -0
  25. package/src/agent/harness-control.ts +2 -2
  26. package/src/agent/memory-prompt.ts +2 -2
  27. package/src/agent/operator-actions.ts +50 -6
  28. package/src/agent/persona-registry.ts +8 -0
  29. package/src/agent/project-context-files.ts +273 -0
  30. package/src/agent/prompt-context-receipts.ts +502 -0
  31. package/src/agent/reminder-schedule-format.ts +16 -2
  32. package/src/agent/research-run-registry.ts +582 -0
  33. package/src/agent/research-source-registry.ts +441 -0
  34. package/src/agent/routine-registry.ts +19 -3
  35. package/src/agent/routine-schedule-format.ts +27 -2
  36. package/src/agent/runtime-profile-starters.ts +7 -0
  37. package/src/agent/runtime-profile.ts +106 -4
  38. package/src/agent/schedule-edit-format.ts +129 -0
  39. package/src/agent/schedule-edit.ts +496 -0
  40. package/src/agent/schedule-next-routes.ts +42 -0
  41. package/src/agent/setup-wizard-checkpoint.ts +140 -0
  42. package/src/agent/setup-wizard.ts +447 -0
  43. package/src/agent/skill-registry-types.ts +102 -0
  44. package/src/agent/skill-registry.ts +81 -107
  45. package/src/agent/vibe-confirmation-routes.ts +62 -0
  46. package/src/agent/vibe-file.ts +285 -0
  47. package/src/cli/agent-knowledge-command.ts +45 -2
  48. package/src/cli/help.ts +3 -0
  49. package/src/cli/profiles-command.ts +25 -11
  50. package/src/config/agent-settings-policy.ts +1 -18
  51. package/src/input/agent-workspace-activation.ts +53 -0
  52. package/src/input/agent-workspace-artifact-browser-editor.ts +494 -0
  53. package/src/input/agent-workspace-artifact-metadata.ts +17 -0
  54. package/src/input/agent-workspace-basic-command-editors.ts +5 -1
  55. package/src/input/agent-workspace-categories.ts +153 -155
  56. package/src/input/agent-workspace-channel-triage.ts +481 -0
  57. package/src/input/agent-workspace-channels.ts +263 -0
  58. package/src/input/agent-workspace-command-editor.ts +152 -0
  59. package/src/input/agent-workspace-context-snapshot.ts +349 -0
  60. package/src/input/agent-workspace-delegation-editor-submission.ts +8 -0
  61. package/src/input/agent-workspace-document-editor.ts +502 -0
  62. package/src/input/agent-workspace-document-ops-editor.ts +523 -0
  63. package/src/input/agent-workspace-host-category.ts +1 -1
  64. package/src/input/agent-workspace-local-library-snapshot.ts +167 -0
  65. package/src/input/agent-workspace-model-compare-editor.ts +376 -0
  66. package/src/input/agent-workspace-model-compare-prompt-submission.ts +552 -0
  67. package/src/input/agent-workspace-model-compare-types.ts +82 -0
  68. package/src/input/agent-workspace-model-compare-utils.ts +35 -0
  69. package/src/input/agent-workspace-onboarding-categories.ts +141 -0
  70. package/src/input/agent-workspace-operations-command-editor-submission.ts +53 -0
  71. package/src/input/agent-workspace-operations-command-editors.ts +22 -0
  72. package/src/input/agent-workspace-research-report-editor.ts +212 -0
  73. package/src/input/agent-workspace-research-run-editor.ts +144 -0
  74. package/src/input/agent-workspace-research-source-editor.ts +167 -0
  75. package/src/input/agent-workspace-review-packet-snapshot.ts +593 -0
  76. package/src/input/agent-workspace-review-packet-utils.ts +265 -0
  77. package/src/input/agent-workspace-settings.ts +262 -30
  78. package/src/input/agent-workspace-setup-checkpoint-action.ts +127 -0
  79. package/src/input/agent-workspace-setup-snapshot.ts +198 -0
  80. package/src/input/agent-workspace-setup.ts +34 -1
  81. package/src/input/agent-workspace-snapshot.ts +162 -147
  82. package/src/input/agent-workspace-types.ts +287 -2
  83. package/src/input/agent-workspace.ts +18 -0
  84. package/src/input/command-registry.ts +9 -2
  85. package/src/input/commands/agent-runtime-profile-runtime.ts +28 -13
  86. package/src/input/commands/channels-runtime.ts +102 -114
  87. package/src/input/commands/delegation-runtime.ts +87 -24
  88. package/src/input/commands/knowledge-browser-flags.ts +12 -0
  89. package/src/input/commands/knowledge.ts +28 -14
  90. package/src/input/commands/operator-actions-runtime.ts +6 -3
  91. package/src/input/commands/schedule-runtime.ts +71 -14
  92. package/src/input/commands/session-content.ts +2 -2
  93. package/src/input/commands/shell-core.ts +2 -0
  94. package/src/input/commands/vibe-runtime.ts +140 -0
  95. package/src/input/commands.ts +2 -0
  96. package/src/input/connected-host-routes.ts +123 -0
  97. package/src/input/settings-modal-types.ts +14 -0
  98. package/src/main.ts +15 -15
  99. package/src/panels/qr-panel.ts +2 -2
  100. package/src/renderer/agent-workspace-context-lines.ts +686 -0
  101. package/src/renderer/agent-workspace.ts +30 -419
  102. package/src/renderer/settings-modal-helpers.ts +12 -0
  103. package/src/renderer/settings-modal.ts +12 -0
  104. package/src/runtime/bootstrap-command-context.ts +11 -1
  105. package/src/runtime/bootstrap-command-parts.ts +14 -3
  106. package/src/runtime/bootstrap-core.ts +43 -1
  107. package/src/runtime/bootstrap-shell.ts +6 -0
  108. package/src/runtime/bootstrap.ts +113 -30
  109. package/src/runtime/connected-host-auth.ts +3 -2
  110. package/src/runtime/execution-ledger.ts +231 -0
  111. package/src/runtime/services.ts +88 -10
  112. package/src/runtime/tool-permission-safety.ts +287 -0
  113. package/src/shell/session-continuity-hints.ts +39 -0
  114. package/src/tools/agent-artifacts-tool.ts +606 -0
  115. package/src/tools/agent-audit-tool.ts +155 -0
  116. package/src/tools/agent-autonomy-schedule-tool.ts +238 -0
  117. package/src/tools/agent-autonomy-tool.ts +140 -0
  118. package/src/tools/agent-channel-send-tool.ts +24 -2
  119. package/src/tools/agent-channels-tool.ts +140 -0
  120. package/src/tools/agent-computer-tool.ts +168 -0
  121. package/src/tools/agent-context-policy.ts +267 -10
  122. package/src/tools/agent-context-tool.ts +143 -0
  123. package/src/tools/agent-delegation-tool.ts +128 -0
  124. package/src/tools/agent-device-tool.ts +240 -0
  125. package/src/tools/agent-documents-tool.ts +684 -0
  126. package/src/tools/agent-execution-tool.ts +230 -0
  127. package/src/tools/agent-harness-agent-orchestration.ts +703 -0
  128. package/src/tools/agent-harness-autonomy-intake.ts +785 -0
  129. package/src/tools/agent-harness-autonomy-live-records.ts +588 -0
  130. package/src/tools/agent-harness-autonomy-queue-types.ts +88 -0
  131. package/src/tools/agent-harness-autonomy-queue.ts +560 -0
  132. package/src/tools/agent-harness-background-processes-types.ts +35 -0
  133. package/src/tools/agent-harness-background-processes.ts +794 -0
  134. package/src/tools/agent-harness-browser-cockpit-route.ts +219 -0
  135. package/src/tools/agent-harness-browser-control.ts +338 -0
  136. package/src/tools/agent-harness-channel-metadata.ts +168 -10
  137. package/src/tools/agent-harness-cli-command-policy.ts +110 -0
  138. package/src/tools/agent-harness-command-catalog.ts +4 -2
  139. package/src/tools/agent-harness-command-runner.ts +42 -0
  140. package/src/tools/agent-harness-connected-host-status.ts +7 -4
  141. package/src/tools/agent-harness-delegation-posture.ts +234 -19
  142. package/src/tools/agent-harness-document-ops-reviewer-readiness.ts +234 -0
  143. package/src/tools/agent-harness-document-ops-types.ts +72 -0
  144. package/src/tools/agent-harness-document-ops.ts +671 -0
  145. package/src/tools/agent-harness-execution-history.ts +489 -0
  146. package/src/tools/agent-harness-execution-posture.ts +382 -0
  147. package/src/tools/agent-harness-file-recovery.ts +135 -0
  148. package/src/tools/agent-harness-keybinding-metadata.ts +16 -12
  149. package/src/tools/agent-harness-learning-curator-common.ts +102 -0
  150. package/src/tools/agent-harness-learning-curator-consolidation.ts +295 -0
  151. package/src/tools/agent-harness-learning-curator-proposals.ts +606 -0
  152. package/src/tools/agent-harness-learning-curator-types.ts +151 -0
  153. package/src/tools/agent-harness-learning-curator.ts +417 -0
  154. package/src/tools/agent-harness-local-model-benchmarks.ts +199 -0
  155. package/src/tools/agent-harness-local-model-cookbook.ts +238 -0
  156. package/src/tools/agent-harness-local-model-endpoints.ts +673 -0
  157. package/src/tools/agent-harness-media-posture.ts +208 -2
  158. package/src/tools/agent-harness-memory-posture.ts +556 -0
  159. package/src/tools/agent-harness-metadata.ts +100 -168
  160. package/src/tools/agent-harness-mode-catalog.ts +84 -33
  161. package/src/tools/agent-harness-model-catalog.ts +162 -0
  162. package/src/tools/agent-harness-model-provider-health.ts +186 -0
  163. package/src/tools/agent-harness-model-readiness.ts +406 -0
  164. package/src/tools/agent-harness-model-routing-types.ts +266 -0
  165. package/src/tools/agent-harness-model-routing-utils.ts +30 -0
  166. package/src/tools/agent-harness-model-routing.ts +137 -190
  167. package/src/tools/agent-harness-operator-methods.ts +115 -133
  168. package/src/tools/agent-harness-pairing-posture.ts +431 -18
  169. package/src/tools/agent-harness-personal-ops-discovery.ts +533 -0
  170. package/src/tools/agent-harness-personal-ops-intake.ts +385 -0
  171. package/src/tools/agent-harness-personal-ops-lanes.ts +204 -0
  172. package/src/tools/agent-harness-personal-ops-records.ts +732 -0
  173. package/src/tools/agent-harness-personal-ops-runner.ts +637 -0
  174. package/src/tools/agent-harness-personal-ops-types.ts +222 -0
  175. package/src/tools/agent-harness-personal-ops.ts +606 -0
  176. package/src/tools/agent-harness-project-context.ts +144 -0
  177. package/src/tools/agent-harness-prompt-context.ts +589 -0
  178. package/src/tools/agent-harness-provider-account-metadata.ts +2 -2
  179. package/src/tools/agent-harness-release-evidence.ts +9 -7
  180. package/src/tools/agent-harness-release-readiness.ts +9 -7
  181. package/src/tools/agent-harness-research-briefing.ts +427 -0
  182. package/src/tools/agent-harness-research-queue.ts +250 -0
  183. package/src/tools/agent-harness-research-runs.ts +295 -0
  184. package/src/tools/agent-harness-research-workflow.ts +322 -0
  185. package/src/tools/agent-harness-security-posture.ts +2 -2
  186. package/src/tools/agent-harness-service-posture.ts +9 -9
  187. package/src/tools/agent-harness-session-metadata.ts +3 -3
  188. package/src/tools/agent-harness-setup-connected-host.ts +501 -0
  189. package/src/tools/agent-harness-setup-describe.ts +557 -0
  190. package/src/tools/agent-harness-setup-handoffs.ts +502 -0
  191. package/src/tools/agent-harness-setup-model-helpers.ts +101 -0
  192. package/src/tools/agent-harness-setup-plan.ts +253 -0
  193. package/src/tools/agent-harness-setup-posture-types.ts +218 -0
  194. package/src/tools/agent-harness-setup-posture-utils.ts +173 -0
  195. package/src/tools/agent-harness-setup-posture.ts +449 -221
  196. package/src/tools/agent-harness-setup-smoke.ts +508 -0
  197. package/src/tools/agent-harness-sudo-posture.ts +114 -0
  198. package/src/tools/agent-harness-tool-schema.ts +120 -7
  199. package/src/tools/agent-harness-tool-types.ts +78 -0
  200. package/src/tools/agent-harness-tool-utils.ts +43 -0
  201. package/src/tools/agent-harness-tool.ts +311 -370
  202. package/src/tools/agent-harness-ui-surface-metadata.ts +76 -69
  203. package/src/tools/agent-harness-ui-surface-types.ts +46 -0
  204. package/src/tools/agent-harness-vibe-health.ts +105 -0
  205. package/src/tools/agent-harness-workspace-action-runner.ts +149 -0
  206. package/src/tools/agent-harness-workspace-actions.ts +114 -8
  207. package/src/tools/agent-harness-workspace-editor-execution.ts +214 -0
  208. package/src/tools/agent-harness-workspace-editor-runner.ts +755 -0
  209. package/src/tools/agent-host-tool.ts +159 -0
  210. package/src/tools/agent-knowledge-ingest-tool.ts +34 -1
  211. package/src/tools/agent-learning-consolidation-core.ts +327 -0
  212. package/src/tools/agent-learning-consolidation-tool.ts +758 -0
  213. package/src/tools/agent-memory-tool.ts +214 -0
  214. package/src/tools/agent-model-compare-export.ts +315 -0
  215. package/src/tools/agent-model-compare-handoff.ts +592 -0
  216. package/src/tools/agent-model-compare-judgment.ts +633 -0
  217. package/src/tools/agent-model-compare-run.ts +722 -0
  218. package/src/tools/agent-model-compare-tool.ts +698 -0
  219. package/src/tools/agent-model-compare-types.ts +191 -0
  220. package/src/tools/agent-model-compare-utils.ts +93 -0
  221. package/src/tools/agent-models-tool.ts +208 -0
  222. package/src/tools/agent-operator-action-tool.ts +1 -1
  223. package/src/tools/agent-operator-method-tool.ts +643 -0
  224. package/src/tools/agent-personal-ops-tool.ts +197 -0
  225. package/src/tools/agent-policy-explanation.ts +415 -0
  226. package/src/tools/agent-research-report-tool.ts +608 -0
  227. package/src/tools/agent-research-runs-tool.ts +434 -0
  228. package/src/tools/agent-research-sources-tool.ts +443 -0
  229. package/src/tools/agent-research-tool.ts +687 -0
  230. package/src/tools/agent-review-packet-presets-core.ts +757 -0
  231. package/src/tools/agent-review-packet-presets-tool.ts +466 -0
  232. package/src/tools/agent-review-packet-share-tool.ts +305 -0
  233. package/src/tools/agent-route-planner-candidates-setup.ts +411 -0
  234. package/src/tools/agent-route-planner-candidates-surfaces.ts +432 -0
  235. package/src/tools/agent-route-planner-candidates-work.ts +251 -0
  236. package/src/tools/agent-route-planner-helpers.ts +667 -0
  237. package/src/tools/agent-route-planner.ts +185 -0
  238. package/src/tools/agent-route-tool.ts +105 -0
  239. package/src/tools/agent-schedule-edit-tool.ts +210 -0
  240. package/src/tools/agent-schedule-tool.ts +282 -0
  241. package/src/tools/agent-security-tool.ts +145 -0
  242. package/src/tools/agent-sessions-tool.ts +122 -0
  243. package/src/tools/agent-settings-import-tool.ts +104 -0
  244. package/src/tools/agent-settings-tool.ts +176 -0
  245. package/src/tools/agent-setup-tool.ts +226 -0
  246. package/src/tools/agent-support-tool.ts +122 -0
  247. package/src/tools/agent-terminal-process-tools.ts +167 -0
  248. package/src/tools/agent-tool-policy-guard-types.ts +77 -0
  249. package/src/tools/agent-tool-policy-guard.ts +110 -89
  250. package/src/tools/agent-vibe-tool.ts +297 -0
  251. package/src/tools/agent-work-plan-tool.ts +265 -6
  252. package/src/tools/agent-workspace-tool.ts +305 -0
  253. package/src/tools/artifact-archive.ts +169 -0
  254. package/src/tools/tool-definition-compaction.ts +36 -0
  255. package/src/tools/tool-execution-safety.ts +41 -0
  256. package/src/version.ts +1 -1
@@ -0,0 +1,176 @@
1
+ import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
2
+ import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
3
+ import type { CommandContext, CommandRegistry } from '../input/command-registry.ts';
4
+ import { createAgentHarnessTool } from './agent-harness-tool.ts';
5
+ import { createAgentSettingsImportTool } from './agent-settings-import-tool.ts';
6
+
7
+ type AgentSettingsAction =
8
+ | 'list'
9
+ | 'get'
10
+ | 'set'
11
+ | 'reset'
12
+ | 'import';
13
+
14
+ interface AgentSettingsToolArgs {
15
+ readonly action?: unknown;
16
+ readonly mode?: unknown;
17
+ readonly key?: unknown;
18
+ readonly setting?: unknown;
19
+ readonly target?: unknown;
20
+ readonly query?: unknown;
21
+ readonly category?: unknown;
22
+ readonly prefix?: unknown;
23
+ readonly value?: unknown;
24
+ readonly includeHidden?: unknown;
25
+ readonly includeParameters?: unknown;
26
+ readonly limit?: unknown;
27
+ readonly confirm?: unknown;
28
+ readonly explicitUserRequest?: unknown;
29
+ }
30
+
31
+ interface AgentSettingsToolDeps {
32
+ readonly commandRegistry: CommandRegistry;
33
+ readonly commandContext: CommandContext;
34
+ readonly toolRegistry: ToolRegistry;
35
+ readonly harnessTool?: Tool;
36
+ readonly settingsImportTool?: Tool;
37
+ }
38
+
39
+ function error(message: string): { readonly success: false; readonly error: string } {
40
+ return { success: false, error: message };
41
+ }
42
+
43
+ function readString(value: unknown): string {
44
+ return typeof value === 'string' ? value.trim() : '';
45
+ }
46
+
47
+ function readBoolean(value: unknown): boolean {
48
+ return value === true || (typeof value === 'string' && ['true', 'yes', 'apply', 'run'].includes(value.trim().toLowerCase()));
49
+ }
50
+
51
+ function normalizeSettingsAction(value: unknown): AgentSettingsAction | null {
52
+ const action = readString(value).toLowerCase().replace(/-/g, '_');
53
+ if (!action) return null;
54
+ if (action === 'list' || action === 'status' || action === 'settings' || action === 'catalog' || action === 'search' || action === 'find' || action === 'browse') return 'list';
55
+ if (action === 'get' || action === 'show' || action === 'inspect' || action === 'read' || action === 'setting' || action === 'get_setting') return 'get';
56
+ if (action === 'set' || action === 'update' || action === 'change' || action === 'configure' || action === 'set_setting') return 'set';
57
+ if (action === 'reset' || action === 'clear' || action === 'default' || action === 'restore' || action === 'reset_setting') return 'reset';
58
+ if (action === 'import' || action === 'import_settings' || action === 'settings_import' || action === 'import_goodvibes' || action === 'goodvibes_import' || action === 'preview_import' || action === 'apply_import') return 'import';
59
+ return null;
60
+ }
61
+
62
+ function readAction(args: AgentSettingsToolArgs): AgentSettingsAction {
63
+ const explicit = normalizeSettingsAction(args.action) ?? normalizeSettingsAction(args.mode);
64
+ if (explicit) return explicit;
65
+ if (readString(args.key) || readString(args.setting)) return 'get';
66
+ return 'list';
67
+ }
68
+
69
+ function compactArgs(entries: Record<string, unknown>): Record<string, unknown> {
70
+ return Object.fromEntries(Object.entries(entries).filter(([, value]) => value !== undefined && value !== ''));
71
+ }
72
+
73
+ function settingKey(args: AgentSettingsToolArgs): string {
74
+ return readString(args.key) || readString(args.setting);
75
+ }
76
+
77
+ function confirmedArgs(args: AgentSettingsToolArgs): Record<string, unknown> {
78
+ return compactArgs({
79
+ confirm: args.confirm,
80
+ explicitUserRequest: args.explicitUserRequest,
81
+ });
82
+ }
83
+
84
+ function settingsListArgs(args: AgentSettingsToolArgs): Record<string, unknown> {
85
+ return compactArgs({
86
+ mode: 'settings',
87
+ category: args.category,
88
+ prefix: args.prefix,
89
+ query: args.query ?? args.target,
90
+ includeHidden: args.includeHidden,
91
+ includeParameters: args.includeParameters,
92
+ limit: args.limit,
93
+ });
94
+ }
95
+
96
+ function settingsLookupArgs(mode: 'get_setting' | 'set_setting' | 'reset_setting', args: AgentSettingsToolArgs): Record<string, unknown> {
97
+ const key = settingKey(args);
98
+ return compactArgs({
99
+ mode,
100
+ key,
101
+ target: key ? undefined : args.target,
102
+ query: key ? undefined : args.query,
103
+ category: args.category,
104
+ prefix: args.prefix,
105
+ value: mode === 'set_setting' ? args.value : undefined,
106
+ includeHidden: args.includeHidden,
107
+ ...confirmedArgs(args),
108
+ });
109
+ }
110
+
111
+ export function createAgentSettingsTool(deps: AgentSettingsToolDeps): Tool {
112
+ const harnessTool = deps.harnessTool ?? createAgentHarnessTool({
113
+ commandRegistry: deps.commandRegistry,
114
+ commandContext: deps.commandContext,
115
+ toolRegistry: deps.toolRegistry,
116
+ });
117
+ const settingsImportTool = deps.settingsImportTool ?? createAgentSettingsImportTool(deps.commandContext);
118
+
119
+ return {
120
+ definition: {
121
+ name: 'settings',
122
+ description: 'List, inspect, change, reset, or import settings.',
123
+ parameters: {
124
+ type: 'object',
125
+ properties: {
126
+ action: {
127
+ type: 'string',
128
+ enum: ['list', 'get', 'set', 'reset', 'import'],
129
+ description: 'Read settings or confirm setting changes/imports.',
130
+ },
131
+ mode: { type: 'string', description: 'Alias for action.' },
132
+ key: { type: 'string', description: 'Exact setting key.' },
133
+ setting: { type: 'string', description: 'Alias for key.' },
134
+ target: { type: 'string', description: 'Setting lookup text.' },
135
+ query: { type: 'string', description: 'Setting search text.' },
136
+ category: { type: 'string', description: 'Top-level setting category.' },
137
+ prefix: { type: 'string', description: 'Setting key prefix.' },
138
+ value: { description: 'Value for action:set.' },
139
+ includeHidden: { type: 'boolean', description: 'Include scriptable or hidden settings.' },
140
+ includeParameters: { type: 'boolean', description: 'Include full setting metadata.' },
141
+ limit: { type: 'number', description: 'Maximum settings to return.' },
142
+ confirm: { type: 'boolean', description: 'Required true for set/reset/import apply.' },
143
+ explicitUserRequest: { type: 'string', description: 'User request authorizing confirmed setting effects.' },
144
+ },
145
+ additionalProperties: false,
146
+ },
147
+ sideEffects: ['state'],
148
+ concurrency: 'serial',
149
+ },
150
+ execute: async (rawArgs: unknown) => {
151
+ const args = (rawArgs && typeof rawArgs === 'object' && !Array.isArray(rawArgs) ? rawArgs : {}) as AgentSettingsToolArgs;
152
+ const action = readAction(args);
153
+
154
+ if (action === 'list') return harnessTool.execute(settingsListArgs(args));
155
+ if (action === 'get') return harnessTool.execute(settingsLookupArgs('get_setting', args));
156
+ if (action === 'set') return harnessTool.execute(settingsLookupArgs('set_setting', args));
157
+ if (action === 'reset') return harnessTool.execute(settingsLookupArgs('reset_setting', args));
158
+ if (action === 'import') {
159
+ return settingsImportTool.execute({
160
+ action: readBoolean(args.confirm) ? 'apply' : 'preview',
161
+ ...confirmedArgs(args),
162
+ });
163
+ }
164
+
165
+ return error('Unknown settings action. Use action:"list" to inspect settings.');
166
+ },
167
+ };
168
+ }
169
+
170
+ export function registerAgentSettingsTool(
171
+ registry: ToolRegistry,
172
+ commandRegistry: CommandRegistry,
173
+ commandContext: CommandContext,
174
+ ): void {
175
+ if (!registry.has('settings')) registry.register(createAgentSettingsTool({ commandRegistry, commandContext, toolRegistry: registry }));
176
+ }
@@ -0,0 +1,226 @@
1
+ import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
2
+ import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
3
+ import type { CommandContext, CommandRegistry } from '../input/command-registry.ts';
4
+ import { createAgentHarnessTool } from './agent-harness-tool.ts';
5
+ import { createAgentSettingsImportTool } from './agent-settings-import-tool.ts';
6
+
7
+ type AgentSetupAction =
8
+ | 'status'
9
+ | 'item'
10
+ | 'repair'
11
+ | 'checkpoint'
12
+ | 'save_checkpoint'
13
+ | 'clear_checkpoint'
14
+ | 'token'
15
+ | 'smoke'
16
+ | 'finish'
17
+ | 'import_settings';
18
+
19
+ interface AgentSetupToolArgs {
20
+ readonly action?: unknown;
21
+ readonly mode?: unknown;
22
+ readonly setupItemId?: unknown;
23
+ readonly itemId?: unknown;
24
+ readonly target?: unknown;
25
+ readonly query?: unknown;
26
+ readonly fields?: unknown;
27
+ readonly includeParameters?: unknown;
28
+ readonly limit?: unknown;
29
+ readonly confirm?: unknown;
30
+ readonly explicitUserRequest?: unknown;
31
+ }
32
+
33
+ interface AgentSetupToolDeps {
34
+ readonly commandRegistry: CommandRegistry;
35
+ readonly commandContext: CommandContext;
36
+ readonly toolRegistry: ToolRegistry;
37
+ readonly harnessTool?: Tool;
38
+ readonly settingsImportTool?: Tool;
39
+ }
40
+
41
+ function output(value: unknown): { readonly success: true; readonly output: string } {
42
+ return {
43
+ success: true,
44
+ output: typeof value === 'string' ? value : JSON.stringify(value, null, 2),
45
+ };
46
+ }
47
+
48
+ function error(message: string): { readonly success: false; readonly error: string } {
49
+ return { success: false, error: message };
50
+ }
51
+
52
+ function readString(value: unknown): string {
53
+ return typeof value === 'string' ? value.trim() : '';
54
+ }
55
+
56
+ function readBoolean(value: unknown): boolean {
57
+ return value === true || (typeof value === 'string' && ['true', 'yes', 'apply', 'run'].includes(value.trim().toLowerCase()));
58
+ }
59
+
60
+ function normalizeSetupAction(value: unknown): AgentSetupAction | null {
61
+ const action = readString(value).toLowerCase().replace(/-/g, '_');
62
+ if (!action) return null;
63
+ if (action === 'setup' || action === 'posture' || action === 'status' || action === 'summary' || action === 'list') return 'status';
64
+ if (action === 'item' || action === 'show' || action === 'inspect') return 'item';
65
+ if (action === 'repair' || action === 'fix' || action === 'diagnose_repair' || action === 'host_repair' || action === 'repair_host' || action === 'launch_host') return 'repair';
66
+ if (action === 'checkpoint' || action === 'resume' || action === 'checkpoint_status') return 'checkpoint';
67
+ if (action === 'save_checkpoint' || action === 'mark_checkpoint' || action === 'checkpoint_save' || action === 'save') return 'save_checkpoint';
68
+ if (action === 'clear_checkpoint' || action === 'reset_checkpoint' || action === 'checkpoint_clear' || action === 'clear') return 'clear_checkpoint';
69
+ if (action === 'token' || action === 'auth' || action === 'provision_token' || action === 'repair_token') return 'token';
70
+ if (action === 'smoke' || action === 'run_smoke' || action === 'install_smoke') return 'smoke';
71
+ if (action === 'finish' || action === 'closeout' || action === 'apply_close' || action === 'apply_and_close') return 'finish';
72
+ if (action === 'import' || action === 'import_settings' || action === 'settings_import') return 'import_settings';
73
+ return null;
74
+ }
75
+
76
+ function readAction(args: AgentSetupToolArgs): AgentSetupAction {
77
+ const explicit = normalizeSetupAction(args.action) ?? normalizeSetupAction(args.mode);
78
+ if (explicit) return explicit;
79
+ if (readString(args.setupItemId) || readString(args.itemId)) return 'item';
80
+ return 'status';
81
+ }
82
+
83
+ function itemLookup(args: AgentSetupToolArgs): string {
84
+ return readString(args.setupItemId) || readString(args.itemId);
85
+ }
86
+
87
+ function compactArgs(entries: Record<string, unknown>): Record<string, unknown> {
88
+ return Object.fromEntries(Object.entries(entries).filter(([, value]) => value !== undefined && value !== ''));
89
+ }
90
+
91
+ function setupStatusArgs(args: AgentSetupToolArgs): Record<string, unknown> {
92
+ return compactArgs({
93
+ mode: 'setup_posture',
94
+ query: args.query,
95
+ limit: args.limit,
96
+ includeParameters: args.includeParameters,
97
+ });
98
+ }
99
+
100
+ function setupItemArgs(args: AgentSetupToolArgs): Record<string, unknown> {
101
+ const setupItemId = itemLookup(args);
102
+ return compactArgs({
103
+ mode: 'setup_item',
104
+ setupItemId,
105
+ target: setupItemId ? undefined : args.target,
106
+ query: setupItemId ? undefined : args.query,
107
+ includeParameters: args.includeParameters,
108
+ });
109
+ }
110
+
111
+ function confirmedArgs(args: AgentSetupToolArgs): Record<string, unknown> {
112
+ return compactArgs({
113
+ confirm: args.confirm,
114
+ explicitUserRequest: args.explicitUserRequest,
115
+ });
116
+ }
117
+
118
+ export function createAgentSetupTool(deps: AgentSetupToolDeps): Tool {
119
+ const harnessTool = deps.harnessTool ?? createAgentHarnessTool({
120
+ commandRegistry: deps.commandRegistry,
121
+ commandContext: deps.commandContext,
122
+ toolRegistry: deps.toolRegistry,
123
+ });
124
+ const settingsImportTool = deps.settingsImportTool ?? createAgentSettingsImportTool(deps.commandContext);
125
+
126
+ return {
127
+ definition: {
128
+ name: 'setup',
129
+ description: 'Inspect and complete first-run Agent setup.',
130
+ parameters: {
131
+ type: 'object',
132
+ properties: {
133
+ action: {
134
+ type: 'string',
135
+ enum: ['status', 'item', 'repair', 'checkpoint', 'save_checkpoint', 'clear_checkpoint', 'token', 'smoke', 'finish', 'import_settings'],
136
+ description: 'Setup action; read status/item/checkpoint, confirm mutations.',
137
+ },
138
+ mode: { type: 'string', description: 'Alias for action.' },
139
+ setupItemId: { type: 'string', description: 'Setup item id.' },
140
+ itemId: { type: 'string', description: 'Alias for setupItemId.' },
141
+ target: { type: 'string', description: 'Setup item lookup text.' },
142
+ query: { type: 'string', description: 'Filter setup status or lookup a setup item.' },
143
+ fields: { type: 'object', description: 'Optional redacted setup-smoke evidence fields.' },
144
+ includeParameters: { type: 'boolean', description: 'Include bounded route details and parameters where supported.' },
145
+ limit: { type: 'number', description: 'Optional status list limit.' },
146
+ confirm: { type: 'boolean', description: 'Required true for setup mutations.' },
147
+ explicitUserRequest: { type: 'string', description: 'User request authorizing confirmed setup effects.' },
148
+ },
149
+ additionalProperties: false,
150
+ },
151
+ sideEffects: ['state'],
152
+ concurrency: 'serial',
153
+ },
154
+ execute: async (rawArgs: unknown) => {
155
+ const args = (rawArgs && typeof rawArgs === 'object' && !Array.isArray(rawArgs) ? rawArgs : {}) as AgentSetupToolArgs;
156
+ const action = readAction(args);
157
+
158
+ if (action === 'status') return harnessTool.execute(setupStatusArgs(args));
159
+ if (action === 'item') return harnessTool.execute(setupItemArgs(args));
160
+ if (action === 'repair') {
161
+ return harnessTool.execute(compactArgs({
162
+ mode: 'setup_repair',
163
+ setupItemId: itemLookup(args) || undefined,
164
+ target: itemLookup(args) ? undefined : args.target,
165
+ query: itemLookup(args) ? undefined : args.query,
166
+ includeParameters: args.includeParameters,
167
+ }));
168
+ }
169
+ if (action === 'checkpoint') return harnessTool.execute({ mode: 'setup_checkpoint' });
170
+ if (action === 'save_checkpoint') {
171
+ return harnessTool.execute({
172
+ mode: 'mark_setup_checkpoint',
173
+ ...compactArgs({ setupItemId: itemLookup(args) || undefined }),
174
+ ...confirmedArgs(args),
175
+ });
176
+ }
177
+ if (action === 'clear_checkpoint') {
178
+ return harnessTool.execute({
179
+ mode: 'clear_setup_checkpoint',
180
+ ...confirmedArgs(args),
181
+ });
182
+ }
183
+ if (action === 'token') {
184
+ return harnessTool.execute({
185
+ mode: 'provision_connected_host_token',
186
+ setupItemId: itemLookup(args) || 'connected-host-auth',
187
+ ...confirmedArgs(args),
188
+ });
189
+ }
190
+ if (action === 'smoke') {
191
+ return harnessTool.execute({
192
+ mode: 'run_setup_smoke',
193
+ setupItemId: itemLookup(args) || 'install-smoke',
194
+ ...compactArgs({
195
+ fields: args.fields,
196
+ includeParameters: args.includeParameters,
197
+ }),
198
+ ...confirmedArgs(args),
199
+ });
200
+ }
201
+ if (action === 'finish') {
202
+ return harnessTool.execute({
203
+ mode: 'run_workspace_action',
204
+ actionId: 'onboarding-apply-close',
205
+ ...confirmedArgs(args),
206
+ });
207
+ }
208
+ if (action === 'import_settings') {
209
+ return settingsImportTool.execute({
210
+ action: readBoolean(args.confirm) ? 'apply' : 'preview',
211
+ ...confirmedArgs(args),
212
+ });
213
+ }
214
+
215
+ return error('Unknown setup action. Use action:"status" to inspect first-run setup.');
216
+ },
217
+ };
218
+ }
219
+
220
+ export function registerAgentSetupTool(
221
+ registry: ToolRegistry,
222
+ commandRegistry: CommandRegistry,
223
+ commandContext: CommandContext,
224
+ ): void {
225
+ if (!registry.has('setup')) registry.register(createAgentSetupTool({ commandRegistry, commandContext, toolRegistry: registry }));
226
+ }
@@ -0,0 +1,122 @@
1
+ import type { Tool } from '@pellux/goodvibes-sdk/platform/types';
2
+ import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
3
+ import type { CommandContext, CommandRegistry } from '../input/command-registry.ts';
4
+ import { createAgentHarnessTool } from './agent-harness-tool.ts';
5
+
6
+ type AgentSupportAction = 'status' | 'bundle';
7
+
8
+ interface AgentSupportToolArgs {
9
+ readonly action?: unknown;
10
+ readonly mode?: unknown;
11
+ readonly id?: unknown;
12
+ readonly bundlePath?: unknown;
13
+ readonly target?: unknown;
14
+ readonly query?: unknown;
15
+ readonly includeParameters?: unknown;
16
+ readonly limit?: unknown;
17
+ }
18
+
19
+ interface AgentSupportToolDeps {
20
+ readonly commandRegistry: CommandRegistry;
21
+ readonly commandContext: CommandContext;
22
+ readonly toolRegistry: ToolRegistry;
23
+ readonly harnessTool?: Tool;
24
+ }
25
+
26
+ function error(message: string): { readonly success: false; readonly error: string } {
27
+ return { success: false, error: message };
28
+ }
29
+
30
+ function readString(value: unknown): string {
31
+ return typeof value === 'string' ? value.trim() : '';
32
+ }
33
+
34
+ function normalizeSupportAction(value: unknown): AgentSupportAction | null {
35
+ const action = readString(value).toLowerCase().replace(/-/g, '_');
36
+ if (!action) return null;
37
+ if (['status', 'summary', 'list', 'catalog', 'routes', 'bundles', 'diagnostics'].includes(action)) return 'status';
38
+ if (['bundle', 'inspect', 'show', 'get', 'support_bundle'].includes(action)) return 'bundle';
39
+ return null;
40
+ }
41
+
42
+ function readAction(args: AgentSupportToolArgs): AgentSupportAction | null {
43
+ const explicit = normalizeSupportAction(args.action) ?? normalizeSupportAction(args.mode);
44
+ if (explicit) return explicit;
45
+ if (readString(args.bundlePath) || readString(args.id)) return 'bundle';
46
+ return 'status';
47
+ }
48
+
49
+ function compactArgs(entries: Record<string, unknown>): Record<string, unknown> {
50
+ return Object.fromEntries(Object.entries(entries).filter(([, value]) => value !== undefined && value !== ''));
51
+ }
52
+
53
+ function statusArgs(args: AgentSupportToolArgs): Record<string, unknown> {
54
+ return compactArgs({
55
+ mode: 'support_bundles',
56
+ query: args.query ?? args.target,
57
+ includeParameters: args.includeParameters,
58
+ limit: args.limit,
59
+ });
60
+ }
61
+
62
+ function bundleArgs(args: AgentSupportToolArgs): Record<string, unknown> {
63
+ const bundlePath = readString(args.bundlePath) || readString(args.id);
64
+ return compactArgs({
65
+ mode: 'support_bundle',
66
+ bundlePath,
67
+ target: bundlePath ? undefined : args.target,
68
+ query: bundlePath ? undefined : args.query,
69
+ includeParameters: args.includeParameters,
70
+ });
71
+ }
72
+
73
+ export function createAgentSupportTool(deps: AgentSupportToolDeps): Tool {
74
+ const harnessTool = deps.harnessTool ?? createAgentHarnessTool({
75
+ commandRegistry: deps.commandRegistry,
76
+ commandContext: deps.commandContext,
77
+ toolRegistry: deps.toolRegistry,
78
+ });
79
+
80
+ return {
81
+ definition: {
82
+ name: 'support',
83
+ description: 'Read support-bundle routes and redacted bundle summaries.',
84
+ parameters: {
85
+ type: 'object',
86
+ properties: {
87
+ action: {
88
+ type: 'string',
89
+ enum: ['status', 'bundle'],
90
+ description: 'List support bundle routes or inspect one existing bundle.',
91
+ },
92
+ mode: { type: 'string', description: 'Alias for action.' },
93
+ id: { type: 'string', description: 'Alias for bundlePath.' },
94
+ bundlePath: { type: 'string', description: 'Workspace-relative support bundle path to inspect.' },
95
+ target: { type: 'string', description: 'Lookup target or search text.' },
96
+ query: { type: 'string', description: 'Search text.' },
97
+ includeParameters: { type: 'boolean', description: 'Include detailed route and policy metadata.' },
98
+ limit: { type: 'number', description: 'Maximum bundle routes returned.' },
99
+ },
100
+ additionalProperties: false,
101
+ },
102
+ sideEffects: [],
103
+ concurrency: 'parallel',
104
+ },
105
+ execute: async (rawArgs: unknown) => {
106
+ const args = (rawArgs && typeof rawArgs === 'object' && !Array.isArray(rawArgs) ? rawArgs : {}) as AgentSupportToolArgs;
107
+ const action = readAction(args);
108
+ if (!action) return error('Unknown support action. Use action:"status" or action:"bundle".');
109
+ if (action === 'status') return harnessTool.execute(statusArgs(args));
110
+ if (action === 'bundle') return harnessTool.execute(bundleArgs(args));
111
+ return error('Unknown support action. Use action:"status" or action:"bundle".');
112
+ },
113
+ };
114
+ }
115
+
116
+ export function registerAgentSupportTool(
117
+ registry: ToolRegistry,
118
+ commandRegistry: CommandRegistry,
119
+ commandContext: CommandContext,
120
+ ): void {
121
+ if (!registry.has('support')) registry.register(createAgentSupportTool({ commandRegistry, commandContext, toolRegistry: registry }));
122
+ }