@pellux/goodvibes-agent 1.4.4 → 1.5.1
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 +22 -0
- package/README.md +52 -7
- package/dist/package/main.js +7491 -12253
- package/docs/README.md +2 -2
- package/docs/channels-remote-and-api.md +1 -1
- package/docs/getting-started.md +2 -2
- package/docs/release-and-publishing.md +1 -1
- package/docs/tools-and-commands.md +5 -5
- package/package.json +4 -2
- package/release/live-verification/live-verification.json +13 -13
- package/release/live-verification/live-verification.md +15 -15
- package/release/performance-snapshot.json +2 -2
- package/release/release-notes.md +5 -7
- package/release/release-readiness.json +6 -6
- package/src/agent/behavior-discovery-summary.ts +4 -18
- package/src/agent/calendar-registry.ts +322 -0
- package/src/agent/competitive-feature-inventory.ts +268 -130
- package/src/agent/document-registry.ts +5 -1
- package/src/agent/email/email-service.ts +350 -0
- package/src/agent/email/imap-client.ts +596 -0
- package/src/agent/email/smtp-client.ts +453 -0
- package/src/agent/ics-calendar.ts +662 -0
- package/src/agent/ics-timezone.ts +172 -0
- package/src/agent/markdown-frontmatter.ts +31 -0
- package/src/agent/memory-safety.ts +1 -1
- package/src/agent/note-registry.ts +3 -9
- package/src/agent/persona-discovery.ts +3 -15
- package/src/agent/persona-registry.ts +1 -10
- package/src/agent/research-source-registry.ts +5 -1
- package/src/agent/routine-discovery.ts +3 -15
- package/src/agent/runtime-profile.ts +3 -0
- package/src/agent/skill-discovery.ts +3 -15
- package/src/agent/skill-draft-proposer.ts +203 -0
- package/src/agent/skill-draft-runner.ts +201 -0
- package/src/agent/skill-registry.ts +36 -1
- package/src/agent/skill-standard.ts +99 -0
- package/src/agent/vibe-file.ts +7 -22
- package/src/cli/completion.ts +1 -1
- package/src/cli/config-overrides.ts +10 -1
- package/src/cli/redaction.ts +17 -5
- package/src/config/provider-model.ts +2 -1
- package/src/config/secret-config.ts +13 -6
- package/src/core/activity-feed.ts +97 -0
- package/src/core/away-digest.ts +161 -0
- package/src/core/conversation-rendering.ts +7 -3
- package/src/core/conversation.ts +22 -15
- package/src/core/hardware-profile.ts +362 -0
- package/src/core/last-seen-store.ts +78 -0
- package/src/core/plain-language.ts +52 -0
- package/src/core/setup-incomplete-hint.ts +90 -0
- package/src/core/system-message-router.ts +38 -87
- package/src/input/agent-workspace-basic-command-editor-submission.ts +60 -220
- package/src/input/agent-workspace-basic-command-editors.ts +39 -141
- package/src/input/agent-workspace-categories.ts +40 -125
- package/src/input/agent-workspace-command-editor.ts +4 -0
- package/src/input/agent-workspace-host-category.ts +0 -5
- package/src/input/agent-workspace-local-editor-submission.ts +3 -1
- package/src/input/agent-workspace-navigation.ts +10 -3
- package/src/input/agent-workspace-onboarding-actions.ts +132 -0
- package/src/input/agent-workspace-onboarding-categories.ts +29 -26
- package/src/input/agent-workspace-onboarding-finish.ts +11 -4
- package/src/input/agent-workspace-onboarding-state.ts +111 -0
- package/src/input/agent-workspace-profile-editor-submission.ts +260 -0
- package/src/input/agent-workspace-profile-editors.ts +155 -0
- package/src/input/agent-workspace-subscription-editor.ts +7 -0
- package/src/input/agent-workspace-types.ts +5 -1
- package/src/input/agent-workspace.ts +65 -39
- package/src/input/command-registry.ts +18 -5
- package/src/input/commands/agent-runtime-profile-runtime.ts +2 -1
- package/src/input/commands/agent-skills-runtime.ts +60 -3
- package/src/input/commands/calendar-runtime.ts +209 -0
- package/src/input/commands/channels-runtime.ts +1 -0
- package/src/input/commands/command-error.ts +9 -0
- package/src/input/commands/compat-runtime.ts +1 -0
- package/src/input/commands/config.ts +1 -0
- package/src/input/commands/conversation-runtime.ts +1 -1
- package/src/input/commands/delegation-runtime.ts +5 -6
- package/src/input/commands/email-runtime.ts +387 -0
- package/src/input/commands/experience-runtime.ts +17 -4
- package/src/input/commands/guidance-runtime.ts +1 -1
- package/src/input/commands/health-runtime.ts +6 -1
- package/src/input/commands/knowledge-format.ts +73 -0
- package/src/input/commands/knowledge.ts +9 -74
- package/src/input/commands/local-provider-runtime.ts +2 -1
- package/src/input/commands/local-runtime.ts +10 -4
- package/src/input/commands/mcp-runtime.ts +7 -0
- package/src/input/commands/notify-runtime.ts +17 -1
- package/src/input/commands/onboarding-runtime.ts +1 -0
- package/src/input/commands/operator-actions-runtime.ts +1 -0
- package/src/input/commands/operator-runtime.ts +3 -0
- package/src/input/commands/personas-runtime.ts +1 -0
- package/src/input/commands/platform-access-runtime.ts +40 -17
- package/src/input/commands/product-runtime.ts +6 -1
- package/src/input/commands/provider-accounts-runtime.ts +3 -2
- package/src/input/commands/qrcode-runtime.ts +1 -0
- package/src/input/commands/routines-runtime.ts +1 -0
- package/src/input/commands/runtime-services.ts +0 -13
- package/src/input/commands/security-runtime.ts +1 -0
- package/src/input/commands/session-content.ts +1 -0
- package/src/input/commands/shell-core.ts +5 -2
- package/src/input/commands/subscription-runtime.ts +33 -9
- package/src/input/commands/support-bundle-runtime.ts +8 -1
- package/src/input/commands/tasks-runtime.ts +1 -0
- package/src/input/commands/tts-runtime.ts +1 -0
- package/src/input/commands/vibe-runtime.ts +1 -0
- package/src/input/commands.ts +4 -0
- package/src/input/feed-context-factory.ts +3 -12
- package/src/input/handler-command-route.ts +7 -60
- package/src/input/handler-feed-routes.ts +0 -194
- package/src/input/handler-feed.ts +2 -54
- package/src/input/handler-interactions.ts +0 -2
- package/src/input/handler-modal-stack.ts +0 -9
- package/src/input/handler-picker-routes.ts +24 -1
- package/src/input/handler-shortcuts.ts +11 -40
- package/src/input/handler-ui-state.ts +13 -0
- package/src/input/handler.ts +8 -35
- package/src/input/keybindings.ts +40 -17
- package/src/input/model-picker-local-fit.ts +130 -0
- package/src/input/shell-passthrough.ts +58 -0
- package/src/input/submission-router.ts +0 -5
- package/src/main.ts +129 -90
- package/src/renderer/activity-sidebar.ts +186 -0
- package/src/renderer/agent-workspace-context-lines.ts +5 -48
- package/src/renderer/agent-workspace-style.ts +1 -1
- package/src/renderer/agent-workspace.ts +14 -2
- package/src/renderer/compositor.ts +37 -125
- package/src/renderer/conversation-overlays.ts +3 -3
- package/src/renderer/help-overlay.ts +7 -5
- package/src/renderer/model-workspace.ts +101 -86
- package/src/{panels → renderer}/polish.ts +3 -3
- package/src/renderer/shell-surface.ts +4 -5
- package/src/renderer/status-token.ts +31 -11
- package/src/renderer/tab-strip.ts +1 -1
- package/src/renderer/tool-call.ts +7 -8
- package/src/renderer/tool-labels.ts +92 -0
- package/src/renderer/ui-factory.ts +48 -96
- package/src/runtime/bootstrap-command-context.ts +0 -5
- package/src/runtime/bootstrap-command-parts.ts +6 -15
- package/src/runtime/bootstrap-core.ts +34 -13
- package/src/runtime/bootstrap-hook-bridge.ts +3 -1
- package/src/runtime/bootstrap-shell.ts +3 -50
- package/src/runtime/bootstrap.ts +3 -4
- package/src/runtime/context.ts +1 -1
- package/src/runtime/diagnostics/panels/index.ts +0 -1
- package/src/runtime/diagnostics/panels/policy.ts +1 -1
- package/src/runtime/execution-ledger.ts +16 -1
- package/src/runtime/index.ts +6 -1
- package/src/runtime/onboarding/index.ts +1 -0
- package/src/runtime/onboarding/onboarding-state.ts +200 -0
- package/src/{panels → runtime}/provider-account-snapshot.ts +5 -2
- package/src/runtime/services.ts +16 -4
- package/src/runtime/terminal-output-guard.ts +7 -0
- package/src/runtime/tool-permission-safety.ts +1 -1
- package/src/runtime/ui/model-picker/data-provider.ts +1 -1
- package/src/runtime/ui/model-picker/health-enrichment.ts +2 -2
- package/src/runtime/ui/model-picker/types.ts +2 -2
- package/src/runtime/ui/provider-health/data-provider.ts +3 -3
- package/src/runtime/ui/provider-health/types.ts +2 -2
- package/src/runtime/ui-services.ts +0 -2
- package/src/shell/agent-workspace-fullscreen.ts +0 -1
- package/src/shell/autonomy-surfacing.ts +272 -0
- package/src/shell/session-continuity-hints.ts +0 -6
- package/src/shell/startup-wiring.ts +221 -0
- package/src/shell/ui-openers.ts +18 -29
- package/src/tools/agent-context-policy.ts +1 -1
- package/src/tools/agent-harness-background-processes.ts +4 -4
- package/src/tools/agent-harness-browser-cockpit-route.ts +3 -3
- package/src/tools/agent-harness-command-runner.ts +6 -1
- package/src/tools/agent-harness-document-ops.ts +26 -53
- package/src/tools/agent-harness-execution-history.ts +1 -13
- package/src/tools/agent-harness-execution-posture.ts +0 -15
- package/src/tools/agent-harness-keybinding-metadata.ts +28 -29
- package/src/tools/agent-harness-local-model-cookbook.ts +24 -1
- package/src/tools/agent-harness-metadata.ts +16 -0
- package/src/tools/agent-harness-mode-catalog.ts +2 -9
- package/src/tools/agent-harness-provider-account-metadata.ts +2 -2
- package/src/tools/agent-harness-setup-posture-utils.ts +1 -1
- package/src/tools/agent-harness-tool-schema.ts +13 -14
- package/src/tools/agent-harness-tool.ts +27 -23
- package/src/tools/agent-harness-ui-surface-metadata.ts +10 -20
- package/src/tools/agent-harness-workspace-action-runner.ts +3 -4
- package/src/tools/agent-workspace-tool.ts +2 -33
- package/src/utils/terminal-width.ts +9 -3
- package/src/version.ts +1 -1
- package/src/input/agent-workspace-panel-route.ts +0 -44
- package/src/input/panel-integration-actions.ts +0 -26
- package/src/panels/approval-panel.ts +0 -149
- package/src/panels/automation-control-panel.ts +0 -212
- package/src/panels/base-panel.ts +0 -254
- package/src/panels/builtin/agent.ts +0 -58
- package/src/panels/builtin/knowledge.ts +0 -26
- package/src/panels/builtin/operations.ts +0 -121
- package/src/panels/builtin/session.ts +0 -138
- package/src/panels/builtin/shared.ts +0 -275
- package/src/panels/builtin/usage.ts +0 -21
- package/src/panels/builtin-panels.ts +0 -23
- package/src/panels/confirm-state.ts +0 -61
- package/src/panels/context-visualizer-panel.ts +0 -204
- package/src/panels/cost-tracker-panel.ts +0 -444
- package/src/panels/docs-panel.ts +0 -285
- package/src/panels/index.ts +0 -25
- package/src/panels/knowledge-panel.ts +0 -417
- package/src/panels/memory-panel.ts +0 -226
- package/src/panels/panel-list-panel.ts +0 -464
- package/src/panels/panel-manager.ts +0 -570
- package/src/panels/provider-accounts-panel.ts +0 -233
- package/src/panels/provider-health-domains.ts +0 -208
- package/src/panels/provider-health-panel.ts +0 -720
- package/src/panels/provider-health-tracker.ts +0 -115
- package/src/panels/provider-stats-panel.ts +0 -366
- package/src/panels/qr-panel.ts +0 -207
- package/src/panels/schedule-panel.ts +0 -321
- package/src/panels/scrollable-list-panel.ts +0 -491
- package/src/panels/search-focus.ts +0 -32
- package/src/panels/security-panel.ts +0 -295
- package/src/panels/session-browser-panel.ts +0 -395
- package/src/panels/session-maintenance.ts +0 -125
- package/src/panels/subscription-panel.ts +0 -263
- package/src/panels/system-messages-panel.ts +0 -230
- package/src/panels/tasks-panel.ts +0 -344
- package/src/panels/thinking-panel.ts +0 -304
- package/src/panels/token-budget-panel.ts +0 -475
- package/src/panels/tool-inspector-panel.ts +0 -436
- package/src/panels/types.ts +0 -54
- package/src/renderer/panel-composite.ts +0 -158
- package/src/renderer/panel-tab-bar.ts +0 -69
- package/src/renderer/panel-workspace-bar.ts +0 -42
- package/src/runtime/diagnostics/panels/panel-resources.ts +0 -118
- package/src/tools/agent-harness-panel-metadata.ts +0 -211
- /package/src/runtime/perf/{panel-health-monitor.ts → component-health.ts} +0 -0
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { networkInterfaces } from 'node:os';
|
|
2
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
-
import type { PanelManager } from '../panel-manager.ts';
|
|
4
|
-
import { SessionBrowserPanel } from '../session-browser-panel.ts';
|
|
5
|
-
import { QrPanel } from '../qr-panel.ts';
|
|
6
|
-
import { DocsPanel } from '../docs-panel.ts';
|
|
7
|
-
import { PanelListPanel } from '../panel-list-panel.ts';
|
|
8
|
-
import { TokenBudgetPanel } from '../token-budget-panel.ts';
|
|
9
|
-
import type { ResolvedBuiltinPanelDeps } from './shared.ts';
|
|
10
|
-
import { requireUiServices } from './shared.ts';
|
|
11
|
-
import {
|
|
12
|
-
buildCompanionConnectionInfo,
|
|
13
|
-
} from '@pellux/goodvibes-sdk/platform/pairing';
|
|
14
|
-
import { copyToClipboard } from '../../utils/clipboard.ts';
|
|
15
|
-
import { GOODVIBES_AGENT_PAIRING_SURFACE } from '../../config/surface.ts';
|
|
16
|
-
|
|
17
|
-
function getLocalNetworkIp(): string {
|
|
18
|
-
const nets = networkInterfaces();
|
|
19
|
-
for (const name of Object.keys(nets)) {
|
|
20
|
-
for (const net of nets[name] ?? []) {
|
|
21
|
-
if (net.family === 'IPv4' && !net.internal) {
|
|
22
|
-
return net.address;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return 'localhost';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function readBootstrapPassword(credentialPath: string): string | undefined {
|
|
30
|
-
try {
|
|
31
|
-
const content = readFileSync(credentialPath, 'utf-8');
|
|
32
|
-
for (const line of content.split('\n')) {
|
|
33
|
-
if (line.startsWith('password=')) {
|
|
34
|
-
return line.slice('password='.length).trim();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
} catch {
|
|
38
|
-
// credential file may not exist yet
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function readOperatorToken(tokenPath: string): string | null {
|
|
44
|
-
if (!existsSync(tokenPath)) return null;
|
|
45
|
-
try {
|
|
46
|
-
const parsed = JSON.parse(readFileSync(tokenPath, 'utf-8')) as unknown;
|
|
47
|
-
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return null;
|
|
48
|
-
const token = 'token' in parsed ? parsed.token : undefined;
|
|
49
|
-
return typeof token === 'string' && token.trim().length > 0 ? token : null;
|
|
50
|
-
} catch {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function registerSessionPanels(manager: PanelManager, deps: ResolvedBuiltinPanelDeps): void {
|
|
56
|
-
manager.registerType({
|
|
57
|
-
id: 'qr-code',
|
|
58
|
-
name: 'QR Code',
|
|
59
|
-
icon: 'Q',
|
|
60
|
-
category: 'session',
|
|
61
|
-
description: 'QR code for companion app pairing through the connected GoodVibes host',
|
|
62
|
-
factory: () => {
|
|
63
|
-
if (!deps.connectedHostTokenDir) throw new Error('connected host token directory must be provided to the session panel factory via BuiltinPanelDeps');
|
|
64
|
-
const token = readOperatorToken(`${deps.connectedHostTokenDir}/operator-tokens.json`);
|
|
65
|
-
const connectedHostPort = deps.configManager.get('controlPlane.port');
|
|
66
|
-
const connectedHostName = String(process.env['GOODVIBES_AGENT_RUNTIME_HOST'] ?? process.env['GOODVIBES_DAEMON_HOST'] ?? getLocalNetworkIp());
|
|
67
|
-
const connectedHostUrl = `http://${connectedHostName}:${connectedHostPort}`;
|
|
68
|
-
const bootstrapPassword = readBootstrapPassword(deps.localUserAuthManager.getBootstrapCredentialPath());
|
|
69
|
-
const connectionInfo = token
|
|
70
|
-
? buildCompanionConnectionInfo({
|
|
71
|
-
daemonUrl: connectedHostUrl,
|
|
72
|
-
token,
|
|
73
|
-
password: bootstrapPassword,
|
|
74
|
-
surface: GOODVIBES_AGENT_PAIRING_SURFACE,
|
|
75
|
-
})
|
|
76
|
-
: {
|
|
77
|
-
url: connectedHostUrl,
|
|
78
|
-
token: '',
|
|
79
|
-
username: 'admin',
|
|
80
|
-
...(bootstrapPassword !== undefined ? { password: bootstrapPassword } : {}),
|
|
81
|
-
surface: GOODVIBES_AGENT_PAIRING_SURFACE,
|
|
82
|
-
};
|
|
83
|
-
return new QrPanel(connectionInfo, undefined, copyToClipboard);
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
manager.registerType({
|
|
88
|
-
id: 'sessions',
|
|
89
|
-
name: 'Sessions',
|
|
90
|
-
icon: 'H',
|
|
91
|
-
category: 'session',
|
|
92
|
-
description: 'Browse, search, and resume past conversation sessions',
|
|
93
|
-
factory: () => new SessionBrowserPanel(deps.sessionManager, deps.resumeSession),
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
manager.registerType({
|
|
97
|
-
id: 'docs',
|
|
98
|
-
name: 'Docs',
|
|
99
|
-
icon: '?',
|
|
100
|
-
category: 'session',
|
|
101
|
-
description: 'Tool list, model capabilities, and keyboard shortcut reference',
|
|
102
|
-
factory: () => new DocsPanel(deps.toolRegistry, deps.providerRegistry),
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
manager.registerType({
|
|
106
|
-
id: 'panel-list',
|
|
107
|
-
name: 'Panel List',
|
|
108
|
-
icon: 'L',
|
|
109
|
-
category: 'session',
|
|
110
|
-
description: 'Browse all registered panels grouped by category, with open/closed status and Enter-to-open',
|
|
111
|
-
factory: () => new PanelListPanel(manager, deps.componentHealthMonitor),
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
manager.registerType({
|
|
115
|
-
id: 'system-messages',
|
|
116
|
-
name: 'System Messages',
|
|
117
|
-
icon: 'J',
|
|
118
|
-
category: 'monitoring',
|
|
119
|
-
description: 'Operational system messages routed away from the main conversation (scans, discovery, plugin events, tool status)',
|
|
120
|
-
preload: true,
|
|
121
|
-
factory: () => deps.systemMessagesPanel,
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
manager.registerType({
|
|
125
|
-
id: 'tokens',
|
|
126
|
-
name: 'Tokens',
|
|
127
|
-
icon: 'K',
|
|
128
|
-
category: 'monitoring',
|
|
129
|
-
description: 'Token budget tracker: per-turn and cumulative usage with context window gauge',
|
|
130
|
-
factory: () => {
|
|
131
|
-
const panel = new TokenBudgetPanel(deps.sessionMemoryStore, deps.configManager);
|
|
132
|
-
if (deps.orchestrator && deps.getCtxWindow) {
|
|
133
|
-
panel.wire(deps.orchestrator, deps.getCtxWindow, requireUiServices(deps).readModels.session);
|
|
134
|
-
}
|
|
135
|
-
return panel;
|
|
136
|
-
},
|
|
137
|
-
});
|
|
138
|
-
}
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import type { ConfigManager } from '@pellux/goodvibes-sdk/platform/config';
|
|
2
|
-
import type { ServiceRegistry } from '@pellux/goodvibes-sdk/platform/config';
|
|
3
|
-
import type { ToolRegistry } from '@pellux/goodvibes-sdk/platform/tools';
|
|
4
|
-
import type { ProviderRegistry } from '@pellux/goodvibes-sdk/platform/providers';
|
|
5
|
-
import type { Orchestrator } from '../../core/orchestrator';
|
|
6
|
-
import type { MemoryRegistry } from '@pellux/goodvibes-sdk/platform/state';
|
|
7
|
-
import type { ApprovalBroker, SharedSessionBroker } from '@pellux/goodvibes-sdk/platform/control-plane';
|
|
8
|
-
import type { AutomationManager } from '@pellux/goodvibes-sdk/platform/automation';
|
|
9
|
-
import type { ControlPlaneRecentEvent } from '@pellux/goodvibes-sdk/platform/control-plane';
|
|
10
|
-
import type { UiRuntimeServices } from '../../runtime/ui-services.ts';
|
|
11
|
-
import type { PluginManagerObserver } from '@pellux/goodvibes-sdk/platform/plugins';
|
|
12
|
-
import type { HookWorkbench } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
13
|
-
import type { HookDispatcher } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
14
|
-
import type { HookActivityTracker } from '@pellux/goodvibes-sdk/platform/hooks';
|
|
15
|
-
import type { McpRegistry } from '@pellux/goodvibes-sdk/platform/mcp';
|
|
16
|
-
import type { PolicyRuntimeState } from '@/runtime/index.ts';
|
|
17
|
-
import type { SessionManager } from '@pellux/goodvibes-sdk/platform/sessions';
|
|
18
|
-
import type { SubscriptionManager } from '@pellux/goodvibes-sdk/platform/config';
|
|
19
|
-
import type { UserAuthManager } from '@pellux/goodvibes-sdk/platform/security';
|
|
20
|
-
import type { SessionMemoryStore } from '@pellux/goodvibes-sdk/platform/core';
|
|
21
|
-
import type { ExecutionPlanManager } from '@pellux/goodvibes-sdk/platform/core';
|
|
22
|
-
import type { AdaptivePlanner } from '@pellux/goodvibes-sdk/platform/core';
|
|
23
|
-
import type { ProjectPlanningService } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
24
|
-
import type { KnowledgeService } from '@pellux/goodvibes-sdk/platform/knowledge';
|
|
25
|
-
import type { ApiTokenAuditor } from '@pellux/goodvibes-sdk/platform/security';
|
|
26
|
-
import type { ComponentHealthMonitor } from '../../runtime/perf/panel-health-monitor.ts';
|
|
27
|
-
import type { WorktreeRegistry } from '@/runtime/index.ts';
|
|
28
|
-
import type { SandboxSessionRegistry } from '@/runtime/index.ts';
|
|
29
|
-
|
|
30
|
-
export interface BuiltinPanelDeps {
|
|
31
|
-
/** Config manager for settings-sync and other config-backed panels. */
|
|
32
|
-
configManager?: ConfigManager;
|
|
33
|
-
/** Getter returning the main orchestrator's cumulative token usage. */
|
|
34
|
-
getOrchestratorUsage?: () => { input: number; output: number; cacheRead: number; cacheWrite: number; model?: string };
|
|
35
|
-
/** Optional cost budget alert threshold in USD (0 = disabled). */
|
|
36
|
-
budgetThreshold?: number;
|
|
37
|
-
/** Tool registry for Docs panel. */
|
|
38
|
-
toolRegistry?: ToolRegistry;
|
|
39
|
-
/** Provider registry for Docs panel model list. */
|
|
40
|
-
providerRegistry: ProviderRegistry;
|
|
41
|
-
/** Local auth manager for panels that inspect shared auth state. */
|
|
42
|
-
localUserAuthManager?: UserAuthManager;
|
|
43
|
-
/** Session manager for panels that inspect shared session state. */
|
|
44
|
-
sessionManager?: SessionManager;
|
|
45
|
-
/** Subscription manager for panels that inspect shared provider subscription state. */
|
|
46
|
-
subscriptionManager?: SubscriptionManager;
|
|
47
|
-
/** Shared service registry for services-backed panels. */
|
|
48
|
-
serviceRegistry?: ServiceRegistry;
|
|
49
|
-
/** Context window size in tokens (for ContextVisualizerPanel). */
|
|
50
|
-
contextWindow?: number;
|
|
51
|
-
/** Main Orchestrator instance for TokenBudgetPanel.wire(). */
|
|
52
|
-
orchestrator?: Orchestrator;
|
|
53
|
-
/** Callback returning the current model context window size (for TokenBudgetPanel). */
|
|
54
|
-
getCtxWindow?: () => number;
|
|
55
|
-
/** Resume a saved session directly through the session controller path. */
|
|
56
|
-
resumeSession?: (sessionId: string) => void;
|
|
57
|
-
/** Request a shell repaint directly rather than routing through a retired event path. */
|
|
58
|
-
requestRender?: () => void;
|
|
59
|
-
/** Submit a Planning panel answer through the normal Agent chat/planning coordinator path. */
|
|
60
|
-
submitPlanningAnswer?: (answer: string) => void;
|
|
61
|
-
/** Pause the Agent-owned planning loop and return focus to normal prompt input. */
|
|
62
|
-
dismissPlanning?: () => void;
|
|
63
|
-
/** ForensicsRegistry for the Forensics panel. */
|
|
64
|
-
forensicsRegistry?: import('@/runtime/index.ts').ForensicsRegistry;
|
|
65
|
-
/** MemoryRegistry for the Memory panel. */
|
|
66
|
-
memoryRegistry?: MemoryRegistry;
|
|
67
|
-
/** Isolated Agent Knowledge service for the Agent Knowledge panel. */
|
|
68
|
-
agentKnowledgeService?: Pick<KnowledgeService, 'getStatus'>;
|
|
69
|
-
/** Shared policy runtime state for governance/policy diagnostics. */
|
|
70
|
-
policyRuntimeState?: import('@/runtime/index.ts').PolicyRuntimeState;
|
|
71
|
-
/** Approval broker for control-plane/operator panels. */
|
|
72
|
-
approvalBroker?: ApprovalBroker;
|
|
73
|
-
/** Shared session broker for control-plane/operator panels. */
|
|
74
|
-
sessionBroker?: SharedSessionBroker;
|
|
75
|
-
/** Automation manager for schedule/operator panels. */
|
|
76
|
-
automationManager?: AutomationManager;
|
|
77
|
-
/** Recent control-plane events provider for control-plane/operator panels. */
|
|
78
|
-
getControlPlaneRecentEvents?: (limit: number) => readonly ControlPlaneRecentEvent[];
|
|
79
|
-
/** Token auditor for the security control-room panel. */
|
|
80
|
-
tokenAuditor: ApiTokenAuditor;
|
|
81
|
-
/** Shared component-health monitor for rate-limited panels and diagnostics. */
|
|
82
|
-
componentHealthMonitor: ComponentHealthMonitor;
|
|
83
|
-
/** Inert shell dependency in Agent; build worktree UX belongs to GoodVibes TUI delegation. */
|
|
84
|
-
worktreeRegistry: WorktreeRegistry;
|
|
85
|
-
/** Isolation session registry used by MCP internals; Agent does not expose local execution-isolation command UX. */
|
|
86
|
-
sandboxSessionRegistry: SandboxSessionRegistry;
|
|
87
|
-
/**
|
|
88
|
-
* Resolved connected-host token directory (e.g. `~/.goodvibes/daemon`) — owned by the
|
|
89
|
-
* composition root and passed explicitly so panel factories do not discover cwd/home implicitly.
|
|
90
|
-
*/
|
|
91
|
-
connectedHostTokenDir?: string;
|
|
92
|
-
/** Session memory store for context and token budget panels. */
|
|
93
|
-
sessionMemoryStore?: SessionMemoryStore;
|
|
94
|
-
/** Execution plan manager for plan dashboard panels. */
|
|
95
|
-
planManager?: ExecutionPlanManager;
|
|
96
|
-
/** Adaptive planner for ops strategy panels. */
|
|
97
|
-
adaptivePlanner?: AdaptivePlanner;
|
|
98
|
-
/** Passive project planning artifact service. */
|
|
99
|
-
projectPlanningService?: ProjectPlanningService;
|
|
100
|
-
/** Stable workspace project id for project:<projectId> planning namespaces. */
|
|
101
|
-
projectPlanningProjectId?: string;
|
|
102
|
-
/** Agent-owned persistent work plan store. */
|
|
103
|
-
workPlanStore?: import('../../work-plans/work-plan-store.ts').WorkPlanStore;
|
|
104
|
-
/** Shared system-messages panel instance attached from boot so low-priority chatter stays out of conversation. */
|
|
105
|
-
systemMessagesPanel?: import('../system-messages-panel.ts').SystemMessagesPanel;
|
|
106
|
-
/** Explicit UI-facing runtime services for operator panels and modals. */
|
|
107
|
-
uiServices?: UiRuntimeServices;
|
|
108
|
-
/** Shared plugin manager observer for plugin and security panels. */
|
|
109
|
-
pluginManager?: PluginManagerObserver;
|
|
110
|
-
/** Shared hook dispatcher for the hooks control-room panel. */
|
|
111
|
-
hookDispatcher?: Pick<HookDispatcher, 'listHooks' | 'getChains'>;
|
|
112
|
-
/** Shared hook workbench for the hooks control-room panel. */
|
|
113
|
-
hookWorkbench?: HookWorkbench;
|
|
114
|
-
/** Shared hook activity tracker for the hooks control-room panel. */
|
|
115
|
-
hookActivityTracker?: Pick<HookActivityTracker, 'listRecent'>;
|
|
116
|
-
/** Shared MCP registry for security panels and MCP workspace commands. */
|
|
117
|
-
mcpRegistry?: McpRegistry;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export type ResolvedBuiltinPanelDeps = Omit<
|
|
121
|
-
BuiltinPanelDeps,
|
|
122
|
-
| 'configManager'
|
|
123
|
-
| 'localUserAuthManager'
|
|
124
|
-
| 'sessionManager'
|
|
125
|
-
| 'subscriptionManager'
|
|
126
|
-
| 'serviceRegistry'
|
|
127
|
-
| 'sessionMemoryStore'
|
|
128
|
-
| 'planManager'
|
|
129
|
-
| 'adaptivePlanner'
|
|
130
|
-
| 'projectPlanningService'
|
|
131
|
-
| 'projectPlanningProjectId'
|
|
132
|
-
| 'workPlanStore'
|
|
133
|
-
| 'policyRuntimeState'
|
|
134
|
-
| 'systemMessagesPanel'
|
|
135
|
-
> & {
|
|
136
|
-
readonly configManager: ConfigManager;
|
|
137
|
-
readonly localUserAuthManager: UserAuthManager;
|
|
138
|
-
readonly sessionManager: SessionManager;
|
|
139
|
-
readonly subscriptionManager: SubscriptionManager;
|
|
140
|
-
readonly serviceRegistry: ServiceRegistry;
|
|
141
|
-
readonly sessionMemoryStore: SessionMemoryStore;
|
|
142
|
-
readonly planManager: ExecutionPlanManager;
|
|
143
|
-
readonly adaptivePlanner: AdaptivePlanner;
|
|
144
|
-
readonly projectPlanningService: ProjectPlanningService;
|
|
145
|
-
readonly projectPlanningProjectId: string;
|
|
146
|
-
readonly workPlanStore: import('../../work-plans/work-plan-store.ts').WorkPlanStore;
|
|
147
|
-
readonly policyRuntimeState: PolicyRuntimeState;
|
|
148
|
-
readonly systemMessagesPanel: import('../system-messages-panel.ts').SystemMessagesPanel;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export interface ControlPlanePanelFactoryDeps {
|
|
152
|
-
readonly approvalBroker: ApprovalBroker;
|
|
153
|
-
readonly sessionBroker: SharedSessionBroker;
|
|
154
|
-
readonly getControlPlaneRecentEvents: (limit: number) => readonly ControlPlaneRecentEvent[];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function requireBuiltinPanelDep<TValue>(value: TValue | undefined, message: string): TValue {
|
|
158
|
-
if (value === undefined) {
|
|
159
|
-
throw new Error(message);
|
|
160
|
-
}
|
|
161
|
-
return value;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function resolveBuiltinPanelDeps(deps: BuiltinPanelDeps): ResolvedBuiltinPanelDeps {
|
|
165
|
-
const uiServices = requireUiServices(deps);
|
|
166
|
-
return {
|
|
167
|
-
...deps,
|
|
168
|
-
configManager: requireBuiltinPanelDep(
|
|
169
|
-
uiServices.platform.configManager,
|
|
170
|
-
'Config manager must be wired at bootstrap for builtin panels.',
|
|
171
|
-
),
|
|
172
|
-
localUserAuthManager: requireBuiltinPanelDep(
|
|
173
|
-
uiServices.platform.localUserAuthManager,
|
|
174
|
-
'Local auth manager must be wired at bootstrap for builtin panels.',
|
|
175
|
-
),
|
|
176
|
-
sessionManager: requireBuiltinPanelDep(
|
|
177
|
-
uiServices.sessions.sessionManager,
|
|
178
|
-
'Session manager must be wired at bootstrap for builtin panels.',
|
|
179
|
-
),
|
|
180
|
-
subscriptionManager: requireBuiltinPanelDep(
|
|
181
|
-
uiServices.platform.subscriptionManager,
|
|
182
|
-
'Subscription manager must be wired at bootstrap for builtin panels.',
|
|
183
|
-
),
|
|
184
|
-
serviceRegistry: requireBuiltinPanelDep(
|
|
185
|
-
uiServices.platform.serviceRegistry,
|
|
186
|
-
'Service registry must be wired at bootstrap for builtin panels.',
|
|
187
|
-
),
|
|
188
|
-
sessionMemoryStore: requireBuiltinPanelDep(
|
|
189
|
-
uiServices.sessions.sessionMemoryStore,
|
|
190
|
-
'Session memory store must be wired at bootstrap for builtin panels.',
|
|
191
|
-
),
|
|
192
|
-
planManager: requireBuiltinPanelDep(
|
|
193
|
-
uiServices.planning.planManager,
|
|
194
|
-
'Execution plan manager must be wired at bootstrap for builtin panels.',
|
|
195
|
-
),
|
|
196
|
-
adaptivePlanner: requireBuiltinPanelDep(
|
|
197
|
-
uiServices.planning.adaptivePlanner,
|
|
198
|
-
'Adaptive planner must be wired at bootstrap for builtin panels.',
|
|
199
|
-
),
|
|
200
|
-
projectPlanningService: requireBuiltinPanelDep(
|
|
201
|
-
uiServices.planning.projectPlanningService,
|
|
202
|
-
'Project planning service must be wired at bootstrap for builtin panels.',
|
|
203
|
-
),
|
|
204
|
-
projectPlanningProjectId: requireBuiltinPanelDep(
|
|
205
|
-
uiServices.planning.projectPlanningProjectId,
|
|
206
|
-
'Project planning project id must be wired at bootstrap for builtin panels.',
|
|
207
|
-
),
|
|
208
|
-
workPlanStore: requireBuiltinPanelDep(
|
|
209
|
-
uiServices.planning.workPlanStore,
|
|
210
|
-
'Work plan store must be wired at bootstrap for builtin panels.',
|
|
211
|
-
),
|
|
212
|
-
policyRuntimeState: requireBuiltinPanelDep(
|
|
213
|
-
uiServices.platform.policyRuntimeState,
|
|
214
|
-
'Policy runtime state must be wired at bootstrap for builtin panels.',
|
|
215
|
-
),
|
|
216
|
-
systemMessagesPanel: requireBuiltinPanelDep(
|
|
217
|
-
deps.systemMessagesPanel,
|
|
218
|
-
'System messages panel must be wired at bootstrap for builtin panels.',
|
|
219
|
-
),
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export function requireControlPlanePanelDeps(deps: BuiltinPanelDeps): ControlPlanePanelFactoryDeps {
|
|
224
|
-
if (!deps.approvalBroker || !deps.sessionBroker || !deps.getControlPlaneRecentEvents) {
|
|
225
|
-
throw new Error('ControlPlanePanel requires approval/session brokers and recent-event access to be wired at bootstrap.');
|
|
226
|
-
}
|
|
227
|
-
return {
|
|
228
|
-
approvalBroker: deps.approvalBroker,
|
|
229
|
-
sessionBroker: deps.sessionBroker,
|
|
230
|
-
getControlPlaneRecentEvents: deps.getControlPlaneRecentEvents,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export function requireAutomationManager(deps: BuiltinPanelDeps): AutomationManager {
|
|
235
|
-
if (!deps.automationManager) {
|
|
236
|
-
throw new Error('SchedulePanel requires an automation manager to be wired at bootstrap.');
|
|
237
|
-
}
|
|
238
|
-
return deps.automationManager;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export function requireUiServices(deps: BuiltinPanelDeps): UiRuntimeServices {
|
|
242
|
-
if (!deps.uiServices) {
|
|
243
|
-
throw new Error('UI runtime services must be wired at bootstrap for operator panels.');
|
|
244
|
-
}
|
|
245
|
-
return deps.uiServices;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export function requirePluginManager(deps: BuiltinPanelDeps): PluginManagerObserver {
|
|
249
|
-
if (!deps.pluginManager) {
|
|
250
|
-
throw new Error('Plugin manager must be wired at bootstrap for plugin and security panels.');
|
|
251
|
-
}
|
|
252
|
-
return deps.pluginManager;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export function requireHookPanelDeps(deps: BuiltinPanelDeps): {
|
|
256
|
-
readonly hookDispatcher: Pick<HookDispatcher, 'listHooks' | 'getChains'>;
|
|
257
|
-
readonly hookWorkbench: HookWorkbench;
|
|
258
|
-
readonly hookActivityTracker: Pick<HookActivityTracker, 'listRecent'>;
|
|
259
|
-
} {
|
|
260
|
-
if (!deps.hookDispatcher || !deps.hookWorkbench || !deps.hookActivityTracker) {
|
|
261
|
-
throw new Error('Hook dispatcher, hook activity tracker, and hook workbench must be wired at bootstrap for the hooks panel.');
|
|
262
|
-
}
|
|
263
|
-
return {
|
|
264
|
-
hookDispatcher: deps.hookDispatcher,
|
|
265
|
-
hookWorkbench: deps.hookWorkbench,
|
|
266
|
-
hookActivityTracker: deps.hookActivityTracker,
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export function requireMcpRegistry(deps: BuiltinPanelDeps): McpRegistry {
|
|
271
|
-
if (!deps.mcpRegistry) {
|
|
272
|
-
throw new Error('MCP registry must be wired at bootstrap for security panels and MCP workspace commands.');
|
|
273
|
-
}
|
|
274
|
-
return deps.mcpRegistry;
|
|
275
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { PanelManager } from '../panel-manager.ts';
|
|
2
|
-
import { CostTrackerPanel } from '../cost-tracker-panel.ts';
|
|
3
|
-
import type { ResolvedBuiltinPanelDeps } from './shared.ts';
|
|
4
|
-
import { requireUiServices } from './shared.ts';
|
|
5
|
-
|
|
6
|
-
export function registerUsagePanels(manager: PanelManager, deps: ResolvedBuiltinPanelDeps): void {
|
|
7
|
-
if (!deps.getOrchestratorUsage) return;
|
|
8
|
-
|
|
9
|
-
const { getOrchestratorUsage, budgetThreshold } = deps;
|
|
10
|
-
manager.registerType({
|
|
11
|
-
id: 'cost',
|
|
12
|
-
name: 'Cost',
|
|
13
|
-
icon: '$',
|
|
14
|
-
category: 'monitoring',
|
|
15
|
-
description: 'Estimated assistant usage costs for this session and explicit delegated work, with budget alerts',
|
|
16
|
-
factory: () => {
|
|
17
|
-
const ui = requireUiServices(deps);
|
|
18
|
-
return new CostTrackerPanel(ui.events.turns, ui.events.agents, getOrchestratorUsage, { budgetThreshold });
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { PanelManager } from './panel-manager.ts';
|
|
2
|
-
import { resolveBuiltinPanelDeps, type BuiltinPanelDeps } from './builtin/shared.ts';
|
|
3
|
-
import { registerUsagePanels } from './builtin/usage.ts';
|
|
4
|
-
import { registerOperationsPanels } from './builtin/operations.ts';
|
|
5
|
-
import { registerAgentPanels } from './builtin/agent.ts';
|
|
6
|
-
import { registerSessionPanels } from './builtin/session.ts';
|
|
7
|
-
import { registerKnowledgePanels } from './builtin/knowledge.ts';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Register all built-in panel types with the given PanelManager.
|
|
11
|
-
*
|
|
12
|
-
* Call this once during application startup, before opening any panels.
|
|
13
|
-
*/
|
|
14
|
-
export function registerBuiltinPanels(manager: PanelManager, deps: BuiltinPanelDeps): void {
|
|
15
|
-
const resolved = resolveBuiltinPanelDeps(deps);
|
|
16
|
-
registerUsagePanels(manager, resolved);
|
|
17
|
-
registerOperationsPanels(manager, resolved);
|
|
18
|
-
registerAgentPanels(manager, resolved);
|
|
19
|
-
registerSessionPanels(manager, resolved);
|
|
20
|
-
registerKnowledgePanels(manager, resolved);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type { BuiltinPanelDeps } from './builtin/shared.ts';
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// useConfirmState<T> — reusable inline y/n confirmation helper
|
|
3
|
-
//
|
|
4
|
-
// Pattern (chosen over ConfirmableListPanel base class):
|
|
5
|
-
// - Composable: each panel holds a ConfirmState field, not a new base class
|
|
6
|
-
// - Identical y/n UX everywhere: y confirms, n/Esc cancels, any other key
|
|
7
|
-
// is absorbed (does nothing) while confirm is active
|
|
8
|
-
// - Render: caller calls renderConfirmLines(width, state) to get the two
|
|
9
|
-
// lines that replace the normal content area when confirming
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
|
|
12
|
-
import type { Line } from '../types/grid.ts';
|
|
13
|
-
import { buildPanelLine } from './polish.ts';
|
|
14
|
-
import { DEFAULT_PANEL_PALETTE } from './polish.ts';
|
|
15
|
-
|
|
16
|
-
export interface ConfirmState<T = string> {
|
|
17
|
-
/** The subject of the confirmation (e.g. item name or id). */
|
|
18
|
-
readonly subject: T;
|
|
19
|
-
/** Human-readable label for the item being destroyed. */
|
|
20
|
-
readonly label: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Call this from a panel's handleInput() BEFORE any other key handling.
|
|
25
|
-
*
|
|
26
|
-
* Returns:
|
|
27
|
-
* - `'confirmed'` — user pressed y; caller must execute the action and
|
|
28
|
-
* clear state (set confirm to null)
|
|
29
|
-
* - `'cancelled'` — user pressed n or Esc; caller must clear state
|
|
30
|
-
* - `'absorbed'` — any other key while confirm is active; caller returns true
|
|
31
|
-
* - `'inactive'` — no confirm pending; caller continues normal dispatch
|
|
32
|
-
*/
|
|
33
|
-
export function handleConfirmInput<T = string>(
|
|
34
|
-
confirm: ConfirmState<T> | null,
|
|
35
|
-
key: string,
|
|
36
|
-
): 'confirmed' | 'cancelled' | 'absorbed' | 'inactive' {
|
|
37
|
-
if (!confirm) return 'inactive';
|
|
38
|
-
if (key === 'y') return 'confirmed';
|
|
39
|
-
if (key === 'n' || key === 'escape') return 'cancelled';
|
|
40
|
-
return 'absorbed';
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Build the two confirmation lines to show in place of the normal list body.
|
|
45
|
-
* Callers embed these lines in a workspace section titled 'Confirmation'.
|
|
46
|
-
*/
|
|
47
|
-
export function renderConfirmLines<T = string>(width: number, state: ConfirmState<T>): Line[] {
|
|
48
|
-
const palette = DEFAULT_PANEL_PALETTE;
|
|
49
|
-
return [
|
|
50
|
-
buildPanelLine(width, [[
|
|
51
|
-
` Delete "${state.label}"?`,
|
|
52
|
-
palette.warn,
|
|
53
|
-
]]),
|
|
54
|
-
buildPanelLine(width, [
|
|
55
|
-
[' y', palette.info],
|
|
56
|
-
[' confirm delete', palette.dim],
|
|
57
|
-
[' n / Esc', palette.info],
|
|
58
|
-
[' cancel', palette.dim],
|
|
59
|
-
]),
|
|
60
|
-
];
|
|
61
|
-
}
|