wicked-crew 0.7.28 → 0.7.30
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/README.md +12 -1
- package/dist/api/chat-scope.d.ts +210 -0
- package/dist/api/chat-scope.d.ts.map +1 -0
- package/dist/api/chat-scope.js +728 -0
- package/dist/api/chat-scope.js.map +1 -0
- package/dist/api/diagnostics.d.ts +30 -2
- package/dist/api/diagnostics.d.ts.map +1 -1
- package/dist/api/diagnostics.js +73 -5
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/api/governance-health.d.ts +171 -0
- package/dist/api/governance-health.d.ts.map +1 -0
- package/dist/api/governance-health.js +379 -0
- package/dist/api/governance-health.js.map +1 -0
- package/dist/api/open-path.d.ts.map +1 -1
- package/dist/api/open-path.js +2 -1
- package/dist/api/open-path.js.map +1 -1
- package/dist/api/post-hoc-deliver.d.ts +9 -5
- package/dist/api/post-hoc-deliver.d.ts.map +1 -1
- package/dist/api/post-hoc-deliver.js +21 -7
- package/dist/api/post-hoc-deliver.js.map +1 -1
- package/dist/api/routes.d.ts +70 -12
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +375 -60
- package/dist/api/routes.js.map +1 -1
- package/dist/api/seat-health.d.ts +38 -0
- package/dist/api/seat-health.d.ts.map +1 -1
- package/dist/api/seat-health.js +88 -5
- package/dist/api/seat-health.js.map +1 -1
- package/dist/api/seat-signin.d.ts.map +1 -1
- package/dist/api/seat-signin.js +49 -23
- package/dist/api/seat-signin.js.map +1 -1
- package/dist/api/seat-standing.d.ts +101 -0
- package/dist/api/seat-standing.d.ts.map +1 -0
- package/dist/api/seat-standing.js +138 -0
- package/dist/api/seat-standing.js.map +1 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +37 -0
- package/dist/api/server.js.map +1 -1
- package/dist/campaigns/routes.d.ts +4 -4
- package/dist/cli/governance.d.ts +131 -0
- package/dist/cli/governance.d.ts.map +1 -0
- package/dist/cli/governance.js +354 -0
- package/dist/cli/governance.js.map +1 -0
- package/dist/cli/index.js +102 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/core/adapter.d.ts +99 -1
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +149 -8
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/bridge-path.d.ts +21 -0
- package/dist/core/bridge-path.d.ts.map +1 -1
- package/dist/core/bridge-path.js +37 -0
- package/dist/core/bridge-path.js.map +1 -1
- package/dist/core/bridge-reaper.d.ts.map +1 -1
- package/dist/core/bridge-reaper.js +11 -4
- package/dist/core/bridge-reaper.js.map +1 -1
- package/dist/core/deliver-text.d.ts +184 -0
- package/dist/core/deliver-text.d.ts.map +1 -0
- package/dist/core/deliver-text.js +434 -0
- package/dist/core/deliver-text.js.map +1 -0
- package/dist/core/deliver-triage.d.ts +90 -0
- package/dist/core/deliver-triage.d.ts.map +1 -0
- package/dist/core/deliver-triage.js +106 -0
- package/dist/core/deliver-triage.js.map +1 -0
- package/dist/core/deliver.d.ts +103 -9
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +244 -46
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/estate-mcp-client.d.ts.map +1 -1
- package/dist/core/estate-mcp-client.js +7 -2
- package/dist/core/estate-mcp-client.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +11 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/governance-store.d.ts +219 -0
- package/dist/core/governance-store.d.ts.map +1 -0
- package/dist/core/governance-store.js +290 -0
- package/dist/core/governance-store.js.map +1 -0
- package/dist/core/repoPaths.d.ts +36 -5
- package/dist/core/repoPaths.d.ts.map +1 -1
- package/dist/core/repoPaths.js +46 -4
- package/dist/core/repoPaths.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +29 -24
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +74 -7
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +5 -2
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/council-outcome.d.ts +28 -0
- package/dist/interactive/council-outcome.d.ts.map +1 -0
- package/dist/interactive/council-outcome.js +57 -0
- package/dist/interactive/council-outcome.js.map +1 -0
- package/dist/interactive/demo-events.d.ts.map +1 -1
- package/dist/interactive/demo-events.js +5 -2
- package/dist/interactive/demo-events.js.map +1 -1
- package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
- package/dist/interactive/doc-delete-routes.js +3 -2
- package/dist/interactive/doc-delete-routes.js.map +1 -1
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +5 -2
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/edit-events.d.ts.map +1 -1
- package/dist/interactive/edit-events.js +5 -2
- package/dist/interactive/edit-events.js.map +1 -1
- package/dist/projects/auto-refresh.d.ts +54 -0
- package/dist/projects/auto-refresh.d.ts.map +1 -0
- package/dist/projects/auto-refresh.js +76 -0
- package/dist/projects/auto-refresh.js.map +1 -0
- package/dist/projects/graph-paths.d.ts +4 -2
- package/dist/projects/graph-paths.d.ts.map +1 -1
- package/dist/projects/graph-paths.js +4 -2
- package/dist/projects/graph-paths.js.map +1 -1
- package/dist/projects/graph.d.ts +20 -6
- package/dist/projects/graph.d.ts.map +1 -1
- package/dist/projects/graph.js +40 -13
- package/dist/projects/graph.js.map +1 -1
- package/dist/projects/routes.d.ts.map +1 -1
- package/dist/projects/routes.js +30 -11
- package/dist/projects/routes.js.map +1 -1
- package/dist/projects/state-home.d.ts +6 -0
- package/dist/projects/state-home.d.ts.map +1 -1
- package/dist/projects/state-home.js +9 -1
- package/dist/projects/state-home.js.map +1 -1
- package/dist/skills/guards.d.ts +17 -6
- package/dist/skills/guards.d.ts.map +1 -1
- package/dist/skills/guards.js +42 -15
- package/dist/skills/guards.js.map +1 -1
- package/dist/skills/plugin-source.d.ts.map +1 -1
- package/dist/skills/plugin-source.js +3 -0
- package/dist/skills/plugin-source.js.map +1 -1
- package/dist/skills/refs.d.ts +181 -17
- package/dist/skills/refs.d.ts.map +1 -1
- package/dist/skills/refs.js +345 -26
- package/dist/skills/refs.js.map +1 -1
- package/dist/skills/store.d.ts +22 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/skills/store.js +161 -23
- package/dist/skills/store.js.map +1 -1
- package/dist/studio/assets/index-CWUS9Ump.js +542 -0
- package/dist/studio/assets/{index-CK1uJWs2.css → index-_ydd-jKd.css} +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +567 -6
- package/endpoint-manifest.json +67 -14
- package/package.json +4 -4
- package/dist/studio/assets/index-CdmCMh2f.js +0 -539
|
@@ -5,6 +5,36 @@ export type { SeatHealth };
|
|
|
5
5
|
export declare const FALLBACK_WINDOW_MS: number;
|
|
6
6
|
/** Fallbacks within the window that flip a seat inactive. */
|
|
7
7
|
export declare const FALLBACK_THRESHOLD = 3;
|
|
8
|
+
/**
|
|
9
|
+
* The council BENCH fold (independent review of #533, F-1): `councilSeatFailed { cli, kind }` is the
|
|
10
|
+
* engine's own evidence that a seat cannot hold a ballot — `non_zero_exit` ("Not logged in", "No
|
|
11
|
+
* API key found", "exceeded your monthly quota") or `timed_out` (opencode past the 40 s dispatch
|
|
12
|
+
* budget on the phase-4 rig). Until this fold existed the tracker never read it, so a seat benched
|
|
13
|
+
* in every council kept `health: active` and the roster's `council_eligible` prediction could not
|
|
14
|
+
* learn. The fold is bounded on purpose: only PRIMARY failures count (`benched` is the engine's
|
|
15
|
+
* derivative of an earlier failure, not a new observation), only within {@link COUNCIL_BENCH_WINDOW_MS},
|
|
16
|
+
* and only from {@link COUNCIL_BENCH_THRESHOLD} failures up (one timed-out ballot is weather). It
|
|
17
|
+
* does NOT flip `health` — a chat is not a council and the free tier may still answer — it feeds
|
|
18
|
+
* `council_eligible` through {@link SeatHealthTracker.councilBenchFor}, and an ok unit output clears
|
|
19
|
+
* it like every other recovery.
|
|
20
|
+
*/
|
|
21
|
+
export declare const COUNCIL_BENCH_WINDOW_MS: number;
|
|
22
|
+
export declare const COUNCIL_BENCH_THRESHOLD = 2;
|
|
23
|
+
/** The `councilSeatFailed.kind` values that are the seat's OWN failure (the engine's `benched` is derivative). */
|
|
24
|
+
export declare const COUNCIL_PRIMARY_FAILURE_KINDS: ReadonlySet<string>;
|
|
25
|
+
/** What the roster carries as `council_bench` when a seat is benched by this daemon's recent evidence. */
|
|
26
|
+
export interface CouncilBench {
|
|
27
|
+
/** Primary ballot failures inside the window. */
|
|
28
|
+
failures: number;
|
|
29
|
+
last_kind: string;
|
|
30
|
+
/** ISO-8601 of the last failure. */
|
|
31
|
+
last_at: string;
|
|
32
|
+
/** The run the last failure happened in, when the frame named one. */
|
|
33
|
+
last_run?: string;
|
|
34
|
+
/** A bounded excerpt of the last failure's detail / stderr, when there was one. */
|
|
35
|
+
last_detail?: string;
|
|
36
|
+
window_ms: number;
|
|
37
|
+
}
|
|
8
38
|
/**
|
|
9
39
|
* In-memory per-seat health, folded from live CoreEvents. In-memory ON PURPOSE: health is a
|
|
10
40
|
* statement about the running platform's ability to reach a CLI right now — a daemon restart
|
|
@@ -18,6 +48,8 @@ export declare class SeatHealthTracker {
|
|
|
18
48
|
private readonly assignments;
|
|
19
49
|
/** cli key → recent failure-fallback timestamps (epoch ms), pruned to the rolling window. */
|
|
20
50
|
private readonly fallbacks;
|
|
51
|
+
/** cli key → primary council ballot failures inside {@link COUNCIL_BENCH_WINDOW_MS}. */
|
|
52
|
+
private readonly councilFailures;
|
|
21
53
|
/** Default `since` for seats that have never changed state. */
|
|
22
54
|
private readonly startedAt;
|
|
23
55
|
constructor(opts?: {
|
|
@@ -33,6 +65,12 @@ export declare class SeatHealthTracker {
|
|
|
33
65
|
ingest(event: CoreEvent): void;
|
|
34
66
|
/** Flip a seat ACTIVE: message cleared, `since` updated on a genuine transition. */
|
|
35
67
|
markActive(key: string, atMs?: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* The seat's council bench from THIS daemon's recent evidence, or `null`: fewer than
|
|
70
|
+
* {@link COUNCIL_BENCH_THRESHOLD} primary ballot failures inside {@link COUNCIL_BENCH_WINDOW_MS}
|
|
71
|
+
* (older ones have aged out), or an ok output since.
|
|
72
|
+
*/
|
|
73
|
+
councilBenchFor(key: string, nowMs?: number): CouncilBench | null;
|
|
36
74
|
/** Flip a seat INACTIVE with the error excerpt; `since` survives while already inactive. */
|
|
37
75
|
markInactive(key: string, message: string, atMs?: number): void;
|
|
38
76
|
/** The seat's health — a seat never seen in an event is ACTIVE with no message (the default). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-health.d.ts","sourceRoot":"","sources":["../../src/api/seat-health.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seat-health.d.ts","sourceRoot":"","sources":["../../src/api/seat-health.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EACL,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAGtC,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,QAAiB,CAAC;AACjD,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,QAAiB,CAAC;AACtD,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,kHAAkH;AAClH,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,MAAM,CAA2C,CAAC;AAU1G,0GAA0G;AAC1G,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAoCD;;;;;GAKG;AACH,qBAAa,iBAAiB;IAWhB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAVjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,oGAAoG;IACpG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IACzD,6FAA6F;IAC7F,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,wFAAwF;IACxF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuC;IACvE,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4B;gBAEzB,IAAI,GAAE;QACjC;;;WAGG;QACH,SAAS,CAAC,EAAE,eAAe,CAAC;QAC5B,wEAAwE;QACxE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;KACtB;IAEN,4FAA4F;IAC5F,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAkJ9B,oFAAoF;IACpF,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAa,GAAG,IAAI;IAWhD;;;;OAIG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAa,GAAG,YAAY,GAAG,IAAI;IAmBrE,4FAA4F;IAC5F,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,SAAa,GAAG,IAAI;IAWnE,iGAAiG;IACjG,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;CAGnC"}
|
package/dist/api/seat-health.js
CHANGED
|
@@ -12,11 +12,18 @@
|
|
|
12
12
|
// "workerError"` (the CLI process itself failed — crew#277 asks exactly this stamp), or a
|
|
13
13
|
// `detail` naming the wrapped runner's "(cli `x` exited N)" message, an ACP "timeout waiting",
|
|
14
14
|
// or an auth/quota string (401/unauthorized/quota/rate-limit/credits). The seat is read from
|
|
15
|
-
// the detail when it names one, else from the unit's `unitDistributed` assignment.
|
|
15
|
+
// the detail when it names one, else from the unit's `unitDistributed` assignment. A DELIVER
|
|
16
|
+
// refusal is the exception (wicked-core#431 follow-through): the deliver phase is a Tool command
|
|
17
|
+
// no seat ran, and the engine's pre-push lift + re-verify (`deliver: LIFT-CONFLICT — …`, `… the
|
|
18
|
+
// repository's own checks FAILED on it …`, `… could not be applied cleanly …`) and crew's own script (nothing to
|
|
19
|
+
// deliver, a moved verified base, a failed `gh`) both surface as `workerError` only because the
|
|
20
|
+
// Tool path has no finer kind. They are operator ESCALATIONS (`core/deliver-triage.ts`) and flip
|
|
21
|
+
// no seat.
|
|
16
22
|
// - `acpFallback` is NOT alone inactive — `session_died` falls back to single-shot and the unit
|
|
17
23
|
// can still succeed — but REPEATED fallback (3+ in 10 minutes) is a seat that cannot hold a
|
|
18
|
-
// session, and that is. `governance_requires_wrapped`
|
|
19
|
-
//
|
|
24
|
+
// session, and that is. `governance_requires_wrapped` and `read_only_requires_wrapped`
|
|
25
|
+
// (wicked-core#431: an evaluator on an unadmitted ACP seat is rerouted to the wrapped carrier,
|
|
26
|
+
// where read-only is an argv fact) are deliberate routing, not failures, and never count.
|
|
20
27
|
// - `unitOutputCaptured` with `stepStatus: "ok"` marks the assigned seat ACTIVE again and clears
|
|
21
28
|
// the message (the event carries no seat, so `unitDistributed`/`unitReassigned` are folded
|
|
22
29
|
// into a per-unit assignment map for the correlation).
|
|
@@ -28,10 +35,28 @@
|
|
|
28
35
|
// gated dispatch (display-only), so an inactive seat keeps receiving work and its next real
|
|
29
36
|
// `ok` output flips it active — recovery by real work, no probe required.
|
|
30
37
|
import { SIGNAL_CORRELATION_WINDOW_MS, } from '../core/daemon-signal-log.js';
|
|
38
|
+
import { triageDeliverFailure } from '../core/deliver-triage.js';
|
|
31
39
|
/** Rolling window for the repeated-acpFallback rule. */
|
|
32
40
|
export const FALLBACK_WINDOW_MS = 10 * 60 * 1000;
|
|
33
41
|
/** Fallbacks within the window that flip a seat inactive. */
|
|
34
42
|
export const FALLBACK_THRESHOLD = 3;
|
|
43
|
+
/**
|
|
44
|
+
* The council BENCH fold (independent review of #533, F-1): `councilSeatFailed { cli, kind }` is the
|
|
45
|
+
* engine's own evidence that a seat cannot hold a ballot — `non_zero_exit` ("Not logged in", "No
|
|
46
|
+
* API key found", "exceeded your monthly quota") or `timed_out` (opencode past the 40 s dispatch
|
|
47
|
+
* budget on the phase-4 rig). Until this fold existed the tracker never read it, so a seat benched
|
|
48
|
+
* in every council kept `health: active` and the roster's `council_eligible` prediction could not
|
|
49
|
+
* learn. The fold is bounded on purpose: only PRIMARY failures count (`benched` is the engine's
|
|
50
|
+
* derivative of an earlier failure, not a new observation), only within {@link COUNCIL_BENCH_WINDOW_MS},
|
|
51
|
+
* and only from {@link COUNCIL_BENCH_THRESHOLD} failures up (one timed-out ballot is weather). It
|
|
52
|
+
* does NOT flip `health` — a chat is not a council and the free tier may still answer — it feeds
|
|
53
|
+
* `council_eligible` through {@link SeatHealthTracker.councilBenchFor}, and an ok unit output clears
|
|
54
|
+
* it like every other recovery.
|
|
55
|
+
*/
|
|
56
|
+
export const COUNCIL_BENCH_WINDOW_MS = 30 * 60 * 1000;
|
|
57
|
+
export const COUNCIL_BENCH_THRESHOLD = 2;
|
|
58
|
+
/** The `councilSeatFailed.kind` values that are the seat's OWN failure (the engine's `benched` is derivative). */
|
|
59
|
+
export const COUNCIL_PRIMARY_FAILURE_KINDS = new Set(['non_zero_exit', 'timed_out']);
|
|
35
60
|
/** Health messages are operator-facing chips, not transcripts — bound them hard. */
|
|
36
61
|
const EXCERPT_MAX = 240;
|
|
37
62
|
function excerpt(s) {
|
|
@@ -52,8 +77,11 @@ const SEAT_FAILURE_PATTERNS = [
|
|
|
52
77
|
/\bquota\b|rate.?limit|too many requests|\b429\b/i, // quota/rate ceiling
|
|
53
78
|
/\bout of credits\b|\binsufficient credits\b/i, // account balance
|
|
54
79
|
];
|
|
55
|
-
/** `acpFallback` kinds that are deliberate routing rather than a failure — never counted
|
|
56
|
-
|
|
80
|
+
/** `acpFallback` kinds that are deliberate routing rather than a failure — never counted:
|
|
81
|
+
* `governance_requires_wrapped` (crew#276) and `read_only_requires_wrapped` (wicked-core#431 —
|
|
82
|
+
* an `executes_code: false` unit on an ACP seat not admitted to input governance is routed to the
|
|
83
|
+
* wrapped carrier before any ACP turn, where the read-only lever is an argv fact). */
|
|
84
|
+
const BENIGN_FALLBACK_KINDS = new Set(['governance_requires_wrapped', 'read_only_requires_wrapped']);
|
|
57
85
|
function str(v) {
|
|
58
86
|
return typeof v === 'string' && v.length > 0 ? v : undefined;
|
|
59
87
|
}
|
|
@@ -70,6 +98,8 @@ export class SeatHealthTracker {
|
|
|
70
98
|
assignments = new Map();
|
|
71
99
|
/** cli key → recent failure-fallback timestamps (epoch ms), pruned to the rolling window. */
|
|
72
100
|
fallbacks = new Map();
|
|
101
|
+
/** cli key → primary council ballot failures inside {@link COUNCIL_BENCH_WINDOW_MS}. */
|
|
102
|
+
councilFailures = new Map();
|
|
73
103
|
/** Default `since` for seats that have never changed state. */
|
|
74
104
|
startedAt = new Date().toISOString();
|
|
75
105
|
constructor(opts = {}) {
|
|
@@ -113,6 +143,15 @@ export class SeatHealthTracker {
|
|
|
113
143
|
}
|
|
114
144
|
case 'stepFailed': {
|
|
115
145
|
const detail = typeof event.detail === 'string' ? event.detail : '';
|
|
146
|
+
// wicked-core#431 follow-through: a DELIVER refusal — the engine's pre-push lift
|
|
147
|
+
// (LIFT-CONFLICT, a failed re-verify on the lifted tree, an apply failure) or crew's own
|
|
148
|
+
// script (nothing to deliver, a moved verified base, a failed gh) — is an operator
|
|
149
|
+
// ESCALATION, never a seat fault: the deliver phase is a Tool command no CLI seat ran, and
|
|
150
|
+
// the engine stamps it `workerError` only because the Tool path has no finer kind. Reading
|
|
151
|
+
// that literally blamed the unit's assigned seat for a git state. Recognised by phrase
|
|
152
|
+
// (`core/deliver-triage.ts`), it flips nobody.
|
|
153
|
+
if (triageDeliverFailure(detail) !== null)
|
|
154
|
+
return;
|
|
116
155
|
const failureKind = str(event.failureKind);
|
|
117
156
|
// The detail names the seat when the wrapped runner produced it; otherwise fall back to
|
|
118
157
|
// the unit's assignment (a workerError detail is the CLI's own output and rarely does).
|
|
@@ -130,6 +169,25 @@ export class SeatHealthTracker {
|
|
|
130
169
|
}
|
|
131
170
|
return;
|
|
132
171
|
}
|
|
172
|
+
case 'councilSeatFailed': {
|
|
173
|
+
const cli = str(event.cli);
|
|
174
|
+
const kind = str(event.kind);
|
|
175
|
+
if (cli === undefined || kind === undefined || !COUNCIL_PRIMARY_FAILURE_KINDS.has(kind))
|
|
176
|
+
return;
|
|
177
|
+
const detail = str(event.detail) ?? str(event.stderr) ?? '';
|
|
178
|
+
const fresh = (this.councilFailures.get(cli) ?? []).filter((f) => at - f.at < COUNCIL_BENCH_WINDOW_MS);
|
|
179
|
+
fresh.push({ at, kind, detail: excerpt(detail), session });
|
|
180
|
+
this.councilFailures.set(cli, fresh);
|
|
181
|
+
// An observed error — stamped, never a status flip (see COUNCIL_BENCH_WINDOW_MS).
|
|
182
|
+
const prev = this.entries.get(cli);
|
|
183
|
+
this.entries.set(cli, {
|
|
184
|
+
status: prev?.status ?? 'active',
|
|
185
|
+
...(prev?.message !== undefined ? { message: prev.message } : {}),
|
|
186
|
+
since: prev?.since ?? this.startedAt,
|
|
187
|
+
lastErrorAt: new Date(at).toISOString(),
|
|
188
|
+
});
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
133
191
|
case 'acpFallback': {
|
|
134
192
|
const cliKey = str(event.cliKey);
|
|
135
193
|
const fallbackKind = str(event.fallbackKind);
|
|
@@ -201,6 +259,31 @@ export class SeatHealthTracker {
|
|
|
201
259
|
...(prev?.lastErrorAt !== undefined ? { lastErrorAt: prev.lastErrorAt } : {}),
|
|
202
260
|
});
|
|
203
261
|
this.fallbacks.delete(key); // an ok output resets the repeated-fallback window too
|
|
262
|
+
this.councilFailures.delete(key); // …and the council bench: real work is the recovery
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* The seat's council bench from THIS daemon's recent evidence, or `null`: fewer than
|
|
266
|
+
* {@link COUNCIL_BENCH_THRESHOLD} primary ballot failures inside {@link COUNCIL_BENCH_WINDOW_MS}
|
|
267
|
+
* (older ones have aged out), or an ok output since.
|
|
268
|
+
*/
|
|
269
|
+
councilBenchFor(key, nowMs = Date.now()) {
|
|
270
|
+
const fresh = (this.councilFailures.get(key) ?? []).filter((f) => nowMs - f.at < COUNCIL_BENCH_WINDOW_MS);
|
|
271
|
+
if (fresh.length === 0) {
|
|
272
|
+
this.councilFailures.delete(key);
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
this.councilFailures.set(key, fresh);
|
|
276
|
+
if (fresh.length < COUNCIL_BENCH_THRESHOLD)
|
|
277
|
+
return null;
|
|
278
|
+
const last = fresh[fresh.length - 1];
|
|
279
|
+
return {
|
|
280
|
+
failures: fresh.length,
|
|
281
|
+
last_kind: last.kind,
|
|
282
|
+
last_at: new Date(last.at).toISOString(),
|
|
283
|
+
...(last.session !== undefined ? { last_run: last.session } : {}),
|
|
284
|
+
...(last.detail !== '' ? { last_detail: last.detail } : {}),
|
|
285
|
+
window_ms: COUNCIL_BENCH_WINDOW_MS,
|
|
286
|
+
};
|
|
204
287
|
}
|
|
205
288
|
/** Flip a seat INACTIVE with the error excerpt; `since` survives while already inactive. */
|
|
206
289
|
markInactive(key, message, atMs = Date.now()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-health.js","sourceRoot":"","sources":["../../src/api/seat-health.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,+FAA+F;AAC/F,kGAAkG;AAClG,2EAA2E;AAC3E,EAAE;AACF,kFAAkF;AAClF,EAAE;AACF,uFAAuF;AACv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,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3D,SAAS,EAAE,uBAAuB;SACnC,CAAC;IACJ,CAAC;IAED,4FAA4F;IAC5F,YAAY,CAAC,GAAW,EAAE,OAAe,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE;QAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE;YACpB,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;YACzB,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG;YACrD,WAAW,EAAE,GAAG;SACjB,CAAC,CAAC;IACL,CAAC;IAED,iGAAiG;IACjG,SAAS,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-signin.d.ts","sourceRoot":"","sources":["../../src/api/seat-signin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seat-signin.d.ts","sourceRoot":"","sources":["../../src/api/seat-signin.ts"],"names":[],"mappings":"AA6CA;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,MAAM,EACzB,EAAE,GAAE,aAAkB,GACrB,OAAO,GAAG,IAAI,CAgHhB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,GAAG,SAA6C,CAAC;AAEtF;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,QAAQ,GAAE,MAAM,GAAG,SAA4B,GAC9C,IAAI,CAQN"}
|
package/dist/api/seat-signin.js
CHANGED
|
@@ -17,16 +17,27 @@
|
|
|
17
17
|
// - `true` is "a credential artifact exists", NOT "the credential still works". An expired
|
|
18
18
|
// OAuth token reads `true` here; seat HEALTH (crew#274) is what catches it failing live.
|
|
19
19
|
//
|
|
20
|
-
// Per-seat rules (each documented at its branch)
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
20
|
+
// Per-seat rules (each documented at its branch). EVERY known seat is probed under its OWN root
|
|
21
|
+
// in the worker home (wicked-core#410, F-010: the engine now runs codex/pi/copilot/opencode seats
|
|
22
|
+
// under `<worker home>/<seat>` through the CLI's own configuration-home variable, exactly as claude
|
|
23
|
+
// runs under `<worker home>/claude`) — so the roster says whether the SEAT is signed in, never
|
|
24
|
+
// whether the operator is. The layout mirrors `wicked_apps_core::spawn::seat_config_for`:
|
|
25
|
+
// claude — `<root>/claude/.claude.json` with an `oauthAccount` (per-config-dir keychain entry
|
|
26
|
+
// means the file is the observable half; see below).
|
|
27
|
+
// codex — `<root>/codex/auth.json` (`CODEX_HOME=<root>/codex`).
|
|
28
|
+
// copilot — env token (COPILOT_GITHUB_TOKEN/GH_TOKEN/GITHUB_TOKEN) → true; else
|
|
29
|
+
// `<root>/copilot/config.json` (`COPILOT_HOME`) recording a logged-in user → true;
|
|
30
|
+
// installed but no user → null (keychain state unknowable cheaply — NOT false);
|
|
31
|
+
// no trace → false.
|
|
32
|
+
// opencode — `<root>/opencode/data/opencode/auth.json` (`XDG_DATA_HOME=<root>/opencode/data`).
|
|
33
|
+
// pi — `<root>/pi/auth.json` (`PI_CODING_AGENT_DIR=<root>/pi`).
|
|
34
|
+
// agy — any `.json` under `~/.gemini/` (the installed agy's layout) → true; else null
|
|
35
|
+
// (keyring unknowable; no
|
|
36
|
+
// configuration-home variable is known for agy, so it runs where the operator does).
|
|
29
37
|
// unknown — null (a seat this module has no rule for is exactly "unknown").
|
|
38
|
+
// Under the operator's inherit hatch (`WICKED_WORKER_INHERIT_OPERATOR_CONFIG` set in the daemon's
|
|
39
|
+
// env) every seat runs on the operator's OWN configuration, so the probes read the CLIs' default
|
|
40
|
+
// homes instead (`~/.codex`, `~/.pi/agent`, `~/.copilot`, `~/.local/share/opencode`, `~/.claude`).
|
|
30
41
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
31
42
|
import { homedir } from 'node:os';
|
|
32
43
|
import { join } from 'node:path';
|
|
@@ -41,6 +52,14 @@ import { join } from 'node:path';
|
|
|
41
52
|
export function signedInHeuristic(seatKey, workerConfigRoot, io = {}) {
|
|
42
53
|
const home = io.home ?? homedir();
|
|
43
54
|
const env = io.env ?? process.env;
|
|
55
|
+
// The one hatch every engine spawn honours (wicked_apps_core::spawn::INHERIT_OPERATOR_CONFIG_ENV):
|
|
56
|
+
// set, the seats run on the operator's own CLI homes and so does this probe.
|
|
57
|
+
const inherit = env['WICKED_WORKER_INHERIT_OPERATOR_CONFIG'] !== undefined;
|
|
58
|
+
// The worker home base the engine resolves (`WICKED_WORKER_HOME`, else `~/.wicked-worker`);
|
|
59
|
+
// each seat's root is `<base>/<seat>`.
|
|
60
|
+
const root = workerConfigRoot !== undefined && workerConfigRoot !== ''
|
|
61
|
+
? workerConfigRoot
|
|
62
|
+
: join(home, '.wicked-worker');
|
|
44
63
|
switch (seatKey) {
|
|
45
64
|
case 'claude': {
|
|
46
65
|
// The engine places the claude WORKER home at `<root>/claude` (acp_runner.rs
|
|
@@ -49,10 +68,7 @@ export function signedInHeuristic(seatKey, workerConfigRoot, io = {}) {
|
|
|
49
68
|
// but `/login` also writes an `oauthAccount` block into that dir's `.claude.json`, which
|
|
50
69
|
// is: present-with-key means a login completed for the WORKER home (not the operator's
|
|
51
70
|
// own ~/.claude). Heuristic by construction — a revoked token still reads true.
|
|
52
|
-
const
|
|
53
|
-
? workerConfigRoot
|
|
54
|
-
: join(home, '.wicked-worker');
|
|
55
|
-
const file = join(root, 'claude', '.claude.json');
|
|
71
|
+
const file = inherit ? join(home, '.claude', '.claude.json') : join(root, 'claude', '.claude.json');
|
|
56
72
|
try {
|
|
57
73
|
const parsed = JSON.parse(readFileSync(file, 'utf8'));
|
|
58
74
|
return typeof parsed === 'object' && parsed !== null && 'oauthAccount' in parsed;
|
|
@@ -62,8 +78,9 @@ export function signedInHeuristic(seatKey, workerConfigRoot, io = {}) {
|
|
|
62
78
|
}
|
|
63
79
|
}
|
|
64
80
|
case 'codex':
|
|
65
|
-
// `codex login` writes
|
|
66
|
-
|
|
81
|
+
// `codex login` writes `$CODEX_HOME/auth.json` (tokens live IN the file — presence is the
|
|
82
|
+
// state); the seat's CODEX_HOME is `<root>/codex` (wicked-core#410).
|
|
83
|
+
return existsSync(inherit ? join(home, '.codex', 'auth.json') : join(root, 'codex', 'auth.json'));
|
|
67
84
|
case 'copilot': {
|
|
68
85
|
// Env token wins: copilot honors these directly, and a set token IS a signed-in seat.
|
|
69
86
|
for (const key of ['COPILOT_GITHUB_TOKEN', 'GH_TOKEN', 'GITHUB_TOKEN']) {
|
|
@@ -75,8 +92,11 @@ export function signedInHeuristic(seatKey, workerConfigRoot, io = {}) {
|
|
|
75
92
|
// USER in config.json (`lastLoggedInUser` / `loggedInUsers`) — verified in the field: a
|
|
76
93
|
// successful sign-in left the chip on null-neutral and the Sign in button up, reading as
|
|
77
94
|
// "didn't work". The file is JSONC (comment header), so this parses key-presence
|
|
78
|
-
// leniently rather than JSON.parse-ing the whole document.
|
|
79
|
-
|
|
95
|
+
// leniently rather than JSON.parse-ing the whole document. The seat's config home is
|
|
96
|
+
// `COPILOT_HOME=<root>/copilot` (wicked-core#410); the keychain entry itself is per-user.
|
|
97
|
+
const cfg = inherit
|
|
98
|
+
? join(home, '.copilot', 'config.json')
|
|
99
|
+
: join(root, 'copilot', 'config.json');
|
|
80
100
|
if (existsSync(cfg)) {
|
|
81
101
|
try {
|
|
82
102
|
const raw = readFileSync(cfg, 'utf8');
|
|
@@ -103,18 +123,24 @@ export function signedInHeuristic(seatKey, workerConfigRoot, io = {}) {
|
|
|
103
123
|
return false; // no env, no config dir: nothing suggests this seat ever signed in
|
|
104
124
|
}
|
|
105
125
|
case 'opencode':
|
|
106
|
-
// `opencode auth login` writes
|
|
107
|
-
|
|
126
|
+
// `opencode auth login` writes `$XDG_DATA_HOME/opencode/auth.json` — presence is the state;
|
|
127
|
+
// the seat's XDG_DATA_HOME is `<root>/opencode/data` (wicked-core#410).
|
|
128
|
+
return existsSync(inherit
|
|
129
|
+
? join(home, '.local', 'share', 'opencode', 'auth.json')
|
|
130
|
+
: join(root, 'opencode', 'data', 'opencode', 'auth.json'));
|
|
108
131
|
case 'pi':
|
|
109
|
-
// pi's auth flow writes
|
|
110
|
-
|
|
132
|
+
// pi's auth flow writes `$PI_CODING_AGENT_DIR/auth.json` — presence is the state; the
|
|
133
|
+
// seat's agent dir is `<root>/pi` (wicked-core#410).
|
|
134
|
+
return existsSync(inherit ? join(home, '.pi', 'agent', 'auth.json') : join(root, 'pi', 'auth.json'));
|
|
111
135
|
case 'agy': {
|
|
112
|
-
// Antigravity keeps its credential in the OS keyring; a `.json`
|
|
136
|
+
// Antigravity keeps its credential in the OS keyring; a `.json` under ~/.gemini/ (the
|
|
137
|
+
// installed agy's configuration directory — verified by the independent review; the earlier
|
|
138
|
+
// `~/.antigravitycli` spelling was a stale guess) is
|
|
113
139
|
// the observable artifact a completed login leaves behind. Missing dir OR dir-with-no-json
|
|
114
140
|
// both mean the keyring state is unknowable cheaply → null (only a json upgrades to true).
|
|
115
141
|
let entries;
|
|
116
142
|
try {
|
|
117
|
-
entries = readdirSync(join(home, '.
|
|
143
|
+
entries = readdirSync(join(home, '.gemini'));
|
|
118
144
|
}
|
|
119
145
|
catch {
|
|
120
146
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seat-signin.js","sourceRoot":"","sources":["../../src/api/seat-signin.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,iGAAiG;AACjG,2FAA2F;AAC3F,8FAA8F;AAC9F,4FAA4F;AAC5F,iCAAiC;AACjC,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,8FAA8F;AAC9F,wEAAwE;AACxE,4FAA4F;AAC5F,gGAAgG;AAChG,+FAA+F;AAC/F,qFAAqF;AACrF,2FAA2F;AAC3F,2FAA2F;AAC3F,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"seat-signin.js","sourceRoot":"","sources":["../../src/api/seat-signin.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,iGAAiG;AACjG,2FAA2F;AAC3F,8FAA8F;AAC9F,4FAA4F;AAC5F,iCAAiC;AACjC,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,8FAA8F;AAC9F,wEAAwE;AACxE,4FAA4F;AAC5F,gGAAgG;AAChG,+FAA+F;AAC/F,qFAAqF;AACrF,2FAA2F;AAC3F,2FAA2F;AAC3F,EAAE;AACF,gGAAgG;AAChG,kGAAkG;AAClG,oGAAoG;AACpG,+FAA+F;AAC/F,0FAA0F;AAC1F,mGAAmG;AACnG,mEAAmE;AACnE,sEAAsE;AACtE,oFA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I,CAAC;YACd,CAAC;YACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAChE,CAAC;QAED;YACE,OAAO,IAAI,CAAC,CAAC,gDAAgD;IACjE,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAuB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAEtF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAwB,EACxB,WAA+B,gBAAgB;IAE/C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IAC3C,CAAC;SAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,QAAQ,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seat STANDING — what the daemon can say about a roster seat's usability from what it already
|
|
3
|
+
* knows, so the roster and the chat admission read the SAME predicate (F-2R2-009, F-2R2-007).
|
|
4
|
+
*
|
|
5
|
+
* # The defect
|
|
6
|
+
*
|
|
7
|
+
* `GET /roster` carried `signed_in: false` for four seats and the Health rail rendered every one
|
|
8
|
+
* of them as "active · signed out" with a green tick. Two of those seats mean two different
|
|
9
|
+
* things by "signed out": codex / pi / copilot bench on their first ballot (`non_zero_exit`: "No
|
|
10
|
+
* API key found", "exceeded your monthly quota"), while opencode ANSWERED a scoped chat on its
|
|
11
|
+
* free tier (OpenCode Zen, no account). One word, two outcomes, and nothing on the wire to tell
|
|
12
|
+
* them apart — and `POST /chats` seated its defaults through a third, unrelated filter.
|
|
13
|
+
*
|
|
14
|
+
* # The model
|
|
15
|
+
*
|
|
16
|
+
* - `auth` — the sign-in probe's three values re-read against the seat's free-tier capability:
|
|
17
|
+
* `signed_in` (a credential artifact is observable), `signed_out` (none is, and the seat needs
|
|
18
|
+
* one to answer), `not_required` (none is, but the seat answers unauthenticated on a free tier
|
|
19
|
+
* — see {@link FREE_TIER_SEATS}), `unknown` (the probe cannot tell cheaply: keychain-backed
|
|
20
|
+
* seats, seat keys with no rule).
|
|
21
|
+
* - `council_eligible` — whether a council would seat and keep this seat as far as the daemon
|
|
22
|
+
* can tell: enabled for council, runtime health `active`, and `auth` not `signed_out`. A
|
|
23
|
+
* PREDICTION from the daemon's own records, not the engine's verdict — the engine convenes
|
|
24
|
+
* whatever roster it is handed and benches a seat only after it fails (F-4R2-007). `unknown`
|
|
25
|
+
* auth is eligible: refusing a seat the daemon cannot read would bench working keychain seats.
|
|
26
|
+
* - chat admission ({@link chatSeatAdmission}) — the seats a chat seats BY DEFAULT: the same
|
|
27
|
+
* auth predicate (a `signed_out` seat is refused up front with the reason, instead of failing
|
|
28
|
+
* its first turn), plus the engine's scope rule restated (a SCOPED chat holds only a seat whose
|
|
29
|
+
* ACP adapter asks permissions or whose record arms the kernel write floor). Every refusal
|
|
30
|
+
* carries every reason that applies, so the thread can say WHY a seat is missing.
|
|
31
|
+
*
|
|
32
|
+
* Pure, synchronous, no IO: the probe result and the health record are inputs.
|
|
33
|
+
*/
|
|
34
|
+
import type { CouncilBench, SeatHealth } from './seat-health.js';
|
|
35
|
+
/** The seat's auth state, read for what it MEANS for the seat's usability. */
|
|
36
|
+
export type SeatAuth = 'signed_in' | 'signed_out' | 'not_required' | 'unknown';
|
|
37
|
+
/**
|
|
38
|
+
* Seats known to answer with NO credential at all — a free tier the CLI selects by itself when no
|
|
39
|
+
* provider is configured. A CREW-SIDE HEURISTIC, keyed by roster `key` (independent review of #533,
|
|
40
|
+
* F-1): the CLI registry declares no credential requirement today (`AgenticCli` has none;
|
|
41
|
+
* `AcpConfig.auth_method` is the ACP transport's auth, `None` for every built-in), so the daemon
|
|
42
|
+
* cannot read this off the record and says so on the wire (`free_tier_source: 'crew-heuristic'`).
|
|
43
|
+
* The day the `[cli]` record carries `credential = "optional"` (wicked-core follow-up), {@link seatAuth}
|
|
44
|
+
* reads the record first and reports `free_tier_source: 'registry'` — this table is the fallback.
|
|
45
|
+
* opencode runs its free "OpenCode Zen" models (`big-pickle` and friends) with no account, which is
|
|
46
|
+
* exactly what the fresh-rig chat exercised (F-2R2-009).
|
|
47
|
+
*/
|
|
48
|
+
export declare const FREE_TIER_SEATS: Readonly<Record<string, string>>;
|
|
49
|
+
/** Where a `not_required` reading came from: the CLI's registry record, or crew's own table. */
|
|
50
|
+
export type FreeTierSource = 'registry' | 'crew-heuristic';
|
|
51
|
+
/** The auth reading for one seat: the probe's answer, re-read against the seat's credential requirement. */
|
|
52
|
+
export declare function seatAuth(seat: StandingSeat, signedIn: boolean | null): {
|
|
53
|
+
auth: SeatAuth;
|
|
54
|
+
free_tier?: string;
|
|
55
|
+
free_tier_source?: FreeTierSource;
|
|
56
|
+
};
|
|
57
|
+
/** The roster fields standing reads. Structural, so both the wire seat and a test stub satisfy it. */
|
|
58
|
+
export interface StandingSeat {
|
|
59
|
+
key: string;
|
|
60
|
+
enabled_for_council?: boolean;
|
|
61
|
+
acp?: {
|
|
62
|
+
acp_input_governance?: boolean;
|
|
63
|
+
os_sandbox?: boolean;
|
|
64
|
+
} | null;
|
|
65
|
+
/** A registry-declared credential requirement, when the engine's record carries one (future core). */
|
|
66
|
+
credential?: 'required' | 'optional' | string;
|
|
67
|
+
/** A registry-declared free-tier label, when the record carries one (future core). */
|
|
68
|
+
free_tier?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface SeatStanding {
|
|
71
|
+
auth: SeatAuth;
|
|
72
|
+
/** Present when `auth` is `not_required`: the free tier the seat answers on. */
|
|
73
|
+
free_tier?: string;
|
|
74
|
+
/** Present with `free_tier`: whether the CLI registry declared it, or crew's own table did. */
|
|
75
|
+
free_tier_source?: FreeTierSource;
|
|
76
|
+
council_eligible: boolean;
|
|
77
|
+
/** Present when `council_eligible` is false: the one reason, in the operator's words. */
|
|
78
|
+
council_ineligible_reason?: string;
|
|
79
|
+
/** Present when THIS daemon's recent councils benched the seat (`SeatHealthTracker.councilBenchFor`). */
|
|
80
|
+
council_bench?: CouncilBench;
|
|
81
|
+
}
|
|
82
|
+
/** A seat whose `auth` lets it take a turn — the ONE predicate the roster and the chat share. */
|
|
83
|
+
export declare function authUsable(auth: SeatAuth): boolean;
|
|
84
|
+
export declare function seatStanding(seat: StandingSeat, signedIn: boolean | null, health: SeatHealth, bench?: CouncilBench | null): SeatStanding;
|
|
85
|
+
export type ChatAdmission = {
|
|
86
|
+
ok: true;
|
|
87
|
+
} | {
|
|
88
|
+
ok: false;
|
|
89
|
+
reason: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Whether a chat seats this seat BY DEFAULT — the seat's own auth standing plus, for a SCOPED chat,
|
|
93
|
+
* the engine's admission rule (`acp_runner.rs` `scoped_seat_admission`) restated so a refused seat
|
|
94
|
+
* is named with its reason instead of silently absent (F-2R2-007). Explicitly requested seats
|
|
95
|
+
* (`clis`) bypass this: the engine refuses them per seat, and its reason rides on the outcome.
|
|
96
|
+
* Takes the seat's `auth` only (independent review of #533, F-4): a chat is not a council, so
|
|
97
|
+
* `council_eligible` / health are deliberately NOT consulted here — a seat benched in councils can
|
|
98
|
+
* still answer a chat, and saying otherwise would refuse a working seat.
|
|
99
|
+
*/
|
|
100
|
+
export declare function chatSeatAdmission(seat: StandingSeat, auth: SeatAuth, scoped: boolean): ChatAdmission;
|
|
101
|
+
//# sourceMappingURL=seat-standing.d.ts.map
|
|
@@ -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