@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,199 @@
|
|
|
1
|
+
import type { AgentWorkspaceActionResult, AgentWorkspaceLocalEditor } from './agent-workspace-types.ts';
|
|
2
|
+
import type { AgentWorkspaceSessionCommandEditorKind } from './agent-workspace-session-command-editors.ts';
|
|
3
|
+
import { isAgentWorkspaceSessionCommandEditorKind } from './agent-workspace-session-command-editors.ts';
|
|
4
|
+
import { quoteSlashCommandArg } from './slash-command-parser.ts';
|
|
5
|
+
|
|
6
|
+
type AgentWorkspaceFieldReader = (fieldId: string) => string;
|
|
7
|
+
|
|
8
|
+
export type AgentWorkspaceSessionCommandEditorSubmission =
|
|
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 isAgentWorkspaceSessionCommandSubmissionKind(kind: string): kind is AgentWorkspaceSessionCommandEditorKind {
|
|
23
|
+
return isAgentWorkspaceSessionCommandEditorKind(kind as AgentWorkspaceSessionCommandEditorKind);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function isAffirmative(value: string): boolean {
|
|
27
|
+
return /^(y|yes|true)$/i.test(value.trim());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function unconfirmed(editor: AgentWorkspaceLocalEditor, message: string): AgentWorkspaceSessionCommandEditorSubmission {
|
|
31
|
+
return {
|
|
32
|
+
kind: 'editor',
|
|
33
|
+
editor: { ...editor, message },
|
|
34
|
+
status: message,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function dispatch(command: string, title: string, detail: string, safety: AgentWorkspaceActionResult['safety']): AgentWorkspaceSessionCommandEditorSubmission {
|
|
39
|
+
return {
|
|
40
|
+
kind: 'dispatch',
|
|
41
|
+
command,
|
|
42
|
+
status: `${title}.`,
|
|
43
|
+
actionResult: { kind: 'dispatched', title, detail, command, safety },
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function buildAgentWorkspaceSessionCommandEditorSubmission(
|
|
48
|
+
editor: AgentWorkspaceLocalEditor,
|
|
49
|
+
readField: AgentWorkspaceFieldReader,
|
|
50
|
+
): AgentWorkspaceSessionCommandEditorSubmission {
|
|
51
|
+
if (editor.kind === 'conversation-export') {
|
|
52
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Conversation export not confirmed. Type yes, then press Enter.');
|
|
53
|
+
return dispatch(
|
|
54
|
+
`/export ${quoteSlashCommandArg(readField('format'))} ${quoteSlashCommandArg(readField('path'))} --yes`,
|
|
55
|
+
'Opening conversation export',
|
|
56
|
+
'The workspace handed a confirmed conversation export command to the shell-owned command router.',
|
|
57
|
+
'safe',
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
if (editor.kind === 'conversation-events' || editor.kind === 'conversation-groups') {
|
|
61
|
+
const subcommand = editor.kind === 'conversation-groups' ? 'groups' : 'events';
|
|
62
|
+
const eventKind = readField('kind');
|
|
63
|
+
const command = eventKind.length > 0
|
|
64
|
+
? `/conversation ${subcommand} ${quoteSlashCommandArg(eventKind)}`
|
|
65
|
+
: `/conversation ${subcommand}`;
|
|
66
|
+
return dispatch(
|
|
67
|
+
command,
|
|
68
|
+
editor.kind === 'conversation-groups' ? 'Opening transcript groups' : 'Opening transcript events',
|
|
69
|
+
'The workspace handed read-only transcript structure inspection to the shell-owned command router.',
|
|
70
|
+
'read-only',
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
if (editor.kind === 'conversation-find') {
|
|
74
|
+
const kind = readField('kind');
|
|
75
|
+
const command = kind.length > 0
|
|
76
|
+
? `/conversation find ${quoteSlashCommandArg(readField('query'))} ${quoteSlashCommandArg(kind)}`
|
|
77
|
+
: `/conversation find ${quoteSlashCommandArg(readField('query'))}`;
|
|
78
|
+
return dispatch(
|
|
79
|
+
command,
|
|
80
|
+
'Opening transcript search',
|
|
81
|
+
'The workspace handed read-only transcript search to the shell-owned command router.',
|
|
82
|
+
'read-only',
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (editor.kind === 'effort-level') {
|
|
86
|
+
return dispatch(
|
|
87
|
+
`/effort ${quoteSlashCommandArg(readField('level'))}`,
|
|
88
|
+
'Opening reasoning effort change',
|
|
89
|
+
'The workspace handed reasoning effort selection to the shell-owned command router.',
|
|
90
|
+
'safe',
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
if (editor.kind === 'session-save') {
|
|
94
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Session save not confirmed. Type yes, then press Enter.');
|
|
95
|
+
return dispatch(
|
|
96
|
+
`/save ${quoteSlashCommandArg(readField('name'))}`,
|
|
97
|
+
'Opening session save',
|
|
98
|
+
'The workspace handed a confirmed session save command to the shell-owned command router.',
|
|
99
|
+
'safe',
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
if (editor.kind === 'session-load') {
|
|
103
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Session load not confirmed. Type yes, then press Enter.');
|
|
104
|
+
return dispatch(
|
|
105
|
+
`/load ${quoteSlashCommandArg(readField('name'))}`,
|
|
106
|
+
'Opening session load',
|
|
107
|
+
'The workspace handed a confirmed session load command to the shell-owned command router.',
|
|
108
|
+
'safe',
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
if (editor.kind === 'session-rename') {
|
|
112
|
+
return dispatch(
|
|
113
|
+
`/session rename ${quoteSlashCommandArg(readField('name'))}`,
|
|
114
|
+
'Opening session rename',
|
|
115
|
+
'The workspace handed current-session rename to the shell-owned command router.',
|
|
116
|
+
'safe',
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
if (editor.kind === 'session-resume') {
|
|
120
|
+
return dispatch(
|
|
121
|
+
`/session resume ${quoteSlashCommandArg(readField('target'))}`,
|
|
122
|
+
'Opening session resume',
|
|
123
|
+
'The workspace handed saved-session resume to the shell-owned command router.',
|
|
124
|
+
'safe',
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
if (editor.kind === 'session-info') {
|
|
128
|
+
return dispatch(
|
|
129
|
+
`/session info ${quoteSlashCommandArg(readField('target'))}`,
|
|
130
|
+
'Opening session inspection',
|
|
131
|
+
'The workspace handed read-only saved-session inspection to the shell-owned command router.',
|
|
132
|
+
'read-only',
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
if (editor.kind === 'session-export-saved') {
|
|
136
|
+
return dispatch(
|
|
137
|
+
`/session export ${quoteSlashCommandArg(readField('target'))} ${quoteSlashCommandArg(readField('format'))}`,
|
|
138
|
+
'Opening saved-session export',
|
|
139
|
+
'The workspace handed saved-session transcript export to the shell-owned command router.',
|
|
140
|
+
'read-only',
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
if (editor.kind === 'session-search') {
|
|
144
|
+
return dispatch(
|
|
145
|
+
`/session search ${quoteSlashCommandArg(readField('query'))}`,
|
|
146
|
+
'Opening saved-session search',
|
|
147
|
+
'The workspace handed saved-session search to the shell-owned command router.',
|
|
148
|
+
'read-only',
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
if (editor.kind === 'session-delete') {
|
|
152
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Session delete not confirmed. Type yes, then press Enter.');
|
|
153
|
+
return dispatch(
|
|
154
|
+
`/session delete ${quoteSlashCommandArg(readField('target'))} --yes`,
|
|
155
|
+
'Opening saved-session delete',
|
|
156
|
+
'The workspace handed confirmed saved-session deletion to the shell-owned command router.',
|
|
157
|
+
'safe',
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
if (editor.kind === 'session-fork') {
|
|
161
|
+
const name = readField('name');
|
|
162
|
+
return dispatch(
|
|
163
|
+
name.length > 0 ? `/session fork ${quoteSlashCommandArg(name)}` : '/session fork',
|
|
164
|
+
'Opening session fork',
|
|
165
|
+
'The workspace handed current-session fork to the shell-owned command router.',
|
|
166
|
+
'safe',
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
if (editor.kind === 'session-graph') {
|
|
170
|
+
const sessionId = readField('sessionId');
|
|
171
|
+
const format = readField('format');
|
|
172
|
+
const parts = ['/session', 'graph'];
|
|
173
|
+
if (sessionId.length > 0) parts.push('--session', quoteSlashCommandArg(sessionId));
|
|
174
|
+
if (format.length > 0) parts.push('--format', quoteSlashCommandArg(format));
|
|
175
|
+
const command = parts.join(' ');
|
|
176
|
+
return dispatch(
|
|
177
|
+
command,
|
|
178
|
+
'Opening session graph',
|
|
179
|
+
'The workspace handed read-only session graph inspection to the shell-owned command router.',
|
|
180
|
+
'read-only',
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
if (editor.kind === 'mode-preset') {
|
|
184
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Interaction mode change not confirmed. Type yes, then press Enter.');
|
|
185
|
+
return dispatch(
|
|
186
|
+
`/mode ${quoteSlashCommandArg(readField('preset'))} --yes`,
|
|
187
|
+
'Opening interaction mode change',
|
|
188
|
+
'The workspace handed a confirmed interaction mode command to the shell-owned command router.',
|
|
189
|
+
'safe',
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Domain verbosity change not confirmed. Type yes, then press Enter.');
|
|
193
|
+
return dispatch(
|
|
194
|
+
`/mode set-domain ${quoteSlashCommandArg(readField('domain'))} ${quoteSlashCommandArg(readField('verbosity'))} --yes`,
|
|
195
|
+
'Opening domain verbosity change',
|
|
196
|
+
'The workspace handed a confirmed domain verbosity command to the shell-owned command router.',
|
|
197
|
+
'safe',
|
|
198
|
+
);
|
|
199
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type { AgentWorkspaceEditorKind, AgentWorkspaceLocalEditor } from './agent-workspace-types.ts';
|
|
2
|
+
|
|
3
|
+
export type AgentWorkspaceSessionCommandEditorKind = Extract<
|
|
4
|
+
AgentWorkspaceEditorKind,
|
|
5
|
+
| 'conversation-export'
|
|
6
|
+
| 'conversation-events'
|
|
7
|
+
| 'conversation-groups'
|
|
8
|
+
| 'conversation-find'
|
|
9
|
+
| 'effort-level'
|
|
10
|
+
| 'session-save'
|
|
11
|
+
| 'session-load'
|
|
12
|
+
| 'session-rename'
|
|
13
|
+
| 'session-resume'
|
|
14
|
+
| 'session-info'
|
|
15
|
+
| 'session-export-saved'
|
|
16
|
+
| 'session-search'
|
|
17
|
+
| 'session-delete'
|
|
18
|
+
| 'session-fork'
|
|
19
|
+
| 'session-graph'
|
|
20
|
+
| 'mode-preset'
|
|
21
|
+
| 'mode-domain'
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
export function isAgentWorkspaceSessionCommandEditorKind(kind: AgentWorkspaceEditorKind): kind is AgentWorkspaceSessionCommandEditorKind {
|
|
25
|
+
return kind === 'conversation-export'
|
|
26
|
+
|| kind === 'conversation-events'
|
|
27
|
+
|| kind === 'conversation-groups'
|
|
28
|
+
|| kind === 'conversation-find'
|
|
29
|
+
|| kind === 'effort-level'
|
|
30
|
+
|| kind === 'session-save'
|
|
31
|
+
|| kind === 'session-load'
|
|
32
|
+
|| kind === 'session-rename'
|
|
33
|
+
|| kind === 'session-resume'
|
|
34
|
+
|| kind === 'session-info'
|
|
35
|
+
|| kind === 'session-export-saved'
|
|
36
|
+
|| kind === 'session-search'
|
|
37
|
+
|| kind === 'session-delete'
|
|
38
|
+
|| kind === 'session-fork'
|
|
39
|
+
|| kind === 'session-graph'
|
|
40
|
+
|| kind === 'mode-preset'
|
|
41
|
+
|| kind === 'mode-domain';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function createAgentWorkspaceSessionCommandEditor(kind: AgentWorkspaceSessionCommandEditorKind): AgentWorkspaceLocalEditor {
|
|
45
|
+
if (kind === 'conversation-export') {
|
|
46
|
+
return {
|
|
47
|
+
kind,
|
|
48
|
+
mode: 'create',
|
|
49
|
+
title: 'Export Conversation',
|
|
50
|
+
selectedFieldIndex: 0,
|
|
51
|
+
message: 'Export the current conversation to a workspace file. Type yes on the final field to confirm.',
|
|
52
|
+
fields: [
|
|
53
|
+
{ id: 'format', label: 'Format', value: 'markdown', required: true, multiline: false, hint: 'markdown or text.' },
|
|
54
|
+
{ id: 'path', label: 'Output path', value: './conversation.md', required: true, multiline: false, hint: 'Workspace-relative output path.' },
|
|
55
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /export with --yes.' },
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (kind === 'conversation-events' || kind === 'conversation-groups') {
|
|
60
|
+
const groups = kind === 'conversation-groups';
|
|
61
|
+
return {
|
|
62
|
+
kind,
|
|
63
|
+
mode: 'create',
|
|
64
|
+
title: groups ? 'Show Transcript Groups' : 'Show Transcript Events',
|
|
65
|
+
selectedFieldIndex: 0,
|
|
66
|
+
message: groups
|
|
67
|
+
? 'Inspect grouped transcript structure from the Agent workspace.'
|
|
68
|
+
: 'Inspect transcript events from the Agent workspace.',
|
|
69
|
+
fields: [
|
|
70
|
+
{ id: 'kind', label: 'Event kind', value: '', required: false, multiline: false, hint: 'Optional transcript event kind. Blank shows all.' },
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (kind === 'conversation-find') {
|
|
75
|
+
return {
|
|
76
|
+
kind,
|
|
77
|
+
mode: 'create',
|
|
78
|
+
title: 'Find Transcript Text',
|
|
79
|
+
selectedFieldIndex: 0,
|
|
80
|
+
message: 'Search the current Agent transcript from the workspace.',
|
|
81
|
+
fields: [
|
|
82
|
+
{ id: 'query', label: 'Search query', value: '', required: true, multiline: false, hint: 'Text to find in the current transcript.' },
|
|
83
|
+
{ id: 'kind', label: 'Event kind', value: '', required: false, multiline: false, hint: 'Optional transcript event kind.' },
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (kind === 'effort-level') {
|
|
88
|
+
return {
|
|
89
|
+
kind,
|
|
90
|
+
mode: 'update',
|
|
91
|
+
title: 'Set Reasoning Effort',
|
|
92
|
+
selectedFieldIndex: 0,
|
|
93
|
+
message: 'Set the reasoning effort used by normal Agent chat turns when the selected model supports it.',
|
|
94
|
+
fields: [
|
|
95
|
+
{ id: 'level', label: 'Effort level', value: 'medium', required: true, multiline: false, hint: 'instant, low, medium, or high.' },
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (kind === 'session-save') {
|
|
100
|
+
return {
|
|
101
|
+
kind,
|
|
102
|
+
mode: 'create',
|
|
103
|
+
title: 'Save Session',
|
|
104
|
+
selectedFieldIndex: 0,
|
|
105
|
+
message: 'Save the current Agent session under a reviewable name. Type yes on the final field to confirm.',
|
|
106
|
+
fields: [
|
|
107
|
+
{ id: 'name', label: 'Session name', value: '', required: true, multiline: false, hint: 'Local saved-session name.' },
|
|
108
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /save.' },
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (kind === 'session-load') {
|
|
113
|
+
return {
|
|
114
|
+
kind,
|
|
115
|
+
mode: 'update',
|
|
116
|
+
title: 'Load Session',
|
|
117
|
+
selectedFieldIndex: 0,
|
|
118
|
+
message: 'Load a saved Agent session into the current conversation. Type yes on the final field to confirm.',
|
|
119
|
+
fields: [
|
|
120
|
+
{ id: 'name', label: 'Session name', value: '', required: true, multiline: false, hint: 'Existing saved-session name from /sessions.' },
|
|
121
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /load.' },
|
|
122
|
+
],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (kind === 'session-rename') {
|
|
126
|
+
return {
|
|
127
|
+
kind,
|
|
128
|
+
mode: 'update',
|
|
129
|
+
title: 'Rename Current Session',
|
|
130
|
+
selectedFieldIndex: 0,
|
|
131
|
+
message: 'Rename the active Agent session from the workspace.',
|
|
132
|
+
fields: [
|
|
133
|
+
{ id: 'name', label: 'New session name', value: '', required: true, multiline: false, hint: 'New reviewable name for the current session.' },
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (kind === 'session-resume') {
|
|
138
|
+
return {
|
|
139
|
+
kind,
|
|
140
|
+
mode: 'update',
|
|
141
|
+
title: 'Resume Saved Session',
|
|
142
|
+
selectedFieldIndex: 0,
|
|
143
|
+
message: 'Resume one saved Agent session by id, prefix, or title.',
|
|
144
|
+
fields: [
|
|
145
|
+
{ id: 'target', label: 'Session id or name', value: '', required: true, multiline: false, hint: 'Use /session list or the Saved sessions action to find ids.' },
|
|
146
|
+
],
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (kind === 'session-info') {
|
|
150
|
+
return {
|
|
151
|
+
kind,
|
|
152
|
+
mode: 'create',
|
|
153
|
+
title: 'Inspect Saved Session',
|
|
154
|
+
selectedFieldIndex: 0,
|
|
155
|
+
message: 'Inspect saved session metadata without changing the current conversation.',
|
|
156
|
+
fields: [
|
|
157
|
+
{ id: 'target', label: 'Session id or name', value: '', required: true, multiline: false, hint: 'Saved session id, prefix, or name.' },
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
if (kind === 'session-export-saved') {
|
|
162
|
+
return {
|
|
163
|
+
kind,
|
|
164
|
+
mode: 'create',
|
|
165
|
+
title: 'Export Saved Session',
|
|
166
|
+
selectedFieldIndex: 0,
|
|
167
|
+
message: 'Print one saved session transcript as markdown or text.',
|
|
168
|
+
fields: [
|
|
169
|
+
{ id: 'target', label: 'Session id or name', value: '', required: true, multiline: false, hint: 'Use . for the current session, or a saved session id/name.' },
|
|
170
|
+
{ id: 'format', label: 'Format', value: 'markdown', required: true, multiline: false, hint: 'markdown or text.' },
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (kind === 'session-search') {
|
|
175
|
+
return {
|
|
176
|
+
kind,
|
|
177
|
+
mode: 'create',
|
|
178
|
+
title: 'Search Saved Sessions',
|
|
179
|
+
selectedFieldIndex: 0,
|
|
180
|
+
message: 'Search saved Agent sessions from the workspace.',
|
|
181
|
+
fields: [
|
|
182
|
+
{ id: 'query', label: 'Search query', value: '', required: true, multiline: false, hint: 'Keyword or phrase to find in saved sessions.' },
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (kind === 'session-delete') {
|
|
187
|
+
return {
|
|
188
|
+
kind,
|
|
189
|
+
mode: 'delete',
|
|
190
|
+
title: 'Delete Saved Session',
|
|
191
|
+
selectedFieldIndex: 0,
|
|
192
|
+
message: 'Delete one saved Agent session. Type yes on the final field to confirm.',
|
|
193
|
+
fields: [
|
|
194
|
+
{ id: 'target', label: 'Session id or name', value: '', required: true, multiline: false, hint: 'Saved session id or prefix. The active session cannot be deleted.' },
|
|
195
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /session delete with --yes.' },
|
|
196
|
+
],
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
if (kind === 'session-fork') {
|
|
200
|
+
return {
|
|
201
|
+
kind,
|
|
202
|
+
mode: 'create',
|
|
203
|
+
title: 'Fork Current Session',
|
|
204
|
+
selectedFieldIndex: 0,
|
|
205
|
+
message: 'Fork the current Agent session into a new local saved session.',
|
|
206
|
+
fields: [
|
|
207
|
+
{ id: 'name', label: 'Fork name', value: '', required: false, multiline: false, hint: 'Optional new session name. Blank uses the default fork name.' },
|
|
208
|
+
],
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
if (kind === 'session-graph') {
|
|
212
|
+
return {
|
|
213
|
+
kind,
|
|
214
|
+
mode: 'create',
|
|
215
|
+
title: 'Inspect Session Graph',
|
|
216
|
+
selectedFieldIndex: 0,
|
|
217
|
+
message: 'Inspect the read-only cross-session graph. Mutating graph actions remain blocked in Agent.',
|
|
218
|
+
fields: [
|
|
219
|
+
{ id: 'sessionId', label: 'Session id', value: '', required: false, multiline: false, hint: 'Optional session id filter.' },
|
|
220
|
+
{ id: 'format', label: 'Format', value: 'text', required: false, multiline: false, hint: 'text or json.' },
|
|
221
|
+
],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (kind === 'mode-preset') {
|
|
225
|
+
return {
|
|
226
|
+
kind,
|
|
227
|
+
mode: 'update',
|
|
228
|
+
title: 'Set Interaction Mode',
|
|
229
|
+
selectedFieldIndex: 0,
|
|
230
|
+
message: 'Set the Agent interaction noise level. Type yes on the final field to confirm.',
|
|
231
|
+
fields: [
|
|
232
|
+
{ id: 'preset', label: 'Preset', value: 'balanced', required: true, multiline: false, hint: 'quiet, balanced, or operator.' },
|
|
233
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /mode <preset> with --yes.' },
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
kind,
|
|
239
|
+
mode: 'update',
|
|
240
|
+
title: 'Set Domain Verbosity',
|
|
241
|
+
selectedFieldIndex: 0,
|
|
242
|
+
message: 'Set interaction verbosity for one notification domain. Type yes on the final field to confirm.',
|
|
243
|
+
fields: [
|
|
244
|
+
{ id: 'domain', label: 'Domain', value: '', required: true, multiline: false, hint: 'Domain name from mode output.' },
|
|
245
|
+
{ id: 'verbosity', label: 'Verbosity', value: 'normal', required: true, multiline: false, hint: 'minimal, normal, or verbose.' },
|
|
246
|
+
{ id: 'confirm', label: 'Confirm', value: '', required: true, multiline: false, hint: 'Type yes to run /mode set-domain.' },
|
|
247
|
+
],
|
|
248
|
+
};
|
|
249
|
+
}
|
|
@@ -19,10 +19,12 @@ export interface AgentWorkspaceSetupChecklistInput {
|
|
|
19
19
|
readonly localMemoryReviewQueueCount: number;
|
|
20
20
|
readonly routineCount: number;
|
|
21
21
|
readonly enabledRoutineCount: number;
|
|
22
|
+
readonly missingRoutineRequirementCount: number;
|
|
22
23
|
readonly skillCount: number;
|
|
23
24
|
readonly enabledSkillCount: number;
|
|
24
25
|
readonly skillBundleCount: number;
|
|
25
26
|
readonly enabledSkillBundleCount: number;
|
|
27
|
+
readonly missingSkillRequirementCount: number;
|
|
26
28
|
readonly activePersonaName: string;
|
|
27
29
|
readonly discoveredPersonas: AgentBehaviorDiscoverySummary;
|
|
28
30
|
readonly discoveredSkills: AgentBehaviorDiscoverySummary;
|
|
@@ -51,7 +53,7 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
51
53
|
return [
|
|
52
54
|
{
|
|
53
55
|
id: 'runtime',
|
|
54
|
-
label: 'Connected
|
|
56
|
+
label: 'Connected host',
|
|
55
57
|
status: 'ready',
|
|
56
58
|
detail: `Agent will connect to ${input.runtimeBaseUrl}; service ownership stays outside this product.`,
|
|
57
59
|
command: '/health',
|
|
@@ -63,14 +65,14 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
63
65
|
detail: providerReady
|
|
64
66
|
? `Current chat route is ${input.provider} / ${input.model}.`
|
|
65
67
|
: 'Choose a provider and model before relying on assistant turns.',
|
|
66
|
-
command: '/
|
|
68
|
+
command: '/agent setup',
|
|
67
69
|
},
|
|
68
70
|
{
|
|
69
71
|
id: 'agent-knowledge',
|
|
70
72
|
label: 'Agent Knowledge',
|
|
71
73
|
status: 'recommended',
|
|
72
74
|
detail: 'Check isolated Agent Knowledge status, then ingest source-backed material into the Agent segment only.',
|
|
73
|
-
command: '/knowledge
|
|
75
|
+
command: '/agent knowledge',
|
|
74
76
|
},
|
|
75
77
|
{
|
|
76
78
|
id: 'profile',
|
|
@@ -81,7 +83,7 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
81
83
|
: discoveredBehaviorCount > 0
|
|
82
84
|
? `${discoveredBehaviorCount} discovered behavior file(s) can seed an isolated Agent profile from the Profiles workspace.`
|
|
83
85
|
: `${input.runtimeStarterTemplateCount} starter template(s) are available if this machine needs separate operator identities.`,
|
|
84
|
-
command:
|
|
86
|
+
command: '/agent profiles',
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
id: 'persona',
|
|
@@ -92,29 +94,37 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
92
94
|
: input.discoveredPersonas.count > 0
|
|
93
95
|
? `${input.discoveredPersonas.count} discovered persona file(s) can be imported into the Agent-local registry.${sampleNames(input.discoveredPersonas)}`
|
|
94
96
|
: 'Create or choose a persona to make the assistant voice and policy explicit.',
|
|
95
|
-
command:
|
|
97
|
+
command: '/agent personas',
|
|
96
98
|
},
|
|
97
99
|
{
|
|
98
100
|
id: 'skills',
|
|
99
101
|
label: 'Skills',
|
|
100
|
-
status: input.
|
|
102
|
+
status: input.missingSkillRequirementCount > 0
|
|
103
|
+
? 'recommended'
|
|
104
|
+
: input.enabledSkillCount > 0 || input.enabledSkillBundleCount > 0
|
|
105
|
+
? 'ready'
|
|
106
|
+
: input.skillCount > 0 || input.skillBundleCount > 0 || input.discoveredSkills.count > 0
|
|
107
|
+
? 'recommended'
|
|
108
|
+
: 'optional',
|
|
101
109
|
detail: input.skillCount > 0 || input.skillBundleCount > 0
|
|
102
|
-
? `${input.enabledSkillCount}/${input.skillCount} local skill(s) enabled; ${input.enabledSkillBundleCount}/${input.skillBundleCount} bundle(s) enabled.${input.discoveredSkills.count > 0 ? ` ${input.discoveredSkills.count} discovered skill file(s) are still available to import.` : ''}`
|
|
110
|
+
? `${input.enabledSkillCount}/${input.skillCount} local skill(s) enabled; ${input.enabledSkillBundleCount}/${input.skillBundleCount} bundle(s) enabled.${input.missingSkillRequirementCount > 0 ? ` ${input.missingSkillRequirementCount} missing setup requirement(s).` : ''}${input.discoveredSkills.count > 0 ? ` ${input.discoveredSkills.count} discovered skill file(s) are still available to import.` : ''}`
|
|
103
111
|
: input.discoveredSkills.count > 0
|
|
104
112
|
? `${input.discoveredSkills.count} discovered skill file(s) can be imported as local reusable procedures.${sampleNames(input.discoveredSkills)}`
|
|
105
113
|
: 'Create reusable local skills and bundles for repeated workflows.',
|
|
106
|
-
command:
|
|
114
|
+
command: '/agent skills',
|
|
107
115
|
},
|
|
108
116
|
{
|
|
109
117
|
id: 'routines',
|
|
110
118
|
label: 'Routines',
|
|
111
|
-
status:
|
|
119
|
+
status: input.missingRoutineRequirementCount > 0
|
|
120
|
+
? 'recommended'
|
|
121
|
+
: setupStatusForCount(input.enabledRoutineCount, 'ready', input.routineCount > 0 || input.discoveredRoutines.count > 0 ? 'recommended' : 'optional'),
|
|
112
122
|
detail: input.routineCount > 0
|
|
113
|
-
? `${input.enabledRoutineCount}/${input.routineCount} local routine(s) enabled.${input.discoveredRoutines.count > 0 ? ` ${input.discoveredRoutines.count} discovered routine file(s) are still available to import.` : ''}`
|
|
123
|
+
? `${input.enabledRoutineCount}/${input.routineCount} local routine(s) enabled.${input.missingRoutineRequirementCount > 0 ? ` ${input.missingRoutineRequirementCount} missing setup requirement(s).` : ''}${input.discoveredRoutines.count > 0 ? ` ${input.discoveredRoutines.count} discovered routine file(s) are still available to import.` : ''}`
|
|
114
124
|
: input.discoveredRoutines.count > 0
|
|
115
125
|
? `${input.discoveredRoutines.count} discovered routine file(s) can be imported as main-conversation workflows.${sampleNames(input.discoveredRoutines)}`
|
|
116
126
|
: 'Create local routines first; promote schedules only with explicit confirmation.',
|
|
117
|
-
command:
|
|
127
|
+
command: '/agent routines',
|
|
118
128
|
},
|
|
119
129
|
{
|
|
120
130
|
id: 'memory',
|
|
@@ -123,7 +133,7 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
123
133
|
detail: input.localMemoryCount > 0
|
|
124
134
|
? `${input.localMemoryCount} Agent memory record(s) are available; ${input.localMemoryReviewQueueCount} need review.`
|
|
125
135
|
: 'Memory starts empty; durable facts should be stored deliberately and never include secrets.',
|
|
126
|
-
command: '/memory',
|
|
136
|
+
command: '/agent memory',
|
|
127
137
|
},
|
|
128
138
|
{
|
|
129
139
|
id: 'channels',
|
|
@@ -132,14 +142,14 @@ export function buildAgentWorkspaceSetupChecklist(input: AgentWorkspaceSetupChec
|
|
|
132
142
|
detail: input.readyChannelCount > 0
|
|
133
143
|
? `${input.readyChannelCount} external channel(s) are ready.`
|
|
134
144
|
: 'Pair or review channels only when you want the assistant reachable outside this terminal.',
|
|
135
|
-
command: '/
|
|
145
|
+
command: '/agent channels',
|
|
136
146
|
},
|
|
137
147
|
{
|
|
138
148
|
id: 'voice-media',
|
|
139
149
|
label: 'Voice and media',
|
|
140
150
|
status: input.voiceProviderCount > 0 || input.mediaProviderCount > 0 ? 'ready' : 'optional',
|
|
141
151
|
detail: `${input.voiceProviderCount} voice provider(s), ${input.mediaProviderCount} media provider(s). Configure these only when useful.`,
|
|
142
|
-
command: '/
|
|
152
|
+
command: '/agent voice-media',
|
|
143
153
|
},
|
|
144
154
|
];
|
|
145
155
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { AgentWorkspaceActionResult, AgentWorkspaceLocalEditor } from './agent-workspace-types.ts';
|
|
2
|
+
import type { AgentWorkspaceSkillBundleCommandEditorKind } from './agent-workspace-skill-bundle-command-editors.ts';
|
|
3
|
+
import { isAgentWorkspaceSkillBundleCommandEditorKind } from './agent-workspace-skill-bundle-command-editors.ts';
|
|
4
|
+
import { quoteSlashCommandArg } from './slash-command-parser.ts';
|
|
5
|
+
|
|
6
|
+
type AgentWorkspaceFieldReader = (fieldId: string) => string;
|
|
7
|
+
|
|
8
|
+
export type AgentWorkspaceSkillBundleCommandEditorSubmission =
|
|
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 isAgentWorkspaceSkillBundleCommandSubmissionKind(kind: string): kind is AgentWorkspaceSkillBundleCommandEditorKind {
|
|
23
|
+
return isAgentWorkspaceSkillBundleCommandEditorKind(kind as AgentWorkspaceSkillBundleCommandEditorKind);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function isAffirmative(value: string): boolean {
|
|
27
|
+
return /^(y|yes|true)$/i.test(value.trim());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function unconfirmed(editor: AgentWorkspaceLocalEditor, message: string): AgentWorkspaceSkillBundleCommandEditorSubmission {
|
|
31
|
+
return {
|
|
32
|
+
kind: 'editor',
|
|
33
|
+
editor: { ...editor, message },
|
|
34
|
+
status: message,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function dispatch(command: string, title: string, detail: string, safety: AgentWorkspaceActionResult['safety']): AgentWorkspaceSkillBundleCommandEditorSubmission {
|
|
39
|
+
return {
|
|
40
|
+
kind: 'dispatch',
|
|
41
|
+
command,
|
|
42
|
+
status: `${title}.`,
|
|
43
|
+
actionResult: { kind: 'dispatched', title, detail, command, safety },
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function buildAgentWorkspaceSkillBundleCommandEditorSubmission(
|
|
48
|
+
editor: AgentWorkspaceLocalEditor,
|
|
49
|
+
readField: AgentWorkspaceFieldReader,
|
|
50
|
+
): AgentWorkspaceSkillBundleCommandEditorSubmission {
|
|
51
|
+
if (editor.kind === 'skill-bundle-search') {
|
|
52
|
+
const query = readField('query').trim();
|
|
53
|
+
const command = query.length > 0 ? `/agent-skills bundle search ${quoteSlashCommandArg(query)}` : '/agent-skills bundle search';
|
|
54
|
+
return dispatch(command, 'Opening skill bundle search', 'The workspace handed a read-only skill bundle search command to the shell-owned command router.', 'read-only');
|
|
55
|
+
}
|
|
56
|
+
if (editor.kind === 'skill-bundle-show') {
|
|
57
|
+
return dispatch(
|
|
58
|
+
`/agent-skills bundle show ${quoteSlashCommandArg(readField('id'))}`,
|
|
59
|
+
'Opening skill bundle detail',
|
|
60
|
+
'The workspace handed a read-only skill bundle detail command to the shell-owned command router.',
|
|
61
|
+
'read-only',
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
if (editor.kind === 'skill-bundle-update') {
|
|
65
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Skill bundle update not confirmed. Type yes, then press Enter.');
|
|
66
|
+
const parts = ['/agent-skills', 'bundle', 'update', quoteSlashCommandArg(readField('id'))];
|
|
67
|
+
const name = readField('name');
|
|
68
|
+
const description = readField('description');
|
|
69
|
+
const skills = readField('skills');
|
|
70
|
+
if (name.length > 0) parts.push('--name', quoteSlashCommandArg(name));
|
|
71
|
+
if (description.length > 0) parts.push('--description', quoteSlashCommandArg(description));
|
|
72
|
+
if (skills.length > 0) parts.push('--skills', quoteSlashCommandArg(skills));
|
|
73
|
+
return dispatch(parts.join(' '), 'Opening skill bundle update', 'The workspace handed a confirmed skill bundle update command to the shell-owned command router.', 'safe');
|
|
74
|
+
}
|
|
75
|
+
if (editor.kind === 'skill-bundle-enable' || editor.kind === 'skill-bundle-disable' || editor.kind === 'skill-bundle-review') {
|
|
76
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Skill bundle action not confirmed. Type yes, then press Enter.');
|
|
77
|
+
const verb = editor.kind.replace('skill-bundle-', '');
|
|
78
|
+
return dispatch(
|
|
79
|
+
`/agent-skills bundle ${verb} ${quoteSlashCommandArg(readField('id'))}`,
|
|
80
|
+
`Opening skill bundle ${verb}`,
|
|
81
|
+
`The workspace handed a confirmed skill bundle ${verb} command to the shell-owned command router.`,
|
|
82
|
+
'safe',
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (editor.kind === 'skill-bundle-stale') {
|
|
86
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Skill bundle stale action not confirmed. Type yes, then press Enter.');
|
|
87
|
+
return dispatch(
|
|
88
|
+
`/agent-skills bundle stale ${quoteSlashCommandArg(readField('id'))} ${quoteSlashCommandArg(readField('reason'))}`,
|
|
89
|
+
'Opening skill bundle stale review',
|
|
90
|
+
'The workspace handed a confirmed skill bundle stale command to the shell-owned command router.',
|
|
91
|
+
'safe',
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
if (!isAffirmative(readField('confirm'))) return unconfirmed(editor, 'Skill bundle delete not confirmed. Type yes, then press Enter.');
|
|
95
|
+
return dispatch(
|
|
96
|
+
`/agent-skills bundle delete ${quoteSlashCommandArg(readField('id'))} --yes`,
|
|
97
|
+
'Opening skill bundle delete',
|
|
98
|
+
'The workspace handed a confirmed skill bundle delete command to the shell-owned command router.',
|
|
99
|
+
'safe',
|
|
100
|
+
);
|
|
101
|
+
}
|