@pellux/goodvibes-tui 0.18.13 → 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.
Files changed (65) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/README.md +1 -1
  3. package/docs/foundation-artifacts/operator-contract.json +1 -1
  4. package/package.json +3 -2
  5. package/src/daemon/cli.ts +82 -6
  6. package/src/input/command-registry.ts +2 -0
  7. package/src/input/commands/control-room-runtime.ts +1 -1
  8. package/src/input/commands/health-runtime.ts +1 -1
  9. package/src/input/commands/local-setup-review.ts +1 -1
  10. package/src/input/commands/platform-access-runtime.ts +1 -1
  11. package/src/input/commands/qrcode-runtime.ts +20 -0
  12. package/src/input/commands/subscription-runtime.ts +1 -1
  13. package/src/input/commands.ts +2 -0
  14. package/src/input/handler-feed.ts +6 -0
  15. package/src/input/handler-modal-routes.ts +19 -2
  16. package/src/input/handler-modal-token-routes.ts +3 -0
  17. package/src/input/handler-picker-routes.ts +4 -2
  18. package/src/input/model-picker.ts +11 -0
  19. package/src/input/settings-modal.ts +31 -3
  20. package/src/panels/agent-logs-panel.ts +23 -24
  21. package/src/panels/builtin/session.ts +66 -0
  22. package/src/panels/builtin/shared.ts +1 -1
  23. package/src/panels/provider-account-snapshot.ts +1 -1
  24. package/src/panels/provider-accounts-panel.ts +23 -27
  25. package/src/panels/qr-panel.ts +182 -0
  26. package/src/panels/scrollable-list-panel.ts +407 -0
  27. package/src/panels/services-panel.ts +1 -1
  28. package/src/panels/subscription-panel.ts +1 -1
  29. package/src/panels/worktree-panel.ts +20 -19
  30. package/src/renderer/qr-renderer.ts +117 -0
  31. package/src/renderer/settings-modal-helpers.ts +122 -0
  32. package/src/renderer/settings-modal.ts +147 -111
  33. package/src/runtime/bootstrap-command-context.ts +1 -1
  34. package/src/runtime/bootstrap-command-parts.ts +31 -15
  35. package/src/runtime/bootstrap.ts +6 -1
  36. package/src/runtime/diagnostics/panels/index.ts +5 -5
  37. package/src/runtime/services.ts +1 -1
  38. package/src/runtime/store/domains/domain-read-matrix.ts +0 -2
  39. package/src/runtime/ui-events.ts +1 -46
  40. package/src/runtime/ui-read-model-helpers.ts +1 -32
  41. package/src/runtime/ui-read-models-observability-maintenance.ts +1 -81
  42. package/src/runtime/ui-read-models-observability-options.ts +1 -5
  43. package/src/runtime/ui-read-models-observability-remote.ts +1 -73
  44. package/src/runtime/ui-read-models-observability-security.ts +1 -172
  45. package/src/runtime/ui-read-models-observability-system.ts +1 -217
  46. package/src/runtime/ui-read-models-observability.ts +1 -59
  47. package/src/runtime/ui-service-queries.ts +1 -114
  48. package/src/version.ts +1 -1
  49. package/src/config/service-registry.ts +0 -1
  50. package/src/config/subscription-providers.ts +0 -1
  51. package/src/runtime/diagnostics/actions.ts +0 -776
  52. package/src/runtime/diagnostics/index.ts +0 -99
  53. package/src/runtime/diagnostics/panels/agents.ts +0 -252
  54. package/src/runtime/diagnostics/panels/events.ts +0 -188
  55. package/src/runtime/diagnostics/panels/health.ts +0 -242
  56. package/src/runtime/diagnostics/panels/tasks.ts +0 -251
  57. package/src/runtime/diagnostics/panels/tool-calls.ts +0 -267
  58. package/src/runtime/diagnostics/provider.ts +0 -262
  59. package/src/runtime/store/domains/conversation.ts +0 -1
  60. package/src/runtime/store/domains/permissions.ts +0 -1
  61. package/src/runtime/store/helpers/reducers/conversation.ts +0 -1
  62. package/src/runtime/store/helpers/reducers/lifecycle.ts +0 -1
  63. package/src/runtime/store/helpers/reducers/shared.ts +0 -60
  64. package/src/runtime/store/helpers/reducers/sync.ts +0 -555
  65. package/src/runtime/store/helpers/reducers.ts +0 -30
