@jmanuelcorral/openteam 0.17.6 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.es.md +4 -4
  2. package/README.md +4 -4
  3. package/dist/certificates/graph-release-certificate.json +2 -2
  4. package/dist/certificates/graph-shadow-certificate.json +2 -2
  5. package/dist/cli.js +893 -2537
  6. package/dist/commands/dispatch.d.ts +2 -135
  7. package/dist/commands/dispatch.d.ts.map +1 -1
  8. package/dist/config/schema.d.ts +2 -0
  9. package/dist/config/schema.d.ts.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +6151 -6398
  13. package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -1
  14. package/dist/orchestrator/coordinator.d.ts +39 -1
  15. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  16. package/dist/orchestrator/nodeIteration.d.ts +36 -0
  17. package/dist/orchestrator/nodeIteration.d.ts.map +1 -0
  18. package/dist/orchestrator/outputContract.d.ts +117 -0
  19. package/dist/orchestrator/outputContract.d.ts.map +1 -0
  20. package/dist/orchestrator/reportArtifactProbe.d.ts +40 -0
  21. package/dist/orchestrator/reportArtifactProbe.d.ts.map +1 -0
  22. package/dist/orchestrator/reportArtifactReader.d.ts +36 -0
  23. package/dist/orchestrator/reportArtifactReader.d.ts.map +1 -0
  24. package/dist/orchestrator/reportDurability.d.ts +70 -0
  25. package/dist/orchestrator/reportDurability.d.ts.map +1 -0
  26. package/dist/orchestrator/subsessions.d.ts +1 -1
  27. package/dist/orchestrator/subsessions.d.ts.map +1 -1
  28. package/dist/plugin/orchestrateTool.d.ts +59 -1
  29. package/dist/plugin/orchestrateTool.d.ts.map +1 -1
  30. package/dist/telemetry/diagnostics.d.ts +1 -1
  31. package/dist/telemetry/diagnostics.d.ts.map +1 -1
  32. package/dist/telemetry/events.d.ts +14 -0
  33. package/dist/telemetry/events.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/orchestrator/ralphLoop.d.ts +0 -57
  36. package/dist/orchestrator/ralphLoop.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAInE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAwRR"}
1
+ {"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAInE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAmTR"}
@@ -6,7 +6,7 @@ import type { RuntimeConcurrencyLimiter } from "../local/concurrency";
6
6
  import type { LocalRuntimeId } from "../local/types";
7
7
  import type { AvailableModel, RoutingDecision, TaskSignals } from "../router/types";
8
8
  import { type EventSink } from "../telemetry/eventLog";
9
- import { type MeetingEvent, type QueueEvent, type RouteEvent } from "../telemetry/events";
9
+ import { type DiagnosticEvent, type MeetingEvent, type QueueEvent, type RouteEvent } from "../telemetry/events";
10
10
  import type { CostRecord } from "../telemetry/types";
11
11
  import { type AgentRoleProfile } from "./roles";
12
12
  import { type OpencodeSessionClient, type SubsessionResult } from "./subsessions";
@@ -106,6 +106,25 @@ export type CoordinatorDeps = {
106
106
  * the exact pre-#217 single-pool behaviour when it is absent.
107
107
  */
108
108
  reportedModelSlots?: (runtimeId: LocalRuntimeId) => Readonly<Record<string, number>> | undefined;
109
+ /**
110
+ * Report reader for the per-node done-signal (unify dispatch paths). Injected
111
+ * I/O port — reading the report file is filesystem access, so it lives at the
112
+ * composition root, not here. Given a resolved report path it returns the
113
+ * file's text, or `undefined` on any error (missing/unreadable). The
114
+ * coordinator parses only a bounded status token from the text
115
+ * (`parseReportStatus`); the report BODY never crosses `assertReferenceOnly`.
116
+ *
117
+ * REQUIRED, not optional. Iteration is governed by the configured bound
118
+ * (`orchestrator.maxRetries`), NOT by whether this port happens to be wired:
119
+ * `maxRetries: 0` means one pass, any higher value re-dispatches a node until
120
+ * it declares `openteam-status: done` or its pass budget is exhausted. Making
121
+ * the port required means dropping the forwarding from the plugin boundary to
122
+ * the coordinator is a COMPILE error, not a silent regression to never-iterate
123
+ * — mirroring the same guarantee `reportArtifactExists` already has. The port
124
+ * is read only when the budget permits a re-dispatch, so a single-pass node
125
+ * never calls it.
126
+ */
127
+ readReportArtifact: (reportPath: string) => Promise<string | undefined>;
109
128
  };
