omp-fabric 1.25.6 → 1.25.8

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 (72) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +19 -21
  3. package/dist/audit/projection.d.ts.map +1 -1
  4. package/dist/chunks/{chunk-HAH64YUG.js → chunk-2C5YN36Y.js} +2 -2
  5. package/dist/chunks/chunk-2C5YN36Y.js.map +7 -0
  6. package/dist/chunks/{chunk-3BS4RMF4.js → chunk-AZBJNZS4.js} +2 -2
  7. package/dist/chunks/{chunk-EZRC24CX.js → chunk-BMSAIMFB.js} +2 -2
  8. package/dist/chunks/{chunk-63VIZJGS.js → chunk-BWLZ6VDQ.js} +2 -2
  9. package/dist/chunks/{chunk-BQG4LFAC.js → chunk-D55BFSFK.js} +2 -2
  10. package/dist/chunks/{chunk-WUPYPFAC.js → chunk-E3KTE736.js} +3 -3
  11. package/dist/chunks/{chunk-JBKYNJFN.js → chunk-FL4A542C.js} +2 -1
  12. package/dist/chunks/chunk-FL4A542C.js.map +7 -0
  13. package/dist/chunks/{chunk-REHGQCXU.js → chunk-J2BDKPO4.js} +4 -4
  14. package/dist/chunks/{chunk-3KORI7FQ.js → chunk-KLWNXXEI.js} +2 -2
  15. package/dist/chunks/{chunk-XLINRLLP.js → chunk-PIW2DEO2.js} +4 -4
  16. package/dist/chunks/{chunk-H3KRHDDF.js → chunk-QJKOPPW2.js} +2 -2
  17. package/dist/chunks/{chunk-6G25AUGA.js → chunk-UKB5RJDP.js} +4 -4
  18. package/dist/chunks/chunk-UKB5RJDP.js.map +7 -0
  19. package/dist/chunks/{chunk-GPJV2FSP.js → chunk-WX6C7N3W.js} +2 -2
  20. package/dist/chunks/{chunk-ABBGHQVX.js → chunk-YAI5SCIE.js} +2 -2
  21. package/dist/chunks/{chunk-G3ELO3QC.js → chunk-Z6TTRT6Q.js} +2 -2
  22. package/dist/compaction/hook.js +3 -3
  23. package/dist/compaction/lcm-runtime.js +4 -4
  24. package/dist/core/action-registry.js +2 -2
  25. package/dist/core/system-guidance.d.ts.map +1 -1
  26. package/dist/entropy/index.js +5 -5
  27. package/dist/fabric-runtime-state.js +72 -26
  28. package/dist/fabric-runtime-state.js.map +2 -2
  29. package/dist/host-compatibility.d.ts +1 -1
  30. package/dist/index.js +19 -15
  31. package/dist/index.js.map +2 -2
  32. package/dist/memory/discovery.js +4 -4
  33. package/dist/memory/normalize.js +3 -3
  34. package/dist/memory/search.js +4 -4
  35. package/dist/providers/memory-provider.js +6 -6
  36. package/dist/providers/omp-tools-provider.d.ts.map +1 -1
  37. package/dist/residency/host.js +6 -6
  38. package/dist/residency/omp-entry.js +6 -6
  39. package/dist/runtime/core-override-guest-types.js +1 -1
  40. package/dist/runtime/guest-types.d.ts +2 -2
  41. package/dist/runtime/guest-types.d.ts.map +1 -1
  42. package/dist/runtime/guest-types.js +1 -1
  43. package/dist/runtime/node-process-runtime.js +1 -1
  44. package/dist/runtime/quickjs-runtime.d.ts +1 -1
  45. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  46. package/dist/runtime/quickjs-runtime.js +1 -1
  47. package/dist/speculation/guest-args.d.ts.map +1 -1
  48. package/dist/speculation/scanner.js +2 -1
  49. package/dist/speculation/scanner.js.map +2 -2
  50. package/dist/type-error-guidance.d.ts.map +1 -1
  51. package/docs/audit-trace.md +1 -1
  52. package/docs/certification.md +1 -1
  53. package/docs/codemap.md +7 -8
  54. package/docs/configuration.md +1 -1
  55. package/docs/judgment.md +3 -3
  56. package/package.json +11 -11
  57. package/skills/fabric-exec/SKILL.md +4 -4
  58. package/dist/chunks/chunk-6G25AUGA.js.map +0 -7
  59. package/dist/chunks/chunk-HAH64YUG.js.map +0 -7
  60. package/dist/chunks/chunk-JBKYNJFN.js.map +0 -7
  61. /package/dist/chunks/{chunk-3BS4RMF4.js.map → chunk-AZBJNZS4.js.map} +0 -0
  62. /package/dist/chunks/{chunk-EZRC24CX.js.map → chunk-BMSAIMFB.js.map} +0 -0
  63. /package/dist/chunks/{chunk-63VIZJGS.js.map → chunk-BWLZ6VDQ.js.map} +0 -0
  64. /package/dist/chunks/{chunk-BQG4LFAC.js.map → chunk-D55BFSFK.js.map} +0 -0
  65. /package/dist/chunks/{chunk-WUPYPFAC.js.map → chunk-E3KTE736.js.map} +0 -0
  66. /package/dist/chunks/{chunk-REHGQCXU.js.map → chunk-J2BDKPO4.js.map} +0 -0
  67. /package/dist/chunks/{chunk-3KORI7FQ.js.map → chunk-KLWNXXEI.js.map} +0 -0
  68. /package/dist/chunks/{chunk-XLINRLLP.js.map → chunk-PIW2DEO2.js.map} +0 -0
  69. /package/dist/chunks/{chunk-H3KRHDDF.js.map → chunk-QJKOPPW2.js.map} +0 -0
  70. /package/dist/chunks/{chunk-GPJV2FSP.js.map → chunk-WX6C7N3W.js.map} +0 -0
  71. /package/dist/chunks/{chunk-ABBGHQVX.js.map → chunk-YAI5SCIE.js.map} +0 -0
  72. /package/dist/chunks/{chunk-G3ELO3QC.js.map → chunk-Z6TTRT6Q.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.25.8
4
+
5
+ ### Fixed
6
+
7
+ - The extension roster in the kernel guidance named host-builtin tools after whatever project was open. OMP registers its autoresearch tools (`init_experiment`, `run_experiment`, `log_experiment`, `update_notes`) inline with a synthetic `<extension:name>` source path, and the roster resolved that path against the working directory and took the nearest `package.json`, so in this repository it read `omp-fabric: update_notes` and in another project that project's name. Only real filesystem paths are looked up now; synthetic sources are labelled by their `source`, matching the captured-tool namespaces.
8
+ - When the host fails to write a bash artifact it reports `meta.artifactError` and drops the artifact id, but Fabric fell back to its own copy of the path, restored from a file that had stopped receiving writes, and called the stream complete. A failed capture is now treated like an elided one: no restore, no path, and the note names the failed operation and says the full output is unrecoverable.
9
+ - A column-capped result that was too large to inline gave no way back to the full text. When the artifact is intact the note now names its path and size and the `executor.maxNestedResultChars` budget that kept it out of the result.
10
+ - `skills/fabric-exec/SKILL.md` taught `omp.grep` a `limit` it did not have and a positional third argument named `limit` that is really `skip`; the `find` row omitted `gitignore` and `hidden`. The audit trace projected the dead grep `limit` and dropped `skip`, so two grep pages recorded identically.
11
+ - The declared OMP peer floor and the startup compatibility check move from `18.3.0` to `18.4.4`. 1.25.7 dropped the per-call bash `env` that hosts before 18.4.4 still accept, so on those hosts Fabric rejected a working call and its recovery hint wrongly said the host had removed it.
12
+
13
+ ### Added
14
+
15
+ - `omp.grep` accepts `limit`, passed to the host's `totalMatchLimit` on a per-call grep tool, and combines with `skip`. A capped result carries the partial marker with `matchLimit` and a note naming the limit rather than the host's per-file cap.
16
+
17
+ ## 1.25.7
18
+
19
+ ### Fixed
20
+
21
+ - `omp.bash` still advertised a per-call `env` option that OMP removed in 18.4.4, so a program could pass it, typecheck, and have the host silently ignore it — commands ran without the variables the model believed it had set. The guest shell options no longer declare `env`, and the unknown-property recovery hint now says where the host moved it: inline assignments or `export` inside the command, since commands inherit the configured shell environment.
22
+ - The host caps bash artifacts at `tools.artifactMaxBytes` (16 MiB default, read from host settings, so this session's override cannot lift it) and keeps only a head and tail sample with the middle dropped. Fabric's truncation note promised "the complete stream is on disk" regardless, and the column-cap restore would happily read the holed file back and present it as the full output. The note now names the dropped bytes and the setting, and the restore refuses an artifact the host reports as elided.
23
+ - Host pins move from `18.3.4` to `18.4.10`. The declared peer floor stays `>=18.3.0`; typecheck, the full suite, and certification re-run green against the new pin, and `docs/certification.md` records the re-certified host facts.
24
+
3
25
  ## 1.25.6
4
26
 
5
27
  ### Fixed
package/README.md CHANGED
@@ -28,15 +28,15 @@ Fabric gives OMP one programmable tool called `fabric_exec`, which composes core
28
28
 
29
29
  ## Why Fabric?
30
30
 
31
- | | Capability | What it unlocks |
32
- | :-: | ---------- | --------------- |
33
- | ⚡ | **Code mode** | One flat tool schema; branching, loops, fan-out, and data flow live in checked TypeScript. |
34
- | 🧰 | **Capability routing** | Call OMP core tools, MCP servers, captured extension tools, or Fabric providers through one runtime. |
35
- | 🧑‍🤝‍🧑 | **Agent runtime** | One-shot workers, durable resident agents, persistent event-driven actors, councils, and bounded recursive queries. |
36
- | 🕸️ | **Workflows + mesh** | Phased progress plus durable topics, shared tasks, and compare-and-swap state. |
37
- | ⚖️ | **Typed judgment** | Calibrated choice, bool, and score answers about one state, ergonomic guest helpers for batch semantic triage, and four optional gates. |
31
+ | | Capability | What it unlocks |
32
+ | :-: | --- | --- |
33
+ | ⚡ | **Code mode** | One tool schema. Branching, loops, fan-out, and data flow live in checked TypeScript. |
34
+ | 🧰 | **Capability routing** | OMP core tools, MCP servers, captured extension tools, and Fabric providers share one runtime. |
35
+ | 🧑‍🤝‍🧑 | **Agent runtime** | One-shot workers, durable resident agents, persistent actors, councils, and bounded recursive queries. |
36
+ | 🕸️ | **Workflows + mesh** | Phased progress, durable topics, shared tasks, and compare-and-swap state. |
37
+ | ⚖️ | **Typed judgment** | Calibrated choice, bool, and score answers, plus batch triage helpers and four optional gates. |
38
38
  | 🛡️ | **Guardrails** | Approvals, isolation, timeouts, concurrency, recursion depth, and shared cost budgets. |
39
- | 🎛️ | **Native TUI** | Live activity, an interactive dashboard, and settings without leaving OMP. |
39
+ | 🎛️ | **Native TUI** | Live activity, an interactive dashboard, and settings inside OMP. |
40
40
 
41
41
  ## How it works
42
42
 
@@ -62,7 +62,7 @@ Independent calls run in parallel, and the returned object enters the model cont
62
62
 
63
63
  ## Install
64
64
 
65
- Requires Node.js 24+ and OMP 18.3.0+. Fabric also checks a detectable OMP host version at startup and warns when an older host may ignore continuation APIs such as actor `triggerTurn`.
65
+ Requires Node.js 24+ and OMP 18.4.4+. Fabric also checks a detectable OMP host version at startup and warns when an older host does not match the tool shapes Fabric types against.
66
66
 
67
67
  ```bash
68
68
  omp install npm:omp-fabric
@@ -131,27 +131,25 @@ See the [interface & commands reference](docs/interface.md) for every view, keyb
131
131
 
132
132
  ## Measured against OMP without Fabric
133
133
 
134
- A resume task, seeded as a paused session, run three times per arm on `claude-opus-5` through the same provider. The baseline arm is OMP with no extension loaded; the Fabric arm loads `dist/index.js` and compacts the session with LCM before resuming. Both arms receive the same fixture, the same prompt, and the same host configuration, and a run counts as a success only when the fixture's own `verify.mjs` exits zero with the forbidden files untouched.
134
+ A paused session with 40 prior tool turns, about 190 KB on disk, resumed three times per arm on fabric 1.25.6 with `claude-opus-5-5`. Both arms get the same fixture, prompt, and host config. A run passes only when `verify.mjs` exits zero and the forbidden files stay untouched. Measured 2026-09-28:
135
135
 
136
136
  | | Baseline | Fabric | Delta |
137
- |---|---|---|---|
137
+ | --- | ---: | ---: | ---: |
138
138
  | Task success | 3/3 | 3/3 | equal |
139
- | Tokens | 585,197 | 356,542 | **-39%** |
140
- | Tool calls | 14 | 6 | **-57%** |
141
- | Wall time | 67.6 s | 59.1 s | -13% |
142
- | Cost | $0.6987 | $0.2356 | -66% |
139
+ | Tokens | 1,182,067 | 630,932 | **-47%** |
140
+ | Tool calls | 6 | 9 | +3 |
141
+ | Wall time | 44.3 s | 72.7 s | +64% |
142
+ | Cost | $3.6159 | $1.0158 | **-72%** |
143
143
 
144
- Per-run tokens were 208,595 / 209,619 / 166,983 for the baseline and 118,751 / 119,387 / 118,404 with Fabric, so the reduction is stable across runs, not an artifact of one lucky sample. Read the cost row with care: the baseline's first run cost $0.4710 against $0.1271 and $0.1007 for its later two, because a cold prompt cache is charged at full rate. The token column is the honest measure of the difference, and cost follows it once caches are warm on both sides.
145
-
146
- Reproduce it with your own model and provider:
144
+ Per-run tokens were 394,130 / 394,110 / 393,827 for the baseline and 226,541 / 224,805 / 179,586 with Fabric. Each fabric run compacted the history to a 6,538-byte LCM summary before resuming, and five of its nine tool calls were memory recalls of that summary. Wall time rose because compaction runs before the resume. The smaller fixture this table replaces stays in git history.
147
145
 
148
146
  ```sh
149
147
  OMP_FABRIC_REAL_RESUME=1 \
150
- OMP_FABRIC_BENCH_MODEL=claude-opus-5 \
151
- OMP_FABRIC_BENCH_PROVIDER=sub2api-claude \
148
+ OMP_FABRIC_BENCH_MODEL=<model> \
149
+ OMP_FABRIC_BENCH_PROVIDER=<provider> \
152
150
  OMP_FABRIC_BENCH_KEY_ENV=YOUR_KEY_VARIABLE \
153
151
  OMP_FABRIC_BENCH_REPEATS=3 \
154
- OMP_FABRIC_BENCH_MAX_USD=8 \
152
+ OMP_FABRIC_BENCH_MAX_USD=50 \
155
153
  bun run benchmark:real-resume
156
154
  ```
157
155
 
@@ -1 +1 @@
1
- {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/audit/projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAA;KAAE,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB;AAwJD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,EACX,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBA4GF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,KAAK,MAAM,EACX,QAAQ,OAAO,KACd,qBAAqB,GAAG,SAwB1B,CAAC"}
1
+ {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/audit/projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAA;KAAE,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB;AAwJD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,EACX,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,qBA6GF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,KAAK,MAAM,EACX,QAAQ,OAAO,KACd,qBAAqB,GAAG,SAwB1B,CAAC"}
@@ -269,7 +269,7 @@ const __ompPositionalFields = {
269
269
  const __ompNumericFields = {
270
270
  read: ["offset", "limit"],
271
271
  bash: ["timeout"],
272
- grep: ["skip", "context"],
272
+ grep: ["skip", "context", "limit"],
273
273
  find: ["limit"],
274
274
  ls: ["limit"],
275
275
  };
@@ -1531,4 +1531,4 @@ export {
1531
1531
  GUEST_SETUP,
1532
1532
  QuickJsRuntime
1533
1533
  };
1534
- //# sourceMappingURL=chunk-HAH64YUG.js.map
1534
+ //# sourceMappingURL=chunk-2C5YN36Y.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/runtime/quickjs-runtime.ts", "../../src/runtime/guest-stack-map.ts"],
4
+ "sourcesContent": ["import releaseSyncVariant from \"@jitl/quickjs-singlefile-mjs-release-sync\";\nimport { newQuickJSWASMModuleFromVariant } from \"quickjs-emscripten-core\";\nimport ts from \"typescript\";\nimport { runAbortable, settleWithin } from \"../async-settlement.js\";\nimport { ompBashExitMetadata } from \"../core/omp-bash-error.js\";\nimport { createGuestStackMap, remapGuestErrorText } from \"./guest-stack-map.js\";\nimport { OMP_GUEST_ENTRYPOINT, transpileFabricCodeWithSourceMap } from \"./type-checker.js\";\n\nexport type FabricSandboxTerminationReason =\n | \"completed\"\n | \"runtime_error\"\n | \"timed_out\"\n | \"aborted\";\n\nexport interface FabricGuestProxyNames {\n extensions?: string[];\n mcp?: Record<string, string[]>;\n}\n\nexport interface FabricSandboxResult {\n value: unknown;\n logs: string[];\n terminationReason: FabricSandboxTerminationReason;\n error?: string;\n}\n\nexport interface FabricSandboxOptions {\n timeoutMs: number;\n memoryLimitBytes: number;\n maxLogChars?: number;\n payloads?: Record<string, string>;\n proxyNames?: FabricGuestProxyNames;\n tokenBudget?: number;\n signal?: AbortSignal;\n minimumTimeoutMsForHostCall?(\n ref: string,\n args: Record<string, unknown>,\n ): number | undefined;\n transpiledCode?: string;\n transpiledSourceMap?: string;\n}\n\nexport type FabricHostCall = (\n ref: string,\n args: Record<string, unknown>,\n signal: AbortSignal,\n) => Promise<unknown>;\n\ntype QuickJsModule = Awaited<ReturnType<typeof newQuickJSWASMModuleFromVariant>>;\n\nlet quickJsModulePromise: Promise<QuickJsModule> | undefined;\n\n// Static payloads.<identifier> references (bracket access like payloads[k] is not provable).\n// Parse instead of scanning text so examples inside strings and comments do not\n// become false missing-payload failures.\nconst referencedPayloadKeys = (code: string): string[] => {\n const source = ts.createSourceFile(\n \"fabric-exec.ts\",\n `async function __fabricProgram() {\\n${code}\\n}`,\n ts.ScriptTarget.Latest,\n false,\n ts.ScriptKind.TS,\n );\n const keys: string[] = [];\n const visit = (node: ts.Node): void => {\n if (\n ts.isPropertyAccessExpression(node) &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === \"payloads\" &&\n !keys.includes(node.name.text)\n ) {\n keys.push(node.name.text);\n }\n ts.forEachChild(node, visit);\n };\n visit(source);\n return keys;\n};\n\n// Reject up front when a referenced key is statically provable missing, before\n// QuickJS is even loaded.\nconst missingPayloadKeys = (\n code: string,\n payloads: Record<string, string> | undefined,\n): string[] => {\n const provided = payloads ?? {};\n return referencedPayloadKeys(code).filter((key) => !(key in provided));\n};\nconst quickJsModule = (): Promise<QuickJsModule> => {\n quickJsModulePromise ??= newQuickJSWASMModuleFromVariant(releaseSyncVariant);\n return quickJsModulePromise;\n};\n\nexport const GUEST_SETUP = `\n(() => {\nconst __fabricBridge = globalThis.__fabricHostCall;\ndelete globalThis.__fabricHostCall;\nconst __successfulCalls = [];\nconst __resolvedCallRef = (ref, args) =>\n ref === \"fabric.$call\" && args && typeof args.ref === \"string\" ? args.ref : ref;\nconst __recordSuccessfulCall = (ref, args) => {\n __successfulCalls.push(Object.freeze({ ref: __resolvedCallRef(ref, args) }));\n};\nconst __handoffFacts = () => {\n const calls = Object.freeze(__successfulCalls.slice());\n const count = (ref) => {\n if (ref === undefined) return calls.length;\n const refs = new Set(Array.isArray(ref) ? ref : [ref]);\n return calls.reduce((total, call) => total + (refs.has(call.ref) ? 1 : 0), 0);\n };\n return Object.freeze({ calls, count });\n};\nconst __call = async (ref, args) => {\n const normalizedArgs = args ?? {};\n const value = await __fabricBridge(ref, normalizedArgs);\n __recordSuccessfulCall(ref, normalizedArgs);\n return value;\n};\nconst __ompToolNames = [\"read\",\"bash\",\"edit\",\"write\",\"grep\",\"find\",\"ls\",\"wait\"];\nconst __toolsBase = {\n providers: () => __call(\"fabric.$providers\", {}),\n catalog: (args = {}) => __call(\"fabric.$catalog\", args),\n list: (args = {}) => __call(\"fabric.$list\", args),\n search: (args) => __call(\n \"fabric.$search\",\n typeof args === \"string\" ? { query: args } : args,\n ),\n describe: (args) => __call(\"fabric.$describe\", args),\n call: (args) => __call(\"fabric.$call\", args),\n progress: (args) => __call(\"fabric.$progress\", args),\n models: () => __call(\"fabric.$models\", {}),\n};\n// tools is discovery + generic calls only. The proxy keeps the seven discovery\n// methods and turns a core-tool name (read/bash/edit/...) into an actionable\n// error pointing at omp.<name>, so a model that writes tools.read(...) learns\n// the fix in one turn instead of looping on \"tools.read is not a function\".\nglobalThis.tools = new Proxy(__toolsBase, {\n get(target, property) {\n if (property === \"then\" || typeof property === \"symbol\") return undefined;\n const name = String(property);\n if (__ompToolNames.indexOf(name) >= 0) {\n return () => {\n throw new Error(\n \"tools.\" + name + \" is not available on the discovery API. tools is discovery + generic calls only (providers/catalog/list/search/describe/call/models). For the OMP core tool, call omp.\" + name + \"(args), e.g. omp.\" + name + \"({ ... }).\"\n );\n };\n }\n return target[property];\n },\n set() { return true; },\n deleteProperty() { return true; },\n});\nconst __ompStringFields = { bash: \"command\", read: \"path\", ls: \"path\", grep: \"pattern\", find: \"pattern\" };\n// Per-tool key aliases. The runtime normalizes them to the canonical form\n// before the host validates args; unit-converting aliases are handled separately\n// in __normalizeOmpArgs. This lets a model that writes { query, regex, ... }\n// or { file } instead of { pattern } / { path } still succeeds on the first\n// call. Keep these in sync with the OmpToolsApi overloads in guest-types.ts so\n// the type-checker accepts the same spellings it coercion-handles at runtime.\nconst __ompArgAliases = {\n bash: {\n cmd: \"command\", shell: \"command\", cmdline: \"command\", script: \"command\",\n commandLine: \"command\",\n workdir: \"cwd\", directory: \"cwd\", workingDirectory: \"cwd\",\n },\n find: {\n query: \"pattern\", regex: \"pattern\", search: \"pattern\", name: \"pattern\",\n filename: \"pattern\", glob: \"pattern\", expression: \"pattern\", include: \"pattern\",\n max: \"limit\",\n },\n grep: {\n query: \"pattern\", regex: \"pattern\", search: \"pattern\", q: \"pattern\",\n expression: \"pattern\", text: \"pattern\",\n ic: \"ignoreCase\", caseInsensitive: \"ignoreCase\",\n globPattern: \"glob\",\n ctx: \"context\",\n },\n read: {\n file: \"path\", absolutePath: \"path\", file_path: \"path\", filePath: \"path\",\n filepath: \"path\", pathname: \"path\", target_file: \"path\", targetFile: \"path\",\n absolute_path: \"path\", fileAbsolutePath: \"path\",\n max: \"limit\", start: \"offset\",\n },\n ls: {\n dir: \"path\", file: \"path\", folder: \"path\", absolutePath: \"path\",\n file_path: \"path\", filePath: \"path\", filepath: \"path\", pathname: \"path\",\n target_file: \"path\", targetFile: \"path\", absolute_path: \"path\",\n fileAbsolutePath: \"path\", directory: \"path\", directoryPath: \"path\",\n max: \"limit\",\n },\n edit: {\n file: \"path\", absolutePath: \"path\", file_path: \"path\", filePath: \"path\",\n filepath: \"path\", pathname: \"path\", target_file: \"path\", targetFile: \"path\",\n absolute_path: \"path\", fileAbsolutePath: \"path\",\n old: \"oldText\", old_string: \"oldText\", oldString: \"oldText\",\n old_str: \"oldText\", oldStr: \"oldText\", from: \"oldText\",\n old_value: \"oldText\", old_text: \"oldText\", oldContent: \"oldText\",\n old_content: \"oldText\",\n new: \"newText\", replacement: \"newText\", new_string: \"newText\",\n newString: \"newText\", new_str: \"newText\", newStr: \"newText\",\n to: \"newText\", new_value: \"newText\", new_text: \"newText\",\n newContent: \"newText\", new_content: \"newText\",\n },\n write: {\n file: \"path\", absolutePath: \"path\", file_path: \"path\", filePath: \"path\",\n filepath: \"path\", pathname: \"path\", target_file: \"path\", targetFile: \"path\",\n absolute_path: \"path\", fileAbsolutePath: \"path\",\n contents: \"content\", body: \"content\", text: \"content\", data: \"content\",\n fileContent: \"content\",\n },\n};\n// Multi-arg positional order, used only when a call passes >= 2 args and the\n// (primary, options) merge in __positionalToArgs does not apply. One-field\n// tools (read/bash/ls) stay absent: their two-arg form is a bare string plus\n// an options object, repaired by the merge instead of a wrong-arity (2554)\n// type error; only a non-object second arg still fails 2554.\nconst __ompPositionalFields = {\n grep: [\"pattern\", \"path\", \"skip\"],\n find: [\"pattern\", \"path\", \"limit\"],\n write: [\"path\", \"content\"],\n edit: [\"path\", \"oldText\", \"newText\"],\n};\n// Models often pass numbers as strings (\"20\"); coerce the known numeric\n// option fields so the host schema sees a number. Non-numeric strings pass\n// through untouched and fail host validation exactly as before. Kept in sync\n// with the numeric optionals in the OmpToolsApi overloads in guest-types.ts.\nconst __ompNumericFields = {\n read: [\"offset\", \"limit\"],\n bash: [\"timeout\"],\n grep: [\"skip\", \"context\", \"limit\"],\n find: [\"limit\"],\n ls: [\"limit\"],\n};\nconst __ompOptionalFields = {\n read: [\"offset\", \"limit\"],\n grep: [\"path\", \"glob\", \"ignoreCase\", \"literal\", \"context\", \"limit\"],\n find: [\"path\", \"limit\"],\n ls: [\"path\", \"limit\"],\n};\n// (primary, options) two-arg merge for the string-primary tools:\n// omp.read(\"index.ts\", { limit: 120 }) becomes { path: \"index.ts\", limit: 120 }.\n// A plain-object second arg is never a valid positional value for these tools\n// (grep/find take (pattern, path, limit) strings/numbers), so merging is\n// unambiguous; the positional string wins the primary field on conflict. The\n// merged object flows through the same alias, unit, and numeric normalization\n// in __normalizeOmpArgs as any other options object.\nconst __positionalToArgs = (name, rest) => {\n const first = rest[0];\n const second = rest[1];\n const primaryField = __ompStringFields[name];\n if (\n rest.length === 2 &&\n typeof first === \"string\" &&\n primaryField !== undefined &&\n second !== null && typeof second === \"object\" && !Array.isArray(second)\n ) {\n const merged = Object.assign({}, second);\n merged[primaryField] = first;\n return merged;\n }\n const order = __ompPositionalFields[name];\n if (!order) return rest.length > 0 ? first : {};\n const out = {};\n for (let i = 0; i < rest.length && i < order.length; i++) {\n const v = rest[i];\n if (v !== undefined) out[order[i]] = v;\n }\n return out;\n};\nconst __normalizeOmpArgs = (name, args) => {\n const field = __ompStringFields[name];\n if (typeof args === \"string\" && field) return { [field]: args };\n if (args === null || typeof args !== \"object\" || Array.isArray(args)) return args;\n const aliases = __ompArgAliases[name];\n let out = args;\n if (name === \"bash\" && \"timeoutMs\" in out) {\n out = Object.assign({}, args);\n if (!(\"timeout\" in out)) {\n const timeoutMs = out.timeoutMs;\n if (timeoutMs !== null && timeoutMs !== undefined) {\n out.timeout = Number.isFinite(Number(timeoutMs)) ? Number(timeoutMs) / 1000 : timeoutMs;\n }\n }\n delete out.timeoutMs;\n }\n // settle is a guest-only directive (settles nonzero exits instead of\n // rejecting); strip it so it never reaches the host/bash schema.\n if (name === \"bash\" && \"settle\" in out) {\n if (out === args) out = Object.assign({}, args);\n delete out.settle;\n }\n if (aliases) {\n for (const alias in aliases) {\n const canonical = aliases[alias];\n if (alias in out) {\n if (out === args) out = Object.assign({}, args);\n if (!(canonical in out)) out[canonical] = out[alias];\n delete out[alias];\n }\n }\n }\n const numerics = __ompNumericFields[name];\n if (numerics) {\n for (const key of numerics) {\n const value = out[key];\n if (typeof value === \"string\" && value.trim() !== \"\" && Number.isFinite(Number(value))) {\n if (out === args) out = Object.assign({}, args);\n out[key] = Number(value);\n }\n }\n }\n const optionalFields = __ompOptionalFields[name];\n if (optionalFields) {\n for (const key of optionalFields) {\n if (out[key] !== null && out[key] !== undefined) continue;\n if (!(key in out)) continue;\n if (out === args) out = Object.assign({}, args);\n delete out[key];\n }\n }\n if (name === \"edit\" && Array.isArray(out.edits)) {\n let changed = false;\n const editAliases = __ompArgAliases.edit;\n const edits = out.edits.map((entry) => {\n if (entry === null || typeof entry !== \"object\" || Array.isArray(entry)) return entry;\n let edit = entry;\n for (const alias in editAliases) {\n const canonical = editAliases[alias];\n if (canonical !== \"oldText\" && canonical !== \"newText\") continue;\n if (!(alias in edit)) continue;\n if (edit === entry) edit = Object.assign({}, entry);\n if (!(canonical in edit)) edit[canonical] = edit[alias];\n delete edit[alias];\n changed = true;\n }\n return edit;\n });\n if (changed) {\n if (out === args) out = Object.assign({}, args);\n out.edits = edits;\n }\n }\n if (name === \"edit\" && !Array.isArray(out.edits) && (\"oldText\" in out || \"newText\" in out)) {\n if (out === args) out = Object.assign({}, args);\n const edit = {};\n if (\"oldText\" in out) edit.oldText = out.oldText;\n if (\"newText\" in out) edit.newText = out.newText;\n out.edits = [edit];\n delete out.oldText;\n delete out.newText;\n }\n return out;\n};\n// shell/edit/write resolve envelope objects { ok, output, details }, and the\n// type-checker deliberately suppresses property-miss (2339) diagnostics, so\n// result.trim() on an envelope typechecks and then dies with QuickJS's terse\n// \"not a function\" \u2014 an error models cannot localize (observed: misdirected\n// debugging spirals probing unrelated globals). Guard envelopes with a proxy\n// that throws an actionable TypeError for string-method access and iteration,\n// naming the tool and the .output fix. Ordinary reads (ok/output/details/\n// exitCode/error), destructuring, 'in' checks, and JSON marshaling pass through.\nconst __ompEnvelopeTools = { bash: true, edit: true, write: true, wait: true };\nconst __ompEnvelopeStringTraps = new Set([\n \"anchor\", \"at\", \"big\", \"blink\", \"bold\", \"charAt\", \"charCodeAt\", \"codePointAt\",\n \"concat\", \"endsWith\", \"fixed\", \"fontcolor\", \"fontsize\", \"includes\", \"indexOf\",\n \"italics\", \"lastIndexOf\", \"length\", \"link\", \"localeCompare\", \"match\", \"matchAll\",\n \"normalize\", \"padEnd\", \"padStart\", \"repeat\", \"replace\", \"replaceAll\", \"search\",\n \"slice\", \"small\", \"split\", \"startsWith\", \"strike\", \"sub\", \"substr\", \"substring\",\n \"sup\", \"toLocaleLowerCase\", \"toLocaleUpperCase\", \"toLowerCase\", \"toUpperCase\",\n \"trim\", \"trimEnd\", \"trimStart\",\n]);\nconst __ompEnvelopeGuard = (name, value) => {\n if (value === null || typeof value !== \"object\" || typeof value.ok !== \"boolean\") return value;\n return new Proxy(value, {\n get(target, property, receiver) {\n if (property === Symbol.iterator || property === Symbol.asyncIterator) {\n throw new TypeError(\n \"omp.\" + name + \"(...) resolves an envelope { ok, output, details }, which is not iterable. \" +\n \"Iterate the text instead: (await omp.\" + name + \"(...)).output.split('\\\\\\\\n')\"\n );\n }\n if (typeof property === \"string\" && __ompEnvelopeStringTraps.has(property)) {\n throw new TypeError(\n \"omp.\" + name + \"(...) resolves an envelope { ok, output, details }, not a string, so .\" + property +\n \" is unavailable on it. Read the text first: const out = (await omp.\" + name + \"(...)).output; then out.\" + property +\n \"(...). Shell commands reject on a nonzero exit \u2014 pass settle: true to receive an ok:false envelope instead.\"\n );\n }\n return Reflect.get(target, property, receiver);\n },\n });\n};\n// The omp proxy accepts: a bare string (primary field), an options object, a\n// (primary, options) two-arg merge for the string-primary tools, or a\n// positional spread mapped by __ompPositionalFields. 0/1 args preserve the\n// legacy (args = {}) default so existing programs are unchanged.\nglobalThis.omp = new Proxy({}, {\n get(_target, property) {\n if (property === \"then\") return undefined;\n const name = String(property);\n // fabric_exec payload values are readable directly on the omp surface\n // (documented for skills as payloads.<key>), while core tool names stay\n // callables. Only shadow a payload key that actually exists.\n const payloadValues = (typeof globalThis[\"payloads\"] === \"object\" && globalThis[\"payloads\"] !== null)\n ? globalThis[\"payloads\"]\n : {};\n if (__ompToolNames.indexOf(name) < 0 && Object.prototype.hasOwnProperty.call(payloadValues, name)) {\n return payloadValues[name];\n }\n return (...rest) => {\n let args;\n if (rest.length <= 1) {\n const first = rest.length === 1 ? rest[0] : undefined;\n args = first === undefined ? {} : first;\n } else {\n args = __positionalToArgs(name, rest);\n }\n // Shell tools reject on an ordinary nonzero exit; settle:true returns\n // {ok:false, exitCode, ...} instead (opt-in). Other failures still reject.\n const settle = name === \"bash\" &&\n typeof args === \"object\" && args !== null && args.settle === true;\n const call = __call(\"omp.\" + name, __normalizeOmpArgs(name, args));\n const promise = settle ? call.catch((error) => {\n // node-process bridge errors originate in a different VM realm.\n const message = typeof error?.message === \"string\" ? error.message : String(error);\n const exit = error?.__fabricBashExit;\n if (!exit || !Number.isSafeInteger(exit.exitCode) || exit.exitCode <= 0 ||\n typeof exit.output !== \"string\") throw error;\n return {\n ok: false,\n output: exit.output,\n details: null,\n exitCode: exit.exitCode,\n error: message,\n };\n }) : call;\n return __ompEnvelopeTools[name] === true\n ? promise.then((value) => __ompEnvelopeGuard(name, value))\n : promise;\n };\n },\n});\nconst __payloads = (typeof globalThis[\"payloads\"] === \"object\" && globalThis[\"payloads\"] !== null) ? globalThis[\"payloads\"] : {};\nglobalThis[\"payloads\"] = new Proxy(__payloads, {\n get(target, property) {\n if (typeof property === \"symbol\") return undefined;\n const name = String(property);\n if (name === \"then\" || name === \"toJSON\" || name === \"constructor\") return undefined;\n if (Object.prototype.hasOwnProperty.call(target, name)) return target[name];\n if (__ompToolNames.indexOf(name) >= 0) {\n throw new Error(\n \"payloads.\" + name + \" is the payloads accessor, not a tool. For the OMP core tool, call omp.\" + name + \"(args).\"\n );\n }\n const provided = Object.keys(target);\n throw new Error(\n \"payloads.\" + name + \" is not defined. payloads only exposes keys from the fabric_exec payloads parameter\" +\n (provided.length ? \" (provided: \" + provided.join(\", \") + \")\" : \" (none provided)\") +\n \". Pass payloads: { \" + name + \": '...' } to use payloads.\" + name + \".\" +\n \" For large or quote-heavy content, keep it in top-level payloads and reference payloads.\" + name + \" instead of escaping it inside code.\"\n );\n },\n ownKeys(target) { return Reflect.ownKeys(target); },\n getOwnPropertyDescriptor(target, prop) { return Reflect.getOwnPropertyDescriptor(target, prop); },\n has(target, prop) { return Object.prototype.hasOwnProperty.call(target, prop); }\n});\n// Stable providers share a lazy dispatch proxy; the guest declarations keep\n// their known actions typed while the registry remains the runtime authority.\n// extensions' per-tool surface is additionally rendered from the captured\n// catalog by guestTypeDeclarations (runtime/dynamic-guest-types.ts).\nconst __memorySelectionKeys = [\n \"indices\",\n \"entryIds\",\n \"operationAddresses\",\n \"entryRange\",\n \"index\",\n \"entry_ids\",\n \"operation_addresses\",\n \"entry_range\",\n];\nconst __hasMemorySelection = (args) => __memorySelectionKeys.some((key) => {\n const value = args[key];\n if (Array.isArray(value)) return value.length > 0;\n return value !== undefined && value !== null;\n});\nconst __memoryWalk = async (args, visitor) => {\n if (!args || typeof args !== \"object\" || Array.isArray(args)) {\n throw new TypeError(\"memory.walk expects an expansion options object\");\n }\n if (typeof visitor !== \"function\") {\n throw new TypeError(\"memory.walk expects a visitor function as its second argument\");\n }\n\n let request = { ...args };\n if (Number(request.textOffset ?? request.text_offset ?? 0) !== 0) {\n throw new TypeError(\"memory.walk must start at text offset 0 to yield complete entries\");\n }\n if (!__hasMemorySelection(request)) {\n if (request.entryOffset !== undefined || request.entry_offset !== undefined ||\n request.textOffset !== undefined || request.text_offset !== undefined) {\n throw new TypeError(\"memory.walk continuation offsets require an explicit selection\");\n }\n if (Number(request.before ?? 0) > 0 || Number(request.after ?? 0) > 0) {\n throw new TypeError(\"memory.walk before/after requires an explicit selection\");\n }\n const head = await __call(\"memory.expand\", request);\n if (!head || typeof head !== \"object\") {\n throw new Error(\"memory.expand returned an invalid metadata response\");\n }\n if (head.error) return { visited: 0, stopped: false, error: head.error };\n if (!Number.isSafeInteger(head.entryCount) || head.entryCount < 0) {\n throw new Error(\"memory.expand metadata omitted a valid entryCount\");\n }\n if (head.entryCount === 0) return { visited: 0, stopped: false };\n request = {\n ...request,\n session: head.session ?? request.session,\n expectedSourceHash: head.sourceHash,\n expectedLineageFingerprint: head.lineageFingerprint,\n branches: head.branches,\n entryRange: { first: 0, last: head.entryCount - 1 },\n };\n }\n\n let visited = 0;\n let pending = null;\n let pendingStart = 0;\n let pendingEnd = 0;\n let pendingTotal = 0;\n const seen = new Set([JSON.stringify({ ref: \"memory.expand\", args: request })]);\n let page = await __call(\"memory.expand\", request);\n\n while (true) {\n if (!page || typeof page !== \"object\") {\n throw new Error(\"memory.expand returned an invalid page\");\n }\n if (page.error) return { visited, stopped: false, error: page.error };\n if (!Array.isArray(page.entries)) {\n throw new Error(\"memory.expand page omitted entries\");\n }\n\n for (const chunk of page.entries) {\n if (!chunk || typeof chunk !== \"object\" || typeof chunk.text !== \"string\") {\n throw new Error(\"memory.expand returned an invalid entry chunk\");\n }\n const range = chunk.textRange;\n if (!range || typeof range !== \"object\" ||\n !Number.isSafeInteger(range.start) || !Number.isSafeInteger(range.end) ||\n !Number.isSafeInteger(range.total) || range.start < 0 ||\n range.end < range.start || range.total < range.end) {\n throw new Error(\"memory.expand returned an invalid textRange\");\n }\n if (chunk.text.length !== range.end - range.start) {\n throw new Error(\"memory.expand entry chunk disagrees with textRange\");\n }\n\n if (pending === null) {\n pending = { ...chunk, text: \"\" };\n pendingStart = range.start;\n pendingEnd = range.start;\n pendingTotal = range.total;\n } else if (pending.index !== chunk.index) {\n throw new Error(\"memory.expand advanced before completing an entry\");\n }\n if (range.start !== pendingEnd || range.total !== pendingTotal) {\n throw new Error(\"memory.expand returned discontinuous entry chunks\");\n }\n for (const key of Object.keys(chunk)) {\n if (pending[key] === undefined) pending[key] = chunk[key];\n }\n pending.text += chunk.text;\n pendingEnd = range.end;\n\n if (range.complete) {\n pending.textRange = {\n start: pendingStart,\n end: pendingEnd,\n total: pendingTotal,\n complete: true,\n };\n const entry = pending;\n pending = null;\n const keepGoing = await visitor(entry, visited);\n visited += 1;\n if (keepGoing === false) return { visited, stopped: true };\n }\n }\n\n if (page.next === null || page.next === undefined) {\n if (pending !== null) {\n throw new Error(\"memory.expand ended before completing an entry\");\n }\n return { visited, stopped: false };\n }\n if (page.next.ref !== \"memory.expand\" || !page.next.args ||\n typeof page.next.args !== \"object\" || Array.isArray(page.next.args)) {\n throw new Error(\"memory.expand returned an invalid continuation\");\n }\n const continuationKey = JSON.stringify(page.next);\n if (seen.has(continuationKey)) {\n throw new Error(\"memory.expand returned a cyclic continuation\");\n }\n seen.add(continuationKey);\n page = await __call(page.next.ref, page.next.args);\n }\n};\n\nconst __proxyNames = (() => {\n const raw = globalThis.__fabricProxyNames;\n delete globalThis.__fabricProxyNames;\n return raw && typeof raw === \"object\" ? raw : {};\n})();\nconst __nameList = (value) =>\n Array.isArray(value) ? value.filter((name) => typeof name === \"string\") : [];\nconst __lazyNamespace = (names, resolve, local = {}) => new Proxy(local, {\n get(target, property) {\n if (property === \"then\" || typeof property === \"symbol\") return undefined;\n if (Object.prototype.hasOwnProperty.call(target, property)) return target[property];\n return resolve(String(property));\n },\n ownKeys(target) {\n const own = Object.keys(target);\n return names.concat(own.filter((key) => names.indexOf(key) < 0));\n },\n getOwnPropertyDescriptor(target, property) {\n if (typeof property === \"symbol\") return undefined;\n const name = String(property);\n if (names.indexOf(name) < 0 && !Object.prototype.hasOwnProperty.call(target, name)) {\n return undefined;\n }\n const value = Object.prototype.hasOwnProperty.call(target, name)\n ? target[name]\n : resolve(name);\n return { value, writable: false, enumerable: true, configurable: true };\n },\n has(target, property) {\n if (typeof property === \"symbol\") return false;\n return names.indexOf(String(property)) >= 0\n || Object.prototype.hasOwnProperty.call(target, property);\n },\n});\nconst __providerProxy = (provider, local = {}, names = []) =>\n __lazyNamespace(names, (property) => (args = {}) => __call(provider + \".\" + property, args), local);\nglobalThis.extensions = __providerProxy(\"extensions\", {}, __nameList(__proxyNames.extensions));\nglobalThis.memory = __providerProxy(\"memory\", { walk: __memoryWalk });\nglobalThis.state = __providerProxy(\"state\");\nglobalThis.schema = __providerProxy(\"schema\");\nglobalThis.components = __providerProxy(\"components\");\nglobalThis.compact = __providerProxy(\"compact\");\nglobalThis.codemap = __providerProxy(\"codemap\");\nglobalThis.judgment = __providerProxy(\"judgment\");\nconst __chunkBatchItems = (items, maxItems = 25, maxBytes = 49152) => {\n const chunks = [];\n let current = [];\n let currentBytes = 2;\n for (const item of items) {\n let serialized = \"\";\n try {\n serialized = JSON.stringify(item) ?? \"null\";\n } catch {\n serialized = JSON.stringify(String(item));\n }\n let stateItem = item;\n if (serialized.length > 40960) {\n stateItem = typeof item === \"string\"\n ? item.slice(0, 40000) + \" [truncated]\"\n : String(item).slice(0, 40000) + \" [truncated]\";\n serialized = JSON.stringify(stateItem);\n }\n const itemBytes = serialized.length + 1;\n if (current.length > 0 && (current.length >= maxItems || currentBytes + itemBytes > maxBytes)) {\n chunks.push(current);\n current = [];\n currentBytes = 2;\n }\n current.push({ item, stateItem });\n currentBytes += itemBytes;\n }\n if (current.length > 0) chunks.push(current);\n return chunks;\n};\nconst __judgeAsk = (first, second) => {\n if (second !== undefined) {\n return globalThis.judgment.ask({ state: first, questions: second });\n }\n return globalThis.judgment.ask(first);\n};\nconst __judgeBool = async (state, instructions, options) => {\n try {\n const outcome = await globalThis.judgment.ask({\n state,\n questions: { q: { type: \"bool\", instructions: String(instructions) } },\n });\n if (outcome && outcome.ok && outcome.answers && outcome.answers.q && outcome.answers.q.type === \"bool\" && typeof outcome.answers.q.bool === \"number\") {\n return outcome.answers.q.bool;\n }\n } catch {}\n return options && typeof options.fallback === \"number\" ? options.fallback : undefined;\n};\nconst __judgeChoice = async (state, optionsListOrCriteria, instructions, config) => {\n let criteria = {};\n if (Array.isArray(optionsListOrCriteria)) {\n for (const opt of optionsListOrCriteria) criteria[String(opt)] = null;\n } else if (optionsListOrCriteria && typeof optionsListOrCriteria === \"object\") {\n criteria = optionsListOrCriteria;\n } else {\n throw new TypeError(\"judge.choice options must be an array or criteria object\");\n }\n if (Object.keys(criteria).length < 2) {\n throw new TypeError(\"judge.choice requires at least 2 unique options\");\n }\n try {\n const outcome = await globalThis.judgment.ask({\n state,\n questions: { q: { type: \"choice\", instructions: String(instructions), criteria } },\n });\n if (outcome && outcome.ok && outcome.answers && outcome.answers.q && outcome.answers.q.type === \"choice\" && typeof outcome.answers.q.choice === \"string\") {\n return outcome.answers.q.choice;\n }\n } catch {}\n return config && typeof config.fallback === \"string\" ? config.fallback : undefined;\n};\nconst __judgeScore = async (state, criteria, instructions, config) => {\n if (!Array.isArray(criteria) || criteria.length < 2) {\n throw new TypeError(\"judge.score requires at least 2 ordered criteria levels\");\n }\n try {\n const outcome = await globalThis.judgment.ask({\n state,\n questions: { q: { type: \"score\", instructions: String(instructions), criteria } },\n });\n if (outcome && outcome.ok && outcome.answers && outcome.answers.q && outcome.answers.q.type === \"score\" && typeof outcome.answers.q.score === \"number\") {\n return outcome.answers.q.score;\n }\n } catch {}\n return config && typeof config.fallback === \"number\" ? config.fallback : undefined;\n};\nconst __judgeFilter = async (items, instructions, options = {}) => {\n if (!Array.isArray(items) || items.length === 0) return [];\n const threshold = Number.isFinite(options.threshold) ? options.threshold : 0.7;\n const onFail = options.onFail || \"keep-all\";\n const chunks = __chunkBatchItems(items, options.maxItems || 25, options.maxBytes || 49152);\n const chunkPromises = chunks.map(async (chunk) => {\n const questions = {};\n chunk.forEach((_, idx) => {\n questions[\"item_\" + idx] = {\n type: \"bool\",\n instructions: \"Regarding items[\" + idx + \"]: \" + String(instructions),\n };\n });\n let outcome;\n try {\n outcome = await globalThis.judgment.ask({ state: { items: chunk.map((c) => c.stateItem) }, questions });\n } catch (err) {\n outcome = { ok: false, reason: \"failed\", detail: String(err && err.message ? err.message : err) };\n }\n if (!outcome || !outcome.ok) {\n if (onFail === \"throw\") {\n throw new Error(\"judge.filter failed: \" + (outcome && outcome.reason ? outcome.reason : \"unknown error\") + (outcome && outcome.detail ? \" (\" + outcome.detail + \")\" : \"\"));\n }\n return onFail === \"empty\" ? [] : chunk.map((c) => c.item);\n }\n return chunk\n .filter((_, idx) => {\n const ans = outcome.answers && outcome.answers[\"item_\" + idx];\n return ans && ans.type === \"bool\" && typeof ans.bool === \"number\" && ans.bool >= threshold;\n })\n .map((c) => c.item);\n });\n const results = await Promise.all(chunkPromises);\n return results.flat();\n};\nconst __judgeClassify = async (items, categories, instructions, options = {}) => {\n if (!Array.isArray(items) || items.length === 0) return [];\n if (!Array.isArray(categories) || categories.length < 2) {\n throw new TypeError(\"judge.classify requires at least 2 categories\");\n }\n const criteria = {};\n for (const cat of categories) criteria[String(cat)] = null;\n const onFail = options.onFail || \"keep-all\";\n const chunks = __chunkBatchItems(items, options.maxItems || 25, options.maxBytes || 49152);\n const chunkPromises = chunks.map(async (chunk) => {\n const questions = {};\n chunk.forEach((_, idx) => {\n questions[\"item_\" + idx] = {\n type: \"choice\",\n instructions: \"Regarding items[\" + idx + \"]: \" + String(instructions),\n criteria,\n };\n });\n let outcome;\n try {\n outcome = await globalThis.judgment.ask({ state: { items: chunk.map((c) => c.stateItem) }, questions });\n } catch (err) {\n outcome = { ok: false, reason: \"failed\", detail: String(err && err.message ? err.message : err) };\n }\n if (!outcome || !outcome.ok) {\n if (onFail === \"throw\") {\n throw new Error(\"judge.classify failed: \" + (outcome && outcome.reason ? outcome.reason : \"unknown error\") + (outcome && outcome.detail ? \" (\" + outcome.detail + \")\" : \"\"));\n }\n if (onFail === \"empty\") return [];\n return chunk.map((c) => ({ item: c.item, category: options.fallbackCategory, confidence: undefined }));\n }\n return chunk.map((c, idx) => {\n const ans = outcome.answers && outcome.answers[\"item_\" + idx];\n const category = ans && ans.type === \"choice\" && typeof ans.choice === \"string\" ? ans.choice : options.fallbackCategory;\n const confidence = ans && typeof ans.confidence === \"number\" ? ans.confidence : undefined;\n return { item: c.item, category, confidence };\n });\n });\n const results = await Promise.all(chunkPromises);\n return results.flat();\n};\nglobalThis.judge = Object.freeze({\n ask: __judgeAsk,\n bool: __judgeBool,\n choice: __judgeChoice,\n score: __judgeScore,\n filter: __judgeFilter,\n classify: __judgeClassify,\n});\nconst __createActor = async (args = {}) => {\n if (!args || typeof args !== \"object\" || Array.isArray(args)) {\n throw new TypeError(\"agents.create expects an options object\");\n }\n const request = { ...args };\n const validWhile = request.validWhile;\n if (validWhile !== undefined) {\n if (typeof validWhile !== \"function\") {\n throw new TypeError(\"agents.create validWhile must be a pure predicate function\");\n }\n const source = Function.prototype.toString.call(validWhile);\n if (source.trimStart().startsWith(\"async\")) {\n throw new TypeError(\"agents.create validWhile must be synchronous\");\n }\n request.validWhile = { version: 1, source };\n }\n return __call(\"agents.create\", request);\n};\nconst __handoff = async (args = {}) => {\n if (!args || typeof args !== \"object\" || Array.isArray(args)) {\n throw new TypeError(\"agents.handoff expects an options object\");\n }\n const request = { ...args };\n const when = request.when;\n delete request.when;\n if (when !== undefined) {\n if (typeof when !== \"function\") {\n throw new TypeError(\"agents.handoff when must be a pure predicate function\");\n }\n const decision = when(__handoffFacts());\n if (decision && typeof decision.then === \"function\") {\n throw new TypeError(\"agents.handoff when must return a boolean synchronously\");\n }\n if (decision !== true) {\n throw new Error(\"agents.handoff predicate returned false; no agent was started\");\n }\n }\n return __call(\"agents.handoff\", request);\n};\nglobalThis.agents = Object.freeze({\n run: (args) => __call(\"agents.run\", args),\n handoff: __handoff,\n spawn: (args) => __call(\"agents.spawn\", args),\n wait: (args) => __call(\"agents.wait\", args),\n status: (args) => __call(\"agents.status\", args),\n list: (args = {}) => __call(\"agents.list\", args),\n members: (args = {}) => __call(\"agents.members\", args),\n self: () => __call(\"agents.self\", {}),\n main: () => __call(\"agents.main\", {}),\n peers: () => __call(\"agents.peers\", {}),\n subscribe: (args) => __call(\"agents.subscribe\", args),\n subscriptions: (args = {}) => __call(\"agents.subscriptions\", args),\n unsubscribe: (args) => __call(\"agents.unsubscribe\", args),\n models: (args = {}) => __call(\"agents.models\", args),\n stop: (args) => __call(\"agents.stop\", args),\n cleanup: (args) => __call(\"agents.cleanup\", args),\n create: __createActor,\n ask: (args) => __call(\"agents.ask\", args),\n tell: (args) => __call(\"agents.tell\", args),\n steer: (args) => __call(\"agents.steer\", args),\n followUp: (args) => __call(\"agents.followUp\", args),\n setSteeringMode: (args) => __call(\"agents.setSteeringMode\", args),\n setFollowUpMode: (args) => __call(\"agents.setFollowUpMode\", args),\n actorStatus: (args) => __call(\"agents.actorStatus\", args),\n setModel: (args) => __call(\"agents.setModel\", args),\n switchModel: (args) => __call(\"agents.switchModel\", args),\n setThinking: (args) => __call(\"agents.setThinking\", args),\n setEvents: (args) => __call(\"agents.setEvents\", args),\n setInstructions: (args) => __call(\"agents.setInstructions\", args),\n actors: () => __call(\"agents.actors\", {}),\n messages: (args) => __call(\"agents.messages\", args),\n remove: (args) => __call(\"agents.remove\", args),\n log: (args) => __call(\"agents.log\", args),\n});\nglobalThis.mesh = Object.freeze({\n self: () => __call(\"mesh.self\", {}),\n publish: (args) => __call(\"mesh.publish\", args),\n read: (args = {}) => __call(\"mesh.read\", args),\n members: (args = {}) => __call(\"mesh.members\", args),\n get: (args) => __call(\"mesh.get\", args),\n list: (args = {}) => __call(\"mesh.list\", args),\n put: (args) => __call(\"mesh.put\", args),\n delete: (args) => __call(\"mesh.delete\", args),\n});\n// The mcp proxy itself stays schema-less \u2014 the registry validates args at\n// dispatch \u2014 but guestTypeDeclarations renders per-server argument types from\n// the live descriptor cache (runtime/dynamic-guest-types.ts), so known tools\n// fail type-check on argument-shape mistakes before this proxy ever runs.\nconst __mcpServerTools = (() => {\n const raw = __proxyNames.mcp;\n const out = {};\n if (raw && typeof raw === \"object\") {\n for (const server of Object.keys(raw)) out[server] = __nameList(raw[server]);\n }\n return out;\n})();\nconst __mcpManagement = {\n servers: () => __call(\"mcp.$servers\", {}),\n reload: () => __call(\"mcp.$reload\", {}),\n register: (args) => __call(\"mcp.$register\", args),\n call: (args) => __call(\"mcp.$call\", args),\n};\nglobalThis.mcp = __lazyNamespace(\n Object.keys(__mcpServerTools).sort(),\n (server) => __lazyNamespace(\n __mcpServerTools[server] ? __mcpServerTools[server].slice().sort() : [],\n (tool) => (args = {}) => __call(\"mcp.\" + server + \".\" + tool, args),\n ),\n __mcpManagement,\n);\nlet __workflowSpentTokens = 0;\nconst __workflowBudgetTotal = Number.isFinite(globalThis.__fabricTokenBudget)\n ? Math.max(0, globalThis.__fabricTokenBudget)\n : Number.POSITIVE_INFINITY;\nconst __recordAgentUsage = (result) => {\n const usage = result && result.usage;\n if (usage) __workflowSpentTokens += Number(usage.input || 0) + Number(usage.output || 0);\n return result;\n};\nconst __workflowAgent = async (prompt, options = {}) => {\n if (__workflowSpentTokens >= __workflowBudgetTotal) {\n throw new Error(\"Fabric workflow token budget exhausted\");\n }\n const { label, ...agentOptions } = options;\n const workerName = String(label || agentOptions.name || \"Fabric workflow agent\");\n const result = __recordAgentUsage(await agents.run({\n ...agentOptions,\n ...(label && !agentOptions.name ? { name: label } : {}),\n task: prompt,\n }));\n if (!result || result.status !== \"completed\") {\n const reason = result && result.error ? result.error : \"agent did not complete\";\n throw new Error(workerName + \" failed: \" + reason);\n }\n return result.value !== undefined ? result.value : result.text;\n};\n// Budget-aware agents.run used by council.run and rlm.query so their usage is\n// counted in budget.spent() and the tokenBudget guard can preempt them, just\n// like workflow.agent(). Without this, councils bypass the budget entirely.\nconst __budgetedRun = async (args) => {\n if (__workflowSpentTokens >= __workflowBudgetTotal) {\n throw new Error(\"Fabric workflow token budget exhausted\");\n }\n return __recordAgentUsage(await agents.run(args));\n};\nlet __nextWorkflowSpanId = 0;\nconst __workflowSpanMetadata = (kind, items, options, stageCount) => {\n const itemCount = Array.isArray(items) ? items.length : undefined;\n let concurrency;\n if (kind === \"parallel\" && itemCount !== undefined) {\n if (itemCount === 0) concurrency = 0;\n else {\n const concurrencyOpt = typeof options === \"number\" ? { concurrency: options } : options ?? {};\n const requested = Number(concurrencyOpt.concurrency ?? itemCount);\n if (Number.isFinite(requested) && requested >= 1) {\n concurrency = Math.max(1, Math.min(itemCount, Math.floor(requested)));\n }\n }\n }\n return {\n kind,\n ...(itemCount !== undefined ? { itemCount } : {}),\n ...(stageCount !== undefined ? { stageCount } : {}),\n ...(concurrency !== undefined ? { concurrency } : {}),\n };\n};\nconst __withWorkflowSpan = async (metadata, body) => {\n const id = \"span-\" + __nextWorkflowSpanId++;\n await __call(\"fabric.$spanStart\", { id, ...metadata });\n try {\n const value = await body();\n await __call(\"fabric.$spanEnd\", { id, outcome: \"succeeded\" });\n return value;\n } catch (error) {\n try { await __call(\"fabric.$spanEnd\", { id, outcome: \"failed\" }); } catch { /* preserve the workflow error */ }\n throw error;\n }\n};\nconst __runParallel = async (thunks, options) => {\n if (!Array.isArray(thunks) || thunks.some((thunk) => typeof thunk !== \"function\")) {\n throw new TypeError(\"workflow.parallel expects an array of functions or (items, mapper)\");\n }\n if (thunks.length === 0) return [];\n const concurrencyOpt = typeof options === \"number\" ? { concurrency: options } : options ?? {};\n const requestedConcurrency = Number(concurrencyOpt.concurrency ?? thunks.length);\n if (!Number.isFinite(requestedConcurrency) || requestedConcurrency < 1) {\n throw new RangeError(\"workflow.parallel concurrency must be a positive finite number\");\n }\n const concurrency = Math.max(1, Math.min(thunks.length || 1, Math.floor(requestedConcurrency)));\n const results = new Array(thunks.length);\n let cursor = 0;\n await Promise.all(Array.from({ length: concurrency }, async () => {\n while (cursor < thunks.length) {\n const index = cursor++;\n results[index] = await thunks[index]();\n }\n }));\n return results;\n};\nconst __workflowParallel = async (items, arg2, arg3) => {\n const options = typeof arg2 === \"function\" ? arg3 : arg2;\n return __withWorkflowSpan(\n __workflowSpanMetadata(\"parallel\", items, options),\n async () => {\n if (typeof arg2 === \"function\") {\n if (!Array.isArray(items)) throw new TypeError(\"workflow.parallel expects an array as the first argument\");\n return __runParallel(items.map((item, index) => () => arg2(item, index)), arg3);\n }\n return __runParallel(items, arg2);\n },\n );\n};\nconst __workflowPipeline = async (items, ...stages) =>\n __withWorkflowSpan(\n __workflowSpanMetadata(\"pipeline\", items, undefined, stages.length),\n async () => {\n if (!Array.isArray(items) || stages.some((stage) => typeof stage !== \"function\")) {\n throw new TypeError(\"workflow.pipeline expects an array followed by stage functions\");\n }\n return __workflowParallel(items.map((original, index) => async () => {\n let value = original;\n for (const stage of stages) value = await stage(value, original, index);\n return value;\n }));\n },\n );\nglobalThis.workflow = Object.freeze({\n agent: __workflowAgent,\n parallel: __workflowParallel,\n pipeline: __workflowPipeline,\n configure: (args) => __call(\"fabric.$configure\", args),\n phase: (nameOrInput, options = {}) => {\n const input =\n nameOrInput && typeof nameOrInput === \"object\" && !Array.isArray(nameOrInput)\n ? { ...nameOrInput }\n : { ...options, name: nameOrInput };\n return __call(\"fabric.$phase\", input);\n },\n item: (args) => __call(\"fabric.$item\", args),\n event: (args) => __call(\"fabric.$event\", args),\n log: (...values) => print(...values),\n budget: Object.freeze({\n total: __workflowBudgetTotal,\n spent: () => __workflowSpentTokens,\n remaining: () => Math.max(0, __workflowBudgetTotal - __workflowSpentTokens),\n }),\n});\nglobalThis.agent = __workflowAgent;\nglobalThis.parallel = __workflowParallel;\nglobalThis.pipeline = __workflowPipeline;\nglobalThis.phase = workflow.phase;\nglobalThis.log = workflow.log;\nglobalThis.budget = workflow.budget;\nglobalThis.rlm = Object.freeze({\n query: (args) => {\n if (args && args.runner && args.runner !== \"omp\") {\n throw new Error(\"rlm.query requires the OMP runner because recursive Fabric is unavailable in Claude Code\");\n }\n return __budgetedRun({ ...args, runner: \"omp\", recursive: true });\n },\n});\nglobalThis.council = Object.freeze({\n async run(args) {\n const { task, roles, synthesize = true, ...agentOptions } = args;\n const results = await Promise.all(roles.map((role) => __budgetedRun({\n ...agentOptions,\n name: role,\n task: \"Act as the \" + role + \" council member. Independently analyze this task:\\\\n\\\\n\" + task,\n })));\n if (!synthesize) return results;\n return __budgetedRun({\n ...agentOptions,\n name: \"council-synthesizer\",\n task: \"Synthesize the council's independent reports into one decision. Preserve disagreements and cite which role raised each concern.\\\\n\\\\nTask:\\\\n\" + task + \"\\\\n\\\\nReports:\\\\n\" + JSON.stringify(results),\n });\n },\n});\nglobalThis.console = Object.freeze({ log: print, info: print, warn: print, error: print });\nconst __timerCallbacks = new Map();\nlet __nextTimerId = 1;\nglobalThis.setTimeout = (callback, ms = 0) => {\n const id = __nextTimerId++;\n __timerCallbacks.set(id, { callback, interval: false });\n __call(\"fabric.$timer\", { ms }).then(() => {\n const entry = __timerCallbacks.get(id);\n if (!entry) return;\n __timerCallbacks.delete(id);\n try { entry.callback(); } catch { /* swallow timer callback errors */ }\n });\n return id;\n};\nglobalThis.setInterval = (callback, ms = 0) => {\n const id = __nextTimerId++;\n __timerCallbacks.set(id, { callback, interval: true });\n const schedule = () => {\n __call(\"fabric.$timer\", { ms }).then(() => {\n const entry = __timerCallbacks.get(id);\n if (!entry) return;\n try { entry.callback(); } catch { /* swallow timer callback errors */ }\n if (__timerCallbacks.has(id)) schedule();\n });\n };\n schedule();\n return id;\n};\nglobalThis.clearTimeout = (id) => { __timerCallbacks.delete(id); };\nglobalThis.clearInterval = (id) => { __timerCallbacks.delete(id); };\n})();\n`;\n\nconst formatValue = (value: unknown): string => {\n if (typeof value === \"string\") return value;\n if (value instanceof Error) return value.stack ?? value.message;\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n};\n\nconst jsonText = (value: unknown): string => {\n const serialized = JSON.stringify(value);\n if (serialized === undefined) return \"null\";\n return serialized;\n};\n\nconst jsonHandle = (\n context: any,\n jsonObject: any,\n jsonParse: any,\n value: unknown,\n): any => {\n if (value === undefined) return context.undefined;\n if (value === null) return context.null;\n if (typeof value === \"string\") return context.newString(value);\n if (typeof value === \"boolean\") return value ? context.true : context.false;\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? context.newNumber(value) : context.null;\n }\n const serialized = context.newString(jsonText(value));\n try {\n return context.unwrapResult(context.callFunction(jsonParse, jsonObject, serialized));\n } finally {\n serialized.dispose();\n }\n};\n\nconst HOST_TASK_SETTLE_GRACE_MS = 250;\n\n// The release-sync WASM variant otherwise exhausts the host stack before\n// QuickJS can throw its guest-catchable InternalError.\nconst QUICKJS_MAX_STACK_SIZE_BYTES = 256 * 1024;\nconst QUICKJS_GC_LIST_ASSERTION = \"list_empty(&rt->gc_obj_list)\";\n\n// Preserve an already-computed result for this known Emscripten teardown\n// assertion while allowing every unrelated disposal failure to escape.\nconst disposeQuickJsContext = (context: any): void => {\n try {\n context.dispose();\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (message.includes(QUICKJS_GC_LIST_ASSERTION) && message.includes(\"JS_FreeRuntime\")) return;\n throw error;\n }\n};\n\nexport class QuickJsRuntime {\n async execute(\n code: string,\n hostCall: FabricHostCall,\n options: FabricSandboxOptions,\n ): Promise<FabricSandboxResult> {\n if (options.signal?.aborted) {\n return {\n value: undefined,\n logs: [],\n terminationReason: \"aborted\",\n error: \"Execution cancelled\",\n };\n }\n const missingKeys = missingPayloadKeys(code, options.payloads);\n if (missingKeys.length > 0) {\n const provided = Object.keys(options.payloads ?? {});\n return {\n value: undefined,\n logs: [],\n terminationReason: \"runtime_error\",\n error:\n \"Pre-execution check: \" + missingKeys.map((key) => \"payloads.\" + key).join(\", \")\n + (missingKeys.length === 1 ? \" is referenced in code but its key is missing from the payloads parameter\"\n : \" are referenced in code but their keys are missing from the payloads parameter\")\n + (provided.length ? \" (provided: \" + provided.join(\", \") + \")\" : \" (none provided)\")\n + \". Add payloads: { \" + missingKeys.join(\": '...', \") + \": '...' } to the fabric_exec arguments, then reference the value as payloads.<key>.\"\n + \" For large or quote-heavy content, keep it in top-level payloads and reference payloads.<key> instead of escaping it inside code.\",\n };\n }\n if (\n !Number.isSafeInteger(options.memoryLimitBytes) ||\n options.memoryLimitBytes < 1 ||\n options.memoryLimitBytes > 0xffff_ffff\n ) {\n return {\n value: undefined,\n logs: [],\n terminationReason: \"runtime_error\",\n error: \"QuickJS memory limit must be an integer between 1 byte and 4294967295 bytes (WASM32 maximum)\",\n };\n }\n const module = await quickJsModule();\n const context = module.newContext();\n const runtime = context.runtime;\n const jsonObject = context.getProp(context.global, \"JSON\");\n const jsonParse = context.getProp(jsonObject, \"parse\");\n const executionStartedAt = Date.now();\n let effectiveTimeoutMs = options.timeoutMs;\n let executionDeadlineAt = executionStartedAt + effectiveTimeoutMs;\n let interruptedByDeadline = false;\n runtime.setMemoryLimit(options.memoryLimitBytes);\n runtime.setMaxStackSize(QUICKJS_MAX_STACK_SIZE_BYTES);\n runtime.setInterruptHandler(() => {\n if (options.signal?.aborted === true) return true;\n if (Date.now() <= executionDeadlineAt) return false;\n interruptedByDeadline = true;\n return true;\n });\n const logs: string[] = [];\n const maxLogChars = options.maxLogChars ?? 100_000;\n let logChars = 0;\n let logsTruncated = false;\n const pendingHostPromises = new Set<any>();\n const hostTasks = new Set<Promise<void>>();\n const pendingTimers = new Set<NodeJS.Timeout>();\n let closing = false;\n let cancelled = false;\n let timedOut = false;\n let timeout: NodeJS.Timeout | undefined;\n let rejectDeadline: ((error: Error) => void) | undefined;\n let abortHandler: (() => void) | undefined;\n let activePromiseHandle: any;\n let executionGate: any;\n let pendingResolution: Promise<any> | undefined;\n const hostAbortController = new AbortController();\n const abortHostCalls = (reason: string): void => {\n if (!hostAbortController.signal.aborted) {\n hostAbortController.abort(new Error(reason));\n }\n };\n\n const rejectExecutionGate = (message: string): void => {\n if (!executionGate || executionGate.alive === false) return;\n const errorHandle = context.newError(message);\n executionGate.reject(errorHandle);\n errorHandle.dispose();\n runtime.executePendingJobs();\n };\n\n const timeoutMessage = (): string =>\n `Execution timed out after ${effectiveTimeoutMs}ms`;\n const expireDeadline = (): void => {\n if (closing || cancelled || timedOut) return;\n timedOut = true;\n const message = timeoutMessage();\n abortHostCalls(message);\n rejectExecutionGate(message);\n rejectDeadline?.(new Error(message));\n };\n const scheduleDeadline = (): void => {\n if (!rejectDeadline || closing || cancelled || timedOut) return;\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(expireDeadline, Math.max(0, executionDeadlineAt - Date.now()));\n };\n const extendExecutionTimeout = (\n ref: string,\n args: Record<string, unknown>,\n ): void => {\n const requestedTimeoutMs = options.minimumTimeoutMsForHostCall?.(ref, args);\n if (\n typeof requestedTimeoutMs !== \"number\" ||\n !Number.isFinite(requestedTimeoutMs)\n ) {\n return;\n }\n const requestedDurationMs = Math.max(1, Math.floor(requestedTimeoutMs));\n const nextDeadlineAt = Date.now() + requestedDurationMs;\n const nextTimeoutMs = nextDeadlineAt - executionStartedAt;\n if (nextDeadlineAt <= executionDeadlineAt) return;\n effectiveTimeoutMs = nextTimeoutMs;\n executionDeadlineAt = nextDeadlineAt;\n scheduleDeadline();\n };\n\n try {\n const hostFunction = context.newFunction(\n \"__fabricHostCall\",\n (referenceHandle: any, argsHandle: any) => {\n const reference = context.getString(referenceHandle);\n const dumpedArgs = context.dump(argsHandle);\n const args =\n typeof dumpedArgs === \"object\" && dumpedArgs !== null && !Array.isArray(dumpedArgs)\n ? (dumpedArgs as Record<string, unknown>)\n : {};\n extendExecutionTimeout(reference, args);\n const promise = context.newPromise();\n pendingHostPromises.add(promise);\n void promise.settled.then(() => pendingHostPromises.delete(promise));\n if (reference === \"fabric.$timer\") {\n const ms = Math.max(0, Number(args.ms ?? 0));\n const timer = setTimeout(() => {\n if (closing || promise.alive === false) return;\n promise.resolve(context.undefined);\n runtime.executePendingJobs();\n }, ms);\n timer.unref?.();\n pendingTimers.add(timer);\n void promise.settled.then(() => pendingTimers.delete(timer));\n return promise.handle;\n }\n const task = runAbortable(hostAbortController.signal, () =>\n hostCall(reference, args, hostAbortController.signal),\n )\n .then((value) => {\n if (closing || promise.alive === false) return;\n const handle = jsonHandle(context, jsonObject, jsonParse, value);\n promise.resolve(handle);\n handle.dispose();\n })\n .catch((error) => {\n if (closing || promise.alive === false) return;\n const errorHandle = context.newError(\n error instanceof Error ? error.message : String(error),\n );\n const exit = reference === \"omp.bash\"\n ? ompBashExitMetadata(error)\n : undefined;\n if (exit) {\n const metadata = jsonHandle(context, jsonObject, jsonParse, exit);\n context.setProp(errorHandle, \"__fabricBashExit\", metadata);\n metadata.dispose();\n }\n promise.reject(errorHandle);\n errorHandle.dispose();\n })\n .finally(() => {\n if (!closing) runtime.executePendingJobs();\n });\n hostTasks.add(task);\n void task.finally(() => hostTasks.delete(task));\n return promise.handle;\n },\n );\n context.setProp(context.global, \"__fabricHostCall\", hostFunction);\n hostFunction.dispose();\n\n const printFunction = context.newFunction(\"print\", (...handles: any[]) => {\n if (logsTruncated) return;\n const line = handles.map((handle) => formatValue(context.dump(handle))).join(\" \");\n const remaining = maxLogChars - logChars;\n if (line.length > remaining) {\n if (remaining > 0) logs.push(line.slice(0, remaining));\n logs.push(\"[OMP Fabric log output truncated]\");\n logsTruncated = true;\n return;\n }\n logs.push(line);\n logChars += line.length;\n });\n context.setProp(context.global, \"print\", printFunction);\n printFunction.dispose();\n\n const payloads = jsonHandle(context, jsonObject, jsonParse, options.payloads ?? {});\n context.setProp(context.global, \"payloads\", payloads);\n payloads.dispose();\n const proxyNames = jsonHandle(\n context,\n jsonObject,\n jsonParse,\n options.proxyNames ?? {},\n );\n context.setProp(context.global, \"__fabricProxyNames\", proxyNames);\n proxyNames.dispose();\n const tokenBudget = context.newNumber(options.tokenBudget ?? Number.POSITIVE_INFINITY);\n context.setProp(context.global, \"__fabricTokenBudget\", tokenBudget);\n tokenBudget.dispose();\n\n const setupResult = context.evalCode(GUEST_SETUP, \"omp-fabric-setup.js\");\n if (setupResult.error) {\n const deadlineExceeded = interruptedByDeadline || Date.now() > executionDeadlineAt;\n if (deadlineExceeded) timedOut = true;\n const error = options.signal?.aborted\n ? \"Execution cancelled\"\n : deadlineExceeded\n ? timeoutMessage()\n : formatValue(context.dump(setupResult.error));\n setupResult.error.dispose();\n abortHostCalls(error);\n return {\n value: undefined,\n logs,\n terminationReason: options.signal?.aborted\n ? \"aborted\"\n : deadlineExceeded\n ? \"timed_out\"\n : \"runtime_error\",\n error,\n };\n }\n setupResult.value.dispose();\n\n executionGate = context.newPromise();\n context.setProp(context.global, \"__fabricExecutionGate\", executionGate.handle);\n const guestBundle = options.transpiledCode === undefined\n ? transpileFabricCodeWithSourceMap(code)\n : { code: options.transpiledCode, sourceMap: options.transpiledSourceMap };\n const guestStackMap = createGuestStackMap(guestBundle.sourceMap);\n const guestLineCount = guestBundle.code.split(\"\\n\").length;\n const wrappedCode = `${guestBundle.code}\\nPromise.race([${OMP_GUEST_ENTRYPOINT}(), globalThis.__fabricExecutionGate])`;\n const evaluation = context.evalCode(wrappedCode, \"omp-fabric-guest.js\");\n runtime.executePendingJobs();\n if (evaluation.error) {\n const deadlineExceeded = interruptedByDeadline || Date.now() > executionDeadlineAt;\n if (deadlineExceeded) timedOut = true;\n const error = options.signal?.aborted\n ? \"Execution cancelled\"\n : deadlineExceeded\n ? timeoutMessage()\n : remapGuestErrorText(formatValue(context.dump(evaluation.error)), guestStackMap, guestLineCount);\n evaluation.error.dispose();\n abortHostCalls(error);\n return {\n value: undefined,\n logs,\n terminationReason: options.signal?.aborted\n ? \"aborted\"\n : deadlineExceeded\n ? \"timed_out\"\n : \"runtime_error\",\n error,\n };\n }\n\n activePromiseHandle = evaluation.value;\n const cancellation = new Promise<never>((_resolve, reject) => {\n abortHandler = () => {\n cancelled = true;\n hostAbortController.abort(options.signal?.reason);\n rejectExecutionGate(\"Execution cancelled\");\n reject(new Error(\"Execution cancelled\"));\n };\n if (options.signal?.aborted) abortHandler();\n else options.signal?.addEventListener(\"abort\", abortHandler, { once: true });\n });\n void cancellation.catch(() => undefined);\n const deadline = new Promise<never>((_resolve, reject) => {\n rejectDeadline = reject;\n scheduleDeadline();\n });\n pendingResolution = context.resolvePromise(activePromiseHandle);\n runtime.executePendingJobs();\n const resolution = await Promise.race([pendingResolution, deadline, cancellation]);\n pendingResolution = undefined;\n activePromiseHandle.dispose();\n activePromiseHandle = undefined;\n if (resolution.error) {\n const deadlineExceeded = timedOut || interruptedByDeadline || Date.now() > executionDeadlineAt;\n if (deadlineExceeded) timedOut = true;\n const error = options.signal?.aborted\n ? \"Execution cancelled\"\n : deadlineExceeded\n ? timeoutMessage()\n : remapGuestErrorText(formatValue(context.dump(resolution.error)), guestStackMap, guestLineCount);\n resolution.error.dispose();\n abortHostCalls(error);\n return {\n value: undefined,\n logs,\n terminationReason: options.signal?.aborted\n ? \"aborted\"\n : deadlineExceeded\n ? \"timed_out\"\n : \"runtime_error\",\n error,\n };\n }\n const value = context.dump(resolution.value);\n resolution.value.dispose();\n return { value, logs, terminationReason: \"completed\" };\n } catch (error) {\n const deadlineExceeded = timedOut || interruptedByDeadline || Date.now() > executionDeadlineAt;\n if (deadlineExceeded) timedOut = true;\n abortHostCalls(error instanceof Error ? error.message : String(error));\n return {\n value: undefined,\n logs,\n terminationReason: cancelled ? \"aborted\" : deadlineExceeded ? \"timed_out\" : \"runtime_error\",\n error: cancelled\n ? \"Execution cancelled\"\n : deadlineExceeded\n ? timeoutMessage()\n : error instanceof Error\n ? error.message\n : String(error),\n };\n } finally {\n if (timeout) clearTimeout(timeout);\n for (const timer of pendingTimers) clearTimeout(timer);\n if (abortHandler) options.signal?.removeEventListener(\"abort\", abortHandler);\n if (hostTasks.size > 0) {\n const settled = await settleWithin(hostTasks, HOST_TASK_SETTLE_GRACE_MS);\n if (!settled) {\n abortHostCalls(\"Fabric guest execution ended before its host calls settled\");\n await settleWithin(hostTasks, HOST_TASK_SETTLE_GRACE_MS);\n }\n runtime.executePendingJobs();\n }\n closing = true;\n if (timedOut || cancelled || pendingHostPromises.size > 0) {\n const cleanupMessage = cancelled\n ? \"Execution cancelled\"\n : timedOut\n ? timeoutMessage()\n : \"Fabric guest execution ended before its host calls settled\";\n if (!hostAbortController.signal.aborted) hostAbortController.abort(new Error(cleanupMessage));\n rejectExecutionGate(cleanupMessage);\n const errorHandle = context.newError(cleanupMessage);\n for (const promise of pendingHostPromises) promise.reject(errorHandle);\n errorHandle.dispose();\n runtime.executePendingJobs();\n await new Promise((resolve) => setImmediate(resolve));\n const settled = await Promise.race<any>([\n pendingResolution ? pendingResolution.catch(() => undefined) : Promise.resolve(undefined),\n new Promise<undefined>((resolve) => {\n const timer = setTimeout(() => resolve(undefined), 1_000);\n timer.unref?.();\n }),\n ]);\n if (settled?.error) settled.error.dispose();\n if (settled?.value) settled.value.dispose();\n for (const promise of pendingHostPromises) {\n if (promise.alive !== false) promise.dispose();\n }\n }\n if (activePromiseHandle?.alive !== false) activePromiseHandle?.dispose();\n if (executionGate?.alive !== false) executionGate?.dispose();\n runtime.executePendingJobs();\n jsonParse.dispose();\n jsonObject.dispose();\n disposeQuickJsContext(context);\n }\n }\n}\n", "// Stack frames captured from the executed guest bundle reference the emitted\n// omp-fabric-guest.js (wrapper header plus TypeScript printer layout), not the\n// author's program. These helpers decode the transpile source map and rewrite\n// error text so stack positions point back at the user-submitted code.\n\ninterface GuestSourcePosition {\n line: number;\n column: number;\n}\n\nexport interface GuestStackMap {\n lookup(line: number, column: number): GuestSourcePosition | undefined;\n}\n\ninterface GuestSourceMapJson {\n mappings?: unknown;\n}\n\ninterface MappingSegment {\n generatedColumn: number;\n sourceLine: number;\n sourceColumn: number;\n}\n\nconst BASE64_VALUES = (() => {\n const alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n const table = new Map<string, number>();\n for (let index = 0; index < alphabet.length; index += 1) {\n table.set(alphabet[index] as string, index);\n }\n return table;\n})();\n\nconst decodeVlqSegment = (segment: string): number[] => {\n const values: number[] = [];\n let index = 0;\n while (index < segment.length) {\n let value = 0;\n let shift = 0;\n let continuation = true;\n while (continuation) {\n const digit = BASE64_VALUES.get(segment[index] as string);\n if (digit === undefined) return values;\n index += 1;\n continuation = (digit & 32) !== 0;\n value += (digit & 31) * 2 ** shift;\n shift += 5;\n }\n values.push((value & 1) === 1 ? -(value >> 1) : value >> 1);\n }\n return values;\n};\n\nconst decodeMappings = (mappings: string): MappingSegment[][] => {\n const lines: MappingSegment[][] = [];\n let sourceLine = 0;\n let sourceColumn = 0;\n for (const line of mappings.split(\";\")) {\n const segments: MappingSegment[] = [];\n let generatedColumn = 0;\n for (const rawSegment of line.split(\",\")) {\n if (!rawSegment) continue;\n const values = decodeVlqSegment(rawSegment);\n // values[1] is the source index delta; single-source guest maps never\n // need it, so only generated column and source position accumulate.\n if (values.length < 4) continue;\n generatedColumn += values[0] as number;\n sourceLine += values[2] as number;\n sourceColumn += values[3] as number;\n segments.push({ generatedColumn, sourceLine, sourceColumn });\n }\n lines.push(segments);\n }\n return lines;\n};\n\nexport const createGuestStackMap = (\n sourceMapText: string | undefined,\n): GuestStackMap | undefined => {\n if (!sourceMapText) return undefined;\n let mappings: string;\n try {\n const parsed = JSON.parse(sourceMapText) as GuestSourceMapJson;\n if (typeof parsed.mappings !== \"string\") return undefined;\n mappings = parsed.mappings;\n } catch {\n return undefined;\n }\n // Validating the envelope above is cheap; decoding the VLQ mappings defers\n // to the first error lookup so clean executions pay almost nothing for\n // diagnostics they never render.\n let decoded: MappingSegment[][] | undefined;\n return {\n lookup(line, column) {\n decoded ??= decodeMappings(mappings);\n const segments = decoded[line - 1];\n if (!segments) return undefined;\n const target = column - 1;\n let best: MappingSegment | undefined;\n for (const segment of segments) {\n if (segment.generatedColumn > target) break;\n best = segment;\n }\n // Columns before the first segment point at line indentation; anchor\n // them to the first statement segment rather than leaving the frame\n // in emitted-file coordinates.\n best ??= segments[0];\n if (!best) return undefined;\n // The wrapper header occupies source line 1, so the zero-based source\n // line already equals the author's one-based program line.\n return { line: best.sourceLine, column: best.sourceColumn + 1 };\n },\n };\n};\n\nconst GUEST_FRAME_PATTERN = /omp-fabric-guest\\.js:(\\d+):(\\d+)/g;\n\nexport const remapGuestErrorText = (\n text: string,\n stackMap: GuestStackMap | undefined,\n guestLineCount?: number,\n): string => {\n if (!stackMap || !text.includes(\"omp-fabric-guest.js:\")) return text;\n return text.replace(GUEST_FRAME_PATTERN, (match, lineText, columnText) => {\n const line = Number(lineText);\n const mapped = stackMap.lookup(line, Number(columnText));\n if (mapped) return `guest code:${mapped.line}:${mapped.column}`;\n // Both runtimes append their driver call after the emitted bundle, so\n // frames beyond it can only be harness machinery, never user statements.\n if (guestLineCount !== undefined && line > guestLineCount) return \"fabric driver\";\n return match;\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA,OAAO,wBAAwB;AAC/B,SAAS,uCAAuC;AAChD,OAAO,QAAQ;;;ACsBf,IAAM,iBAAiB,MAAM;AAC3B,QAAM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AI,SAAS,MAAO,SAAQ,MAAM,QAAQ;AAC1C,mBAAW,WAAW,qBAAqB;AACzC,cAAI,QAAQ,UAAU,MAAO,SAAQ,QAAQ;AAAA,QAC/C;AAAA,MACF;AACA,UAAI,qBAAqB,UAAU,MAAO,sBAAqB,QAAQ;AACvE,UAAI,eAAe,UAAU,MAAO,gBAAe,QAAQ;AAC3D,cAAQ,mBAAmB;AAC3B,gBAAU,QAAQ;AAClB,iBAAW,QAAQ;AACnB,4BAAsB,OAAO;AAAA,IAC/B;AAAA,EACF;AACF;",
6
+ "names": ["value"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readFabricExecutionTraceV1
3
- } from "./chunk-JBKYNJFN.js";
3
+ } from "./chunk-FL4A542C.js";
4
4
 
5
5
  // src/compaction/branch-details.ts
6
6
  var FABRIC_BRANCH_SUMMARY_KIND = "omp-fabric.branch-summary";
@@ -218,4 +218,4 @@ export {
218
218
  readFabricBranchSummaryDetails,
219
219
  readFabricProjectionTrace
220
220
  };
221
- //# sourceMappingURL=chunk-3BS4RMF4.js.map
221
+ //# sourceMappingURL=chunk-AZBJNZS4.js.map
@@ -10,7 +10,7 @@ import {
10
10
  lifecycleSourceIdentity,
11
11
  loadModelUsage,
12
12
  useBudgetLedger
13
- } from "./chunk-ABBGHQVX.js";
13
+ } from "./chunk-YAI5SCIE.js";
14
14
  import {
15
15
  normalizeModelAliases,
16
16
  resolveAvailableOmpModel
@@ -685,4 +685,4 @@ if (isMain) {
685
685
  export {
686
686
  runResidentHostFromConfigPath
687
687
  };
688
- //# sourceMappingURL=chunk-EZRC24CX.js.map
688
+ //# sourceMappingURL=chunk-BMSAIMFB.js.map
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  DEFAULT_MEMORY_INDEX_PRIVACY,
11
11
  normalizeSession
12
- } from "./chunk-G3ELO3QC.js";
12
+ } from "./chunk-Z6TTRT6Q.js";
13
13
 
14
14
  // src/memory/index.ts
15
15
  import crypto2 from "node:crypto";
@@ -1226,4 +1226,4 @@ export {
1226
1226
  searchMemoryIndex,
1227
1227
  searchShards
1228
1228
  };
1229
- //# sourceMappingURL=chunk-63VIZJGS.js.map
1229
+ //# sourceMappingURL=chunk-BWLZ6VDQ.js.map
@@ -22,7 +22,7 @@ import {
22
22
  FABRIC_BRANCH_SUMMARY_VERSION,
23
23
  readFabricBranchSummaryDetails,
24
24
  readFabricProjectionTrace
25
- } from "./chunk-3BS4RMF4.js";
25
+ } from "./chunk-AZBJNZS4.js";
26
26
 
27
27
  // src/compaction/hook.ts
28
28
  import "@oh-my-pi/pi-coding-agent";
@@ -1748,4 +1748,4 @@ export {
1748
1748
  compileFabricSummary,
1749
1749
  registerCompactionHook
1750
1750
  };
1751
- //# sourceMappingURL=chunk-BQG4LFAC.js.map
1751
+ //# sourceMappingURL=chunk-D55BFSFK.js.map
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  sessionDirsForCwd,
15
15
  sessionsDirRoot
16
- } from "./chunk-GPJV2FSP.js";
16
+ } from "./chunk-WX6C7N3W.js";
17
17
  import {
18
18
  stableJsonHash,
19
19
  stableJsonHashArrayAsync
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  FABRIC_EXECUTION_TRACE_KIND,
27
27
  readFabricExecutionTraceV1
28
- } from "./chunk-JBKYNJFN.js";
28
+ } from "./chunk-FL4A542C.js";
29
29
 
30
30
  // src/entropy/types.ts
31
31
  var ENTROPY_METRIC_VERSION = 2;
@@ -2208,4 +2208,4 @@ export {
2208
2208
  formatEntropyCompileNotice,
2209
2209
  runEntropyTrial
2210
2210
  };
2211
- //# sourceMappingURL=chunk-WUPYPFAC.js.map
2211
+ //# sourceMappingURL=chunk-E3KTE736.js.map
@@ -181,6 +181,7 @@ var projectFabricAuditArgs = (ref, args) => {
181
181
  return projected(args, (output) => {
182
182
  copyPath(output, args);
183
183
  copyNumber(output, args, "context");
184
+ copyNumber(output, args, "skip");
184
185
  copyNumber(output, args, "limit");
185
186
  });
186
187
  case "omp.find":
@@ -783,4 +784,4 @@ export {
783
784
  isFabricExecutionTraceV1,
784
785
  readFabricExecutionTraceV1
785
786
  };
786
- //# sourceMappingURL=chunk-JBKYNJFN.js.map
787
+ //# sourceMappingURL=chunk-FL4A542C.js.map