@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
|
@@ -2,6 +2,7 @@ import type { MemoryApi } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
|
2
2
|
import type { MemoryRecord } from '@pellux/goodvibes-sdk/platform/state';
|
|
3
3
|
import type { ShellPathService } from '@/runtime/index.ts';
|
|
4
4
|
import type { CommandContext } from './command-registry.ts';
|
|
5
|
+
import { AgentNoteRegistry } from '../agent/note-registry.ts';
|
|
5
6
|
import { AgentPersonaRegistry } from '../agent/persona-registry.ts';
|
|
6
7
|
import { AgentRoutineRegistry } from '../agent/routine-registry.ts';
|
|
7
8
|
import { createAgentRuntimeProfile, type AgentRuntimeProfileInfo } from '../agent/runtime-profile.ts';
|
|
@@ -9,17 +10,19 @@ import { AgentSkillRegistry } from '../agent/skill-registry.ts';
|
|
|
9
10
|
import { activateAgentWorkspaceSelection } from './agent-workspace-activation.ts';
|
|
10
11
|
import { AGENT_WORKSPACE_CATEGORIES } from './agent-workspace-categories.ts';
|
|
11
12
|
import { buildAgentWorkspaceCommandEditorSubmission, isAgentWorkspaceCommandEditorKind } from './agent-workspace-command-editor.ts';
|
|
12
|
-
import {
|
|
13
|
-
import { createDeleteEditor, createMemoryUpdateEditor, createPersonaUpdateEditor, createRoutineUpdateEditor, createSkillUpdateEditor, editorCategoryId, isAffirmative, splitList } from './agent-workspace-editors.ts';
|
|
13
|
+
import { createDeleteEditor, editorCategoryId, isAffirmative, splitList } from './agent-workspace-editors.ts';
|
|
14
14
|
import { createAgentWorkspaceLearnedBehavior } from './agent-workspace-learned-behavior.ts';
|
|
15
|
+
import { clampAgentWorkspaceLocalLibrarySelection, moveAgentWorkspaceLocalLibraryItemSelection, selectedAgentWorkspaceLocalLibraryItem, type AgentWorkspaceLocalSelectionIndexes } from './agent-workspace-local-selection.ts';
|
|
16
|
+
import { applyAgentWorkspaceLocalLibraryOperation } from './agent-workspace-local-operations.ts';
|
|
15
17
|
import { deleteAgentWorkspaceMemoryEditor, submitAgentWorkspaceMemoryEditor } from './agent-workspace-memory-editor.ts';
|
|
16
18
|
import { jumpAgentWorkspaceSelection, moveAgentWorkspaceSelection, selectAgentWorkspaceCategory } from './agent-workspace-navigation.ts';
|
|
17
19
|
import { buildAgentWorkspaceRequirements } from './agent-workspace-requirements.ts';
|
|
20
|
+
import { appendAgentWorkspaceActionSearchText, backspaceAgentWorkspaceActionSearch, beginAgentWorkspaceActionSearch, clearAgentWorkspaceActionSearch, commitAgentWorkspaceActionSearchSelection, searchAgentWorkspaceActions } from './agent-workspace-search.ts';
|
|
18
21
|
import { buildAgentWorkspaceRuntimeSnapshot } from './agent-workspace-snapshot.ts';
|
|
19
|
-
import type { AgentWorkspaceAction, AgentWorkspaceActionResult, AgentWorkspaceCategory, AgentWorkspaceCommandDispatcher, AgentWorkspaceEditorField, AgentWorkspaceFocusPane, AgentWorkspaceLocalEditor, AgentWorkspaceLocalEditorKind, AgentWorkspaceLocalLibraryItem, AgentWorkspaceLocalOperation, AgentWorkspaceRuntimeSnapshot } from './agent-workspace-types.ts';
|
|
22
|
+
import type { AgentWorkspaceAction, AgentWorkspaceActionResult, AgentWorkspaceActionSearchResult, AgentWorkspaceCategory, AgentWorkspaceCommandDispatcher, AgentWorkspaceEditorField, AgentWorkspaceFocusPane, AgentWorkspaceLocalEditor, AgentWorkspaceLocalEditorKind, AgentWorkspaceLocalLibraryItem, AgentWorkspaceLocalOperation, AgentWorkspacePromptDispatcher, AgentWorkspaceRuntimeSnapshot } from './agent-workspace-types.ts';
|
|
20
23
|
|
|
21
24
|
export type { AgentWorkspaceChannelRisk, AgentWorkspaceChannelStatus } from './agent-workspace-channels.ts';
|
|
22
|
-
export type { AgentWorkspaceAction, AgentWorkspaceActionResult, AgentWorkspaceCategory, AgentWorkspaceCommandDispatcher, AgentWorkspaceEditorField, AgentWorkspaceFocusPane, AgentWorkspaceLocalEditor, AgentWorkspaceLocalEditorKind, AgentWorkspaceLocalLibraryItem, AgentWorkspaceLocalOperation, AgentWorkspaceRuntimeSnapshot } from './agent-workspace-types.ts';
|
|
25
|
+
export type { AgentWorkspaceAction, AgentWorkspaceActionResult, AgentWorkspaceActionSearchResult, AgentWorkspaceCategory, AgentWorkspaceCategoryId, AgentWorkspaceCommandDispatcher, AgentWorkspaceEditorField, AgentWorkspaceFocusPane, AgentWorkspaceLocalEditor, AgentWorkspaceLocalEditorKind, AgentWorkspaceLocalLibraryItem, AgentWorkspaceLocalOperation, AgentWorkspacePromptDispatcher, AgentWorkspaceRuntimeSnapshot } from './agent-workspace-types.ts';
|
|
23
26
|
export { AGENT_WORKSPACE_MODAL_NAME } from './agent-workspace-types.ts';
|
|
24
27
|
export { buildAgentWorkspaceRuntimeSnapshot } from './agent-workspace-snapshot.ts';
|
|
25
28
|
export { handleAgentWorkspaceToken } from './agent-workspace-token.ts';
|
|
@@ -33,8 +36,11 @@ export class AgentWorkspace {
|
|
|
33
36
|
public runtimeSnapshot: AgentWorkspaceRuntimeSnapshot | null = null;
|
|
34
37
|
public lastActionResult: AgentWorkspaceActionResult | null = null;
|
|
35
38
|
public localEditor: AgentWorkspaceLocalEditor | null = null;
|
|
36
|
-
|
|
39
|
+
public actionSearchActive = false;
|
|
40
|
+
public actionSearchQuery = '';
|
|
41
|
+
public readonly selectedLibraryItemIndexes: AgentWorkspaceLocalSelectionIndexes = {
|
|
37
42
|
memory: 0,
|
|
43
|
+
note: 0,
|
|
38
44
|
persona: 0,
|
|
39
45
|
skill: 0,
|
|
40
46
|
routine: 0,
|
|
@@ -42,23 +48,27 @@ export class AgentWorkspace {
|
|
|
42
48
|
};
|
|
43
49
|
private context: CommandContext | null = null;
|
|
44
50
|
private dispatchCommand: AgentWorkspaceCommandDispatcher | null = null;
|
|
51
|
+
private dispatchPrompt: AgentWorkspacePromptDispatcher | null = null;
|
|
45
52
|
|
|
46
|
-
open(context: CommandContext, dispatchCommand: AgentWorkspaceCommandDispatcher, categoryId?: string): void {
|
|
53
|
+
open(context: CommandContext, dispatchCommand: AgentWorkspaceCommandDispatcher, categoryId?: string, dispatchPrompt?: AgentWorkspacePromptDispatcher): void {
|
|
47
54
|
this.context = context;
|
|
48
55
|
this.dispatchCommand = dispatchCommand;
|
|
56
|
+
this.dispatchPrompt = dispatchPrompt ?? null;
|
|
49
57
|
this.runtimeSnapshot = buildAgentWorkspaceRuntimeSnapshot(context);
|
|
50
58
|
this.active = true;
|
|
51
59
|
this.focusPane = 'actions';
|
|
52
60
|
this.status = 'Ready. Choose an operator flow; ordinary assistant work stays in the main conversation.';
|
|
53
61
|
this.lastActionResult = null;
|
|
54
62
|
this.localEditor = null;
|
|
63
|
+
this.actionSearchActive = false;
|
|
64
|
+
this.actionSearchQuery = '';
|
|
55
65
|
if (categoryId && !this.selectCategory(categoryId)) {
|
|
56
66
|
const normalized = categoryId.trim();
|
|
57
|
-
this.status = `Unknown Agent workspace area: ${normalized}
|
|
67
|
+
this.status = `Unknown Agent workspace area: ${normalized}`;
|
|
58
68
|
this.lastActionResult = {
|
|
59
69
|
kind: 'guidance',
|
|
60
70
|
title: 'Unknown Agent workspace area',
|
|
61
|
-
detail: `Use one of
|
|
71
|
+
detail: `Use one of ${this.categories.map((category) => category.id).join(', ')}.`,
|
|
62
72
|
safety: 'safe',
|
|
63
73
|
};
|
|
64
74
|
}
|
|
@@ -73,6 +83,8 @@ export class AgentWorkspace {
|
|
|
73
83
|
close(): void {
|
|
74
84
|
this.active = false;
|
|
75
85
|
this.localEditor = null;
|
|
86
|
+
this.actionSearchActive = false;
|
|
87
|
+
this.actionSearchQuery = '';
|
|
76
88
|
}
|
|
77
89
|
|
|
78
90
|
get categories(): readonly AgentWorkspaceCategory[] {
|
|
@@ -84,6 +96,7 @@ export class AgentWorkspace {
|
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
get actions(): readonly AgentWorkspaceAction[] {
|
|
99
|
+
if (this.actionSearchActive) return this.actionSearchResults.map((result) => result.action);
|
|
87
100
|
return this.selectedCategory.actions;
|
|
88
101
|
}
|
|
89
102
|
|
|
@@ -91,15 +104,37 @@ export class AgentWorkspace {
|
|
|
91
104
|
return this.actions[this.selectedActionIndex] ?? null;
|
|
92
105
|
}
|
|
93
106
|
|
|
107
|
+
get selectedActionCategory(): AgentWorkspaceCategory {
|
|
108
|
+
if (this.actionSearchActive) return this.selectedActionSearchResult?.category ?? this.selectedCategory;
|
|
109
|
+
return this.selectedCategory;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
get actionSearchResults(): readonly AgentWorkspaceActionSearchResult[] {
|
|
113
|
+
return this.actionSearchActive ? searchAgentWorkspaceActions(this.categories, this.actionSearchQuery) : [];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
get selectedActionSearchResult(): AgentWorkspaceActionSearchResult | null {
|
|
117
|
+
if (!this.actionSearchActive) return null;
|
|
118
|
+
return this.actionSearchResults[this.selectedActionIndex] ?? null;
|
|
119
|
+
}
|
|
120
|
+
|
|
94
121
|
selectCategory(categoryIdOrLabel: string): boolean {
|
|
95
122
|
return selectAgentWorkspaceCategory(this, categoryIdOrLabel);
|
|
96
123
|
}
|
|
97
124
|
|
|
125
|
+
cycleCategory(direction: 'next' | 'prev'): void {
|
|
126
|
+
const total = this.categories.length;
|
|
127
|
+
if (total === 0) return;
|
|
128
|
+
const delta = direction === 'next' ? 1 : -1;
|
|
129
|
+
this.selectedCategoryIndex = (this.selectedCategoryIndex + delta + total) % total;
|
|
130
|
+
this.selectedActionIndex = 0;
|
|
131
|
+
this.focusPane = 'actions';
|
|
132
|
+
this.clampSelection();
|
|
133
|
+
this.status = `Agent workspace category: ${this.selectedCategory.label}.`;
|
|
134
|
+
}
|
|
135
|
+
|
|
98
136
|
selectedLocalLibraryItem(kind: AgentWorkspaceLocalEditorKind): AgentWorkspaceLocalLibraryItem | null {
|
|
99
|
-
|
|
100
|
-
if (items.length === 0) return null;
|
|
101
|
-
const index = Math.max(0, Math.min(this.selectedLibraryItemIndexes[kind], items.length - 1));
|
|
102
|
-
return items[index] ?? null;
|
|
137
|
+
return selectedAgentWorkspaceLocalLibraryItem(this.runtimeSnapshot, this.selectedLibraryItemIndexes, kind);
|
|
103
138
|
}
|
|
104
139
|
|
|
105
140
|
focusCategories(): void {
|
|
@@ -157,10 +192,30 @@ export class AgentWorkspace {
|
|
|
157
192
|
this.lastActionResult = {
|
|
158
193
|
kind: 'guidance',
|
|
159
194
|
title: `${title} cancelled`,
|
|
160
|
-
detail: 'No local
|
|
195
|
+
detail: 'No Agent-local registry changes were written.',
|
|
161
196
|
};
|
|
162
197
|
}
|
|
163
198
|
|
|
199
|
+
beginActionSearch(): void {
|
|
200
|
+
beginAgentWorkspaceActionSearch(this);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
appendActionSearchText(text: string): void {
|
|
204
|
+
appendAgentWorkspaceActionSearchText(this, text);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
actionSearchBackspace(): void {
|
|
208
|
+
backspaceAgentWorkspaceActionSearch(this);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
clearActionSearch(): void {
|
|
212
|
+
clearAgentWorkspaceActionSearch(this);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
commitActionSearchSelection(): boolean {
|
|
216
|
+
return commitAgentWorkspaceActionSearchSelection(this, this.selectedActionSearchResult);
|
|
217
|
+
}
|
|
218
|
+
|
|
164
219
|
moveEditorField(delta: number): void {
|
|
165
220
|
const editor = this.localEditor;
|
|
166
221
|
if (!editor) return;
|
|
@@ -215,201 +270,45 @@ export class AgentWorkspace {
|
|
|
215
270
|
return Boolean(this.context?.executeCommand && this.dispatchCommand);
|
|
216
271
|
}
|
|
217
272
|
|
|
273
|
+
hasPromptDispatch(): boolean {
|
|
274
|
+
return Boolean(this.context?.submitInput && this.dispatchPrompt);
|
|
275
|
+
}
|
|
276
|
+
|
|
218
277
|
dispatchWorkspaceCommand(command: string): void {
|
|
219
278
|
this.dispatchCommand?.(command);
|
|
220
279
|
}
|
|
221
280
|
|
|
281
|
+
dispatchWorkspacePrompt(prompt: string): void {
|
|
282
|
+
this.dispatchPrompt?.(prompt);
|
|
283
|
+
}
|
|
284
|
+
|
|
222
285
|
clampSelection(): void {
|
|
223
286
|
this.selectedCategoryIndex = Math.max(0, Math.min(this.selectedCategoryIndex, this.categories.length - 1));
|
|
224
287
|
this.selectedActionIndex = Math.max(0, Math.min(this.selectedActionIndex, this.actions.length - 1));
|
|
225
|
-
this.
|
|
226
|
-
this.
|
|
227
|
-
this.
|
|
228
|
-
this.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
private localLibraryItems(kind: AgentWorkspaceLocalEditorKind): readonly AgentWorkspaceLocalLibraryItem[] {
|
|
232
|
-
if (kind === 'memory') return this.runtimeSnapshot?.localMemories ?? [];
|
|
233
|
-
if (kind === 'persona') return this.runtimeSnapshot?.localPersonas ?? [];
|
|
234
|
-
if (kind === 'skill') return this.runtimeSnapshot?.localSkills ?? [];
|
|
235
|
-
if (kind === 'profile') return [];
|
|
236
|
-
return this.runtimeSnapshot?.localRoutines ?? [];
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
private clampLocalLibrarySelection(kind: AgentWorkspaceLocalEditorKind): void {
|
|
240
|
-
const length = this.localLibraryItems(kind).length;
|
|
241
|
-
this.selectedLibraryItemIndexes[kind] = length === 0
|
|
242
|
-
? 0
|
|
243
|
-
: Math.max(0, Math.min(this.selectedLibraryItemIndexes[kind], length - 1));
|
|
288
|
+
clampAgentWorkspaceLocalLibrarySelection(this.runtimeSnapshot, this.selectedLibraryItemIndexes, 'memory');
|
|
289
|
+
clampAgentWorkspaceLocalLibrarySelection(this.runtimeSnapshot, this.selectedLibraryItemIndexes, 'note');
|
|
290
|
+
clampAgentWorkspaceLocalLibrarySelection(this.runtimeSnapshot, this.selectedLibraryItemIndexes, 'persona');
|
|
291
|
+
clampAgentWorkspaceLocalLibrarySelection(this.runtimeSnapshot, this.selectedLibraryItemIndexes, 'skill');
|
|
292
|
+
clampAgentWorkspaceLocalLibrarySelection(this.runtimeSnapshot, this.selectedLibraryItemIndexes, 'routine');
|
|
244
293
|
}
|
|
245
294
|
|
|
246
295
|
moveLocalLibraryItemSelection(kind: AgentWorkspaceLocalEditorKind, delta: number): void {
|
|
247
|
-
|
|
248
|
-
if (items.length === 0) {
|
|
249
|
-
this.status = `No local ${kind} records to select.`;
|
|
250
|
-
this.lastActionResult = {
|
|
251
|
-
kind: 'guidance',
|
|
252
|
-
title: `No ${kind} records`,
|
|
253
|
-
detail: `Create a local ${kind} before using selection actions.`,
|
|
254
|
-
safety: 'safe',
|
|
255
|
-
};
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
this.selectedLibraryItemIndexes[kind] = Math.max(0, Math.min(items.length - 1, this.selectedLibraryItemIndexes[kind] + delta));
|
|
259
|
-
const selected = this.selectedLocalLibraryItem(kind);
|
|
260
|
-
this.status = selected ? `Selected ${kind}: ${selected.name}.` : `Selected ${kind} updated.`;
|
|
261
|
-
this.lastActionResult = {
|
|
262
|
-
kind: 'guidance',
|
|
263
|
-
title: selected ? `Selected ${selected.name}` : `Selected ${kind}`,
|
|
264
|
-
detail: selected ? `${selected.name} (${selected.id}) is now the selected local ${kind}.` : `Selection changed for ${kind}.`,
|
|
265
|
-
safety: 'safe',
|
|
266
|
-
};
|
|
296
|
+
moveAgentWorkspaceLocalLibraryItemSelection(this, kind, delta);
|
|
267
297
|
}
|
|
268
298
|
|
|
269
299
|
applyLocalLibraryOperation(operation: AgentWorkspaceLocalOperation): void {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
this.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
};
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
try {
|
|
281
|
-
if (operation === 'persona-clear') {
|
|
282
|
-
AgentPersonaRegistry.fromShellPaths(shellPaths).clearActive();
|
|
283
|
-
this.finishLocalOperation('persona', 'Cleared active persona', 'The default Agent policy will apply to future turns.');
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
const selected = this.selectedItemForOperation(operation);
|
|
287
|
-
if (!selected) {
|
|
288
|
-
this.status = 'No selected local registry item.';
|
|
289
|
-
this.lastActionResult = {
|
|
290
|
-
kind: 'guidance',
|
|
291
|
-
title: 'Nothing selected',
|
|
292
|
-
detail: 'Create or select a local library item before running this action.',
|
|
293
|
-
safety: 'safe',
|
|
294
|
-
};
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (operation === 'memory-edit') {
|
|
298
|
-
const memory = this.memoryApi();
|
|
299
|
-
const record = memory.get(selected.id);
|
|
300
|
-
if (!record) throw new Error(`Unknown Agent memory: ${selected.id}`);
|
|
301
|
-
this.localEditor = createMemoryUpdateEditor(record);
|
|
302
|
-
this.status = `Editing memory: ${record.id}.`;
|
|
303
|
-
this.lastActionResult = {
|
|
304
|
-
kind: 'guidance',
|
|
305
|
-
title: this.localEditor.title,
|
|
306
|
-
detail: this.localEditor.message,
|
|
307
|
-
safety: 'safe',
|
|
308
|
-
};
|
|
309
|
-
} else if (operation === 'memory-review') {
|
|
310
|
-
const record = this.memoryApi().review(selected.id, { state: 'reviewed', confidence: selected.confidence ?? 100, reviewedBy: 'operator' });
|
|
311
|
-
if (!record) throw new Error(`Unknown Agent memory: ${selected.id}`);
|
|
312
|
-
this.finishLocalOperation('memory', `Reviewed memory ${record.id}`, `${record.summary} is marked reviewed.`);
|
|
313
|
-
} else if (operation === 'memory-stale') {
|
|
314
|
-
const record = this.memoryApi().review(selected.id, { state: 'stale', staleReason: 'Marked stale from Agent workspace', reviewedBy: 'operator' });
|
|
315
|
-
if (!record) throw new Error(`Unknown Agent memory: ${selected.id}`);
|
|
316
|
-
this.finishLocalOperation('memory', `Marked memory stale ${record.id}`, `${record.summary} needs review before reuse.`);
|
|
317
|
-
} else if (operation === 'memory-delete') {
|
|
318
|
-
this.openDeleteEditor('memory', selected);
|
|
319
|
-
} else if (operation === 'persona-edit') {
|
|
320
|
-
const registry = AgentPersonaRegistry.fromShellPaths(shellPaths);
|
|
321
|
-
const persona = registry.get(selected.id);
|
|
322
|
-
if (!persona) throw new Error(`Unknown persona: ${selected.id}`);
|
|
323
|
-
this.localEditor = createPersonaUpdateEditor(persona, registry.snapshot().activePersonaId === persona.id);
|
|
324
|
-
this.status = `Editing persona: ${persona.name}.`;
|
|
325
|
-
this.lastActionResult = {
|
|
326
|
-
kind: 'guidance',
|
|
327
|
-
title: this.localEditor.title,
|
|
328
|
-
detail: this.localEditor.message,
|
|
329
|
-
safety: 'safe',
|
|
330
|
-
};
|
|
331
|
-
} else if (operation === 'persona-use') {
|
|
332
|
-
AgentPersonaRegistry.fromShellPaths(shellPaths).setActive(selected.id);
|
|
333
|
-
this.finishLocalOperation('persona', `Using persona ${selected.name}`, `${selected.name} will shape future main-conversation turns.`);
|
|
334
|
-
} else if (operation === 'persona-review') {
|
|
335
|
-
AgentPersonaRegistry.fromShellPaths(shellPaths).markReviewed(selected.id);
|
|
336
|
-
this.finishLocalOperation('persona', `Reviewed persona ${selected.name}`, `${selected.name} is marked reviewed.`);
|
|
337
|
-
} else if (operation === 'persona-delete') {
|
|
338
|
-
this.openDeleteEditor('persona', selected);
|
|
339
|
-
} else if (operation === 'skill-edit') {
|
|
340
|
-
const skill = AgentSkillRegistry.fromShellPaths(shellPaths).get(selected.id);
|
|
341
|
-
if (!skill) throw new Error(`Unknown skill: ${selected.id}`);
|
|
342
|
-
this.localEditor = createSkillUpdateEditor(skill);
|
|
343
|
-
this.status = `Editing skill: ${skill.name}.`;
|
|
344
|
-
this.lastActionResult = {
|
|
345
|
-
kind: 'guidance',
|
|
346
|
-
title: this.localEditor.title,
|
|
347
|
-
detail: this.localEditor.message,
|
|
348
|
-
safety: 'safe',
|
|
349
|
-
};
|
|
350
|
-
} else if (operation === 'skill-enable') {
|
|
351
|
-
AgentSkillRegistry.fromShellPaths(shellPaths).setEnabled(selected.id, true);
|
|
352
|
-
this.finishLocalOperation('skill', `Enabled skill ${selected.name}`, `${selected.name} can now inform main-conversation turns.`);
|
|
353
|
-
} else if (operation === 'skill-disable') {
|
|
354
|
-
AgentSkillRegistry.fromShellPaths(shellPaths).setEnabled(selected.id, false);
|
|
355
|
-
this.finishLocalOperation('skill', `Disabled skill ${selected.name}`, `${selected.name} remains saved but is no longer injected into guidance.`);
|
|
356
|
-
} else if (operation === 'skill-review') {
|
|
357
|
-
AgentSkillRegistry.fromShellPaths(shellPaths).markReviewed(selected.id);
|
|
358
|
-
this.finishLocalOperation('skill', `Reviewed skill ${selected.name}`, `${selected.name} is marked reviewed.`);
|
|
359
|
-
} else if (operation === 'skill-delete') {
|
|
360
|
-
this.openDeleteEditor('skill', selected);
|
|
361
|
-
} else if (operation === 'routine-edit') {
|
|
362
|
-
const routine = AgentRoutineRegistry.fromShellPaths(shellPaths).get(selected.id);
|
|
363
|
-
if (!routine) throw new Error(`Unknown routine: ${selected.id}`);
|
|
364
|
-
this.localEditor = createRoutineUpdateEditor(routine);
|
|
365
|
-
this.status = `Editing routine: ${routine.name}.`;
|
|
366
|
-
this.lastActionResult = {
|
|
367
|
-
kind: 'guidance',
|
|
368
|
-
title: this.localEditor.title,
|
|
369
|
-
detail: this.localEditor.message,
|
|
370
|
-
safety: 'safe',
|
|
371
|
-
};
|
|
372
|
-
} else if (operation === 'routine-start') {
|
|
373
|
-
if (this.hasCommandDispatch()) {
|
|
374
|
-
const command = `/routines start ${quoteSlashCommandArg(selected.id)}`;
|
|
375
|
-
this.dispatchWorkspaceCommand(command);
|
|
376
|
-
this.status = `Opening routine: ${selected.name}.`;
|
|
377
|
-
this.lastActionResult = {
|
|
378
|
-
kind: 'dispatched',
|
|
379
|
-
title: `Opening routine ${selected.name}`,
|
|
380
|
-
detail: `${selected.name} will print its workflow steps in the main conversation. No hidden job was created.`,
|
|
381
|
-
command,
|
|
382
|
-
safety: 'safe',
|
|
383
|
-
};
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
AgentRoutineRegistry.fromShellPaths(shellPaths).markStarted(selected.id);
|
|
387
|
-
this.finishLocalOperation('routine', `Started routine ${selected.name}`, `${selected.name} was marked started for this main-conversation workflow. No hidden job was created.`);
|
|
388
|
-
} else if (operation === 'routine-enable') {
|
|
389
|
-
AgentRoutineRegistry.fromShellPaths(shellPaths).setEnabled(selected.id, true);
|
|
390
|
-
this.finishLocalOperation('routine', `Enabled routine ${selected.name}`, `${selected.name} can now inform main-conversation turns.`);
|
|
391
|
-
} else if (operation === 'routine-disable') {
|
|
392
|
-
AgentRoutineRegistry.fromShellPaths(shellPaths).setEnabled(selected.id, false);
|
|
393
|
-
this.finishLocalOperation('routine', `Disabled routine ${selected.name}`, `${selected.name} remains saved but is no longer injected into guidance.`);
|
|
394
|
-
} else if (operation === 'routine-review') {
|
|
395
|
-
AgentRoutineRegistry.fromShellPaths(shellPaths).markReviewed(selected.id);
|
|
396
|
-
this.finishLocalOperation('routine', `Reviewed routine ${selected.name}`, `${selected.name} is marked reviewed.`);
|
|
397
|
-
} else {
|
|
398
|
-
this.openDeleteEditor('routine', selected);
|
|
399
|
-
}
|
|
400
|
-
} catch (error) {
|
|
401
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
402
|
-
this.status = detail;
|
|
403
|
-
this.lastActionResult = {
|
|
404
|
-
kind: 'error',
|
|
405
|
-
title: 'Local registry action failed',
|
|
406
|
-
detail,
|
|
407
|
-
};
|
|
408
|
-
}
|
|
300
|
+
applyAgentWorkspaceLocalLibraryOperation(this, operation, {
|
|
301
|
+
shellPaths: () => this.context?.workspace?.shellPaths,
|
|
302
|
+
selectedItemForOperation: (selectedOperation) => this.selectedItemForOperation(selectedOperation),
|
|
303
|
+
memoryApi: () => this.memoryApi(),
|
|
304
|
+
finishLocalOperation: (kind, title, detail) => this.finishLocalOperation(kind, title, detail),
|
|
305
|
+
openDeleteEditor: (kind, selected) => this.openDeleteEditor(kind, selected),
|
|
306
|
+
});
|
|
409
307
|
}
|
|
410
308
|
|
|
411
309
|
private selectedItemForOperation(operation: AgentWorkspaceLocalOperation): AgentWorkspaceLocalLibraryItem | null {
|
|
412
310
|
if (operation.startsWith('memory-')) return this.selectedLocalLibraryItem('memory');
|
|
311
|
+
if (operation.startsWith('note-')) return this.selectedLocalLibraryItem('note');
|
|
413
312
|
if (operation.startsWith('persona-')) return this.selectedLocalLibraryItem('persona');
|
|
414
313
|
if (operation.startsWith('skill-')) return this.selectedLocalLibraryItem('skill');
|
|
415
314
|
return this.selectedLocalLibraryItem('routine');
|
|
@@ -417,11 +316,11 @@ export class AgentWorkspace {
|
|
|
417
316
|
|
|
418
317
|
private memoryApi(): MemoryApi {
|
|
419
318
|
const memory = this.context?.clients?.agentKnowledgeApi?.memory;
|
|
420
|
-
if (!memory) throw new Error('Agent Memory API is unavailable; refusing default
|
|
319
|
+
if (!memory) throw new Error('Agent Memory API is unavailable; refusing default knowledge or non-Agent fallback.');
|
|
421
320
|
return memory;
|
|
422
321
|
}
|
|
423
322
|
|
|
424
|
-
private learnedBehaviorTarget(): Exclude<AgentWorkspaceLocalEditorKind, 'memory' | 'profile'> {
|
|
323
|
+
private learnedBehaviorTarget(): Exclude<AgentWorkspaceLocalEditorKind, 'memory' | 'note' | 'profile'> {
|
|
425
324
|
const target = this.editorField('target').trim().toLowerCase();
|
|
426
325
|
if (target === 'persona' || target === 'skill' || target === 'routine') return target;
|
|
427
326
|
throw new Error('Behavior type must be skill, routine, or persona.');
|
|
@@ -429,7 +328,7 @@ export class AgentWorkspace {
|
|
|
429
328
|
|
|
430
329
|
private finishLocalOperation(kind: AgentWorkspaceLocalEditorKind, title: string, detail: string): void {
|
|
431
330
|
this.runtimeSnapshot = this.context ? buildAgentWorkspaceRuntimeSnapshot(this.context) : this.runtimeSnapshot;
|
|
432
|
-
this.
|
|
331
|
+
clampAgentWorkspaceLocalLibrarySelection(this.runtimeSnapshot, this.selectedLibraryItemIndexes, kind);
|
|
433
332
|
this.status = title;
|
|
434
333
|
this.lastActionResult = {
|
|
435
334
|
kind: 'refreshed',
|
|
@@ -510,7 +409,7 @@ export class AgentWorkspace {
|
|
|
510
409
|
const shellPaths = this.context?.workspace?.shellPaths;
|
|
511
410
|
if (!shellPaths) {
|
|
512
411
|
this.localEditor = { ...editor, message: 'Cannot save because Agent shell paths are unavailable.' };
|
|
513
|
-
this.status = 'Cannot save local
|
|
412
|
+
this.status = 'Cannot save Agent-local registry item without shell paths.';
|
|
514
413
|
this.lastActionResult = {
|
|
515
414
|
kind: 'error',
|
|
516
415
|
title: 'Local registry unavailable',
|
|
@@ -541,6 +440,28 @@ export class AgentWorkspace {
|
|
|
541
440
|
...(templateId ? { templateId } : {}),
|
|
542
441
|
});
|
|
543
442
|
this.finishProfileEditor(profile);
|
|
443
|
+
} else if (editor.kind === 'note') {
|
|
444
|
+
const registry = AgentNoteRegistry.fromShellPaths(shellPaths);
|
|
445
|
+
if (editor.mode === 'update' && editor.recordId) {
|
|
446
|
+
const updated = registry.update(editor.recordId, {
|
|
447
|
+
title: this.editorField('title'),
|
|
448
|
+
body: this.editorField('body'),
|
|
449
|
+
sourceUrl: this.editorField('sourceUrl'),
|
|
450
|
+
tags: splitList(this.editorField('tags')),
|
|
451
|
+
provenance: 'Workspace',
|
|
452
|
+
});
|
|
453
|
+
this.finishLocalEditor(editor.kind, updated.id, updated.title, 'Updated');
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
const created = registry.create({
|
|
457
|
+
title: this.editorField('title'),
|
|
458
|
+
body: this.editorField('body'),
|
|
459
|
+
sourceUrl: this.editorField('sourceUrl'),
|
|
460
|
+
tags: splitList(this.editorField('tags')),
|
|
461
|
+
source: 'user',
|
|
462
|
+
provenance: 'Workspace',
|
|
463
|
+
});
|
|
464
|
+
this.finishLocalEditor(editor.kind, created.id, created.title, 'Created');
|
|
544
465
|
} else if (editor.kind === 'persona') {
|
|
545
466
|
const registry = AgentPersonaRegistry.fromShellPaths(shellPaths);
|
|
546
467
|
if (editor.mode === 'update' && editor.recordId) {
|
|
@@ -551,7 +472,7 @@ export class AgentWorkspace {
|
|
|
551
472
|
body: this.editorField('body'),
|
|
552
473
|
tags: splitList(this.editorField('tags')),
|
|
553
474
|
triggers: splitList(this.editorField('triggers')),
|
|
554
|
-
provenance: '
|
|
475
|
+
provenance: 'Workspace',
|
|
555
476
|
});
|
|
556
477
|
if (isAffirmative(this.editorField('activate'))) registry.setActive(updated.id);
|
|
557
478
|
else if (wasActive) registry.clearActive();
|
|
@@ -565,7 +486,7 @@ export class AgentWorkspace {
|
|
|
565
486
|
tags: splitList(this.editorField('tags')),
|
|
566
487
|
triggers: splitList(this.editorField('triggers')),
|
|
567
488
|
source: 'user',
|
|
568
|
-
provenance: '
|
|
489
|
+
provenance: 'Workspace',
|
|
569
490
|
});
|
|
570
491
|
if (isAffirmative(this.editorField('activate'))) registry.setActive(created.id);
|
|
571
492
|
this.finishLocalEditor(editor.kind, created.id, created.name, 'Created');
|
|
@@ -579,7 +500,7 @@ export class AgentWorkspace {
|
|
|
579
500
|
triggers: splitList(this.editorField('triggers')),
|
|
580
501
|
tags: splitList(this.editorField('tags')),
|
|
581
502
|
requirements: buildAgentWorkspaceRequirements((id) => this.editorField(id)),
|
|
582
|
-
provenance: '
|
|
503
|
+
provenance: 'Workspace',
|
|
583
504
|
});
|
|
584
505
|
registry.setEnabled(updated.id, isAffirmative(this.editorField('enabled')));
|
|
585
506
|
this.finishLocalEditor(editor.kind, updated.id, updated.name, 'Updated');
|
|
@@ -594,7 +515,7 @@ export class AgentWorkspace {
|
|
|
594
515
|
requirements: buildAgentWorkspaceRequirements((id) => this.editorField(id)),
|
|
595
516
|
enabled: isAffirmative(this.editorField('enabled')),
|
|
596
517
|
source: 'user',
|
|
597
|
-
provenance: '
|
|
518
|
+
provenance: 'Workspace',
|
|
598
519
|
});
|
|
599
520
|
this.finishLocalEditor(editor.kind, created.id, created.name, 'Created');
|
|
600
521
|
} else {
|
|
@@ -607,7 +528,7 @@ export class AgentWorkspace {
|
|
|
607
528
|
triggers: splitList(this.editorField('triggers')),
|
|
608
529
|
tags: splitList(this.editorField('tags')),
|
|
609
530
|
requirements: buildAgentWorkspaceRequirements((id) => this.editorField(id)),
|
|
610
|
-
provenance: '
|
|
531
|
+
provenance: 'Workspace',
|
|
611
532
|
});
|
|
612
533
|
registry.setEnabled(updated.id, isAffirmative(this.editorField('enabled')));
|
|
613
534
|
this.finishLocalEditor(editor.kind, updated.id, updated.name, 'Updated');
|
|
@@ -622,7 +543,7 @@ export class AgentWorkspace {
|
|
|
622
543
|
requirements: buildAgentWorkspaceRequirements((id) => this.editorField(id)),
|
|
623
544
|
enabled: isAffirmative(this.editorField('enabled')),
|
|
624
545
|
source: 'user',
|
|
625
|
-
provenance: '
|
|
546
|
+
provenance: 'Workspace',
|
|
626
547
|
});
|
|
627
548
|
this.finishLocalEditor(editor.kind, created.id, created.name, 'Created');
|
|
628
549
|
}
|
|
@@ -639,7 +560,7 @@ export class AgentWorkspace {
|
|
|
639
560
|
}
|
|
640
561
|
|
|
641
562
|
private submitCommandEditor(editor: AgentWorkspaceLocalEditor): void {
|
|
642
|
-
const result = buildAgentWorkspaceCommandEditorSubmission(editor, (fieldId) => this.editorField(fieldId), this.hasCommandDispatch());
|
|
563
|
+
const result = buildAgentWorkspaceCommandEditorSubmission(editor, (fieldId) => this.editorField(fieldId), this.hasCommandDispatch(), this.hasPromptDispatch());
|
|
643
564
|
if (result.kind === 'editor') {
|
|
644
565
|
this.localEditor = result.editor;
|
|
645
566
|
this.status = result.status;
|
|
@@ -650,6 +571,10 @@ export class AgentWorkspace {
|
|
|
650
571
|
this.localEditor = null;
|
|
651
572
|
this.status = result.status;
|
|
652
573
|
this.lastActionResult = result.actionResult;
|
|
574
|
+
if (result.kind === 'prompt') {
|
|
575
|
+
this.dispatchWorkspacePrompt(result.prompt);
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
653
578
|
this.dispatchWorkspaceCommand(result.command);
|
|
654
579
|
}
|
|
655
580
|
|
|
@@ -666,11 +591,14 @@ export class AgentWorkspace {
|
|
|
666
591
|
}
|
|
667
592
|
if (editor.kind === 'memory') {
|
|
668
593
|
const removed = this.memoryApi().delete(expectedId);
|
|
669
|
-
if (!removed) throw new Error(`Unknown Agent memory
|
|
594
|
+
if (!removed) throw new Error(`Unknown Agent memory ${expectedId}`);
|
|
670
595
|
this.finishLocalDelete(editor.kind, expectedId, expectedId);
|
|
671
596
|
} else if (editor.kind === 'persona') {
|
|
672
597
|
const removed = AgentPersonaRegistry.fromShellPaths(shellPaths).deletePersona(expectedId);
|
|
673
598
|
this.finishLocalDelete(editor.kind, removed.id, removed.name);
|
|
599
|
+
} else if (editor.kind === 'note') {
|
|
600
|
+
const removed = AgentNoteRegistry.fromShellPaths(shellPaths).deleteNote(expectedId);
|
|
601
|
+
this.finishLocalDelete(editor.kind, removed.id, removed.title);
|
|
674
602
|
} else if (editor.kind === 'skill') {
|
|
675
603
|
const removed = AgentSkillRegistry.fromShellPaths(shellPaths).deleteSkill(expectedId);
|
|
676
604
|
this.finishLocalDelete(editor.kind, removed.id, removed.name);
|
|
@@ -678,7 +606,7 @@ export class AgentWorkspace {
|
|
|
678
606
|
const removed = AgentRoutineRegistry.fromShellPaths(shellPaths).deleteRoutine(expectedId);
|
|
679
607
|
this.finishLocalDelete(editor.kind, removed.id, removed.name);
|
|
680
608
|
} else {
|
|
681
|
-
throw new Error(`Unsupported delete editor kind
|
|
609
|
+
throw new Error(`Unsupported delete editor kind ${editor.kind}`);
|
|
682
610
|
}
|
|
683
611
|
}
|
|
684
612
|
|
|
@@ -722,7 +650,7 @@ export class AgentWorkspace {
|
|
|
722
650
|
this.selectedCategoryIndex = categoryIndex;
|
|
723
651
|
this.selectedActionIndex = 0;
|
|
724
652
|
}
|
|
725
|
-
this.status = `${verb} memory
|
|
653
|
+
this.status = `${verb} memory ${record.summary}.`;
|
|
726
654
|
this.lastActionResult = {
|
|
727
655
|
kind: 'refreshed',
|
|
728
656
|
title: `${verb} memory`,
|
|
@@ -741,7 +669,7 @@ export class AgentWorkspace {
|
|
|
741
669
|
this.selectedActionIndex = 0;
|
|
742
670
|
}
|
|
743
671
|
this.runtimeSnapshot = this.context ? buildAgentWorkspaceRuntimeSnapshot(this.context) : this.runtimeSnapshot;
|
|
744
|
-
this.status = `${verb} ${kind}
|
|
672
|
+
this.status = `${verb} ${kind} ${name}.`;
|
|
745
673
|
this.lastActionResult = {
|
|
746
674
|
kind: 'refreshed',
|
|
747
675
|
title: `${verb} ${kind}`,
|
|
@@ -761,7 +689,7 @@ export class AgentWorkspace {
|
|
|
761
689
|
}
|
|
762
690
|
this.runtimeSnapshot = this.context ? buildAgentWorkspaceRuntimeSnapshot(this.context) : this.runtimeSnapshot;
|
|
763
691
|
const starter = profile.starterTemplateId ? ` from ${profile.starterTemplateId}` : '';
|
|
764
|
-
this.status = `Created Agent profile
|
|
692
|
+
this.status = `Created Agent profile ${profile.id}.`;
|
|
765
693
|
this.lastActionResult = {
|
|
766
694
|
kind: 'refreshed',
|
|
767
695
|
title: 'Created Agent profile',
|
|
@@ -780,7 +708,7 @@ export class AgentWorkspace {
|
|
|
780
708
|
this.selectedActionIndex = 0;
|
|
781
709
|
}
|
|
782
710
|
this.runtimeSnapshot = this.context ? buildAgentWorkspaceRuntimeSnapshot(this.context) : this.runtimeSnapshot;
|
|
783
|
-
this.status = `Deleted ${kind}
|
|
711
|
+
this.status = `Deleted ${kind} ${name}.`;
|
|
784
712
|
this.lastActionResult = {
|
|
785
713
|
kind: 'refreshed',
|
|
786
714
|
title: `Deleted ${kind}`,
|
|
@@ -21,6 +21,8 @@ import type { PeerClient } from '@/runtime/index.ts';
|
|
|
21
21
|
import type { DirectTransport } from '@/runtime/index.ts';
|
|
22
22
|
import type { VoiceProviderRegistry, VoiceService } from '@pellux/goodvibes-sdk/platform/voice';
|
|
23
23
|
import type { MediaProviderRegistry } from '@pellux/goodvibes-sdk/platform/media';
|
|
24
|
+
import type { ArtifactStore } from '@pellux/goodvibes-sdk/platform/artifacts';
|
|
25
|
+
import type { ChannelDeliveryRouter } from '@pellux/goodvibes-sdk/platform/channels';
|
|
24
26
|
import type {
|
|
25
27
|
CommandWorkspaceShellServices,
|
|
26
28
|
} from '@/runtime/index.ts';
|
|
@@ -108,7 +110,6 @@ export interface CommandShellUiOpeners {
|
|
|
108
110
|
showPanel?: (panelId: string, pane?: 'top' | 'bottom') => void;
|
|
109
111
|
focusPanels?: () => void;
|
|
110
112
|
focusPrompt?: () => void;
|
|
111
|
-
openPolicyPanel?: () => void;
|
|
112
113
|
openMcpWorkspace?: () => void;
|
|
113
114
|
openAgentWorkspace?: (categoryId?: string) => void;
|
|
114
115
|
openSecurityPanel?: () => void;
|
|
@@ -157,6 +158,8 @@ export interface CommandPlatformConfigServices {
|
|
|
157
158
|
readonly voiceProviderRegistry?: VoiceProviderRegistry;
|
|
158
159
|
readonly voiceService?: VoiceService;
|
|
159
160
|
readonly mediaProviderRegistry?: MediaProviderRegistry;
|
|
161
|
+
readonly artifactStore?: Pick<ArtifactStore, 'create'>;
|
|
162
|
+
readonly channelDeliveryRouter?: Pick<ChannelDeliveryRouter, 'deliver' | 'listStrategies'>;
|
|
160
163
|
}
|
|
161
164
|
|
|
162
165
|
export interface CommandPlatformServices
|