@cotal-ai/manager 0.171.3 → 0.171.4

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.
@@ -0,0 +1,155 @@
1
+ import type { ControlReply, EpCaller, Presence } from "@cotal-ai/core";
2
+ import type { ManagerStatus } from "./manager-service-contract.js";
3
+ import type { Manager } from "./manager.js";
4
+ import type { ManagedAgent } from "./seat-types.js";
5
+ export declare const MANAGER_VERSION: string;
6
+ /** What {@link StatusAndModels} reads from the Manager. Every entry is read at use, so a field the Manager
7
+ * assigns after construction is always current, and a Manager method a test replaces is the one that runs. */
8
+ export interface StatusAndModelsDeps {
9
+ agents: () => Manager["agents"];
10
+ auth: () => Manager["auth"];
11
+ connectorStatuses: () => Manager["connectorStatuses"];
12
+ ep: () => Manager["ep"];
13
+ execution: () => Manager["execution"];
14
+ leaseStopping: () => Manager["leaseStopping"];
15
+ lifecycleInFlight: () => Manager["lifecycleInFlight"];
16
+ maintenanceState: () => Manager["maintenanceState"];
17
+ managerInstanceId: () => Manager["managerInstanceId"];
18
+ managerLifecycleUid: () => Manager["managerLifecycleUid"];
19
+ namesCapacity: () => Manager["namesCapacity"];
20
+ preservationAttemptId: () => Manager["preservationAttemptId"];
21
+ preservationInventory: () => Manager["preservationInventory"];
22
+ remoteAuthority: () => Manager["remoteAuthority"];
23
+ requiredRuntime: () => Manager["requiredRuntime"];
24
+ resumeRequired: () => Manager["resumeRequired"];
25
+ retirement: () => Manager["retirement"];
26
+ runtimeKind: () => Manager["runtimeKind"];
27
+ space: () => Manager["space"];
28
+ startedAtMs: () => Manager["startedAtMs"];
29
+ staticLifecycle: () => Manager["staticLifecycle"];
30
+ userMode: () => Manager["userMode"];
31
+ workspaceRoot: () => Manager["workspaceRoot"];
32
+ classSpawnEnabled: (...args: Parameters<Manager["classSpawnEnabled"]>) => ReturnType<Manager["classSpawnEnabled"]>;
33
+ connectorNames: (...args: Parameters<Manager["connectorNames"]>) => ReturnType<Manager["connectorNames"]>;
34
+ epAdminReach: (...args: Parameters<Manager["epAdminReach"]>) => ReturnType<Manager["epAdminReach"]>;
35
+ executionRefusal: (...args: Parameters<Manager["executionRefusal"]>) => ReturnType<Manager["executionRefusal"]>;
36
+ forkProvenance: (...args: Parameters<Manager["forkProvenance"]>) => ReturnType<Manager["forkProvenance"]>;
37
+ isOwnPresence: (a: ManagedAgent, p: Presence | undefined) => p is Presence;
38
+ isProcessBoundSeat: (...args: Parameters<Manager["isProcessBoundSeat"]>) => ReturnType<Manager["isProcessBoundSeat"]>;
39
+ launchHarness: (...args: Parameters<Manager["launchHarness"]>) => ReturnType<Manager["launchHarness"]>;
40
+ refreshUnavailableConnectors: (...args: Parameters<Manager["refreshUnavailableConnectors"]>) => ReturnType<Manager["refreshUnavailableConnectors"]>;
41
+ resolveConnector: (...args: Parameters<Manager["resolveConnector"]>) => ReturnType<Manager["resolveConnector"]>;
42
+ staticReconciliationStatus: (...args: Parameters<Manager["staticReconciliationStatus"]>) => ReturnType<Manager["staticReconciliationStatus"]>;
43
+ }
44
+ /** What the manager reports about itself: status, the seat list and its owner filter, local seat facts, and the model catalog. */
45
+ export declare class StatusAndModels {
46
+ private readonly deps;
47
+ constructor(deps: StatusAndModelsDeps);
48
+ private get agents();
49
+ private get auth();
50
+ private get connectorStatuses();
51
+ private get ep();
52
+ private get execution();
53
+ private get leaseStopping();
54
+ private get lifecycleInFlight();
55
+ private get maintenanceState();
56
+ private get managerInstanceId();
57
+ private get managerLifecycleUid();
58
+ private get namesCapacity();
59
+ private get preservationAttemptId();
60
+ private get preservationInventory();
61
+ private get remoteAuthority();
62
+ private get requiredRuntime();
63
+ private get resumeRequired();
64
+ private get retirement();
65
+ private get runtimeKind();
66
+ private get space();
67
+ private get startedAtMs();
68
+ private get staticLifecycle();
69
+ private get userMode();
70
+ private get workspaceRoot();
71
+ private classSpawnEnabled;
72
+ private connectorNames;
73
+ private epAdminReach;
74
+ private executionRefusal;
75
+ private forkProvenance;
76
+ private isOwnPresence;
77
+ private isProcessBoundSeat;
78
+ private launchHarness;
79
+ private refreshUnavailableConnectors;
80
+ private resolveConnector;
81
+ private staticReconciliationStatus;
82
+ /** Return connector-provided model catalogs for selector UIs. Optional by connector: a host with no
83
+ * local model-list API reports `supported:false` rather than blocking the manager. A connector that
84
+ * fails to import shows an `error:` row (from manifest enumeration) and never blocks the others. */
85
+ opModels(args: Record<string, unknown>): Promise<ControlReply>;
86
+ /** The owner-domain bound on `ps`/`status` metadata: on a USER mesh, a privileged-tier caller
87
+ * sees only agents under its OWN subject-pinned owner. Two ways to see ALL owners: the admin
88
+ * TIER (operator), or a fresh ledger `admin` SCOPE on the caller's row — the SAME authority that
89
+ * lets `stop`/`attach` reach cross-owner agents ({@link authorizeNamedControl}). Without this the
90
+ * two surfaces disagree: an admin operator could cross-owner stop an agent it could not list.
91
+ * Read fresh so a revoked admin loses visibility on its next call; a read failure and an
92
+ * unparseable caller both fall closed (own-owner / matches-nothing). Static meshes are unbounded. */
93
+ psOwnerFilter(caller: EpCaller, admin: boolean): Promise<string | undefined>;
94
+ /** Parent-local inventory read. It does not enter maintenance or change admission. */
95
+ hostedSeatCount(): number;
96
+ /** Public local-seat facts for the owning machine daemon. No mesh or secret reads. */
97
+ hostedAgents(): {
98
+ name: string;
99
+ application: string;
100
+ model?: string;
101
+ cwd: string;
102
+ startedAt: string;
103
+ state: "running" | "exited";
104
+ }[];
105
+ /** The served manager-level health summary. Given an owner, `agentCount` counts only that owner's
106
+ * seats, as `ps` lists them ({@link psOwnerFilter}), so a person reading a shared Manager does not
107
+ * learn how many seats other owners hold on it. */
108
+ managerStatusData(ownerFilter: string | undefined, setupClaude?: boolean): ManagerStatus;
109
+ /** Managed agents cross-referenced with live presence (the manager sees the roster).
110
+ *
111
+ * `ownerFilter`: restrict to agents whose spawn-time stored `userOwner` equals it (the ps/status
112
+ * owner-domain bound); undefined = unbounded. {@link NO_OWNER_MATCHES} matches nothing. */
113
+ list(ownerFilter?: string): {
114
+ authHealth?: "auth-renewal-failed" | "auth-unknown" | "auth-stale" | undefined;
115
+ authReason?: string | undefined;
116
+ resume?: import("./manager.js").ForkProvenance | {
117
+ source: string;
118
+ } | undefined;
119
+ cwd: string;
120
+ pid: number | undefined;
121
+ spawner: string;
122
+ instanceId: string;
123
+ host: string;
124
+ provider?: string | undefined;
125
+ lifecycleUid: string;
126
+ model: string | undefined;
127
+ variant: string | undefined;
128
+ offlineSince?: number | undefined;
129
+ presenceObservedAt?: number | undefined;
130
+ meshView: "current" | "unpopulated" | "stale";
131
+ presenceIdentityVerified: boolean;
132
+ activeAt?: number | undefined;
133
+ startupNotice?: string | undefined;
134
+ condition?: {
135
+ since?: number | undefined;
136
+ message?: string | undefined;
137
+ source?: string | undefined;
138
+ code: import("@cotal-ai/core").PresenceConditionCode;
139
+ } | undefined;
140
+ joinHealth?: {
141
+ state: "degraded";
142
+ reason: string;
143
+ } | undefined;
144
+ name: string;
145
+ id: string;
146
+ role: string | undefined;
147
+ agent: string;
148
+ space: string;
149
+ mode: string;
150
+ status: "running" | "exited";
151
+ uptimeMs: number;
152
+ mesh: string;
153
+ }[];
154
+ }
155
+ //# sourceMappingURL=status-and-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-and-models.d.ts","sourceRoot":"","sources":["../src/status-and-models.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAKzG,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,+BAA+B,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,eAAO,MAAM,eAAe,QAAiH,CAAC;AAO9I;+GAC+G;AAC/G,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,EAAE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CAAC,YAAY;IACpB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,4BAA4B;IACpC,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,0BAA0B;IAElC;;yGAEqG;IAC/F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IA6CpE;;;;;;0GAMsG;IAChG,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAgBlF,sFAAsF;IACtF,eAAe,IAAI,MAAM;IAEzB,sFAAsF;IACtF,YAAY,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAA;KAAE,EAAE;IAQpI;;wDAEoD;IACpD,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,UAAQ,GAAG,aAAa;IAgDtF;;;gGAG4F;IAC5F,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+F1B"}
@@ -0,0 +1,290 @@
1
+ import { EpEnvelopeError, rejectionText, resolveAuthProvider } from "@cotal-ai/core";
2
+ import { agentAuthState, agentLifecycleSecretFilePaths, userAuthStateDir } from "@cotal-ai/workspace";
3
+ import { createHash } from "node:crypto";
4
+ import { readFileSync } from "node:fs";
5
+ import { hostname } from "node:os";
6
+ // Capture the loaded package version before an installation can replace its files.
7
+ export const MANAGER_VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
8
+ /** Sentinel owner-filter value that matches NO agent's `userOwner` (owner tokens never contain a
9
+ * dash) — what {@link Manager.psOwnerFilter} returns for an unparseable caller so a malformed
10
+ * principal fail-closes to an empty `ps` instead of an unbounded one. */
11
+ const NO_OWNER_MATCHES = "-no-owner-";
12
+ /** What the manager reports about itself: status, the seat list and its owner filter, local seat facts, and the model catalog. */
13
+ export class StatusAndModels {
14
+ deps;
15
+ constructor(deps) {
16
+ this.deps = deps;
17
+ }
18
+ // The Manager members these bodies read, under their Manager names. Each reads through its dep at
19
+ // use, so a field the Manager assigns later is current and a method a test replaces on the Manager
20
+ // is the one that runs.
21
+ get agents() { return this.deps.agents(); }
22
+ get auth() { return this.deps.auth(); }
23
+ get connectorStatuses() { return this.deps.connectorStatuses(); }
24
+ get ep() { return this.deps.ep(); }
25
+ get execution() { return this.deps.execution(); }
26
+ get leaseStopping() { return this.deps.leaseStopping(); }
27
+ get lifecycleInFlight() { return this.deps.lifecycleInFlight(); }
28
+ get maintenanceState() { return this.deps.maintenanceState(); }
29
+ get managerInstanceId() { return this.deps.managerInstanceId(); }
30
+ get managerLifecycleUid() { return this.deps.managerLifecycleUid(); }
31
+ get namesCapacity() { return this.deps.namesCapacity(); }
32
+ get preservationAttemptId() { return this.deps.preservationAttemptId(); }
33
+ get preservationInventory() { return this.deps.preservationInventory(); }
34
+ get remoteAuthority() { return this.deps.remoteAuthority(); }
35
+ get requiredRuntime() { return this.deps.requiredRuntime(); }
36
+ get resumeRequired() { return this.deps.resumeRequired(); }
37
+ get retirement() { return this.deps.retirement(); }
38
+ get runtimeKind() { return this.deps.runtimeKind(); }
39
+ get space() { return this.deps.space(); }
40
+ get startedAtMs() { return this.deps.startedAtMs(); }
41
+ get staticLifecycle() { return this.deps.staticLifecycle(); }
42
+ get userMode() { return this.deps.userMode(); }
43
+ get workspaceRoot() { return this.deps.workspaceRoot(); }
44
+ classSpawnEnabled(...args) { return this.deps.classSpawnEnabled(...args); }
45
+ connectorNames(...args) { return this.deps.connectorNames(...args); }
46
+ epAdminReach(...args) { return this.deps.epAdminReach(...args); }
47
+ executionRefusal(...args) { return this.deps.executionRefusal(...args); }
48
+ forkProvenance(...args) { return this.deps.forkProvenance(...args); }
49
+ isOwnPresence(a, p) { return this.deps.isOwnPresence(a, p); }
50
+ isProcessBoundSeat(...args) { return this.deps.isProcessBoundSeat(...args); }
51
+ launchHarness(...args) { return this.deps.launchHarness(...args); }
52
+ refreshUnavailableConnectors(...args) { return this.deps.refreshUnavailableConnectors(...args); }
53
+ resolveConnector(...args) { return this.deps.resolveConnector(...args); }
54
+ staticReconciliationStatus(...args) { return this.deps.staticReconciliationStatus(...args); }
55
+ /** Return connector-provided model catalogs for selector UIs. Optional by connector: a host with no
56
+ * local model-list API reports `supported:false` rather than blocking the manager. A connector that
57
+ * fails to import shows an `error:` row (from manifest enumeration) and never blocks the others. */
58
+ async opModels(args) {
59
+ if (this.execution === "none")
60
+ throw new EpEnvelopeError("unimplemented", this.executionRefusal());
61
+ const requested = String(args.agent ?? "").trim();
62
+ const refresh = args.refresh === true;
63
+ const one = async (connector) => {
64
+ await this.refreshUnavailableConnectors(connector.name, true);
65
+ const harness = this.launchHarness(connector);
66
+ if (!connector.listModels)
67
+ return { agent: connector.name, supported: false, models: [] };
68
+ if ("refusal" in harness)
69
+ return { agent: connector.name, supported: true, models: [], error: harness.refusal };
70
+ try {
71
+ const catalog = await connector.listModels({ refresh, resolvedBinaries: harness.binaries });
72
+ return { agent: connector.name, supported: catalog.unavailable === undefined, ...catalog };
73
+ }
74
+ catch (e) {
75
+ return { agent: connector.name, supported: true, models: [], error: rejectionText(e) };
76
+ }
77
+ };
78
+ if (requested) {
79
+ let connector;
80
+ try {
81
+ connector = await this.resolveConnector(requested);
82
+ }
83
+ catch (e) {
84
+ return { ok: false, error: rejectionText(e) };
85
+ }
86
+ const result = await one(connector);
87
+ return result.error ? { ok: false, error: result.error } : { ok: true, data: result };
88
+ }
89
+ // Enumerate from the manifest (published binary) so a connector that fails to import still gets
90
+ // a row — `registry.all` can't list one that never registered. Each resolves lazily; an import
91
+ // failure becomes an `error:` catalog row and never blocks the healthy ones.
92
+ const catalogs = await Promise.all(this.connectorNames().map(async (name) => {
93
+ let connector;
94
+ try {
95
+ connector = await this.resolveConnector(name);
96
+ }
97
+ catch (e) {
98
+ return { agent: name, supported: false, models: [], error: rejectionText(e) };
99
+ }
100
+ return one(connector);
101
+ }));
102
+ return { ok: true, data: catalogs };
103
+ }
104
+ /** The owner-domain bound on `ps`/`status` metadata: on a USER mesh, a privileged-tier caller
105
+ * sees only agents under its OWN subject-pinned owner. Two ways to see ALL owners: the admin
106
+ * TIER (operator), or a fresh ledger `admin` SCOPE on the caller's row — the SAME authority that
107
+ * lets `stop`/`attach` reach cross-owner agents ({@link authorizeNamedControl}). Without this the
108
+ * two surfaces disagree: an admin operator could cross-owner stop an agent it could not list.
109
+ * Read fresh so a revoked admin loses visibility on its next call; a read failure and an
110
+ * unparseable caller both fall closed (own-owner / matches-nothing). Static meshes are unbounded. */
111
+ async psOwnerFilter(caller, admin) {
112
+ if (!this.userMode || admin)
113
+ return undefined;
114
+ if (this.remoteAuthority)
115
+ return (await this.epAdminReach(caller)) ? undefined : caller.owner;
116
+ try {
117
+ const scope = await resolveAuthProvider().actorScope({
118
+ dir: userAuthStateDir(this.workspaceRoot, this.space),
119
+ owner: caller.owner,
120
+ actor: caller.actor,
121
+ });
122
+ if (scope?.includes("admin"))
123
+ return undefined;
124
+ }
125
+ catch {
126
+ /* unreadable ledger authorizes nothing extra: fall through to the own-owner bound */
127
+ }
128
+ return caller.owner;
129
+ }
130
+ /** Parent-local inventory read. It does not enter maintenance or change admission. */
131
+ hostedSeatCount() { return this.agents.size; }
132
+ /** Public local-seat facts for the owning machine daemon. No mesh or secret reads. */
133
+ hostedAgents() {
134
+ if (this.agents.size > 50)
135
+ throw new Error("local agent inventory exceeds its bound");
136
+ return [...this.agents.values()].map(a => ({
137
+ name: a.name, application: a.agent, ...(a.launch.model ? { model: a.launch.model } : {}),
138
+ cwd: a.launch.cwd, startedAt: new Date(a.startedAt).toISOString(), state: a.handle.status(),
139
+ }));
140
+ }
141
+ /** The served manager-level health summary. Given an owner, `agentCount` counts only that owner's
142
+ * seats, as `ps` lists them ({@link psOwnerFilter}), so a person reading a shared Manager does not
143
+ * learn how many seats other owners hold on it. */
144
+ managerStatusData(ownerFilter, setupClaude = false) {
145
+ this.refreshUnavailableConnectors(undefined, setupClaude);
146
+ return {
147
+ instanceId: this.managerInstanceId,
148
+ lifecycleUid: this.managerLifecycleUid,
149
+ host: hostname(),
150
+ version: MANAGER_VERSION,
151
+ execution: this.execution,
152
+ runtime: this.runtimeKind,
153
+ custody: this.execution === "none" ? "none" : this.requiredRuntime.kind === "pty" && this.requiredRuntime.supportsRelease === true ? "custodied" : "legacy",
154
+ runHosting: this.execution !== "none" && (this.remoteAuthority ? this.remoteAuthority.runHosting !== undefined : !this.userMode && this.auth !== undefined),
155
+ terminalSessions: this.execution !== "none",
156
+ agentCount: ownerFilter === undefined ? this.agents.size : [...this.agents.values()].filter((a) => a.userOwner === ownerFilter).length,
157
+ uptimeMs: Date.now() - this.startedAtMs,
158
+ connectors: this.connectorStatuses.map((row) => ({ ...row, binaries: { ...row.binaries } })),
159
+ classSpawn: this.classSpawnEnabled(),
160
+ staticReconciliation: this.staticReconciliationStatus(),
161
+ stopImpact: {
162
+ agentScope: ownerFilter === undefined ? "manager" : "owner-filtered",
163
+ observedAt: new Date().toISOString(),
164
+ maintenance: this.maintenanceState,
165
+ resumeRequired: this.resumeRequired,
166
+ stopping: this.leaseStopping,
167
+ lifecycleInFlight: this.lifecycleInFlight,
168
+ reservedLaunches: this.namesCapacity.reservedCount,
169
+ retirementsPending: this.retirement.pendingCount,
170
+ deprovisioningInFlight: this.retirement.inFlightCount,
171
+ staticReconciliationInFlight: this.staticLifecycle.sweepsInFlight,
172
+ agents: [...this.agents.values()]
173
+ .filter((a) => ownerFilter === undefined || a.userOwner === ownerFilter)
174
+ .map((a) => ({
175
+ name: a.name,
176
+ id: a.id,
177
+ lifecycleUid: a.lifecycleUid,
178
+ mode: a.handle.kind,
179
+ defaultAction: this.maintenanceState !== "active" || this.resumeRequired
180
+ ? "stop-retaining-state" : this.isProcessBoundSeat(a) ? "stop" : "release-custody",
181
+ withAgentsAction: this.maintenanceState !== "active" || this.resumeRequired ? "stop-retaining-state" : "stop",
182
+ })),
183
+ // The same digest form `opResumePreserved` binds, so a preserved-exit stop and the later
184
+ // resume name one inventory.
185
+ ...(this.maintenanceState !== "active" && this.preservationAttemptId && this.preservationInventory
186
+ ? { preservation: { attemptId: this.preservationAttemptId, inventorySha256: createHash("sha256").update(JSON.stringify(this.preservationInventory)).digest("hex") } }
187
+ : {}),
188
+ },
189
+ };
190
+ }
191
+ /** Managed agents cross-referenced with live presence (the manager sees the roster).
192
+ *
193
+ * `ownerFilter`: restrict to agents whose spawn-time stored `userOwner` equals it (the ps/status
194
+ * owner-domain bound); undefined = unbounded. {@link NO_OWNER_MATCHES} matches nothing. */
195
+ list(ownerFilter) {
196
+ const roster = new Map(this.ep.getRoster().map((p) => [p.card.name, p]));
197
+ const observedAt = Date.now();
198
+ // The roster is only evidence while THIS observer's presence watch is fresh. A stale view
199
+ // (whole-bucket silence past TTL) or an unpopulated one (snapshot not yet replayed) cannot
200
+ // support "offline" or "absent" for anyone: a live deployment on 2026-09-09 rendered every live seat as
201
+ // one of those for hours after the presence stream was recreated under a still-open watch.
202
+ // Carry the view state on the row so the renderer can say "unknown" instead of a verdict.
203
+ // An endpoint that reports no view (test doubles built on `getRoster` alone) is read as
204
+ // `current`: that is exactly what every row meant before the field existed.
205
+ const view = typeof this.ep.presenceView === "function" ? this.ep.presenceView() : { state: "current" };
206
+ return [...this.agents.values()].filter((a) => ownerFilter === undefined || a.userOwner === ownerFilter).map((a) => {
207
+ // USER MODE: a detached agent's bearer-refresh death is silent everywhere except here — its
208
+ // bearer command writes each attempt's outcome to the health file, and `ps` renders it
209
+ // FAIL-CLOSED: a failed record is the failure + repair sentence; a missing/malformed or
210
+ // stale record on a live agent is auth-unknown/auth-stale, NEVER silently healthy.
211
+ const health = a.userOwner
212
+ ? agentAuthState(a.secretPaths?.health ?? agentLifecycleSecretFilePaths(this.workspaceRoot, this.space, a.name, a.lifecycleUid).health)
213
+ : undefined;
214
+ // The connector-reported provider from presence (#785): the live roster card's `meta.provider`,
215
+ // when it is a non-empty string. Absent when the connector reported none — never fabricated.
216
+ const seen = roster.get(a.name);
217
+ const presenceIdentityVerified = this.isOwnPresence(a, seen);
218
+ const providerMeta = seen?.card.meta?.provider;
219
+ const provider = typeof providerMeta === "string" && providerMeta ? providerMeta : undefined;
220
+ // The harness-reported condition beside the mesh status (#618): a turn that died upstream reads
221
+ // `waiting` with `rate_limit` here, not a bare `waiting`. Absent when the connector reported none.
222
+ // Projected field by field like `provider`: a malformed peer row must not fail this reply's schema.
223
+ const reported = roster.get(a.name)?.condition;
224
+ const condition = reported && typeof reported.code === "string" && reported.code
225
+ ? {
226
+ code: reported.code,
227
+ ...(typeof reported.source === "string" ? { source: reported.source } : {}),
228
+ ...(typeof reported.message === "string" ? { message: reported.message } : {}),
229
+ ...(typeof reported.since === "number" && Number.isFinite(reported.since) ? { since: reported.since } : {}),
230
+ }
231
+ : undefined;
232
+ // The seat's last harness-reported work progress (#618). `ts` is only its heartbeat, so a turn
233
+ // that stopped advancing reads as an old `activeAt` beside a live process. Absent when none was reported.
234
+ const activeAtReported = roster.get(a.name)?.activeAt;
235
+ const activeAt = typeof activeAtReported === "number" && Number.isFinite(activeAtReported) ? activeAtReported : undefined;
236
+ // How long an offline verdict has stood (#1208): the seat's last heartbeat before it went
237
+ // offline. Only beside a verdict, since a stale or unpopulated view dates nothing, only from the
238
+ // seat's own record, since `seen` is matched by name and a same-named foreign peer or an older
239
+ // incarnation must not date this seat, and only when the seat's unvalidated `ts` fits the row
240
+ // schema, so one odd record cannot fail the reply.
241
+ const offlineSince = view.state === "current" && this.isOwnPresence(a, seen) && seen.status === "offline" && Number.isSafeInteger(seen.ts) && seen.ts >= 0
242
+ ? seen.ts
243
+ : undefined;
244
+ return {
245
+ name: a.name,
246
+ // The spawned agent's id (nkey, or the user-mode principal) — lets an operator tool (e.g.
247
+ // `cotal down -f`) match a ledger entry by name AND id before stopping, so it never stops a
248
+ // same-named foreign agent.
249
+ id: a.id,
250
+ role: a.role,
251
+ agent: a.agent,
252
+ space: this.space,
253
+ mode: a.handle.kind,
254
+ status: a.handle.status(),
255
+ uptimeMs: Date.now() - a.startedAt,
256
+ mesh: seen?.status ?? "absent",
257
+ ...(a.joinIssue ? { joinHealth: { state: "degraded", reason: a.joinIssue } } : {}),
258
+ ...(condition ? { condition } : {}),
259
+ ...(a.startupNotice !== undefined ? { startupNotice: a.startupNotice } : {}),
260
+ ...(activeAt !== undefined ? { activeAt } : {}),
261
+ // `current` is the only state in which `mesh` is a verdict; the other two are the
262
+ // observer's own condition and travel on the row (older CLIs ignore the field).
263
+ meshView: view.state,
264
+ presenceIdentityVerified,
265
+ ...(view.state === "current" && presenceIdentityVerified ? { presenceObservedAt: observedAt } : {}),
266
+ ...(offlineSince !== undefined ? { offlineSince } : {}),
267
+ // The incarnation coordinate (SPEC 13.1) — with `id`, exactly what a v0.4 caller needs to
268
+ // build a targeted (`despawn`/`attach`) request against THIS incarnation.
269
+ lifecycleUid: a.lifecycleUid,
270
+ // #651 enrichment: per-seat facts the manager ALREADY holds, carried on the row so `ps
271
+ // --wide`/`--json` can surface them without a new collection path. All optional in the row
272
+ // schema: a fact this backend did not record serializes absent, never fabricated (the
273
+ // pid is absent on runtimes that do not own a real process; a launch may pin no model).
274
+ model: a.launch.model,
275
+ variant: a.launch.variant,
276
+ ...(provider ? { provider } : {}),
277
+ cwd: a.launch.cwd,
278
+ pid: a.handle.pid,
279
+ spawner: a.spawner,
280
+ instanceId: this.managerInstanceId,
281
+ host: hostname(),
282
+ // #1500: the session a `--resume` seat forked, with its title and transcript hash once the
283
+ // seat has recorded them.
284
+ ...(a.launch.forkSource ? { resume: this.forkProvenance(a) ?? { source: a.launch.forkSource } } : {}),
285
+ ...(health && health.state !== "ok" ? { authHealth: health.state, authReason: health.reason } : {}),
286
+ };
287
+ });
288
+ }
289
+ }
290
+ //# sourceMappingURL=status-and-models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-and-models.js","sourceRoot":"","sources":["../src/status-and-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErF,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKnC,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC,OAAO,CAAC;AAE9I;;0EAE0E;AAC1E,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAyCtC,kIAAkI;AAClI,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,IAAyB;QAAzB,SAAI,GAAJ,IAAI,CAAqB;IAAG,CAAC;IAE1D,kGAAkG;IAClG,mGAAmG;IACnG,wBAAwB;IACxB,IAAY,MAAM,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnD,IAAY,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/C,IAAY,iBAAiB,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,E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C,CAAC,MAAM,CAAC,KAAK;gBACrB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO;gBACzB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG;gBACjB,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG;gBACjB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,UAAU,EAAE,IAAI,CAAC,iBAAiB;gBAClC,IAAI,EAAE,QAAQ,EAAE;gBAChB,2FAA2F;gBAC3F,0BAA0B;gBAC1B,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACrG,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACpG,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/manager",
3
3
  "description": "Cotal agent supervisor: spawns and manages mesh nodes via a pluggable runtime (pty/tmux/cmux/orca/herdr).",
