@crewhaus/ir 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
@@ -818,6 +818,25 @@ export type IrObservability = {
818
818
  readonly incidents?: IrObservabilityToggle;
819
819
  readonly otel?: IrObservabilityOtel;
820
820
  };
821
+ /**
822
+ * "Watch me" (design/watch-me.md §4.6) — observe-and-learn config, lowered
823
+ * from `spec.watchme` on the three interactive-loop shapes (IrV0/cli,
824
+ * IrChannelV0, IrManagedV0), carried beside `observability` (a sibling
825
+ * feature, not a telemetry sub-key). Unlike IrObservability's declare-only
826
+ * carriage, every field here is REQUIRED: the lowering resolves all defaults
827
+ * (a bare `watchme: {}` arrives fully populated), so emitters/runtimes never
828
+ * re-derive them. Absent from the IR entirely when the spec omits the block.
829
+ */
830
+ export type IrWatchme = {
831
+ readonly enabled: boolean;
832
+ readonly capture: "full" | "mirrors";
833
+ /** Phase-2 judge model — default resolved at lower time. */
834
+ readonly judgeModel: string;
835
+ readonly judgeSampleRate: number;
836
+ readonly judgeBudgetUsd: number;
837
+ readonly scope: "harness" | "user";
838
+ readonly share: boolean;
839
+ };
821
840
  /**
822
841
  * Track F (Section 57) — typed message schemas (Σ) for multi-agent
823
842
  * communication. Source: AgentFlow (arxiv 2604.20801). A typed graph
@@ -934,6 +953,10 @@ export type IrV0 = {
934
953
  /** Ops item 37 — SLO targets + mitigation ladder. Optional; absent when the
935
954
  * spec omits the `observability` block. */
936
955
  readonly observability?: IrObservability;
956
+ /** "Watch me" — observe-and-learn config (design/watch-me.md §4.6).
957
+ * Optional; absent when the spec omits the `watchme` block; all defaults
958
+ * resolved at lower time when present. */
959
+ readonly watchme?: IrWatchme;
937
960
  /** Item 1 (G30) — MCP-server projection config. Present when the spec
938
961
  * declares `expose.mcp`; absent otherwise. */
939
962
  readonly expose?: IrExpose;
@@ -1161,6 +1184,12 @@ export type IrWhatsAppConfig = {
1161
1184
  readonly phoneNumberId: IrSecretRef;
1162
1185
  readonly accessToken: IrSecretRef;
1163
1186
  readonly appSecret: IrSecretRef;
1187
+ /**
1188
+ * Shared token echoed back on Meta's unsigned GET callback-URL verification
1189
+ * handshake (`hub.verify_token`). Optional — absent means the daemon fails
1190
+ * that handshake closed and serves only an already-verified subscription.
1191
+ */
1192
+ readonly verifyToken?: IrSecretRef;
1164
1193
  };
1165
1194
  /**
1166
1195
  * Section 33 — iMessage channel config (macOS host-bound). `chatDbPath`
@@ -1302,6 +1331,10 @@ export type IrChannelV0 = {
1302
1331
  /** Ops item 37 — SLO targets + mitigation ladder. Optional; absent when the
1303
1332
  * spec omits the `observability` block. */
1304
1333
  readonly observability?: IrObservability;
1334
+ /** "Watch me" — observe-and-learn config (design/watch-me.md §4.6).
1335
+ * Optional; absent when the spec omits the `watchme` block; all defaults
1336
+ * resolved at lower time when present. */
1337
+ readonly watchme?: IrWatchme;
1305
1338
  /** Item 1 (G30) — MCP-server projection config. Present when the spec
1306
1339
  * declares `expose.mcp`; absent otherwise. */
1307
1340
  readonly expose?: IrExpose;
