@songsid/agend 2.4.0-beta.16 → 2.4.0-beta.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 (112) hide show
  1. package/dist/auth-api.js +2 -0
  2. package/dist/auth-api.js.map +1 -1
  3. package/dist/backend/claude-code.d.ts +10 -1
  4. package/dist/backend/claude-code.js +1 -0
  5. package/dist/backend/claude-code.js.map +1 -1
  6. package/dist/backend/types.d.ts +6 -0
  7. package/dist/backend/types.js.map +1 -1
  8. package/dist/build-provenance.json +1 -1
  9. package/dist/claude-credential-launch.d.ts +1 -0
  10. package/dist/claude-credential-launch.js +13 -2
  11. package/dist/claude-credential-launch.js.map +1 -1
  12. package/dist/claude-credential-vault.d.ts +7 -1
  13. package/dist/claude-credential-vault.js +26 -1
  14. package/dist/claude-credential-vault.js.map +1 -1
  15. package/dist/claude-request-observation.d.ts +7 -0
  16. package/dist/claude-request-observation.js +26 -0
  17. package/dist/claude-request-observation.js.map +1 -0
  18. package/dist/cli-audited.js +8 -6
  19. package/dist/cli-audited.js.map +1 -1
  20. package/dist/daemon.js +6 -0
  21. package/dist/daemon.js.map +1 -1
  22. package/dist/fleet-manager.d.ts +14 -0
  23. package/dist/fleet-manager.js +128 -3
  24. package/dist/fleet-manager.js.map +1 -1
  25. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +9 -3
  26. package/dist/host-monitoring-config.d.ts +2 -1
  27. package/dist/host-monitoring-config.js +8 -3
  28. package/dist/host-monitoring-config.js.map +1 -1
  29. package/dist/host-monitoring-history-files.d.ts +2 -0
  30. package/dist/host-monitoring-history-files.js +16 -0
  31. package/dist/host-monitoring-history-files.js.map +1 -0
  32. package/dist/host-monitoring-history-policy.d.ts +55 -0
  33. package/dist/host-monitoring-history-policy.js +93 -0
  34. package/dist/host-monitoring-history-policy.js.map +1 -0
  35. package/dist/host-monitoring-history-store.d.ts +52 -0
  36. package/dist/host-monitoring-history-store.js +176 -0
  37. package/dist/host-monitoring-history-store.js.map +1 -0
  38. package/dist/host-monitoring-history-worker.d.ts +1 -0
  39. package/dist/host-monitoring-history-worker.js +50 -0
  40. package/dist/host-monitoring-history-worker.js.map +1 -0
  41. package/dist/host-monitoring-history.d.ts +71 -0
  42. package/dist/host-monitoring-history.js +265 -0
  43. package/dist/host-monitoring-history.js.map +1 -0
  44. package/dist/host-monitoring-platform.d.ts +73 -0
  45. package/dist/host-monitoring-platform.js +273 -0
  46. package/dist/host-monitoring-platform.js.map +1 -0
  47. package/dist/host-monitoring-runtime.d.ts +34 -0
  48. package/dist/host-monitoring-runtime.js +80 -0
  49. package/dist/host-monitoring-runtime.js.map +1 -0
  50. package/dist/host-monitoring-settings-store.d.ts +5 -0
  51. package/dist/host-monitoring-settings-store.js +49 -0
  52. package/dist/host-monitoring-settings-store.js.map +1 -0
  53. package/dist/host-monitoring.d.ts +106 -0
  54. package/dist/host-monitoring.js +157 -0
  55. package/dist/host-monitoring.js.map +1 -0
  56. package/dist/public-web-gateway.js +4 -0
  57. package/dist/public-web-gateway.js.map +1 -1
  58. package/dist/runtime-cli-install.js +17 -16
  59. package/dist/runtime-cli-install.js.map +1 -1
  60. package/dist/settings-api.d.ts +3 -0
  61. package/dist/settings-api.js +14 -7
  62. package/dist/settings-api.js.map +1 -1
  63. package/dist/settings-baseline.d.ts +1 -0
  64. package/dist/settings-baseline.js +5 -4
  65. package/dist/settings-baseline.js.map +1 -1
  66. package/dist/settings-change.js +8 -0
  67. package/dist/settings-change.js.map +1 -1
  68. package/dist/settings-effect.d.ts +2 -0
  69. package/dist/settings-effect.js +5 -3
  70. package/dist/settings-effect.js.map +1 -1
  71. package/dist/transcript-monitor.d.ts +1 -0
  72. package/dist/transcript-monitor.js +18 -0
  73. package/dist/transcript-monitor.js.map +1 -1
  74. package/dist/ui/accounts-view.js +7 -5
  75. package/dist/ui/claude-credentials.js +12 -1
  76. package/dist/ui/fleet-office-pack.js +2 -2
  77. package/dist/ui/fleet-office-play.js +142 -3
  78. package/dist/ui/fleet-office-skin.js +67 -2
  79. package/dist/ui/fleet-office-store.js +41 -0
  80. package/dist/ui/fleet-office-zones.js +15 -8
  81. package/dist/ui/fleet-office.js +126 -21
  82. package/dist/ui/host-health-model.js +42 -0
  83. package/dist/ui/host-health.js +74 -0
  84. package/dist/ui/panel-chat.js +99 -43
  85. package/dist/ui/panel-fleet.js +24 -11
  86. package/dist/ui/panel-hub.js +5 -1
  87. package/dist/ui/panel-settings.js +3 -3
  88. package/dist/ui/search-dialog.js +8 -1
  89. package/dist/ui/settings-capabilities.js +2 -0
  90. package/dist/ui/settings-host-monitoring.js +31 -13
  91. package/dist/ui/settings-registry.js +4 -1
  92. package/dist/ui/shared/accounts.css +8 -4
  93. package/dist/ui/shared/agent-sheet.js +5 -2
  94. package/dist/ui/shared/app-route.js +1 -1
  95. package/dist/ui/shared/app.css +37 -0
  96. package/dist/ui/shared/app.js +1 -0
  97. package/dist/ui/shared/chat-strings.js +2 -2
  98. package/dist/ui/shared/chat-thread.js +42 -10
  99. package/dist/ui/shared/instance-nav.js +47 -5
  100. package/dist/ui/shared/jump-idle.js +36 -0
  101. package/dist/ui/shared/theme.js +6 -2
  102. package/dist/ui/shared/ui-menu.js +17 -11
  103. package/dist/web-api.d.ts +2 -0
  104. package/dist/web-api.js +54 -0
  105. package/dist/web-api.js.map +1 -1
  106. package/dist/web-chat-history.d.ts +7 -1
  107. package/dist/web-chat-history.js +19 -3
  108. package/dist/web-chat-history.js.map +1 -1
  109. package/dist/web-shell-routes.d.ts +1 -1
  110. package/dist/web-shell-routes.js +1 -1
  111. package/dist/web-shell-routes.js.map +1 -1
  112. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import type { HistoryAnswer, HistoryStats } from './host-monitoring-history-store.js';
