@pellux/goodvibes-tui 0.18.12 → 0.18.17
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 +172 -0
- package/README.md +1 -1
- package/docs/foundation-artifacts/operator-contract.json +1 -1
- package/package.json +3 -2
- package/src/config/index.ts +1 -138
- package/src/core/conversation-rendering.ts +3 -3
- package/src/core/conversation.ts +176 -423
- package/src/core/history.ts +45 -0
- package/src/core/orchestrator.ts +3 -735
- package/src/core/system-message-router.ts +19 -58
- package/src/daemon/cli.ts +82 -6
- package/src/input/command-registry.ts +2 -0
- package/src/input/commands/control-room-runtime.ts +1 -1
- package/src/input/commands/health-runtime.ts +1 -1
- package/src/input/commands/local-setup-review.ts +1 -1
- package/src/input/commands/platform-access-runtime.ts +1 -1
- package/src/input/commands/qrcode-runtime.ts +20 -0
- package/src/input/commands/subscription-runtime.ts +1 -1
- package/src/input/commands.ts +2 -0
- package/src/input/handler-content-actions.ts +2 -2
- package/src/input/handler-feed.ts +7 -1
- package/src/input/handler-modal-routes.ts +19 -2
- package/src/input/handler-modal-token-routes.ts +4 -1
- package/src/input/handler-picker-routes.ts +4 -2
- package/src/input/handler-ui-state.ts +1 -1
- package/src/input/handler.ts +1 -1
- package/src/input/model-picker.ts +11 -0
- package/src/input/search.ts +1 -1
- package/src/input/selection.ts +2 -2
- package/src/input/settings-modal.ts +31 -3
- package/src/main.ts +1 -1
- package/src/panels/agent-inspector-panel.ts +3 -3
- package/src/panels/agent-logs-panel.ts +26 -27
- package/src/panels/approval-panel.ts +2 -2
- package/src/panels/automation-control-panel.ts +3 -3
- package/src/panels/base-panel.ts +14 -14
- package/src/panels/builtin/operations.ts +1 -1
- package/src/panels/builtin/session.ts +67 -1
- package/src/panels/builtin/shared.ts +4 -4
- package/src/panels/cockpit-panel.ts +2 -2
- package/src/panels/communication-panel.ts +3 -3
- package/src/panels/context-visualizer-panel.ts +2 -2
- package/src/panels/control-plane-panel.ts +3 -3
- package/src/panels/cost-tracker-panel.ts +3 -3
- package/src/panels/debug-panel.ts +2 -2
- package/src/panels/diff-panel.ts +2 -2
- package/src/panels/docs-panel.ts +1 -1
- package/src/panels/eval-panel.ts +2 -2
- package/src/panels/file-explorer-panel.ts +3 -3
- package/src/panels/file-preview-panel.ts +3 -3
- package/src/panels/forensics-panel.ts +2 -2
- package/src/panels/git-panel.ts +1 -1
- package/src/panels/hooks-panel.ts +3 -3
- package/src/panels/incident-review-panel.ts +1 -1
- package/src/panels/intelligence-panel.ts +2 -2
- package/src/panels/knowledge-panel.ts +1 -1
- package/src/panels/local-auth-panel.ts +2 -2
- package/src/panels/marketplace-panel.ts +1 -1
- package/src/panels/mcp-panel.ts +3 -3
- package/src/panels/memory-panel.ts +1 -1
- package/src/panels/ops-control-panel.ts +3 -3
- package/src/panels/ops-strategy-panel.ts +2 -2
- package/src/panels/orchestration-panel.ts +2 -2
- package/src/panels/panel-list-panel.ts +6 -6
- package/src/panels/plan-dashboard-panel.ts +1 -1
- package/src/panels/plugins-panel.ts +2 -2
- package/src/panels/policy-panel.ts +2 -2
- package/src/panels/polish.ts +3 -3
- package/src/panels/provider-account-snapshot.ts +1 -1
- package/src/panels/provider-accounts-panel.ts +25 -29
- package/src/panels/provider-health-panel.ts +2 -2
- package/src/panels/provider-stats-panel.ts +3 -3
- package/src/panels/qr-panel.ts +182 -0
- package/src/panels/remote-panel.ts +3 -3
- package/src/panels/routes-panel.ts +3 -3
- package/src/panels/sandbox-panel.ts +2 -2
- package/src/panels/schedule-panel.ts +1 -1
- package/src/panels/scrollable-list-panel.ts +407 -0
- package/src/panels/security-panel.ts +2 -2
- package/src/panels/services-panel.ts +3 -3
- package/src/panels/session-browser-panel.ts +2 -2
- package/src/panels/settings-sync-panel.ts +2 -2
- package/src/panels/skills-panel.ts +6 -6
- package/src/panels/subscription-panel.ts +3 -3
- package/src/panels/symbol-outline-panel.ts +3 -3
- package/src/panels/system-messages-panel.ts +4 -4
- package/src/panels/tasks-panel.ts +2 -2
- package/src/panels/thinking-panel.ts +3 -3
- package/src/panels/token-budget-panel.ts +1 -1
- package/src/panels/tool-inspector-panel.ts +3 -3
- package/src/panels/types.ts +5 -5
- package/src/panels/watchers-panel.ts +3 -3
- package/src/panels/welcome-panel.ts +1 -1
- package/src/panels/worktree-panel.ts +22 -21
- package/src/panels/wrfc-panel.ts +3 -3
- package/src/permissions/prompt.ts +3 -22
- package/src/plugins/loader.ts +15 -304
- package/src/renderer/agent-detail-modal.ts +1 -1
- package/src/renderer/autocomplete-overlay.ts +2 -2
- package/src/renderer/bookmark-modal.ts +1 -1
- package/src/renderer/bottom-bar.ts +2 -2
- package/src/renderer/buffer.ts +1 -1
- package/src/renderer/code-block.ts +2 -2
- package/src/renderer/compositor.ts +2 -2
- package/src/renderer/context-inspector.ts +1 -1
- package/src/renderer/conversation-layout.ts +2 -2
- package/src/renderer/conversation-overlays.ts +1 -1
- package/src/renderer/conversation-surface.ts +2 -2
- package/src/renderer/diff-view.ts +2 -2
- package/src/renderer/diff.ts +1 -1
- package/src/renderer/file-picker-overlay.ts +2 -2
- package/src/renderer/file-tree.ts +2 -2
- package/src/renderer/help-overlay.ts +1 -1
- package/src/renderer/history-search-overlay.ts +2 -2
- package/src/renderer/live-tail-modal.ts +1 -1
- package/src/renderer/markdown.ts +2 -2
- package/src/renderer/modal-factory.ts +3 -3
- package/src/renderer/model-picker-overlay.ts +2 -2
- package/src/renderer/overlay-box.ts +2 -2
- package/src/renderer/panel-composite.ts +1 -1
- package/src/renderer/panel-picker-overlay.ts +2 -2
- package/src/renderer/panel-tab-bar.ts +1 -1
- package/src/renderer/panel-workspace-bar.ts +1 -1
- package/src/renderer/process-indicator.ts +2 -2
- package/src/renderer/process-modal.ts +1 -1
- package/src/renderer/profile-picker-modal.ts +2 -2
- package/src/renderer/progress.ts +2 -2
- package/src/renderer/qr-renderer.ts +117 -0
- package/src/renderer/search-overlay.ts +2 -2
- package/src/renderer/selection-modal-overlay.ts +2 -2
- package/src/renderer/session-picker-modal.ts +2 -2
- package/src/renderer/settings-modal-helpers.ts +122 -0
- package/src/renderer/settings-modal.ts +149 -113
- package/src/renderer/shell-surface.ts +1 -1
- package/src/renderer/system-message.ts +1 -1
- package/src/renderer/tab-strip.ts +2 -2
- package/src/renderer/text-layout.ts +1 -1
- package/src/renderer/thinking.ts +1 -1
- package/src/renderer/tool-call.ts +2 -2
- package/src/renderer/ui-factory.ts +2 -2
- package/src/runtime/bootstrap-command-context.ts +5 -6
- package/src/runtime/bootstrap-command-parts.ts +32 -18
- package/src/runtime/bootstrap-core.ts +3 -2
- package/src/runtime/bootstrap-hook-bridge.ts +15 -174
- package/src/runtime/bootstrap-shell.ts +4 -4
- package/src/runtime/bootstrap.ts +7 -2
- package/src/runtime/context.ts +4 -20
- package/src/runtime/diagnostics/panels/index.ts +6 -6
- package/src/runtime/diagnostics/panels/ops.ts +1 -1
- package/src/runtime/diagnostics/panels/panel-resources.ts +118 -0
- package/src/runtime/perf/panel-contracts.ts +32 -0
- package/src/runtime/perf/panel-health-monitor.ts +18 -0
- package/src/runtime/services.ts +5 -5
- package/src/runtime/store/domains/domain-read-matrix.ts +0 -2
- package/src/runtime/store/selectors/index.ts +11 -6
- package/src/runtime/store/state.ts +12 -4
- package/src/runtime/ui-events.ts +1 -0
- package/src/runtime/ui-read-model-helpers.ts +1 -32
- package/src/runtime/ui-read-models-observability-maintenance.ts +1 -81
- package/src/runtime/ui-read-models-observability-options.ts +1 -5
- package/src/runtime/ui-read-models-observability-remote.ts +1 -73
- package/src/runtime/ui-read-models-observability-security.ts +1 -172
- package/src/runtime/ui-read-models-observability-system.ts +1 -217
- package/src/runtime/ui-read-models-observability.ts +1 -59
- package/src/runtime/ui-service-queries.ts +1 -114
- package/src/runtime/ui-services.ts +1 -1
- package/src/shell/ui-openers.ts +1 -1
- package/src/tools/index.ts +1 -186
- package/src/types/grid.ts +48 -0
- package/src/utils/clipboard.ts +21 -0
- package/src/utils/splash-lines.ts +1 -1
- package/src/utils/terminal-width.ts +185 -0
- package/src/version.ts +1 -1
- package/src/config/service-registry.ts +0 -1
- package/src/config/subscription-providers.ts +0 -127
- package/src/daemon/facade-composition.ts +0 -398
- package/src/daemon/facade.ts +0 -638
- package/src/daemon/surface-policy.ts +0 -60
- package/src/daemon/types.ts +0 -191
- package/src/runtime/diagnostics/actions.ts +0 -776
- package/src/runtime/diagnostics/index.ts +0 -99
- package/src/runtime/diagnostics/panels/agents.ts +0 -252
- package/src/runtime/diagnostics/panels/events.ts +0 -188
- package/src/runtime/diagnostics/panels/health.ts +0 -242
- package/src/runtime/diagnostics/panels/tasks.ts +0 -251
- package/src/runtime/diagnostics/panels/tool-calls.ts +0 -267
- package/src/runtime/diagnostics/provider.ts +0 -262
- package/src/runtime/store/domains/conversation.ts +0 -181
- package/src/runtime/store/domains/permissions.ts +0 -143
- package/src/runtime/store/helpers/reducers/conversation.ts +0 -228
- package/src/runtime/store/helpers/reducers/lifecycle.ts +0 -440
- package/src/runtime/store/helpers/reducers/shared.ts +0 -60
- package/src/runtime/store/helpers/reducers/sync.ts +0 -555
- package/src/runtime/store/helpers/reducers.ts +0 -30
- package/src/runtime/ui-read-models-core.ts +0 -95
- package/src/runtime/ui-read-models-operations.ts +0 -203
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel resource diagnostics panel data provider.
|
|
3
|
+
*
|
|
4
|
+
* Polls the shared TUI-owned ComponentHealthMonitor and produces PanelResourceSnapshot
|
|
5
|
+
* values for the diagnostics panel to render.
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentHealthMonitor } from '../../perf/panel-health-monitor.ts';
|
|
8
|
+
import type {
|
|
9
|
+
ComponentResourceEntry,
|
|
10
|
+
ComponentResourceSnapshot,
|
|
11
|
+
} from '@pellux/goodvibes-sdk/platform/runtime/diagnostics/types';
|
|
12
|
+
|
|
13
|
+
const DEFAULT_POLL_INTERVAL_MS = 500;
|
|
14
|
+
|
|
15
|
+
const HEALTH_ORDER: Record<string, number> = {
|
|
16
|
+
overloaded: 0,
|
|
17
|
+
warning: 1,
|
|
18
|
+
healthy: 2,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class PanelResourcesPanel {
|
|
22
|
+
private readonly _pollIntervalMs: number;
|
|
23
|
+
private readonly _monitor: ComponentHealthMonitor;
|
|
24
|
+
private _current: ComponentResourceSnapshot;
|
|
25
|
+
private _timerId: ReturnType<typeof setInterval> | null = null;
|
|
26
|
+
private readonly _subscribers = new Set<() => void>();
|
|
27
|
+
|
|
28
|
+
constructor(monitor: ComponentHealthMonitor, pollIntervalMs: number = DEFAULT_POLL_INTERVAL_MS) {
|
|
29
|
+
this._monitor = monitor;
|
|
30
|
+
this._pollIntervalMs = pollIntervalMs;
|
|
31
|
+
this._current = this._buildSnapshot(Date.now());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
start(): void {
|
|
35
|
+
if (this._timerId !== null) return;
|
|
36
|
+
this._timerId = setInterval(() => {
|
|
37
|
+
this._current = this._buildSnapshot(Date.now());
|
|
38
|
+
this._notify();
|
|
39
|
+
}, this._pollIntervalMs);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
stop(): void {
|
|
43
|
+
if (this._timerId !== null) {
|
|
44
|
+
clearInterval(this._timerId);
|
|
45
|
+
this._timerId = null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getSnapshot(): ComponentResourceSnapshot {
|
|
50
|
+
return this._current;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
refresh(now: number = Date.now()): ComponentResourceSnapshot {
|
|
54
|
+
this._current = this._buildSnapshot(now);
|
|
55
|
+
return this._current;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
subscribe(callback: () => void): () => void {
|
|
59
|
+
this._subscribers.add(callback);
|
|
60
|
+
return () => this._subscribers.delete(callback);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
dispose(): void {
|
|
64
|
+
this.stop();
|
|
65
|
+
this._subscribers.clear();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private _buildSnapshot(capturedAt: number): ComponentResourceSnapshot {
|
|
69
|
+
const healthStates = this._monitor.getAllHealth();
|
|
70
|
+
|
|
71
|
+
const panels: ComponentResourceEntry[] = healthStates.map((health) => {
|
|
72
|
+
const contract = this._monitor.getContract(health.componentId);
|
|
73
|
+
return {
|
|
74
|
+
componentId: health.componentId,
|
|
75
|
+
throttleStatus: health.throttleStatus,
|
|
76
|
+
healthStatus: health.healthStatus,
|
|
77
|
+
renderP95Ms: health.renderP95Ms,
|
|
78
|
+
maxRenderMs: contract?.maxRenderMs ?? 0,
|
|
79
|
+
rendersInWindow: health.rendersInWindow,
|
|
80
|
+
maxUpdatesPerSecond: contract?.maxUpdatesPerSecond ?? 0,
|
|
81
|
+
consecutiveViolations: health.consecutiveViolations,
|
|
82
|
+
totalSuppressed: health.totalSuppressed,
|
|
83
|
+
totalPermitted: health.totalPermitted,
|
|
84
|
+
lastRenderAt: health.lastRenderAt,
|
|
85
|
+
nextAllowedAt: health.nextAllowedAt,
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
panels.sort((left, right) => {
|
|
90
|
+
const diff = (HEALTH_ORDER[left.healthStatus] ?? 2) - (HEALTH_ORDER[right.healthStatus] ?? 2);
|
|
91
|
+
return diff !== 0 ? diff : left.componentId.localeCompare(right.componentId);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const overloadedCount = panels.filter((panel) => panel.healthStatus === 'overloaded').length;
|
|
95
|
+
const warningCount = panels.filter((panel) => panel.healthStatus === 'warning').length;
|
|
96
|
+
const healthyCount = panels.filter((panel) => panel.healthStatus === 'healthy').length;
|
|
97
|
+
const totalSuppressed = panels.reduce((sum, panel) => sum + panel.totalSuppressed, 0);
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
panels,
|
|
101
|
+
overloadedCount,
|
|
102
|
+
warningCount,
|
|
103
|
+
healthyCount,
|
|
104
|
+
totalSuppressed,
|
|
105
|
+
capturedAt,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private _notify(): void {
|
|
110
|
+
for (const callback of this._subscribers) {
|
|
111
|
+
try {
|
|
112
|
+
callback();
|
|
113
|
+
} catch {
|
|
114
|
+
// Subscriber failures must not take down diagnostics polling.
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel resource contracts — backward-compat shim.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the SDK's component contract types and helpers. TUI code that
|
|
5
|
+
* previously used local `ComponentResourceContract` / `ComponentHealthState`
|
|
6
|
+
* types (with `panelId`) now uses the SDK types (with `componentId`).
|
|
7
|
+
*
|
|
8
|
+
* Backward-compat aliases are re-exported:
|
|
9
|
+
* - `PanelResourceContract` = `Omit<ComponentResourceContract,'componentId'> & { panelId }`
|
|
10
|
+
* - `PanelHealthState` = `Omit<ComponentHealthState,'componentId'> & { panelId }`
|
|
11
|
+
*
|
|
12
|
+
* These keep TUI-internal code that still uses `.panelId` compiling while
|
|
13
|
+
* the broader migration to `.componentId` proceeds.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export type {
|
|
17
|
+
ComponentThrottleStatus,
|
|
18
|
+
ComponentHealthStatus,
|
|
19
|
+
ComponentResourceContract,
|
|
20
|
+
ComponentHealthState,
|
|
21
|
+
PanelThrottleStatus,
|
|
22
|
+
PanelHealthStatus,
|
|
23
|
+
PanelResourceContract,
|
|
24
|
+
PanelHealthState,
|
|
25
|
+
} from '@pellux/goodvibes-sdk/platform/runtime/perf/component-contracts';
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
CATEGORY_CONTRACTS,
|
|
29
|
+
buildContract,
|
|
30
|
+
createInitialComponentHealthState,
|
|
31
|
+
createInitialPanelHealthState,
|
|
32
|
+
} from '@pellux/goodvibes-sdk/platform/runtime/perf/component-contracts';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel health monitor — backward-compat shim.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the SDK's ComponentHealthMonitor so that the TUI and the SDK
|
|
5
|
+
* share a single class declaration. This eliminates the TypeScript nominal
|
|
6
|
+
* incompatibility that arises from two classes having separate `private`
|
|
7
|
+
* field declarations with the same name.
|
|
8
|
+
*
|
|
9
|
+
* All call-sites that previously imported the TUI-local ComponentHealthMonitor
|
|
10
|
+
* now receive the SDK's canonical class without any behavioral change —
|
|
11
|
+
* the public API is identical (register/deregister/canRender/recordRender/
|
|
12
|
+
* getHealth/getAllHealth/getContract/resetHealth).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
ComponentHealthMonitor,
|
|
17
|
+
PanelHealthMonitor,
|
|
18
|
+
} from '@pellux/goodvibes-sdk/platform/runtime/perf/component-health-monitor';
|
package/src/runtime/services.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { ConfigManager } from '@pellux/goodvibes-sdk/platform/config/manager';
|
|
3
3
|
import { SecretsManager } from '../config/secrets.ts';
|
|
4
|
-
import { ServiceRegistry } from '
|
|
4
|
+
import { ServiceRegistry } from '@pellux/goodvibes-sdk/platform/config/service-registry';
|
|
5
5
|
import { SubscriptionManager } from '@pellux/goodvibes-sdk/platform/config/subscriptions';
|
|
6
6
|
import { AutomationDeliveryManager, AutomationManager, AutomationRouteStore } from '@pellux/goodvibes-sdk/platform/automation/index';
|
|
7
7
|
import { ChannelPluginRegistry, ChannelPolicyManager, RouteBindingManager, SurfaceRegistry } from '@pellux/goodvibes-sdk/platform/channels/index';
|
|
@@ -62,7 +62,7 @@ import { ProjectIndex } from '@pellux/goodvibes-sdk/platform/state/project-index
|
|
|
62
62
|
import { IdempotencyStore } from '@pellux/goodvibes-sdk/platform/runtime/idempotency/index';
|
|
63
63
|
import { OverflowHandler } from '@pellux/goodvibes-sdk/platform/tools/shared/overflow';
|
|
64
64
|
import { ToolLLM } from '@pellux/goodvibes-sdk/platform/config/tool-llm';
|
|
65
|
-
import {
|
|
65
|
+
import { ComponentHealthMonitor } from '@pellux/goodvibes-sdk/platform/runtime/perf/component-health-monitor';
|
|
66
66
|
import { WorktreeRegistry } from '@pellux/goodvibes-sdk/platform/runtime/worktree/registry';
|
|
67
67
|
import { SandboxSessionRegistry } from '@pellux/goodvibes-sdk/platform/runtime/sandbox/session-registry';
|
|
68
68
|
import { createShellPathService, type ShellPathService } from '@pellux/goodvibes-sdk/platform/runtime/shell-paths';
|
|
@@ -133,7 +133,7 @@ export interface RuntimeServices {
|
|
|
133
133
|
readonly channelPolicy: ChannelPolicyManager;
|
|
134
134
|
readonly mcpRegistry: McpRegistry;
|
|
135
135
|
readonly tokenAuditor: ApiTokenAuditor;
|
|
136
|
-
readonly
|
|
136
|
+
readonly componentHealthMonitor: ComponentHealthMonitor;
|
|
137
137
|
readonly worktreeRegistry: WorktreeRegistry;
|
|
138
138
|
readonly sandboxSessionRegistry: SandboxSessionRegistry;
|
|
139
139
|
readonly webhookNotifier: WebhookNotifier;
|
|
@@ -393,7 +393,7 @@ export function createRuntimeServices(options: RuntimeServicesOptions): RuntimeS
|
|
|
393
393
|
mcpRegistry.setRuntimeBus(options.runtimeBus);
|
|
394
394
|
mcpRegistry.setSandboxRuntime(configManager, sandboxSessionRegistry);
|
|
395
395
|
const tokenAuditor = new ApiTokenAuditor({ managed: false });
|
|
396
|
-
const
|
|
396
|
+
const componentHealthMonitor = new ComponentHealthMonitor();
|
|
397
397
|
const worktreeRegistry = new WorktreeRegistry(workingDirectory);
|
|
398
398
|
const webhookNotifier = new WebhookNotifier();
|
|
399
399
|
const replayEngine = new DeterministicReplayEngine(workingDirectory);
|
|
@@ -511,7 +511,7 @@ export function createRuntimeServices(options: RuntimeServicesOptions): RuntimeS
|
|
|
511
511
|
channelPolicy,
|
|
512
512
|
mcpRegistry,
|
|
513
513
|
tokenAuditor,
|
|
514
|
-
|
|
514
|
+
componentHealthMonitor,
|
|
515
515
|
worktreeRegistry,
|
|
516
516
|
sandboxSessionRegistry,
|
|
517
517
|
webhookNotifier,
|
|
@@ -53,9 +53,9 @@ export function selectOverlays(state: RuntimeState): OverlayDomainState {
|
|
|
53
53
|
return state.overlays;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
/** Select the full panels domain slice. */
|
|
56
|
+
/** Select the full panels domain slice. Casts from Record<string,unknown> to PanelDomainState. */
|
|
57
57
|
export function selectPanels(state: RuntimeState): PanelDomainState {
|
|
58
|
-
return state.panels;
|
|
58
|
+
return state.panels as unknown as PanelDomainState;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/** Select the full permissions domain slice. */
|
|
@@ -123,11 +123,14 @@ export function selectIntelligence(state: RuntimeState): IntelligenceDomainState
|
|
|
123
123
|
return state.intelligence;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
/** Select the full UI performance domain slice. */
|
|
126
|
+
/** Select the full surface/UI performance domain slice. */
|
|
127
127
|
export function selectUiPerf(state: RuntimeState): UiPerfDomainState {
|
|
128
|
-
return state.
|
|
128
|
+
return state.surfacePerf;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
/** Select the full surface performance domain slice (SDK-compatible alias). */
|
|
132
|
+
export const selectSurfacePerf = selectUiPerf;
|
|
133
|
+
|
|
131
134
|
// ---------------------------------------------------------------------------
|
|
132
135
|
// Derived selectors
|
|
133
136
|
// ---------------------------------------------------------------------------
|
|
@@ -271,7 +274,8 @@ export function selectPermissionMode(state: RuntimeState): PermissionMode {
|
|
|
271
274
|
*/
|
|
272
275
|
export function selectActivePanels(state: RuntimeState): PanelState[] {
|
|
273
276
|
const result: PanelState[] = [];
|
|
274
|
-
|
|
277
|
+
const panelDomain = state.panels as unknown as PanelDomainState;
|
|
278
|
+
for (const panel of panelDomain.panels.values()) {
|
|
275
279
|
if (panel.open) {
|
|
276
280
|
result.push(panel);
|
|
277
281
|
}
|
|
@@ -283,7 +287,8 @@ export function selectActivePanels(state: RuntimeState): PanelState[] {
|
|
|
283
287
|
* Returns the panel currently holding focus.
|
|
284
288
|
*/
|
|
285
289
|
export function selectFocusedPanel(state: RuntimeState): PanelState | undefined {
|
|
286
|
-
|
|
290
|
+
const panelDomain = state.panels as unknown as PanelDomainState;
|
|
291
|
+
return panelDomain.panels.get(panelDomain.focusedPanelId);
|
|
287
292
|
}
|
|
288
293
|
|
|
289
294
|
/**
|
|
@@ -33,6 +33,9 @@ import type { GitDomainState } from '@pellux/goodvibes-sdk/platform/runtime/stor
|
|
|
33
33
|
import type { DiscoveryDomainState } from '@pellux/goodvibes-sdk/platform/runtime/store/domains/discovery';
|
|
34
34
|
import type { IntelligenceDomainState } from '@pellux/goodvibes-sdk/platform/runtime/store/domains/intelligence';
|
|
35
35
|
import type { UiPerfDomainState } from './domains/ui-perf.ts';
|
|
36
|
+
// UiPerfDomainState is structurally identical to SDK's SurfacePerfDomainState.
|
|
37
|
+
// Export as SurfacePerfDomainState alias for SDK compatibility.
|
|
38
|
+
export type { UiPerfDomainState };
|
|
36
39
|
|
|
37
40
|
import { createInitialSessionState } from '@pellux/goodvibes-sdk/platform/runtime/store/domains/session';
|
|
38
41
|
import { createInitialModelState } from '@pellux/goodvibes-sdk/platform/runtime/store/domains/model';
|
|
@@ -73,7 +76,11 @@ export interface RuntimeState {
|
|
|
73
76
|
model: ModelDomainState;
|
|
74
77
|
conversation: ConversationDomainState;
|
|
75
78
|
overlays: OverlayDomainState;
|
|
76
|
-
|
|
79
|
+
/**
|
|
80
|
+
* TUI panel state. Typed as Record<string,unknown> for SDK RuntimeState
|
|
81
|
+
* compatibility. Use selectPanels() which casts to PanelDomainState.
|
|
82
|
+
*/
|
|
83
|
+
panels: Record<string, unknown>;
|
|
77
84
|
permissions: PermissionDomainState;
|
|
78
85
|
tasks: TaskDomainState;
|
|
79
86
|
agents: AgentDomainState;
|
|
@@ -95,7 +102,8 @@ export interface RuntimeState {
|
|
|
95
102
|
git: GitDomainState;
|
|
96
103
|
discovery: DiscoveryDomainState;
|
|
97
104
|
intelligence: IntelligenceDomainState;
|
|
98
|
-
|
|
105
|
+
/** Surface/UI performance metrics. SDK-compatible field name. */
|
|
106
|
+
surfacePerf: UiPerfDomainState;
|
|
99
107
|
}
|
|
100
108
|
|
|
101
109
|
/**
|
|
@@ -110,7 +118,7 @@ export function createInitialRuntimeState(): RuntimeState {
|
|
|
110
118
|
model: createInitialModelState(),
|
|
111
119
|
conversation: createInitialConversationState(),
|
|
112
120
|
overlays: createInitialOverlaysState(),
|
|
113
|
-
panels: createInitialPanelsState(),
|
|
121
|
+
panels: createInitialPanelsState() as unknown as Record<string, unknown>,
|
|
114
122
|
permissions: createInitialPermissionsState(),
|
|
115
123
|
tasks: createInitialTasksState(),
|
|
116
124
|
agents: createInitialAgentsState(),
|
|
@@ -132,6 +140,6 @@ export function createInitialRuntimeState(): RuntimeState {
|
|
|
132
140
|
git: createInitialGitState(),
|
|
133
141
|
discovery: createInitialDiscoveryState(),
|
|
134
142
|
intelligence: createInitialIntelligenceState(),
|
|
135
|
-
|
|
143
|
+
surfacePerf: createInitialUiPerfState(),
|
|
136
144
|
};
|
|
137
145
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/ui-events';
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { UiReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-base';
|
|
3
|
-
|
|
4
|
-
export function combineSubscriptions(...teardowns: Array<() => void>): () => void {
|
|
5
|
-
return () => {
|
|
6
|
-
for (const teardown of teardowns) {
|
|
7
|
-
teardown();
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function createStoreBackedReadModel<TSnapshot>(
|
|
13
|
-
runtimeServices: RuntimeServices,
|
|
14
|
-
getSnapshot: () => TSnapshot,
|
|
15
|
-
): UiReadModel<TSnapshot> {
|
|
16
|
-
return {
|
|
17
|
-
getSnapshot,
|
|
18
|
-
subscribe(listener) {
|
|
19
|
-
return runtimeServices.runtimeStore.subscribe(listener);
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function listProviderIds(runtimeServices: RuntimeServices): readonly string[] {
|
|
25
|
-
const providerIds = new Set<string>(
|
|
26
|
-
runtimeServices.providerRegistry.listProviders().map((provider) => provider.name),
|
|
27
|
-
);
|
|
28
|
-
for (const model of runtimeServices.providerRegistry.listModels()) {
|
|
29
|
-
providerIds.add(model.provider);
|
|
30
|
-
}
|
|
31
|
-
return [...providerIds].sort();
|
|
32
|
-
}
|
|
1
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/ui-read-model-helpers';
|
|
@@ -1,81 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { UiReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-base';
|
|
3
|
-
import { createStoreBackedReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-model-helpers';
|
|
4
|
-
import type {
|
|
5
|
-
ContinuitySnapshot as IntegrationContinuitySnapshot,
|
|
6
|
-
SettingsSnapshot as IntegrationSettingsSnapshot,
|
|
7
|
-
WorktreeSnapshot as IntegrationWorktreeSnapshot,
|
|
8
|
-
} from '@pellux/goodvibes-sdk/platform/runtime/integration/helpers';
|
|
9
|
-
import type { SessionReturnContextSummary } from '@pellux/goodvibes-sdk/platform/runtime/session-return-context';
|
|
10
|
-
import type { ManagedWorktreeMeta } from '@pellux/goodvibes-sdk/platform/runtime/worktree/registry';
|
|
11
|
-
|
|
12
|
-
export interface UiSettingsSnapshot {
|
|
13
|
-
readonly available: boolean;
|
|
14
|
-
readonly conflictCount: number;
|
|
15
|
-
readonly recentFailureCount: number;
|
|
16
|
-
readonly managedLockCount: number;
|
|
17
|
-
readonly hasStagedManagedBundle: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface UiContinuitySnapshot {
|
|
21
|
-
readonly sessionId: string;
|
|
22
|
-
readonly status: string;
|
|
23
|
-
readonly recoveryState: string;
|
|
24
|
-
readonly lastSessionPointer: string | null;
|
|
25
|
-
readonly recoveryFilePresent: boolean;
|
|
26
|
-
readonly recoveryFile: Record<string, unknown> | null;
|
|
27
|
-
readonly returnContext?: SessionReturnContextSummary;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface UiWorktreeSnapshot {
|
|
31
|
-
readonly summary: {
|
|
32
|
-
readonly total: number;
|
|
33
|
-
readonly active: number;
|
|
34
|
-
readonly paused: number;
|
|
35
|
-
readonly cleanupPending: number;
|
|
36
|
-
readonly discard: number;
|
|
37
|
-
};
|
|
38
|
-
readonly records: readonly ManagedWorktreeMeta[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface UiMaintenanceObservabilityReadModels {
|
|
42
|
-
readonly settings: UiReadModel<UiSettingsSnapshot>;
|
|
43
|
-
readonly continuity: UiReadModel<UiContinuitySnapshot>;
|
|
44
|
-
readonly worktrees: UiReadModel<UiWorktreeSnapshot>;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function createMaintenanceObservabilityReadModels(runtimeServices: RuntimeServices): UiMaintenanceObservabilityReadModels {
|
|
48
|
-
return {
|
|
49
|
-
settings: {
|
|
50
|
-
getSnapshot() {
|
|
51
|
-
const snapshot = runtimeServices.integrationHelpers.getSettingsSnapshot() as IntegrationSettingsSnapshot;
|
|
52
|
-
return {
|
|
53
|
-
available: snapshot.available,
|
|
54
|
-
conflictCount: snapshot.available ? snapshot.conflicts.length : 0,
|
|
55
|
-
recentFailureCount: snapshot.available ? snapshot.recentFailures.length : 0,
|
|
56
|
-
managedLockCount: snapshot.available ? snapshot.managedLockCount : 0,
|
|
57
|
-
hasStagedManagedBundle: snapshot.available ? Boolean(snapshot.stagedManagedBundle) : false,
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
subscribe() {
|
|
61
|
-
return () => {};
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
continuity: createStoreBackedReadModel(runtimeServices, () => {
|
|
65
|
-
const snapshot = runtimeServices.integrationHelpers.getContinuitySnapshot() as IntegrationContinuitySnapshot;
|
|
66
|
-
return snapshot;
|
|
67
|
-
}),
|
|
68
|
-
worktrees: {
|
|
69
|
-
getSnapshot() {
|
|
70
|
-
const snapshot = runtimeServices.integrationHelpers.getWorktreeSnapshot() as IntegrationWorktreeSnapshot;
|
|
71
|
-
return {
|
|
72
|
-
summary: snapshot.summary,
|
|
73
|
-
records: snapshot.records,
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
subscribe() {
|
|
77
|
-
return () => {};
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
1
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-maintenance';
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface UiObservabilityReadModelOptions {
|
|
4
|
-
readonly forensicsRegistry?: ForensicsRegistry;
|
|
5
|
-
}
|
|
1
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-options';
|
|
@@ -1,73 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { UiReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-base';
|
|
3
|
-
import { createStoreBackedReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-model-helpers';
|
|
4
|
-
import type { RemoteSupervisorSnapshot } from '@pellux/goodvibes-sdk/platform/runtime/remote/supervisor';
|
|
5
|
-
import type { DistributedPendingWork, DistributedPeerRecord, DistributedRuntimePairRequest } from '@pellux/goodvibes-sdk/platform/runtime/remote/distributed-runtime-types';
|
|
6
|
-
|
|
7
|
-
export interface UiRemoteSnapshot {
|
|
8
|
-
readonly daemon: {
|
|
9
|
-
readonly transportState: string;
|
|
10
|
-
readonly isRunning: boolean;
|
|
11
|
-
readonly reconnectAttempts: number;
|
|
12
|
-
readonly runningJobCount: number;
|
|
13
|
-
readonly lastError?: string;
|
|
14
|
-
};
|
|
15
|
-
readonly acp: {
|
|
16
|
-
readonly transportState: string;
|
|
17
|
-
readonly totalMessages: number;
|
|
18
|
-
readonly activeConnections: readonly import('@pellux/goodvibes-sdk/platform/runtime/store/domains/acp').AcpConnection[];
|
|
19
|
-
};
|
|
20
|
-
readonly pools: ReturnType<RuntimeServices['remoteRunnerRegistry']['listPools']>;
|
|
21
|
-
readonly contracts: ReturnType<RuntimeServices['remoteRunnerRegistry']['listContracts']>;
|
|
22
|
-
readonly artifacts: ReturnType<RuntimeServices['remoteRunnerRegistry']['listArtifacts']>;
|
|
23
|
-
readonly supervisor: RemoteSupervisorSnapshot;
|
|
24
|
-
readonly distributed: {
|
|
25
|
-
readonly pairRequests: readonly DistributedRuntimePairRequest[];
|
|
26
|
-
readonly peers: readonly DistributedPeerRecord[];
|
|
27
|
-
readonly work: readonly DistributedPendingWork[];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface UiRemoteReadModels {
|
|
32
|
-
readonly remote: UiReadModel<UiRemoteSnapshot>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function createRemoteReadModels(runtimeServices: RuntimeServices): UiRemoteReadModels {
|
|
36
|
-
const { runtimeStore } = runtimeServices;
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
remote: createStoreBackedReadModel(runtimeServices, () => {
|
|
40
|
-
const state = runtimeStore.getState();
|
|
41
|
-
const distributedRaw = runtimeServices.distributedRuntime.getSnapshot() as {
|
|
42
|
-
pairRequests?: readonly DistributedRuntimePairRequest[];
|
|
43
|
-
peers?: readonly DistributedPeerRecord[];
|
|
44
|
-
work?: readonly DistributedPendingWork[];
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
daemon: {
|
|
48
|
-
transportState: state.daemon.transportState,
|
|
49
|
-
isRunning: state.daemon.isRunning,
|
|
50
|
-
reconnectAttempts: state.daemon.reconnectAttempts,
|
|
51
|
-
runningJobCount: state.daemon.runningJobCount,
|
|
52
|
-
lastError: state.daemon.lastError,
|
|
53
|
-
},
|
|
54
|
-
acp: {
|
|
55
|
-
transportState: state.acp.managerTransportState,
|
|
56
|
-
totalMessages: state.acp.totalMessages,
|
|
57
|
-
activeConnections: state.acp.activeConnectionIds
|
|
58
|
-
.map((id) => state.acp.connections.get(id))
|
|
59
|
-
.filter((connection): connection is import('@pellux/goodvibes-sdk/platform/runtime/store/domains/acp').AcpConnection => connection !== undefined),
|
|
60
|
-
},
|
|
61
|
-
pools: runtimeServices.remoteRunnerRegistry.listPools(),
|
|
62
|
-
contracts: runtimeServices.remoteRunnerRegistry.listContracts(),
|
|
63
|
-
artifacts: runtimeServices.remoteRunnerRegistry.listArtifacts(),
|
|
64
|
-
supervisor: runtimeServices.remoteSupervisor.getSnapshot(runtimeStore),
|
|
65
|
-
distributed: {
|
|
66
|
-
pairRequests: distributedRaw.pairRequests ?? [],
|
|
67
|
-
peers: distributedRaw.peers ?? [],
|
|
68
|
-
work: distributedRaw.work ?? [],
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
}),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
1
|
+
export * from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-remote';
|