@@ -1376,6 +1409,10 @@ export type IrManagedV0 = {
1376
1409
  /** Loop contract 0.4 (Batch B, G02) — in-loop output evaluation.
1377
1410
  * Optional; absent when the spec omits the `evaluation` block. */
1378
1411
  readonly evaluation?: IrEvaluation;
1412
+ /** NEW-inloop-coverage — response-feedback config. Gates the gateway's
1413
+ * `feedback.submit` rating route and (with `autoDistill`) the daemon's
1414
+ * distill janitor step. Absent when the spec omits the block. */
1415
+ readonly feedback?: IrFeedback;
1379
1416
  /** #53 cross-session memory config. Optional; absent when the spec omits `memory`. */
1380
1417
  readonly memory?: IrMemory;
1381
1418
  /** Loop contract 0.4 (Batch E, G22) — agent-shape RAG config. Present when
@@ -1395,6 +1432,12 @@ export type IrManagedV0 = {
1395
1432
  * spec omits the `observability` block. The managed daemon's `pause-intake`
1396
1433
  * rung reuses its `budget_exceeded` 429 path. */
1397
1434
  readonly observability?: IrObservability;
1435
+ /** "Watch me" — observe-and-learn config (design/watch-me.md §4.6).
1436
+ * Optional; absent when the spec omits the `watchme` block; all defaults
1437
+ * resolved at lower time when present. CARRIED but not runtime-wired on
1438
+ * this shape in v1 — `compile()` emits the accepted-but-unwired warning
1439
+ * (design/watch-me.md §6.3 names the target-managed stamp seam). */
1440
+ readonly watchme?: IrWatchme;
1398
1441
  /** Item 1 (G30) — MCP-server projection config. Present when the spec
1399
1442
  * declares `expose.mcp`; absent otherwise. SSE-backed exposure rides this
1400
1443
  * shape's gateway-server tenancy/budgets. */
@@ -1418,8 +1461,12 @@ export type IrGraphNode = {
1418
1461
  readonly tools: readonly string[];
1419
1462
  readonly toolConfigs: IrToolConfigs;
1420
1463
  /**
1421
- * When set, the node calls `ctx.requestApproval(prompt)` after the
1422
- * LLM turn and pauses the graph until `resume(checkpointId, decision)`.
1464
+ * When set, the node calls `ctx.requestApproval(prompt)` BEFORE its LLM
1465
+ * turn and pauses the graph until `resume(checkpointId, decision)`. The
1466
+ * gate is a pre-condition: at the pause the node has spent nothing, the
1467
+ * `hitl_pause` event carries the upstream state the approver is deciding
1468
+ * on, and a rejecting decision cancels the turn (the node records only
1469
+ * `state["<name>_decision"]`).
1423
1470
  */
1424
1471
  readonly hitlPrompt?: string;
1425
1472
  /** Loop contract 0.4 (Batch B, G02) — `"judge"` marks a gate node over
@@ -1838,6 +1885,14 @@ export type IrBrowserV0 = {
1838
1885
  };
1839
1886
  /** Optional initial URL; daemon calls driver.goto() before runChatLoop. */
1840
1887
  readonly startUrl?: string;
1888
+ /**
1889
+ * SECURITY — the spec opted in to private/loopback navigation targets
1890
+ * (`driver.allowPrivateTargets: true`). Relaxes BOTH the Navigate
1891
+ * pre-goto guard and the chromium DNS-pinning proxy for this harness,
1892
+ * never the http/https scheme allowlist. Carried only when true, so a
1893
+ * bundle that leaves it at the default stays byte-identical.
1894
+ */
1895
+ readonly allowPrivateTargets?: boolean;
1841
1896
  };
1842
1897
  /** Vision-grounding model. Defaults at lower-time to agent.model. */
1843
1898
  readonly groundingModel: string;
package/dist/readme.js CHANGED
@@ -342,7 +342,12 @@ function renderEnvSection(ir) {
342
342
  function defaultUsageSection(ir) {
343
343
  return {
344
344
  heading: "Run",
345
- body: ["```sh", RUN_COMMANDS[ir.target], "```"].join("\n"),
345
+ body: [
346
+ "```sh",
347
+ "bun install # first run only — installs the bundle's dependencies",
348
+ RUN_COMMANDS[ir.target],
349
+ "```",
350
+ ].join("\n"),
346
351
  };
347
352
  }
348
353
  const WORKSPACE_NOTE = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewhaus/ir",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "description": "Canonical typed intermediate representation",
6
6
  "main": "dist/index.js",