@crewhaus/spec 0.4.0 → 0.4.2

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/dist/index.d.ts CHANGED
@@ -1718,6 +1718,73 @@ declare const observabilityBlock: z.ZodOptional<z.ZodObject<{
1718
1718
  endpoint?: string | undefined;
1719
1719
  } | undefined;
1720
1720
  }>>;
1721
+ /**
1722
+ * "Watch me" — observe this harness's interactions and learn from them
1723
+ * (design/watch-me.md). Presence turns on the live capture tap; `crewhaus
1724
+ * watchme report` distills the watched sessions post-hoc. Carried on the
1725
+ * three interactive-loop shapes (cli, channel, managed); the strict unions
1726
+ * reject the key loudly elsewhere (research/crew are a named deferral,
1727
+ * design/watch-me.md §13.1).
1728
+ *
1729
+ * Deliberately a SIBLING of `observability:`, not a sub-key of it:
1730
+ * observability controls the generic telemetry subscribers (ring buffer,
1731
+ * printers, metrics, cost, alerts, otel) while watchme is a learning feature
1732
+ * with its own durable store and spec-synthesis outputs. Capture is
1733
+ * INDEPENDENT of `observability.trace.level` — that knob controls the ring
1734
+ * buffer + printers only, never the watchme tap.
1735
+ *
1736
+ * Every knob defaults, so a bare `watchme: {}` is a complete declaration.
1737
+ * NO `watchme.*` path is optimizer-tunable — see the exclusion note beside
1738
+ * OPTIMIZABLE_PATHS in `@crewhaus/spec-patch`.
1739
+ */
1740
+ declare const watchmeBlock: z.ZodOptional<z.ZodObject<{
1741
+ enabled: z.ZodDefault<z.ZodBoolean>;
1742
+ /** "full" = write the .events.jsonl trace sibling; "mirrors" = rely on the
1743
+ * default-on advisor mirrors only (retro-analysis grade, no extra file). */
1744
+ capture: z.ZodDefault<z.ZodEnum<["full", "mirrors"]>>;
1745
+ judge: z.ZodOptional<z.ZodObject<{
1746
+ /** Judge model for the sampled phase-2 quality pass. Refused at runtime
1747
+ * if unpriced (dream-engine pattern) — the budget cap must be
1748
+ * enforceable. */
1749
+ model: z.ZodDefault<z.ZodString>;
1750
+ /** Fraction of ungraded turns escalated to the judge. */
1751
+ sample_rate: z.ZodDefault<z.ZodNumber>;
1752
+ /** Per-report spend cap. 0 (default) = deterministic-only reports. */
1753
+ budget_usd: z.ZodDefault<z.ZodNumber>;
1754
+ }, "strict", z.ZodTypeAny, {
1755
+ model: string;
1756
+ budget_usd: number;
1757
+ sample_rate: number;
1758
+ }, {
1759
+ model?: string | undefined;
1760
+ budget_usd?: number | undefined;
1761
+ sample_rate?: number | undefined;
1762
+ }>>;
1763
+ /** "user" additionally registers this harness in the global registry at run time. */
1764
+ scope: z.ZodDefault<z.ZodEnum<["harness", "user"]>>;
1765
+ /** Publish redacted distilled findings to the wiki/Thredz at report time. */
1766
+ share: z.ZodDefault<z.ZodBoolean>;
1767
+ }, "strict", z.ZodTypeAny, {
1768
+ enabled: boolean;
1769
+ scope: "harness" | "user";
1770
+ capture: "full" | "mirrors";
1771
+ share: boolean;
1772
+ judge?: {
1773
+ model: string;
1774
+ budget_usd: number;
1775
+ sample_rate: number;
1776
+ } | undefined;
1777
+ }, {
1778
+ judge?: {
1779
+ model?: string | undefined;
1780
+ budget_usd?: number | undefined;
1781
+ sample_rate?: number | undefined;
1782
+ } | undefined;
1783
+ enabled?: boolean | undefined;
1784
+ scope?: "harness" | "user" | undefined;
1785
+ capture?: "full" | "mirrors" | undefined;
1786
+ share?: boolean | undefined;
1787
+ }>>;
1721
1788
  /**
1722
1789
  * Item 1 (G30) — the `expose:` block: project THIS compiled bundle's turn
1723
1790
  * function as an MCP server so Claude Code / IDEs / other CrewHaus runtimes
@@ -3226,6 +3293,54 @@ declare const cliSchema: z.ZodObject<{
3226
3293
  endpoint?: string | undefined;
3227
3294
  } | undefined;
3228
3295
  }>>;
3296
+ watchme: z.ZodOptional<z.ZodObject<{
3297
+ enabled: z.ZodDefault<z.ZodBoolean>;
3298
+ /** "full" = write the .events.jsonl trace sibling; "mirrors" = rely on the
3299
+ * default-on advisor mirrors only (retro-analysis grade, no extra file). */
3300
+ capture: z.ZodDefault<z.ZodEnum<["full", "mirrors"]>>;
3301
+ judge: z.ZodOptional<z.ZodObject<{
3302
+ /** Judge model for the sampled phase-2 quality pass. Refused at runtime
3303
+ * if unpriced (dream-engine pattern) — the budget cap must be
3304
+ * enforceable. */
3305
+ model: z.ZodDefault<z.ZodString>;
3306
+ /** Fraction of ungraded turns escalated to the judge. */
3307
+ sample_rate: z.ZodDefault<z.ZodNumber>;
3308
+ /** Per-report spend cap. 0 (default) = deterministic-only reports. */
3309
+ budget_usd: z.ZodDefault<z.ZodNumber>;
3310
+ }, "strict", z.ZodTypeAny, {
3311
+ model: string;
3312
+ budget_usd: number;
3313
+ sample_rate: number;
3314
+ }, {
3315
+ model?: string | undefined;
3316
+ budget_usd?: number | undefined;
3317
+ sample_rate?: number | undefined;
3318
+ }>>;
3319
+ /** "user" additionally registers this harness in the global registry at run time. */
3320
+ scope: z.ZodDefault<z.ZodEnum<["harness", "user"]>>;
3321
+ /** Publish redacted distilled findings to the wiki/Thredz at report time. */
3322
+ share: z.ZodDefault<z.ZodBoolean>;
3323
+ }, "strict", z.ZodTypeAny, {
3324
+ enabled: boolean;
3325
+ scope: "harness" | "user";
3326
+ capture: "full" | "mirrors";
3327
+ share: boolean;
3328
+ judge?: {
3329
+ model: string;
3330
+ budget_usd: number;
3331
+ sample_rate: number;
3332
+ } | undefined;
3333
+ }, {
3334
+ judge?: {
3335
+ model?: string | undefined;
3336
+ budget_usd?: number | undefined;
3337
+ sample_rate?: number | undefined;
3338
+ } | undefined;
3339
+ enabled?: boolean | undefined;
3340
+ scope?: "harness" | "user" | undefined;
3341
+ capture?: "full" | "mirrors" | undefined;
3342
+ share?: boolean | undefined;
3343
+ }>>;
3229
3344
  cli: z.ZodOptional<z.ZodObject<{
3230
3345
  banner: z.ZodOptional<z.ZodObject<{
3231
3346
  taglineMode: z.ZodDefault<z.ZodEnum<["static", "random"]>>;
@@ -3659,6 +3774,17 @@ declare const cliSchema: z.ZodObject<{
3659
3774
  endpoint?: string | undefined;
3660
3775
  } | undefined;
3661
3776
  } | undefined;
3777
+ watchme?: {
3778
+ enabled: boolean;
3779
+ scope: "harness" | "user";
3780
+ capture: "full" | "mirrors";
3781
+ share: boolean;
3782
+ judge?: {
3783
+ model: string;
3784
+ budget_usd: number;
3785
+ sample_rate: number;
3786
+ } | undefined;
3787
+ } | undefined;
3662
3788
  chains?: {
3663
3789
  kind: "evm";
3664
3790
  id: string;
@@ -3983,6 +4109,17 @@ declare const cliSchema: z.ZodObject<{
3983
4109
  endpoint?: string | undefined;
3984
4110
  } | undefined;
3985
4111
  } | undefined;
4112
+ watchme?: {
4113
+ judge?: {
4114
+ model?: string | undefined;
4115
+ budget_usd?: number | undefined;
4116
+ sample_rate?: number | undefined;
4117
+ } | undefined;
4118
+ enabled?: boolean | undefined;
4119
+ scope?: "harness" | "user" | undefined;
4120
+ capture?: "full" | "mirrors" | undefined;
4121
+ share?: boolean | undefined;
4122
+ } | undefined;
3986
4123
  chains?: {
3987
4124
  kind: "evm";
3988
4125
  id: string;
@@ -6193,14 +6330,17 @@ declare const whatsappChannelSchema: z.ZodObject<{
6193
6330
  phoneNumberId: z.ZodString;
6194
6331
  accessToken: z.ZodString;
6195
6332
  appSecret: z.ZodString;
6333
+ verifyToken: z.ZodOptional<z.ZodString>;
6196
6334
  }, "strict", z.ZodTypeAny, {
6197
6335
  phoneNumberId: string;
6198
6336
  accessToken: string;
6199
6337
  appSecret: string;
6338
+ verifyToken?: string | undefined;
6200
6339
  }, {
6201
6340
  phoneNumberId: string;
6202
6341
  accessToken: string;
6203
6342
  appSecret: string;
6343
+ verifyToken?: string | undefined;
6204
6344
  }>;
6205
6345
  declare const imessageChannelSchema: z.ZodObject<{
6206
6346
  chatDbPath: z.ZodOptional<z.ZodString>;
@@ -7377,14 +7517,17 @@ declare const channelSchema: z.ZodObject<{
7377
7517
  phoneNumberId: z.ZodString;
7378
7518
  accessToken: z.ZodString;
7379
7519
  appSecret: z.ZodString;
7520
+ verifyToken: z.ZodOptional<z.ZodString>;
7380
7521
  }, "strict", z.ZodTypeAny, {
7381
7522
  phoneNumberId: string;
7382
7523
  accessToken: string;
7383
7524
  appSecret: string;
7525
+ verifyToken?: string | undefined;
7384
7526
  }, {
7385
7527
  phoneNumberId: string;
7386
7528
  accessToken: string;
7387
7529
  appSecret: string;
7530
+ verifyToken?: string | undefined;
7388
7531
  }>>;
7389
7532
  imessage: z.ZodOptional<z.ZodObject<{
7390
7533
  chatDbPath: z.ZodOptional<z.ZodString>;
@@ -7415,6 +7558,7 @@ declare const channelSchema: z.ZodObject<{
7415
7558
  phoneNumberId: string;
7416
7559
  accessToken: string;
7417
7560
  appSecret: string;
7561
+ verifyToken?: string | undefined;
7418
7562
  } | undefined;
7419
7563
  imessage?: {
7420
7564
  chatDbPath?: string | undefined;
@@ -7439,6 +7583,7 @@ declare const channelSchema: z.ZodObject<{
7439
7583
  phoneNumberId: string;
7440
7584
  accessToken: string;
7441
7585
  appSecret: string;
7586
+ verifyToken?: string | undefined;
7442
7587
  } | undefined;
7443
7588
  imessage?: {
7444
7589
  chatDbPath?: string | undefined;
@@ -7463,6 +7608,7 @@ declare const channelSchema: z.ZodObject<{
7463
7608
  phoneNumberId: string;
7464
7609
  accessToken: string;
7465
7610
  appSecret: string;
7611
+ verifyToken?: string | undefined;
7466
7612
  } | undefined;
7467
7613
  imessage?: {
7468
7614
  chatDbPath?: string | undefined;
@@ -7487,6 +7633,7 @@ declare const channelSchema: z.ZodObject<{
7487
7633
  phoneNumberId: string;
7488
7634
  accessToken: string;
7489
7635
  appSecret: string;
7636
+ verifyToken?: string | undefined;
7490
7637
  } | undefined;
7491
7638
  imessage?: {
7492
7639
  chatDbPath?: string | undefined;
@@ -7496,9 +7643,9 @@ declare const channelSchema: z.ZodObject<{
7496
7643
  routing: z.ZodObject<{
7497
7644
  sessionKey: z.ZodEnum<["thread", "user", "channel"]>;
7498
7645
  }, "strict", z.ZodTypeAny, {
7499
- sessionKey: "thread" | "user" | "channel";
7646
+ sessionKey: "user" | "thread" | "channel";
7500
7647
  }, {
7501
- sessionKey: "thread" | "user" | "channel";
7648
+ sessionKey: "user" | "thread" | "channel";
7502
7649
  }>;
7503
7650
  mcp_servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"transport", [z.ZodObject<{
7504
7651
  transport: z.ZodLiteral<"stdio">;
@@ -8346,6 +8493,54 @@ declare const channelSchema: z.ZodObject<{
8346
8493
  endpoint?: string | undefined;
8347
8494
  } | undefined;
8348
8495
  }>>;
8496
+ watchme: z.ZodOptional<z.ZodObject<{
8497
+ enabled: z.ZodDefault<z.ZodBoolean>;
8498
+ /** "full" = write the .events.jsonl trace sibling; "mirrors" = rely on the
8499
+ * default-on advisor mirrors only (retro-analysis grade, no extra file). */
8500
+ capture: z.ZodDefault<z.ZodEnum<["full", "mirrors"]>>;
8501
+ judge: z.ZodOptional<z.ZodObject<{
8502
+ /** Judge model for the sampled phase-2 quality pass. Refused at runtime
8503
+ * if unpriced (dream-engine pattern) — the budget cap must be
8504
+ * enforceable. */
8505
+ model: z.ZodDefault<z.ZodString>;
8506
+ /** Fraction of ungraded turns escalated to the judge. */
8507
+ sample_rate: z.ZodDefault<z.ZodNumber>;
8508
+ /** Per-report spend cap. 0 (default) = deterministic-only reports. */
8509
+ budget_usd: z.ZodDefault<z.ZodNumber>;
8510
+ }, "strict", z.ZodTypeAny, {
8511
+ model: string;
8512
+ budget_usd: number;
8513
+ sample_rate: number;
8514
+ }, {
8515
+ model?: string | undefined;
8516
+ budget_usd?: number | undefined;
8517
+ sample_rate?: number | undefined;
8518
+ }>>;
8519
+ /** "user" additionally registers this harness in the global registry at run time. */
8520
+ scope: z.ZodDefault<z.ZodEnum<["harness", "user"]>>;
8521
+ /** Publish redacted distilled findings to the wiki/Thredz at report time. */
8522
+ share: z.ZodDefault<z.ZodBoolean>;
8523
+ }, "strict", z.ZodTypeAny, {
8524
+ enabled: boolean;
8525
+ scope: "harness" | "user";
8526
+ capture: "full" | "mirrors";
8527
+ share: boolean;
8528
+ judge?: {
8529
+ model: string;
8530
+ budget_usd: number;
8531
+ sample_rate: number;
8532
+ } | undefined;
8533
+ }, {
8534
+ judge?: {
8535
+ model?: string | undefined;
8536
+ budget_usd?: number | undefined;
8537
+ sample_rate?: number | undefined;
8538
+ } | undefined;
8539
+ enabled?: boolean | undefined;
8540
+ scope?: "harness" | "user" | undefined;
8541
+ capture?: "full" | "mirrors" | undefined;
8542
+ share?: boolean | undefined;
8543
+ }>>;
8349
8544
  heartbeat: z.ZodOptional<z.ZodObject<{
8350
8545
  every: z.ZodString;
8351
8546
  instructions: z.ZodString;
@@ -8514,7 +8709,7 @@ declare const channelSchema: z.ZodObject<{
8514
8709
  }>>;
8515
8710
  }, "strict", z.ZodTypeAny, {
8516
8711
  routing: {
8517
- sessionKey: "thread" | "user" | "channel";
8712
+ sessionKey: "user" | "thread" | "channel";
8518
8713
  };
8519
8714
  name: string;
8520
8715
  target: "channel";
@@ -8610,6 +8805,7 @@ declare const channelSchema: z.ZodObject<{
8610
8805
  phoneNumberId: string;
8611
8806
  accessToken: string;
8612
8807
  appSecret: string;
8808
+ verifyToken?: string | undefined;
8613
8809
  } | undefined;
8614
8810
  imessage?: {
8615
8811
  chatDbPath?: string | undefined;
@@ -8814,6 +9010,17 @@ declare const channelSchema: z.ZodObject<{
8814
9010
  endpoint?: string | undefined;
8815
9011
  } | undefined;
8816
9012
  } | undefined;
9013
+ watchme?: {
9014
+ enabled: boolean;
9015
+ scope: "harness" | "user";
9016
+ capture: "full" | "mirrors";
9017
+ share: boolean;
9018
+ judge?: {
9019
+ model: string;
9020
+ budget_usd: number;
9021
+ sample_rate: number;
9022
+ } | undefined;
9023
+ } | undefined;
8817
9024
  chains?: {
8818
9025
  kind: "evm";
8819
9026
  id: string;
@@ -8871,7 +9078,7 @@ declare const channelSchema: z.ZodObject<{
8871
9078
  } | undefined;
8872
9079
  }, {
8873
9080
  routing: {
8874
- sessionKey: "thread" | "user" | "channel";
9081
+ sessionKey: "user" | "thread" | "channel";
8875
9082
  };
8876
9083
  name: string;
8877
9084
  target: "channel";
@@ -8967,6 +9174,7 @@ declare const channelSchema: z.ZodObject<{
8967
9174
  phoneNumberId: string;
8968
9175
  accessToken: string;
8969
9176
  appSecret: string;
9177
+ verifyToken?: string | undefined;
8970
9178
  } | undefined;
8971
9179
  imessage?: {
8972
9180
  chatDbPath?: string | undefined;
@@ -9171,6 +9379,17 @@ declare const channelSchema: z.ZodObject<{
9171
9379
  endpoint?: string | undefined;
9172
9380
  } | undefined;
9173
9381
  } | undefined;
9382
+ watchme?: {
9383
+ judge?: {
9384
+ model?: string | undefined;
9385
+ budget_usd?: number | undefined;
9386
+ sample_rate?: number | undefined;
9387
+ } | undefined;
9388
+ enabled?: boolean | undefined;
9389
+ scope?: "harness" | "user" | undefined;
9390
+ capture?: "full" | "mirrors" | undefined;
9391
+ share?: boolean | undefined;
9392
+ } | undefined;
9174
9393
  chains?: {
9175
9394
  kind: "evm";
9176
9395
  id: string;
@@ -9250,9 +9469,28 @@ declare const graphNodeSchema: z.ZodObject<{
9250
9469
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9251
9470
  tool_config: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
9252
9471
  /**
9253
- * When true, the node calls `ctx.requestApproval(prompt)` before
9254
- * returning. The engine pauses, persists a checkpoint, and waits for
9255
- * `resume(checkpointId, decision)` from the operator/CLI.
9472
+ * A human approval gate on this node, and a PRE-condition: the node
9473
+ * calls `ctx.requestApproval(prompt)` BEFORE its model turn, so the
9474
+ * prompt is answered against the UPSTREAM state (which the `hitl_pause`
9475
+ * event and the bundle's pause report both print) and no tokens are
9476
+ * spent until the human answers. The engine pauses, persists a
9477
+ * checkpoint, and waits for `resume(checkpointId, decision)` from the
9478
+ * operator/CLI; the resumed run replays this node from the top and
9479
+ * makes its FIRST model call.
9480
+ *
9481
+ * The decision string is recorded at `state["<node>_decision"]`, which
9482
+ * every downstream node reads as part of the upstream state. (NOTE:
9483
+ * `edges[].when.key` cannot name it yet — that key must name a declared
9484
+ * node; see the `graphEdgeWhenSchema` note below.) A rejecting decision
9485
+ * — `reject`, `no`, `deny`, `decline`, `abort`, `cancel`, `stop`, `veto`
9486
+ * (trimmed, case-insensitive) — cancels this node's turn entirely, so
9487
+ * the node records only its decision and no output; any other string,
9488
+ * including free text, approves it. To halt the run on a rejection,
9489
+ * guard the node's outgoing edge with `when: { key: <node>, exists:
9490
+ * true }` — a cancelled node records no output, so no edge matches.
9491
+ *
9492
+ * To have a human approve a node's OWN output, put the gate on the
9493
+ * DOWNSTREAM node: its upstream state is exactly that output.
9256
9494
  */
9257
9495
  hitl: z.ZodOptional<z.ZodObject<{
9258
9496
  prompt: z.ZodString;
@@ -9359,9 +9597,28 @@ declare const graphAnyNodeSchema: z.ZodUnion<[z.ZodObject<{
9359
9597
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9360
9598
  tool_config: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
9361
9599
  /**
9362
- * When true, the node calls `ctx.requestApproval(prompt)` before
9363
- * returning. The engine pauses, persists a checkpoint, and waits for
9364
- * `resume(checkpointId, decision)` from the operator/CLI.
9600
+ * A human approval gate on this node, and a PRE-condition: the node
9601
+ * calls `ctx.requestApproval(prompt)` BEFORE its model turn, so the
9602
+ * prompt is answered against the UPSTREAM state (which the `hitl_pause`
9603
+ * event and the bundle's pause report both print) and no tokens are
9604
+ * spent until the human answers. The engine pauses, persists a
9605
+ * checkpoint, and waits for `resume(checkpointId, decision)` from the
9606
+ * operator/CLI; the resumed run replays this node from the top and
9607
+ * makes its FIRST model call.
9608
+ *
9609
+ * The decision string is recorded at `state["<node>_decision"]`, which
9610
+ * every downstream node reads as part of the upstream state. (NOTE:
9611
+ * `edges[].when.key` cannot name it yet — that key must name a declared
9612
+ * node; see the `graphEdgeWhenSchema` note below.) A rejecting decision
9613
+ * — `reject`, `no`, `deny`, `decline`, `abort`, `cancel`, `stop`, `veto`
9614
+ * (trimmed, case-insensitive) — cancels this node's turn entirely, so
9615
+ * the node records only its decision and no output; any other string,
9616
+ * including free text, approves it. To halt the run on a rejection,
9617
+ * guard the node's outgoing edge with `when: { key: <node>, exists:
9618
+ * true }` — a cancelled node records no output, so no edge matches.
9619
+ *
9620
+ * To have a human approve a node's OWN output, put the gate on the
9621
+ * DOWNSTREAM node: its upstream state is exactly that output.
9365
9622
  */
9366
9623
  hitl: z.ZodOptional<z.ZodObject<{
9367
9624
  prompt: z.ZodString;
@@ -9447,8 +9704,16 @@ declare const graphAnyNodeSchema: z.ZodUnion<[z.ZodObject<{
9447
9704
  * - `equals` — take the edge when `state[key] === equals` (string/number/
9448
9705
  * boolean strict equality).
9449
9706
  * - `exists: true` — take the edge when `state[key] !== undefined` (the
9450
- * node has produced output; pairs with hitl `_decision` gating in a
9451
- * follow-up).
9707
+ * node has produced output which, for a `hitl:` node, is FALSE when
9708
+ * the operator rejected the gate, since a rejected node records only
9709
+ * `state["<node>_decision"]`).
9710
+ *
9711
+ * GAP (unchanged by the pre-condition HITL fix): `key` may not yet name a
9712
+ * hitl node's `<node>_decision` record — the cross-check below pins it to a
9713
+ * declared node name, so a rejection can be observed via `exists` on the
9714
+ * node itself but not matched on the decision string. Widening it means
9715
+ * touching the three mirrored checks (this one, ir-passes' graph
9716
+ * wellformedness, target-graph's validateGraph).
9452
9717
  *
9453
9718
  * Lowered to `IrGraphEdge.when` and emitted as a graph-engine
9454
9719
  * `EdgeCondition` (`(state) => state[key] === equals` / `!== undefined`).
@@ -9546,9 +9811,28 @@ declare const graphSchema: z.ZodObject<{
9546
9811
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9547
9812
  tool_config: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
9548
9813
  /**
9549
- * When true, the node calls `ctx.requestApproval(prompt)` before
9550
- * returning. The engine pauses, persists a checkpoint, and waits for
9551
- * `resume(checkpointId, decision)` from the operator/CLI.
9814
+ * A human approval gate on this node, and a PRE-condition: the node
9815
+ * calls `ctx.requestApproval(prompt)` BEFORE its model turn, so the
9816
+ * prompt is answered against the UPSTREAM state (which the `hitl_pause`
9817
+ * event and the bundle's pause report both print) and no tokens are
9818
+ * spent until the human answers. The engine pauses, persists a
9819
+ * checkpoint, and waits for `resume(checkpointId, decision)` from the
9820
+ * operator/CLI; the resumed run replays this node from the top and
9821
+ * makes its FIRST model call.
9822
+ *
9823
+ * The decision string is recorded at `state["<node>_decision"]`, which
9824
+ * every downstream node reads as part of the upstream state. (NOTE:
9825
+ * `edges[].when.key` cannot name it yet — that key must name a declared
9826
+ * node; see the `graphEdgeWhenSchema` note below.) A rejecting decision
9827
+ * — `reject`, `no`, `deny`, `decline`, `abort`, `cancel`, `stop`, `veto`
9828
+ * (trimmed, case-insensitive) — cancels this node's turn entirely, so
9829
+ * the node records only its decision and no output; any other string,
9830
+ * including free text, approves it. To halt the run on a rejection,
9831
+ * guard the node's outgoing edge with `when: { key: <node>, exists:
9832
+ * true }` — a cancelled node records no output, so no edge matches.
9833
+ *
9834
+ * To have a human approve a node's OWN output, put the gate on the
9835
+ * DOWNSTREAM node: its upstream state is exactly that output.
9552
9836
  */
9553
9837
  hitl: z.ZodOptional<z.ZodObject<{
9554
9838
  prompt: z.ZodString;
@@ -11067,6 +11351,56 @@ declare const managedSchema: z.ZodObject<{
11067
11351
  on_fail?: "retry" | "halt" | "note" | undefined;
11068
11352
  max_retries?: number | undefined;
11069
11353
  }>>;
11354
+ feedback: z.ZodOptional<z.ZodObject<{
11355
+ enabled: z.ZodOptional<z.ZodBoolean>;
11356
+ modality: z.ZodDefault<z.ZodEnum<["binary", "stars", "scale", "comment"]>>;
11357
+ scale: z.ZodOptional<z.ZodObject<{
11358
+ min: z.ZodNumber;
11359
+ max: z.ZodNumber;
11360
+ }, "strict", z.ZodTypeAny, {
11361
+ min: number;
11362
+ max: number;
11363
+ }, {
11364
+ min: number;
11365
+ max: number;
11366
+ }>>;
11367
+ storage: z.ZodOptional<z.ZodObject<{
11368
+ location: z.ZodString;
11369
+ }, "strict", z.ZodTypeAny, {
11370
+ location: string;
11371
+ }, {
11372
+ location: string;
11373
+ }>>;
11374
+ autoDistill: z.ZodOptional<z.ZodBoolean>;
11375
+ exitPrompt: z.ZodOptional<z.ZodBoolean>;
11376
+ channelReactions: z.ZodOptional<z.ZodBoolean>;
11377
+ }, "strict", z.ZodTypeAny, {
11378
+ modality: "binary" | "stars" | "scale" | "comment";
11379
+ enabled?: boolean | undefined;
11380
+ scale?: {
11381
+ min: number;
11382
+ max: number;
11383
+ } | undefined;
11384
+ storage?: {
11385
+ location: string;
11386
+ } | undefined;
11387
+ autoDistill?: boolean | undefined;
11388
+ exitPrompt?: boolean | undefined;
11389
+ channelReactions?: boolean | undefined;
11390
+ }, {
11391
+ enabled?: boolean | undefined;
11392
+ scale?: {
11393
+ min: number;
11394
+ max: number;
11395
+ } | undefined;
11396
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
11397
+ storage?: {
11398
+ location: string;
11399
+ } | undefined;
11400
+ autoDistill?: boolean | undefined;
11401
+ exitPrompt?: boolean | undefined;
11402
+ channelReactions?: boolean | undefined;
11403
+ }>>;
11070
11404
  memory: z.ZodOptional<z.ZodObject<{
11071
11405
  enabled: z.ZodOptional<z.ZodBoolean>;
11072
11406
  backend: z.ZodOptional<z.ZodEnum<["file", "thredz"]>>;
@@ -11508,6 +11842,54 @@ declare const managedSchema: z.ZodObject<{
11508
11842
  endpoint?: string | undefined;
11509
11843
  } | undefined;
11510
11844
  }>>;
11845
+ watchme: z.ZodOptional<z.ZodObject<{
11846
+ enabled: z.ZodDefault<z.ZodBoolean>;
11847
+ /** "full" = write the .events.jsonl trace sibling; "mirrors" = rely on the
11848
+ * default-on advisor mirrors only (retro-analysis grade, no extra file). */
11849
+ capture: z.ZodDefault<z.ZodEnum<["full", "mirrors"]>>;
11850
+ judge: z.ZodOptional<z.ZodObject<{
11851
+ /** Judge model for the sampled phase-2 quality pass. Refused at runtime
11852
+ * if unpriced (dream-engine pattern) — the budget cap must be
11853
+ * enforceable. */
11854
+ model: z.ZodDefault<z.ZodString>;
11855
+ /** Fraction of ungraded turns escalated to the judge. */
11856
+ sample_rate: z.ZodDefault<z.ZodNumber>;
11857
+ /** Per-report spend cap. 0 (default) = deterministic-only reports. */
11858
+ budget_usd: z.ZodDefault<z.ZodNumber>;
11859
+ }, "strict", z.ZodTypeAny, {
11860
+ model: string;
11861
+ budget_usd: number;
11862
+ sample_rate: number;
11863
+ }, {
11864
+ model?: string | undefined;
11865
+ budget_usd?: number | undefined;
11866
+ sample_rate?: number | undefined;
11867
+ }>>;
11868
+ /** "user" additionally registers this harness in the global registry at run time. */
11869
+ scope: z.ZodDefault<z.ZodEnum<["harness", "user"]>>;
11870
+ /** Publish redacted distilled findings to the wiki/Thredz at report time. */
11871
+ share: z.ZodDefault<z.ZodBoolean>;
11872
+ }, "strict", z.ZodTypeAny, {
11873
+ enabled: boolean;
11874
+ scope: "harness" | "user";
11875
+ capture: "full" | "mirrors";
11876
+ share: boolean;
11877
+ judge?: {
11878
+ model: string;
11879
+ budget_usd: number;
11880
+ sample_rate: number;
11881
+ } | undefined;
11882
+ }, {
11883
+ judge?: {
11884
+ model?: string | undefined;
11885
+ budget_usd?: number | undefined;
11886
+ sample_rate?: number | undefined;
11887
+ } | undefined;
11888
+ enabled?: boolean | undefined;
11889
+ scope?: "harness" | "user" | undefined;
11890
+ capture?: "full" | "mirrors" | undefined;
11891
+ share?: boolean | undefined;
11892
+ }>>;
11511
11893
  schedule: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
11512
11894
  kind: z.ZodLiteral<"cron">;
11513
11895
  cron: z.ZodString;
@@ -11708,6 +12090,20 @@ declare const managedSchema: z.ZodObject<{
11708
12090
  on_fail?: "retry" | "halt" | "note" | undefined;
11709
12091
  max_retries?: number | undefined;
11710
12092
  } | undefined;
12093
+ feedback?: {
12094
+ modality: "binary" | "stars" | "scale" | "comment";
12095
+ enabled?: boolean | undefined;
12096
+ scale?: {
12097
+ min: number;
12098
+ max: number;
12099
+ } | undefined;
12100
+ storage?: {
12101
+ location: string;
12102
+ } | undefined;
12103
+ autoDistill?: boolean | undefined;
12104
+ exitPrompt?: boolean | undefined;
12105
+ channelReactions?: boolean | undefined;
12106
+ } | undefined;
11711
12107
  memory?: {
11712
12108
  backend?: "file" | "thredz" | undefined;
11713
12109
  enabled?: boolean | undefined;
@@ -11785,6 +12181,17 @@ declare const managedSchema: z.ZodObject<{
11785
12181
  endpoint?: string | undefined;
11786
12182
  } | undefined;
11787
12183
  } | undefined;
12184
+ watchme?: {
12185
+ enabled: boolean;
12186
+ scope: "harness" | "user";
12187
+ capture: "full" | "mirrors";
12188
+ share: boolean;
12189
+ judge?: {
12190
+ model: string;
12191
+ budget_usd: number;
12192
+ sample_rate: number;
12193
+ } | undefined;
12194
+ } | undefined;
11788
12195
  schedule?: {
11789
12196
  kind: "cron";
11790
12197
  cron: string;
@@ -11962,6 +12369,20 @@ declare const managedSchema: z.ZodObject<{
11962
12369
  on_fail?: "retry" | "halt" | "note" | undefined;
11963
12370
  max_retries?: number | undefined;
11964
12371
  } | undefined;
12372
+ feedback?: {
12373
+ enabled?: boolean | undefined;
12374
+ scale?: {
12375
+ min: number;
12376
+ max: number;
12377
+ } | undefined;
12378
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
12379
+ storage?: {
12380
+ location: string;
12381
+ } | undefined;
12382
+ autoDistill?: boolean | undefined;
12383
+ exitPrompt?: boolean | undefined;
12384
+ channelReactions?: boolean | undefined;
12385
+ } | undefined;
11965
12386
  memory?: {
11966
12387
  backend?: "file" | "thredz" | undefined;
11967
12388
  enabled?: boolean | undefined;
@@ -12039,6 +12460,17 @@ declare const managedSchema: z.ZodObject<{
12039
12460
  endpoint?: string | undefined;
12040
12461
  } | undefined;
12041
12462
  } | undefined;
12463
+ watchme?: {
12464
+ judge?: {
12465
+ model?: string | undefined;
12466
+ budget_usd?: number | undefined;
12467
+ sample_rate?: number | undefined;
12468
+ } | undefined;
12469
+ enabled?: boolean | undefined;
12470
+ scope?: "harness" | "user" | undefined;
12471
+ capture?: "full" | "mirrors" | undefined;
12472
+ share?: boolean | undefined;
12473
+ } | undefined;
12042
12474
  schedule?: {
12043
12475
  kind: "cron";
12044
12476
  cron: string;
@@ -17733,12 +18165,29 @@ declare const browserDriverSchema: z.ZodObject<{
17733
18165
  height?: number | undefined;
17734
18166
  }>>;
17735
18167
  startUrl: z.ZodOptional<z.ZodString>;
18168
+ /**
18169
+ * SECURITY — opt in to private/loopback navigation targets. Default false:
18170
+ * the Navigate tool refuses private/loopback/link-local/metadata hosts
18171
+ * before `driver.goto`, and the chromium backend routes every request
18172
+ * through a DNS-pinning proxy that refuses the same floor at the
18173
+ * connection layer. Together they stop a prompt-injected page from
18174
+ * reaching the host's own services.
18175
+ *
18176
+ * Set true ONLY when the browser legitimately must reach a private target
18177
+ * the operator controls AND the page content is trusted — an intranet app
18178
+ * under test, or a locally-served fixture page (what the browser runtime
18179
+ * smoke does). It relaxes BOTH layers for this spec, so it stays a
18180
+ * per-spec reviewed decision and never a global switch. The http/https
18181
+ * scheme allowlist is NOT waived.
18182
+ */
18183
+ allowPrivateTargets: z.ZodDefault<z.ZodBoolean>;
17736
18184
  }, "strict", z.ZodTypeAny, {
17737
18185
  backend: "host" | "chromium" | "remote";
17738
18186
  viewport: {
17739
18187
  width: number;
17740
18188
  height: number;
17741
18189
  };
18190
+ allowPrivateTargets: boolean;
17742
18191
  startUrl?: string | undefined;
17743
18192
  }, {
17744
18193
  backend?: "host" | "chromium" | "remote" | undefined;
@@ -17747,6 +18196,7 @@ declare const browserDriverSchema: z.ZodObject<{
17747
18196
  height?: number | undefined;
17748
18197
  } | undefined;
17749
18198
  startUrl?: string | undefined;
18199
+ allowPrivateTargets?: boolean | undefined;
17750
18200
  }>;
17751
18201
  declare const browserSchema: z.ZodObject<{
17752
18202
  name: z.ZodString;
@@ -18023,12 +18473,29 @@ declare const browserSchema: z.ZodObject<{
18023
18473
  height?: number | undefined;
18024
18474
  }>>;
18025
18475
  startUrl: z.ZodOptional<z.ZodString>;
18476
+ /**
18477
+ * SECURITY — opt in to private/loopback navigation targets. Default false:
18478
+ * the Navigate tool refuses private/loopback/link-local/metadata hosts
18479
+ * before `driver.goto`, and the chromium backend routes every request
18480
+ * through a DNS-pinning proxy that refuses the same floor at the
18481
+ * connection layer. Together they stop a prompt-injected page from
18482
+ * reaching the host's own services.
18483
+ *
18484
+ * Set true ONLY when the browser legitimately must reach a private target
18485
+ * the operator controls AND the page content is trusted — an intranet app
18486
+ * under test, or a locally-served fixture page (what the browser runtime
18487
+ * smoke does). It relaxes BOTH layers for this spec, so it stays a
18488
+ * per-spec reviewed decision and never a global switch. The http/https
18489
+ * scheme allowlist is NOT waived.
18490
+ */
18491
+ allowPrivateTargets: z.ZodDefault<z.ZodBoolean>;
18026
18492
  }, "strict", z.ZodTypeAny, {
18027
18493
  backend: "host" | "chromium" | "remote";
18028
18494
  viewport: {
18029
18495
  width: number;
18030
18496
  height: number;
18031
18497
  };
18498
+ allowPrivateTargets: boolean;
18032
18499
  startUrl?: string | undefined;
18033
18500
  }, {
18034
18501
  backend?: "host" | "chromium" | "remote" | undefined;
@@ -18037,6 +18504,7 @@ declare const browserSchema: z.ZodObject<{
18037
18504
  height?: number | undefined;
18038
18505
  } | undefined;
18039
18506
  startUrl?: string | undefined;
18507
+ allowPrivateTargets?: boolean | undefined;
18040
18508
  }>>;
18041
18509
  /** Vision-grounding model. Defaults to the agent's primary model. */
18042
18510
  groundingModel: z.ZodOptional<z.ZodString>;
@@ -18345,6 +18813,7 @@ declare const browserSchema: z.ZodObject<{
18345
18813
  width: number;
18346
18814
  height: number;
18347
18815
  };
18816
+ allowPrivateTargets: boolean;
18348
18817
  startUrl?: string | undefined;
18349
18818
  };
18350
18819
  tools?: string[] | undefined;
@@ -18537,6 +19006,7 @@ declare const browserSchema: z.ZodObject<{
18537
19006
  height?: number | undefined;
18538
19007
  } | undefined;
18539
19008
  startUrl?: string | undefined;
19009
+ allowPrivateTargets?: boolean | undefined;
18540
19010
  } | undefined;
18541
19011
  groundingModel?: string | undefined;
18542
19012
  }>;
@@ -21150,6 +21620,54 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
21150
21620
  endpoint?: string | undefined;
21151
21621
  } | undefined;
21152
21622
  }>>;
21623
+ watchme: z.ZodOptional<z.ZodObject<{
21624
+ enabled: z.ZodDefault<z.ZodBoolean>;
21625
+ /** "full" = write the .events.jsonl trace sibling; "mirrors" = rely on the
21626
+ * default-on advisor mirrors only (retro-analysis grade, no extra file). */
21627
+ capture: z.ZodDefault<z.ZodEnum<["full", "mirrors"]>>;
21628
+ judge: z.ZodOptional<z.ZodObject<{
21629
+ /** Judge model for the sampled phase-2 quality pass. Refused at runtime
21630
+ * if unpriced (dream-engine pattern) — the budget cap must be
21631
+ * enforceable. */
21632
+ model: z.ZodDefault<z.ZodString>;
21633
+ /** Fraction of ungraded turns escalated to the judge. */
21634
+ sample_rate: z.ZodDefault<z.ZodNumber>;
21635
+ /** Per-report spend cap. 0 (default) = deterministic-only reports. */
21636
+ budget_usd: z.ZodDefault<z.ZodNumber>;
21637
+ }, "strict", z.ZodTypeAny, {
21638
+ model: string;
21639
+ budget_usd: number;
21640
+ sample_rate: number;
21641
+ }, {
21642
+ model?: string | undefined;
21643
+ budget_usd?: number | undefined;
21644
+ sample_rate?: number | undefined;
21645
+ }>>;
21646
+ /** "user" additionally registers this harness in the global registry at run time. */
21647
+ scope: z.ZodDefault<z.ZodEnum<["harness", "user"]>>;
21648
+ /** Publish redacted distilled findings to the wiki/Thredz at report time. */
21649
+ share: z.ZodDefault<z.ZodBoolean>;
21650
+ }, "strict", z.ZodTypeAny, {
21651
+ enabled: boolean;
21652
+ scope: "harness" | "user";
21653
+ capture: "full" | "mirrors";
21654
+ share: boolean;
21655
+ judge?: {
21656
+ model: string;
21657
+ budget_usd: number;
21658
+ sample_rate: number;
21659
+ } | undefined;
21660
+ }, {
21661
+ judge?: {
21662
+ model?: string | undefined;
21663
+ budget_usd?: number | undefined;
21664
+ sample_rate?: number | undefined;
21665
+ } | undefined;
21666
+ enabled?: boolean | undefined;
21667
+ scope?: "harness" | "user" | undefined;
21668
+ capture?: "full" | "mirrors" | undefined;
21669
+ share?: boolean | undefined;
21670
+ }>>;
21153
21671
  cli: z.ZodOptional<z.ZodObject<{
21154
21672
  banner: z.ZodOptional<z.ZodObject<{
21155
21673
  taglineMode: z.ZodDefault<z.ZodEnum<["static", "random"]>>;
@@ -21583,6 +22101,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
21583
22101
  endpoint?: string | undefined;
21584
22102
  } | undefined;
21585
22103
  } | undefined;
22104
+ watchme?: {
22105
+ enabled: boolean;
22106
+ scope: "harness" | "user";
22107
+ capture: "full" | "mirrors";
22108
+ share: boolean;
22109
+ judge?: {
22110
+ model: string;
22111
+ budget_usd: number;
22112
+ sample_rate: number;
22113
+ } | undefined;
22114
+ } | undefined;
21586
22115
  chains?: {
21587
22116
  kind: "evm";
21588
22117
  id: string;
@@ -21907,6 +22436,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
21907
22436
  endpoint?: string | undefined;
21908
22437
  } | undefined;
21909
22438
  } | undefined;
22439
+ watchme?: {
22440
+ judge?: {
22441
+ model?: string | undefined;
22442
+ budget_usd?: number | undefined;
22443
+ sample_rate?: number | undefined;
22444
+ } | undefined;
22445
+ enabled?: boolean | undefined;
22446
+ scope?: "harness" | "user" | undefined;
22447
+ capture?: "full" | "mirrors" | undefined;
22448
+ share?: boolean | undefined;
22449
+ } | undefined;
21910
22450
  chains?: {
21911
22451
  kind: "evm";
21912
22452
  id: string;
@@ -23741,14 +24281,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
23741
24281
  phoneNumberId: z.ZodString;
23742
24282
  accessToken: z.ZodString;
23743
24283
  appSecret: z.ZodString;
24284
+ verifyToken: z.ZodOptional<z.ZodString>;
23744
24285
  }, "strict", z.ZodTypeAny, {
23745
24286
  phoneNumberId: string;
23746
24287
  accessToken: string;
23747
24288
  appSecret: string;
24289
+ verifyToken?: string | undefined;
23748
24290
  }, {
23749
24291
  phoneNumberId: string;
23750
24292
  accessToken: string;
23751
24293
  appSecret: string;
24294
+ verifyToken?: string | undefined;
23752
24295
  }>>;
23753
24296
  imessage: z.ZodOptional<z.ZodObject<{
23754
24297
  chatDbPath: z.ZodOptional<z.ZodString>;
@@ -23779,6 +24322,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
23779
24322
  phoneNumberId: string;
23780
24323
  accessToken: string;
23781
24324
  appSecret: string;
24325
+ verifyToken?: string | undefined;
23782
24326
  } | undefined;
23783
24327
  imessage?: {
23784
24328
  chatDbPath?: string | undefined;
@@ -23803,6 +24347,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
23803
24347
  phoneNumberId: string;
23804
24348
  accessToken: string;
23805
24349
  appSecret: string;
24350
+ verifyToken?: string | undefined;
23806
24351
  } | undefined;
23807
24352
  imessage?: {
23808
24353
  chatDbPath?: string | undefined;
@@ -23827,6 +24372,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
23827
24372
  phoneNumberId: string;
23828
24373
  accessToken: string;
23829
24374
  appSecret: string;
24375
+ verifyToken?: string | undefined;
23830
24376
  } | undefined;
23831
24377
  imessage?: {
23832
24378
  chatDbPath?: string | undefined;
@@ -23851,6 +24397,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
23851
24397
  phoneNumberId: string;
23852
24398
  accessToken: string;
23853
24399
  appSecret: string;
24400
+ verifyToken?: string | undefined;
23854
24401
  } | undefined;
23855
24402
  imessage?: {
23856
24403
  chatDbPath?: string | undefined;
@@ -23860,9 +24407,9 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
23860
24407
  routing: z.ZodObject<{
23861
24408
  sessionKey: z.ZodEnum<["thread", "user", "channel"]>;
23862
24409
  }, "strict", z.ZodTypeAny, {
23863
- sessionKey: "thread" | "user" | "channel";
24410
+ sessionKey: "user" | "thread" | "channel";
23864
24411
  }, {
23865
- sessionKey: "thread" | "user" | "channel";
24412
+ sessionKey: "user" | "thread" | "channel";
23866
24413
  }>;
23867
24414
  mcp_servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"transport", [z.ZodObject<{
23868
24415
  transport: z.ZodLiteral<"stdio">;
@@ -24710,6 +25257,54 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
24710
25257
  endpoint?: string | undefined;
24711
25258
  } | undefined;
24712
25259
  }>>;
25260
+ watchme: z.ZodOptional<z.ZodObject<{
25261
+ enabled: z.ZodDefault<z.ZodBoolean>;
25262
+ /** "full" = write the .events.jsonl trace sibling; "mirrors" = rely on the
25263
+ * default-on advisor mirrors only (retro-analysis grade, no extra file). */
25264
+ capture: z.ZodDefault<z.ZodEnum<["full", "mirrors"]>>;
25265
+ judge: z.ZodOptional<z.ZodObject<{
25266
+ /** Judge model for the sampled phase-2 quality pass. Refused at runtime
25267
+ * if unpriced (dream-engine pattern) — the budget cap must be
25268
+ * enforceable. */
25269
+ model: z.ZodDefault<z.ZodString>;
25270
+ /** Fraction of ungraded turns escalated to the judge. */
25271
+ sample_rate: z.ZodDefault<z.ZodNumber>;
25272
+ /** Per-report spend cap. 0 (default) = deterministic-only reports. */
25273
+ budget_usd: z.ZodDefault<z.ZodNumber>;
25274
+ }, "strict", z.ZodTypeAny, {
25275
+ model: string;
25276
+ budget_usd: number;
25277
+ sample_rate: number;
25278
+ }, {
25279
+ model?: string | undefined;
25280
+ budget_usd?: number | undefined;
25281
+ sample_rate?: number | undefined;
25282
+ }>>;
25283
+ /** "user" additionally registers this harness in the global registry at run time. */
25284
+ scope: z.ZodDefault<z.ZodEnum<["harness", "user"]>>;
25285
+ /** Publish redacted distilled findings to the wiki/Thredz at report time. */
25286
+ share: z.ZodDefault<z.ZodBoolean>;
25287
+ }, "strict", z.ZodTypeAny, {
25288
+ enabled: boolean;
25289
+ scope: "harness" | "user";
25290
+ capture: "full" | "mirrors";
25291
+ share: boolean;
25292
+ judge?: {
25293
+ model: string;
25294
+ budget_usd: number;
25295
+ sample_rate: number;
25296
+ } | undefined;
25297
+ }, {
25298
+ judge?: {
25299
+ model?: string | undefined;
25300
+ budget_usd?: number | undefined;
25301
+ sample_rate?: number | undefined;
25302
+ } | undefined;
25303
+ enabled?: boolean | undefined;
25304
+ scope?: "harness" | "user" | undefined;
25305
+ capture?: "full" | "mirrors" | undefined;
25306
+ share?: boolean | undefined;
25307
+ }>>;
24713
25308
  heartbeat: z.ZodOptional<z.ZodObject<{
24714
25309
  every: z.ZodString;
24715
25310
  instructions: z.ZodString;
@@ -24878,7 +25473,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
24878
25473
  }>>;
24879
25474
  }, "strict", z.ZodTypeAny, {
24880
25475
  routing: {
24881
- sessionKey: "thread" | "user" | "channel";
25476
+ sessionKey: "user" | "thread" | "channel";
24882
25477
  };
24883
25478
  name: string;
24884
25479
  target: "channel";
@@ -24974,6 +25569,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
24974
25569
  phoneNumberId: string;
24975
25570
  accessToken: string;
24976
25571
  appSecret: string;
25572
+ verifyToken?: string | undefined;
24977
25573
  } | undefined;
24978
25574
  imessage?: {
24979
25575
  chatDbPath?: string | undefined;
@@ -25178,6 +25774,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
25178
25774
  endpoint?: string | undefined;
25179
25775
  } | undefined;
25180
25776
  } | undefined;
25777
+ watchme?: {
25778
+ enabled: boolean;
25779
+ scope: "harness" | "user";
25780
+ capture: "full" | "mirrors";
25781
+ share: boolean;
25782
+ judge?: {
25783
+ model: string;
25784
+ budget_usd: number;
25785
+ sample_rate: number;
25786
+ } | undefined;
25787
+ } | undefined;
25181
25788
  chains?: {
25182
25789
  kind: "evm";
25183
25790
  id: string;
@@ -25235,7 +25842,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
25235
25842
  } | undefined;
25236
25843
  }, {
25237
25844
  routing: {
25238
- sessionKey: "thread" | "user" | "channel";
25845
+ sessionKey: "user" | "thread" | "channel";
25239
25846
  };
25240
25847
  name: string;
25241
25848
  target: "channel";
@@ -25331,6 +25938,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
25331
25938
  phoneNumberId: string;
25332
25939
  accessToken: string;
25333
25940
  appSecret: string;
25941
+ verifyToken?: string | undefined;
25334
25942
  } | undefined;
25335
25943
  imessage?: {
25336
25944
  chatDbPath?: string | undefined;
@@ -25535,6 +26143,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
25535
26143
  endpoint?: string | undefined;
25536
26144
  } | undefined;
25537
26145
  } | undefined;
26146
+ watchme?: {
26147
+ judge?: {
26148
+ model?: string | undefined;
26149
+ budget_usd?: number | undefined;
26150
+ sample_rate?: number | undefined;
26151
+ } | undefined;
26152
+ enabled?: boolean | undefined;
26153
+ scope?: "harness" | "user" | undefined;
26154
+ capture?: "full" | "mirrors" | undefined;
26155
+ share?: boolean | undefined;
26156
+ } | undefined;
25538
26157
  chains?: {
25539
26158
  kind: "evm";
25540
26159
  id: string;
@@ -25619,9 +26238,28 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
25619
26238
  tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25620
26239
  tool_config: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
25621
26240
  /**
25622
- * When true, the node calls `ctx.requestApproval(prompt)` before
25623
- * returning. The engine pauses, persists a checkpoint, and waits for
25624
- * `resume(checkpointId, decision)` from the operator/CLI.
26241
+ * A human approval gate on this node, and a PRE-condition: the node
26242
+ * calls `ctx.requestApproval(prompt)` BEFORE its model turn, so the
26243
+ * prompt is answered against the UPSTREAM state (which the `hitl_pause`
26244
+ * event and the bundle's pause report both print) and no tokens are
26245
+ * spent until the human answers. The engine pauses, persists a
26246
+ * checkpoint, and waits for `resume(checkpointId, decision)` from the
26247
+ * operator/CLI; the resumed run replays this node from the top and
26248
+ * makes its FIRST model call.
26249
+ *
26250
+ * The decision string is recorded at `state["<node>_decision"]`, which
26251
+ * every downstream node reads as part of the upstream state. (NOTE:
26252
+ * `edges[].when.key` cannot name it yet — that key must name a declared
26253
+ * node; see the `graphEdgeWhenSchema` note below.) A rejecting decision
26254
+ * — `reject`, `no`, `deny`, `decline`, `abort`, `cancel`, `stop`, `veto`
26255
+ * (trimmed, case-insensitive) — cancels this node's turn entirely, so
26256
+ * the node records only its decision and no output; any other string,
26257
+ * including free text, approves it. To halt the run on a rejection,
26258
+ * guard the node's outgoing edge with `when: { key: <node>, exists:
26259
+ * true }` — a cancelled node records no output, so no edge matches.
26260
+ *
26261
+ * To have a human approve a node's OWN output, put the gate on the
26262
+ * DOWNSTREAM node: its upstream state is exactly that output.
25625
26263
  */
25626
26264
  hitl: z.ZodOptional<z.ZodObject<{
25627
26265
  prompt: z.ZodString;
@@ -27114,6 +27752,56 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
27114
27752
  on_fail?: "retry" | "halt" | "note" | undefined;
27115
27753
  max_retries?: number | undefined;
27116
27754
  }>>;
27755
+ feedback: z.ZodOptional<z.ZodObject<{
27756
+ enabled: z.ZodOptional<z.ZodBoolean>;
27757
+ modality: z.ZodDefault<z.ZodEnum<["binary", "stars", "scale", "comment"]>>;
27758
+ scale: z.ZodOptional<z.ZodObject<{
27759
+ min: z.ZodNumber;
27760
+ max: z.ZodNumber;
27761
+ }, "strict", z.ZodTypeAny, {
27762
+ min: number;
27763
+ max: number;
27764
+ }, {
27765
+ min: number;
27766
+ max: number;
27767
+ }>>;
27768
+ storage: z.ZodOptional<z.ZodObject<{
27769
+ location: z.ZodString;
27770
+ }, "strict", z.ZodTypeAny, {
27771
+ location: string;
27772
+ }, {
27773
+ location: string;
27774
+ }>>;
27775
+ autoDistill: z.ZodOptional<z.ZodBoolean>;
27776
+ exitPrompt: z.ZodOptional<z.ZodBoolean>;
27777
+ channelReactions: z.ZodOptional<z.ZodBoolean>;
27778
+ }, "strict", z.ZodTypeAny, {
27779
+ modality: "binary" | "stars" | "scale" | "comment";
27780
+ enabled?: boolean | undefined;
27781
+ scale?: {
27782
+ min: number;
27783
+ max: number;
27784
+ } | undefined;
27785
+ storage?: {
27786
+ location: string;
27787
+ } | undefined;
27788
+ autoDistill?: boolean | undefined;
27789
+ exitPrompt?: boolean | undefined;
27790
+ channelReactions?: boolean | undefined;
27791
+ }, {
27792
+ enabled?: boolean | undefined;
27793
+ scale?: {
27794
+ min: number;
27795
+ max: number;
27796
+ } | undefined;
27797
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
27798
+ storage?: {
27799
+ location: string;
27800
+ } | undefined;
27801
+ autoDistill?: boolean | undefined;
27802
+ exitPrompt?: boolean | undefined;
27803
+ channelReactions?: boolean | undefined;
27804
+ }>>;
27117
27805
  memory: z.ZodOptional<z.ZodObject<{
27118
27806
  enabled: z.ZodOptional<z.ZodBoolean>;
27119
27807
  backend: z.ZodOptional<z.ZodEnum<["file", "thredz"]>>;
@@ -27555,6 +28243,54 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
27555
28243
  endpoint?: string | undefined;
27556
28244
  } | undefined;
27557
28245
  }>>;
28246
+ watchme: z.ZodOptional<z.ZodObject<{
28247
+ enabled: z.ZodDefault<z.ZodBoolean>;
28248
+ /** "full" = write the .events.jsonl trace sibling; "mirrors" = rely on the
28249
+ * default-on advisor mirrors only (retro-analysis grade, no extra file). */
28250
+ capture: z.ZodDefault<z.ZodEnum<["full", "mirrors"]>>;
28251
+ judge: z.ZodOptional<z.ZodObject<{
28252
+ /** Judge model for the sampled phase-2 quality pass. Refused at runtime
28253
+ * if unpriced (dream-engine pattern) — the budget cap must be
28254
+ * enforceable. */
28255
+ model: z.ZodDefault<z.ZodString>;
28256
+ /** Fraction of ungraded turns escalated to the judge. */
28257
+ sample_rate: z.ZodDefault<z.ZodNumber>;
28258
+ /** Per-report spend cap. 0 (default) = deterministic-only reports. */
28259
+ budget_usd: z.ZodDefault<z.ZodNumber>;
28260
+ }, "strict", z.ZodTypeAny, {
28261
+ model: string;
28262
+ budget_usd: number;
28263
+ sample_rate: number;
28264
+ }, {
28265
+ model?: string | undefined;
28266
+ budget_usd?: number | undefined;
28267
+ sample_rate?: number | undefined;
28268
+ }>>;
28269
+ /** "user" additionally registers this harness in the global registry at run time. */
28270
+ scope: z.ZodDefault<z.ZodEnum<["harness", "user"]>>;
28271
+ /** Publish redacted distilled findings to the wiki/Thredz at report time. */
28272
+ share: z.ZodDefault<z.ZodBoolean>;
28273
+ }, "strict", z.ZodTypeAny, {
28274
+ enabled: boolean;
28275
+ scope: "harness" | "user";
28276
+ capture: "full" | "mirrors";
28277
+ share: boolean;
28278
+ judge?: {
28279
+ model: string;
28280
+ budget_usd: number;
28281
+ sample_rate: number;
28282
+ } | undefined;
28283
+ }, {
28284
+ judge?: {
28285
+ model?: string | undefined;
28286
+ budget_usd?: number | undefined;
28287
+ sample_rate?: number | undefined;
28288
+ } | undefined;
28289
+ enabled?: boolean | undefined;
28290
+ scope?: "harness" | "user" | undefined;
28291
+ capture?: "full" | "mirrors" | undefined;
28292
+ share?: boolean | undefined;
28293
+ }>>;
27558
28294
  schedule: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
27559
28295
  kind: z.ZodLiteral<"cron">;
27560
28296
  cron: z.ZodString;
@@ -27755,6 +28491,20 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
27755
28491
  on_fail?: "retry" | "halt" | "note" | undefined;
27756
28492
  max_retries?: number | undefined;
27757
28493
  } | undefined;
28494
+ feedback?: {
28495
+ modality: "binary" | "stars" | "scale" | "comment";
28496
+ enabled?: boolean | undefined;
28497
+ scale?: {
28498
+ min: number;
28499
+ max: number;
28500
+ } | undefined;
28501
+ storage?: {
28502
+ location: string;
28503
+ } | undefined;
28504
+ autoDistill?: boolean | undefined;
28505
+ exitPrompt?: boolean | undefined;
28506
+ channelReactions?: boolean | undefined;
28507
+ } | undefined;
27758
28508
  memory?: {
27759
28509
  backend?: "file" | "thredz" | undefined;
27760
28510
  enabled?: boolean | undefined;
@@ -27832,6 +28582,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
27832
28582
  endpoint?: string | undefined;
27833
28583
  } | undefined;
27834
28584
  } | undefined;
28585
+ watchme?: {
28586
+ enabled: boolean;
28587
+ scope: "harness" | "user";
28588
+ capture: "full" | "mirrors";
28589
+ share: boolean;
28590
+ judge?: {
28591
+ model: string;
28592
+ budget_usd: number;
28593
+ sample_rate: number;
28594
+ } | undefined;
28595
+ } | undefined;
27835
28596
  schedule?: {
27836
28597
  kind: "cron";
27837
28598
  cron: string;
@@ -28009,6 +28770,20 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
28009
28770
  on_fail?: "retry" | "halt" | "note" | undefined;
28010
28771
  max_retries?: number | undefined;
28011
28772
  } | undefined;
28773
+ feedback?: {
28774
+ enabled?: boolean | undefined;
28775
+ scale?: {
28776
+ min: number;
28777
+ max: number;
28778
+ } | undefined;
28779
+ modality?: "binary" | "stars" | "scale" | "comment" | undefined;
28780
+ storage?: {
28781
+ location: string;
28782
+ } | undefined;
28783
+ autoDistill?: boolean | undefined;
28784
+ exitPrompt?: boolean | undefined;
28785
+ channelReactions?: boolean | undefined;
28786
+ } | undefined;
28012
28787
  memory?: {
28013
28788
  backend?: "file" | "thredz" | undefined;
28014
28789
  enabled?: boolean | undefined;
@@ -28086,6 +28861,17 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
28086
28861
  endpoint?: string | undefined;
28087
28862
  } | undefined;
28088
28863
  } | undefined;
28864
+ watchme?: {
28865
+ judge?: {
28866
+ model?: string | undefined;
28867
+ budget_usd?: number | undefined;
28868
+ sample_rate?: number | undefined;
28869
+ } | undefined;
28870
+ enabled?: boolean | undefined;
28871
+ scope?: "harness" | "user" | undefined;
28872
+ capture?: "full" | "mirrors" | undefined;
28873
+ share?: boolean | undefined;
28874
+ } | undefined;
28089
28875
  schedule?: {
28090
28876
  kind: "cron";
28091
28877
  cron: string;
@@ -33406,12 +34192,29 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
33406
34192
  height?: number | undefined;
33407
34193
  }>>;
33408
34194
  startUrl: z.ZodOptional<z.ZodString>;
34195
+ /**
34196
+ * SECURITY — opt in to private/loopback navigation targets. Default false:
34197
+ * the Navigate tool refuses private/loopback/link-local/metadata hosts
34198
+ * before `driver.goto`, and the chromium backend routes every request
34199
+ * through a DNS-pinning proxy that refuses the same floor at the
34200
+ * connection layer. Together they stop a prompt-injected page from
34201
+ * reaching the host's own services.
34202
+ *
34203
+ * Set true ONLY when the browser legitimately must reach a private target
34204
+ * the operator controls AND the page content is trusted — an intranet app
34205
+ * under test, or a locally-served fixture page (what the browser runtime
34206
+ * smoke does). It relaxes BOTH layers for this spec, so it stays a
34207
+ * per-spec reviewed decision and never a global switch. The http/https
34208
+ * scheme allowlist is NOT waived.
34209
+ */
34210
+ allowPrivateTargets: z.ZodDefault<z.ZodBoolean>;
33409
34211
  }, "strict", z.ZodTypeAny, {
33410
34212
  backend: "host" | "chromium" | "remote";
33411
34213
  viewport: {
33412
34214
  width: number;
33413
34215
  height: number;
33414
34216
  };
34217
+ allowPrivateTargets: boolean;
33415
34218
  startUrl?: string | undefined;
33416
34219
  }, {
33417
34220
  backend?: "host" | "chromium" | "remote" | undefined;
@@ -33420,6 +34223,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
33420
34223
  height?: number | undefined;
33421
34224
  } | undefined;
33422
34225
  startUrl?: string | undefined;
34226
+ allowPrivateTargets?: boolean | undefined;
33423
34227
  }>>;
33424
34228
  /** Vision-grounding model. Defaults to the agent's primary model. */
33425
34229
  groundingModel: z.ZodOptional<z.ZodString>;
@@ -33728,6 +34532,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
33728
34532
  width: number;
33729
34533
  height: number;
33730
34534
  };
34535
+ allowPrivateTargets: boolean;
33731
34536
  startUrl?: string | undefined;
33732
34537
  };
33733
34538
  tools?: string[] | undefined;
@@ -33920,6 +34725,7 @@ export declare const Spec: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
33920
34725
  height?: number | undefined;
33921
34726
  } | undefined;
33922
34727
  startUrl?: string | undefined;
34728
+ allowPrivateTargets?: boolean | undefined;
33923
34729
  } | undefined;
33924
34730
  groundingModel?: string | undefined;
33925
34731
  }>, z.ZodObject<{
@@ -35054,6 +35860,9 @@ export type SpecBudgetBlock = z.infer<typeof budgetBlock>;
35054
35860
  /** Ops item 37 + Loop contract 0.4 (Batch C, G26) — the cross-cutting
35055
35861
  * `observability:` block (slo + trace/metrics/cost/alerts/incidents/otel). */
35056
35862
  export type SpecObservabilityBlock = z.infer<typeof observabilityBlock>;
35863
+ /** "Watch me" — the observe-and-learn `watchme:` block, carried on
35864
+ * cli/channel/managed (design/watch-me.md §4.1). */
35865
+ export type SpecWatchmeBlock = z.infer<typeof watchmeBlock>;
35057
35866
  export type SpecSecurityBlock = z.infer<typeof securityBlock>;
35058
35867
  export type SpecFeedbackBlock = z.infer<typeof feedbackBlock>;
35059
35868
  export type SpecMemoryBlock = z.infer<typeof memoryBlock>;