4runr-os 1.3.36 → 1.3.38
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/dist/ui/v3/collectors/assets.collector.d.ts +20 -0
- package/dist/ui/v3/collectors/assets.collector.d.ts.map +1 -0
- package/dist/ui/v3/collectors/assets.collector.js +80 -0
- package/dist/ui/v3/collectors/assets.collector.js.map +1 -0
- package/dist/ui/v3/collectors/capabilities.collector.d.ts +18 -0
- package/dist/ui/v3/collectors/capabilities.collector.d.ts.map +1 -0
- package/dist/ui/v3/collectors/capabilities.collector.js +113 -0
- package/dist/ui/v3/collectors/capabilities.collector.js.map +1 -0
- package/dist/ui/v3/collectors/network.collector.d.ts +18 -0
- package/dist/ui/v3/collectors/network.collector.d.ts.map +1 -0
- package/dist/ui/v3/collectors/network.collector.js +37 -0
- package/dist/ui/v3/collectors/network.collector.js.map +1 -0
- package/dist/ui/v3/collectors/posture.derive.d.ts +24 -0
- package/dist/ui/v3/collectors/posture.derive.d.ts.map +1 -0
- package/dist/ui/v3/collectors/posture.derive.js +57 -0
- package/dist/ui/v3/collectors/posture.derive.js.map +1 -0
- package/dist/ui/v3/state/panelStore.d.ts +80 -0
- package/dist/ui/v3/state/panelStore.d.ts.map +1 -0
- package/dist/ui/v3/state/panelStore.js +124 -0
- package/dist/ui/v3/state/panelStore.js.map +1 -0
- package/dist/ui/v3/state/uiStateBuilder.d.ts +7 -0
- package/dist/ui/v3/state/uiStateBuilder.d.ts.map +1 -1
- package/dist/ui/v3/state/uiStateBuilder.js +28 -51
- package/dist/ui/v3/state/uiStateBuilder.js.map +1 -1
- package/dist/ui/v3/ui/panels/CapabilitiesPanel.d.ts +3 -1
- package/dist/ui/v3/ui/panels/CapabilitiesPanel.d.ts.map +1 -1
- package/dist/ui/v3/ui/panels/CapabilitiesPanel.js +5 -7
- package/dist/ui/v3/ui/panels/CapabilitiesPanel.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Assets Collector
|
|
3
|
+
*
|
|
4
|
+
* Collects agent registry summary from V1 or Gateway API.
|
|
5
|
+
* Returns agent counts and run state summary.
|
|
6
|
+
*
|
|
7
|
+
* Data source priority:
|
|
8
|
+
* 1. Gateway API /api/runs (if connected) - get active/failed/completed counts
|
|
9
|
+
* 2. Local agent registry (V1) - get agent count
|
|
10
|
+
* 3. Fallback to unavailable if neither available
|
|
11
|
+
*/
|
|
12
|
+
import type { Value } from '../state/value.js';
|
|
13
|
+
import type { AssetsState } from '../state/uiStateTypes.js';
|
|
14
|
+
/**
|
|
15
|
+
* Collect assets (agents + runs summary)
|
|
16
|
+
*
|
|
17
|
+
* Returns Value<AssetsState> with agent and run counts
|
|
18
|
+
*/
|
|
19
|
+
export declare function collectAssets(): Promise<Value<AssetsState>>;
|
|
20
|
+
//# sourceMappingURL=assets.collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.collector.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/assets.collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAQ5D;;;;GAIG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAsEjE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Assets Collector
|
|
3
|
+
*
|
|
4
|
+
* Collects agent registry summary from V1 or Gateway API.
|
|
5
|
+
* Returns agent counts and run state summary.
|
|
6
|
+
*
|
|
7
|
+
* Data source priority:
|
|
8
|
+
* 1. Gateway API /api/runs (if connected) - get active/failed/completed counts
|
|
9
|
+
* 2. Local agent registry (V1) - get agent count
|
|
10
|
+
* 3. Fallback to unavailable if neither available
|
|
11
|
+
*/
|
|
12
|
+
import { available, unavailable } from '../state/value.js';
|
|
13
|
+
import { listAgents } from '../v1Adapters/agents.js';
|
|
14
|
+
import { gatewayConnectionStore } from '../state/gatewayConnectionStore.js';
|
|
15
|
+
import { GatewayClient } from '../../../gateway-client.js';
|
|
16
|
+
const COLLECTOR_TIMEOUT = 5000; // ms
|
|
17
|
+
/**
|
|
18
|
+
* Collect assets (agents + runs summary)
|
|
19
|
+
*
|
|
20
|
+
* Returns Value<AssetsState> with agent and run counts
|
|
21
|
+
*/
|
|
22
|
+
export async function collectAssets() {
|
|
23
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
resolve(unavailable('Assets collection timeout', 'Check gateway connection or system load'));
|
|
26
|
+
}, COLLECTOR_TIMEOUT);
|
|
27
|
+
});
|
|
28
|
+
const collectionPromise = (async () => {
|
|
29
|
+
try {
|
|
30
|
+
// Get local agent count (always available)
|
|
31
|
+
const agentsResult = listAgents();
|
|
32
|
+
const agentCount = agentsResult.ok ? agentsResult.data.length : 0;
|
|
33
|
+
// Get connection state
|
|
34
|
+
const connState = gatewayConnectionStore.getState();
|
|
35
|
+
// If connected, try to get run counts from gateway
|
|
36
|
+
if (connState.status === 'connected' && connState.resolvedTo) {
|
|
37
|
+
try {
|
|
38
|
+
const client = new GatewayClient({ gatewayUrl: connState.resolvedTo });
|
|
39
|
+
const runs = await client.runs.list({ limit: 100 });
|
|
40
|
+
// Calculate run state counts
|
|
41
|
+
const activeCount = runs.filter(r => r.status === 'running' || r.status === 'queued').length;
|
|
42
|
+
const completedCount = runs.filter(r => r.status === 'completed').length;
|
|
43
|
+
const errorCount = runs.filter(r => r.status === 'failed' || r.status === 'cancelled').length;
|
|
44
|
+
const totalRuns = runs.length;
|
|
45
|
+
// Assets state: combine agents and runs
|
|
46
|
+
const data = {
|
|
47
|
+
total: agentCount + totalRuns, // Total assets (agents + runs)
|
|
48
|
+
active: activeCount, // Active runs
|
|
49
|
+
idle: completedCount, // Completed runs
|
|
50
|
+
error: errorCount, // Failed/cancelled runs
|
|
51
|
+
};
|
|
52
|
+
return available(data);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
// Gateway API failed - fall back to agent count only
|
|
56
|
+
const data = {
|
|
57
|
+
total: agentCount,
|
|
58
|
+
active: 0,
|
|
59
|
+
idle: 0,
|
|
60
|
+
error: 0,
|
|
61
|
+
};
|
|
62
|
+
return available(data);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Not connected - use agent count only
|
|
66
|
+
const data = {
|
|
67
|
+
total: agentCount,
|
|
68
|
+
active: 0,
|
|
69
|
+
idle: 0,
|
|
70
|
+
error: 0,
|
|
71
|
+
};
|
|
72
|
+
return available(data);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
return unavailable(`Failed to collect assets: ${error.message || 'Unknown error'}`, 'Check agent registry and gateway connection');
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
return Promise.race([collectionPromise, timeoutPromise]);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=assets.collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.collector.js","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/assets.collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAW,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,KAAK;AAErC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAqB,CAAC,OAAO,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
|
|
5
|
+
* Shows real capabilities: persistence, auth mode, rate limit config.
|
|
6
|
+
*
|
|
7
|
+
* Truth: Only shows what the server actually returns.
|
|
8
|
+
* If a field is missing, show UNKNOWN, don't guess.
|
|
9
|
+
*/
|
|
10
|
+
import type { Value } from '../state/value.js';
|
|
11
|
+
import type { CapabilitiesState } from '../state/uiStateTypes.js';
|
|
12
|
+
/**
|
|
13
|
+
* Collect capabilities from Gateway health endpoint
|
|
14
|
+
*
|
|
15
|
+
* Returns Value<CapabilitiesState> with capabilities list
|
|
16
|
+
*/
|
|
17
|
+
export declare function collectCapabilities(): Promise<Value<CapabilitiesState>>;
|
|
18
|
+
//# sourceMappingURL=capabilities.collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.collector.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/capabilities.collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAOlE;;;;GAIG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAgH7E"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Capabilities Collector
|
|
3
|
+
*
|
|
4
|
+
* Collects capabilities from Gateway health endpoint.
|
|
5
|
+
* Shows real capabilities: persistence, auth mode, rate limit config.
|
|
6
|
+
*
|
|
7
|
+
* Truth: Only shows what the server actually returns.
|
|
8
|
+
* If a field is missing, show UNKNOWN, don't guess.
|
|
9
|
+
*/
|
|
10
|
+
import { available, unavailable } from '../state/value.js';
|
|
11
|
+
import { gatewayConnectionStore } from '../state/gatewayConnectionStore.js';
|
|
12
|
+
import { GatewayClient } from '../../../gateway-client.js';
|
|
13
|
+
const COLLECTOR_TIMEOUT = 5000; // ms
|
|
14
|
+
/**
|
|
15
|
+
* Collect capabilities from Gateway health endpoint
|
|
16
|
+
*
|
|
17
|
+
* Returns Value<CapabilitiesState> with capabilities list
|
|
18
|
+
*/
|
|
19
|
+
export async function collectCapabilities() {
|
|
20
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
resolve(unavailable('Capabilities collection timeout', 'Check gateway connection'));
|
|
23
|
+
}, COLLECTOR_TIMEOUT);
|
|
24
|
+
});
|
|
25
|
+
const collectionPromise = (async () => {
|
|
26
|
+
try {
|
|
27
|
+
// Get connection state
|
|
28
|
+
const connState = gatewayConnectionStore.getState();
|
|
29
|
+
if (connState.status !== 'connected' || !connState.resolvedTo) {
|
|
30
|
+
return unavailable('Not connected to Gateway', 'Run "connect" first');
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const client = new GatewayClient({ gatewayUrl: connState.resolvedTo });
|
|
34
|
+
const health = await client.health();
|
|
35
|
+
// Build capabilities list from health response
|
|
36
|
+
// Truth: Only show what the server actually returns
|
|
37
|
+
const items = [];
|
|
38
|
+
// Persistence (from health.persistence field)
|
|
39
|
+
if (health.persistence !== undefined) {
|
|
40
|
+
items.push(`Persistence: ${health.persistence}`);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
items.push('Persistence: UNKNOWN');
|
|
44
|
+
}
|
|
45
|
+
// Auth (check if health has auth field - may not exist)
|
|
46
|
+
if ('auth' in health && health.auth !== undefined) {
|
|
47
|
+
const auth = health.auth;
|
|
48
|
+
if (typeof auth === 'object') {
|
|
49
|
+
items.push(`Auth: ${auth.enabled ? 'enabled' : 'disabled'}`);
|
|
50
|
+
if (auth.enabled && auth.mode) {
|
|
51
|
+
items.push(`Auth Mode: ${auth.mode}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
items.push(`Auth: ${auth}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
items.push('Auth: UNKNOWN');
|
|
60
|
+
}
|
|
61
|
+
// Rate limit (check if health has rateLimit field - may not exist)
|
|
62
|
+
// Gateway returns: { enabled: boolean, max: number, window_ms: number }
|
|
63
|
+
if ('rateLimit' in health && health.rateLimit !== undefined) {
|
|
64
|
+
const rateLimit = health.rateLimit;
|
|
65
|
+
if (typeof rateLimit === 'object') {
|
|
66
|
+
items.push(`Rate Limit: ${rateLimit.enabled ? 'enabled' : 'disabled'}`);
|
|
67
|
+
if (rateLimit.enabled) {
|
|
68
|
+
if (rateLimit.max !== undefined) {
|
|
69
|
+
items.push(`Rate Limit Max: ${rateLimit.max}`);
|
|
70
|
+
}
|
|
71
|
+
// Gateway returns window_ms (milliseconds), convert to seconds for display
|
|
72
|
+
if (rateLimit.window_ms !== undefined) {
|
|
73
|
+
const windowSeconds = Math.round(rateLimit.window_ms / 1000);
|
|
74
|
+
items.push(`Rate Limit Window: ${windowSeconds}s`);
|
|
75
|
+
}
|
|
76
|
+
else if (rateLimit.window !== undefined) {
|
|
77
|
+
// Fallback: if window is in seconds already
|
|
78
|
+
items.push(`Rate Limit Window: ${rateLimit.window}s`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
items.push(`Rate Limit: ${rateLimit}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
items.push('Rate Limit: UNKNOWN');
|
|
88
|
+
}
|
|
89
|
+
// Status (if present)
|
|
90
|
+
if (health.status) {
|
|
91
|
+
items.push(`Status: ${health.status}`);
|
|
92
|
+
}
|
|
93
|
+
const data = {
|
|
94
|
+
items: items.length > 0 ? items : ['No capabilities available'],
|
|
95
|
+
};
|
|
96
|
+
return available(data);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
const httpStatus = error.response?.status;
|
|
100
|
+
if (httpStatus === 404) {
|
|
101
|
+
// Endpoint not implemented - that's OK, show unavailable
|
|
102
|
+
return unavailable('Capabilities endpoint not implemented', 'Gateway may not expose capabilities endpoint');
|
|
103
|
+
}
|
|
104
|
+
return unavailable(`Failed to fetch capabilities: ${error.message || 'Unknown error'}`, 'Check gateway connection');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return unavailable(`Failed to collect capabilities: ${error.message || 'Unknown error'}`, 'Check gateway connection');
|
|
109
|
+
}
|
|
110
|
+
})();
|
|
111
|
+
return Promise.race([collectionPromise, timeoutPromise]);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=capabilities.collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.collector.js","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/capabilities.collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAW,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,iBAAiB,GAAG,IAAI,CAAC,CAAC,KAAK;AAErC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,MAAM,cAAc,GAAG,IAAI,OAAO,CAA2B,CAAC,OAAO,EAAE,EAAE;QACvE,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,WAAW,CACjB,iCAAiC,EACjC,0BAA0B,CAC3B,CAAC,CAAC;QACL,CAAC,EAAE,iBAAiB,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,CAAC,KAAK,IAAuC,EAAE;QACvE,IAAI,CAAC;YACH,uBAAuB;YACvB,MAAM,SAAS,GAAG,sBAAsB,CAAC,QAAQ,EAAE,CAAC;YAEpD,IAAI,SAAS,CAAC,MAAM,KAAK,WAAW,IAAI,CAAC,SAAS,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AAM,CAAC,MAAM,EAAE,CAAC,CAAC;gBACzC,CAAC;gBAED,MAAM,IAAI,GAAsB;oBAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC;iBAChE,CAAC;gBAEF,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAC1C,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;oBACvB,yDAAyD;oBACzD,OAAO,WAAW,CAChB,uCAAuC,EACvC,8CAA8C,CAC/C,CAAC;gBACJ,CAAC;gBAED,OAAO,WAAW,CAChB,iCAAiC,KAAK,CAAC,OAAO,IAAI,eAAe,EAAE,EACnE,0BAA0B,CAC3B,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,WAAW,CAChB,mCAAmC,KAAK,CAAC,OAAO,IAAI,eAAe,EAAE,EACrE,0BAA0B,CAC3B,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Network Collector
|
|
3
|
+
*
|
|
4
|
+
* Collects network state from gatewayConnectionStore.
|
|
5
|
+
* Shows target, effective URL, latency, connection status.
|
|
6
|
+
*
|
|
7
|
+
* This is mostly a pass-through from the connection store,
|
|
8
|
+
* but formats it for the panel display.
|
|
9
|
+
*/
|
|
10
|
+
import type { Value } from '../state/value.js';
|
|
11
|
+
import type { NetworkState } from '../state/uiStateTypes.js';
|
|
12
|
+
/**
|
|
13
|
+
* Collect network state from connection store
|
|
14
|
+
*
|
|
15
|
+
* Returns Value<NetworkState> based on connection store state
|
|
16
|
+
*/
|
|
17
|
+
export declare function collectNetwork(): Promise<Value<NetworkState>>;
|
|
18
|
+
//# sourceMappingURL=network.collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.collector.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/network.collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D;;;;GAIG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CA6BnE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Network Collector
|
|
3
|
+
*
|
|
4
|
+
* Collects network state from gatewayConnectionStore.
|
|
5
|
+
* Shows target, effective URL, latency, connection status.
|
|
6
|
+
*
|
|
7
|
+
* This is mostly a pass-through from the connection store,
|
|
8
|
+
* but formats it for the panel display.
|
|
9
|
+
*/
|
|
10
|
+
import { available, unavailable, loading } from '../state/value.js';
|
|
11
|
+
import { gatewayConnectionStore } from '../state/gatewayConnectionStore.js';
|
|
12
|
+
/**
|
|
13
|
+
* Collect network state from connection store
|
|
14
|
+
*
|
|
15
|
+
* Returns Value<NetworkState> based on connection store state
|
|
16
|
+
*/
|
|
17
|
+
export async function collectNetwork() {
|
|
18
|
+
const connState = gatewayConnectionStore.getState();
|
|
19
|
+
if (connState.status === 'connected') {
|
|
20
|
+
const data = {
|
|
21
|
+
gateway: 'CONNECTED',
|
|
22
|
+
endpoint: connState.resolvedTo,
|
|
23
|
+
status: connState.health?.status || 'alive',
|
|
24
|
+
latency: connState.latencyMs,
|
|
25
|
+
};
|
|
26
|
+
return available(data);
|
|
27
|
+
}
|
|
28
|
+
if (connState.status === 'connecting') {
|
|
29
|
+
return loading('Connecting to Gateway...');
|
|
30
|
+
}
|
|
31
|
+
if (connState.status === 'error') {
|
|
32
|
+
return unavailable(connState.message || 'Connection failed', connState.next || 'Run "connect" to retry');
|
|
33
|
+
}
|
|
34
|
+
// disconnected
|
|
35
|
+
return unavailable(connState.reason || 'Not connected', connState.next || 'Run "connect" to connect to Gateway');
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=network.collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.collector.js","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/network.collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAG5E;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,SAAS,GAAG,sBAAsB,CAAC,QAAQ,EAAE,CAAC;IAEpD,IAAI,SAAS,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACrC,MAAM,IAAI,GAAiB;YACzB,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,SAAS,CAAC,UAAU;YAC9B,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,IAAI,OAAO;YAC3C,OAAO,EAAE,SAAS,CAAC,SAAS;SAC7B,CAAC;QACF,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;QACtC,OAAO,OAAO,CAAe,0BAA0B,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,WAAW,CAChB,SAAS,CAAC,OAAO,IAAI,mBAAmB,EACxC,SAAS,CAAC,IAAI,IAAI,wBAAwB,CAC3C,CAAC;IACJ,CAAC;IAED,eAAe;IACf,OAAO,WAAW,CAChB,SAAS,CAAC,MAAM,IAAI,eAAe,EACnC,SAAS,CAAC,IAAI,IAAI,qCAAqC,CACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Posture Deriver
|
|
3
|
+
*
|
|
4
|
+
* Derives posture state from other panel states.
|
|
5
|
+
* Not a collector - it's computed from:
|
|
6
|
+
* - Network state (must be connected)
|
|
7
|
+
* - Capabilities state (must be available)
|
|
8
|
+
* - Gateway health (must be alive)
|
|
9
|
+
*
|
|
10
|
+
* Derivation rules:
|
|
11
|
+
* - If Network not connected → UNAVAILABLE ("Not connected")
|
|
12
|
+
* - Else if Capabilities.persistence is missing/unknown → UNAVAILABLE ("Capabilities unknown")
|
|
13
|
+
* - Else if Gateway health not alive → UNAVAILABLE ("Gateway unhealthy")
|
|
14
|
+
* - Else → AVAILABLE ("MODE: RUNNING" or "MODE: HUB")
|
|
15
|
+
*/
|
|
16
|
+
import type { Value } from '../state/value.js';
|
|
17
|
+
import type { PostureState } from '../state/uiStateTypes.js';
|
|
18
|
+
/**
|
|
19
|
+
* Derive posture state from other panel states
|
|
20
|
+
*
|
|
21
|
+
* Returns Value<PostureState> based on network, capabilities, and health
|
|
22
|
+
*/
|
|
23
|
+
export declare function derivePosture(): Promise<Value<PostureState>>;
|
|
24
|
+
//# sourceMappingURL=posture.derive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posture.derive.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/posture.derive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAM7D;;;;GAIG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAoDlE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Posture Deriver
|
|
3
|
+
*
|
|
4
|
+
* Derives posture state from other panel states.
|
|
5
|
+
* Not a collector - it's computed from:
|
|
6
|
+
* - Network state (must be connected)
|
|
7
|
+
* - Capabilities state (must be available)
|
|
8
|
+
* - Gateway health (must be alive)
|
|
9
|
+
*
|
|
10
|
+
* Derivation rules:
|
|
11
|
+
* - If Network not connected → UNAVAILABLE ("Not connected")
|
|
12
|
+
* - Else if Capabilities.persistence is missing/unknown → UNAVAILABLE ("Capabilities unknown")
|
|
13
|
+
* - Else if Gateway health not alive → UNAVAILABLE ("Gateway unhealthy")
|
|
14
|
+
* - Else → AVAILABLE ("MODE: RUNNING" or "MODE: HUB")
|
|
15
|
+
*/
|
|
16
|
+
import { available, unavailable } from '../state/value.js';
|
|
17
|
+
import { gatewayConnectionStore } from '../state/gatewayConnectionStore.js';
|
|
18
|
+
import { isPostureEnabled } from '../runtime/moduleConfig.js';
|
|
19
|
+
import { panelStore } from '../state/panelStore.js';
|
|
20
|
+
/**
|
|
21
|
+
* Derive posture state from other panel states
|
|
22
|
+
*
|
|
23
|
+
* Returns Value<PostureState> based on network, capabilities, and health
|
|
24
|
+
*/
|
|
25
|
+
export async function derivePosture() {
|
|
26
|
+
// Check if posture module is enabled
|
|
27
|
+
const postureConfig = isPostureEnabled();
|
|
28
|
+
if (!postureConfig.enabled) {
|
|
29
|
+
return unavailable(postureConfig.reason, postureConfig.nextAction || 'Enable posture service or configure POSTURE_URL');
|
|
30
|
+
}
|
|
31
|
+
// Get network state
|
|
32
|
+
const connState = gatewayConnectionStore.getState();
|
|
33
|
+
if (connState.status !== 'connected') {
|
|
34
|
+
return unavailable('Not connected to Gateway', 'Run "connect" first');
|
|
35
|
+
}
|
|
36
|
+
// Get capabilities state from panel store
|
|
37
|
+
const capabilitiesState = panelStore.getPanel('capabilities');
|
|
38
|
+
if (capabilitiesState.status !== 'AVAILABLE' || !capabilitiesState.data) {
|
|
39
|
+
return unavailable('Capabilities unknown', 'Wait for capabilities to load or run "status"');
|
|
40
|
+
}
|
|
41
|
+
// Check if persistence is known
|
|
42
|
+
const persistenceItem = capabilitiesState.data.items.find(item => item.startsWith('Persistence:'));
|
|
43
|
+
if (!persistenceItem || persistenceItem.includes('UNKNOWN')) {
|
|
44
|
+
return unavailable('Capabilities incomplete', 'Wait for capabilities to fully load');
|
|
45
|
+
}
|
|
46
|
+
// Check gateway health
|
|
47
|
+
if (connState.health?.status !== 'alive' && connState.health?.status !== 'ok') {
|
|
48
|
+
return unavailable('Gateway unhealthy', 'Check gateway logs and restart if needed');
|
|
49
|
+
}
|
|
50
|
+
// All checks passed - posture is available
|
|
51
|
+
// Determine mode based on connection state
|
|
52
|
+
const data = {
|
|
53
|
+
mode: 'HUB', // Default to HUB, can be set to RUNNING by start command
|
|
54
|
+
};
|
|
55
|
+
return available(data);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=posture.derive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posture.derive.js","sourceRoot":"","sources":["../../../../src/ui/v3/collectors/posture.derive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,qCAAqC;IACrC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,WAAW,CAChB,aAAa,CAAC,MAAM,EACpB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Section 7: Centralized Panel Store
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for all panel state.
|
|
5
|
+
* Panels read from here, collectors write to here.
|
|
6
|
+
* Commands trigger collectors, never mutate panels directly.
|
|
7
|
+
*/
|
|
8
|
+
import type { ResourcesState, AssetsState, NetworkState, CapabilitiesState, PostureState, StatusStripState } from './uiStateTypes.js';
|
|
9
|
+
/**
|
|
10
|
+
* Panel State Contract
|
|
11
|
+
* Every panel follows this shape for consistency
|
|
12
|
+
*/
|
|
13
|
+
export interface PanelState<T> {
|
|
14
|
+
status: "AVAILABLE" | "UNAVAILABLE" | "DISABLED" | "LOADING";
|
|
15
|
+
data?: T;
|
|
16
|
+
reason?: string;
|
|
17
|
+
nextAction?: string;
|
|
18
|
+
lastUpdated?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* All panel states
|
|
22
|
+
*/
|
|
23
|
+
export interface PanelStates {
|
|
24
|
+
resources: PanelState<ResourcesState>;
|
|
25
|
+
assets: PanelState<AssetsState>;
|
|
26
|
+
network: PanelState<NetworkState>;
|
|
27
|
+
capabilities: PanelState<CapabilitiesState>;
|
|
28
|
+
posture: PanelState<PostureState>;
|
|
29
|
+
statusStrip: PanelState<StatusStripState>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Centralized Panel Store (singleton)
|
|
33
|
+
*/
|
|
34
|
+
declare class PanelStore {
|
|
35
|
+
private state;
|
|
36
|
+
private listeners;
|
|
37
|
+
/**
|
|
38
|
+
* Get current panel states
|
|
39
|
+
*/
|
|
40
|
+
getState(): PanelStates;
|
|
41
|
+
/**
|
|
42
|
+
* Get a specific panel state
|
|
43
|
+
*/
|
|
44
|
+
getPanel<K extends keyof PanelStates>(key: K): PanelState<PanelStates[K]['data']>;
|
|
45
|
+
/**
|
|
46
|
+
* Subscribe to state changes
|
|
47
|
+
*/
|
|
48
|
+
subscribe(listener: (state: PanelStates) => void): () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Update a panel state (internal - use methods below)
|
|
51
|
+
*/
|
|
52
|
+
private setPanel;
|
|
53
|
+
/**
|
|
54
|
+
* Update resources panel
|
|
55
|
+
*/
|
|
56
|
+
setResources(state: PanelState<ResourcesState>): void;
|
|
57
|
+
/**
|
|
58
|
+
* Update assets panel
|
|
59
|
+
*/
|
|
60
|
+
setAssets(state: PanelState<AssetsState>): void;
|
|
61
|
+
/**
|
|
62
|
+
* Update network panel
|
|
63
|
+
*/
|
|
64
|
+
setNetwork(state: PanelState<NetworkState>): void;
|
|
65
|
+
/**
|
|
66
|
+
* Update capabilities panel
|
|
67
|
+
*/
|
|
68
|
+
setCapabilities(state: PanelState<CapabilitiesState>): void;
|
|
69
|
+
/**
|
|
70
|
+
* Update posture panel
|
|
71
|
+
*/
|
|
72
|
+
setPosture(state: PanelState<PostureState>): void;
|
|
73
|
+
/**
|
|
74
|
+
* Update status strip
|
|
75
|
+
*/
|
|
76
|
+
setStatusStrip(state: PanelState<StatusStripState>): void;
|
|
77
|
+
}
|
|
78
|
+
export declare const panelStore: PanelStore;
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=panelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelStore.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/state/panelStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGtI;;;GAGG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7D,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;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,IAAI;CAG1D;AAGD,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section 7: Centralized Panel Store
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for all panel state.
|
|
5
|
+
* Panels read from here, collectors write to here.
|
|
6
|
+
* Commands trigger collectors, never mutate panels directly.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Centralized Panel Store (singleton)
|
|
10
|
+
*/
|
|
11
|
+
class PanelStore {
|
|
12
|
+
state = {
|
|
13
|
+
resources: {
|
|
14
|
+
status: "LOADING",
|
|
15
|
+
reason: "Initializing",
|
|
16
|
+
},
|
|
17
|
+
assets: {
|
|
18
|
+
status: "UNAVAILABLE",
|
|
19
|
+
reason: "Asset registry not initialized",
|
|
20
|
+
nextAction: "Start agent registry",
|
|
21
|
+
},
|
|
22
|
+
network: {
|
|
23
|
+
status: "UNAVAILABLE",
|
|
24
|
+
reason: "Network state unknown",
|
|
25
|
+
nextAction: "Start Gateway service and run 'connect'",
|
|
26
|
+
},
|
|
27
|
+
capabilities: {
|
|
28
|
+
status: "UNAVAILABLE",
|
|
29
|
+
reason: "Capabilities not loaded",
|
|
30
|
+
nextAction: "Run 'status' after connecting",
|
|
31
|
+
},
|
|
32
|
+
posture: {
|
|
33
|
+
status: "UNAVAILABLE",
|
|
34
|
+
reason: "Posture not initialized",
|
|
35
|
+
nextAction: "Run 'status' to check system state",
|
|
36
|
+
},
|
|
37
|
+
statusStrip: {
|
|
38
|
+
status: "UNAVAILABLE",
|
|
39
|
+
reason: "Status not initialized",
|
|
40
|
+
nextAction: "System starting up",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
listeners = new Set();
|
|
44
|
+
/**
|
|
45
|
+
* Get current panel states
|
|
46
|
+
*/
|
|
47
|
+
getState() {
|
|
48
|
+
return { ...this.state };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get a specific panel state
|
|
52
|
+
*/
|
|
53
|
+
getPanel(key) {
|
|
54
|
+
return { ...this.state[key] };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Subscribe to state changes
|
|
58
|
+
*/
|
|
59
|
+
subscribe(listener) {
|
|
60
|
+
this.listeners.add(listener);
|
|
61
|
+
return () => {
|
|
62
|
+
this.listeners.delete(listener);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Update a panel state (internal - use methods below)
|
|
67
|
+
*/
|
|
68
|
+
setPanel(key, update) {
|
|
69
|
+
const current = this.state[key];
|
|
70
|
+
this.state[key] = {
|
|
71
|
+
...current,
|
|
72
|
+
...update,
|
|
73
|
+
lastUpdated: new Date().toISOString(),
|
|
74
|
+
};
|
|
75
|
+
// Notify all listeners
|
|
76
|
+
this.listeners.forEach(listener => {
|
|
77
|
+
try {
|
|
78
|
+
listener({ ...this.state });
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.error('PanelStore listener error:', error);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Update resources panel
|
|
87
|
+
*/
|
|
88
|
+
setResources(state) {
|
|
89
|
+
this.setPanel('resources', state);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Update assets panel
|
|
93
|
+
*/
|
|
94
|
+
setAssets(state) {
|
|
95
|
+
this.setPanel('assets', state);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Update network panel
|
|
99
|
+
*/
|
|
100
|
+
setNetwork(state) {
|
|
101
|
+
this.setPanel('network', state);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Update capabilities panel
|
|
105
|
+
*/
|
|
106
|
+
setCapabilities(state) {
|
|
107
|
+
this.setPanel('capabilities', state);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Update posture panel
|
|
111
|
+
*/
|
|
112
|
+
setPosture(state) {
|
|
113
|
+
this.setPanel('posture', state);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Update status strip
|
|
117
|
+
*/
|
|
118
|
+
setStatusStrip(state) {
|
|
119
|
+
this.setPanel('statusStrip', state);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Singleton instance
|
|
123
|
+
export const panelStore = new PanelStore();
|
|
124
|
+
//# sourceMappingURL=panelStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelStore.js","sourceRoot":"","sources":["../../../../src/ui/v3/state/panelStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8BH;;GAEG;AACH,MAAM,UAAU;IACN,KAAK,GAAgB;QAC3B,SAAS,EAAE;YACT,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,cAAc;SACvB;QACD,MAAM,EAAE;YACN,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,gCAAgC;YACxC,UAAU,EAAE,sBAAsB;SACnC;QACD,OAAO,EAAE;YACP,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,uBAAuB;YAC/B,UAAU,EAAE,yCAAyC;SACtD;QACD,YAAY,EAAE;YACZ,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,yBAAyB;YACjC,UAAU,EAAE,+BAA+B;SAC5C;QACD,OAAO,EAAE;YACP,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,yBAAyB;YACjC,UAAU,EAAE,oCAAoC;SACjD;QACD,WAAW,EAAE;YACX,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,wBAAwB;YAChC,UAAU,EAAE,oBAAoB;SACjC;KACF,CAAC;IAEM,SAAS,GAAsC,IAAI,GAAG,EAAE,CAAC;IAEjE;;OAEG;IACH,QAAQ;QACN,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,QAAQ,CAA8B,GAAM;QAC1C,OAAO,EAAE,GAAG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AAC,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,KAA+B;QACxC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,KAAmC;QAChD,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;CACF;AAED,qBAAqB;AACrB,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -17,6 +17,13 @@ import type { UiState } from './uiState.js';
|
|
|
17
17
|
* If a key is AVAILABLE in previousState, it will be preserved
|
|
18
18
|
* (commands update state, collectors should not overwrite it)
|
|
19
19
|
*/
|
|
20
|
+
/**
|
|
21
|
+
* Section 7: Build UiState from collectors
|
|
22
|
+
*
|
|
23
|
+
* All panels are driven by collectors.
|
|
24
|
+
* Commands may trigger collectors or update state temporarily,
|
|
25
|
+
* but collectors are the source of truth.
|
|
26
|
+
*/
|
|
20
27
|
export declare function buildUiState(previousState?: UiState): Promise<UiState>;
|
|
21
28
|
/**
|
|
22
29
|
* Get the last built state (for immediate access without async)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uiStateBuilder.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/state/uiStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"uiStateBuilder.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/state/uiStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAqB5C;;;;;;;;;GASG;AACH;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CA4B5E;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAEtC"}
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
import { defaultUiState } from './defaultState.js';
|
|
10
10
|
import { assertUiState } from './assertUiState.js';
|
|
11
11
|
import { collectResources } from '../collectors/resources.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { collectAssets } from '../collectors/assets.collector.js';
|
|
13
|
+
import { collectCapabilities } from '../collectors/capabilities.collector.js';
|
|
14
|
+
import { collectNetwork } from '../collectors/network.collector.js';
|
|
15
|
+
import { derivePosture } from '../collectors/posture.derive.js';
|
|
16
|
+
import { unavailable } from './value.js';
|
|
14
17
|
/**
|
|
15
18
|
* Build UiState from collectors
|
|
16
19
|
*
|
|
@@ -28,58 +31,32 @@ let lastState = defaultUiState;
|
|
|
28
31
|
* If a key is AVAILABLE in previousState, it will be preserved
|
|
29
32
|
* (commands update state, collectors should not overwrite it)
|
|
30
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* Section 7: Build UiState from collectors
|
|
36
|
+
*
|
|
37
|
+
* All panels are driven by collectors.
|
|
38
|
+
* Commands may trigger collectors or update state temporarily,
|
|
39
|
+
* but collectors are the source of truth.
|
|
40
|
+
*/
|
|
31
41
|
export async function buildUiState(previousState) {
|
|
32
|
-
// Collect
|
|
33
|
-
const resources = await
|
|
42
|
+
// Collect all panel data in parallel (non-blocking)
|
|
43
|
+
const [resources, assets, network, capabilities, posture] = await Promise.all([
|
|
44
|
+
collectResources(),
|
|
45
|
+
collectAssets(),
|
|
46
|
+
collectNetwork(),
|
|
47
|
+
collectCapabilities(),
|
|
48
|
+
derivePosture(),
|
|
49
|
+
]);
|
|
34
50
|
// Build state with all required keys
|
|
35
|
-
// CRITICAL: Preserve command-updated state (
|
|
36
|
-
//
|
|
37
|
-
// If we see LOADING in previousState, it means a command is in-flight, so preserve it
|
|
38
|
-
// But if a command completed and left LOADING, that's a bug - we'll let it persist for now but log it
|
|
39
|
-
// STEP 3: Only update posture if enabled (don't poll if disabled)
|
|
40
|
-
let postureState = previousState?.posture;
|
|
41
|
-
if (!postureState) {
|
|
42
|
-
// No previous state - check if posture is enabled
|
|
43
|
-
const postureConfig = isPostureEnabled();
|
|
44
|
-
if (!postureConfig.enabled) {
|
|
45
|
-
// Posture is disabled - set to UNAVAILABLE with clear reason
|
|
46
|
-
postureState = unavailable('Posture module not enabled in this build', postureConfig.nextAction || 'Enable posture service or configure POSTURE_URL');
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Posture is enabled but not initialized yet
|
|
50
|
-
postureState = unavailable('Posture not initialized', 'Run "status" to check system state');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
// STEP 3: If posture is disabled, don't transition from DISABLED state
|
|
55
|
-
const postureConfig = isPostureEnabled();
|
|
56
|
-
if (!postureConfig.enabled && isUnavailable(postureState)) {
|
|
57
|
-
// Check if reason indicates disabled state
|
|
58
|
-
const reason = postureState.reason || '';
|
|
59
|
-
if (reason.includes('not enabled') || reason.includes('POSTURE_URL')) {
|
|
60
|
-
// Posture is disabled and already in DISABLED state - don't change it
|
|
61
|
-
// This prevents flicker and ensures deterministic state
|
|
62
|
-
// Keep the existing disabled state
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
// Not a disabled state - preserve previous state (commands may have set it)
|
|
66
|
-
// Keep existing state
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
// Posture is enabled or state is not DISABLED - preserve previous state (commands may have set it)
|
|
71
|
-
// Keep existing state
|
|
72
|
-
}
|
|
73
|
-
}
|
|
51
|
+
// CRITICAL: Preserve command-updated state for statusStrip (commands set this)
|
|
52
|
+
// All other panels come from collectors
|
|
74
53
|
const state = {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
//
|
|
81
|
-
network: previousState?.network || unavailable('Network state unknown', 'Start Gateway service and run "connect"'),
|
|
82
|
-
capabilities: previousState?.capabilities || unavailable('Capabilities not loaded', 'Run "status" after connecting'),
|
|
54
|
+
resources, // From collector
|
|
55
|
+
assets, // From collector
|
|
56
|
+
network, // From collector (reads from connection store)
|
|
57
|
+
capabilities, // From collector
|
|
58
|
+
posture, // Derived from other states
|
|
59
|
+
// Preserve statusStrip from previous state (commands update this)
|
|
83
60
|
statusStrip: previousState?.statusStrip || unavailable('Status not initialized', 'System starting up'),
|
|
84
61
|
};
|
|
85
62
|
// Section 4: Validate state contract at runtime
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uiStateBuilder.js","sourceRoot":"","sources":["../../../../src/ui/v3/state/uiStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"uiStateBuilder.js","sourceRoot":"","sources":["../../../../src/ui/v3/state/uiStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAyC,MAAM,YAAY,CAAC;AAGhF;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,IAAI,CAAC,CAAC,KAAK;AAEtC,IAAI,SAAS,GAAY,cAAc,CAAC;AAExC;;;;;;;;;GASG;AACH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,aAAuB;IACxD,oDAAoD;IACpD,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC5E,gBAAgB,EAAE;QAClB,aAAa,EAAE;QACf,cAAc,EAAE;QAChB,mBAAmB,EAAE;QACrB,aAAa,EAAE;KAChB,CAAC,CAAC;IAEH,qCAAqC;IACrC,+EAA+E;IAC/E,wCAAwC;IACxC,MAAM,KAAK,GAAY;QACrB,SAAS,EAAE,iBAAiB;QAC5B,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,+CAA+C;QACxD,YAAY,EAAE,iBAAiB;QAC/B,OAAO,EAAE,4BAA4B;QACrC,kEAAkE;QAClE,WAAW,EAAE,aAAa,EAAE,WAAW,IAAI,WAAW,CAAC,wBAAwB,EAAE,oBAAoB,CAAC;KACvG,CAAC;IAEF,gDAAgD;IAChD,aAAa,CAAC,KAAK,CAAC,CAAC;IAErB,SAAS,GAAG,KAAK,CAAC;IAClB,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -10,7 +10,9 @@ import type { CapabilitiesState as StoreCapabilitiesState } from '../../state/ca
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function renderCapabilitiesPanelFromStore(capabilitiesState: StoreCapabilitiesState, connectionStatus: string): string[];
|
|
12
12
|
/**
|
|
13
|
-
* Render Capabilities panel
|
|
13
|
+
* Render Capabilities panel from Value<CapabilitiesState>
|
|
14
|
+
*
|
|
15
|
+
* Section 7: Reads from collector data (via UiState), not from old store
|
|
14
16
|
*/
|
|
15
17
|
import type { Value } from '../../state/value.js';
|
|
16
18
|
import type { CapabilitiesState } from '../../state/uiStateTypes.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilitiesPanel.d.ts","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/panels/CapabilitiesPanel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAIpG;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,iBAAiB,EAAE,sBAAsB,EACzC,gBAAgB,EAAE,MAAM,GACvB,MAAM,EAAE,CAyCV;AAED
|
|
1
|
+
{"version":3,"file":"CapabilitiesPanel.d.ts","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/panels/CapabilitiesPanel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,IAAI,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAIpG;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,iBAAiB,EAAE,sBAAsB,EACzC,gBAAgB,EAAE,MAAM,GACvB,MAAM,EAAE,CAyCV;AAED;;;;GAIG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAUrE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,MAAM,EAAE,CAIjF"}
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* Renders the CAPABILITIES panel content from capabilitiesStore.
|
|
5
5
|
* Subscribes to both gatewayConnectionStore and capabilitiesStore.
|
|
6
6
|
*/
|
|
7
|
-
import { capabilitiesStore } from '../../state/capabilitiesStore.js';
|
|
8
|
-
import { gatewayConnectionStore } from '../../state/gatewayConnectionStore.js';
|
|
9
7
|
/**
|
|
10
8
|
* Render Capabilities panel from store state
|
|
11
9
|
*/
|
|
@@ -52,16 +50,16 @@ export function renderCapabilitiesPanelFromStore(capabilitiesState, connectionSt
|
|
|
52
50
|
}
|
|
53
51
|
return lines;
|
|
54
52
|
}
|
|
53
|
+
import { renderValue } from '../../state/value.js';
|
|
55
54
|
function renderAvailable(data) {
|
|
56
55
|
if (data.items.length === 0) {
|
|
57
|
-
return 'No capabilities';
|
|
56
|
+
return 'No capabilities available';
|
|
58
57
|
}
|
|
59
58
|
return data.items.join('\n');
|
|
60
59
|
}
|
|
61
60
|
export function renderCapabilitiesPanel(value) {
|
|
62
|
-
//
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
return renderCapabilitiesPanelFromStore(capabilitiesState, connectionState.status);
|
|
61
|
+
// Section 7: Use collector data from UiState, not old store
|
|
62
|
+
const content = renderValue(value, renderAvailable);
|
|
63
|
+
return content.split('\n');
|
|
66
64
|
}
|
|
67
65
|
//# sourceMappingURL=CapabilitiesPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilitiesPanel.js","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/panels/CapabilitiesPanel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"CapabilitiesPanel.js","sourceRoot":"","sources":["../../../../../src/ui/v3/ui/panels/CapabilitiesPanel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,iBAAyC,EACzC,gBAAwB;IAExB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,qCAAqC;IACrC,IAAI,gBAAgB,KAAK,WAAW,EAAE,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CA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