2
+ import type { HostHealthSnapshot } from './host-monitoring.js';
3
+ export interface HistoryIsolate {
4
+ on(event: 'message' | 'error' | 'exit', listener: (...args: any[]) => void): unknown;
5
+ postMessage(value: unknown): void;
6
+ terminate(): Promise<number>;
7
+ unref(): unknown;
8
+ }
9
+ export interface HostHistoryStatus {
10
+ state: 'off' | 'waiting' | 'recording' | 'paused' | 'stopping' | 'failed';
11
+ reason?: string;
12
+ stats?: HistoryStats;
13
+ }
14
+ export type HostHistoryResult = {
15
+ ok: true;
16
+ value: HistoryAnswer;
17
+ } | {
18
+ ok: false;
19
+ reason: string;
20
+ };
21
+ interface Options {
22
+ path: string;
23
+ now?: () => number;
24
+ monotonic?: () => number;
25
+ factory?: (path: string, control: SharedArrayBuffer) => HistoryIsolate;
26
+ cleanup?: (path: string) => Promise<void>;
27
+ unblocked?: () => void;
28
+ }
29
+ /** One owned persistence worker, one request in flight, at most two host frames buffered. */
30
+ export declare class HostMonitoringHistory {
31
+ private readonly options;
32
+ private readonly now;
33
+ private readonly monotonic;
34
+ private enabled;
35
+ private initialized;
36
+ private stopped;
37
+ private cleanupFailed;
38
+ private failed;
39
+ private watermark;
40
+ private worker;
41
+ private control;
42
+ private ready;
43
+ private exit;
44
+ private closing;
45
+ private removeOnClose;
46
+ private startupTimer;
47
+ private flight;
48
+ private sequence;
49
+ private pending;
50
+ private lastFlush;
51
+ private lastWall;
52
+ private permitGeneration;
53
+ private permitted;
54
+ private current;
55
+ constructor(options: Options);
56
+ status(): HostHistoryStatus;
57
+ blocked(): boolean;
58
+ configure(enabled: boolean): void;
59
+ /** Shutdown retains enabled history; disabling removes it only after physical worker exit. */
60
+ shutdown(): void;
61
+ ingest(snapshot: HostHealthSnapshot): void;
62
+ private start;
63
+ private clearStartup;
64
+ private fail;
65
+ private complete;
66
+ private request;
67
+ private flush;
68
+ query(range: unknown, series: unknown): Promise<HostHistoryResult>;
69
+ private finish;
70
+ }
71
+ export {};
@@ -0,0 +1,265 @@
1
+ import { Worker } from 'node:worker_threads';
2
+ import { cleanupHistory } from './host-monitoring-history-files.js';
3
+ import { HistoryWatermark, historyQuery, hostHistoryPoints } from './host-monitoring-history-policy.js';
4
+ const createIsolate = (path, control) => import.meta.url.endsWith('.ts')
5
+ ? new Worker(`const {workerData}=require('node:worker_threads');import('tsx/esm/api').then(({tsImport})=>tsImport(workerData.entry,workerData.entry));`, { eval: true, execArgv: [], resourceLimits: { maxOldGenerationSizeMb: 64 }, workerData: { path, control, entry: new URL('./host-monitoring-history-worker.ts', import.meta.url).href } })
6
+ : new Worker(new URL('./host-monitoring-history-worker.js', import.meta.url), { execArgv: [], resourceLimits: { maxOldGenerationSizeMb: 64 }, workerData: { path, control } });
7
+ /** One owned persistence worker, one request in flight, at most two host frames buffered. */
8
+ export class HostMonitoringHistory {
9
+ options;
10
+ now;
11
+ monotonic;
12
+ enabled = false;
13
+ initialized = false;
14
+ stopped = false;
15
+ cleanupFailed = false;
16
+ failed = false;
17
+ watermark = new HistoryWatermark();
18
+ worker = null;
19
+ control = null;
20
+ ready = false;
21
+ exit = null;
22
+ closing = null;
23
+ removeOnClose = false;
24
+ startupTimer = null;
25
+ flight = null;
26
+ sequence = 0;
27
+ pending = new Map();
28
+ lastFlush = -Infinity;
29
+ lastWall = -Infinity;
30
+ permitGeneration = 0;
31
+ permitted = false;
32
+ current = { state: 'off' };
33
+ constructor(options) {
34
+ this.options = options;
35
+ this.now = options.now ?? Date.now;
36
+ this.monotonic = options.monotonic ?? (() => performance.now());
37
+ }
38
+ status() { return structuredClone(this.current); }
39
+ blocked() { return !!this.closing || this.cleanupFailed; }
40
+ configure(enabled) {
41
+ if (this.initialized && this.enabled === enabled && !this.stopped)
42
+ return;
43
+ this.initialized = true;
44
+ this.enabled = enabled;
45
+ this.stopped = false;
46
+ if (!enabled) {
47
+ void this.finish(true);
48
+ return;
49
+ }
50
+ if (this.cleanupFailed)
51
+ return;
52
+ this.failed = false;
53
+ if (this.closing)
54
+ return;
55
+ this.lastWall = -Infinity;
56
+ this.lastFlush = -Infinity;
57
+ this.watermark = new HistoryWatermark();
58
+ this.current = { state: 'waiting' };
59
+ }
60
+ /** Shutdown retains enabled history; disabling removes it only after physical worker exit. */
61
+ shutdown() { this.stopped = true; void this.finish(!this.enabled); }
62
+ ingest(snapshot) {
63
+ if (!this.enabled || this.stopped || this.blocked() || this.failed)
64
+ return;
65
+ const at = this.now();
66
+ if (at < this.lastWall) {
67
+ this.permitted = false;
68
+ if (this.control)
69
+ Atomics.store(this.control, 1, 0);
70
+ this.permitGeneration++;
71
+ this.pending.clear();
72
+ this.current = { ...this.current, state: 'paused', reason: 'clock_changed' };
73
+ return;
74
+ }
75
+ this.lastWall = at;
76
+ const permit = this.watermark.permit(snapshot, this.monotonic());
77
+ if (!permit.ok) {
78
+ this.permitted = false;
79
+ if (this.control)
80
+ Atomics.store(this.control, 1, 0);
81
+ this.permitGeneration++;
82
+ this.pending.clear();
83
+ this.current = { ...this.current, state: 'paused', reason: permit.reason };
84
+ return;
85
+ }
86
+ this.permitted = true;
87
+ if (this.control)
88
+ Atomics.store(this.control, 1, 1);
89
+ for (const point of hostHistoryPoints(snapshot, at))
90
+ this.pending.set(`${point.series}:${Math.floor(at / 30000)}`, point);
91
+ // Discard old buffered frames rather than queuing a catch-up stream behind a slow disk.
92
+ const frames = [...new Set([...this.pending.values()].map(p => Math.floor(p.at / 30000)))].sort((a, b) => b - a).slice(0, 2);
93
+ for (const [key, point] of this.pending)
94
+ if (!frames.includes(Math.floor(point.at / 30000)))
95
+ this.pending.delete(key);
96
+ if (!this.pending.size)
97
+ return;
98
+ if (!this.worker)
99
+ this.start();
100
+ if (this.ready && !this.flight && (frames.length >= 2 || this.monotonic() - this.lastFlush >= 60000))
101
+ void this.flush();
102
+ }
103
+ start() {
104
+ if (this.worker || !this.enabled || this.blocked() || this.failed || this.stopped)
105
+ return;
106
+ const control = new SharedArrayBuffer(8);
107
+ this.control = new Int32Array(control);
108
+ Atomics.store(this.control, 0, 1);
109
+ Atomics.store(this.control, 1, 1);
110
+ let worker;
111
+ try {
112
+ worker = (this.options.factory ?? createIsolate)(this.options.path, control);
113
+ }
114
+ catch {
115
+ this.fail('history_start_failed');
116
+ return;
117
+ }
118
+ this.worker = worker;
119
+ worker.unref();
120
+ this.exit = new Promise(resolve => worker.on('exit', () => {
121
+ if (this.worker === worker) {
122
+ this.worker = null;
123
+ this.ready = false;
124
+ this.clearStartup();
125
+ this.complete({ ok: false, reason: 'history_unavailable' });
126
+ if (!this.closing && !this.stopped)
127
+ this.fail('history_worker_exited');
128
+ }
129
+ resolve();
130
+ }));
131
+ worker.on('error', () => { this.fail('history_io_failed'); this.complete({ ok: false }); void worker.terminate(); });
132
+ worker.on('message', message => {
133
+ if (this.worker !== worker)
134
+ return;
135
+ if (message?.op === 'ready') {
136
+ this.clearStartup();
137
+ if (!this.enabled || this.stopped || this.closing) {
138
+ worker.postMessage({ op: 'close' });
139
+ return;
140
+ }
141
+ this.ready = true;
142
+ if (this.permitted) {
143
+ this.current = { state: 'recording', stats: message.stats };
144
+ void this.flush();
145
+ }
146
+ return;
147
+ }
148
+ if (message?.op === 'failed') {
149
+ this.fail('history_io_failed');
150
+ void worker.terminate();
151
+ return;
152
+ }
153
+ if (message?.id === this.flight?.id)
154
+ this.complete(message);
155
+ });
156
+ this.startupTimer = setTimeout(() => { this.fail('history_timeout'); void worker.terminate(); }, 2000);
157
+ this.startupTimer.unref?.();
158
+ }
159
+ clearStartup() { if (this.startupTimer)
160
+ clearTimeout(this.startupTimer); this.startupTimer = null; }
161
+ fail(reason) { this.failed = true; this.pending.clear(); this.current = { ...this.current, state: 'failed', reason }; this.clearStartup(); }
162
+ complete(value) { const flight = this.flight; if (!flight)
163
+ return; this.flight = null; clearTimeout(flight.timer); flight.resolve(value); }
164
+ request(message) {
165
+ if (!this.worker || !this.ready || this.flight || this.closing || !this.enabled || this.stopped)
166
+ return Promise.resolve({ ok: false, reason: 'history_busy' });
167
+ const worker = this.worker, id = ++this.sequence;
168
+ return new Promise(resolve => {
169
+ const timer = setTimeout(() => { if (this.flight?.id === id) {
170
+ this.complete({ ok: false, reason: 'history_timeout' });
171
+ this.fail('history_timeout');
172
+ void worker.terminate();
173
+ } }, 2000);
174
+ timer.unref?.();
175
+ this.flight = { id, timer, resolve };
176
+ try {
177
+ worker.postMessage({ ...message, id });
178
+ }
179
+ catch {
180
+ this.complete({ ok: false, reason: 'history_unavailable' });
181
+ this.fail('history_io_failed');
182
+ }
183
+ });
184
+ }
185
+ async flush() {
186
+ if (!this.pending.size || this.flight || !this.ready || !this.permitted)
187
+ return;
188
+ const generation = this.permitGeneration;
189
+ const points = [...this.pending.values()].slice(-64);
190
+ this.pending.clear();
191
+ this.lastFlush = this.monotonic();
192
+ const answer = await this.request({ op: 'append', points, now: this.now() });
193
+ if (!this.enabled || this.stopped || this.closing || generation !== this.permitGeneration)
194
+ return;
195
+ if (!answer.ok) {
196
+ this.fail('history_io_failed');
197
+ return;
198
+ }
199
+ this.current = { state: answer.value.paused ? 'paused' : 'recording', ...(answer.value.paused ? { reason: 'history_busy' } : {}), stats: answer.value.stats };
200
+ }
201
+ async query(range, series) {
202
+ try {
203
+ historyQuery(range, series, this.now());
204
+ }
205
+ catch {
206
+ return { ok: false, reason: 'invalid_history_query' };
207
+ }
208
+ if (!this.enabled || this.stopped || this.blocked() || this.failed || this.current.state !== 'recording')
209
+ return { ok: false, reason: this.current.reason ?? 'history_unavailable' };
210
+ const answer = await this.request({ op: 'query', range, series, now: this.now() });
211
+ if (!this.enabled || this.stopped || this.closing)
212
+ return { ok: false, reason: 'history_unavailable' };
213
+ return answer.ok ? { ok: true, value: answer.value } : { ok: false, reason: 'history_unavailable' };
214
+ }
215
+ finish(remove) {
216
+ // An Off edit can arrive while shutdown is already retaining enabled history.
217
+ this.removeOnClose ||= remove;
218
+ if (this.closing)
219
+ return this.closing;
220
+ this.permitted = false;
221
+ if (this.control)
222
+ Atomics.store(this.control, 1, 0);
223
+ this.permitGeneration++;
224
+ this.pending.clear();
225
+ this.clearStartup();
226
+ this.complete({ ok: false, reason: 'history_unavailable' });
227
+ if (this.control)
228
+ Atomics.store(this.control, 0, 0);
229
+ const worker = this.worker, physical = this.exit;
230
+ this.current = { state: 'stopping' };
231
+ this.closing = (async () => {
232
+ // Assign ownership before a no-worker close can finish.
233
+ await Promise.resolve();
234
+ if (worker) {
235
+ try {
236
+ worker.postMessage({ op: 'close' });
237
+ }
238
+ catch {
239
+ void worker.terminate();
240
+ }
241
+ const timer = setTimeout(() => { void worker.terminate(); }, 2000);
242
+ timer.unref?.();
243
+ try {
244
+ await physical;
245
+ }
246
+ finally {
247
+ clearTimeout(timer);
248
+ }
249
+ }
250
+ if (this.removeOnClose)
251
+ await (this.options.cleanup ?? cleanupHistory)(this.options.path);
252
+ // With no await between the decision above and releasing ownership, a late
253
+ // Off request either upgrades this close or starts its own cleanup.
254
+ this.closing = null;
255
+ this.removeOnClose = false;
256
+ this.control = null;
257
+ this.exit = null;
258
+ this.cleanupFailed = false;
259
+ this.current = { state: this.enabled && !this.stopped ? 'waiting' : 'off' };
260
+ this.options.unblocked?.();
261
+ })().catch(() => { this.closing = null; this.cleanupFailed = true; this.current = { state: 'failed', reason: 'history_cleanup_failed' }; this.options.unblocked?.(); });
262
+ return this.closing;
263
+ }
264
+ }
265
+ //# sourceMappingURL=host-monitoring-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-monitoring-history.js","sourceRoot":"","sources":["../src/host-monitoring-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAC,YAAY,EAAC,iBAAiB,EAAmB,MAAM,qCAAqC,CAAC;AAiBtH,MAAM,aAAa,GAAC,CAAC,IAAW,EAAC,OAAyB,EAAgB,EAAE,CAAA,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;IACzG,CAAC,CAAA,IAAI,MAAM,CAAC,0IAA0I,EAAC,EAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAC,cAAc,EAAC,EAAC,sBAAsB,EAAC,EAAE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BAAO,CAAC;oBAAA,YAAY,CAAC,KAAK,CAAC,CAAC;gBAAA,CAAC;YACnD,CAAC;YACD,IAAG,IAAI,CAAC,aAAa;gBAAC,MAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAE,cAAc,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrF,2EAA2E;YAC3E,oEAAoE;YACpE,IAAI,CAAC,OAAO,GAAC,IAAI,CAAC;YAAA,IAAI,CAAC,aAAa,GAAC,KAAK,CAAC;YAAA,IAAI,CAAC,OAAO,GAAC,IAAI,CAAC;YAAA,IAAI,CAAC,IAAI,GAAC,IAAI,CAAC;YAAA,IAAI,CAAC,aAAa,GAAC,KAAK,CAAC;YACrG,IAAI,CAAC,OAAO,GAAC,EAAC,KAAK,EAAC,IAAI,CAAC,OAAO,IAAE,CAAC,IAAI,CAAC,OAAO,CAAA,CAAC,CAAA,SAAS,CAAA,CAAC,CAAA,KAAK,EAAC,CAAC;YAAA,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;QAC9F,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAE,EAAE,GAAC,IAAI,CAAC,OAAO,GAAC,IAAI,CAAC,CAAA,IAAI,CAAC,aAAa,GAAC,IAAI,CAAC,CAAA,IAAI,CAAC,OAAO,GAAC,EAAC,KAAK,EAAC,QAAQ,EAAC,MAAM,EAAC,wBAAwB,EAAC,CAAC,CAAA,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;QACtJ,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
@@ -0,0 +1,73 @@
1
+ import { cpus, loadavg } from 'node:os';
2
+ import type { MemoryPressureSnapshot } from './memory-pressure.js';
3
+ import type { CpuReading, DiskReading, HostMonitoringProvider, MonitoringPlatform, MonitoringProbe } from './host-monitoring.js';
4
+ export declare const MONITOR_OUTPUT_BYTES: number;
5
+ /** Kernel mount metadata can exceed helper stdout; keep its read separately bounded. */
6
+ export declare const MONITOR_MOUNT_BYTES: number;
7
+ export declare const MONITOR_DEADLINE_MS = 2000;
8
+ export interface MonitorCommand {
9
+ result: Promise<string | null>;
10
+ stopped: Promise<void>;
11
+ kill(): void;
12
+ }
13
+ export type MonitorRunner = (file: string, args: string[], env?: Record<string, string>, cwd?: string) => MonitorCommand;
14
+ /** Native readers receive no account credentials, shell, project startup file or user PATH. */
15
+ export declare const runMonitorCommand: MonitorRunner;
16
+ /** Kernel inventories only; never reads a directory tree or an unbounded file. */
17
+ export declare function readMonitorKernelFile(path: string, limit?: number): Promise<string | null>;
18
+ export interface MonitorMount {
19
+ id: string;
20
+ path: string;
21
+ type: string;
22
+ local: boolean;
23
+ drive?: string;
24
+ }
25
+ export declare function parseMonitorMounts(text: string | null): MonitorMount[];
26
+ export declare function monitorMountFor(mounts: MonitorMount[], path: string): MonitorMount | null;
27
+ export declare function parseMonitorDf(text: string | null): {
28
+ totalBytes: number;
29
+ availableBytes: number;
30
+ usedPercent: number;
31
+ } | null;
32
+ /** Read only one known plist string key; duplicate/malformed identities are not evidence of a shared container. */
33
+ export declare function parseApfsContainer(text: string | null): string | null;
34
+ export declare class MonitorCpu {
35
+ private previous;
36
+ sample(rows: ReturnType<typeof cpus>, load: number[]): CpuReading;
37
+ }
38
+ export declare const WSL_BACKING_DRIVE_SCRIPT: string;
39
+ interface Options {
40
+ statePath: string;
41
+ memory: () => MemoryPressureSnapshot;
42
+ platform?: MonitoringPlatform;
43
+ run?: MonitorRunner;
44
+ readMounts?: () => Promise<string | null>;
45
+ now?: () => number;
46
+ monotonic?: () => number;
47
+ cpus?: typeof cpus;
48
+ load?: typeof loadavg;
49
+ /** Explicit mounted drive selection takes precedence over registration discovery. */
50
+ wslDrive?: string;
51
+ }
52
+ /** Constructed only by the enabled runtime. No extra memory sampler or history is owned here. */
53
+ export declare class NativeHostMonitoring implements HostMonitoringProvider {
54
+ private readonly options;
55
+ readonly platform: MonitoringPlatform;
56
+ private readonly run;
57
+ private readonly now;
58
+ private readonly monotonic;
59
+ private readonly cpu;
60
+ private commands;
61
+ private flight;
62
+ private closed;
63
+ private discoveryAt;
64
+ private mounts;
65
+ private backing;
66
+ private apfs;
67
+ private macMounts;
68
+ constructor(options: Options);
69
+ host(): ReturnType<HostMonitoringProvider['host']>;
70
+ disks(): MonitoringProbe<DiskReading>;
71
+ stop(): Promise<void>;
72
+ }
73
+ export {};