@@ -1,81 +1 @@
1
- import type { RuntimeServices } from './services.ts';
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
- import type { ForensicsRegistry } from '@pellux/goodvibes-sdk/platform/runtime/forensics/index';
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
- import type { RuntimeServices } from './services.ts';
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';
@@ -1,172 +1 @@
1
- import { buildMcpAttackPathReview } from '@pellux/goodvibes-sdk/platform/runtime/mcp/index';
2
- import type { McpDecisionRecord, McpSecuritySnapshot } from '@pellux/goodvibes-sdk/platform/runtime/mcp/types';
3
- import type { RuntimeServices } from './services.ts';
4
- import type { UiReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-base';
5
- import { combineSubscriptions } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-model-helpers';
6
- import type { SecurityPanelSnapshot } from '@pellux/goodvibes-sdk/platform/runtime/diagnostics/panels/security';
7
- import type { PluginStatus } from '@pellux/goodvibes-sdk/platform/plugins/manager';
8
-
9
- export interface UiMcpServerSnapshot {
10
- readonly name: string;
11
- readonly role: string;
12
- readonly trustMode: string;
13
- readonly status: string;
14
- readonly schemaFreshness: string;
15
- readonly toolCount: number;
16
- readonly lastError?: string;
17
- readonly quarantineReason?: string;
18
- readonly quarantineDetail?: string;
19
- }
20
-
21
- export interface UiSecuritySnapshot {
22
- readonly audit: SecurityPanelSnapshot;
23
- readonly policy: {
24
- readonly preflightStatus: string;
25
- readonly preflightIssueCount: number;
26
- readonly lintFindingCount: number;
27
- };
28
- readonly deniedPermissions: number;
29
- readonly incidents: ReturnType<import('@pellux/goodvibes-sdk/platform/runtime/forensics/index').ForensicsRegistry['getAll']>;
30
- readonly latestIncident: ReturnType<import('@pellux/goodvibes-sdk/platform/runtime/forensics/index').ForensicsRegistry['latest']>;
31
- readonly mcpServers: readonly McpSecuritySnapshot[];
32
- readonly recentMcpDecisions: readonly McpDecisionRecord[];
33
- readonly attackPathReview: ReturnType<typeof buildMcpAttackPathReview>;
34
- readonly plugins: readonly PluginStatus[];
35
- readonly quarantinedPlugins: readonly PluginStatus[];
36
- readonly untrustedPlugins: readonly PluginStatus[];
37
- }
38
-
39
- export interface UiMcpSnapshot {
40
- readonly servers: readonly UiMcpServerSnapshot[];
41
- readonly connectedServerNames: readonly string[];
42
- readonly availableToolCount: number;
43
- readonly totalCalls: number;
44
- readonly totalErrors: number;
45
- readonly recentDecisions: readonly McpDecisionRecord[];
46
- }
47
-
48
- export interface UiLocalAuthSnapshot {
49
- readonly bootstrapCredentialPresent: boolean;
50
- readonly userCount: number;
51
- readonly sessionCount: number;
52
- }
53
-
54
- export interface UiSecurityObservabilityReadModels {
55
- readonly security: UiReadModel<UiSecuritySnapshot>;
56
- readonly mcp: UiReadModel<UiMcpSnapshot>;
57
- readonly localAuth: UiReadModel<UiLocalAuthSnapshot>;
58
- }
59
-
60
- export function createSecurityObservabilityReadModels(
61
- runtimeServices: RuntimeServices,
62
- options: import('./ui-read-models-observability-options.ts').UiObservabilityReadModelOptions = {},
63
- ): UiSecurityObservabilityReadModels {
64
- const { runtimeStore } = runtimeServices;
65
-
66
- return {
67
- security: {
68
- getSnapshot() {
69
- const audit = runtimeServices.tokenAuditor.auditAll(Date.now());
70
- const mcpServers = [...runtimeStore.getState().mcp.servers.values()].map((server): McpSecuritySnapshot => ({
71
- name: server.name,
72
- role: server.role,
73
- trustMode: server.trustMode,
74
- allowedPaths: server.allowedPaths,
75
- allowedHosts: server.allowedHosts,
76
- schemaFreshness: server.schemaFreshness,
77
- quarantineReason: server.quarantineReason,
78
- quarantineDetail: server.quarantineDetail,
79
- connected: server.status === 'connected' || server.status === 'degraded',
80
- }));
81
- const recentMcpDecisions = runtimeServices.mcpRegistry.listRecentSecurityDecisions(8);
82
- const attackPathReview = buildMcpAttackPathReview({
83
- servers: mcpServers,
84
- recentDecisions: recentMcpDecisions,
85
- });
86
- const plugins = runtimeServices.pluginManager.list();
87
- const policySnapshot = runtimeServices.policyRuntimeState.getSnapshot();
88
- const snapshot: SecurityPanelSnapshot = {
89
- managed: runtimeServices.tokenAuditor.isManaged,
90
- totalTokens: runtimeServices.tokenAuditor.tokenCount,
91
- results: audit.results,
92
- blocked: audit.blocked,
93
- scopeViolations: audit.scopeViolations,
94
- rotationWarnings: audit.rotationWarnings,
95
- rotationOverdue: audit.rotationOverdue,
96
- lastAuditAt: audit.capturedAt,
97
- capturedAt: new Date().toISOString(),
98
- };
99
- return {
100
- audit: snapshot,
101
- policy: {
102
- preflightStatus: policySnapshot.lastPreflightReview?.status ?? 'n/a',
103
- preflightIssueCount: policySnapshot.lastPreflightReview?.issueCount ?? 0,
104
- lintFindingCount: policySnapshot.lintFindings.length,
105
- },
106
- deniedPermissions: runtimeStore.getState().permissions.denialCount,
107
- incidents: options.forensicsRegistry?.getAll() ?? [],
108
- latestIncident: options.forensicsRegistry?.latest(),
109
- mcpServers,
110
- recentMcpDecisions,
111
- attackPathReview,
112
- plugins,
113
- quarantinedPlugins: plugins.filter((plugin) => plugin.quarantined),
114
- untrustedPlugins: plugins.filter((plugin) => plugin.trustTier === 'untrusted'),
115
- };
116
- },
117
- subscribe(listener) {
118
- const unsubs: Array<() => void> = [
119
- runtimeStore.subscribe(listener),
120
- runtimeServices.pluginManager.subscribe(listener),
121
- runtimeServices.policyRuntimeState.subscribe(listener),
122
- ];
123
- if (options.forensicsRegistry) {
124
- unsubs.push(options.forensicsRegistry.subscribe(listener));
125
- }
126
- return combineSubscriptions(...unsubs);
127
- },
128
- },
129
- mcp: {
130
- getSnapshot() {
131
- const state = runtimeStore.getState().mcp;
132
- const servers = [...state.servers.values()]
133
- .map((server): UiMcpServerSnapshot => ({
134
- name: server.name,
135
- role: server.role,
136
- trustMode: server.trustMode,
137
- status: server.status,
138
- schemaFreshness: server.schemaFreshness,
139
- toolCount: server.toolCount,
140
- lastError: server.lastError,
141
- quarantineReason: server.quarantineReason,
142
- quarantineDetail: server.quarantineDetail,
143
- }))
144
- .sort((a, b) => a.name.localeCompare(b.name));
145
- return {
146
- servers,
147
- connectedServerNames: state.connectedServerNames,
148
- availableToolCount: state.availableToolCount,
149
- totalCalls: state.totalCalls,
150
- totalErrors: state.totalErrors,
151
- recentDecisions: runtimeServices.mcpRegistry.listRecentSecurityDecisions(8),
152
- };
153
- },
154
- subscribe(listener) {
155
- return runtimeStore.subscribe(listener);
156
- },
157
- },
158
- localAuth: {
159
- getSnapshot() {
160
- const snapshot = runtimeServices.localUserAuthManager.inspect();
161
- return {
162
- bootstrapCredentialPresent: snapshot.bootstrapCredentialPresent,
163
- userCount: snapshot.userCount,
164
- sessionCount: snapshot.sessionCount,
165
- };
166
- },
167
- subscribe() {
168
- return () => {};
169
- },
170
- },
171
- };
172
- }
1
+ export * from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-security';
@@ -1,217 +1 @@
1
- import { buildEcosystemRecommendations, type EcosystemRecommendation } from '@pellux/goodvibes-sdk/platform/runtime/ecosystem/recommendations';
2
- import type { RuntimeServices } from './services.ts';
3
- import type { UiReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-base';
4
- import { combineSubscriptions, createStoreBackedReadModel } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-model-helpers';
5
- import type {
6
- ContinuitySnapshot as IntegrationContinuitySnapshot,
7
- SettingsSnapshot as IntegrationSettingsSnapshot,
8
- WorktreeSnapshot as IntegrationWorktreeSnapshot,
9
- } from '@pellux/goodvibes-sdk/platform/runtime/integration/helpers';
10
- import type { SessionReturnContextSummary } from '@pellux/goodvibes-sdk/platform/runtime/session-return-context';
11
- import type { ManagedWorktreeMeta } from '@pellux/goodvibes-sdk/platform/runtime/worktree/registry';
12
- import type { PluginStatus } from '@pellux/goodvibes-sdk/platform/plugins/manager';
13
-
14
- export interface UiIntelligenceSnapshot {
15
- readonly diagnosticsStatus: string;
16
- readonly symbolSearchStatus: string;
17
- readonly completionsStatus: string;
18
- readonly hoverStatus: string;
19
- readonly errorCount: number;
20
- readonly warningCount: number;
21
- readonly totalRequests: number;
22
- readonly avgLatencyMs: number;
23
- readonly hover: {
24
- readonly active: boolean;
25
- readonly filePath?: string;
26
- };
27
- readonly diagnostics: ReadonlyMap<string, readonly import('@pellux/goodvibes-sdk/platform/runtime/store/domains/intelligence').LspDiagnostic[]>;
28
- }
29
-
30
- export interface UiMarketplaceSnapshot {
31
- readonly startupIssues: readonly string[];
32
- readonly recommendations: readonly EcosystemRecommendation[];
33
- }
34
-
35
- export interface UiCockpitSnapshot {
36
- readonly runningTasks: number;
37
- readonly blockedTasks: number;
38
- readonly failedTasks: number;
39
- readonly activeGraphs: number;
40
- readonly guardTrips: number;
41
- readonly blockedMessages: number;
42
- readonly pendingPermissions: number;
43
- readonly deniedPermissions: number;
44
- readonly preflightStatus: string;
45
- readonly preflightIssueCount: number;
46
- readonly lintFindingCount: number;
47
- readonly tokenBlockedCount: number;
48
- readonly tokenRotationOverdueCount: number;
49
- readonly tokenScopeViolationCount: number;
50
- readonly tokenRotationWarningCount: number;
51
- readonly incidentCount: number;
52
- readonly latestIncident: ReturnType<import('@pellux/goodvibes-sdk/platform/runtime/forensics/index').ForensicsRegistry['latest']>;
53
- readonly elevatedMcp: number;
54
- readonly unhealthyMcp: number;
55
- readonly erroredPlugins: number;
56
- readonly failingIntegrations: number;
57
- readonly taskCount: number;
58
- readonly agentCount: number;
59
- readonly totalGraphs: number;
60
- readonly communicationCount: number;
61
- readonly mcpServerCount: number;
62
- readonly pluginCount: number;
63
- }
64
-
65
- export interface UiHealthSnapshot {
66
- readonly degradedDomains: readonly string[];
67
- readonly providerProblems: readonly string[];
68
- readonly degradedMcpServers: readonly string[];
69
- readonly quarantinedMcpServers: readonly string[];
70
- readonly integrationProblems: readonly string[];
71
- readonly daemonTransportState: string;
72
- readonly acpTransportState: string;
73
- readonly recoveryState: string;
74
- }
75
-
76
- export interface UiSystemObservabilityReadModels {
77
- readonly intelligence: UiReadModel<UiIntelligenceSnapshot>;
78
- readonly marketplace: UiReadModel<UiMarketplaceSnapshot>;
79
- readonly cockpit: UiReadModel<UiCockpitSnapshot>;
80
- readonly health: UiReadModel<UiHealthSnapshot>;
81
- }
82
-
83
- export function createSystemObservabilityReadModels(
84
- runtimeServices: RuntimeServices,
85
- options: import('./ui-read-models-observability-options.ts').UiObservabilityReadModelOptions = {},
86
- ): UiSystemObservabilityReadModels {
87
- const { runtimeStore } = runtimeServices;
88
-
89
- return {
90
- intelligence: createStoreBackedReadModel(runtimeServices, () => {
91
- const state = runtimeStore.getState().intelligence;
92
- return {
93
- diagnosticsStatus: state.diagnosticsStatus,
94
- symbolSearchStatus: state.symbolSearchStatus,
95
- completionsStatus: state.completionsStatus,
96
- hoverStatus: state.hoverStatus,
97
- errorCount: state.errorCount,
98
- warningCount: state.warningCount,
99
- totalRequests: state.totalRequests,
100
- avgLatencyMs: state.avgLatencyMs,
101
- hover: {
102
- active: state.hover.active,
103
- filePath: state.hover.filePath,
104
- },
105
- diagnostics: state.diagnostics,
106
- };
107
- }),
108
- marketplace: createStoreBackedReadModel(runtimeServices, () => {
109
- const state = runtimeStore.getState();
110
- const startupIssues: string[] = [];
111
- if (state.permissions.denialCount >= 3) {
112
- startupIssues.push(`${state.permissions.denialCount} permission denials suggest a policy-pack or trust posture review.`);
113
- }
114
- const authRequiredServers = [...state.mcp.servers.values()].filter((server) => server.status === 'auth_required');
115
- if (authRequiredServers.length > 0) {
116
- startupIssues.push(`${authRequiredServers.length} MCP server${authRequiredServers.length === 1 ? '' : 's'} need auth or reconnect repair.`);
117
- }
118
- const staleSchemas = [...state.mcp.servers.values()].filter((server) => server.schemaFreshness !== 'fresh');
119
- if (staleSchemas.length > 0) {
120
- startupIssues.push(`${staleSchemas.length} MCP server schema${staleSchemas.length === 1 ? ' is' : 's are'} stale or quarantined.`);
121
- }
122
- return {
123
- startupIssues,
124
- recommendations: buildEcosystemRecommendations(runtimeStore, {
125
- cwd: runtimeServices.shellPaths.workingDirectory,
126
- homeDir: runtimeServices.shellPaths.homeDirectory,
127
- }),
128
- };
129
- }),
130
- cockpit: {
131
- getSnapshot() {
132
- const state = runtimeStore.getState();
133
- const runningTasks = [...state.tasks.tasks.values()].filter((task) => task.status === 'running').length;
134
- const blockedTasks = [...state.tasks.tasks.values()].filter((task) => task.status === 'blocked').length;
135
- const failedTasks = [...state.tasks.tasks.values()].filter((task) => task.status === 'failed').length;
136
- const audit = runtimeServices.tokenAuditor.auditAll();
137
- const incidents = options.forensicsRegistry?.getAll() ?? [];
138
- const plugins = runtimeServices.pluginManager.list();
139
- const failingIntegrations = [...state.integrations.integrations.values()].filter((record) => record.status === 'error').length;
140
- const elevatedMcp = [...state.mcp.servers.values()].filter((server) => server.trustMode === 'allow-all').length;
141
- const unhealthyMcp = [...state.mcp.servers.values()].filter((server) => (
142
- server.status === 'degraded'
143
- || server.status === 'auth_required'
144
- || server.status === 'reconnecting'
145
- || server.status === 'disconnected'
146
- )).length;
147
- const preflight = runtimeServices.policyRuntimeState.getSnapshot().lastPreflightReview;
148
- const lintFindingCount = runtimeServices.policyRuntimeState.getSnapshot().lintFindings.length;
149
- return {
150
- runningTasks,
151
- blockedTasks,
152
- failedTasks,
153
- activeGraphs: state.orchestration.activeGraphIds.length,
154
- guardTrips: state.orchestration.recursionGuardTrips,
155
- blockedMessages: state.communication.totalBlocked,
156
- pendingPermissions: state.permissions.awaitingDecision ? 1 : 0,
157
- deniedPermissions: state.permissions.denialCount,
158
- preflightStatus: preflight?.status ?? 'n/a',
159
- preflightIssueCount: preflight?.issueCount ?? 0,
160
- lintFindingCount,
161
- tokenBlockedCount: audit.blocked.length,
162
- tokenRotationOverdueCount: audit.rotationOverdue.length,
163
- tokenScopeViolationCount: audit.scopeViolations.length,
164
- tokenRotationWarningCount: audit.rotationWarnings.length,
165
- incidentCount: incidents.length,
166
- latestIncident: options.forensicsRegistry?.latest(),
167
- elevatedMcp,
168
- unhealthyMcp,
169
- erroredPlugins: plugins.filter((plugin) => plugin.quarantined || !plugin.active).length,
170
- failingIntegrations,
171
- taskCount: state.tasks.tasks.size,
172
- agentCount: state.agents.agents.size,
173
- totalGraphs: state.orchestration.totalGraphs,
174
- communicationCount: state.communication.records.size,
175
- mcpServerCount: state.mcp.servers.size,
176
- pluginCount: plugins.length,
177
- };
178
- },
179
- subscribe(listener) {
180
- const unsubs: Array<() => void> = [runtimeStore.subscribe(listener)];
181
- if (options.forensicsRegistry) {
182
- unsubs.push(options.forensicsRegistry.subscribe(listener));
183
- }
184
- return combineSubscriptions(...unsubs);
185
- },
186
- },
187
- health: createStoreBackedReadModel(runtimeServices, () => {
188
- const state = runtimeStore.getState();
189
- const providerProblems = [...state.providerHealth.providers.values()]
190
- .filter((provider) => provider.status !== 'healthy' && provider.status !== 'unknown')
191
- .map((provider) => provider.providerId);
192
- const degradedMcpServers = [...state.mcp.servers.values()]
193
- .filter((server) => server.status === 'degraded' || server.status === 'auth_required' || server.schemaFreshness === 'quarantined')
194
- .map((server) => server.name);
195
- const quarantinedMcpServers = [...state.mcp.servers.values()]
196
- .filter((server) => server.schemaFreshness === 'quarantined')
197
- .map((server) => server.name);
198
- const degradedDomains: string[] = [];
199
- if (providerProblems.length > 0) degradedDomains.push('providerHealth');
200
- if (degradedMcpServers.length > 0) degradedDomains.push('mcp');
201
- if (state.integrations.problemIds.length > 0) degradedDomains.push('integrations');
202
- if (state.daemon.transportState === 'degraded' || state.daemon.transportState === 'terminal_failure') degradedDomains.push('daemon');
203
- if (state.acp.managerTransportState === 'degraded' || state.acp.managerTransportState === 'terminal_failure') degradedDomains.push('acp');
204
- if (state.session.recoveryState === 'failed') degradedDomains.push('session');
205
- return {
206
- degradedDomains,
207
- providerProblems,
208
- degradedMcpServers,
209
- quarantinedMcpServers,
210
- integrationProblems: state.integrations.problemIds,
211
- daemonTransportState: state.daemon.transportState,
212
- acpTransportState: state.acp.managerTransportState,
213
- recoveryState: state.session.recoveryState,
214
- };
215
- }),
216
- };
217
- }
1
+ export * from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-system';
@@ -1,59 +1 @@
1
- export type { UiObservabilityReadModelOptions } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-options';
2
- export type {
3
- UiRemoteSnapshot,
4
- UiRemoteReadModels,
5
- } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-remote';
6
- export type {
7
- UiIntelligenceSnapshot,
8
- UiMarketplaceSnapshot,
9
- UiCockpitSnapshot,
10
- UiHealthSnapshot,
11
- UiSystemObservabilityReadModels,
12
- } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-system';
13
- export type {
14
- UiSecuritySnapshot,
15
- UiMcpServerSnapshot,
16
- UiMcpSnapshot,
17
- UiLocalAuthSnapshot,
18
- UiSecurityObservabilityReadModels,
19
- } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-security';
20
- export type {
21
- UiSettingsSnapshot,
22
- UiContinuitySnapshot,
23
- UiWorktreeSnapshot,
24
- UiMaintenanceObservabilityReadModels,
25
- } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-maintenance';
26
-
27
- import type { RuntimeServices } from './services.ts';
28
- import { createRemoteReadModels, type UiRemoteReadModels } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-remote';
29
- import {
30
- createSystemObservabilityReadModels,
31
- type UiSystemObservabilityReadModels,
32
- } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-system';
33
- import {
34
- createSecurityObservabilityReadModels,
35
- type UiSecurityObservabilityReadModels,
36
- } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-security';
37
- import {
38
- createMaintenanceObservabilityReadModels,
39
- type UiMaintenanceObservabilityReadModels,
40
- } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-maintenance';
41
- import type { UiObservabilityReadModelOptions } from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability-options';
42
-
43
- export interface UiObservabilityReadModels
44
- extends UiRemoteReadModels,
45
- UiSystemObservabilityReadModels,
46
- UiSecurityObservabilityReadModels,
47
- UiMaintenanceObservabilityReadModels {}
48
-
49
- export function createObservabilityReadModels(
50
- runtimeServices: RuntimeServices,
51
- options: UiObservabilityReadModelOptions = {},
52
- ): UiObservabilityReadModels {
53
- return {
54
- ...createRemoteReadModels(runtimeServices),
55
- ...createSystemObservabilityReadModels(runtimeServices, options),
56
- ...createSecurityObservabilityReadModels(runtimeServices, options),
57
- ...createMaintenanceObservabilityReadModels(runtimeServices),
58
- };
59
- }
1
+ export * from '@pellux/goodvibes-sdk/platform/runtime/ui-read-models-observability';