110
129
  export type CorrelatedCostRecord = CostRecord & {
111
130
  decisionID: string;
@@ -120,6 +139,13 @@ export type RoleTaskResult = {
120
139
  decision: RoutingDecision;
121
140
  subsession: SubsessionResult;
122
141
  record: CorrelatedCostRecord;
142
+ /**
143
+ * Reference-only path the role was instructed to write its findings to
144
+ * (`composeSubsessionPrompt`). A plain string path — never content — so it
145
+ * survives `assertReferenceOnly` when projected to the coordinator. The
146
+ * coordinator reads this file to synthesise the actual findings for the user.
147
+ */
148
+ reportPath: string;
123
149
  };
124
150
  /**
125
151
  * Emits an observable warning the first time an unknown worker roleID is
@@ -260,6 +286,18 @@ export declare function buildQueueEvent(observation: QueueWaitObservation, sessi
260
286
  agent?: string;
261
287
  batchID?: string;
262
288
  }): QueueEvent;
289
+ /**
290
+ * Builds the bounded `node-budget-exhausted` diagnostic event. Pure: no I/O,
291
+ * clock, random, or env — the producer supplies `ts` (from the injected
292
+ * coordinator clock) and the resolved `sessionID`.
293
+ *
294
+ * Reference-only by construction: it carries the `roleID` and an integer
295
+ * `passCount` and nothing else, so the report BODY — which the coordinator never
296
+ * reads past a boolean substance check — cannot leak into telemetry. It is the
297
+ * same `diagnostic` event class the plugin already records (e.g.
298
+ * `graph-gate-advisory`), just attributed to the node it concerns.
299
+ */
300
+ export declare function buildNodeBudgetExhaustedEvent(roleID: string, passCount: number, sessionID: string, ts: number): DiagnosticEvent;
263
301
  export declare function runRoleTask(input: RoleTaskInput, deps: CoordinatorDeps): Promise<RoleTaskResult>;
264
302
  export type RoleBatchResult = {
265
303
  readonly batchID: string;
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAEf,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,UAAU,EACf,KAAK,UAAU,E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AC,OAAO,EAAE,cAAc,EAAE,CAAC;IACnC,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B,aAAa,EAAE,EAAE,CA2BnB;AA2HD,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,eAAe,CAAC,CAoE1B"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * **Per-node iteration primitives** — the pure, deterministic helpers that bound
3
+ * how many times an orchestrated graph node may run before it must declare
4
+ * itself done.
5
+ *
6
+ * ## Why this exists (unify the two dispatch paths)
7
+ * openteam used to have two dispatch paths: `openteam-orchestrate` ran each
8
+ * graph node exactly once, while a separate `runRalphLoop` engine implemented
9
+ * iterate-until-done for a single hardcoded `ralph` role on its own entry point.
10
+ * Iteration is now a property of the graph itself: every node runs through the
11
+ * one orchestrate path and keeps working until it declares completion (via the
12
+ * output contract's status token) or this bound is hit. These helpers carry the
13
+ * arithmetic so the bound's meaning is unambiguous to a reader and testable in
14
+ * isolation.
15
+ *
16
+ * Pure: no I/O, clock, randomness, or env access. The retry budget is derived
17
+ * from injected config, never read from the environment here.
18
+ */
19
+ /**
20
+ * Default number of RETRIES per node when the orchestrator config does not pin
21
+ * one. A retry is an ADDITIONAL pass after the initial attempt, so the default
22
+ * of 2 means **three total passes** per node (one initial + two retries). Kept
23
+ * as the single source of truth for both the config schema default and the
24
+ * runtime fallback so the two can never drift.
25
+ */
26
+ export declare const DEFAULT_MAX_RETRIES = 2;
27
+ /**
28
+ * Total passes a node may run, from its retry budget. Pure.
29
+ *
30
+ * `maxRetries` counts RETRIES (additional passes after the first), so the pass
31
+ * budget is `1 + maxRetries`: `maxRetries = 2` → 3 passes, `maxRetries = 0` → a
32
+ * single pass (iteration effectively disabled). When `maxRetries` is undefined
33
+ * (no orchestrator config), {@link DEFAULT_MAX_RETRIES} applies.
34
+ */
35
+ export declare function nodePassBudget(maxRetries: number | undefined): number;
36
+ //# sourceMappingURL=nodeIteration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeIteration.d.ts","sourceRoot":"","sources":["../../src/orchestrator/nodeIteration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAErE"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * **Subsession output contract** — the deterministic instruction appended to
3
+ * every orchestrated role's prompt, plus the reference-only report path that
4
+ * carries a role's findings back to the coordinator.
5
+ *
6
+ * ## Why this exists (GE — orchestrate findings are discarded)
7
+ * `openteam-orchestrate` spawns a real subsession, the role does real work, and
8
+ * the subsession succeeds — but the coordinator only ever receives a
9
+ * reference-only `RoleResultSummary` (roleID, model, success, sessionID). The
10
+ * role's actual output never leaves its session, so a coordinator with nothing
11
+ * to report was observed inventing an `in_progress` narrative for work that had
12
+ * already finished. This module closes that gap **without** weakening the
13
+ * privacy boundary: the role is told to persist its findings to a file, and the
14
+ * coordinator is handed the file **path** — a reference, never content. The
15
+ * path passes `assertReferenceOnly` because it is a plain string on a
16
+ * non-forbidden key.
17
+ *
18
+ * Pure: no I/O, clock, randomness, or env access. The batch identifier is
19
+ * injected by the caller (`runRoleTasks` derives it from `deps.newDecisionID`),
20
+ * never generated here, so composition stays deterministic and unit-testable.
21
+ */
22
+ /**
23
+ * Machine-local root (repo-relative) for per-batch role report artifacts.
24
+ *
25
+ * Lives under `.opencode/openteam-local/` — the P15b machine-local, git-ignored
26
+ * side of the portability boundary — **by deliberate decision**, not accident.
27
+ * A role report is per-run runtime output (keyed by an ephemeral batch id), not
28
+ * portable team-state, so it belongs where telemetry and session logs live.
29
+ * `.opencode/.gitignore`'s `openteam-local/` rule ignores this whole directory,
30
+ * so reports never appear in `git status` and never get committed; the user can
31
+ * still open them locally. Placing them under the tracked `.opencode/openteam/`
32
+ * directory instead would leak an unbounded stream of per-batch files into the
33
+ * repository.
34
+ */
35
+ export declare const ROLE_REPORTS_ROOT = ".opencode/openteam-local/reports";
36
+ /**
37
+ * Bounded completion status a role declares in its report artifact, parsed by
38
+ * code from a fixed vocabulary. This — not a free-text `DONE` substring match —
39
+ * is the done-signal that ends per-node iteration. `"unknown"` covers an absent
40
+ * or unparseable declaration and is deliberately NOT `"done"`: a node that
41
+ * cannot prove completion must be assumed to have more work, never assumed
42
+ * finished.
43
+ *
44
+ * Only this small enum ever influences control flow. The report BODY is never
45
+ * carried across the `assertReferenceOnly` boundary — reading a bounded status
46
+ * token from a file is not a content leak.
47
+ */
48
+ export type ReportStatus = "done" | "continue" | "unknown";
49
+ /**
50
+ * The exact marker a role writes to declare its status, e.g.
51
+ * `openteam-status: done`. A specific, unambiguous token (unlike a bare `DONE`
52
+ * substring, which matched incidental prose such as "not done yet") so the
53
+ * parse is deterministic and cannot be tripped by ordinary report content.
54
+ */
55
+ export declare const REPORT_STATUS_MARKER = "openteam-status";
56
+ /**
57
+ * Parses the bounded completion status from a role's report text. Pure.
58
+ *
59
+ * The LAST declaration wins: a role updates its report across iterations, so its
60
+ * final `openteam-status:` line is authoritative. An absent, empty, or
61
+ * unrecognised declaration returns `"unknown"` — treated by the caller as
62
+ * not-done, never as done.
63
+ */
64
+ export declare function parseReportStatus(text: string | undefined): ReportStatus;
65
+ /**
66
+ * Minimum length, in trimmed characters, of a report's substantive body — the
67
+ * text that survives after its status-marker line(s) are removed — for a `done`
68
+ * declaration to be honoured by `nodeReportedDone`.
69
+ *
70
+ * Deliberately conservative floor: 40 characters is shorter than a single real
71
+ * sentence, so any genuine finding clears it easily, while a degenerate stub —
72
+ * an empty file, a bare `openteam-status: done`, a lone `"Done."`, or a single
73
+ * heading — does not. Its only job is to reject "work not done, presented as
74
+ * done": a marker with no findings behind it. It is intentionally NOT a quality
75
+ * bar; it merely requires that *something* was written.
76
+ */
77
+ export declare const MIN_REPORT_BODY_CHARS = 40;
78
+ /**
79
+ * Whether a report carries a substantive body, not just the status marker. Pure.
80
+ *
81
+ * The done-signal (`parseReportStatus(text) === "done"`) is necessary but not
82
+ * sufficient: a role that writes ONLY `openteam-status: done` has proven
83
+ * nothing. This predicate removes EVERY status-marker line (matching the same
84
+ * `REPORT_STATUS_PATTERN_SOURCE` the parser uses, so the marker syntax is
85
+ * defined once), trims the remainder including blank lines, and reports whether
86
+ * at least `MIN_REPORT_BODY_CHARS` characters of body survive. It is composed
87
+ * with `parseReportStatus` at the call site — never folded into it — so the
88
+ * parser's own semantics and tests are untouched.
89
+ */
90
+ export declare function reportHasSubstance(text: string | undefined): boolean;
91
+ /**
92
+ * Deterministic, per-role report artifact path within a batch. Pure.
93
+ *
94
+ * Shape: `<ROLE_REPORTS_ROOT>/<batchID>/<roleID>.md`. Same inputs always
95
+ * produce the same path, so the coordinator can predict where each role writes.
96
+ */
97
+ export declare function roleReportPath(batchID: string, roleID: string): string;
98
+ /** Result of composing a role's base prompt with its output contract. */
99
+ export type SubsessionPromptComposition = {
100
+ /** Base prompt with the standing output contract appended. */
101
+ readonly prompt: string;
102
+ /** Reference-only path the role is instructed to write its findings to. */
103
+ readonly reportPath: string;
104
+ };
105
+ /**
106
+ * Appends the standing output contract to a role's base prompt and returns the
107
+ * augmented prompt together with the report path the role is told to write.
108
+ *
109
+ * Pure and deterministic: `batchID` is injected by the caller, never generated
110
+ * here. Reference-only: it emits a file path, never content.
111
+ */
112
+ export declare function composeSubsessionPrompt(input: {
113
+ readonly prompt: string;
114
+ readonly roleID: string;
115
+ readonly batchID: string;
116
+ }): SubsessionPromptComposition;
117
+ //# sourceMappingURL=outputContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputContract.d.ts","sourceRoot":"","sources":["../../src/orchestrator/outputContract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAYtD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAUxE;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CASpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,yEAAyE;AACzE,MAAM,MAAM,2BAA2B,GAAG;IACxC,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAwCF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GAAG,2BAA2B,CAM9B"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * **Report artifact probe** — the concrete filesystem adapter behind the
3
+ * `ReportArtifactProbe` port consumed by the durability gate
4
+ * (`reportDurability.ts`).
5
+ *
6
+ * ## Why this is its own named, exported unit
7
+ * The durability gate is the entire point of the orchestrate durability work:
8
+ * it downgrades a subsession that reported success but wrote no usable report.
9
+ * That guarantee is only as strong as the real probe wired at the composition
10
+ * root. When the probe lived inline in `src/index.ts` it was never driven by
11
+ * any test — every test injects a fake port — so the adapter could be mutated
12
+ * to fail permanently open (`return true`: every role reported durable, no
13
+ * report ever required) and the whole suite stayed green. This is exactly the
14
+ * failure shape this repo has been bitten by before: a green suite over a
15
+ * composition root whose real adapter is never exercised.
16
+ *
17
+ * Extracting it here makes it a separately-testable unit driven against the
18
+ * REAL filesystem (a genuinely missing path, an empty file, a non-empty file,
19
+ * and a directory), so breaking its predicate now fails a named test. Testing
20
+ * it against a mocked `fs` would recreate the same hole one layer up, so the
21
+ * unit calls `node:fs/promises` directly rather than injecting `stat`.
22
+ *
23
+ * ## Fail-safe
24
+ * The probe never throws: any error (a missing path raises `ENOENT`, a
25
+ * permission error, etc.) resolves to `false`. Durability is only ever asserted
26
+ * on positive evidence — a file that exists AND is non-empty. It is handed a
27
+ * path and returns a boolean; no content ever crosses the `assertReferenceOnly`
28
+ * privacy boundary.
29
+ */
30
+ import type { ReportArtifactProbe } from "./reportDurability";
31
+ /**
32
+ * Real filesystem implementation of {@link ReportArtifactProbe}. Resolves
33
+ * `true` iff `reportPath` names a regular file that exists AND is non-empty;
34
+ * resolves `false` otherwise, including for a missing path, an empty file, a
35
+ * directory (`isFile()` is what excludes it), or any thrown filesystem error.
36
+ * Wired at the composition root (`src/index.ts`); every other layer consumes
37
+ * the injected port.
38
+ */
39
+ export declare const reportArtifactExists: ReportArtifactProbe;
40
+ //# sourceMappingURL=reportArtifactProbe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportArtifactProbe.d.ts","sourceRoot":"","sources":["../../src/orchestrator/reportArtifactProbe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,mBAOlC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * **Report artifact reader** — the concrete filesystem adapter behind the report
3
+ * READER port consumed by per-node iterate-until-done in the coordinator
4
+ * (`coordinator.ts`) and injected as `readReportArtifact` on `OrchestrateDeps`.
5
+ *
6
+ * ## Why this is its own named, exported unit
7
+ * The done-signal that ends per-node iteration is a bounded status token the
8
+ * role writes into its report artifact; the coordinator must READ that file to
9
+ * parse the token. Reading a file is I/O, so it cannot live in the pure
10
+ * `router/` or coordinator logic — it is an injected port. Extracting the real
11
+ * adapter here (rather than inlining it at the composition root) keeps
12
+ * `src/index.ts` as wiring and makes the adapter a separately-testable unit
13
+ * driven against the REAL filesystem. That matters for the same reason the
14
+ * existence probe (`reportArtifactProbe.ts`) was extracted: an adapter that no
15
+ * test drives can be mutated to misbehave while the suite stays green. Testing
16
+ * it against a mocked `fs` would recreate that hole one layer up, so the unit
17
+ * calls `node:fs/promises` directly.
18
+ *
19
+ * ## Fail-safe
20
+ * The reader never throws: any error (a missing path raises `ENOENT`, a
21
+ * permission error, a path that is a directory, etc.) resolves to `undefined`.
22
+ * `undefined` is treated by the caller as "no proof of completion", so a node
23
+ * whose report cannot be read is retried rather than assumed done — the failure
24
+ * mode is safe. It returns the file text so the caller can parse a bounded
25
+ * status token from it; the report BODY is reduced to a small enum before it can
26
+ * influence control flow and never crosses the `assertReferenceOnly` boundary.
27
+ */
28
+ /**
29
+ * Real filesystem implementation of the report reader port. Resolves the UTF-8
30
+ * text of the file at `reportPath`, or `undefined` on any error (a missing
31
+ * path, a directory, a permission error, or any thrown filesystem error).
32
+ * Wired at the composition root (`src/index.ts`); every other layer consumes the
33
+ * injected port.
34
+ */
35
+ export declare const readReportArtifact: (reportPath: string) => Promise<string | undefined>;
36
+ //# sourceMappingURL=reportArtifactReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportArtifactReader.d.ts","sourceRoot":"","sources":["../../src/orchestrator/reportArtifactReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,eACjB,MAAM,KACjB,OAAO,CAAC,MAAM,GAAG,SAAS,CAM5B,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * **Report durability gate** — the deterministic, code-enforced check that a
3
+ * dispatched role actually persisted its findings, downgrading a subsession
4
+ * that reported success but wrote no usable report to a bounded failure.
5
+ *
6
+ * ## Why this exists (GE — orchestrate findings are discarded)
7
+ * The output contract (`outputContract.ts`) *instructs* each role to write its
8
+ * findings to a report file, but an instruction in a prompt is a request, not a
9
+ * guarantee: a model can ignore it and still return `success: true`. That
10
+ * silently re-opens the exact defect — work discarded, reported as success. A
11
+ * prompt cannot fix a prompt; only code can. This module verifies durability in
12
+ * code via an injected filesystem probe.
13
+ *
14
+ * ## Reusable across every dispatch pass — by deliberate decision
15
+ * Iteration is now a property of the orchestration graph: every graph node runs
16
+ * through the single `openteam-orchestrate` path and may be dispatched several
17
+ * times until it declares itself done or its retry bound is hit (see
18
+ * `nodeIteration.ts`). The gate lives HERE, in the orchestrator layer, as a
19
+ * small separately-testable unit — NOT welded into the `openteam-orchestrate`
20
+ * tool handler — so every dispatch pass consumes it and none can silently
21
+ * discard work. (The former standalone Ralph loop entry points — the `openteam
22
+ * loop` CLI command and the `openteam-loop` tool — were retired when the two
23
+ * dispatch paths were unified.)
24
+ *
25
+ * ## Purity / boundaries
26
+ * The gate does no I/O itself: the filesystem existence probe is an injected
27
+ * port (`ReportArtifactProbe`), exactly like every other I/O boundary in this
28
+ * codebase. It is handed a path and returns a boolean — no content ever crosses
29
+ * the `assertReferenceOnly` privacy boundary. Path resolution
30
+ * (`resolveReportProbePath`) is a pure string join.
31
+ */
32
+ import type { RoleTaskResult } from "./coordinator";
33
+ /**
34
+ * Bounded, content-free failure reason recorded when a role's subsession
35
+ * reported success but the promised report artifact was not durably written
36
+ * (absent or empty). A fixed machine-readable literal — never free text, never
37
+ * content — so any consumer can branch on it deterministically.
38
+ */
39
+ export declare const REPORT_NOT_DURABLE_REASON = "report-missing-or-empty";
40
+ /**
41
+ * Injected durability probe. Resolves `true` iff `reportPath` names a file that
42
+ * exists AND is non-empty, and `false` otherwise (including any error). The
43
+ * concrete adapter lives at the composition root (`stat` → `isFile() && size >
44
+ * 0`); the gate only consumes this port. Reference-only: it is handed a path
45
+ * and returns a boolean, never content.
46
+ */
47
+ export type ReportArtifactProbe = (reportPath: string) => Promise<boolean>;
48
+ /**
49
+ * Resolves the on-disk path to probe for a role's report. The report path is
50
+ * relative to the working directory the subsession ran under; when a dispatch
51
+ * supplies a `directory` override, the probe must look there, not at the
52
+ * process cwd. Pure string join — no I/O — so it is shared by every dispatch
53
+ * path instead of each re-deriving (and subtly diverging on) the join.
54
+ */
55
+ export declare function resolveReportProbePath(baseDirectory: string | undefined, reportPath: string): string;
56
+ /**
57
+ * Deterministic durability gate, reusable by ANY dispatch path. For every role
58
+ * whose subsession reported success, it verifies IN CODE — via the injected
59
+ * `probe` — that the promised report artifact exists and is non-empty. A
60
+ * success with no usable report is downgraded to a bounded failure
61
+ * (`success: false`, `failureStage: "report"`,
62
+ * `failureReason: REPORT_NOT_DURABLE_REASON`) so discarded work can never be
63
+ * surfaced to a coordinator as a plain success. Failed subsessions are passed
64
+ * through untouched (there is nothing to preserve).
65
+ *
66
+ * Reference-only: the probe is handed a path and returns a boolean; no content
67
+ * crosses the `assertReferenceOnly` boundary.
68
+ */
69
+ export declare function applyReportDurabilityGate(results: readonly RoleTaskResult[], probe: ReportArtifactProbe): Promise<RoleTaskResult[]>;
70
+ //# sourceMappingURL=reportDurability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportDurability.d.ts","sourceRoot":"","sources":["../../src/orchestrator/reportDurability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GACjB,MAAM,CAIR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,cAAc,EAAE,CAAC,CAiB3B"}
@@ -53,7 +53,7 @@ export type SubsessionResult = {
53
53
  model: ModelSelection;
54
54
  response?: unknown;
55
55
  failureReason?: string;
56
- failureStage?: "create" | "prompt";
56
+ failureStage?: "create" | "prompt" | "report";
57
57
  };
58
58
  export type SubsessionDeps = {
59
59
  timeoutMs?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"subsessions.d.ts","sourceRoot":"","sources":["../../src/orchestrator/subsessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,cAAc,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CA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CAAC;KACnD,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,cAAc,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAiQF,wBAAsB,aAAa,CACjC,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,iBAAiB,EACtB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAuE3B"}
@@ -5,6 +5,7 @@ import type { GraphEventV1, GraphSpecV1 } from "../graph/schema";
5
5
  import type { RuntimeConcurrencyLimiter } from "../local/concurrency";
6
6
  import type { LocalRuntimeId } from "../local/types";
7
7
  import { type CoordinatorDeps, type RoleTaskResult } from "../orchestrator/coordinator";
8
+ import { type ReportArtifactProbe } from "../orchestrator/reportDurability";
8
9
  import type { OpencodeSessionClient } from "../orchestrator/subsessions";
9
10
  import type { GraphJournal } from "../storage/graph/provider";
10
11
  import type { EventSink } from "../telemetry/eventLog";
@@ -52,7 +53,14 @@ export type RoleResultSummary = {
52
53
  };
53
54
  success: boolean;
54
55
  sessionID?: string;
55
- failureStage?: "create" | "prompt";
56
+ /**
57
+ * Reference-only path the role was instructed to write its findings to. A
58
+ * plain string path (never content), so it survives `assertReferenceOnly`.
59
+ * The coordinator READS this file to synthesise the actual findings; the
60
+ * `reportPath` key is intentionally NOT in `FORBIDDEN_RAW_KEYS`.
61
+ */
62
+ reportPath?: string;
63
+ failureStage?: "create" | "prompt" | "report";
56
64
  failureReason?: string;
57
65
  };
58
66
  export type OrchestrateResult = {
@@ -196,6 +204,38 @@ export type OrchestrateDeps = {
196
204
  * must never throw.
197
205
  */
198
206
  readonly rosterRoleIDs: () => Promise<ReadonlySet<string>>;
207
+ /**
208
+ * Durability probe (#report-durability). A REQUIRED injected I/O port that
209
+ * answers, in code, whether a role's promised report artifact was actually
210
+ * written: it resolves `true` iff the given path names a file that exists AND
211
+ * is non-empty, and `false` otherwise (including any error). The tool applies
212
+ * it as a deterministic gate after each subsession finishes so a role that
213
+ * succeeded but wrote no findings is downgraded to a bounded failure instead
214
+ * of being reported to the coordinator as a plain success — closing the
215
+ * "work silently discarded" hole a prompt instruction alone cannot. Reference
216
+ * only: it is handed a path and returns a boolean; it never reads content
217
+ * across the `assertReferenceOnly` boundary. Required (not optional) so that
218
+ * dropping the composition-root wiring is a compile error rather than a silent
219
+ * fail-open that would re-open the exact defect this gate exists to close. The
220
+ * adapter MUST be fail-safe: on a missing/unreadable path it returns `false`
221
+ * and must never throw. Typed as the shared `ReportArtifactProbe` so the gate
222
+ * unit and every dispatch path that reuses it agree on one port shape.
223
+ */
224
+ readonly reportArtifactExists: ReportArtifactProbe;
225
+ /**
226
+ * Report READER for the per-node iterate-until-done done-signal (unify
227
+ * dispatch paths). Given a resolved report path it resolves the file's text,
228
+ * or `undefined` on any error (missing/unreadable). The coordinator reduces
229
+ * that text to a bounded status token (`parseReportStatus`) to decide whether
230
+ * a node has declared itself done; the report BODY never crosses the
231
+ * `assertReferenceOnly` boundary — this port returns text that is collapsed to
232
+ * a small enum before it can influence control flow. Required (not optional),
233
+ * mirroring `reportArtifactExists`, so dropping the composition-root wiring is
234
+ * a compile error rather than a silent regression to never-iterate. The
235
+ * adapter MUST be fail-safe: on a missing/unreadable path it returns
236
+ * `undefined` and must never throw.
237
+ */
238
+ readonly readReportArtifact: (reportPath: string) => Promise<string | undefined>;
199
239
  };
200
240
  /**
201
241
  * Builds a `GraphSpecV1` from orchestrate payload assignments. Each assignment
@@ -256,6 +296,24 @@ export declare function assignableRoleIDs(config: OpenTeamConfig): string[];
256
296
  * Builds the tool description. Dynamic because the roster is config-driven.
257
297
  */
258
298
  export declare function orchestrateToolDescription(config: OpenTeamConfig): string;
299
+ /**
300
+ * Post-call advisory for a fan-out that never happened. The tool DESCRIPTION
301
+ * already warns — before the call — that a lone assignment "has delegated
302
+ * nothing and is almost always a mistake". That text is only read up front;
303
+ * nothing tells the model AFTER it makes the call. Measured on a live box, the
304
+ * coordinator repeatedly dispatched a single `tester` assignment while a healthy
305
+ * six-role roster was assignable, so the pre-call warning alone is not enough.
306
+ *
307
+ * This returns the correction to append to the tool RESULT — visible to the
308
+ * model on its next turn and to the user — when the call carried exactly one
309
+ * assignment while more than one role is assignable. It is DELIBERATELY
310
+ * non-blocking: some tasks genuinely belong to a single role, so the call is
311
+ * never rejected; this only nudges. It stays silent when only one role is
312
+ * assignable (no fan-out is even possible — that would be pure noise).
313
+ *
314
+ * Pure: it derives the message from two counts, with no I/O, clock, or env.
315
+ */
316
+ export declare function singleAssignmentAdvisory(assignmentCount: number, assignableCount: number): string | undefined;
259
317
  /**
260
318
  * Returns the assignment roleIDs that are genuinely invented: they resolve NO
261
319
  * curated or configured routing profile AND are not registered in the project
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateTool.d.ts","sourceRoot":"","sources":["../../src/plugin/orchestrateTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,CAAC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;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CAUpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,SAAS,kBAAkB,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,EAAE,EACjE,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,MAAM,EAAE,CAiBV;AAqBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc,CA6J3E"}
@@ -1,4 +1,4 @@
1
- export declare const DIAGNOSTIC_CODES: readonly ["availability-refresh-failed", "config-missing", "graph-gate-advisory", "graph-gate-denied", "memory-extraction-warning", "memory-runtime-warning", "opencode-server-url", "opencode-version-read-failed", "privacy-inert", "soak-evidence-rejected", "telemetry-warning", "telemetry-write-failed", "unknown-role"];
1
+ export declare const DIAGNOSTIC_CODES: readonly ["availability-refresh-failed", "config-missing", "graph-gate-advisory", "graph-gate-denied", "memory-extraction-warning", "memory-runtime-warning", "node-budget-exhausted", "opencode-server-url", "opencode-version-read-failed", "privacy-inert", "soak-evidence-rejected", "telemetry-warning", "telemetry-write-failed", "unknown-role"];
2
2
  export type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[number];
3
3
  /**
4
4
  * Static, content-free summaries for plugin diagnostics. These strings are safe
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/telemetry/diagnostics.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAC3B,6BAA6B,EAC7B,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,CACN,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CA6BlE"}
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/telemetry/diagnostics.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAC3B,6BAA6B,EAC7B,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,CACN,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CA+BlE"}
@@ -188,6 +188,13 @@ export declare const ShadowDiagnosticEventSchema: z.ZodObject<{
188
188
  * Runtime diagnostic recorded by plugin-safe channels instead of stdout/stderr.
189
189
  * It stores only a bounded code, never free-form strings derived from prompts,
190
190
  * tool arguments, SDK errors, filesystem paths, or user-provided role names.
191
+ *
192
+ * `roleID` and `passCount` are OPTIONAL bounded attribution for diagnostics that
193
+ * name a specific graph node (e.g. `node-budget-exhausted`): a role identifier
194
+ * and an integer only. They exist so a per-node diagnostic can be attributed to
195
+ * the role it concerns — the gap the older `unknown-role` diagnostic still has —
196
+ * without ever carrying report body, prompt, or output text across the
197
+ * reference-only boundary.
191
198
  */
192
199
  export declare const DiagnosticLevelSchema: z.ZodEnum<{
193
200
  debug: "debug";
@@ -202,6 +209,7 @@ export declare const DiagnosticCodeSchema: z.ZodEnum<{
202
209
  "graph-gate-denied": "graph-gate-denied";
203
210
  "memory-extraction-warning": "memory-extraction-warning";
204
211
  "memory-runtime-warning": "memory-runtime-warning";
212
+ "node-budget-exhausted": "node-budget-exhausted";
205
213
  "opencode-server-url": "opencode-server-url";
206
214
  "opencode-version-read-failed": "opencode-version-read-failed";
207
215
  "privacy-inert": "privacy-inert";
@@ -228,6 +236,7 @@ export declare const DiagnosticEventSchema: z.ZodObject<{
228
236
  "graph-gate-denied": "graph-gate-denied";
229
237
  "memory-extraction-warning": "memory-extraction-warning";
230
238
  "memory-runtime-warning": "memory-runtime-warning";
239
+ "node-budget-exhausted": "node-budget-exhausted";
231
240
  "opencode-server-url": "opencode-server-url";
232
241
  "opencode-version-read-failed": "opencode-version-read-failed";
233
242
  "privacy-inert": "privacy-inert";
@@ -236,6 +245,8 @@ export declare const DiagnosticEventSchema: z.ZodObject<{
236
245
  "telemetry-write-failed": "telemetry-write-failed";
237
246
  "unknown-role": "unknown-role";
238
247
  }>;
248
+ roleID: z.ZodOptional<z.ZodString>;
249
+ passCount: z.ZodOptional<z.ZodNumber>;
239
250
  }, z.core.$strict>;
240
251
  export declare const OpenTeamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
241
252
  v: z.ZodLiteral<1>;
@@ -386,6 +397,7 @@ export declare const OpenTeamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
386
397
  "graph-gate-denied": "graph-gate-denied";
387
398
  "memory-extraction-warning": "memory-extraction-warning";
388
399
  "memory-runtime-warning": "memory-runtime-warning";
400
+ "node-budget-exhausted": "node-budget-exhausted";
389
401
  "opencode-server-url": "opencode-server-url";
390
402
  "opencode-version-read-failed": "opencode-version-read-failed";
391
403
  "privacy-inert": "privacy-inert";
@@ -394,6 +406,8 @@ export declare const OpenTeamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
394
406
  "telemetry-write-failed": "telemetry-write-failed";
395
407
  "unknown-role": "unknown-role";
396
408
  }>;
409
+ roleID: z.ZodOptional<z.ZodString>;
410
+ passCount: z.ZodOptional<z.ZodNumber>;
397
411
  }, z.core.$strict>], "type">;
398
412
  export type OpenTeamEvent = z.infer<typeof OpenTeamEventSchema>;
399
413
  export type RouteEvent = z.infer<typeof RouteEventSchema>;