@phnx-labs/agents-cli 1.22.66 → 1.22.68
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 +26 -0
- package/README.md +7 -2
- package/dist/bootstrap.js +3 -3
- package/dist/commands/browser.js +46 -21
- package/dist/commands/daemon-test-harness.d.ts +1 -1
- package/dist/commands/daemon-test-harness.js +2 -2
- package/dist/commands/daemon.js +21 -22
- package/dist/commands/exec.js +40 -0
- package/dist/commands/monitors.js +2 -2
- package/dist/commands/repo.js +57 -19
- package/dist/commands/resume.d.ts +16 -0
- package/dist/commands/resume.js +41 -8
- package/dist/commands/routines.js +42 -21
- package/dist/commands/sessions-optimize.js +1 -1
- package/dist/commands/sessions.js +4 -11
- package/dist/commands/share.d.ts +5 -3
- package/dist/commands/share.js +33 -9
- package/dist/lib/accounting/account-pool-collect.d.ts +6 -4
- package/dist/lib/accounting/account-pool-collect.js +6 -4
- package/dist/lib/accounting/usage-ingest.js +4 -2
- package/dist/lib/accounting/usage-sync.d.ts +38 -93
- package/dist/lib/accounting/usage-sync.js +66 -210
- package/dist/lib/accounting/usage.d.ts +11 -3
- package/dist/lib/accounting/usage.js +23 -10
- package/dist/lib/auth-health.d.ts +8 -0
- package/dist/lib/auth-health.js +4 -4
- package/dist/lib/browser/caller-identity.d.ts +12 -0
- package/dist/lib/browser/caller-identity.js +19 -0
- package/dist/lib/browser/ipc.d.ts +37 -32
- package/dist/lib/browser/ipc.js +146 -94
- package/dist/lib/browser/task-index.d.ts +10 -2
- package/dist/lib/browser/task-index.js +22 -3
- package/dist/lib/daemon/account-state-daemon-service.d.ts +49 -9
- package/dist/lib/daemon/account-state-daemon-service.js +81 -18
- package/dist/lib/daemon/auth-sync-service.d.ts +4 -4
- package/dist/lib/daemon/auth-sync-service.js +17 -6
- package/dist/lib/daemon/catchup-service.d.ts +51 -0
- package/dist/lib/daemon/catchup-service.js +51 -0
- package/dist/lib/daemon/daemon.d.ts +12 -22
- package/dist/lib/daemon/daemon.js +463 -176
- package/dist/lib/daemon/runner.js +2 -0
- package/dist/lib/daemon/service.d.ts +22 -4
- package/dist/lib/daemon/service.js +2 -2
- package/dist/lib/daemon/supervisor.d.ts +55 -15
- package/dist/lib/daemon/supervisor.js +119 -29
- package/dist/lib/daemon/usage-sync-service.d.ts +4 -6
- package/dist/lib/daemon/usage-sync-service.js +22 -18
- package/dist/lib/daemon-health.js +36 -31
- package/dist/lib/daemon-services.d.ts +1 -1
- package/dist/lib/daemon-services.js +12 -2
- package/dist/lib/daemon-ticks.d.ts +9 -6
- package/dist/lib/daemon-ticks.js +14 -8
- package/dist/lib/devices/registry.js +2 -0
- package/dist/lib/exec.js +11 -0
- package/dist/lib/feed/watch.d.ts +3 -0
- package/dist/lib/feed/watch.js +13 -3
- package/dist/lib/fleet-shared-repo-sync.d.ts +36 -0
- package/dist/lib/fleet-shared-repo-sync.js +333 -0
- package/dist/lib/fleet-shared-state.d.ts +38 -0
- package/dist/lib/fleet-shared-state.js +105 -0
- package/dist/lib/hosts/remote-cmd.d.ts +2 -0
- package/dist/lib/hosts/remote-cmd.js +12 -3
- package/dist/lib/lock-compromise.d.ts +8 -0
- package/dist/lib/lock-compromise.js +12 -0
- package/dist/lib/monitors/engine.d.ts +2 -1
- package/dist/lib/monitors/engine.js +9 -2
- package/dist/lib/refresh-coordinator.js +2 -0
- package/dist/lib/run-trace-sync.d.ts +13 -0
- package/dist/lib/run-trace-sync.js +77 -0
- package/dist/lib/secrets/push.d.ts +10 -0
- package/dist/lib/secrets/push.js +86 -7
- package/dist/lib/secrets/remote.d.ts +18 -6
- package/dist/lib/secrets/remote.js +29 -4
- package/dist/lib/secrets/reserved-sync.d.ts +28 -27
- package/dist/lib/secrets/reserved-sync.js +119 -101
- package/dist/lib/session/active.d.ts +3 -1
- package/dist/lib/session/active.js +2 -0
- package/dist/lib/session/actor-sidecar.d.ts +12 -0
- package/dist/lib/session/actor-sidecar.js +2 -0
- package/dist/lib/session/db.d.ts +5 -2
- package/dist/lib/session/db.js +54 -22
- package/dist/lib/session/discover.d.ts +12 -3
- package/dist/lib/session/discover.js +106 -25
- package/dist/lib/session/prompt.d.ts +11 -0
- package/dist/lib/session/prompt.js +25 -0
- package/dist/lib/session/recovery.d.ts +30 -2
- package/dist/lib/session/recovery.js +56 -4
- package/dist/lib/session/remote/remote-list.d.ts +17 -1
- package/dist/lib/session/remote/remote-list.js +29 -4
- package/dist/lib/session/remote/watch.d.ts +25 -2
- package/dist/lib/session/remote/watch.js +185 -11
- package/dist/lib/session/session-cache.d.ts +2 -1
- package/dist/lib/session/session-cache.js +1 -0
- package/dist/lib/session/types.d.ts +2 -0
- package/dist/lib/share/publish.d.ts +55 -9
- package/dist/lib/share/publish.js +87 -9
- package/dist/lib/share/worker-template.js +100 -8
- package/dist/lib/ssh-exec.d.ts +2 -0
- package/dist/lib/ssh-exec.js +20 -4
- package/dist/lib/teams/registry.js +2 -0
- package/dist/lib/testdata/daemon-health-writer.d.ts +1 -0
- package/dist/lib/testdata/daemon-health-writer.js +8 -0
- package/dist/lib/traces/sync.d.ts +7 -0
- package/dist/lib/traces/sync.js +9 -0
- package/dist/lib/usage-refresh.d.ts +8 -2
- package/dist/lib/usage-refresh.js +3 -3
- package/package.json +1 -1
- package/dist/lib/account-state-service.d.ts +0 -21
- package/dist/lib/account-state-service.js +0 -60
|
@@ -4,24 +4,24 @@ import type { IPCRequest, IPCResponse } from './types.js';
|
|
|
4
4
|
export interface IPCRequestOptions {
|
|
5
5
|
autoStartDaemon?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class BrowserServiceNotRunningError extends Error {
|
|
8
8
|
constructor();
|
|
9
9
|
}
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function formatBrowserServiceNotRunningError(daemonRunning?: boolean): string;
|
|
11
11
|
export declare function getSocketPath(): string;
|
|
12
12
|
/** Is the daemon reachable? A real connect probe on every platform — a socket
|
|
13
13
|
* file existing on disk is not proof a daemon is listening on it. */
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function isBrowserServiceReachable(): Promise<boolean>;
|
|
15
15
|
/**
|
|
16
16
|
* Is a *reachable* daemon actually responsive, or is its event loop wedged
|
|
17
|
-
* (PHNX-3411)? Retries {@link
|
|
17
|
+
* (PHNX-3411)? Retries {@link probeBrowserServiceResponsive} up to
|
|
18
18
|
* {@link RESPONSIVENESS_PROBE_ATTEMPTS} times so a single transient miss (a GC
|
|
19
19
|
* pause) never condemns a healthy daemon; returns true as soon as any attempt
|
|
20
20
|
* gets a reply, and false only when every attempt fails.
|
|
21
21
|
*/
|
|
22
|
-
export declare function
|
|
22
|
+
export declare function isBrowserServiceResponsive(endpoint?: string, attempts?: number): Promise<boolean>;
|
|
23
23
|
/**
|
|
24
|
-
* Wait until the browser
|
|
24
|
+
* Wait until the browser service is genuinely reachable, or throw.
|
|
25
25
|
*
|
|
26
26
|
* Re-probes across the whole window rather than latching on the first accept, so
|
|
27
27
|
* it survives an IPC-server restart that happens mid-wait (PHNX-3289): a restart
|
|
@@ -30,32 +30,35 @@ export declare function isDaemonResponsive(endpoint?: string, attempts?: number)
|
|
|
30
30
|
* that never comes up throws a message naming the endpoint and the budget, never
|
|
31
31
|
* a silent hang.
|
|
32
32
|
*/
|
|
33
|
-
export declare function
|
|
34
|
-
/** Outcome of {@link
|
|
35
|
-
export interface
|
|
36
|
-
/** The
|
|
33
|
+
export declare function waitForBrowserService(_socketPath: string, timeoutMs?: number): Promise<void>;
|
|
34
|
+
/** Outcome of {@link stopBrowserService} — what the service-scoped stop did. */
|
|
35
|
+
export interface BrowserServiceStopResult {
|
|
36
|
+
/** The browser IPC service was reachable before the stop was requested. */
|
|
37
37
|
wasRunning: boolean;
|
|
38
|
+
/** The shared daemon stayed running while only browser IPC was stopped. */
|
|
39
|
+
daemonRunning: boolean;
|
|
38
40
|
/** A leftover `browser.sock` file was unlinked (POSIX only). */
|
|
39
41
|
socketCleared: boolean;
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
|
-
*
|
|
43
|
-
* (PHNX-
|
|
44
|
-
* `
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
44
|
+
* Stop only the daemon-hosted browser IPC service so a subsequent `start` comes
|
|
45
|
+
* up clean (PHNX-3605). The short-lived browser client persists the
|
|
46
|
+
* `browser-ipc` service off and asks the daemon to apply that transition over
|
|
47
|
+
* its existing SIGHUP control path. It never stops or restarts the shared
|
|
48
|
+
* supervisor, so routines, usage sync, secrets, and every sibling service keep
|
|
49
|
+
* their process and in-flight work.
|
|
48
50
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
51
|
+
* Once the endpoint is quiet, a stale socket left by a hard-crashed browser
|
|
52
|
+
* service is removed. If the daemon event loop itself is wedged and cannot
|
|
53
|
+
* consume SIGHUP, the endpoint remains reachable and this fails loud with the
|
|
54
|
+
* deliberate operator-owned whole-daemon restart command; the client never
|
|
55
|
+
* escalates into that process-wide action itself.
|
|
53
56
|
*/
|
|
54
|
-
export declare function
|
|
57
|
+
export declare function stopBrowserService(): Promise<BrowserServiceStopResult>;
|
|
55
58
|
/**
|
|
56
59
|
* Remove a leftover browser socket FILE, but only when nothing is listening on
|
|
57
60
|
* it — re-probing liveness IMMEDIATELY before the unlink to close the TOCTOU
|
|
58
|
-
* window (PHNX-3289 review). Between {@link
|
|
61
|
+
* window (PHNX-3289 review). Between {@link stopBrowserService}'s quiesce loop
|
|
59
62
|
* deciding the endpoint was unreachable and this unlink, a concurrent
|
|
60
63
|
* `browser start` could bind a NEW listener on the same path; an unconditional
|
|
61
64
|
* unlink would then delete a LIVE daemon's socket — the exact two-servers orphan
|
|
@@ -65,7 +68,7 @@ export declare function resetBrowserDaemon(): Promise<BrowserDaemonResetResult>;
|
|
|
65
68
|
*/
|
|
66
69
|
export declare function clearDeadSocketFile(endpoint: string, socketPath: string): Promise<boolean>;
|
|
67
70
|
/**
|
|
68
|
-
* One long-lived connection to the existing browser
|
|
71
|
+
* One long-lived connection to the existing browser service. Requests are
|
|
69
72
|
* serialized so the daemon's newline-delimited responses always map to the
|
|
70
73
|
* caller that produced them, while the process and socket stay warm between
|
|
71
74
|
* actions.
|
|
@@ -85,6 +88,8 @@ export declare class BrowserIPCConnection {
|
|
|
85
88
|
}
|
|
86
89
|
export declare class BrowserIPCServer {
|
|
87
90
|
private server;
|
|
91
|
+
/** Filesystem identity of the POSIX binding this server created. */
|
|
92
|
+
private socketIdentity;
|
|
88
93
|
private service;
|
|
89
94
|
/** Live client connections, so {@link stop} can end them rather than wait. */
|
|
90
95
|
private connections;
|
|
@@ -128,21 +133,21 @@ export declare class BrowserIPCServer {
|
|
|
128
133
|
private handleRequest;
|
|
129
134
|
}
|
|
130
135
|
/**
|
|
131
|
-
* Decide whether a running daemon is stale
|
|
136
|
+
* Decide whether a running daemon is stale enough to name an operator refresh.
|
|
132
137
|
*
|
|
133
|
-
* FORWARD ONLY:
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* not flap the daemon
|
|
138
|
+
* FORWARD ONLY: recommend a refresh when the daemon is *older* than this CLI.
|
|
139
|
+
* An older CLI rides a newer daemon without noise. A client never performs the
|
|
140
|
+
* refresh itself — two installs sharing one daemon dir (keyed off $HOME) must
|
|
141
|
+
* not flap the daemon or interrupt one another's hosted services.
|
|
137
142
|
*
|
|
138
143
|
* `undefined`/`'unknown'` means the daemon is too old to answer the `version`
|
|
139
|
-
* action reliably — don't
|
|
144
|
+
* action reliably — don't recommend an action on that ambiguous signal.
|
|
140
145
|
*
|
|
141
146
|
* When numeric compare cannot order two distinct strings (e.g. two
|
|
142
|
-
* `0.0.0-dev.*` builds),
|
|
143
|
-
*
|
|
147
|
+
* `0.0.0-dev.*` builds), surface the mismatch without deciding either client
|
|
148
|
+
* owns the shared process.
|
|
144
149
|
*/
|
|
145
|
-
export declare function
|
|
150
|
+
export declare function shouldRecommendDaemonRefresh(daemonVersion: string | undefined, clientVersion: string): boolean;
|
|
146
151
|
export declare function sendIPCRequest(request: IPCRequest, opts?: IPCRequestOptions): Promise<IPCResponse>;
|
|
147
152
|
/**
|
|
148
153
|
* Fill actor / launchId / sessionId from the calling process when the request
|