@pellux/goodvibes-agent 0.1.117 → 1.0.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.
- package/CHANGELOG.md +13 -4
- package/README.md +35 -14
- package/bin/goodvibes-agent.ts +16 -2
- package/dist/package/main.js +176073 -170980
- package/docs/README.md +11 -5
- package/docs/channels-remote-and-api.md +50 -0
- package/docs/connected-host.md +3 -3
- package/docs/getting-started.md +29 -15
- package/docs/knowledge-artifacts-and-multimodal.md +91 -0
- package/docs/project-planning.md +79 -0
- package/docs/providers-and-routing.md +46 -0
- package/docs/release-and-publishing.md +44 -9
- package/docs/tools-and-commands.md +123 -0
- package/docs/voice-and-live-tts.md +51 -0
- package/package.json +2 -5
- package/src/agent/channel-delivery.ts +201 -0
- package/src/agent/media-generation.ts +159 -0
- package/src/agent/memory-prompt.ts +0 -1
- package/src/agent/note-registry.ts +329 -0
- package/src/agent/operator-actions.ts +343 -0
- package/src/agent/persona-registry.ts +15 -14
- package/src/agent/record-labels.ts +107 -0
- package/src/agent/reminder-schedule-format.ts +33 -24
- package/src/agent/reminder-schedule.ts +26 -25
- package/src/agent/routine-registry.ts +13 -12
- package/src/agent/routine-schedule-args.ts +2 -1
- package/src/agent/routine-schedule-format.ts +77 -53
- package/src/agent/routine-schedule-promotion.ts +34 -32
- package/src/agent/routine-schedule-receipts.ts +28 -26
- package/src/agent/runtime-profile-starters.ts +2 -2
- package/src/agent/runtime-profile.ts +18 -17
- package/src/agent/skill-registry.ts +25 -24
- package/src/cli/agent-knowledge-args.ts +5 -1
- package/src/cli/agent-knowledge-command.ts +39 -33
- package/src/cli/agent-knowledge-format.ts +80 -67
- package/src/cli/agent-knowledge-methods.ts +1 -1
- package/src/cli/agent-knowledge-runtime.ts +32 -26
- package/src/cli/bundle-command.ts +13 -8
- package/src/cli/config-overrides.ts +37 -36
- package/src/cli/external-runtime.ts +10 -4
- package/src/cli/help.ts +29 -11
- package/src/cli/local-library-command.ts +134 -68
- package/src/cli/management-commands.ts +98 -62
- package/src/cli/management.ts +52 -26
- package/src/cli/memory-command.ts +66 -32
- package/src/cli/parser.ts +37 -24
- package/src/cli/profiles-command.ts +52 -35
- package/src/cli/provider-auth-routes.ts +2 -1
- package/src/cli/routines-command.ts +44 -36
- package/src/cli/service-posture.ts +6 -6
- package/src/cli/status.ts +46 -121
- package/src/core/conversation-message-snapshot.ts +131 -0
- package/src/input/agent-workspace-activation.ts +33 -7
- package/src/input/agent-workspace-basic-command-editor-submission.ts +7 -3
- package/src/input/agent-workspace-basic-command-editors.ts +30 -10
- package/src/input/agent-workspace-categories.ts +276 -64
- package/src/input/agent-workspace-channel-command-editor-submission.ts +34 -0
- package/src/input/agent-workspace-channel-command-editors.ts +23 -5
- package/src/input/agent-workspace-channels.ts +35 -2
- package/src/input/agent-workspace-command-editor.ts +18 -2
- package/src/input/agent-workspace-config-reader.ts +16 -0
- package/src/input/agent-workspace-delegation-editor-submission.ts +1 -1
- package/src/input/agent-workspace-editors.ts +140 -2
- package/src/input/agent-workspace-knowledge-query-editor.ts +1 -1
- package/src/input/agent-workspace-learned-behavior.ts +2 -2
- package/src/input/agent-workspace-library-command-editor-submission.ts +1 -1
- package/src/input/agent-workspace-library-command-editors.ts +2 -2
- package/src/input/agent-workspace-local-operations.ts +218 -0
- package/src/input/agent-workspace-local-selection.ts +75 -0
- package/src/input/agent-workspace-media-command-editor-submission.ts +62 -0
- package/src/input/agent-workspace-media-command-editors.ts +27 -0
- package/src/input/agent-workspace-memory-command-editors.ts +1 -1
- package/src/input/agent-workspace-memory-editor.ts +2 -2
- package/src/input/agent-workspace-navigation.ts +38 -2
- package/src/input/agent-workspace-notify-editor-submission.ts +16 -2
- package/src/input/agent-workspace-operations-command-editor-submission.ts +63 -1
- package/src/input/agent-workspace-operations-command-editors.ts +80 -3
- package/src/input/agent-workspace-panel-route.ts +43 -0
- package/src/input/agent-workspace-reminder-schedule-editor.ts +1 -1
- package/src/input/agent-workspace-routine-schedule-editor.ts +2 -2
- package/src/input/agent-workspace-search.ts +169 -0
- package/src/input/agent-workspace-setup.ts +22 -11
- package/src/input/agent-workspace-skill-bundle-command-editor-submission.ts +6 -6
- package/src/input/agent-workspace-skill-bundle-command-editors.ts +10 -10
- package/src/input/agent-workspace-snapshot.ts +112 -13
- package/src/input/agent-workspace-task-command-editors.ts +4 -4
- package/src/input/agent-workspace-token.ts +18 -2
- package/src/input/agent-workspace-types.ts +92 -4
- package/src/input/agent-workspace-voice-media.ts +3 -6
- package/src/input/agent-workspace-web-research-editor.ts +104 -0
- package/src/input/agent-workspace.ts +136 -208
- package/src/input/command-registry.ts +4 -1
- package/src/input/commands/agent-runtime-profile-runtime.ts +45 -41
- package/src/input/commands/agent-skills-runtime.ts +83 -70
- package/src/input/commands/agent-workspace-runtime.ts +23 -7
- package/src/input/commands/brief-runtime.ts +25 -24
- package/src/input/commands/channels-runtime.ts +145 -31
- package/src/input/commands/delegation-runtime.ts +29 -23
- package/src/input/commands/experience-runtime.ts +6 -4
- package/src/input/commands/guidance-runtime.ts +4 -4
- package/src/input/commands/health-runtime.ts +140 -115
- package/src/input/commands/knowledge.ts +57 -56
- package/src/input/commands/local-provider-runtime.ts +36 -18
- package/src/input/commands/local-runtime.ts +138 -16
- package/src/input/commands/local-setup-review.ts +7 -7
- package/src/input/commands/mcp-runtime.ts +56 -35
- package/src/input/commands/notify-runtime.ts +38 -9
- package/src/input/commands/operator-actions-runtime.ts +138 -0
- package/src/input/commands/operator-runtime.ts +6 -17
- package/src/input/commands/personas-runtime.ts +45 -30
- package/src/input/commands/planning-runtime.ts +1 -1
- package/src/input/commands/platform-access-runtime.ts +29 -29
- package/src/input/commands/provider-accounts-runtime.ts +60 -39
- package/src/input/commands/qrcode-runtime.ts +45 -6
- package/src/input/commands/recall-bundle.ts +11 -11
- package/src/input/commands/recall-capture.ts +13 -11
- package/src/input/commands/recall-query.ts +29 -21
- package/src/input/commands/recall-review.ts +2 -1
- package/src/input/commands/routines-runtime.ts +59 -43
- package/src/input/commands/schedule-runtime.ts +33 -20
- package/src/input/commands/security-runtime.ts +4 -4
- package/src/input/commands/session-content.ts +80 -78
- package/src/input/commands/session-workflow.ts +132 -93
- package/src/input/commands/session.ts +3 -174
- package/src/input/commands/shell-core.ts +32 -17
- package/src/input/commands/subscription-runtime.ts +53 -179
- package/src/input/commands/tasks-runtime.ts +20 -20
- package/src/input/commands/work-plan-runtime.ts +33 -8
- package/src/input/commands.ts +2 -2
- package/src/input/feed-context-factory.ts +2 -1
- package/src/input/file-picker.ts +3 -2
- package/src/input/handler-command-route.ts +4 -7
- package/src/input/handler-content-actions.ts +89 -1
- package/src/input/handler-feed-routes.ts +19 -12
- package/src/input/handler-feed.ts +6 -3
- package/src/input/handler-interactions.ts +7 -5
- package/src/input/handler-modal-stack.ts +3 -3
- package/src/input/handler-onboarding.ts +24 -80
- package/src/input/handler-shortcuts.ts +15 -4
- package/src/input/handler.ts +47 -17
- package/src/input/input-history.ts +5 -6
- package/src/input/keybindings.ts +22 -11
- package/src/input/onboarding/onboarding-wizard-apply.ts +13 -0
- package/src/input/onboarding/onboarding-wizard-constants.ts +1 -0
- package/src/input/onboarding/onboarding-wizard-operator-steps.ts +147 -57
- package/src/input/onboarding/onboarding-wizard-steps.ts +46 -29
- package/src/input/onboarding/onboarding-wizard-types.ts +3 -1
- package/src/input/onboarding/onboarding-wizard.ts +68 -0
- package/src/input/profile-picker-modal.ts +31 -12
- package/src/input/session-picker-modal.ts +21 -4
- package/src/input/settings-modal-behavior.ts +0 -3
- package/src/input/settings-modal-subscriptions.ts +3 -3
- package/src/input/settings-modal-types.ts +2 -13
- package/src/input/settings-modal.ts +6 -52
- package/src/input/submission-intent.ts +0 -1
- package/src/input/submission-router.ts +3 -3
- package/src/main.ts +18 -8
- package/src/panels/approval-panel.ts +8 -8
- package/src/panels/automation-control-panel.ts +2 -2
- package/src/panels/base-panel.ts +1 -1
- package/src/panels/builtin/agent.ts +1 -1
- package/src/panels/builtin/operations.ts +1 -10
- package/src/panels/builtin/session.ts +9 -9
- package/src/panels/builtin/shared.ts +2 -2
- package/src/panels/cost-tracker-panel.ts +1 -1
- package/src/panels/docs-panel.ts +5 -3
- package/src/panels/index.ts +0 -1
- package/src/panels/knowledge-panel.ts +6 -5
- package/src/panels/memory-panel.ts +7 -6
- package/src/panels/panel-list-panel.ts +36 -80
- package/src/panels/project-planning-panel.ts +18 -11
- package/src/panels/provider-account-snapshot.ts +51 -25
- package/src/panels/provider-accounts-panel.ts +33 -18
- package/src/panels/provider-health-domains.ts +45 -4
- package/src/panels/provider-health-panel.ts +5 -4
- package/src/panels/qr-panel.ts +1 -1
- package/src/panels/schedule-panel.ts +9 -17
- package/src/panels/security-panel.ts +8 -8
- package/src/panels/session-browser-panel.ts +10 -10
- package/src/panels/subscription-panel.ts +3 -3
- package/src/panels/system-messages-panel.ts +1 -1
- package/src/panels/tasks-panel.ts +20 -13
- package/src/panels/tool-inspector-panel.ts +19 -12
- package/src/panels/work-plan-panel.ts +5 -5
- package/src/planning/project-planning-coordinator.ts +1 -1
- package/src/provider-auth-route-display.ts +9 -0
- package/src/renderer/agent-workspace-style.ts +34 -0
- package/src/renderer/agent-workspace.ts +228 -52
- package/src/renderer/autocomplete-overlay.ts +25 -6
- package/src/renderer/bookmark-modal.ts +19 -4
- package/src/renderer/buffer.ts +4 -2
- package/src/renderer/context-inspector.ts +50 -13
- package/src/renderer/diff.ts +1 -1
- package/src/renderer/file-picker-overlay.ts +19 -6
- package/src/renderer/help-overlay.ts +106 -33
- package/src/renderer/history-search-overlay.ts +19 -4
- package/src/renderer/live-tail-modal.ts +27 -5
- package/src/renderer/mcp-workspace.ts +164 -50
- package/src/renderer/model-picker-overlay.ts +58 -2
- package/src/renderer/model-workspace.ts +104 -20
- package/src/renderer/process-modal.ts +27 -6
- package/src/renderer/profile-picker-modal.ts +20 -4
- package/src/renderer/search-overlay.ts +25 -5
- package/src/renderer/selection-modal-overlay.ts +46 -14
- package/src/renderer/session-picker-modal.ts +18 -1
- package/src/renderer/settings-modal-helpers.ts +2 -40
- package/src/renderer/settings-modal.ts +83 -50
- package/src/renderer/tool-call.ts +20 -11
- package/src/runtime/agent-runtime-events.ts +6 -6
- package/src/runtime/bootstrap-command-context.ts +7 -1
- package/src/runtime/bootstrap-command-parts.ts +9 -7
- package/src/runtime/bootstrap-core.ts +19 -1
- package/src/runtime/bootstrap-hook-bridge.ts +7 -18
- package/src/runtime/bootstrap-shell.ts +4 -4
- package/src/runtime/bootstrap.ts +31 -22
- package/src/runtime/connected-host-auth.ts +7 -2
- package/src/runtime/diagnostics/panels/index.ts +2 -2
- package/src/runtime/diagnostics/panels/policy.ts +7 -7
- package/src/runtime/index.ts +2 -1
- package/src/runtime/onboarding/apply-file-helpers.ts +66 -0
- package/src/runtime/onboarding/apply.ts +80 -79
- package/src/runtime/onboarding/derivation.ts +5 -8
- package/src/runtime/onboarding/snapshot.ts +0 -15
- package/src/runtime/onboarding/types.ts +8 -19
- package/src/runtime/onboarding/verify.ts +32 -10
- package/src/runtime/operator-token-cleanup.ts +1 -1
- package/src/runtime/services.ts +91 -22
- package/src/runtime/store/selectors/index.ts +3 -3
- package/src/runtime/store/state.ts +1 -4
- package/src/runtime/surface-feature-flags.ts +41 -6
- package/src/runtime/ui-read-models.ts +3 -4
- package/src/runtime/ui-services.ts +6 -6
- package/src/shell/blocking-input.ts +2 -1
- package/src/shell/ui-openers.ts +3 -13
- package/src/tools/agent-analysis-registry-policy.ts +0 -1
- package/src/tools/agent-channel-send-tool.ts +133 -0
- package/src/tools/agent-context-policy.ts +1 -1
- package/src/tools/agent-knowledge-ingest-tool.ts +405 -0
- package/src/tools/agent-knowledge-tool.ts +170 -0
- package/src/tools/agent-local-registry-tool.ts +269 -69
- package/src/tools/agent-media-generate-tool.ts +133 -0
- package/src/tools/agent-notify-tool.ts +143 -0
- package/src/tools/agent-operator-action-tool.ts +137 -0
- package/src/tools/agent-operator-briefing-tool.ts +217 -0
- package/src/tools/agent-reminder-schedule-tool.ts +237 -0
- package/src/tools/agent-tool-policy-guard.ts +8 -8
- package/src/tools/agent-work-plan-tool.ts +256 -0
- package/src/version.ts +1 -1
- package/src/input/commands/policy-dispatch.ts +0 -339
- package/src/input/commands/policy.ts +0 -13
- package/src/panels/panel-picker.ts +0 -105
- package/src/panels/policy-panel.ts +0 -308
- package/src/renderer/panel-picker-overlay.ts +0 -202
|
@@ -8,11 +8,13 @@ import {
|
|
|
8
8
|
type MemoryScope,
|
|
9
9
|
} from '@pellux/goodvibes-sdk/platform/state';
|
|
10
10
|
import { AgentPersonaRegistry, type AgentPersonaRecord } from '../agent/persona-registry.ts';
|
|
11
|
+
import { AgentNoteRegistry, type AgentNoteRecord } from '../agent/note-registry.ts';
|
|
11
12
|
import { AgentRoutineRegistry, type AgentRoutineRecord } from '../agent/routine-registry.ts';
|
|
12
13
|
import { AgentSkillRegistry, type AgentSkillBundleRecord, type AgentSkillRecord } from '../agent/skill-registry.ts';
|
|
13
14
|
import { assertNoSecretLikeMemoryText } from '../agent/memory-safety.ts';
|
|
15
|
+
import { formatAgentRecordOrigin, formatAgentRecordReference, formatAgentRecordReviewState } from '../agent/record-labels.ts';
|
|
14
16
|
|
|
15
|
-
export type AgentLocalRegistryDomain = 'memory' | 'persona' | 'skill' | 'skill_bundle' | 'routine';
|
|
17
|
+
export type AgentLocalRegistryDomain = 'memory' | 'note' | 'persona' | 'skill' | 'skill_bundle' | 'routine';
|
|
16
18
|
export type AgentLocalRegistryAction =
|
|
17
19
|
| 'list'
|
|
18
20
|
| 'search'
|
|
@@ -37,9 +39,11 @@ export interface AgentLocalRegistryToolArgs {
|
|
|
37
39
|
readonly summary?: unknown;
|
|
38
40
|
readonly detail?: unknown;
|
|
39
41
|
readonly confidence?: unknown;
|
|
42
|
+
readonly title?: unknown;
|
|
40
43
|
readonly name?: unknown;
|
|
41
44
|
readonly description?: unknown;
|
|
42
45
|
readonly body?: unknown;
|
|
46
|
+
readonly sourceUrl?: unknown;
|
|
43
47
|
readonly procedure?: unknown;
|
|
44
48
|
readonly steps?: unknown;
|
|
45
49
|
readonly skills?: unknown;
|
|
@@ -51,7 +55,7 @@ export interface AgentLocalRegistryToolArgs {
|
|
|
51
55
|
readonly provenance?: unknown;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
const DOMAINS: readonly AgentLocalRegistryDomain[] = ['memory', 'persona', 'skill', 'skill_bundle', 'routine'];
|
|
58
|
+
const DOMAINS: readonly AgentLocalRegistryDomain[] = ['memory', 'note', 'persona', 'skill', 'skill_bundle', 'routine'];
|
|
55
59
|
const ACTIONS: readonly AgentLocalRegistryAction[] = [
|
|
56
60
|
'list',
|
|
57
61
|
'search',
|
|
@@ -68,6 +72,7 @@ const ACTIONS: readonly AgentLocalRegistryAction[] = [
|
|
|
68
72
|
];
|
|
69
73
|
const MEMORY_CLASSES: readonly MemoryClass[] = ['decision', 'constraint', 'incident', 'pattern', 'fact', 'risk', 'runbook', 'architecture', 'ownership'];
|
|
70
74
|
const MEMORY_SCOPES: readonly MemoryScope[] = ['session', 'project', 'team'];
|
|
75
|
+
const AGENT_TOOL_PROVENANCE = 'agent-local-registry-tool';
|
|
71
76
|
|
|
72
77
|
function isDomain(value: unknown): value is AgentLocalRegistryDomain {
|
|
73
78
|
return typeof value === 'string' && DOMAINS.includes(value as AgentLocalRegistryDomain);
|
|
@@ -151,19 +156,19 @@ function requireSummary(args: AgentLocalRegistryToolArgs): string {
|
|
|
151
156
|
|
|
152
157
|
function requireMemoryClass(args: AgentLocalRegistryToolArgs): MemoryClass {
|
|
153
158
|
const cls = args.cls || 'fact';
|
|
154
|
-
if (!isMemoryClass(cls)) throw new Error(`Invalid memory class. Valid
|
|
159
|
+
if (!isMemoryClass(cls)) throw new Error(`Invalid memory class. Valid values ${MEMORY_CLASSES.join(', ')}.`);
|
|
155
160
|
return cls;
|
|
156
161
|
}
|
|
157
162
|
|
|
158
163
|
function readMemoryScope(args: AgentLocalRegistryToolArgs): MemoryScope {
|
|
159
164
|
const scope = args.scope || 'project';
|
|
160
|
-
if (!isMemoryScope(scope)) throw new Error(`Invalid memory scope. Valid
|
|
165
|
+
if (!isMemoryScope(scope)) throw new Error(`Invalid memory scope. Valid values ${MEMORY_SCOPES.join(', ')}.`);
|
|
161
166
|
return scope;
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
function formatMemory(record: MemoryRecord): string {
|
|
165
|
-
const tags = record.tags.length > 0 ? ` tags
|
|
166
|
-
return `${record.id} ${record.scope}/${record.cls} ${record.reviewState} ${record.confidence}%${tags} ${record.summary}`;
|
|
170
|
+
const tags = record.tags.length > 0 ? ` tags ${record.tags.join(', ')}` : '';
|
|
171
|
+
return `${record.id} ${record.scope}/${record.cls} ${formatAgentRecordReviewState(record.reviewState)} ${record.confidence}%${tags} ${record.summary}`;
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
async function handleMemory(registry: MemoryRegistry, action: AgentLocalRegistryAction, args: AgentLocalRegistryToolArgs): Promise<string> {
|
|
@@ -178,16 +183,17 @@ async function handleMemory(registry: MemoryRegistry, action: AgentLocalRegistry
|
|
|
178
183
|
const records = registry.search({ query, limit: 10 });
|
|
179
184
|
return records.length === 0
|
|
180
185
|
? `Agent-local memory search\nNo Agent-local memory records matched "${query}".`
|
|
181
|
-
: [
|
|
186
|
+
: ['Agent-local memory search', `query ${query || '(all)'}`, ...records.map(formatMemory)].join('\n');
|
|
182
187
|
}
|
|
183
188
|
if (action === 'get') {
|
|
184
189
|
const record = registry.get(requireId(args));
|
|
185
|
-
if (!record) return `Unknown Agent-local memory
|
|
190
|
+
if (!record) return `Unknown Agent-local memory ${readString(args.id)}`;
|
|
186
191
|
return [
|
|
187
192
|
formatMemory(record),
|
|
188
|
-
`created
|
|
189
|
-
`updated
|
|
190
|
-
`
|
|
193
|
+
`created ${new Date(record.createdAt).toISOString()}`,
|
|
194
|
+
`updated ${new Date(record.updatedAt).toISOString()}`,
|
|
195
|
+
`origin ${record.provenance.map((entry) => formatAgentRecordReference({ kind: String(entry.kind), ref: String(entry.ref) })).join(', ') || '(none)'}`,
|
|
196
|
+
`provenance: ${record.provenance.map((entry) => `${String(entry.kind)}:${String(entry.ref)}`).join(',') || '(none)'}`,
|
|
191
197
|
'',
|
|
192
198
|
record.detail || '(no detail)',
|
|
193
199
|
].join('\n');
|
|
@@ -203,9 +209,13 @@ async function handleMemory(registry: MemoryRegistry, action: AgentLocalRegistry
|
|
|
203
209
|
summary,
|
|
204
210
|
detail,
|
|
205
211
|
tags: [...tags],
|
|
206
|
-
provenance: [{ kind: 'event', ref: readString(args.provenance) ||
|
|
212
|
+
provenance: [{ kind: 'event', ref: readString(args.provenance) || AGENT_TOOL_PROVENANCE }],
|
|
207
213
|
});
|
|
208
|
-
return
|
|
214
|
+
return [
|
|
215
|
+
'Created Agent-local memory',
|
|
216
|
+
` id ${record.id}`,
|
|
217
|
+
` summary ${record.summary}`,
|
|
218
|
+
].join('\n');
|
|
209
219
|
}
|
|
210
220
|
if (action === 'update') {
|
|
211
221
|
const summary = readString(args.summary || args.description);
|
|
@@ -218,8 +228,12 @@ async function handleMemory(registry: MemoryRegistry, action: AgentLocalRegistry
|
|
|
218
228
|
tags,
|
|
219
229
|
scope: args.scope === undefined ? undefined : readMemoryScope(args),
|
|
220
230
|
});
|
|
221
|
-
if (!record) return `Unknown Agent-local memory
|
|
222
|
-
return
|
|
231
|
+
if (!record) return `Unknown Agent-local memory ${readString(args.id)}`;
|
|
232
|
+
return [
|
|
233
|
+
'Updated Agent-local memory',
|
|
234
|
+
` id ${record.id}`,
|
|
235
|
+
` summary ${record.summary}`,
|
|
236
|
+
].join('\n');
|
|
223
237
|
}
|
|
224
238
|
if (action === 'review') {
|
|
225
239
|
const record = registry.review(requireId(args), {
|
|
@@ -227,38 +241,118 @@ async function handleMemory(registry: MemoryRegistry, action: AgentLocalRegistry
|
|
|
227
241
|
confidence: readOptionalConfidence(args.confidence),
|
|
228
242
|
reviewedBy: 'agent',
|
|
229
243
|
});
|
|
230
|
-
if (!record) return `Unknown Agent-local memory
|
|
231
|
-
return
|
|
244
|
+
if (!record) return `Unknown Agent-local memory ${readString(args.id)}`;
|
|
245
|
+
return [
|
|
246
|
+
'Reviewed Agent-local memory',
|
|
247
|
+
` id ${record.id}`,
|
|
248
|
+
].join('\n');
|
|
232
249
|
}
|
|
233
250
|
if (action === 'stale') {
|
|
234
251
|
const record = registry.review(requireId(args), {
|
|
235
252
|
state: 'stale',
|
|
236
253
|
staleReason: readString(args.reason) || 'Marked stale by Agent.',
|
|
237
254
|
});
|
|
238
|
-
if (!record) return `Unknown Agent-local memory
|
|
239
|
-
return
|
|
255
|
+
if (!record) return `Unknown Agent-local memory ${readString(args.id)}`;
|
|
256
|
+
return [
|
|
257
|
+
'Marked Agent-local memory stale',
|
|
258
|
+
` id ${record.id}`,
|
|
259
|
+
].join('\n');
|
|
240
260
|
}
|
|
241
261
|
throw new Error(`Action ${action} is not valid for memory.`);
|
|
242
262
|
}
|
|
243
263
|
|
|
264
|
+
function formatNote(note: AgentNoteRecord): string {
|
|
265
|
+
const tags = note.tags.length > 0 ? ` tags ${note.tags.join(', ')}` : '';
|
|
266
|
+
const sourceUrl = note.sourceUrl ? ` source ${note.sourceUrl}` : '';
|
|
267
|
+
return `${note.id} ${formatAgentRecordReviewState(note.reviewState)} ${formatAgentRecordOrigin(note.source, note.provenance)}${tags}${sourceUrl} ${note.title}`;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function listNotes(records: readonly AgentNoteRecord[], title: string): string {
|
|
271
|
+
return records.length === 0
|
|
272
|
+
? `${title}\nNo Agent-local notes.`
|
|
273
|
+
: [title, ...records.map(formatNote)].join('\n');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function handleNote(shellPaths: ShellPathService, action: AgentLocalRegistryAction, args: AgentLocalRegistryToolArgs): string {
|
|
277
|
+
const registry = AgentNoteRegistry.fromShellPaths(shellPaths);
|
|
278
|
+
if (action === 'list') return listNotes(registry.list(), 'Agent-local notes');
|
|
279
|
+
if (action === 'search') return listNotes(registry.search(readString(args.query)), 'Agent-local notes search');
|
|
280
|
+
if (action === 'get') {
|
|
281
|
+
const note = registry.get(requireId(args));
|
|
282
|
+
if (!note) return `Unknown Agent-local note ${readString(args.id)}`;
|
|
283
|
+
return [
|
|
284
|
+
formatNote(note),
|
|
285
|
+
`created ${note.createdAt}`,
|
|
286
|
+
`updated ${note.updatedAt}`,
|
|
287
|
+
`origin ${formatAgentRecordOrigin(note.source, note.provenance)}`,
|
|
288
|
+
'',
|
|
289
|
+
note.body,
|
|
290
|
+
].join('\n');
|
|
291
|
+
}
|
|
292
|
+
if (action === 'create') {
|
|
293
|
+
const note = registry.create({
|
|
294
|
+
title: requireTextField(args.title ?? args.name ?? args.summary, 'title'),
|
|
295
|
+
body: requireTextField(args.body ?? args.detail ?? args.description, 'body'),
|
|
296
|
+
tags: readStringList(args.tags),
|
|
297
|
+
sourceUrl: readString(args.sourceUrl) || undefined,
|
|
298
|
+
source: 'agent',
|
|
299
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
300
|
+
});
|
|
301
|
+
return [
|
|
302
|
+
'Created Agent-local note',
|
|
303
|
+
` id ${note.id}`,
|
|
304
|
+
` title ${note.title}`,
|
|
305
|
+
].join('\n');
|
|
306
|
+
}
|
|
307
|
+
if (action === 'update') {
|
|
308
|
+
const note = registry.update(requireId(args), {
|
|
309
|
+
title: readString(args.title ?? args.name ?? args.summary) || undefined,
|
|
310
|
+
body: readString(args.body ?? args.detail ?? args.description) || undefined,
|
|
311
|
+
tags: args.tags === undefined ? undefined : readStringList(args.tags),
|
|
312
|
+
sourceUrl: args.sourceUrl === undefined ? undefined : readString(args.sourceUrl),
|
|
313
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
314
|
+
});
|
|
315
|
+
return [
|
|
316
|
+
'Updated Agent-local note',
|
|
317
|
+
` id ${note.id}`,
|
|
318
|
+
` title ${note.title}`,
|
|
319
|
+
].join('\n');
|
|
320
|
+
}
|
|
321
|
+
if (action === 'review') {
|
|
322
|
+
const note = registry.markReviewed(requireId(args));
|
|
323
|
+
return [
|
|
324
|
+
'Reviewed Agent-local note',
|
|
325
|
+
` id ${note.id}`,
|
|
326
|
+
].join('\n');
|
|
327
|
+
}
|
|
328
|
+
if (action === 'stale') {
|
|
329
|
+
const note = registry.markStale(requireId(args), readString(args.reason));
|
|
330
|
+
return [
|
|
331
|
+
'Marked Agent-local note stale',
|
|
332
|
+
` id ${note.id}`,
|
|
333
|
+
].join('\n');
|
|
334
|
+
}
|
|
335
|
+
throw new Error(`Action ${action} is not valid for notes.`);
|
|
336
|
+
}
|
|
337
|
+
|
|
244
338
|
function formatPersona(persona: AgentPersonaRecord, activeId: string | null): string {
|
|
245
339
|
const active = persona.id === activeId ? 'active' : 'inactive';
|
|
246
|
-
return `${persona.id} ${active} ${persona.reviewState} ${persona.name} - ${persona.description}`;
|
|
340
|
+
return `${persona.id} ${active} ${formatAgentRecordReviewState(persona.reviewState)} ${persona.name} - ${persona.description}`;
|
|
247
341
|
}
|
|
248
342
|
|
|
249
343
|
function formatSkill(skill: AgentSkillRecord): string {
|
|
250
344
|
const enabled = skill.enabled ? 'enabled' : 'disabled';
|
|
251
|
-
return `${skill.id} ${enabled} ${skill.reviewState} ${skill.name} - ${skill.description}`;
|
|
345
|
+
return `${skill.id} ${enabled} ${formatAgentRecordReviewState(skill.reviewState)} ${skill.name} - ${skill.description}`;
|
|
252
346
|
}
|
|
253
347
|
|
|
254
348
|
function formatSkillBundle(bundle: AgentSkillBundleRecord): string {
|
|
255
349
|
const enabled = bundle.enabled ? 'enabled' : 'disabled';
|
|
256
|
-
return `${bundle.id} ${enabled} ${bundle.reviewState} ${bundle.name} - ${bundle.description} skills
|
|
350
|
+
return `${bundle.id} ${enabled} ${formatAgentRecordReviewState(bundle.reviewState)} ${bundle.name} - ${bundle.description} skills ${bundle.skillIds.join(', ')}`;
|
|
257
351
|
}
|
|
258
352
|
|
|
259
353
|
function formatRoutine(routine: AgentRoutineRecord): string {
|
|
260
354
|
const enabled = routine.enabled ? 'enabled' : 'disabled';
|
|
261
|
-
return `${routine.id} ${enabled} ${routine.reviewState} starts
|
|
355
|
+
return `${routine.id} ${enabled} ${formatAgentRecordReviewState(routine.reviewState)} starts ${routine.startCount} ${routine.name} - ${routine.description}`;
|
|
262
356
|
}
|
|
263
357
|
|
|
264
358
|
function listPersonas(registry: AgentPersonaRegistry, records: readonly AgentPersonaRecord[], title: string): string {
|
|
@@ -292,11 +386,12 @@ function handlePersona(shellPaths: ShellPathService, action: AgentLocalRegistryA
|
|
|
292
386
|
if (action === 'search') return listPersonas(registry, registry.search(readString(args.query)), 'Agent-local personas search');
|
|
293
387
|
if (action === 'get') {
|
|
294
388
|
const persona = registry.get(requireId(args));
|
|
295
|
-
if (!persona) return `Unknown Agent-local persona
|
|
389
|
+
if (!persona) return `Unknown Agent-local persona ${readString(args.id)}`;
|
|
296
390
|
return [
|
|
297
391
|
formatPersona(persona, registry.snapshot().activePersonaId),
|
|
298
|
-
`
|
|
299
|
-
`
|
|
392
|
+
`origin ${formatAgentRecordOrigin(persona.source, persona.provenance)}`,
|
|
393
|
+
`triggers ${persona.triggers.join(', ') || '(manual)'}`,
|
|
394
|
+
`tags ${persona.tags.join(', ') || '(none)'}`,
|
|
300
395
|
'',
|
|
301
396
|
persona.body,
|
|
302
397
|
].join('\n');
|
|
@@ -309,9 +404,13 @@ function handlePersona(shellPaths: ShellPathService, action: AgentLocalRegistryA
|
|
|
309
404
|
tags: readStringList(args.tags),
|
|
310
405
|
triggers: readStringList(args.triggers),
|
|
311
406
|
source: 'agent',
|
|
312
|
-
provenance: readString(args.provenance) ||
|
|
407
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
313
408
|
});
|
|
314
|
-
return
|
|
409
|
+
return [
|
|
410
|
+
'Created Agent-local persona',
|
|
411
|
+
` id ${persona.id}`,
|
|
412
|
+
` name ${persona.name}`,
|
|
413
|
+
].join('\n');
|
|
315
414
|
}
|
|
316
415
|
if (action === 'update') {
|
|
317
416
|
const persona = registry.update(requireId(args), {
|
|
@@ -320,20 +419,40 @@ function handlePersona(shellPaths: ShellPathService, action: AgentLocalRegistryA
|
|
|
320
419
|
body: readString(args.body) || undefined,
|
|
321
420
|
tags: args.tags === undefined ? undefined : readStringList(args.tags),
|
|
322
421
|
triggers: args.triggers === undefined ? undefined : readStringList(args.triggers),
|
|
323
|
-
provenance: readString(args.provenance) ||
|
|
422
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
324
423
|
});
|
|
325
|
-
return
|
|
424
|
+
return [
|
|
425
|
+
'Updated Agent-local persona',
|
|
426
|
+
` id ${persona.id}`,
|
|
427
|
+
` name ${persona.name}`,
|
|
428
|
+
].join('\n');
|
|
326
429
|
}
|
|
327
430
|
if (action === 'use') {
|
|
328
431
|
const persona = registry.setActive(requireId(args));
|
|
329
|
-
return
|
|
432
|
+
return [
|
|
433
|
+
'Active Agent-local persona set',
|
|
434
|
+
` id ${persona.id}`,
|
|
435
|
+
` name ${persona.name}`,
|
|
436
|
+
].join('\n');
|
|
330
437
|
}
|
|
331
438
|
if (action === 'clear_active') {
|
|
332
439
|
registry.clearActive();
|
|
333
440
|
return 'Cleared active Agent-local persona.';
|
|
334
441
|
}
|
|
335
|
-
if (action === 'review')
|
|
336
|
-
|
|
442
|
+
if (action === 'review') {
|
|
443
|
+
const persona = registry.markReviewed(requireId(args));
|
|
444
|
+
return [
|
|
445
|
+
'Reviewed Agent-local persona',
|
|
446
|
+
` id ${persona.id}`,
|
|
447
|
+
].join('\n');
|
|
448
|
+
}
|
|
449
|
+
if (action === 'stale') {
|
|
450
|
+
const persona = registry.markStale(requireId(args), readString(args.reason));
|
|
451
|
+
return [
|
|
452
|
+
'Marked Agent-local persona stale',
|
|
453
|
+
` id ${persona.id}`,
|
|
454
|
+
].join('\n');
|
|
455
|
+
}
|
|
337
456
|
throw new Error(`Action ${action} is not valid for personas.`);
|
|
338
457
|
}
|
|
339
458
|
|
|
@@ -343,11 +462,13 @@ function handleSkill(shellPaths: ShellPathService, action: AgentLocalRegistryAct
|
|
|
343
462
|
if (action === 'search') return listSkills(registry.search(readString(args.query)), 'Agent-local skills search');
|
|
344
463
|
if (action === 'get') {
|
|
345
464
|
const skill = registry.get(requireId(args));
|
|
346
|
-
if (!skill) return `Unknown Agent-local skill
|
|
465
|
+
if (!skill) return `Unknown Agent-local skill ${readString(args.id)}`;
|
|
347
466
|
return [
|
|
348
467
|
formatSkill(skill),
|
|
349
|
-
`
|
|
350
|
-
`
|
|
468
|
+
`origin ${formatAgentRecordOrigin(skill.source, skill.provenance)}`,
|
|
469
|
+
`provenance: ${skill.provenance}`,
|
|
470
|
+
`triggers ${skill.triggers.join(', ') || '(manual)'}`,
|
|
471
|
+
`tags ${skill.tags.join(', ') || '(none)'}`,
|
|
351
472
|
'',
|
|
352
473
|
skill.procedure,
|
|
353
474
|
].join('\n');
|
|
@@ -361,9 +482,13 @@ function handleSkill(shellPaths: ShellPathService, action: AgentLocalRegistryAct
|
|
|
361
482
|
tags: readStringList(args.tags),
|
|
362
483
|
enabled: args.enabled === true,
|
|
363
484
|
source: 'agent',
|
|
364
|
-
provenance: readString(args.provenance) ||
|
|
485
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
365
486
|
});
|
|
366
|
-
return
|
|
487
|
+
return [
|
|
488
|
+
`Created Agent-local skill ${skill.id}`,
|
|
489
|
+
` id ${skill.id}`,
|
|
490
|
+
` name ${skill.name}`,
|
|
491
|
+
].join('\n');
|
|
367
492
|
}
|
|
368
493
|
if (action === 'update') {
|
|
369
494
|
const skill = registry.update(requireId(args), {
|
|
@@ -372,16 +497,36 @@ function handleSkill(shellPaths: ShellPathService, action: AgentLocalRegistryAct
|
|
|
372
497
|
procedure: readString(args.procedure) || undefined,
|
|
373
498
|
triggers: args.triggers === undefined ? undefined : readStringList(args.triggers),
|
|
374
499
|
tags: args.tags === undefined ? undefined : readStringList(args.tags),
|
|
375
|
-
provenance: readString(args.provenance) ||
|
|
500
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
376
501
|
});
|
|
377
|
-
return
|
|
502
|
+
return [
|
|
503
|
+
'Updated Agent-local skill',
|
|
504
|
+
` id ${skill.id}`,
|
|
505
|
+
` name ${skill.name}`,
|
|
506
|
+
].join('\n');
|
|
378
507
|
}
|
|
379
508
|
if (action === 'enable' || action === 'disable') {
|
|
380
509
|
const skill = registry.setEnabled(requireId(args), action === 'enable');
|
|
381
|
-
return
|
|
510
|
+
return [
|
|
511
|
+
`${action === 'enable' ? 'Enabled' : 'Disabled'} Agent-local skill`,
|
|
512
|
+
` id ${skill.id}`,
|
|
513
|
+
` name ${skill.name}`,
|
|
514
|
+
].join('\n');
|
|
515
|
+
}
|
|
516
|
+
if (action === 'review') {
|
|
517
|
+
const skill = registry.markReviewed(requireId(args));
|
|
518
|
+
return [
|
|
519
|
+
'Reviewed Agent-local skill',
|
|
520
|
+
` id ${skill.id}`,
|
|
521
|
+
].join('\n');
|
|
522
|
+
}
|
|
523
|
+
if (action === 'stale') {
|
|
524
|
+
const skill = registry.markStale(requireId(args), readString(args.reason));
|
|
525
|
+
return [
|
|
526
|
+
'Marked Agent-local skill stale',
|
|
527
|
+
` id ${skill.id}`,
|
|
528
|
+
].join('\n');
|
|
382
529
|
}
|
|
383
|
-
if (action === 'review') return `Reviewed Agent-local skill ${registry.markReviewed(requireId(args)).id}.`;
|
|
384
|
-
if (action === 'stale') return `Marked Agent-local skill ${registry.markStale(requireId(args), readString(args.reason)).id} stale.`;
|
|
385
530
|
throw new Error(`Action ${action} is not valid for skills.`);
|
|
386
531
|
}
|
|
387
532
|
|
|
@@ -391,10 +536,11 @@ function handleSkillBundle(shellPaths: ShellPathService, action: AgentLocalRegis
|
|
|
391
536
|
if (action === 'search') return listSkillBundles(registry.searchBundles(readString(args.query)), 'Agent-local skill bundles search');
|
|
392
537
|
if (action === 'get') {
|
|
393
538
|
const bundle = registry.getBundle(requireId(args));
|
|
394
|
-
if (!bundle) return `Unknown Agent-local skill bundle
|
|
539
|
+
if (!bundle) return `Unknown Agent-local skill bundle ${readString(args.id)}`;
|
|
395
540
|
return [
|
|
396
541
|
formatSkillBundle(bundle),
|
|
397
|
-
`
|
|
542
|
+
`origin ${formatAgentRecordOrigin(bundle.source, bundle.provenance)}`,
|
|
543
|
+
`skills ${bundle.skillIds.join(', ')}`,
|
|
398
544
|
'',
|
|
399
545
|
bundle.description,
|
|
400
546
|
].join('\n');
|
|
@@ -406,25 +552,49 @@ function handleSkillBundle(shellPaths: ShellPathService, action: AgentLocalRegis
|
|
|
406
552
|
skillIds: readStringList(args.skillIds ?? args.skills),
|
|
407
553
|
enabled: args.enabled === true,
|
|
408
554
|
source: 'agent',
|
|
409
|
-
provenance: readString(args.provenance) ||
|
|
555
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
410
556
|
});
|
|
411
|
-
return
|
|
557
|
+
return [
|
|
558
|
+
`Created Agent-local skill bundle ${bundle.id}`,
|
|
559
|
+
` id ${bundle.id}`,
|
|
560
|
+
` name ${bundle.name}`,
|
|
561
|
+
].join('\n');
|
|
412
562
|
}
|
|
413
563
|
if (action === 'update') {
|
|
414
564
|
const bundle = registry.updateBundle(requireId(args), {
|
|
415
565
|
name: readString(args.name) || undefined,
|
|
416
566
|
description: readString(args.description) || undefined,
|
|
417
567
|
skillIds: args.skillIds === undefined && args.skills === undefined ? undefined : readStringList(args.skillIds ?? args.skills),
|
|
418
|
-
provenance: readString(args.provenance) ||
|
|
568
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
419
569
|
});
|
|
420
|
-
return
|
|
570
|
+
return [
|
|
571
|
+
'Updated Agent-local skill bundle',
|
|
572
|
+
` id ${bundle.id}`,
|
|
573
|
+
` name ${bundle.name}`,
|
|
574
|
+
].join('\n');
|
|
421
575
|
}
|
|
422
576
|
if (action === 'enable' || action === 'disable') {
|
|
423
577
|
const bundle = registry.setBundleEnabled(requireId(args), action === 'enable');
|
|
424
|
-
return
|
|
578
|
+
return [
|
|
579
|
+
`${action === 'enable' ? 'Enabled' : 'Disabled'} Agent-local skill bundle`,
|
|
580
|
+
` id ${bundle.id}`,
|
|
581
|
+
` name ${bundle.name}`,
|
|
582
|
+
].join('\n');
|
|
583
|
+
}
|
|
584
|
+
if (action === 'review') {
|
|
585
|
+
const bundle = registry.markBundleReviewed(requireId(args));
|
|
586
|
+
return [
|
|
587
|
+
'Reviewed Agent-local skill bundle',
|
|
588
|
+
` id ${bundle.id}`,
|
|
589
|
+
].join('\n');
|
|
590
|
+
}
|
|
591
|
+
if (action === 'stale') {
|
|
592
|
+
const bundle = registry.markBundleStale(requireId(args), readString(args.reason));
|
|
593
|
+
return [
|
|
594
|
+
'Marked Agent-local skill bundle stale',
|
|
595
|
+
` id ${bundle.id}`,
|
|
596
|
+
].join('\n');
|
|
425
597
|
}
|
|
426
|
-
if (action === 'review') return `Reviewed Agent-local skill bundle ${registry.markBundleReviewed(requireId(args)).id}.`;
|
|
427
|
-
if (action === 'stale') return `Marked Agent-local skill bundle ${registry.markBundleStale(requireId(args), readString(args.reason)).id} stale.`;
|
|
428
598
|
throw new Error(`Action ${action} is not valid for skill bundles.`);
|
|
429
599
|
}
|
|
430
600
|
|
|
@@ -434,11 +604,12 @@ function handleRoutine(shellPaths: ShellPathService, action: AgentLocalRegistryA
|
|
|
434
604
|
if (action === 'search') return listRoutines(registry.search(readString(args.query)), 'Agent-local routines search');
|
|
435
605
|
if (action === 'get') {
|
|
436
606
|
const routine = registry.get(requireId(args));
|
|
437
|
-
if (!routine) return `Unknown Agent-local routine
|
|
607
|
+
if (!routine) return `Unknown Agent-local routine ${readString(args.id)}`;
|
|
438
608
|
return [
|
|
439
609
|
formatRoutine(routine),
|
|
440
|
-
`
|
|
441
|
-
`
|
|
610
|
+
`origin ${formatAgentRecordOrigin(routine.source, routine.provenance)}`,
|
|
611
|
+
`triggers ${routine.triggers.join(', ') || '(manual)'}`,
|
|
612
|
+
`tags ${routine.tags.join(', ') || '(none)'}`,
|
|
442
613
|
'',
|
|
443
614
|
routine.steps,
|
|
444
615
|
].join('\n');
|
|
@@ -452,9 +623,13 @@ function handleRoutine(shellPaths: ShellPathService, action: AgentLocalRegistryA
|
|
|
452
623
|
tags: readStringList(args.tags),
|
|
453
624
|
enabled: args.enabled === true,
|
|
454
625
|
source: 'agent',
|
|
455
|
-
provenance: readString(args.provenance) ||
|
|
626
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
456
627
|
});
|
|
457
|
-
return
|
|
628
|
+
return [
|
|
629
|
+
'Created Agent-local routine',
|
|
630
|
+
` id ${routine.id}`,
|
|
631
|
+
` name ${routine.name}`,
|
|
632
|
+
].join('\n');
|
|
458
633
|
}
|
|
459
634
|
if (action === 'update') {
|
|
460
635
|
const routine = registry.update(requireId(args), {
|
|
@@ -463,25 +638,47 @@ function handleRoutine(shellPaths: ShellPathService, action: AgentLocalRegistryA
|
|
|
463
638
|
steps: readString(args.steps) || undefined,
|
|
464
639
|
triggers: args.triggers === undefined ? undefined : readStringList(args.triggers),
|
|
465
640
|
tags: args.tags === undefined ? undefined : readStringList(args.tags),
|
|
466
|
-
provenance: readString(args.provenance) ||
|
|
641
|
+
provenance: readString(args.provenance) || AGENT_TOOL_PROVENANCE,
|
|
467
642
|
});
|
|
468
|
-
return
|
|
643
|
+
return [
|
|
644
|
+
'Updated Agent-local routine',
|
|
645
|
+
` id ${routine.id}`,
|
|
646
|
+
` name ${routine.name}`,
|
|
647
|
+
].join('\n');
|
|
469
648
|
}
|
|
470
649
|
if (action === 'enable' || action === 'disable') {
|
|
471
650
|
const routine = registry.setEnabled(requireId(args), action === 'enable');
|
|
472
|
-
return
|
|
651
|
+
return [
|
|
652
|
+
`${action === 'enable' ? 'Enabled' : 'Disabled'} Agent-local routine`,
|
|
653
|
+
` id ${routine.id}`,
|
|
654
|
+
` name ${routine.name}`,
|
|
655
|
+
].join('\n');
|
|
473
656
|
}
|
|
474
657
|
if (action === 'start') {
|
|
475
658
|
const routine = registry.markStarted(requireId(args));
|
|
476
659
|
return [
|
|
477
|
-
|
|
660
|
+
'Started Agent-local routine',
|
|
661
|
+
` id ${routine.id}`,
|
|
662
|
+
` name ${routine.name}`,
|
|
478
663
|
'Policy: same main conversation; no hidden background job, connected-host mutation, or external side effect was started.',
|
|
479
664
|
'',
|
|
480
665
|
routine.steps,
|
|
481
666
|
].join('\n');
|
|
482
667
|
}
|
|
483
|
-
if (action === 'review')
|
|
484
|
-
|
|
668
|
+
if (action === 'review') {
|
|
669
|
+
const routine = registry.markReviewed(requireId(args));
|
|
670
|
+
return [
|
|
671
|
+
'Reviewed Agent-local routine',
|
|
672
|
+
` id ${routine.id}`,
|
|
673
|
+
].join('\n');
|
|
674
|
+
}
|
|
675
|
+
if (action === 'stale') {
|
|
676
|
+
const routine = registry.markStale(requireId(args), readString(args.reason));
|
|
677
|
+
return [
|
|
678
|
+
'Marked Agent-local routine stale',
|
|
679
|
+
` id ${routine.id}`,
|
|
680
|
+
].join('\n');
|
|
681
|
+
}
|
|
485
682
|
throw new Error(`Action ${action} is not valid for routines.`);
|
|
486
683
|
}
|
|
487
684
|
|
|
@@ -490,9 +687,9 @@ export function createAgentLocalRegistryTool(shellPaths: ShellPathService, memor
|
|
|
490
687
|
definition: {
|
|
491
688
|
name: 'agent_local_registry',
|
|
492
689
|
description: [
|
|
493
|
-
'Inspect and maintain GoodVibes Agent-local memory, personas, skills, and routines from the main conversation.',
|
|
494
|
-
'Use this for safe self-improvement: remember durable non-secret facts, create or refine reusable behavior, bundle related skills, enable skills/routines, choose personas, review/stale records, and start routines in the same serial conversation.',
|
|
495
|
-
'This tool cannot delete records, create schedules, mutate connected
|
|
690
|
+
'Inspect and maintain GoodVibes Agent-local notes, memory, personas, skills, and routines from the main conversation.',
|
|
691
|
+
'Use this for safe self-improvement: capture scratchpad notes, remember durable non-secret facts, create or refine reusable behavior, bundle related skills, enable skills/routines, choose personas, review/stale records, and start routines in the same serial conversation.',
|
|
692
|
+
'This tool cannot delete records, create schedules, mutate connected hosts, send messages, run background jobs, or delegate build work.',
|
|
496
693
|
].join(' '),
|
|
497
694
|
parameters: {
|
|
498
695
|
type: 'object',
|
|
@@ -506,9 +703,11 @@ export function createAgentLocalRegistryTool(shellPaths: ShellPathService, memor
|
|
|
506
703
|
summary: { type: 'string', description: 'Memory summary when domain is memory.' },
|
|
507
704
|
detail: { type: 'string', description: 'Memory detail when domain is memory.' },
|
|
508
705
|
confidence: { type: 'number', description: 'Memory review confidence from 0 to 100.' },
|
|
706
|
+
title: { type: 'string', description: 'Note title when domain is note.' },
|
|
509
707
|
name: { type: 'string' },
|
|
510
708
|
description: { type: 'string' },
|
|
511
|
-
body: { type: 'string', description: '
|
|
709
|
+
body: { type: 'string', description: 'Note body or persona body/instructions.' },
|
|
710
|
+
sourceUrl: { type: 'string', description: 'Optional source URL when domain is note.' },
|
|
512
711
|
procedure: { type: 'string', description: 'Skill procedure.' },
|
|
513
712
|
steps: { type: 'string', description: 'Routine steps.' },
|
|
514
713
|
skills: { type: 'array', items: { type: 'string' }, description: 'Skill ids for skill_bundle create/update.' },
|
|
@@ -526,10 +725,11 @@ export function createAgentLocalRegistryTool(shellPaths: ShellPathService, memor
|
|
|
526
725
|
},
|
|
527
726
|
execute: async (rawArgs: unknown) => {
|
|
528
727
|
const args = rawArgs as AgentLocalRegistryToolArgs;
|
|
529
|
-
if (!isDomain(args.domain)) return registryError(`Unknown domain. Valid
|
|
530
|
-
if (!isAction(args.action)) return registryError(`Unknown action. Valid
|
|
728
|
+
if (!isDomain(args.domain)) return registryError(`Unknown domain. Valid values ${DOMAINS.join(', ')}.`);
|
|
729
|
+
if (!isAction(args.action)) return registryError(`Unknown action. Valid values ${ACTIONS.join(', ')}.`);
|
|
531
730
|
try {
|
|
532
731
|
if (args.domain === 'memory') return registryOutput(await handleMemory(memoryRegistry, args.action, args));
|
|
732
|
+
if (args.domain === 'note') return registryOutput(handleNote(shellPaths, args.action, args));
|
|
533
733
|
if (args.domain === 'persona') return registryOutput(handlePersona(shellPaths, args.action, args));
|
|
534
734
|
if (args.domain === 'skill') return registryOutput(handleSkill(shellPaths, args.action, args));
|
|
535
735
|
if (args.domain === 'skill_bundle') return registryOutput(handleSkillBundle(shellPaths, args.action, args));
|