@pellux/goodvibes-agent 0.1.116 → 0.1.117
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 +41 -663
- package/README.md +38 -52
- package/dist/package/main.js +37826 -35924
- package/docs/README.md +5 -4
- package/docs/{connected-services.md → connected-host.md} +18 -10
- package/docs/getting-started.md +41 -44
- package/docs/release-and-publishing.md +6 -4
- package/package.json +3 -3
- package/src/agent/behavior-discovery-summary.ts +1 -3
- package/src/agent/persona-discovery.ts +1 -3
- package/src/agent/persona-registry.ts +5 -3
- package/src/agent/reminder-schedule-format.ts +6 -6
- package/src/agent/reminder-schedule.ts +1 -1
- package/src/agent/routine-registry.ts +43 -4
- package/src/agent/routine-schedule-format.ts +6 -6
- package/src/agent/routine-schedule-promotion.ts +1 -1
- package/src/agent/routine-schedule-receipts.ts +1 -1
- package/src/agent/runtime-profile-starters.ts +3 -3
- package/src/agent/runtime-profile.ts +78 -0
- package/src/agent/skill-registry.ts +190 -13
- package/src/cli/agent-knowledge-command.ts +2 -2
- package/src/cli/agent-knowledge-format.ts +2 -2
- package/src/cli/agent-knowledge-runtime.ts +1 -1
- package/src/cli/bundle-command.ts +1 -1
- package/src/cli/entrypoint.ts +16 -7
- package/src/cli/help.ts +26 -19
- package/src/cli/local-library-command.ts +75 -21
- package/src/cli/management-commands.ts +7 -6
- package/src/cli/management.ts +6 -51
- package/src/cli/parser.ts +23 -2
- package/src/cli/profiles-command.ts +119 -1
- package/src/cli/routines-command.ts +139 -11
- package/src/cli/service-posture.ts +11 -11
- package/src/cli/status.ts +21 -25
- package/src/input/agent-workspace-access-command-editor-submission.ts +149 -0
- package/src/input/agent-workspace-access-command-editors.ts +170 -0
- package/src/input/agent-workspace-activation.ts +2 -1
- package/src/input/agent-workspace-basic-command-editor-submission.ts +345 -92
- package/src/input/agent-workspace-basic-command-editors.ts +480 -7
- package/src/input/agent-workspace-categories.ts +175 -15
- package/src/input/agent-workspace-channel-command-editor-submission.ts +49 -0
- package/src/input/agent-workspace-channel-command-editors.ts +47 -0
- package/src/input/agent-workspace-command-editor.ts +23 -1
- package/src/input/agent-workspace-delegation-editor-submission.ts +55 -0
- package/src/input/agent-workspace-editors.ts +27 -0
- package/src/input/agent-workspace-knowledge-command-editor-submission.ts +132 -0
- package/src/input/agent-workspace-knowledge-command-editors.ts +110 -0
- package/src/input/agent-workspace-learned-behavior.ts +67 -0
- package/src/input/agent-workspace-library-command-editor-submission.ts +50 -0
- package/src/input/agent-workspace-library-command-editors.ts +35 -0
- package/src/input/agent-workspace-mcp-command-editor-submission.ts +95 -0
- package/src/input/agent-workspace-memory-command-editor-submission.ts +232 -0
- package/src/input/agent-workspace-memory-command-editors.ts +180 -0
- package/src/input/agent-workspace-navigation.ts +45 -0
- package/src/input/agent-workspace-notify-editor-submission.ts +107 -0
- package/src/input/agent-workspace-operations-command-editor-submission.ts +146 -0
- package/src/input/agent-workspace-operations-command-editors.ts +119 -0
- package/src/input/agent-workspace-provider-command-editor-submission.ts +155 -0
- package/src/input/agent-workspace-provider-command-editors.ts +93 -0
- package/src/input/agent-workspace-requirements.ts +11 -0
- package/src/input/agent-workspace-secret-editor-submission.ts +153 -0
- package/src/input/agent-workspace-session-command-editor-submission.ts +199 -0
- package/src/input/agent-workspace-session-command-editors.ts +249 -0
- package/src/input/agent-workspace-setup.ts +24 -14
- package/src/input/agent-workspace-skill-bundle-command-editor-submission.ts +101 -0
- package/src/input/agent-workspace-skill-bundle-command-editors.ts +110 -0
- package/src/input/agent-workspace-snapshot.ts +50 -8
- package/src/input/agent-workspace-task-command-editor-submission.ts +61 -0
- package/src/input/agent-workspace-task-command-editors.ts +47 -0
- package/src/input/agent-workspace-types.ts +120 -0
- package/src/input/agent-workspace-voice-media.ts +1 -1
- package/src/input/agent-workspace-workplan-editor-submission.ts +153 -0
- package/src/input/agent-workspace.ts +47 -37
- package/src/input/command-registry.ts +1 -1
- package/src/input/commands/agent-runtime-profile-runtime.ts +89 -4
- package/src/input/commands/agent-skills-runtime.ts +76 -12
- package/src/input/commands/agent-workspace-runtime.ts +4 -3
- package/src/input/commands/brief-runtime.ts +38 -9
- package/src/input/commands/channels-runtime.ts +3 -3
- package/src/input/commands/compat-runtime.ts +32 -0
- package/src/input/commands/health-runtime.ts +22 -24
- package/src/input/commands/knowledge.ts +26 -5
- package/src/input/commands/local-provider-runtime.ts +7 -3
- package/src/input/commands/local-setup-review.ts +4 -14
- package/src/input/commands/mcp-runtime.ts +8 -12
- package/src/input/commands/operator-runtime.ts +8 -67
- package/src/input/commands/personas-runtime.ts +1 -1
- package/src/input/commands/platform-access-runtime.ts +7 -70
- package/src/input/commands/policy-dispatch.ts +1 -1
- package/src/input/commands/policy.ts +1 -5
- package/src/input/commands/product-runtime.ts +2 -2
- package/src/input/commands/qrcode-runtime.ts +6 -4
- package/src/input/commands/routines-runtime.ts +44 -6
- package/src/input/commands/runtime-services.ts +1 -14
- package/src/input/commands/security-runtime.ts +3 -8
- package/src/input/commands/session-content.ts +1 -1
- package/src/input/commands/session-workflow.ts +5 -14
- package/src/input/commands/shell-core.ts +8 -2
- package/src/input/commands/subscription-runtime.ts +1 -6
- package/src/input/commands/support-bundle-runtime.ts +53 -0
- package/src/input/commands/tasks-runtime.ts +2 -2
- package/src/input/commands.ts +4 -0
- package/src/input/feed-context-factory.ts +0 -1
- package/src/input/handler-content-actions.ts +0 -25
- package/src/input/handler-feed.ts +0 -2
- package/src/input/handler-interactions.ts +2 -31
- package/src/input/handler-onboarding.ts +29 -12
- package/src/input/handler-shortcuts.ts +1 -3
- package/src/input/handler.ts +4 -7
- package/src/input/keybindings.ts +9 -9
- package/src/input/mcp-workspace.ts +90 -26
- package/src/input/onboarding/handler-onboarding-routes.ts +3 -1
- package/src/input/onboarding/onboarding-wizard-apply.ts +49 -0
- package/src/input/onboarding/onboarding-wizard-helpers.ts +1 -1
- package/src/input/onboarding/onboarding-wizard-operator-steps.ts +81 -3
- package/src/input/onboarding/onboarding-wizard-steps.ts +14 -7
- package/src/input/onboarding/onboarding-wizard-types.ts +1 -0
- package/src/input/onboarding/onboarding-wizard.ts +19 -2
- package/src/input/profile-picker-modal.ts +2 -2
- package/src/input/settings-modal-agent-policy.ts +6 -6
- package/src/input/settings-modal-subscriptions.ts +3 -3
- package/src/input/settings-modal.ts +14 -14
- package/src/main.ts +0 -2
- package/src/panels/automation-control-panel.ts +3 -3
- package/src/panels/builtin/agent.ts +1 -1
- package/src/panels/builtin/operations.ts +2 -2
- package/src/panels/builtin/session.ts +26 -18
- package/src/panels/builtin/shared.ts +6 -6
- package/src/panels/project-planning-panel.ts +1 -1
- package/src/panels/provider-health-domains.ts +3 -3
- package/src/panels/qr-panel.ts +44 -20
- package/src/panels/subscription-panel.ts +3 -3
- package/src/panels/system-messages-panel.ts +2 -2
- package/src/panels/tasks-panel.ts +4 -4
- package/src/planning/project-planning-coordinator.ts +2 -2
- package/src/renderer/agent-workspace.ts +26 -5
- package/src/renderer/block-actions.ts +1 -3
- package/src/renderer/help-overlay.ts +13 -8
- package/src/renderer/mcp-workspace.ts +32 -13
- package/src/renderer/model-picker-overlay.ts +0 -1
- package/src/renderer/model-workspace.ts +0 -2
- package/src/renderer/onboarding/onboarding-wizard.ts +20 -4
- package/src/renderer/panel-picker-overlay.ts +1 -1
- package/src/renderer/profile-picker-modal.ts +2 -2
- package/src/renderer/settings-modal-helpers.ts +23 -23
- package/src/renderer/settings-modal.ts +18 -18
- package/src/renderer/system-message.ts +1 -1
- package/src/runtime/agent-runtime-events.ts +129 -0
- package/src/runtime/bootstrap-command-parts.ts +3 -2
- package/src/runtime/bootstrap-core.ts +4 -64
- package/src/runtime/bootstrap-shell.ts +42 -4
- package/src/runtime/bootstrap.ts +8 -27
- package/src/runtime/connected-host-auth.ts +42 -0
- package/src/runtime/diagnostics/panels/panel-resources.ts +1 -1
- package/src/runtime/index.ts +1 -5
- package/src/runtime/onboarding/apply.ts +213 -0
- package/src/runtime/onboarding/derivation.ts +5 -5
- package/src/runtime/onboarding/snapshot.ts +2 -2
- package/src/runtime/onboarding/types.ts +26 -1
- package/src/runtime/onboarding/verify.ts +81 -2
- package/src/runtime/operator-token-cleanup.ts +2 -2
- package/src/runtime/services.ts +27 -12
- package/src/shell/service-settings-sync.ts +7 -7
- package/src/shell/ui-openers.ts +27 -38
- package/src/tools/agent-local-registry-tool.ts +10 -4
- package/src/tools/agent-tool-policy-guard.ts +5 -7
- package/src/version.ts +1 -1
- package/src/cli/package-verification.ts +0 -274
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import type { AgentWorkspaceAction, AgentWorkspaceActionResult, AgentWorkspaceEditorKind, AgentWorkspaceLocalEditor } from './agent-workspace-types.ts';
|
|
2
|
+
import { quoteSlashCommandArg } from './slash-command-parser.ts';
|
|
3
|
+
import type { AgentWorkspaceMemoryCommandEditorKind } from './agent-workspace-memory-command-editors.ts';
|
|
4
|
+
import { isAgentWorkspaceMemoryCommandEditorKind } from './agent-workspace-memory-command-editors.ts';
|
|
5
|
+
|
|
6
|
+
type AgentWorkspaceFieldReader = (fieldId: string) => string;
|
|
7
|
+
|
|
8
|
+
export type AgentWorkspaceMemoryCommandEditorSubmission =
|
|
9
|
+
| {
|
|
10
|
+
readonly kind: 'editor';
|
|
11
|
+
readonly editor: AgentWorkspaceLocalEditor;
|
|
12
|
+
readonly status: string;
|
|
13
|
+
readonly actionResult?: AgentWorkspaceActionResult;
|
|
14
|
+
}
|
|
15
|
+
| {
|
|
16
|
+
readonly kind: 'dispatch';
|
|
17
|
+
readonly command: string;
|
|
18
|
+
readonly status: string;
|
|
19
|
+
readonly actionResult: AgentWorkspaceActionResult;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type MemoryDispatchSafety = AgentWorkspaceAction['safety'];
|
|
23
|
+
|
|
24
|
+
function isAffirmative(value: string): boolean {
|
|
25
|
+
return /^(y|yes|true)$/i.test(value.trim());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function splitCommaList(value: string): readonly string[] {
|
|
29
|
+
return value.split(',').map((entry) => entry.trim()).filter(Boolean);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function unconfirmed(editor: AgentWorkspaceLocalEditor, label: string): AgentWorkspaceMemoryCommandEditorSubmission {
|
|
33
|
+
return {
|
|
34
|
+
kind: 'editor',
|
|
35
|
+
editor: { ...editor, message: `${label} not confirmed. Type yes, then press Enter.` },
|
|
36
|
+
status: `${label} not confirmed.`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function dispatch(
|
|
41
|
+
command: string,
|
|
42
|
+
title: string,
|
|
43
|
+
status: string,
|
|
44
|
+
detail: string,
|
|
45
|
+
safety: MemoryDispatchSafety,
|
|
46
|
+
): AgentWorkspaceMemoryCommandEditorSubmission {
|
|
47
|
+
return {
|
|
48
|
+
kind: 'dispatch',
|
|
49
|
+
command,
|
|
50
|
+
status,
|
|
51
|
+
actionResult: {
|
|
52
|
+
kind: 'dispatched',
|
|
53
|
+
title,
|
|
54
|
+
detail,
|
|
55
|
+
command,
|
|
56
|
+
safety,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function appendOptional(parts: string[], flag: string, value: string): void {
|
|
62
|
+
if (value.trim().length > 0) {
|
|
63
|
+
parts.push(flag, quoteSlashCommandArg(value));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function requireConfirmation(
|
|
68
|
+
editor: AgentWorkspaceLocalEditor,
|
|
69
|
+
readField: AgentWorkspaceFieldReader,
|
|
70
|
+
label: string,
|
|
71
|
+
): AgentWorkspaceMemoryCommandEditorSubmission | null {
|
|
72
|
+
return isAffirmative(readField('confirm')) ? null : unconfirmed(editor, label);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function isAgentWorkspaceMemoryCommandSubmissionKind(kind: AgentWorkspaceEditorKind): kind is AgentWorkspaceMemoryCommandEditorKind {
|
|
76
|
+
return isAgentWorkspaceMemoryCommandEditorKind(kind);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function buildAgentWorkspaceMemoryCommandEditorSubmission(
|
|
80
|
+
editor: AgentWorkspaceLocalEditor,
|
|
81
|
+
readField: AgentWorkspaceFieldReader,
|
|
82
|
+
): AgentWorkspaceMemoryCommandEditorSubmission {
|
|
83
|
+
if (editor.kind === 'memory-search') {
|
|
84
|
+
const parts = ['/memory', 'search'];
|
|
85
|
+
const query = readField('query');
|
|
86
|
+
if (query.length > 0) parts.push(quoteSlashCommandArg(query));
|
|
87
|
+
appendOptional(parts, '--scope', readField('scope'));
|
|
88
|
+
appendOptional(parts, '--cls', readField('class'));
|
|
89
|
+
appendOptional(parts, '--limit', readField('limit'));
|
|
90
|
+
if (isAffirmative(readField('semantic'))) parts.push('--semantic');
|
|
91
|
+
const command = parts.join(' ');
|
|
92
|
+
return dispatch(
|
|
93
|
+
command,
|
|
94
|
+
'Opening Agent memory search',
|
|
95
|
+
'Opening Agent memory search.',
|
|
96
|
+
'The workspace handed an Agent-local memory search command to the shell-owned command router.',
|
|
97
|
+
'read-only',
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (editor.kind === 'memory-get') {
|
|
102
|
+
const command = `/memory get ${quoteSlashCommandArg(readField('id'))}`;
|
|
103
|
+
return dispatch(
|
|
104
|
+
command,
|
|
105
|
+
'Opening Agent memory record',
|
|
106
|
+
'Opening Agent memory record.',
|
|
107
|
+
'The workspace handed an Agent-local memory lookup command to the shell-owned command router.',
|
|
108
|
+
'read-only',
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (editor.kind === 'memory-explain') {
|
|
113
|
+
const parts = ['/memory', 'explain', quoteSlashCommandArg(readField('task'))];
|
|
114
|
+
const scopes = splitCommaList(readField('scopes'));
|
|
115
|
+
if (scopes.length > 0) {
|
|
116
|
+
parts.push('--scope');
|
|
117
|
+
for (const scope of scopes) parts.push(quoteSlashCommandArg(scope));
|
|
118
|
+
}
|
|
119
|
+
const command = parts.join(' ');
|
|
120
|
+
return dispatch(
|
|
121
|
+
command,
|
|
122
|
+
'Opening Agent memory explanation',
|
|
123
|
+
'Opening Agent memory explanation.',
|
|
124
|
+
'The workspace handed an Agent-local memory explanation command to the shell-owned command router.',
|
|
125
|
+
'read-only',
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (editor.kind === 'memory-promote') {
|
|
130
|
+
const confirmation = requireConfirmation(editor, readField, 'Memory promotion');
|
|
131
|
+
if (confirmation) return confirmation;
|
|
132
|
+
const command = `/memory promote ${quoteSlashCommandArg(readField('id'))} ${quoteSlashCommandArg(readField('scope'))} --yes`;
|
|
133
|
+
return dispatch(
|
|
134
|
+
command,
|
|
135
|
+
'Opening Agent memory promotion',
|
|
136
|
+
'Opening Agent memory promotion.',
|
|
137
|
+
'The workspace handed a confirmed Agent-local memory promotion command to the shell-owned command router.',
|
|
138
|
+
'safe',
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (editor.kind === 'memory-link') {
|
|
143
|
+
const confirmation = requireConfirmation(editor, readField, 'Memory link');
|
|
144
|
+
if (confirmation) return confirmation;
|
|
145
|
+
const command = `/memory link ${quoteSlashCommandArg(readField('fromId'))} ${quoteSlashCommandArg(readField('toId'))} ${quoteSlashCommandArg(readField('relation'))} --yes`;
|
|
146
|
+
return dispatch(
|
|
147
|
+
command,
|
|
148
|
+
'Opening Agent memory link',
|
|
149
|
+
'Opening Agent memory link.',
|
|
150
|
+
'The workspace handed a confirmed Agent-local memory link command to the shell-owned command router.',
|
|
151
|
+
'safe',
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (editor.kind === 'memory-export') {
|
|
156
|
+
const confirmation = requireConfirmation(editor, readField, 'Memory bundle export');
|
|
157
|
+
if (confirmation) return confirmation;
|
|
158
|
+
const parts = ['/memory', 'export', quoteSlashCommandArg(readField('path'))];
|
|
159
|
+
appendOptional(parts, '--scope', readField('scope'));
|
|
160
|
+
appendOptional(parts, '--cls', readField('class'));
|
|
161
|
+
parts.push('--yes');
|
|
162
|
+
return dispatch(
|
|
163
|
+
parts.join(' '),
|
|
164
|
+
'Opening Agent memory bundle export',
|
|
165
|
+
'Opening Agent memory bundle export.',
|
|
166
|
+
'The workspace handed a confirmed Agent-local memory export command to the shell-owned command router.',
|
|
167
|
+
'safe',
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (editor.kind === 'memory-import') {
|
|
172
|
+
const confirmation = requireConfirmation(editor, readField, 'Memory bundle import');
|
|
173
|
+
if (confirmation) return confirmation;
|
|
174
|
+
const command = `/memory import ${quoteSlashCommandArg(readField('path'))} --yes`;
|
|
175
|
+
return dispatch(
|
|
176
|
+
command,
|
|
177
|
+
'Opening Agent memory bundle import',
|
|
178
|
+
'Opening Agent memory bundle import.',
|
|
179
|
+
'The workspace handed a confirmed Agent-local memory import command to the shell-owned command router.',
|
|
180
|
+
'safe',
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (editor.kind === 'memory-handoff-export') {
|
|
185
|
+
const confirmation = requireConfirmation(editor, readField, 'Memory handoff export');
|
|
186
|
+
if (confirmation) return confirmation;
|
|
187
|
+
const parts = ['/memory', 'handoff-export', quoteSlashCommandArg(readField('path'))];
|
|
188
|
+
appendOptional(parts, '--scope', readField('scope'));
|
|
189
|
+
parts.push('--yes');
|
|
190
|
+
return dispatch(
|
|
191
|
+
parts.join(' '),
|
|
192
|
+
'Opening Agent memory handoff export',
|
|
193
|
+
'Opening Agent memory handoff export.',
|
|
194
|
+
'The workspace handed a confirmed Agent-local memory handoff export command to the shell-owned command router.',
|
|
195
|
+
'safe',
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (editor.kind === 'memory-handoff-inspect') {
|
|
200
|
+
const command = `/memory handoff-inspect ${quoteSlashCommandArg(readField('path'))}`;
|
|
201
|
+
return dispatch(
|
|
202
|
+
command,
|
|
203
|
+
'Opening Agent memory handoff inspection',
|
|
204
|
+
'Opening Agent memory handoff inspection.',
|
|
205
|
+
'The workspace handed an Agent-local memory handoff inspection command to the shell-owned command router.',
|
|
206
|
+
'read-only',
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (editor.kind === 'memory-handoff-import') {
|
|
211
|
+
const confirmation = requireConfirmation(editor, readField, 'Memory handoff import');
|
|
212
|
+
if (confirmation) return confirmation;
|
|
213
|
+
const command = `/memory handoff-import ${quoteSlashCommandArg(readField('path'))} --yes`;
|
|
214
|
+
return dispatch(
|
|
215
|
+
command,
|
|
216
|
+
'Opening Agent memory handoff import',
|
|
217
|
+
'Opening Agent memory handoff import.',
|
|
218
|
+
'The workspace handed a confirmed Agent-local memory handoff import command to the shell-owned command router.',
|
|
219
|
+
'safe',
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const confirmation = requireConfirmation(editor, readField, 'Memory vector rebuild');
|
|
224
|
+
if (confirmation) return confirmation;
|
|
225
|
+
return dispatch(
|
|
226
|
+
'/memory vector rebuild',
|
|
227
|
+
'Opening Agent memory vector rebuild',
|
|
228
|
+
'Opening Agent memory vector rebuild.',
|
|
229
|
+
'The workspace handed a confirmed Agent-local memory vector rebuild command to the shell-owned command router.',
|
|
230
|
+
'safe',
|
|
231
|
+
);
|
|
232
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { AgentWorkspaceEditorKind, AgentWorkspaceLocalEditor } from './agent-workspace-types.ts';
|
|
2
|
+
|
|
3
|
+
export type AgentWorkspaceMemoryCommandEditorKind = Extract<
|
|
4
|
+
AgentWorkspaceEditorKind,
|
|
5
|
+
| 'memory-search'
|
|
6
|
+
| 'memory-get'
|
|
7
|
+
| 'memory-explain'
|
|
8
|
+
| 'memory-promote'
|
|
9
|
+
| 'memory-link'
|
|
10
|
+
| 'memory-export'
|
|
11
|
+
| 'memory-import'
|
|
12
|
+
| 'memory-handoff-export'
|
|
13
|
+
| 'memory-handoff-inspect'
|
|
14
|
+
| 'memory-handoff-import'
|
|
15
|
+
| 'memory-vector-rebuild'
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export function isAgentWorkspaceMemoryCommandEditorKind(kind: AgentWorkspaceEditorKind): kind is AgentWorkspaceMemoryCommandEditorKind {
|
|
19
|
+
return kind === 'memory-search'
|
|
20
|
+
|| kind === 'memory-get'
|
|
21
|
+
|| kind === 'memory-explain'
|
|
22
|
+
|| kind === 'memory-promote'
|
|
23
|
+
|| kind === 'memory-link'
|
|
24
|
+
|| kind === 'memory-export'
|
|
25
|
+
|| kind === 'memory-import'
|
|
26
|
+
|| kind === 'memory-handoff-export'
|
|
27
|
+
|| kind === 'memory-handoff-inspect'
|
|
28
|
+
|| kind === 'memory-handoff-import'
|
|
29
|
+
|| kind === 'memory-vector-rebuild';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function createAgentWorkspaceMemoryCommandEditor(kind: AgentWorkspaceMemoryCommandEditorKind): AgentWorkspaceLocalEditor {
|
|
33
|
+
if (kind === 'memory-search') {
|
|
34
|
+
return {
|
|
35
|
+
kind,
|
|
36
|
+
mode: 'create',
|
|
37
|
+
title: 'Search Agent Memory',
|
|
38
|
+
selectedFieldIndex: 0,
|
|
39
|
+
message: 'Search Agent-local memory only. This does not query default Knowledge/Wiki or other product routes.',
|
|
40
|
+
fields: [
|
|
41
|
+
{ id: 'query', label: 'Query', value: '', required: false, multiline: false, hint: 'Optional text query. Blank searches by filters.' },
|
|
42
|
+
{ id: 'scope', label: 'Scope', value: '', required: false, multiline: false, hint: 'Optional session, project, or team.' },
|
|
43
|
+
{ id: 'class', label: 'Class', value: '', required: false, multiline: false, hint: 'Optional fact, constraint, pattern, runbook, risk, etc.' },
|
|
44
|
+
{ id: 'limit', label: 'Limit', value: '', required: false, multiline: false, hint: 'Optional result limit.' },
|
|
45
|
+
{ id: 'semantic', label: 'Semantic', value: 'no', required: false, multiline: false, hint: 'yes/no. Uses the local vector index when available.' },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (kind === 'memory-get') {
|
|
50
|
+
return {
|
|
51
|
+
kind,
|
|
52
|
+
mode: 'create',
|
|
53
|
+
title: 'Show Agent Memory',
|
|
54
|
+
selectedFieldIndex: 0,
|
|
55
|
+
message: 'Show one Agent-local memory record with provenance and links.',
|
|
56
|
+
fields: [
|
|
57
|
+
{ id: 'id', label: 'Memory id', value: '', required: true, multiline: false, hint: 'Existing Agent memory id.' },
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (kind === 'memory-explain') {
|
|
62
|
+
return {
|
|
63
|
+
kind,
|
|
64
|
+
mode: 'create',
|
|
65
|
+
title: 'Explain Memory Selection',
|
|
66
|
+
selectedFieldIndex: 0,
|
|
67
|
+
message: 'Preview which reviewed Agent-local memory records would be selected for a task.',
|
|
68
|
+
fields: [
|
|
69
|
+
{ id: 'task', label: 'Task', value: '', required: true, multiline: true, hint: 'Task description. Ctrl-J inserts a new line.' },
|
|
70
|
+
{ id: 'scopes', label: 'Scopes', value: '', required: false, multiline: false, hint: 'Optional comma-separated write scopes.' },
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (kind === 'memory-promote') {
|
|
75
|
+
return {
|
|
76
|
+
kind,
|
|
77
|
+
mode: 'update',
|
|
78
|
+
title: 'Promote Agent Memory',
|
|
79
|
+
selectedFieldIndex: 0,
|
|
80
|
+
message: 'Promote one Agent-local memory record to another scope. Type yes on the final field to confirm.',
|
|
81
|
+
fields: [
|
|
82
|
+
{ id: 'id', label: 'Memory id', value: '', required: true, multiline: false, hint: 'Existing Agent memory id.' },
|
|
83
|
+
{ id: 'scope', label: 'Scope', value: '', required: true, multiline: false, hint: 'session, project, or team.' },
|
|
84
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /memory promote with --yes.' },
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (kind === 'memory-link') {
|
|
89
|
+
return {
|
|
90
|
+
kind,
|
|
91
|
+
mode: 'update',
|
|
92
|
+
title: 'Link Agent Memories',
|
|
93
|
+
selectedFieldIndex: 0,
|
|
94
|
+
message: 'Create one directed relation between two Agent-local memory records. Type yes on the final field to confirm.',
|
|
95
|
+
fields: [
|
|
96
|
+
{ id: 'fromId', label: 'From memory id', value: '', required: true, multiline: false, hint: 'Source memory id.' },
|
|
97
|
+
{ id: 'toId', label: 'To memory id', value: '', required: true, multiline: false, hint: 'Target memory id.' },
|
|
98
|
+
{ id: 'relation', label: 'Relation', value: '', required: true, multiline: false, hint: 'Short relation label, such as supports, supersedes, or contradicts.' },
|
|
99
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /memory link with --yes.' },
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (kind === 'memory-export') {
|
|
104
|
+
return {
|
|
105
|
+
kind,
|
|
106
|
+
mode: 'create',
|
|
107
|
+
title: 'Export Agent Memory Bundle',
|
|
108
|
+
selectedFieldIndex: 0,
|
|
109
|
+
message: 'Export Agent-local memory records and links to a reviewable JSON bundle. Type yes on the final field to confirm.',
|
|
110
|
+
fields: [
|
|
111
|
+
{ id: 'path', label: 'Output path', value: 'agent-memory-bundle.json', required: true, multiline: false, hint: 'Workspace-relative JSON path to write.' },
|
|
112
|
+
{ id: 'scope', label: 'Scope', value: '', required: false, multiline: false, hint: 'Optional session, project, or team.' },
|
|
113
|
+
{ id: 'class', label: 'Class', value: '', required: false, multiline: false, hint: 'Optional fact, constraint, pattern, runbook, risk, etc.' },
|
|
114
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /memory export with --yes.' },
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (kind === 'memory-import') {
|
|
119
|
+
return {
|
|
120
|
+
kind,
|
|
121
|
+
mode: 'update',
|
|
122
|
+
title: 'Import Agent Memory Bundle',
|
|
123
|
+
selectedFieldIndex: 0,
|
|
124
|
+
message: 'Import a reviewed Agent memory bundle into the Agent-local memory registry. Type yes on the final field to confirm.',
|
|
125
|
+
fields: [
|
|
126
|
+
{ id: 'path', label: 'Bundle path', value: 'agent-memory-bundle.json', required: true, multiline: false, hint: 'Workspace-relative JSON bundle path.' },
|
|
127
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /memory import with --yes.' },
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (kind === 'memory-handoff-export') {
|
|
132
|
+
return {
|
|
133
|
+
kind,
|
|
134
|
+
mode: 'create',
|
|
135
|
+
title: 'Export Memory Handoff',
|
|
136
|
+
selectedFieldIndex: 0,
|
|
137
|
+
message: 'Export a scoped Agent memory handoff bundle for review. Type yes on the final field to confirm.',
|
|
138
|
+
fields: [
|
|
139
|
+
{ id: 'path', label: 'Output path', value: 'agent-memory-handoff.json', required: true, multiline: false, hint: 'Workspace-relative JSON path to write.' },
|
|
140
|
+
{ id: 'scope', label: 'Scope', value: 'team', required: false, multiline: false, hint: 'session, project, or team. Blank defaults to team.' },
|
|
141
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /memory handoff-export with --yes.' },
|
|
142
|
+
],
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
if (kind === 'memory-handoff-inspect') {
|
|
146
|
+
return {
|
|
147
|
+
kind,
|
|
148
|
+
mode: 'create',
|
|
149
|
+
title: 'Inspect Memory Handoff',
|
|
150
|
+
selectedFieldIndex: 0,
|
|
151
|
+
message: 'Inspect a memory handoff bundle before importing it.',
|
|
152
|
+
fields: [
|
|
153
|
+
{ id: 'path', label: 'Bundle path', value: 'agent-memory-handoff.json', required: true, multiline: false, hint: 'Workspace-relative JSON handoff bundle path.' },
|
|
154
|
+
],
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
if (kind === 'memory-handoff-import') {
|
|
158
|
+
return {
|
|
159
|
+
kind,
|
|
160
|
+
mode: 'update',
|
|
161
|
+
title: 'Import Memory Handoff',
|
|
162
|
+
selectedFieldIndex: 0,
|
|
163
|
+
message: 'Import a reviewed memory handoff bundle into Agent-local memory. Type yes on the final field to confirm.',
|
|
164
|
+
fields: [
|
|
165
|
+
{ id: 'path', label: 'Bundle path', value: 'agent-memory-handoff.json', required: true, multiline: false, hint: 'Workspace-relative JSON handoff bundle path.' },
|
|
166
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /memory handoff-import with --yes.' },
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
kind,
|
|
172
|
+
mode: 'update',
|
|
173
|
+
title: 'Rebuild Memory Vector Index',
|
|
174
|
+
selectedFieldIndex: 0,
|
|
175
|
+
message: 'Rebuild the Agent-local memory vector index. Type yes on the final field to confirm.',
|
|
176
|
+
fields: [
|
|
177
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /memory vector rebuild.' },
|
|
178
|
+
],
|
|
179
|
+
};
|
|
180
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AgentWorkspaceAction, AgentWorkspaceCategory, AgentWorkspaceFocusPane } from './agent-workspace-types.ts';
|
|
2
|
+
|
|
3
|
+
interface AgentWorkspaceNavigationHost {
|
|
4
|
+
readonly categories: readonly AgentWorkspaceCategory[];
|
|
5
|
+
readonly actions: readonly AgentWorkspaceAction[];
|
|
6
|
+
focusPane: AgentWorkspaceFocusPane;
|
|
7
|
+
selectedCategoryIndex: number;
|
|
8
|
+
selectedActionIndex: number;
|
|
9
|
+
clampSelection(): void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function moveAgentWorkspaceSelection(host: AgentWorkspaceNavigationHost, delta: -1 | 1): void {
|
|
13
|
+
if (host.focusPane === 'categories') {
|
|
14
|
+
host.selectedCategoryIndex = Math.max(0, Math.min(host.categories.length - 1, host.selectedCategoryIndex + delta));
|
|
15
|
+
host.selectedActionIndex = 0;
|
|
16
|
+
} else {
|
|
17
|
+
host.selectedActionIndex = Math.max(0, Math.min(host.actions.length - 1, host.selectedActionIndex + delta));
|
|
18
|
+
}
|
|
19
|
+
host.clampSelection();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function jumpAgentWorkspaceSelection(host: AgentWorkspaceNavigationHost, target: 'home' | 'end'): void {
|
|
23
|
+
if (host.focusPane === 'categories') {
|
|
24
|
+
host.selectedCategoryIndex = target === 'home' ? 0 : host.categories.length - 1;
|
|
25
|
+
} else {
|
|
26
|
+
host.selectedActionIndex = target === 'home' ? 0 : host.actions.length - 1;
|
|
27
|
+
}
|
|
28
|
+
host.clampSelection();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function selectAgentWorkspaceCategory(host: AgentWorkspaceNavigationHost, categoryIdOrLabel: string): boolean {
|
|
32
|
+
const normalized = categoryIdOrLabel.trim().toLowerCase();
|
|
33
|
+
if (!normalized) return false;
|
|
34
|
+
const categoryIndex = host.categories.findIndex((category) =>
|
|
35
|
+
category.id.toLowerCase() === normalized
|
|
36
|
+
|| category.label.toLowerCase() === normalized
|
|
37
|
+
|| category.label.toLowerCase().replace(/[^a-z0-9]+/g, '-') === normalized
|
|
38
|
+
);
|
|
39
|
+
if (categoryIndex < 0) return false;
|
|
40
|
+
host.selectedCategoryIndex = categoryIndex;
|
|
41
|
+
host.selectedActionIndex = 0;
|
|
42
|
+
host.focusPane = 'actions';
|
|
43
|
+
host.clampSelection();
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { AgentWorkspaceActionResult, AgentWorkspaceLocalEditor } from './agent-workspace-types.ts';
|
|
2
|
+
import { quoteSlashCommandArg } from './slash-command-parser.ts';
|
|
3
|
+
|
|
4
|
+
type AgentWorkspaceFieldReader = (fieldId: string) => string;
|
|
5
|
+
|
|
6
|
+
export type AgentWorkspaceNotifyEditorKind = 'notify-webhook' | 'notify-webhook-remove' | 'notify-webhook-clear' | 'notify-webhook-test';
|
|
7
|
+
|
|
8
|
+
export type AgentWorkspaceNotifyEditorSubmission =
|
|
9
|
+
| {
|
|
10
|
+
readonly kind: 'editor';
|
|
11
|
+
readonly editor: AgentWorkspaceLocalEditor;
|
|
12
|
+
readonly status: string;
|
|
13
|
+
readonly actionResult?: AgentWorkspaceActionResult;
|
|
14
|
+
}
|
|
15
|
+
| {
|
|
16
|
+
readonly kind: 'dispatch';
|
|
17
|
+
readonly command: string;
|
|
18
|
+
readonly status: string;
|
|
19
|
+
readonly actionResult: AgentWorkspaceActionResult;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function isAgentWorkspaceNotifyEditorKind(kind: string): kind is AgentWorkspaceNotifyEditorKind {
|
|
23
|
+
return kind === 'notify-webhook'
|
|
24
|
+
|| kind === 'notify-webhook-remove'
|
|
25
|
+
|| kind === 'notify-webhook-clear'
|
|
26
|
+
|| kind === 'notify-webhook-test';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isAffirmative(value: string): boolean {
|
|
30
|
+
return /^(y|yes|true)$/i.test(value.trim());
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function unconfirmed(editor: AgentWorkspaceLocalEditor, message: string, status: string): AgentWorkspaceNotifyEditorSubmission {
|
|
34
|
+
return {
|
|
35
|
+
kind: 'editor',
|
|
36
|
+
editor: { ...editor, message },
|
|
37
|
+
status,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function dispatch(command: string, title: string, status: string, detail: string): AgentWorkspaceNotifyEditorSubmission {
|
|
42
|
+
return {
|
|
43
|
+
kind: 'dispatch',
|
|
44
|
+
command,
|
|
45
|
+
status,
|
|
46
|
+
actionResult: {
|
|
47
|
+
kind: 'dispatched',
|
|
48
|
+
title,
|
|
49
|
+
detail,
|
|
50
|
+
command,
|
|
51
|
+
safety: 'safe',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function buildAgentWorkspaceNotifyEditorSubmission(
|
|
57
|
+
editor: AgentWorkspaceLocalEditor,
|
|
58
|
+
readField: AgentWorkspaceFieldReader,
|
|
59
|
+
): AgentWorkspaceNotifyEditorSubmission {
|
|
60
|
+
if (editor.kind === 'notify-webhook') {
|
|
61
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
62
|
+
return unconfirmed(editor, 'Notification webhook add not confirmed. Type yes, then press Enter.', 'Notification webhook add not confirmed.');
|
|
63
|
+
}
|
|
64
|
+
const command = `/notify add ${quoteSlashCommandArg(readField('url'))} --yes`;
|
|
65
|
+
return dispatch(
|
|
66
|
+
command,
|
|
67
|
+
'Opening notification webhook add',
|
|
68
|
+
'Opening notification webhook add.',
|
|
69
|
+
'The workspace handed a confirmed notification target command to the shell-owned command router.',
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (editor.kind === 'notify-webhook-remove') {
|
|
74
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
75
|
+
return unconfirmed(editor, 'Notification webhook remove not confirmed. Type yes, then press Enter.', 'Notification webhook remove not confirmed.');
|
|
76
|
+
}
|
|
77
|
+
const command = `/notify remove ${quoteSlashCommandArg(readField('url'))} --yes`;
|
|
78
|
+
return dispatch(
|
|
79
|
+
command,
|
|
80
|
+
'Opening notification webhook remove',
|
|
81
|
+
'Opening notification webhook remove.',
|
|
82
|
+
'The workspace handed a confirmed notification target remove command to the shell-owned command router.',
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (editor.kind === 'notify-webhook-clear') {
|
|
87
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
88
|
+
return unconfirmed(editor, 'Notification webhook clear not confirmed. Type yes, then press Enter.', 'Notification webhook clear not confirmed.');
|
|
89
|
+
}
|
|
90
|
+
return dispatch(
|
|
91
|
+
'/notify clear --yes',
|
|
92
|
+
'Opening notification webhook clear',
|
|
93
|
+
'Opening notification webhook clear.',
|
|
94
|
+
'The workspace handed a confirmed notification target cleanup command to the shell-owned command router.',
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (!isAffirmative(readField('confirm'))) {
|
|
99
|
+
return unconfirmed(editor, 'Notification webhook test not confirmed. Type yes, then press Enter.', 'Notification webhook test not confirmed.');
|
|
100
|
+
}
|
|
101
|
+
return dispatch(
|
|
102
|
+
'/notify test --yes',
|
|
103
|
+
'Opening notification webhook test',
|
|
104
|
+
'Opening notification webhook test.',
|
|
105
|
+
'The workspace handed a confirmed notification test command to the shell-owned command router.',
|
|
106
|
+
);
|
|
107
|
+
}
|