@phnx-labs/agents-cli 1.23.21 → 1.23.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +115 -0
- package/README.md +17 -0
- package/dist/bootstrap.js +5 -4
- package/dist/cli/command-registry.js +2 -0
- package/dist/commands/config.js +16 -0
- package/dist/commands/daemon.js +3 -3
- package/dist/commands/doctor.js +10 -19
- package/dist/commands/events.js +1 -14
- package/dist/commands/feed-watch.js +5 -2
- package/dist/commands/go.js +2 -2
- package/dist/commands/lead.d.ts +3 -0
- package/dist/commands/lead.js +280 -0
- package/dist/commands/projects.js +3 -2
- package/dist/commands/ps-roster.d.ts +2 -12
- package/dist/commands/ps-roster.js +5 -87
- package/dist/commands/ps.js +3 -1
- package/dist/commands/repo.js +12 -12
- package/dist/commands/resource-view.js +5 -5
- package/dist/commands/sessions-browser.js +2 -2
- package/dist/commands/sessions-watch.js +5 -2
- package/dist/commands/setup-secrets.d.ts +3 -4
- package/dist/commands/setup-secrets.js +15 -46
- package/dist/commands/setup-session-backup.js +1 -1
- package/dist/commands/ssh.d.ts +0 -4
- package/dist/commands/ssh.js +14 -81
- package/dist/commands/teams-picker.js +1 -12
- package/dist/commands/teams.js +1 -13
- package/dist/commands/view.d.ts +1 -40
- package/dist/commands/view.js +9 -330
- package/dist/commands/watchdog.js +4 -4
- package/dist/index.js +4 -0
- package/dist/lib/accounting/usage.d.ts +0 -1
- package/dist/lib/accounting/usage.js +1 -112
- package/dist/lib/accounts/add.js +1 -1
- package/dist/lib/accounts/migrate.js +1 -1
- package/dist/lib/auto-pull-worker.js +2 -16
- package/dist/lib/auto-pull.d.ts +1 -0
- package/dist/lib/auto-pull.js +27 -0
- package/dist/lib/browser-client.js +2 -11
- package/dist/lib/cloud/codex.js +3 -0
- package/dist/lib/commands.d.ts +0 -6
- package/dist/lib/commands.js +3 -116
- package/dist/lib/comms-render.d.ts +1 -7
- package/dist/lib/comms-render.js +0 -19
- package/dist/lib/computer-client.js +2 -11
- package/dist/lib/config-keys.d.ts +7 -3
- package/dist/lib/config-keys.js +15 -2
- package/dist/lib/crabbox/runtimes.d.ts +0 -14
- package/dist/lib/crabbox/runtimes.js +0 -80
- package/dist/lib/daemon/attention-notify-service.d.ts +53 -28
- package/dist/lib/daemon/attention-notify-service.js +232 -53
- package/dist/lib/daemon/daemon.js +1 -2
- package/dist/lib/daemon/feed-stream-service.js +2 -4
- package/dist/lib/device-config.d.ts +0 -5
- package/dist/lib/device-config.js +20 -27
- package/dist/lib/devices/doctor-findings.d.ts +2 -1
- package/dist/lib/devices/doctor-findings.js +12 -1
- package/dist/lib/devices/fleet.d.ts +6 -0
- package/dist/lib/devices/fleet.js +15 -0
- package/dist/lib/devices/harness-inventory.d.ts +9 -0
- package/dist/lib/devices/harness-inventory.js +66 -0
- package/dist/lib/exec.js +1 -3
- package/dist/lib/feed/attention.d.ts +16 -1
- package/dist/lib/feed/attention.js +63 -1
- package/dist/lib/feed/feed.d.ts +1 -1
- package/dist/lib/feed/feed.js +12 -2
- package/dist/lib/feed/hub.d.ts +9 -0
- package/dist/lib/feed/hub.js +27 -1
- package/dist/lib/feed/notify-schedule.d.ts +16 -0
- package/dist/lib/feed/notify-schedule.js +62 -0
- package/dist/lib/feed/ticket-priority.d.ts +4 -0
- package/dist/lib/feed/ticket-priority.js +30 -0
- package/dist/lib/feed/watch.d.ts +1 -0
- package/dist/lib/feed/watch.js +27 -3
- package/dist/lib/feed-ranking.d.ts +1 -0
- package/dist/lib/feed-ranking.js +3 -1
- package/dist/lib/format.d.ts +0 -2
- package/dist/lib/format.js +0 -8
- package/dist/lib/helper-versions.js +1 -1
- package/dist/lib/hooks/cache.d.ts +1 -0
- package/dist/lib/hooks/cache.js +12 -1
- package/dist/lib/installations/duplicate-prune.d.ts +37 -0
- package/dist/lib/installations/duplicate-prune.js +85 -0
- package/dist/lib/installations/inventory-json.d.ts +20 -0
- package/dist/lib/installations/inventory-json.js +252 -0
- package/dist/lib/installations/shims.d.ts +0 -18
- package/dist/lib/installations/shims.js +1 -257
- package/dist/lib/lead/brief.d.ts +49 -0
- package/dist/lib/lead/brief.js +173 -0
- package/dist/lib/lead/client.d.ts +21 -0
- package/dist/lib/lead/client.js +167 -0
- package/dist/lib/lead/confirm.d.ts +22 -0
- package/dist/lib/lead/confirm.js +73 -0
- package/dist/lib/lead/events.d.ts +106 -0
- package/dist/lib/lead/events.js +188 -0
- package/dist/lib/lead/harness.d.ts +29 -0
- package/dist/lib/lead/harness.js +107 -0
- package/dist/lib/lead/host.d.ts +132 -0
- package/dist/lib/lead/host.js +675 -0
- package/dist/lib/lead/paths.d.ts +22 -0
- package/dist/lib/lead/paths.js +69 -0
- package/dist/lib/lead/refs.d.ts +17 -0
- package/dist/lib/lead/refs.js +75 -0
- package/dist/lib/lead/roster.d.ts +26 -0
- package/dist/lib/lead/roster.js +121 -0
- package/dist/lib/lead/shapes.d.ts +23 -0
- package/dist/lib/lead/shapes.js +95 -0
- package/dist/lib/lead/store.d.ts +46 -0
- package/dist/lib/lead/store.js +77 -0
- package/dist/lib/lead/tools.d.ts +18 -0
- package/dist/lib/lead/tools.js +106 -0
- package/dist/lib/lead/visibility.d.ts +16 -0
- package/dist/lib/lead/visibility.js +77 -0
- package/dist/lib/mailbox.d.ts +0 -18
- package/dist/lib/mailbox.js +0 -170
- package/dist/lib/menubar/notify-desktop.d.ts +5 -0
- package/dist/lib/menubar/notify-desktop.js +24 -0
- package/dist/lib/models.js +1 -19
- package/dist/lib/permissions.d.ts +0 -6
- package/dist/lib/permissions.js +0 -140
- package/dist/lib/platform/process.d.ts +1 -0
- package/dist/lib/platform/process.js +5 -0
- package/dist/lib/probe.js +13 -1
- package/dist/lib/project-status.js +4 -3
- package/dist/lib/projects.d.ts +9 -0
- package/dist/lib/projects.js +61 -3
- package/dist/lib/scheduling/routines.d.ts +1 -13
- package/dist/lib/scheduling/routines.js +1 -37
- package/dist/lib/secrets-cli.d.ts +3 -3
- package/dist/lib/secrets-cli.js +1 -1
- package/dist/lib/secrets-client.d.ts +4 -37
- package/dist/lib/secrets-client.js +19 -265
- package/dist/lib/session/active.d.ts +18 -8
- package/dist/lib/session/active.js +94 -18
- package/dist/lib/session/db.d.ts +0 -16
- package/dist/lib/session/db.js +1 -134
- package/dist/lib/session/detached.d.ts +0 -1
- package/dist/lib/session/detached.js +0 -18
- package/dist/lib/session/pending-work.d.ts +21 -0
- package/dist/lib/session/pending-work.js +284 -0
- package/dist/lib/session/remote/remote-list.d.ts +0 -3
- package/dist/lib/session/remote/remote-list.js +1 -23
- package/dist/lib/session/remote/watch.d.ts +5 -0
- package/dist/lib/session/remote/watch.js +19 -2
- package/dist/lib/session/session-cache.d.ts +1 -1
- package/dist/lib/session/session-cache.js +12 -5
- package/dist/lib/session/sync/provision.js +1 -2
- package/dist/lib/smart-launch.js +7 -2
- package/dist/lib/snapshot.js +3 -4
- package/dist/lib/ssh-exec.d.ts +0 -40
- package/dist/lib/ssh-exec.js +0 -108
- package/dist/lib/ssh-tunnel.d.ts +0 -6
- package/dist/lib/ssh-tunnel.js +0 -42
- package/dist/lib/standalone-tools.js +12 -1
- package/dist/lib/startup/command-registry.js +1 -1
- package/dist/lib/startup/spellcheck.d.ts +0 -1
- package/dist/lib/startup/spellcheck.js +1 -20
- package/dist/lib/state.d.ts +0 -6
- package/dist/lib/state.js +1 -14
- package/dist/lib/teams/delivery.d.ts +1 -0
- package/dist/lib/teams/delivery.js +13 -0
- package/dist/lib/types.d.ts +0 -37
- package/dist/lib/types.js +0 -9
- package/dist/lib/watchdog/log.d.ts +1 -1
- package/dist/lib/watchdog/log.js +6 -4
- package/package.json +2 -1
- package/dist/lib/artifact-actions.d.ts +0 -7
- package/dist/lib/artifact-actions.js +0 -39
- package/dist/lib/session/sync/managed-config.d.ts +0 -3
- package/dist/lib/session/sync/managed-config.js +0 -3
- package/dist/lib/session/sync/worker-template.d.ts +0 -1
- package/dist/lib/session/sync/worker-template.js +0 -807
- package/dist/lib/storage/selection.d.ts +0 -8
- package/dist/lib/storage/selection.js +0 -10
- package/dist/lib/watchdog/index.d.ts +0 -3
- package/dist/lib/watchdog/index.js +0 -3
|
@@ -1,43 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Attention desktop banners
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* request the CLI could not verify is still pending), and route the answer back
|
|
12
|
-
* through `agents feed answer <key> --choice <id>`. The kind — and so the button
|
|
13
|
-
* set — is the reconciler's verdict from explicit harness evidence; an idle
|
|
14
|
-
* reminder never reaches here as a permission (PHNX-3999).
|
|
15
|
-
*
|
|
16
|
-
* Idempotency is a filesystem ledger, not memory: one sidecar file per notified
|
|
17
|
-
* key under `~/.agents/.history/feed/notified/`, so a daemon restart never
|
|
18
|
-
* re-posts a banner already sent — the ledger is the truth. It is pruned with
|
|
19
|
-
* the feed's 14-day retention rule.
|
|
20
|
-
*
|
|
21
|
-
* Reader-independent: unlike the session-state publisher this does NOT gate on a
|
|
22
|
-
* live `sessions watch` reader — an attention banner must fire whether or not
|
|
23
|
-
* anyone is watching the stream. `done` banners are deliberately NOT produced
|
|
24
|
-
* here; they ride the run process's own exit (`run-notify.ts`).
|
|
2
|
+
* Attention desktop banners (PHNX-4004, PHNX-4369). Each tick takes the open asks
|
|
3
|
+
* from the CLI-owned reconciler (feed/attention.ts) and drives each banner along
|
|
4
|
+
* its urgency level's schedule (`menubar.menu.notify*`): first banner, reminders
|
|
5
|
+
* (same identifier, so they replace it), withdraw on resolve, and withdraw ~10 s
|
|
6
|
+
* after posting when the level has no `stay` (macOS alert style is app-wide).
|
|
7
|
+
* `interactive.host` unset: this host's asks; this machine: every host's, from
|
|
8
|
+
* the shared fleet collector; another machine: none. The ledger under
|
|
9
|
+
* `feed/notified/` (`<key>`, `<key>#r<n>`) makes a restart re-send nothing.
|
|
10
|
+
* `done` banners ride the run process's exit (`run-notify.ts`), not this service.
|
|
25
11
|
*/
|
|
26
12
|
import * as fs from 'fs';
|
|
27
13
|
import * as path from 'path';
|
|
28
14
|
import { atomicWriteFile } from '../fs-atomic.js';
|
|
29
15
|
import { getFeedDir } from '../state.js';
|
|
30
|
-
import { machineId } from '../machine-id.js';
|
|
16
|
+
import { machineId, normalizeHost } from '../machine-id.js';
|
|
17
|
+
import { getConfigValue } from '../device-config.js';
|
|
31
18
|
import { getActiveSessions } from '../session/active.js';
|
|
19
|
+
import { mailboxIdForActiveSession } from '../mailbox-target.js';
|
|
20
|
+
import { gcMailbox } from '../mailbox-gc.js';
|
|
32
21
|
import { blockIdForSession, readBlock, readResolution } from '../feed/feed.js';
|
|
33
22
|
import { reconcileAttention, harnessOf } from '../feed/attention.js';
|
|
34
|
-
import {
|
|
23
|
+
import { cachedTicketPriority } from '../feed/ticket-priority.js';
|
|
24
|
+
import { sharedFleetFeedHub } from '../feed/watch.js';
|
|
25
|
+
import { DEFAULT_NOTIFY_SCHEDULES, NOTIFY_LEVELS, NOTIFY_LEVEL_KEYS, formatWaited, parseNotifySchedule, } from '../feed/notify-schedule.js';
|
|
26
|
+
import { notifyDesktop, withdrawDesktop } from '../menubar/notify-desktop.js';
|
|
35
27
|
import { BasePeriodicService } from './service.js';
|
|
36
28
|
import { span, spanSync } from './diagnostics.js';
|
|
37
29
|
const ATTENTION_NOTIFY_TICK_MS = 5_000;
|
|
38
30
|
const ATTENTION_NOTIFY_DEADLINE_MS = 10_000;
|
|
39
31
|
const LEDGER_RETENTION_MS = 14 * 24 * 60 * 60 * 1000;
|
|
40
|
-
const
|
|
32
|
+
const HOURLY_MS = 60 * 60 * 1000;
|
|
33
|
+
const SETTINGS_TTL_MS = 30_000;
|
|
34
|
+
export const BANNER_HIDE_AFTER_MS = 10_000;
|
|
41
35
|
const MAX_CHOICES = 6;
|
|
42
36
|
const BODY_MAX = 200;
|
|
43
37
|
const BANNER_KINDS = {
|
|
@@ -79,32 +73,152 @@ export function buildAttentionNotification(item, session) {
|
|
|
79
73
|
n.choices = choices;
|
|
80
74
|
return n;
|
|
81
75
|
}
|
|
76
|
+
export function notifyScope(interactiveHost, self) {
|
|
77
|
+
if (!interactiveHost?.trim())
|
|
78
|
+
return 'local';
|
|
79
|
+
return normalizeHost(interactiveHost) === normalizeHost(self) ? 'fleet' : 'none';
|
|
80
|
+
}
|
|
81
|
+
export function readAttentionNotifySettings() {
|
|
82
|
+
const schedules = {};
|
|
83
|
+
for (const level of NOTIFY_LEVELS) {
|
|
84
|
+
const stored = getConfigValue(NOTIFY_LEVEL_KEYS[level]).value;
|
|
85
|
+
const parsed = parseNotifySchedule(Array.isArray(stored) ? stored.map(String) : DEFAULT_NOTIFY_SCHEDULES[level]);
|
|
86
|
+
// A hand-edited agents.yaml can hold what `config set` refuses; the level then keeps its default.
|
|
87
|
+
schedules[level] = typeof parsed === 'string' ? parseNotifySchedule(DEFAULT_NOTIFY_SCHEDULES[level]) : parsed;
|
|
88
|
+
}
|
|
89
|
+
const host = getConfigValue('interactive.host').value;
|
|
90
|
+
return { interactiveHost: typeof host === 'string' ? host : undefined, schedules };
|
|
91
|
+
}
|
|
92
|
+
export function dueStage(schedule, openedMs, nowMs) {
|
|
93
|
+
if (schedule.sidebar)
|
|
94
|
+
return -1;
|
|
95
|
+
let stage = -1;
|
|
96
|
+
schedule.atMs.forEach((at, i) => { if (openedMs + at <= nowMs)
|
|
97
|
+
stage = i; });
|
|
98
|
+
return stage;
|
|
99
|
+
}
|
|
82
100
|
export class AttentionNotifyService extends BasePeriodicService {
|
|
83
101
|
id = 'attention-notify';
|
|
84
102
|
intervalMs = ATTENTION_NOTIFY_TICK_MS;
|
|
85
103
|
deadlineMs = ATTENTION_NOTIFY_DEADLINE_MS;
|
|
86
104
|
getSessions;
|
|
87
105
|
notify;
|
|
106
|
+
withdraw;
|
|
107
|
+
fleetHubOf;
|
|
108
|
+
readSettings;
|
|
109
|
+
self;
|
|
110
|
+
gc;
|
|
88
111
|
feedRoot;
|
|
89
112
|
ledgerDir;
|
|
90
113
|
now;
|
|
91
|
-
|
|
114
|
+
lastHourlyMs = 0;
|
|
115
|
+
gcScan = null;
|
|
116
|
+
settingsCache;
|
|
117
|
+
banners = null;
|
|
118
|
+
fleetHub = null;
|
|
119
|
+
detachFleet = null;
|
|
92
120
|
constructor(opts = {}) {
|
|
93
121
|
super();
|
|
94
122
|
this.getSessions = opts.getSessions ?? (() => getActiveSessions());
|
|
95
123
|
this.notify = opts.notify ?? notifyDesktop;
|
|
124
|
+
this.withdraw = opts.withdraw ?? withdrawDesktop;
|
|
125
|
+
this.fleetHubOf = opts.fleetHub ?? sharedFleetFeedHub;
|
|
126
|
+
this.readSettings = opts.settings ?? readAttentionNotifySettings;
|
|
127
|
+
this.self = opts.self ?? machineId;
|
|
96
128
|
this.feedRoot = opts.feedRoot;
|
|
129
|
+
this.gc = opts.gc ?? ((ids) => { gcMailbox(ids, { feedRoot: this.feedRoot }); });
|
|
97
130
|
this.ledgerDir = opts.ledgerDir ?? path.join(opts.feedRoot ?? getFeedDir(), 'notified');
|
|
98
131
|
this.now = opts.now ?? Date.now;
|
|
99
132
|
}
|
|
100
133
|
async onStart(_ctx) {
|
|
134
|
+
this.lastHourlyMs = this.now();
|
|
101
135
|
}
|
|
102
136
|
async onStop() {
|
|
137
|
+
this.releaseFleet();
|
|
103
138
|
}
|
|
104
139
|
async onTick(ctx) {
|
|
105
|
-
const
|
|
106
|
-
const
|
|
140
|
+
const nowMs = this.now();
|
|
141
|
+
const settings = this.settings(nowMs);
|
|
142
|
+
const scope = notifyScope(settings.interactiveHost, this.self());
|
|
143
|
+
if (scope !== 'fleet')
|
|
144
|
+
this.releaseFleet();
|
|
145
|
+
const local = scope === 'local' ? await this.localAsks(nowMs) : undefined;
|
|
146
|
+
const { asks, scopes } = local
|
|
147
|
+
? { asks: local.asks, scopes: null }
|
|
148
|
+
: scope === 'fleet'
|
|
149
|
+
? this.fleetAsks()
|
|
150
|
+
: { asks: [], scopes: null };
|
|
151
|
+
const banners = await this.loadBanners();
|
|
152
|
+
const toWithdraw = [];
|
|
153
|
+
const seen = new Set();
|
|
107
154
|
let posted = 0;
|
|
155
|
+
for (const { item, session } of asks) {
|
|
156
|
+
if (!BANNER_KINDS[item.kind])
|
|
157
|
+
continue;
|
|
158
|
+
seen.add(item.key);
|
|
159
|
+
const level = item.urgency ?? 'normal';
|
|
160
|
+
const schedule = settings.schedules[level];
|
|
161
|
+
if (schedule.sidebar)
|
|
162
|
+
continue;
|
|
163
|
+
const opened = Date.parse(item.openedAt);
|
|
164
|
+
const openedMs = Number.isFinite(opened) ? opened : nowMs;
|
|
165
|
+
const stage = dueStage(schedule, openedMs, nowMs);
|
|
166
|
+
if (stage < 0 || await this.stageSent(item.key, stage, banners))
|
|
167
|
+
continue;
|
|
168
|
+
const notification = buildAttentionNotification(item, session);
|
|
169
|
+
if (!notification)
|
|
170
|
+
continue;
|
|
171
|
+
notification.level = level;
|
|
172
|
+
if (schedule.sound)
|
|
173
|
+
notification.sound = true;
|
|
174
|
+
if (stage > 0) {
|
|
175
|
+
notification.reminder = stage;
|
|
176
|
+
notification.subtitle = [notification.subtitle, `Still waiting · ${formatWaited(nowMs - openedMs)}`].filter(Boolean).join(' · ');
|
|
177
|
+
}
|
|
178
|
+
this.notify(notification);
|
|
179
|
+
await this.recordStage(banners, {
|
|
180
|
+
key: item.key,
|
|
181
|
+
postedAt: new Date(nowMs).toISOString(),
|
|
182
|
+
level,
|
|
183
|
+
stage,
|
|
184
|
+
bannerUp: true,
|
|
185
|
+
...(schedule.stay ? {} : { hideAt: nowMs + BANNER_HIDE_AFTER_MS }),
|
|
186
|
+
});
|
|
187
|
+
posted += 1;
|
|
188
|
+
ctx.log('INFO', `attention-notify: posted ${level} ${item.kind} banner for ${item.key}${stage ? ` (reminder ${stage})` : ''}`, { event: 'attention.posted', kind: item.kind, key: item.key, level, reminder: stage });
|
|
189
|
+
}
|
|
190
|
+
for (const state of banners.values()) {
|
|
191
|
+
const resolved = !seen.has(state.key) && (scopes === null || scopes.has(state.key.split('/')[0]));
|
|
192
|
+
if (resolved) {
|
|
193
|
+
if (state.bannerUp)
|
|
194
|
+
toWithdraw.push(state.key);
|
|
195
|
+
banners.delete(state.key);
|
|
196
|
+
await this.writeState({ ...state, bannerUp: false, resolvedAt: new Date(nowMs).toISOString() });
|
|
197
|
+
}
|
|
198
|
+
else if (state.bannerUp && state.hideAt !== undefined && nowMs >= state.hideAt) {
|
|
199
|
+
toWithdraw.push(state.key);
|
|
200
|
+
state.bannerUp = false;
|
|
201
|
+
delete state.hideAt;
|
|
202
|
+
await this.writeState(state);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (toWithdraw.length) {
|
|
206
|
+
this.withdraw(toWithdraw);
|
|
207
|
+
ctx.log('INFO', `attention-notify: withdrew ${toWithdraw.length} banner(s)`, { event: 'attention.withdrawn', keys: toWithdraw });
|
|
208
|
+
}
|
|
209
|
+
await this.hourly(ctx, nowMs, local?.sessions);
|
|
210
|
+
ctx.log('DEBUG', `attention-notify: ${asks.length} ask(s) in ${scope} scope, ${posted} banner(s) posted`, { event: 'attention.tick', scope, asks: asks.length, posted });
|
|
211
|
+
}
|
|
212
|
+
settings(nowMs) {
|
|
213
|
+
if (!this.settingsCache || nowMs - this.settingsCache.at >= SETTINGS_TTL_MS || nowMs < this.settingsCache.at) {
|
|
214
|
+
this.settingsCache = { at: nowMs, value: this.readSettings() };
|
|
215
|
+
}
|
|
216
|
+
return this.settingsCache.value;
|
|
217
|
+
}
|
|
218
|
+
async localAsks(nowMs) {
|
|
219
|
+
const sessions = await span('attention.sessions', () => this.getSessions(), () => ({}));
|
|
220
|
+
const host = normalizeHost(this.self());
|
|
221
|
+
const asks = [];
|
|
108
222
|
for (const session of sessions) {
|
|
109
223
|
if (!session.sessionId)
|
|
110
224
|
continue;
|
|
@@ -114,44 +228,109 @@ export class AttentionNotifyService extends BasePeriodicService {
|
|
|
114
228
|
block: readBlock(blockId, this.feedRoot),
|
|
115
229
|
session: projected,
|
|
116
230
|
resolution: readResolution(blockId, this.feedRoot),
|
|
117
|
-
|
|
231
|
+
ticketPriority: (ticketId) => cachedTicketPriority(ticketId, nowMs),
|
|
232
|
+
nowMs,
|
|
118
233
|
}));
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
if (await this.hasNotified(item.key))
|
|
122
|
-
continue;
|
|
123
|
-
const notification = buildAttentionNotification(item, projected);
|
|
124
|
-
if (!notification)
|
|
125
|
-
continue;
|
|
126
|
-
this.notify(notification);
|
|
127
|
-
await this.markNotified(item.key);
|
|
128
|
-
posted += 1;
|
|
129
|
-
ctx.log('INFO', `attention-notify: posted ${item.kind} banner for ${item.key}`, { event: 'attention.posted', kind: item.kind, key: item.key });
|
|
234
|
+
if (item)
|
|
235
|
+
asks.push({ item, session: projected });
|
|
130
236
|
}
|
|
131
|
-
|
|
132
|
-
ctx.log('DEBUG', `attention-notify: ${sessions.length} session(s) reconciled, ${posted} banner(s) posted`, { event: 'attention.tick', sessions: sessions.length, posted });
|
|
237
|
+
return { asks, sessions };
|
|
133
238
|
}
|
|
134
|
-
|
|
135
|
-
|
|
239
|
+
fleetAsks() {
|
|
240
|
+
const hub = this.fleetHubOf();
|
|
241
|
+
// The feed-stream service closes the shared hub when it stops; re-attach rather than read a dead stream.
|
|
242
|
+
if (this.fleetHub !== hub || !this.detachFleet || !hub.active) {
|
|
243
|
+
this.releaseFleet();
|
|
244
|
+
this.fleetHub = hub;
|
|
245
|
+
this.detachFleet = hub.subscribe(() => { });
|
|
246
|
+
}
|
|
247
|
+
const asks = hub.state.attention().map(({ item, agent }) => ({
|
|
248
|
+
item: item.urgency ? item : { ...item, urgency: 'normal' },
|
|
249
|
+
session: agent ?? {},
|
|
250
|
+
}));
|
|
251
|
+
return { asks, scopes: hub.state.reportingScopes };
|
|
252
|
+
}
|
|
253
|
+
releaseFleet() {
|
|
254
|
+
this.detachFleet?.();
|
|
255
|
+
this.detachFleet = null;
|
|
256
|
+
this.fleetHub = null;
|
|
257
|
+
}
|
|
258
|
+
ledgerPath(key, stage = 0) {
|
|
259
|
+
return path.join(this.ledgerDir, encodeURIComponent(stage ? `${key}#r${stage}` : key));
|
|
260
|
+
}
|
|
261
|
+
async loadBanners() {
|
|
262
|
+
if (this.banners)
|
|
263
|
+
return this.banners;
|
|
264
|
+
const banners = new Map();
|
|
265
|
+
let names = [];
|
|
266
|
+
try {
|
|
267
|
+
names = await fs.promises.readdir(this.ledgerDir);
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
}
|
|
271
|
+
for (const name of names) {
|
|
272
|
+
if (name.includes('%23r'))
|
|
273
|
+
continue;
|
|
274
|
+
try {
|
|
275
|
+
const state = JSON.parse(await fs.promises.readFile(path.join(this.ledgerDir, name), 'utf-8'));
|
|
276
|
+
if (state.key && state.level && typeof state.stage === 'number' && !state.resolvedAt)
|
|
277
|
+
banners.set(state.key, state);
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
this.banners = banners;
|
|
283
|
+
return banners;
|
|
136
284
|
}
|
|
137
|
-
async
|
|
285
|
+
async stageSent(key, stage, banners) {
|
|
286
|
+
const known = banners.get(key);
|
|
287
|
+
if (known && known.stage >= stage)
|
|
288
|
+
return true;
|
|
138
289
|
try {
|
|
139
|
-
await fs.promises.stat(this.ledgerPath(key));
|
|
290
|
+
await fs.promises.stat(this.ledgerPath(key, stage));
|
|
140
291
|
return true;
|
|
141
292
|
}
|
|
142
293
|
catch {
|
|
143
294
|
return false;
|
|
144
295
|
}
|
|
145
296
|
}
|
|
146
|
-
async
|
|
297
|
+
async recordStage(banners, state) {
|
|
298
|
+
banners.set(state.key, state);
|
|
299
|
+
await this.writeState(state);
|
|
300
|
+
for (let reminder = 1; reminder <= state.stage; reminder += 1) {
|
|
301
|
+
await atomicWriteFile(this.ledgerPath(state.key, reminder), JSON.stringify({ key: state.key, reminder, postedAt: state.postedAt }), 'utf-8');
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
async writeState(state) {
|
|
147
305
|
await fs.promises.mkdir(this.ledgerDir, { recursive: true });
|
|
148
|
-
await atomicWriteFile(this.ledgerPath(key), JSON.stringify(
|
|
306
|
+
await atomicWriteFile(this.ledgerPath(state.key), JSON.stringify(state), 'utf-8');
|
|
149
307
|
}
|
|
150
|
-
async
|
|
151
|
-
|
|
152
|
-
|
|
308
|
+
async hourly(ctx, nowMs, fetched) {
|
|
309
|
+
if (nowMs - this.lastHourlyMs < HOURLY_MS)
|
|
310
|
+
return;
|
|
311
|
+
this.lastHourlyMs = nowMs;
|
|
312
|
+
await this.pruneLedger(nowMs);
|
|
313
|
+
if (fetched) {
|
|
314
|
+
this.sweep(ctx, fetched);
|
|
153
315
|
return;
|
|
154
|
-
|
|
316
|
+
}
|
|
317
|
+
if (this.gcScan)
|
|
318
|
+
return;
|
|
319
|
+
this.gcScan = this.getSessions()
|
|
320
|
+
.then((sessions) => this.sweep(ctx, sessions))
|
|
321
|
+
.catch((err) => ctx.log('WARN', `attention-notify: mailbox gc skipped: ${err.message}`, { event: 'attention.gc.failed' }))
|
|
322
|
+
.finally(() => { this.gcScan = null; });
|
|
323
|
+
}
|
|
324
|
+
sweep(ctx, sessions) {
|
|
325
|
+
try {
|
|
326
|
+
const active = new Set(sessions.map(mailboxIdForActiveSession).filter((id) => !!id));
|
|
327
|
+
spanSync('attention.gc', () => this.gc(active));
|
|
328
|
+
}
|
|
329
|
+
catch (err) {
|
|
330
|
+
ctx.log('WARN', `attention-notify: mailbox gc skipped: ${err.message}`, { event: 'attention.gc.failed' });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
async pruneLedger(nowMs) {
|
|
155
334
|
let names;
|
|
156
335
|
try {
|
|
157
336
|
names = await fs.promises.readdir(this.ledgerDir);
|
|
@@ -1259,8 +1259,7 @@ function waitForPid(timeoutMs) {
|
|
|
1259
1259
|
const pid = readDaemonPid();
|
|
1260
1260
|
if (pid)
|
|
1261
1261
|
return pid;
|
|
1262
|
-
|
|
1263
|
-
while (Date.now() < waitUntil) { }
|
|
1262
|
+
sleepSync(200);
|
|
1264
1263
|
}
|
|
1265
1264
|
return readDaemonPid();
|
|
1266
1265
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { BaseDaemonService } from './service.js';
|
|
2
|
-
import { FeedHub } from '../feed/hub.js';
|
|
3
2
|
import { FeedHubServer } from '../feed/hub-server.js';
|
|
4
|
-
import {
|
|
3
|
+
import { sharedFleetFeedHub, sharedLocalFeedHub } from '../feed/watch.js';
|
|
5
4
|
export class FeedStreamService extends BaseDaemonService {
|
|
6
5
|
id = 'feed-stream';
|
|
7
6
|
server = null;
|
|
8
7
|
async onStart(ctx) {
|
|
9
|
-
|
|
10
|
-
this.server = new FeedHubServer(fleet, undefined, sharedLocalFeedHub());
|
|
8
|
+
this.server = new FeedHubServer(sharedFleetFeedHub(), undefined, sharedLocalFeedHub());
|
|
11
9
|
await this.server.start();
|
|
12
10
|
ctx.log('INFO', 'Feed stream hub listening (fan-out starts on first reader)');
|
|
13
11
|
}
|
|
@@ -50,10 +50,6 @@ export declare function configuredDeviceRole(name: string): ConfiguredDeviceRole
|
|
|
50
50
|
export declare function selfConfiguredDeviceRole(): ConfiguredDeviceRole | undefined;
|
|
51
51
|
export declare function isHeadedDeviceRole(role: ConfiguredDeviceRole | undefined): boolean;
|
|
52
52
|
export declare function setConfiguredDeviceRole(name: string, role: ConfiguredDeviceRole | undefined): void;
|
|
53
|
-
export declare function devicesPinningBrowserProfile(profile: string): Array<{
|
|
54
|
-
device: string;
|
|
55
|
-
key: 'browser.profile' | 'browser.viewer';
|
|
56
|
-
}>;
|
|
57
53
|
export declare function listConfiguredDeviceRoles(roster?: string[]): Record<string, ConfiguredDeviceRole>;
|
|
58
54
|
export declare function autoPoolMode(): AutoPoolMode;
|
|
59
55
|
export interface AutoLaunchPreference {
|
|
@@ -70,6 +66,5 @@ export declare function assertSchedulerEnabled(): void;
|
|
|
70
66
|
export declare function isTmuxEnabled(): boolean;
|
|
71
67
|
export declare function isDaemonEnabled(): boolean;
|
|
72
68
|
export declare function assertDaemonEnabled(): void;
|
|
73
|
-
export declare function resolveBrowserTaskIdleMs(): Promise<number | null>;
|
|
74
69
|
export declare function readMaxConcurrentCaps(devices: string[]): Record<string, number>;
|
|
75
70
|
export {};
|
|
@@ -8,6 +8,7 @@ import { machineId } from './machine-id.js';
|
|
|
8
8
|
import { assertValidDeviceName, assertRegistrableDeviceName } from './devices/registry.js';
|
|
9
9
|
import { migrateDeviceConfigStores } from './devices/config-migration.js';
|
|
10
10
|
import { isAgentId } from './types.js';
|
|
11
|
+
import { DEFAULT_NOTIFY_SCHEDULES, NOTIFY_LEVELS, NOTIFY_LEVEL_KEYS, notifyScheduleDescription, validateNotifySchedule } from './feed/notify-schedule.js';
|
|
11
12
|
const DEVICE_PLATFORMS = ['windows', 'linux', 'macos', 'unknown'];
|
|
12
13
|
const SSH_AUTH_METHODS = ['key', 'password'];
|
|
13
14
|
const DEVICE_ROLES = ['worker', 'personal', 'desktop'];
|
|
@@ -86,6 +87,16 @@ export const CONFIG_KEYS = [
|
|
|
86
87
|
type: 'string',
|
|
87
88
|
description: 'Model the summarizer requests from summarizer.baseUrl, e.g. qwen2.5:3b. Overridden per-process by AGENTS_SUMMARIZER_MODEL.',
|
|
88
89
|
},
|
|
90
|
+
{
|
|
91
|
+
name: 'lead.model',
|
|
92
|
+
yamlKey: 'leadModel',
|
|
93
|
+
scope: 'user',
|
|
94
|
+
type: 'string',
|
|
95
|
+
defaultValue: 'sonnet',
|
|
96
|
+
description: 'Model the per-project Lead (`agents lead ask`) runs on, passed to `agents run claude --model`. A tier ' +
|
|
97
|
+
'(cheap|default|best|ultra) or a model id. Read when a Lead session starts; a running Lead keeps its model ' +
|
|
98
|
+
'until `agents lead stop` or the next context rotation.',
|
|
99
|
+
},
|
|
89
100
|
{
|
|
90
101
|
name: 'updates.auto',
|
|
91
102
|
yamlKey: 'updatesAuto',
|
|
@@ -611,6 +622,15 @@ export const CONFIG_KEYS = [
|
|
|
611
622
|
return null;
|
|
612
623
|
},
|
|
613
624
|
},
|
|
625
|
+
...NOTIFY_LEVELS.map((level) => ({
|
|
626
|
+
name: NOTIFY_LEVEL_KEYS[level],
|
|
627
|
+
yamlKey: `menubarMenuNotify${level[0].toUpperCase()}${level.slice(1)}`,
|
|
628
|
+
scope: 'user',
|
|
629
|
+
type: 'string-list',
|
|
630
|
+
defaultValue: [...DEFAULT_NOTIFY_SCHEDULES[level]],
|
|
631
|
+
description: notifyScheduleDescription(level),
|
|
632
|
+
validate: validateNotifySchedule(NOTIFY_LEVEL_KEYS[level]),
|
|
633
|
+
})),
|
|
614
634
|
{
|
|
615
635
|
name: 'menubar.menu.githubHidden',
|
|
616
636
|
yamlKey: 'menubarMenuGithubHidden',
|
|
@@ -1090,29 +1110,6 @@ export function setConfiguredDeviceRole(name, role) {
|
|
|
1090
1110
|
else
|
|
1091
1111
|
setConfigValue('role', role, { device: name });
|
|
1092
1112
|
}
|
|
1093
|
-
export function devicesPinningBrowserProfile(profile) {
|
|
1094
|
-
ensureDeviceConfigMigrated();
|
|
1095
|
-
const hits = [];
|
|
1096
|
-
const devicesRoot = path.join(getUserAgentsDir(), 'devices');
|
|
1097
|
-
let names = [];
|
|
1098
|
-
try {
|
|
1099
|
-
names = fs
|
|
1100
|
-
.readdirSync(devicesRoot, { withFileTypes: true })
|
|
1101
|
-
.filter((e) => e.isDirectory())
|
|
1102
|
-
.map((e) => e.name);
|
|
1103
|
-
}
|
|
1104
|
-
catch {
|
|
1105
|
-
return hits;
|
|
1106
|
-
}
|
|
1107
|
-
for (const name of names.sort()) {
|
|
1108
|
-
const cfg = readDeviceDocConfig(name);
|
|
1109
|
-
if (cfg.defaultBrowserProfile === profile)
|
|
1110
|
-
hits.push({ device: name, key: 'browser.profile' });
|
|
1111
|
-
if (cfg.browserViewer === profile)
|
|
1112
|
-
hits.push({ device: name, key: 'browser.viewer' });
|
|
1113
|
-
}
|
|
1114
|
-
return hits;
|
|
1115
|
-
}
|
|
1116
1113
|
export function listConfiguredDeviceRoles(roster) {
|
|
1117
1114
|
ensureDeviceConfigMigrated();
|
|
1118
1115
|
const out = {};
|
|
@@ -1212,10 +1209,6 @@ export function assertDaemonEnabled() {
|
|
|
1212
1209
|
throw new Error(`The daemon is disabled on this device (daemon.enabled=false in ~/.agents/devices/${machineId()}/agents.yaml). ` +
|
|
1213
1210
|
`Re-enable with: agents daemon enable`);
|
|
1214
1211
|
}
|
|
1215
|
-
export async function resolveBrowserTaskIdleMs() {
|
|
1216
|
-
const minutes = (await getConfigValueAsync('browser.task-idle-minutes')).value ?? 30;
|
|
1217
|
-
return minutes === 0 ? null : minutes * 60_000;
|
|
1218
|
-
}
|
|
1219
1212
|
export function readMaxConcurrentCaps(devices) {
|
|
1220
1213
|
const caps = {};
|
|
1221
1214
|
for (const device of devices) {
|
|
@@ -10,7 +10,7 @@ import type { FetchStatusMarker } from '../auto-pull.js';
|
|
|
10
10
|
import { type VersionResourceReport } from '../doctor-diff.js';
|
|
11
11
|
import type { FleetDivergence, FleetHookRuntimeState, FleetVersionSignIn } from './fleet-divergence.js';
|
|
12
12
|
export type FindingSeverity = 'critical' | 'warning';
|
|
13
|
-
export declare const ALL_FINDING_KINDS: readonly ["logged-out", "logout-unprovable", "missing-hook", "missing-plugin", "unwired-hook", "hook-runtime-broken", "hook-runtime-visibility-unavailable", "cli-missing", "missing-resource", "content-drift", "never-synced", "stale", "repo-behind", "repo-drift", "fleet-resource-gap", "host-cli-missing", "host-cli-invalid", "version-skew", "orphan", "duplicate-hook", "duplicate-hook-drift", "rc-secret-export", "env-secret-export", "auth-bundle-wrong-backend", "exec-policy", "ssh-key-enrollment", "stale-cli", "binary-shadow", "owner-not-signed-in", "leaked-daemon", "menubar"];
|
|
13
|
+
export declare const ALL_FINDING_KINDS: readonly ["logged-out", "logout-unprovable", "missing-hook", "missing-plugin", "unwired-hook", "hook-runtime-broken", "hook-runtime-visibility-unavailable", "cli-missing", "missing-resource", "content-drift", "never-synced", "stale", "repo-behind", "repo-drift", "fleet-resource-gap", "host-cli-missing", "host-cli-invalid", "version-skew", "orphan", "duplicate-hook", "duplicate-hook-drift", "rc-secret-export", "env-secret-export", "auth-bundle-wrong-backend", "secrets-engine-incompatible", "exec-policy", "ssh-key-enrollment", "stale-cli", "binary-shadow", "owner-not-signed-in", "leaked-daemon", "menubar"];
|
|
14
14
|
export declare const FINDING_SEVERITY: Record<FindingKind, FindingSeverity>;
|
|
15
15
|
export type FindingKind = typeof ALL_FINDING_KINDS[number];
|
|
16
16
|
export interface DoctorFinding {
|
|
@@ -47,6 +47,7 @@ export interface LocalFindingInputs {
|
|
|
47
47
|
rcSecrets?: RcSecretFinding[];
|
|
48
48
|
masterPassphraseInEnv?: boolean;
|
|
49
49
|
authBundleWrongBackend?: boolean;
|
|
50
|
+
secretsEngineIncompatible?: boolean;
|
|
50
51
|
execPolicy?: {
|
|
51
52
|
platform: NodeJS.Platform;
|
|
52
53
|
policy: string | null;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* CRITICAL — logged-out (provable) · missing-hook · missing-plugin ·
|
|
20
20
|
* unwired-hook (a hook on disk that settings.json never fires) ·
|
|
21
21
|
* hook-runtime-broken (a wired hook's generated shim wrapper is
|
|
22
|
-
* missing or unusable) · cli-missing · ssh-key-enrollment ·
|
|
22
|
+
* missing or unusable) · cli-missing · ssh-key-enrollment · secrets-engine-incompatible ·
|
|
23
23
|
* owner-not-signed-in (no Phoenix session or worker device
|
|
24
24
|
* token, so this box cannot reach the owner).
|
|
25
25
|
* WARNING — logout-unprovable (hedged) · missing-resource · content-drift ·
|
|
@@ -93,6 +93,7 @@ export const ALL_FINDING_KINDS = [
|
|
|
93
93
|
'rc-secret-export',
|
|
94
94
|
'env-secret-export',
|
|
95
95
|
'auth-bundle-wrong-backend',
|
|
96
|
+
'secrets-engine-incompatible',
|
|
96
97
|
'exec-policy',
|
|
97
98
|
'ssh-key-enrollment',
|
|
98
99
|
'stale-cli',
|
|
@@ -109,6 +110,7 @@ export const FINDING_SEVERITY = {
|
|
|
109
110
|
'hook-runtime-broken': 'critical',
|
|
110
111
|
'cli-missing': 'critical',
|
|
111
112
|
'owner-not-signed-in': 'critical',
|
|
113
|
+
'secrets-engine-incompatible': 'critical',
|
|
112
114
|
'logout-unprovable': 'warning',
|
|
113
115
|
'hook-runtime-visibility-unavailable': 'warning',
|
|
114
116
|
'missing-resource': 'warning',
|
|
@@ -208,6 +210,8 @@ export function remediationFor(finding) {
|
|
|
208
210
|
return 'unset at the source, then restart every process that inherited it (shells, editor, tmux, agents daemon)';
|
|
209
211
|
case 'auth-bundle-wrong-backend':
|
|
210
212
|
return 'secrets delete auth --yes && secrets create auth --backend file';
|
|
213
|
+
case 'secrets-engine-incompatible':
|
|
214
|
+
return 'agents setup tools --tool secrets';
|
|
211
215
|
case 'exec-policy':
|
|
212
216
|
return 'Set-ExecutionPolicy -Scope CurrentUser RemoteSigned';
|
|
213
217
|
case 'ssh-key-enrollment':
|
|
@@ -390,6 +394,13 @@ export function buildLocalFindings(input) {
|
|
|
390
394
|
const authFinding = authBundleWrongBackendFinding(device, input.authBundleWrongBackend ?? false);
|
|
391
395
|
if (authFinding)
|
|
392
396
|
out.push(authFinding);
|
|
397
|
+
if (input.secretsEngineIncompatible) {
|
|
398
|
+
out.push(finding({
|
|
399
|
+
severity: FINDING_SEVERITY['secrets-engine-incompatible'], kind: 'secrets-engine-incompatible', device,
|
|
400
|
+
message: 'the `secrets` engine on PATH (or SECRETS_BIN) predates the 0.4.0 contract this agents-cli needs, '
|
|
401
|
+
+ 'so every secrets read fails with ENGINE_INCOMPATIBLE',
|
|
402
|
+
}));
|
|
403
|
+
}
|
|
393
404
|
const policyFinding = execPolicyFinding(device, input.execPolicy);
|
|
394
405
|
if (policyFinding)
|
|
395
406
|
out.push(policyFinding);
|
|
@@ -48,8 +48,14 @@ interface RunFleetOptions {
|
|
|
48
48
|
localRunner?: typeof runLocalCommand;
|
|
49
49
|
}
|
|
50
50
|
export declare function runFleet(targets: FleetTarget[], cmd: string[], opts?: RunFleetOptions): FleetRunResult[];
|
|
51
|
+
export interface FleetStatusTarget extends FanOutDeviceTarget {
|
|
52
|
+
platform?: string;
|
|
53
|
+
dialTarget: string;
|
|
54
|
+
extraSshArgs?: string[];
|
|
55
|
+
}
|
|
51
56
|
interface FanOutDeviceOptions {
|
|
52
57
|
perDeviceTimeoutMs?: number;
|
|
53
58
|
}
|
|
54
59
|
export declare function fanOutDevices<T, Target extends FanOutDeviceTarget = FanOutDeviceTarget>(targets: Target[], probe: (target: Target) => Promise<T>, opts?: FanOutDeviceOptions): Promise<FanOutDeviceResult<T>[]>;
|
|
60
|
+
export declare function raceFleetPingDeadline<T, Target extends FanOutDeviceTarget>(fanOut: Promise<FanOutDeviceResult<T>[]>, remoteTargets: Target[], overallTimeoutMs: number): Promise<FanOutDeviceResult<T>[]>;
|
|
55
61
|
export {};
|
|
@@ -159,3 +159,18 @@ export async function fanOutDevices(targets, probe, opts = {}) {
|
|
|
159
159
|
}
|
|
160
160
|
}));
|
|
161
161
|
}
|
|
162
|
+
export async function raceFleetPingDeadline(fanOut, remoteTargets, overallTimeoutMs) {
|
|
163
|
+
const overallDeadline = new Promise((_, reject) => setTimeout(() => reject(new Error('fleet ping overall deadline exceeded')), overallTimeoutMs));
|
|
164
|
+
try {
|
|
165
|
+
return await Promise.race([fanOut, overallDeadline]);
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
169
|
+
return remoteTargets.map((t) => ({
|
|
170
|
+
name: t.name,
|
|
171
|
+
status: t.skip ? 'skipped' : 'failed',
|
|
172
|
+
reason: t.skip,
|
|
173
|
+
error: t.skip ? undefined : errMsg,
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -56,6 +56,15 @@ export declare function collectLocalHarnessInventory(opts?: {
|
|
|
56
56
|
agents?: readonly AgentId[];
|
|
57
57
|
refresh?: boolean;
|
|
58
58
|
}): Promise<HarnessRow[]>;
|
|
59
|
+
export interface FleetHarnessQuery {
|
|
60
|
+
agents?: AgentId[];
|
|
61
|
+
devices?: string[];
|
|
62
|
+
refresh?: boolean;
|
|
63
|
+
spinner?: (text: string) => {
|
|
64
|
+
stop(): void;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export declare function collectFleetHarnesses(opts: FleetHarnessQuery): Promise<HostHarnessResult[]>;
|
|
59
68
|
export declare function groupByAccount(rows: HarnessRow[]): AccountGroup[];
|
|
60
69
|
export declare function formatQuota(quota: QuotaSummary): string;
|
|
61
70
|
export declare function renderHarnessMatrix(results: HostHarnessResult[]): string[];
|