4
- "version": "0.171.3",
4
+ "version": "0.171.4",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@clack/prompts": "^1.0.0",
22
- "@cotal-ai/core": "0.171.3",
23
- "@cotal-ai/seat": "0.171.3",
24
- "@cotal-ai/workspace": "0.171.3",
22
+ "@cotal-ai/core": "0.171.4",
23
+ "@cotal-ai/seat": "0.171.4",
24
+ "@cotal-ai/workspace": "0.171.4",
25
25
  "@lydell/node-pty": "1.2.0-beta.12",
26
26
  "@nats-io/jetstream": "3.4.0",
27
27
  "@nats-io/kv": "3.4.0",
@@ -37,14 +37,14 @@
37
37
  "zod": "^4.4.3"
38
38
  },
39
39
  "devDependencies": {
40
- "@cotal-ai/auth": "0.171.3",
41
- "@cotal-ai/connector-claude-code": "0.171.3",
42
- "@cotal-ai/connector-codex": "0.171.3",
43
- "@cotal-ai/connector-core": "0.171.3",
44
- "@cotal-ai/connector-hermes": "0.171.3",
45
- "@cotal-ai/connector-opencode": "0.171.3",
46
- "@cotal-ai/delivery": "0.171.3",
47
- "@cotal-ai/runtime": "0.171.3",
40
+ "@cotal-ai/auth": "0.171.4",
41
+ "@cotal-ai/connector-claude-code": "0.171.4",
42
+ "@cotal-ai/connector-codex": "0.171.4",
43
+ "@cotal-ai/connector-core": "0.171.4",
44
+ "@cotal-ai/connector-hermes": "0.171.4",
45
+ "@cotal-ai/connector-opencode": "0.171.4",
46
+ "@cotal-ai/delivery": "0.171.4",
47
+ "@cotal-ai/runtime": "0.171.4",
48
48
  "@cotal-ai/smoke-kit": "0.0.0",
49
49
  "@modelcontextprotocol/sdk": "1.29.0",
50
50
  "@types/ws": "^8.18.1",