@pellux/goodvibes-agent 1.4.3 → 1.5.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 +24 -0
- package/README.md +7 -7
- package/dist/package/main.js +7450 -12285
- 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/performance-snapshot.json +2 -2
- package/release/release-notes.md +11 -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 +63 -158
- 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/submission-router.ts +0 -5
- package/src/main.ts +111 -89
- 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
package/src/panels/base-panel.ts
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import type { Line } from '../types/grid.ts';
|
|
2
|
-
import type { Panel, PanelCategory } from './types.ts';
|
|
3
|
-
import type { ComponentResourceContract, ComponentHealthState } from '../runtime/perf/panel-contracts.ts';
|
|
4
|
-
import type { ComponentHealthMonitor } from '../runtime/perf/panel-health-monitor.ts';
|
|
5
|
-
import { UIFactory } from '../renderer/ui-factory.ts';
|
|
6
|
-
import { SPINNER_FRAMES } from '../renderer/progress.ts';
|
|
7
|
-
|
|
8
|
-
export abstract class BasePanel implements Panel {
|
|
9
|
-
public needsRender = true;
|
|
10
|
-
public isTransient = false;
|
|
11
|
-
public isPinned = false;
|
|
12
|
-
protected readonly componentHealthMonitor?: ComponentHealthMonitor;
|
|
13
|
-
|
|
14
|
-
// -------------------------------------------------------------------------
|
|
15
|
-
// Timer registry
|
|
16
|
-
// -------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
-
/** All timers registered via registerTimer(). Cleared automatically on onDestroy(). */
|
|
19
|
-
private readonly _timers: Set<ReturnType<typeof setTimeout> | ReturnType<typeof setInterval>> = new Set();
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Register a timer id (from setInterval or setTimeout) so it is
|
|
23
|
-
* automatically cleared when the panel is destroyed. Returns the id
|
|
24
|
-
* unchanged so the call can be chained inline:
|
|
25
|
-
*
|
|
26
|
-
* ```ts
|
|
27
|
-
* this.registerTimer(setInterval(() => this.refresh(), 5_000));
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
protected registerTimer<T extends ReturnType<typeof setTimeout> | ReturnType<typeof setInterval>>(id: T): T {
|
|
31
|
-
this._timers.add(id);
|
|
32
|
-
return id;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Clear a specific timer and remove it from the registry.
|
|
37
|
-
* Safe to call with an unregistered or already-cleared id.
|
|
38
|
-
*/
|
|
39
|
-
protected clearTimer(id: ReturnType<typeof setTimeout> | ReturnType<typeof setInterval>): void {
|
|
40
|
-
clearInterval(id as ReturnType<typeof setInterval>);
|
|
41
|
-
this._timers.delete(id);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// -------------------------------------------------------------------------
|
|
45
|
-
// I2: Error surface slot
|
|
46
|
-
// -------------------------------------------------------------------------
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Last error message to surface in the panel footer.
|
|
50
|
-
* Auto-cleared on the next keystroke by `ScrollableListPanel.handleInput()` (and any
|
|
51
|
-
* subclass that calls `super.handleInput()` or manually calls `this.clearError()` at
|
|
52
|
-
* the start of its handler). BasePanel itself does NOT auto-clear — only subclasses
|
|
53
|
-
* that opt into the contract do.
|
|
54
|
-
*/
|
|
55
|
-
protected lastError: string | null = null;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Set a transient error message. Triggers a re-render.
|
|
59
|
-
* The error will be auto-cleared on the next keystroke if the panel extends
|
|
60
|
-
* `ScrollableListPanel` (which calls `clearError()` at the top of `handleInput()`).
|
|
61
|
-
*/
|
|
62
|
-
protected setError(msg: string): void {
|
|
63
|
-
this.lastError = msg;
|
|
64
|
-
this.needsRender = true;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Clear the current error. */
|
|
68
|
-
protected clearError(): void {
|
|
69
|
-
this.lastError = null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Build a single error Line for display above the hints footer.
|
|
74
|
-
* Returns null when there is no active error.
|
|
75
|
-
*
|
|
76
|
-
* Color: bold red foreground (palette-consistent: #ef4444).
|
|
77
|
-
*/
|
|
78
|
-
protected renderErrorLine(width: number): Line | null {
|
|
79
|
-
if (!this.lastError) return null;
|
|
80
|
-
return UIFactory.stringToLine(
|
|
81
|
-
` ✕ ${this.lastError}`.padEnd(width).slice(0, width),
|
|
82
|
-
width,
|
|
83
|
-
{ fg: '#ef4444', bold: true },
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// -------------------------------------------------------------------------
|
|
88
|
-
// I3: Loading spinner slot
|
|
89
|
-
// -------------------------------------------------------------------------
|
|
90
|
-
|
|
91
|
-
/** Tracks the loading label for the spinner (undefined = no spinner active). */
|
|
92
|
-
protected loadingState: 'idle' | 'loading' | 'error' = 'idle';
|
|
93
|
-
private _loadingLabel = '';
|
|
94
|
-
|
|
95
|
-
/** Begin loading. Triggers a re-render. */
|
|
96
|
-
protected startLoading(label = 'Loading...'): void {
|
|
97
|
-
this.loadingState = 'loading';
|
|
98
|
-
this._loadingLabel = label;
|
|
99
|
-
this.needsRender = true;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** End loading (returns to idle). Triggers a re-render. */
|
|
103
|
-
protected stopLoading(): void {
|
|
104
|
-
this.loadingState = 'idle';
|
|
105
|
-
this._loadingLabel = '';
|
|
106
|
-
this.needsRender = true;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Run an async operation with the panel's loading spinner visible.
|
|
111
|
-
* The spinner is always cleared on completion, whether the operation succeeds or throws
|
|
112
|
-
* (uses try/finally). Rethrows any error so callers can handle it or forward to setError.
|
|
113
|
-
*
|
|
114
|
-
* @param label Optional label shown next to the spinner.
|
|
115
|
-
* @param fn The async work to run.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```ts
|
|
119
|
-
* try {
|
|
120
|
-
* await this.withLoading('Loading diff…', () => this.fetchDiff());
|
|
121
|
-
* } catch (err) {
|
|
122
|
-
* this.setError(summarizeError(err));
|
|
123
|
-
* }
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
protected async withLoading<T>(label: string | undefined, fn: () => Promise<T>): Promise<T> {
|
|
127
|
-
this.startLoading(label);
|
|
128
|
-
try {
|
|
129
|
-
return await fn();
|
|
130
|
-
} finally {
|
|
131
|
-
this.stopLoading();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Build a spinner Line for the loading state.
|
|
137
|
-
* Returns null when loadingState is not 'loading'.
|
|
138
|
-
*
|
|
139
|
-
* @param width Panel width in columns.
|
|
140
|
-
* @param frame Current animation frame index (caller increments each render).
|
|
141
|
-
*/
|
|
142
|
-
protected renderLoadingLine(width: number, frame = 0): Line | null {
|
|
143
|
-
if (this.loadingState !== 'loading') return null;
|
|
144
|
-
const spinner = SPINNER_FRAMES[frame % SPINNER_FRAMES.length] ?? SPINNER_FRAMES[0]!;
|
|
145
|
-
const text = ` ${spinner} ${this._loadingLabel}`;
|
|
146
|
-
return UIFactory.stringToLine(text.padEnd(width).slice(0, width), width, { fg: '135', bold: true });
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Optional resource contract for this panel.
|
|
151
|
-
* Override in subclasses to declare a custom contract; leave undefined
|
|
152
|
-
* to use the category default enforced by ComponentHealthMonitor.
|
|
153
|
-
*/
|
|
154
|
-
public resourceContract: Readonly<ComponentResourceContract> | undefined = undefined;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Live health state populated by ComponentHealthMonitor.
|
|
158
|
-
* Read-only from outside the monitor.
|
|
159
|
-
*/
|
|
160
|
-
public get healthState(): Readonly<ComponentHealthState> | undefined {
|
|
161
|
-
return this.componentHealthMonitor?.getHealth(this.id);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
constructor(
|
|
165
|
-
public readonly id: string,
|
|
166
|
-
public readonly name: string,
|
|
167
|
-
public readonly icon: string,
|
|
168
|
-
public readonly category: PanelCategory,
|
|
169
|
-
componentHealthMonitor?: ComponentHealthMonitor,
|
|
170
|
-
) {
|
|
171
|
-
this.componentHealthMonitor = componentHealthMonitor;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
onActivate(): void { this.needsRender = true; }
|
|
175
|
-
onDeactivate(): void {}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Called when the panel is permanently removed. Subclasses should call
|
|
179
|
-
* `super.onDestroy()` to ensure all registered timers are cleared.
|
|
180
|
-
*/
|
|
181
|
-
onDestroy(): void {
|
|
182
|
-
for (const id of this._timers) {
|
|
183
|
-
clearInterval(id as ReturnType<typeof setInterval>);
|
|
184
|
-
}
|
|
185
|
-
this._timers.clear();
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
abstract render(width: number, height: number): Line[];
|
|
189
|
-
|
|
190
|
-
/** R2: Mark this panel dirty — it will be re-rendered on the next compositor frame. */
|
|
191
|
-
public invalidate(): void { this.needsRender = true; }
|
|
192
|
-
|
|
193
|
-
/** R2: Called by the compositor after a successful render to clear the dirty flag. */
|
|
194
|
-
public markRendered(): void { this.needsRender = false; }
|
|
195
|
-
|
|
196
|
-
protected markDirty(): void { this.needsRender = true; }
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Check whether the panel is currently permitted to render.
|
|
200
|
-
*
|
|
201
|
-
* Consults the shared ComponentHealthMonitor. Returns true if not registered
|
|
202
|
-
* (unthrottled) or if the monitor permits a render at this moment.
|
|
203
|
-
*
|
|
204
|
-
* Call this inside render() or before invoking render() to skip
|
|
205
|
-
* expensive work when throttled:
|
|
206
|
-
*
|
|
207
|
-
* ```ts
|
|
208
|
-
* render(width, height): Line[] {
|
|
209
|
-
* if (!this.canRenderNow()) return this._lastLines ?? [];
|
|
210
|
-
* // ... expensive render ...
|
|
211
|
-
* }
|
|
212
|
-
* ```
|
|
213
|
-
*/
|
|
214
|
-
protected canRenderNow(now: number = Date.now()): boolean {
|
|
215
|
-
return this.componentHealthMonitor?.canRender(this.id, now) ?? true;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Report the duration of a completed render to the health monitor.
|
|
220
|
-
* Call this at the end of render() after measuring wall-clock cost.
|
|
221
|
-
*/
|
|
222
|
-
protected reportRenderDuration(durationMs: number, now: number = Date.now()): void {
|
|
223
|
-
this.componentHealthMonitor?.recordRender(this.id, durationMs, now);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/** Cache of the most recent lines produced by trackedRender. */
|
|
227
|
-
private _lastTrackedLines: Line[] = [];
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Wrap a render body with canRenderNow throttle check, wall-clock timing,
|
|
231
|
-
* and automatic reportRenderDuration.
|
|
232
|
-
*
|
|
233
|
-
* When throttled, returns the previously cached lines (stale but correctly
|
|
234
|
-
* sized) rather than empty lines, avoiding a flicker on every skipped frame.
|
|
235
|
-
*
|
|
236
|
-
* Usage:
|
|
237
|
-
* ```ts
|
|
238
|
-
* render(width: number, height: number): Line[] {
|
|
239
|
-
* return this.trackedRender(() => {
|
|
240
|
-
* // expensive render logic
|
|
241
|
-
* return lines;
|
|
242
|
-
* });
|
|
243
|
-
* }
|
|
244
|
-
* ```
|
|
245
|
-
*/
|
|
246
|
-
protected trackedRender(fn: () => Line[]): Line[] {
|
|
247
|
-
if (!this.canRenderNow()) return this._lastTrackedLines;
|
|
248
|
-
const start = Date.now();
|
|
249
|
-
const lines = fn();
|
|
250
|
-
this.reportRenderDuration(Date.now() - start);
|
|
251
|
-
this._lastTrackedLines = lines;
|
|
252
|
-
return lines;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { PanelManager } from '../panel-manager.ts';
|
|
2
|
-
import { ContextVisualizerPanel } from '../context-visualizer-panel.ts';
|
|
3
|
-
import { ThinkingPanel } from '../thinking-panel.ts';
|
|
4
|
-
import { ToolInspectorPanel } from '../tool-inspector-panel.ts';
|
|
5
|
-
import { SchedulePanel } from '../schedule-panel.ts';
|
|
6
|
-
import type { ResolvedBuiltinPanelDeps } from './shared.ts';
|
|
7
|
-
import { requireAutomationManager, requireUiServices } from './shared.ts';
|
|
8
|
-
|
|
9
|
-
export function registerAgentPanels(manager: PanelManager, deps: ResolvedBuiltinPanelDeps): void {
|
|
10
|
-
manager.registerType({
|
|
11
|
-
id: 'thinking',
|
|
12
|
-
name: 'Thinking',
|
|
13
|
-
icon: 'T',
|
|
14
|
-
category: 'ai',
|
|
15
|
-
description: 'Stream model reasoning tokens in real-time with collapsible blocks per turn',
|
|
16
|
-
preload: true,
|
|
17
|
-
factory: () => new ThinkingPanel(requireUiServices(deps).events.turns),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
manager.registerType({
|
|
21
|
-
id: 'tools',
|
|
22
|
-
name: 'Tools',
|
|
23
|
-
icon: 'X',
|
|
24
|
-
category: 'ai',
|
|
25
|
-
description: 'Chronological tool call inspector with expandable args/results and filtering',
|
|
26
|
-
preload: true,
|
|
27
|
-
factory: () => {
|
|
28
|
-
const ui = requireUiServices(deps);
|
|
29
|
-
return new ToolInspectorPanel(ui.events.tools, ui.events.turns);
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
manager.registerType({
|
|
34
|
-
id: 'context',
|
|
35
|
-
name: 'Context',
|
|
36
|
-
icon: 'C',
|
|
37
|
-
category: 'ai',
|
|
38
|
-
description: 'Context window visualizer: stacked bar showing token usage per section',
|
|
39
|
-
preload: true,
|
|
40
|
-
factory: () => new ContextVisualizerPanel(
|
|
41
|
-
requireUiServices(deps).events.turns,
|
|
42
|
-
deps.sessionMemoryStore,
|
|
43
|
-
deps.configManager,
|
|
44
|
-
deps.getOrchestratorUsage,
|
|
45
|
-
deps.contextWindow,
|
|
46
|
-
requireUiServices(deps).readModels.session,
|
|
47
|
-
),
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
manager.registerType({
|
|
51
|
-
id: 'schedule',
|
|
52
|
-
name: 'Schedule',
|
|
53
|
-
icon: 'Z',
|
|
54
|
-
category: 'agent',
|
|
55
|
-
description: 'Read-only schedule posture from the connected GoodVibes host; Agent-local schedule mutation is blocked',
|
|
56
|
-
factory: () => new SchedulePanel(requireAutomationManager(deps)),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { PanelManager } from '../panel-manager.ts';
|
|
2
|
-
import { MemoryPanel } from '../memory-panel.ts';
|
|
3
|
-
import { KnowledgePanel } from '../knowledge-panel.ts';
|
|
4
|
-
import type { ResolvedBuiltinPanelDeps } from './shared.ts';
|
|
5
|
-
|
|
6
|
-
export function registerKnowledgePanels(manager: PanelManager, deps: ResolvedBuiltinPanelDeps): void {
|
|
7
|
-
if (!deps.memoryRegistry) return;
|
|
8
|
-
|
|
9
|
-
const { agentKnowledgeService, memoryRegistry } = deps;
|
|
10
|
-
manager.registerType({
|
|
11
|
-
id: 'knowledge',
|
|
12
|
-
name: 'Knowledge',
|
|
13
|
-
icon: 'K',
|
|
14
|
-
category: 'agent',
|
|
15
|
-
description: 'Isolated Agent Knowledge plus local non-secret memory review',
|
|
16
|
-
factory: () => new KnowledgePanel(memoryRegistry, agentKnowledgeService ?? null),
|
|
17
|
-
});
|
|
18
|
-
manager.registerType({
|
|
19
|
-
id: 'memory',
|
|
20
|
-
name: 'Memory',
|
|
21
|
-
icon: 'M',
|
|
22
|
-
category: 'agent',
|
|
23
|
-
description: 'Project memory: decisions, constraints, incidents, and patterns with provenance links',
|
|
24
|
-
factory: () => new MemoryPanel(memoryRegistry),
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import type { PanelManager } from '../panel-manager.ts';
|
|
2
|
-
import { ApprovalPanel } from '../approval-panel.ts';
|
|
3
|
-
import { AutomationControlPanel } from '../automation-control-panel.ts';
|
|
4
|
-
import { SubscriptionPanel } from '../subscription-panel.ts';
|
|
5
|
-
import { ProviderAccountsPanel } from '../provider-accounts-panel.ts';
|
|
6
|
-
import { SecurityPanel } from '../security-panel.ts';
|
|
7
|
-
import { TasksPanel } from '../tasks-panel.ts';
|
|
8
|
-
import { ProviderStatsPanel } from '../provider-stats-panel.ts';
|
|
9
|
-
import { ProviderHealthPanel } from '../provider-health-panel.ts';
|
|
10
|
-
import { createProviderAccountSnapshotQuery } from '../provider-account-snapshot.ts';
|
|
11
|
-
import {
|
|
12
|
-
createEnvironmentVariableQuery,
|
|
13
|
-
createProviderRuntimeInspectionQuery,
|
|
14
|
-
} from '../../runtime/ui-service-queries.ts';
|
|
15
|
-
import { createRuntimeProviderApi } from '@/runtime/index.ts';
|
|
16
|
-
import type { ResolvedBuiltinPanelDeps } from './shared.ts';
|
|
17
|
-
import { requireUiServices } from './shared.ts';
|
|
18
|
-
|
|
19
|
-
export function registerOperationsPanels(manager: PanelManager, deps: ResolvedBuiltinPanelDeps): void {
|
|
20
|
-
const ui = requireUiServices(deps);
|
|
21
|
-
const providerRuntime = createProviderRuntimeInspectionQuery(createRuntimeProviderApi({
|
|
22
|
-
benchmarkStore: ui.providers.benchmarkStore,
|
|
23
|
-
favoritesStore: ui.providers.favoritesStore,
|
|
24
|
-
providerRegistry: ui.providers.providerRegistry,
|
|
25
|
-
}));
|
|
26
|
-
const providerAccounts = createProviderAccountSnapshotQuery({
|
|
27
|
-
providerModels: deps.providerRegistry,
|
|
28
|
-
services: deps.serviceRegistry,
|
|
29
|
-
subscriptions: deps.subscriptionManager,
|
|
30
|
-
environment: createEnvironmentVariableQuery(process.env),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
manager.registerType({
|
|
34
|
-
id: 'approval',
|
|
35
|
-
name: 'Approval',
|
|
36
|
-
icon: 'A',
|
|
37
|
-
category: 'monitoring',
|
|
38
|
-
description: 'Action-specific approval workspace for why-prompted, why-denied, and what-if review',
|
|
39
|
-
factory: () => new ApprovalPanel(deps.policyRuntimeState),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
manager.registerType({
|
|
43
|
-
id: 'automation',
|
|
44
|
-
name: 'Automation',
|
|
45
|
-
icon: 'M',
|
|
46
|
-
category: 'monitoring',
|
|
47
|
-
description: 'Read-only automation jobs, runs, deliveries, and failure posture from the connected GoodVibes host',
|
|
48
|
-
factory: () => new AutomationControlPanel(ui.readModels.automation),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
manager.registerType({
|
|
52
|
-
id: 'subscription',
|
|
53
|
-
name: 'Subscriptions',
|
|
54
|
-
icon: 'B',
|
|
55
|
-
category: 'monitoring',
|
|
56
|
-
description: 'OAuth-backed provider subscriptions and supported provider override posture',
|
|
57
|
-
factory: () => new SubscriptionPanel(deps.serviceRegistry, deps.subscriptionManager),
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
manager.registerType({
|
|
61
|
-
id: 'accounts',
|
|
62
|
-
name: 'Accounts',
|
|
63
|
-
icon: 'Q',
|
|
64
|
-
category: 'monitoring',
|
|
65
|
-
description: 'Provider auth routes, subscription quota-window hints, and billing-path safety notes',
|
|
66
|
-
factory: () => new ProviderAccountsPanel({ providerAccounts }),
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
manager.registerType({
|
|
70
|
-
id: 'security',
|
|
71
|
-
name: 'Security',
|
|
72
|
-
icon: 'U',
|
|
73
|
-
category: 'monitoring',
|
|
74
|
-
description: 'Security review workspace for token posture, policy posture, MCP quarantine, and incident pressure',
|
|
75
|
-
factory: () => new SecurityPanel(ui.readModels.security),
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
manager.registerType({
|
|
79
|
-
id: 'tasks',
|
|
80
|
-
name: 'Tasks',
|
|
81
|
-
icon: 'J',
|
|
82
|
-
category: 'monitoring',
|
|
83
|
-
description: 'Queued, running, blocked, failed, and completed task summaries from the connected GoodVibes host',
|
|
84
|
-
factory: () => new TasksPanel(ui.readModels.tasks),
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
manager.registerType({
|
|
88
|
-
id: 'providers',
|
|
89
|
-
name: 'Providers',
|
|
90
|
-
icon: 'R',
|
|
91
|
-
category: 'monitoring',
|
|
92
|
-
description: 'Per-provider performance metrics: latency, error rate, request count, sparkline trends',
|
|
93
|
-
factory: () => new ProviderStatsPanel(ui.events.turns, ui.events.providers, deps.requestRender, ui.readModels.providers),
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
manager.registerType({
|
|
97
|
-
id: 'provider-health',
|
|
98
|
-
name: 'Health',
|
|
99
|
-
icon: 'N',
|
|
100
|
-
category: 'monitoring',
|
|
101
|
-
description: 'Provider health dashboard: real-time status, latency, errors, and rate-limit cooldowns',
|
|
102
|
-
preload: true,
|
|
103
|
-
factory: () => new ProviderHealthPanel(
|
|
104
|
-
providerRuntime,
|
|
105
|
-
{
|
|
106
|
-
configManager: deps.configManager,
|
|
107
|
-
turnEvents: ui.events.turns,
|
|
108
|
-
providerEvents: ui.events.providers,
|
|
109
|
-
providers: ui.readModels.providers,
|
|
110
|
-
session: ui.readModels.session,
|
|
111
|
-
security: ui.readModels.security,
|
|
112
|
-
localAuth: ui.readModels.localAuth,
|
|
113
|
-
settings: ui.readModels.settings,
|
|
114
|
-
remote: ui.readModels.remote,
|
|
115
|
-
continuity: ui.readModels.continuity,
|
|
116
|
-
},
|
|
117
|
-
deps.requestRender,
|
|
118
|
-
),
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
}
|
|
@@ -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
|
-
}
|