omp-fabric 1.19.0 → 1.21.0

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 (76) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +7 -2
  3. package/dist/agents/manager.d.ts +4 -0
  4. package/dist/agents/manager.d.ts.map +1 -1
  5. package/dist/chunks/{chunk-5BFEXYPV.js → chunk-3JYNYBJG.js} +3 -3
  6. package/dist/chunks/{chunk-YOAZ5SO7.js → chunk-BAHZYDFD.js} +66 -1
  7. package/dist/chunks/{chunk-YOAZ5SO7.js.map → chunk-BAHZYDFD.js.map} +2 -2
  8. package/dist/chunks/{chunk-HKRSGUUQ.js → chunk-GUJNTA7Z.js} +62 -1
  9. package/dist/chunks/chunk-GUJNTA7Z.js.map +7 -0
  10. package/dist/chunks/{chunk-YE3CSYYB.js → chunk-KIIJH5CX.js} +167 -18
  11. package/dist/chunks/chunk-KIIJH5CX.js.map +7 -0
  12. package/dist/chunks/{chunk-SRC6ERTE.js → chunk-LNP6JVCZ.js} +2 -2
  13. package/dist/chunks/{chunk-DC3KUZQ5.js → chunk-RA2IB2QT.js} +2 -2
  14. package/dist/chunks/{chunk-QNRGTJGE.js → chunk-RAWYAQQJ.js} +2 -1
  15. package/dist/chunks/chunk-RAWYAQQJ.js.map +7 -0
  16. package/dist/chunks/{chunk-Z5YXOMNU.js → chunk-ZQ72MAHY.js} +40 -14
  17. package/dist/chunks/chunk-ZQ72MAHY.js.map +7 -0
  18. package/dist/compaction/hook.js +1 -1
  19. package/dist/config.d.ts +27 -0
  20. package/dist/config.d.ts.map +1 -1
  21. package/dist/core/system-guidance.d.ts.map +1 -1
  22. package/dist/core/token-math.d.ts +12 -0
  23. package/dist/core/token-math.d.ts.map +1 -1
  24. package/dist/execution-service.d.ts +2 -0
  25. package/dist/execution-service.d.ts.map +1 -1
  26. package/dist/fabric-runtime-state.d.ts +3 -0
  27. package/dist/fabric-runtime-state.d.ts.map +1 -1
  28. package/dist/fabric-runtime-state.js +861 -74
  29. package/dist/fabric-runtime-state.js.map +4 -4
  30. package/dist/fabric-state.d.ts +1 -0
  31. package/dist/fabric-state.d.ts.map +1 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +177 -22
  34. package/dist/index.js.map +4 -4
  35. package/dist/judgment/gates/delegation.d.ts +31 -0
  36. package/dist/judgment/gates/delegation.d.ts.map +1 -0
  37. package/dist/judgment/gates/skills.d.ts +20 -0
  38. package/dist/judgment/gates/skills.d.ts.map +1 -0
  39. package/dist/judgment/gates/tool-exec.d.ts +31 -0
  40. package/dist/judgment/gates/tool-exec.d.ts.map +1 -0
  41. package/dist/judgment/gates/tool-output.d.ts +40 -0
  42. package/dist/judgment/gates/tool-output.d.ts.map +1 -0
  43. package/dist/judgment/host-judge.d.ts +12 -0
  44. package/dist/judgment/host-judge.d.ts.map +1 -0
  45. package/dist/judgment/lane.d.ts +43 -0
  46. package/dist/judgment/lane.d.ts.map +1 -0
  47. package/dist/providers/judgment-provider.d.ts +13 -0
  48. package/dist/providers/judgment-provider.d.ts.map +1 -0
  49. package/dist/residency/host.js +5 -5
  50. package/dist/residency/omp-entry.js +5 -5
  51. package/dist/runtime/core-override-guest-types.js +1 -1
  52. package/dist/runtime/guest-types.d.ts +1 -1
  53. package/dist/runtime/guest-types.d.ts.map +1 -1
  54. package/dist/runtime/guest-types.js +1 -1
  55. package/dist/runtime/node-process-runtime.js +1 -1
  56. package/dist/runtime/quickjs-runtime.d.ts +1 -1
  57. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  58. package/dist/runtime/quickjs-runtime.js +1 -1
  59. package/dist/ui/conversation.js +1 -1
  60. package/dist/ui/conversation.js.map +2 -2
  61. package/dist/ui/dashboard.js.map +1 -1
  62. package/dist/ui/settings.d.ts +1 -1
  63. package/dist/ui/settings.d.ts.map +1 -1
  64. package/dist/ui/settings.js +108 -1
  65. package/dist/ui/settings.js.map +2 -2
  66. package/docs/architecture.md +1 -1
  67. package/docs/configuration.md +15 -0
  68. package/docs/judgment.md +91 -0
  69. package/package.json +9 -8
  70. package/dist/chunks/chunk-HKRSGUUQ.js.map +0 -7
  71. package/dist/chunks/chunk-QNRGTJGE.js.map +0 -7
  72. package/dist/chunks/chunk-YE3CSYYB.js.map +0 -7
  73. package/dist/chunks/chunk-Z5YXOMNU.js.map +0 -7
  74. /package/dist/chunks/{chunk-5BFEXYPV.js.map → chunk-3JYNYBJG.js.map} +0 -0
  75. /package/dist/chunks/{chunk-SRC6ERTE.js.map → chunk-LNP6JVCZ.js.map} +0 -0
  76. /package/dist/chunks/{chunk-DC3KUZQ5.js.map → chunk-RA2IB2QT.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.21.0
4
+
5
+ ### Added
6
+
7
+ - Four judgment gates read the lane from inside Fabric, and every one ships off. `judgment.gates.toolExec` judges a tool call before it runs, `judgment.gates.toolOutput` judges fetched text before it reaches the model, `judgment.gates.delegation` judges the shape of a delegated run, and `judgment.gates.skills` names at most one skill for the turn. They ship off so their effects stay separable: turn on two at once and a behaviour change has two suspects. Every gate fails open, so a refusal from the lane leaves the code on the path it would have taken with no judgment at all, and with a gate off its call site costs two boolean reads and builds nothing.
8
+ - The tool-call gate asks whether running a call destroys state that cannot be recovered, and how far the worst plausible outcome reaches, over the prepared arguments the call will actually run with. A destructive or far-reaching verdict escalates to the `execute` class; `network` is reserved for a reach whose mass sits on shared systems, so an operator guarding outbound traffic is not prompted about a local delete. It escalates through the approval path that already exists by raising the call's risk class, so the operator sees the prompt they already know, carrying the reason. Fabric ships every approval class on `allow`, so on a stock configuration the gate forms a verdict and has nothing to escalate to; it starts having an effect once an approval class moves off `allow`.
9
+ - The tool-output gate screens text fetched from outside the session before it reaches the model. The scope is exact: `mcp.<server>.<tool>` other than its `$` control actions, a captured `extensions.web_search`, and a `read` whose path is an `http`, `https`, `issue`, `pr` or `mcp` URL. Every other call, including all seven core tools on a local path, is returned untouched with no lane contact. A hit returns a flagged envelope carrying `judgmentScreened: true`, the notice, the two probabilities and the redacted result, so a program branches on a field instead of parsing prose, and a miss returns the original value by identity. Redaction replaces prose, never a handle, and it decides on the value rather than on the field name: a fetched document controls its own keys, so exempting `data` or `uri` by name would let an injection choose the field it hides in. A string is prose when fewer than a third of its words are longer than any word in prose, which covers a base64 blob, a cursor, a uuid and a URL whether or not they are line-wrapped. Values that are not plain objects or arrays pass through by reference, so a Buffer stays a Buffer and a Date stays a Date. The notice appears once on the envelope, which is what keeps a result of ten thousand screened leaves from growing by megabytes. A large page travels as a deterministic head-and-tail sample, because an injected payload is commonly appended at the end; on a 197,604-character page the state measures 32,905 bytes against the 65,536-byte ceiling.
10
+ - The delegation gate picks the agent kind and the reasoning effort for a spawn, but only where the caller left the field unset, and only above a confidence floor, so a near-tie leaves the configured default in place. It offers only kinds whose own tool mapper and model normalizer accept this request, and it declines to reroute a run whose model the caller pinned, which keeps the gate from ever being the reason a run fails. The effort comes from the level the judge put the most mass on, never from rounding a probability-weighted index, so a distribution split between the extremes cannot configure a midpoint neither side endorsed.
11
+ - The skill gate ranks the roster in one request and reads the three best candidates properly in a second, putting one line on the message channel rather than the system prompt, so provider prefix caches stay warm. Measured on this machine's roster of 765 skills over a 14-case fixture, it names the labelled skill in 6 of 9 cases, suggests nothing on all 5 turns that needed nothing including two written to sound procedural with no skill behind them, and adds 1.1 seconds at the median and 1.9 at the worst. `bun run benchmark:skill-router` runs that measurement against any fixture. It runs the cases one at a time, because an earlier concurrent version reported queue time as per-turn latency and published a figure three times too high, and it excludes any case the backend failed to answer, because the gate fails open and a dead backend would otherwise read as a perfect false-suggestion score. It measures the ranker, not the agent, since only an end-to-end run shows whether the model then loads what was named.
12
+ - TypeSafe rejects a Choice carrying more than 255 options, which a 765-skill roster crosses on the first attempt. The ranker shards the roster into questions of at most 254 options and merges the winners before the second pass. Nothing in the tree documents that cap; the harness found it as an HTTP 400 on every request, with the gate failing open and suggesting nothing, which is how a design constraint should surface.
13
+
14
+ ## 1.20.0
15
+
16
+ ### Added
17
+
18
+ - `judgment.ask` answers typed questions about one state and returns calibrated probabilities: a `choice` picks one label and reports the distribution across them, a `bool` returns the probability of yes, a `score` returns a probability-weighted position on ordered levels. The backend is the host's judge, resolved lazily at first use through `@oh-my-pi/pi-coding-agent/judgment`, so `providers.judgmentProvider` keeps deciding between TypeSafe System One and the `tiny`/`smol` chat chain and Fabric does not hold a second opinion. Full code mode hides `eval`, which is where the host's own `judge()` helper lives, so a Fabric program previously had no way to ask a calibrated question at all. Verified inside a real session driven with `omp --no-extensions -e`: the resolved judge reported kind `typesafe`, label `typesafe/jev-latest`, and `usesTypeSafeJudge` true against the operator's own credential.
19
+ - Judgments raised over an identical state inside `judgment.coalesceMs` merge into one backend request, and the answers are split back to the callers that asked them, so two parts of a program that do not know about each other still share the wire. Measured against the live API, three questions from two independent callers cost one request and 440 input tokens; the same three asked one at a time cost three requests and 1,038 input tokens. Only an identical state merges, because the wire format carries one state per request. `judgment.maxConcurrent` bounds the requests in flight at 8 by default for the same reason: a program that judges a hundred items in parallel would otherwise open a hundred requests at once, and this surface spends real tokens.
20
+ - `judgment.ask` never throws for an operational reason. A host without the judgment module, a budget refusal, a state `JSON.stringify` cannot take, a backend failure, a blown deadline and a caller abort each resolve `{ ok: false, reason }`, so a judgment that cannot be obtained degrades to the decision the program would have made without it rather than becoming a new way for a turn to fail. The deadline settles the callers itself rather than trusting the backend to observe an abort signal. An oversized state is refused rather than truncated: cutting the evidence silently would change the answer instead of reporting the limit, and only the caller knows which part of its state is expendable. A failed first resolution is retried on the next batch rather than stranding the session, and concurrent first uses share one resolution. The six `judgment.*` keys are editable under `/fabric settings` → **Judgment** and documented in `docs/judgment.md`.
21
+
22
+ ### Changed
23
+
24
+ - Host packages move from 18.1.10 to 18.2.6, which is where the judgment module ships. The bump carries API drift: `ThemeColor` now lives in `@oh-my-pi/pi-tui/theme`, `UserMessageComponent` takes `UserBubbleOptions` where it took a `synthetic` boolean, and `RegisteredTool` requires `sourceInfo`.
25
+
26
+ ### Fixed
27
+
28
+ - The mirrored host tokenizer in `src/core/token-math.ts` under-counted every message the host had started charging for. OMP 18.2.6 charges 1200 tokens per image on `user` and `developer` messages rather than only on `toolResult`, counts `custom` and `hookMessage` like `toolResult`, adds `thinkingSignature`, `redactedThinking` and `anthropicServerTool`, bills `compactionSummary` frames at 5024, and measures UTF-8 bytes rather than characters. A user message carrying one image and the text `abc` scored 1 token against the host's 1201, so compaction thresholds fired late on any session holding images. `tests/host-parity.test.ts` now covers every arm it was missing, including a multibyte case that pins the byte semantics, and the mirror no longer throws on shapes the host tolerates: a non-array `content` object and a BigInt inside tool-call arguments both counted rather than aborting the estimate inside the compaction hook.
29
+
3
30
  ## 1.19.0
4
31
 
5
32
  ### Changed
package/README.md CHANGED
@@ -34,6 +34,7 @@ Fabric gives OMP one programmable tool called `fabric_exec`, which composes core
34
34
  | 🧰 | **Capability routing** | Call OMP core tools, MCP servers, captured extension tools, or Fabric providers through one runtime. |
35
35
  | 🧑‍🤝‍🧑 | **Agent runtime** | One-shot workers, durable resident agents, persistent event-driven actors, councils, and bounded recursive queries. |
36
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, batched into one backend request, with four optional gates that read them. |
37
38
  | 🛡️ | **Guardrails** | Approvals, isolation, timeouts, concurrency, recursion depth, and shared cost budgets. |
38
39
  | 🎛️ | **Native TUI** | Live activity, an interactive dashboard, and settings without leaving OMP. |
39
40
 
@@ -57,7 +58,7 @@ return {
57
58
  };
58
59
  ```
59
60
 
60
- Independent calls run in parallel, and the returned object enters the model context. Known providers support concise direct calls such as `mcp.fal_ai.get_model_schema(...)`, `memory.recall(...)`, `state.get()`, `schema.status()`, and `compact.status()`. Refs found or computed at runtime use `tools.call({ ref, args })`.
61
+ Independent calls run in parallel, and the returned object enters the model context. Known providers support concise direct calls such as `mcp.fal_ai.get_model_schema(...)`, `memory.recall(...)`, `state.get()`, `schema.status()`, `compact.status()`, and `judgment.ask(...)`. Refs found or computed at runtime use `tools.call({ ref, args })`.
61
62
 
62
63
  ## Install
63
64
 
@@ -160,6 +161,7 @@ The command bills your provider and stops at `OMP_FABRIC_BENCH_MAX_USD`. Without
160
161
 
161
162
  - [Configuration](docs/configuration.md): `fabric.json`, code modes, tool capture, approvals, and budgets.
162
163
  - [Code map](docs/codemap.md): the native symbol index, token-budgeted disclosure, and git co-change ranking.
164
+ - [Judgment](docs/judgment.md): calibrated choice, bool, and score answers over one state, batched into a single backend request, and the four gates that read them.
163
165
  - [Memory & recall](docs/memory-recall.md): compact ranked hits, uniform follow calls, lossless expansion, and guest-local `memory.walk` computation.
164
166
  - [Interface & commands](docs/interface.md): dashboard, settings, keybindings, slash commands, and headless runs.
165
167
  - [Agents, actors & mesh](docs/agents.md): model handoff, `/fabric prewalk`, runners, transports, actors, councils, recursive queries, and durable coordination.
@@ -187,8 +189,11 @@ The test suite covers:
187
189
  - provider dispatch, registered-tool execution, QuickJS isolation, and OMP built-in calls
188
190
  - agent fixtures for Claude and Veda
189
191
  - workflows, durable mesh state, actor mailboxes, subscriptions, and actor restoration
192
+ - the judgment lane, its provider, the guest surface, and the four gates
190
193
 
191
- Claude and Veda fixtures use local test processes with zero billable requests.
194
+ Claude and Veda fixtures use local test processes with zero billable requests. The judgment tests use scripted judges and spend nothing either.
195
+
196
+ `bun run benchmark:skill-router` measures the skill gate against a fixture of labelled turns. It needs `TYPESAFE_API_KEY` and makes real requests, so it is not part of `bun test`.
192
197
 
193
198
  ## Acknowledgments
194
199
 
@@ -1,6 +1,8 @@
1
1
  import { type FabricAgentRunner, type FabricAgentConfig, type FabricRetentionConfig } from "../config.js";
2
2
  import { type ClaudeModelInfo } from "./claude-cli.js";
3
3
  import type { FabricSteeringMode, FabricAgentLog, AgentHandleInfo, AgentRunRecord, AgentRunRequest, AgentRunResult, AgentSteerResult } from "./types.js";
4
+ import type { FabricJudgmentLane } from "../judgment/lane.js";
5
+ import type { FabricJudgmentGatesConfig } from "../config.js";
4
6
  import { type FabricLifecyclePublishRequest } from "../lifecycle/types.js";
5
7
  export declare const effectiveAgentTimeoutMs: (configuredTimeoutMs: number, requestedTimeoutMs?: number) => number;
6
8
  interface AgentParticipantGuidanceRequest {
@@ -35,6 +37,8 @@ export declare class AgentManager {
35
37
  onLifecycle?: (event: FabricLifecyclePublishRequest) => void;
36
38
  prepareOmpModel?: (model: string | undefined) => Promise<string | void>;
37
39
  resolveParticipantGuidance?: AgentParticipantGuidanceResolver;
40
+ judgment?: FabricJudgmentLane;
41
+ judgmentGates?: () => FabricJudgmentGatesConfig;
38
42
  });
39
43
  subscribeUi(listener: () => void): () => void;
40
44
  resolveCwd(requestedCwd?: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/agents/manager.ts"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AAgBzB,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EAEd,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AAqBpB,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,uBAAuB,CAAC;AAkB/B,eAAO,MAAM,uBAAuB,GAClC,qBAAqB,MAAM,EAC3B,qBAAqB,MAAM,KAC1B,MASF,CAAC;AAEF,UAAU,+BAA+B;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,KAAK,gCAAgC,GAAG,CACtC,OAAO,EAAE,+BAA+B,KACrC,MAAM,GAAG,SAAS,CAAC;AAExB,uEAAuE;AACvE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AAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,gBAAgB;IAKpE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,gBAAgB;IAgBvE,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,gBAAgB;IAIvE,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,gBAAgB;IAUvE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB;IA4BtD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAinB7B"}
@@ -10,11 +10,11 @@ import {
10
10
  lifecycleSourceIdentity,
11
11
  loadModelUsage,
12
12
  useBudgetLedger
13
- } from "./chunk-YE3CSYYB.js";
13
+ } from "./chunk-KIIJH5CX.js";
14
14
  import {
15
15
  normalizeModelAliases,
16
16
  resolveAvailableOmpModel
17
- } from "./chunk-HKRSGUUQ.js";
17
+ } from "./chunk-GUJNTA7Z.js";
18
18
  import {
19
19
  parseFabricOwnedModelGuidance,
20
20
  resolveFabricModelGuidance
@@ -685,4 +685,4 @@ if (isMain) {
685
685
  export {
686
686
  runResidentHostFromConfigPath
687
687
  };
688
- //# sourceMappingURL=chunk-5BFEXYPV.js.map
688
+ //# sourceMappingURL=chunk-3JYNYBJG.js.map
@@ -1338,6 +1338,70 @@ interface FabricWorkflowApi {
1338
1338
  log(...values: unknown[]): void;
1339
1339
  budget: { total: number; spent(): number; remaining(): number };
1340
1340
  }
1341
+ interface FabricJudgmentChoiceQuestion {
1342
+ type: "choice";
1343
+ instructions: string;
1344
+ criteria: Record<string, string | null>;
1345
+ }
1346
+ interface FabricJudgmentBoolQuestion {
1347
+ type: "bool";
1348
+ instructions: string;
1349
+ criteria?: { true?: string; false?: string };
1350
+ }
1351
+ interface FabricJudgmentScoreQuestion {
1352
+ type: "score";
1353
+ instructions: string;
1354
+ criteria: [string, string, ...string[]];
1355
+ }
1356
+ type FabricJudgmentQuestion =
1357
+ | FabricJudgmentChoiceQuestion
1358
+ | FabricJudgmentBoolQuestion
1359
+ | FabricJudgmentScoreQuestion;
1360
+ interface FabricJudgmentChoiceAnswer {
1361
+ type: "choice";
1362
+ choice: string;
1363
+ probabilities: Record<string, number>;
1364
+ confidence: number;
1365
+ }
1366
+ interface FabricJudgmentBoolAnswer {
1367
+ type: "bool";
1368
+ bool: number;
1369
+ }
1370
+ interface FabricJudgmentScoreAnswer {
1371
+ type: "score";
1372
+ score: number;
1373
+ probabilities: Record<string, number>;
1374
+ confidence: number;
1375
+ }
1376
+ type FabricJudgmentAnswer =
1377
+ | FabricJudgmentChoiceAnswer
1378
+ | FabricJudgmentBoolAnswer
1379
+ | FabricJudgmentScoreAnswer;
1380
+ interface FabricJudgmentApi {
1381
+ ask(args: {
1382
+ state: unknown;
1383
+ questions: Record<string, FabricJudgmentQuestion>;
1384
+ }): Promise<
1385
+ | { ok: true; backend: string; answers: Record<string, FabricJudgmentAnswer> }
1386
+ | {
1387
+ ok: false;
1388
+ reason: "disabled" | "unsupported" | "refused" | "failed" | "timeout" | "aborted";
1389
+ detail?: string;
1390
+ }
1391
+ >;
1392
+ stats(): Promise<{
1393
+ enabled: boolean;
1394
+ requests: number;
1395
+ batched: number;
1396
+ questions: number;
1397
+ merged: number;
1398
+ failures: number;
1399
+ refusals: number;
1400
+ timeouts: number;
1401
+ lastBackend?: string;
1402
+ lastError?: string;
1403
+ }>;
1404
+ }
1341
1405
  declare const tools: FabricToolsApi;
1342
1406
  declare const omp: OmpToolsApi;
1343
1407
  declare const extensions: FabricExtensionsApi;
@@ -1350,6 +1414,7 @@ declare const schema: FabricSchemaApi;
1350
1414
  declare const components: FabricComponentsApi;
1351
1415
  declare const compact: FabricCompactApi;
1352
1416
  declare const codemap: FabricCodemapApi;
1417
+ declare const judgment: FabricJudgmentApi;
1353
1418
  declare const council: FabricCouncilApi;
1354
1419
  declare const workflow: FabricWorkflowApi;
1355
1420
  declare function agent<T = string>(prompt: string, options?: FabricWorkflowAgentOptions): Promise<T>;
@@ -1422,4 +1487,4 @@ export {
1422
1487
  GUEST_TYPE_DECLARATIONS,
1423
1488
  guestTypeDeclarations
1424
1489
  };
1425
- //# sourceMappingURL=chunk-YOAZ5SO7.js.map
1490
+ //# sourceMappingURL=chunk-BAHZYDFD.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/runtime/guest-types.ts"],
4
- "sourcesContent": ["import type { FabricDynamicGuestDeclarations } from \"../protocol.js\";\n\n// These names and compatibility fields are the single source of truth for\n// generated core-override overloads. Keep them beside OmpToolsApi below so an\n// override extends the same guest contract rather than copying its signatures.\n// Numeric fields widen to `number | string` in generated overloads too,\n// mirroring built-in runtime normalization; a strict override schema still\n// rejects the string form at validation time, and the registry error wins.\nexport const OMP_CORE_COMPATIBILITY_ARGUMENT_TYPE_NAMES = {\n read: \"OmpReadCompatibilityArgument\",\n bash: \"OmpBashCompatibilityArgument\",\n edit: \"OmpEditCompatibilityArgument\",\n write: \"OmpWriteCompatibilityArgument\",\n grep: \"OmpGrepCompatibilityArgument\",\n find: \"OmpFindCompatibilityArgument\",\n ls: \"OmpLsCompatibilityArgument\",\n} as const;\n\nexport const OMP_CORE_NUMERIC_FIELDS = {\n read: [\"offset\", \"limit\"],\n bash: [\"timeout\"],\n edit: [],\n write: [],\n grep: [\"context\", \"skip\"],\n find: [\"limit\"],\n ls: [\"limit\"],\n} as const;\n\nexport const GUEST_TYPE_DECLARATIONS = `\ntype JsonPrimitive = string | number | boolean | null;\ntype JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };\ntype FabricTransport = \"auto\" | \"process\" | \"tmux\" | \"screen\" | \"localterm\" | \"herdr\";\ntype FabricAgentRunner = \"omp\" | \"claude\" | \"veda\";\ntype FabricThinking = \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\";\ninterface FabricActionEffect {\n kind: \"none\" | \"scoped\" | \"transactional\" | \"emission\";\n resources?: string[];\n ordering?: \"commutative\" | \"ordered\" | \"unknown\";\n}\ninterface FabricAction {\n ref: string;\n provider: string;\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n outputSchema?: Record<string, unknown>;\n risk: \"read\" | \"write\" | \"execute\" | \"network\" | \"agent\";\n namespace?: string;\n effect?: FabricActionEffect;\n}\ninterface FabricImageContent {\n type: \"image\";\n data: string;\n mimeType: string;\n}\ninterface FabricAgentRequest {\n task: string;\n images?: FabricImageContent[];\n name?: string;\n runner?: FabricAgentRunner;\n transport?: FabricTransport;\n model?: string;\n persona?: string;\n thinking?: FabricThinking;\n tools?: string[];\n addTools?: string[];\n timeoutMs?: number;\n extensions?: boolean;\n recursive?: boolean;\n /** Filesystem execution directory; relative paths resolve from the parent agent cwd. */\n cwd?: string;\n worktree?: boolean;\n schema?: Record<string, unknown>;\n prompt?: string;\n instructions?: string;\n timeout_ms?: number;\n residency?: FabricParticipantResidency;\n}\ninterface FabricHandoffCall {\n readonly ref: string;\n}\ninterface FabricHandoffFacts {\n readonly calls: readonly FabricHandoffCall[];\n count(ref?: string | readonly string[]): number;\n}\ntype FabricHandoffPredicate = (facts: Readonly<FabricHandoffFacts>) => boolean;\ninterface FabricHandoffRequest {\n model: string;\n task?: string;\n when?: FabricHandoffPredicate;\n name?: string;\n transport?: FabricTransport;\n thinking?: FabricThinking;\n tools?: string[];\n timeoutMs?: number;\n extensions?: boolean;\n recursive?: boolean;\n schema?: Record<string, unknown>;\n prompt?: string;\n instructions?: string;\n timeout_ms?: number;\n}\ninterface FabricHandoffResult {\n scheduled: true;\n status: \"deferred\";\n boundary: \"fabric_exec_end\";\n}\ninterface FabricMainAgentInfo {\n id: string;\n name: \"Main\";\n kind: \"main\";\n status: \"idle\" | \"running\" | \"remote\";\n runner: \"omp\";\n transport: \"host\";\n cwd?: string;\n sessionId?: string;\n model?: string;\n thinking?: string;\n startedAt?: number;\n updatedAt: number;\n pendingMessages: boolean;\n local: boolean;\n}\ninterface FabricPeerInfo {\n id: string;\n name: string;\n kind: \"peer\";\n status: \"idle\" | \"running\";\n runner: \"omp\";\n transport: \"host\";\n cwd: string;\n sessionId: string;\n model?: string;\n thinking?: string;\n startedAt: number;\n updatedAt: number;\n pendingMessages: boolean;\n local: false;\n}\ntype FabricParticipantKind = \"root\" | \"agent\" | \"actor\";\ntype FabricParticipantResidency = \"session\" | \"durable\";\ntype FabricParticipantScope = \"local\" | \"lineage\" | \"project\";\ntype FabricParticipantCapability = \"steer\" | \"followUp\" | \"stop\" | \"ask\" | \"actor-bindings\" | \"attach\" | \"fabric\";\ninterface FabricParticipantInfo {\n format: 1;\n id: string;\n kind: FabricParticipantKind;\n rootId: string;\n ownerHostId: string;\n ownerIdentityId: string;\n parentId?: string;\n name: string;\n status: string;\n runner: FabricAgentRunner;\n transport: FabricTransport | \"host\";\n capabilities: FabricParticipantCapability[];\n cwd?: string;\n sessionId?: string;\n model?: string;\n thinking?: string;\n startedAt: number;\n updatedAt: number;\n finishedAt?: number;\n pendingMessages?: boolean;\n currentTool?: string;\n turns?: number;\n toolCalls?: number;\n usage?: { input: number; output: number; cacheRead: number; cacheWrite: number; cost: number };\n actorQueued?: number;\n actorMessages?: number;\n controlProtocol: \"v1\" | \"legacy\";\n residency: FabricParticipantResidency;\n local: boolean;\n stale: boolean;\n}\ntype FabricLifecycleEventType =\n | \"omp.input\"\n | \"omp.agent_start\"\n | \"omp.agent_end\"\n | \"omp.turn_end\"\n | \"omp.tool_error\"\n | \"omp.session_compact\"\n | \"run.completed\"\n | \"run.failed\"\n | \"run.stopped\"\n | \"run.timed_out\"\n | \"tokens.usage\"\n | \"component.state\";\ntype FabricLifecycleDelivery = \"steer\" | \"followUp\";\ninterface FabricLifecycleSource {\n id: string;\n name: string;\n kind: FabricParticipantKind;\n rootId: string;\n runner: FabricAgentRunner;\n ownerHostId?: string;\n ownerIdentityId?: string;\n}\ninterface FabricLifecycleEvent {\n version: 1;\n id: string;\n sequence: number;\n event: FabricLifecycleEventType;\n source: FabricLifecycleSource;\n occurredAt: number;\n publishedAt: number;\n runId?: string;\n status?: string;\n data?: unknown;\n}\ninterface FabricLifecycleSubscription {\n format: 1;\n id: string;\n from: string;\n events: FabricLifecycleEventType[];\n to: string;\n delivery: FabricLifecycleDelivery;\n triggerTurn: boolean;\n once: boolean;\n afterSequence: number;\n createdAt: number;\n updatedAt: number;\n createdBy: { id: string; name: string; kind: \"main\" | \"agent\" | \"actor\"; sessionId?: string };\n lastDeliveredAt?: number;\n lastEventId?: string;\n lastError?: string;\n}\ninterface FabricAgentHandle {\n id: string;\n name: string;\n status: string;\n runner: FabricAgentRunner;\n transport: FabricTransport;\n cwd: string;\n model?: string;\n thinking?: FabricThinking;\n actorId?: string;\n actorName?: string;\n sessionId?: string;\n runnerSessionId?: string;\n attachCommand?: string;\n branch?: string;\n worktree?: string;\n text?: string;\n value?: unknown;\n error?: string;\n logFile?: string;\n residency?: FabricParticipantResidency;\n}\ninterface FabricRemoteControlResult {\n queued: true;\n messageId: string;\n routed: \"mesh\";\n acknowledged: true;\n}\ninterface FabricAgentResult extends FabricAgentHandle {\n task: string;\n startedAt: number;\n finishedAt?: number;\n turns: number;\n toolCalls: number;\n text: string;\n value?: unknown;\n error?: string;\n usage: { input: number; output: number; cacheRead: number; cacheWrite: number; cost: number };\n pendingMessages?: { steering: string[]; followUp: string[] };\n}\ninterface FabricModelInfo {\n runner?: FabricAgentRunner;\n provider: string;\n id: string;\n name: string;\n key: string;\n value?: string;\n resolvedModel?: string;\n displayName?: string;\n description?: string;\n supportsEffort?: boolean;\n supportedEffortLevels?: string[];\n supportsAdaptiveThinking?: boolean;\n supportsFastMode?: boolean;\n supportsAutoMode?: boolean;\n}\ninterface FabricLogLine {\n index?: number;\n offset: number;\n raw: string;\n parsed?: unknown;\n}\ninterface FabricAgentLog {\n id: string;\n runDirectory: string;\n logFile: string;\n status?: FabricAgentResult;\n events: FabricLogLine[];\n hasMore: boolean;\n before?: number;\n}\ninterface FabricActorLog {\n actorId: string;\n actorName: string;\n sessionFile: string;\n logDir: string;\n session: FabricLogLine[];\n sessionHasMore: boolean;\n sessionBefore?: number;\n run?: {\n runId: string;\n eventsFile: string;\n status?: FabricAgentResult;\n events: FabricLogLine[];\n hasMore: boolean;\n before?: number;\n };\n retainedRuns: string[];\n}\ninterface FabricCapabilityActionHead {\n key: string;\n parentKey: string;\n ref: string;\n name: string;\n description: string;\n descriptorHash: string;\n risk: \"read\" | \"write\" | \"execute\" | \"network\" | \"agent\";\n namespace?: string;\n effect?: FabricActionEffect;\n}\ninterface FabricCapabilityProviderHead {\n key: string;\n parentKey: string;\n name: string;\n description: string;\n descriptorHash: string;\n actions: FabricCapabilityActionHead[];\n}\ninterface FabricCapabilityCatalog {\n kind: \"omp-fabric.capability-catalog\";\n version: 1;\n root: {\n key: \"capability:fabric\";\n name: \"Fabric capabilities\";\n description: string;\n descriptorHash: string;\n };\n providers: FabricCapabilityProviderHead[];\n totalActions: number;\n indexedActions: number;\n complete: boolean;\n reasons: string[];\n}\ninterface FabricToolsApi {\n providers(): Promise<Array<{ name: string; description: string }>>;\n catalog(args?: { provider?: string; limit?: number }): Promise<FabricCapabilityCatalog>;\n list(args?: { provider?: string; namespace?: string; query?: string; limit?: number }): Promise<FabricAction[]>;\n search(query: string): Promise<FabricAction[]>;\n search(args: { query: string; limit?: number }): Promise<FabricAction[]>;\n describe(args: { ref: string }): Promise<FabricAction>;\n call(args: { ref: string; args?: Record<string, unknown> }): Promise<unknown>;\n progress(args: { message: string }): Promise<void>;\n models(): Promise<FabricModelInfo[]>;\n}\ninterface FabricCapturedToolResult {\n content: Array<{ type: string; text?: string; [key: string]: unknown }>;\n text: string;\n details?: unknown;\n isError: boolean;\n terminate?: boolean;\n source: { path: string; source: string; scope: string; origin: string; baseDir?: string };\n}\ninterface FabricCapturedTool {\n (args?: Record<string, unknown>): Promise<FabricCapturedToolResult>;\n}\ntype FabricExtensionsApi = Record<string, FabricCapturedTool>;\n// String-primary tools (read/bash/grep/find/ls) accept a bare string; the\n// runtime proxy coerces it to { <primaryField>: string }. Lets the model write\n// the natural form (omp.bash(\"ls\")) instead of omp.bash({ command: \"ls\" }).\n// Return shapes differ by tool: read/grep/find/ls return their text as a bare\n// string (e.g. const src: string = await omp.read({ path })); shell/edit/write\n// return { ok, output, details } (e.g. const { output } = await omp.bash(...)).\n// Common alias keys (cmd\u2192command, query\u2192pattern, file\u2192path, dir\u2192path) and a\n// flat edit shape ({ path, oldText, newText }) are also accepted; the runtime\n// proxy normalizes them to the canonical form before the host validates args.\n// Bash timeout is measured in seconds; timeoutMs is converted from milliseconds.\n// Extended near-miss repairs: find's name/filename/glob \u2192 pattern, write's\n// data \u2192 content, ls's folder \u2192 path, bash's script \u2192 command; numeric option\n// fields (limit/offset/context/timeout) also accept numeric strings, coerced\n// at runtime (2322 diagnostics are suppressed by the type-checker by design).\n// String-primary tools also take a two-arg (primary, options) form \u2014\n// omp.read(\"index.ts\", { limit: 120 }) merges to { path, ...options } at\n// runtime, the positional string winning the primary field on conflict.\n// shell/edit/write envelopes are proxy-guarded so string-method access\n// (.trim(), .split(), iteration) fails with an actionable TypeError pointing\n// at .output instead of QuickJS's context-free \"not a function\" \u2014 property-\n// miss (2339) checks are suppressed by design, so the runtime gives the hint.\ntype OmpPathArgument = {\n path?: string;\n file?: string;\n absolutePath?: string;\n file_path?: string;\n filePath?: string;\n filepath?: string;\n pathname?: string;\n target_file?: string;\n targetFile?: string;\n absolute_path?: string;\n fileAbsolutePath?: string;\n};\ntype OmpOptionalPathArgument = {\n path?: string;\n file?: string;\n absolutePath?: string;\n file_path?: string;\n filePath?: string;\n filepath?: string;\n pathname?: string;\n target_file?: string;\n targetFile?: string;\n absolute_path?: string;\n fileAbsolutePath?: string;\n dir?: string;\n folder?: string;\n directory?: string;\n directoryPath?: string;\n};\ntype OmpOldTextArgument = {\n oldText?: string;\n old?: string;\n old_string?: string;\n oldString?: string;\n old_str?: string;\n oldStr?: string;\n from?: string;\n old_value?: string;\n old_text?: string;\n oldContent?: string;\n old_content?: string;\n};\ntype OmpNewTextArgument = {\n newText?: string;\n new?: string;\n replacement?: string;\n new_string?: string;\n newString?: string;\n new_str?: string;\n newStr?: string;\n to?: string;\n new_value?: string;\n new_text?: string;\n newContent?: string;\n new_content?: string;\n};\ntype OmpEditOperation = OmpOldTextArgument & OmpNewTextArgument & { all?: boolean };\ntype OmpCommandArgument = { command?: string; cmd?: string; shell?: string; cmdline?: string; script?: string; commandLine?: string };\ntype OmpContentArgument = { content?: string; contents?: string; body?: string; text?: string; data?: string; fileContent?: string };\ntype OmpGrepPatternArgument = { pattern?: string; query?: string; regex?: string; search?: string; q?: string; expression?: string; text?: string };\ntype OmpFindPatternArgument = { pattern?: string; query?: string; regex?: string; search?: string; name?: string; filename?: string; glob?: string; expression?: string; include?: string };\n// Two-arg (primary, options) bags for the string-primary tools. Only option\n// aliases belong here (max/start/ctx/ic/...), never primary-field aliases \u2014\n// the primary field comes from the positional string.\ntype OmpReadOptions = { offset?: number; limit?: number; start?: number; max?: number };\n// cwd is honored per call by the omp provider, which binds the command to a\n// shell definition rooted there; relative paths resolve from the session cwd.\n// The alias spellings mirror the shell entries in __ompArgAliases: the\n// runtime repairs them, so the checker has to accept the same spellings or a\n// repairable call is rejected before it ever reaches the sandbox.\ntype OmpShellOptions = {\n timeout?: number; timeoutMs?: number; settle?: boolean;\n cwd?: string; workdir?: string; directory?: string; workingDirectory?: string;\n env?: Record<string, string>; pty?: boolean;\n};\ntype OmpBashOptions = OmpShellOptions;\ntype OmpGrepOptions = { path?: string; glob?: string; globPattern?: string; ignoreCase?: boolean; ic?: boolean; caseInsensitive?: boolean; literal?: boolean; context?: number; ctx?: number; skip?: number; gitignore?: boolean };\ntype OmpFindOptions = { path?: string; limit?: number; max?: number; gitignore?: boolean; hidden?: boolean };\ntype OmpLsOptions = { limit?: number; max?: number };\ntype OmpReadArgument = string | (OmpPathArgument & OmpReadOptions);\ntype OmpBashArgument = string | (OmpCommandArgument & OmpBashOptions);\ntype OmpEditFlatArgument = OmpPathArgument & OmpOldTextArgument & OmpNewTextArgument & { all?: boolean };\ntype OmpEditArgument = OmpPathArgument & ({ edits: OmpEditOperation[]; all?: boolean } | OmpEditFlatArgument);\ntype OmpWriteArgument = string | (OmpPathArgument & OmpContentArgument);\ntype OmpGrepArgument = string | (OmpGrepPatternArgument & OmpGrepOptions);\ntype OmpFindArgument = string | (OmpFindPatternArgument & OmpFindOptions);\ntype OmpLsArgument = string | (OmpOptionalPathArgument & OmpLsOptions);\ntype OmpNumericString<T> = T extends number ? T | string : T;\ntype OmpNumericStringOptions<T> = { [K in keyof T]: OmpNumericString<T[K]> };\ntype OmpReadCompatibilityArgument = string | (OmpPathArgument & OmpNumericStringOptions<OmpReadOptions>);\ntype OmpBashCompatibilityArgument = string | (OmpCommandArgument & OmpNumericStringOptions<OmpBashOptions>);\ntype OmpEditCompatibilityArgument = OmpEditFlatArgument;\ntype OmpWriteCompatibilityArgument = OmpWriteArgument;\ntype OmpGrepCompatibilityArgument = string | (OmpGrepPatternArgument & OmpNumericStringOptions<OmpGrepOptions>);\ntype OmpFindCompatibilityArgument = string | (OmpFindPatternArgument & OmpNumericStringOptions<OmpFindOptions>);\ntype OmpLsCompatibilityArgument = string | (OmpOptionalPathArgument & OmpNumericStringOptions<OmpLsOptions>);\ninterface OmpToolsApi {\n read(args: OmpReadArgument, options?: OmpReadOptions): Promise<string>;\n bash(args: OmpBashArgument, options?: OmpBashOptions): Promise<{ ok: true; output: string; details: unknown } | { ok: false; output: string; details: null; exitCode: number; error: string }>;\n edit(args: OmpEditArgument): Promise<{ ok: true; output: string; details: unknown }>;\n edit(path: string, oldText: string, newText: string): Promise<{ ok: true; output: string; details: unknown }>;\n write(args: OmpWriteArgument): Promise<{ ok: true; output: string; details: unknown }>;\n write(path: string, content: string): Promise<{ ok: true; output: string; details: unknown }>;\n grep(args: OmpGrepArgument): Promise<string>;\n grep(pattern: string, path?: string | OmpGrepOptions, skip?: number): Promise<string>;\n find(args: OmpFindArgument): Promise<string>;\n find(pattern: string, path?: string | OmpFindOptions, limit?: number): Promise<string>;\n ls(args?: OmpLsArgument, options?: OmpLsOptions): Promise<string>;\n}\ntype FabricActorHostEvent =\n | \"resources_discover\"\n | \"session_start\"\n | \"session_before_switch\"\n | \"session_switch\"\n | \"session_before_branch\"\n | \"session_branch\"\n | \"session_before_compact\"\n | \"session.compacting\"\n | \"session_compact\"\n | \"session_shutdown\"\n | \"session_before_tree\"\n | \"session_tree\"\n | \"goal_updated\"\n | \"input\"\n | \"before_agent_start\"\n | \"agent_start\"\n | \"agent_end\"\n | \"session_stop\"\n | \"turn_start\"\n | \"turn_end\"\n | \"message_start\"\n | \"message_update\"\n | \"message_end\"\n | \"context\"\n | \"before_provider_request\"\n | \"after_provider_response\"\n | \"tool_execution_start\"\n | \"tool_call\"\n | \"tool_execution_update\"\n | \"tool_result\"\n | \"tool_execution_end\"\n | \"user_bash\"\n | \"tool_error\";\ntype FabricActorDelivery = \"mailbox\" | \"steer\" | \"followUp\" | \"nextTurn\";\ninterface FabricActorHostMediaDescriptor {\n readonly type: \"image\";\n readonly mediaIndex: number;\n readonly mimeType: string;\n}\ninterface FabricActorHostSignal {\n readonly payload: unknown;\n readonly media?: readonly FabricActorHostMediaDescriptor[];\n readonly idle: boolean;\n readonly observedAt: number;\n}\ntype FabricActorActivation =\n | { readonly kind: \"hostEvent\"; readonly id: string; readonly source: string; readonly sequence: number; readonly createdAt: number; readonly event: FabricActorHostEvent; readonly mainRevision: number; readonly taskRevision: number; readonly signal?: FabricActorHostSignal }\n | { readonly kind: \"direct\"; readonly id: string; readonly source: string; readonly sequence: number; readonly createdAt: number }\n | { readonly kind: \"mesh\"; readonly id: string; readonly source: string; readonly sequence: number; readonly createdAt: number; readonly topic: string };\ninterface FabricActorValidityFacts {\n readonly activation: Readonly<FabricActorActivation>;\n readonly current: Readonly<{ latestActivationSequence: number; mainRevision: number; taskRevision: number; idle: boolean; now: number }>;\n}\ntype FabricActorValidityDecision = boolean | { valid: boolean; reason?: string };\ntype FabricActorBindingScope = \"session\" | \"project\";\ninterface FabricActorRunBinding { model?: string; thinking?: FabricThinking }\ntype FabricActorValidWhile = (facts: Readonly<FabricActorValidityFacts>) => FabricActorValidityDecision;\ninterface FabricActorRequestBase {\n scope?: \"session\" | \"project\" | \"global\";\n name: string;\n instructions: string;\n events?: FabricActorHostEvent[];\n topics?: string[];\n responseMode?: \"text\" | \"directive\";\n coalesce?: boolean;\n runner?: FabricAgentRunner;\n model?: string;\n thinking?: FabricThinking;\n tools?: string[];\n transport?: FabricTransport;\n cwd?: string;\n timeoutMs?: number;\n timeout_ms?: number;\n extensions?: boolean;\n requires?: Array<string | { ref: string; optional?: boolean }>;\n validWhile?: FabricActorValidWhile;\n residency?: FabricParticipantResidency;\n}\ntype FabricActorRequest = FabricActorRequestBase & (\n | { delivery?: \"mailbox\"; triggerTurn?: false }\n | { delivery: \"nextTurn\"; triggerTurn?: false }\n | { delivery: \"steer\" | \"followUp\"; triggerTurn: boolean }\n);\ninterface FabricActorInfo {\n id: string;\n scope: \"session\" | \"project\";\n name: string;\n status: \"idle\" | \"queued\" | \"running\" | \"stopped\";\n runner: FabricAgentRunner;\n events: FabricActorHostEvent[];\n topics: string[];\n delivery: FabricActorDelivery;\n responseMode: \"text\" | \"directive\";\n triggerTurn: boolean;\n coalesce: boolean;\n model?: string;\n thinking?: FabricThinking;\n binding?: FabricActorRunBinding & { scope: \"session\"; sessionId: string; updatedAt?: number };\n projectDefaults?: FabricActorRunBinding & { scope: \"project\" };\n tools?: string[];\n timeoutMs?: number;\n extensions?: boolean;\n requirements?: Array<{ ref: string; optional?: boolean }>;\n capabilityDigest?: string;\n missingCapabilities?: string[];\n validWhile?: { version: 1; source: string };\n residency: FabricParticipantResidency;\n queued: number;\n messages: number;\n createdAt: number;\n updatedAt: number;\n lastRunId?: string;\n lastError?: string;\n sessionFile?: string;\n logDir?: string;\n}\ninterface FabricModelSwitchRequest {\n /** provider/id, a models.aliases name, or a search term; resolution tries aliases first, then exact matches, then the closest fuzzy match (recency from pi-model-sort breaks ties) against authenticated models. */\n model: string;\n /** Optional provider filter applied before matching (e.g. \"anthropic\"). */\n provider?: string;\n}\ninterface FabricModelSwitchResult {\n switched: boolean;\n /** Active model as provider/id after the call (unchanged when reason is \"already-active\"). */\n model: string;\n name?: string;\n /** Previously active provider/id when known. Absent for already-active results. */\n previous?: string;\n /** Set when the selector resolved through a configured models.aliases name. */\n alias?: string;\n /** How the selector resolved: the alias name, or one of closest/recent/latest for inexact picks. Absent for exact provider/id or bare-id matches. */\n via?: string;\n reason?: \"already-active\";\n}\ninterface FabricActorMessage {\n id: string;\n actorId: string;\n actorName: string;\n direction: \"in\" | \"out\";\n source: string;\n createdAt: number;\n text?: string;\n data?: unknown;\n action?: \"silent\" | \"message\" | \"stop\";\n runId?: string;\n error?: string;\n stale?: boolean;\n reason?: string;\n}\n// agentId/agent_id spellings repair to id during agent arg normalization.\ntype FabricAgentTargetArgs = { id: string; agentId?: string; agent_id?: string };\ninterface FabricAgentsApi {\n run(args: FabricAgentRequest): Promise<FabricAgentResult>;\n handoff(args: FabricHandoffRequest): Promise<FabricHandoffResult>;\n spawn(args: FabricAgentRequest): Promise<FabricAgentHandle>;\n wait(args: FabricAgentTargetArgs): Promise<FabricAgentResult>;\n status(args: FabricAgentTargetArgs): Promise<FabricAgentResult | FabricAgentHandle | FabricMainAgentInfo | FabricActorInfo | FabricParticipantInfo>;\n list(args?: { scope?: FabricParticipantScope }): Promise<Array<FabricAgentResult | FabricAgentHandle | FabricParticipantInfo>>;\n members(args?: { scope?: FabricParticipantScope; kinds?: FabricParticipantKind[]; includeStale?: boolean }): Promise<FabricParticipantInfo[]>;\n self(): Promise<FabricParticipantInfo>;\n main(): Promise<FabricMainAgentInfo>;\n sessions(): Promise<FabricParticipantInfo[]>;\n peers(): Promise<FabricPeerInfo[]>;\n subscribe(args: {\n from: string;\n events: FabricLifecycleEventType[];\n to?: string;\n delivery: FabricLifecycleDelivery;\n triggerTurn: boolean;\n once?: boolean;\n }): Promise<FabricLifecycleSubscription>;\n subscriptions(args?: { from?: string; to?: string }): Promise<FabricLifecycleSubscription[]>;\n unsubscribe(args: FabricAgentTargetArgs): Promise<{ removed: boolean }>;\n models(args?: { runner?: FabricAgentRunner; refresh?: boolean }): Promise<FabricModelInfo[]>;\n stop(args: FabricAgentTargetArgs): Promise<FabricAgentResult | FabricActorInfo | FabricRemoteControlResult>;\n cleanup(args: FabricAgentTargetArgs & { deleteBranch?: boolean; delete_branch?: boolean }): Promise<{ cleaned: boolean }>;\n create(args: FabricActorRequest): Promise<FabricActorInfo>;\n setModel(args: { id: string; model?: string; scope?: FabricActorBindingScope }): Promise<FabricActorInfo>;\n switchModel(args: FabricModelSwitchRequest): Promise<FabricModelSwitchResult>;\n setThinking(args: { id: string; thinking?: FabricThinking; scope?: FabricActorBindingScope }): Promise<FabricActorInfo>;\n setTools(args: { id: string; tools: string[]; scope?: \"project\" | \"global\" }): Promise<FabricActorInfo>;\n setEvents(args: { id: string; events: FabricActorHostEvent[] }): Promise<FabricActorInfo>;\n setDeliveryPolicy(args: {\n id: string;\n delivery: FabricActorDelivery;\n triggerTurn: boolean;\n scope?: \"project\" | \"global\";\n }): Promise<FabricActorInfo>;\n setInstructions(args: {\n id: string;\n instructions: string;\n scope?: \"project\" | \"global\";\n }): Promise<FabricActorInfo>;\n ask(args: { id: string; message: string; data?: unknown; model?: string; thinking?: FabricThinking }): Promise<FabricActorMessage>;\n tell(args: { id: string; message: string; data?: unknown; model?: string; thinking?: FabricThinking }): Promise<{ queued: true; messageId: string }>;\n steer(args: { id: string; message: string; data?: unknown }): Promise<{ queued: true; messageId: string; routed?: \"local\" | \"main\" | \"mesh\"; acknowledged?: boolean }>;\n followUp(args: { id: string; message: string; data?: unknown }): Promise<{ queued: true; messageId: string; routed?: \"local\" | \"main\" | \"mesh\"; acknowledged?: boolean }>;\n setSteeringMode(args: { id: string; mode: \"all\" | \"one-at-a-time\" }): Promise<{ queued: true; messageId: string }>;\n setFollowUpMode(args: { id: string; mode: \"all\" | \"one-at-a-time\" }): Promise<{ queued: true; messageId: string }>;\n actorStatus(args: FabricAgentTargetArgs): Promise<FabricActorInfo>;\n actors(): Promise<FabricActorInfo[]>;\n messages(args: { id: string; limit?: number }): Promise<FabricActorMessage[]>;\n remove(args: { id: string }): Promise<{ removed: boolean }>;\n log(args: {\n id: string;\n type?: \"session\" | \"run\" | \"all\";\n lines?: number;\n before?: number;\n runId?: string;\n }): Promise<FabricActorLog | FabricAgentLog>;\n}\ninterface FabricMcpResult {\n text: string;\n content: unknown[];\n structuredContent: unknown;\n}\ninterface FabricMcpTool {\n (args?: Record<string, unknown>): Promise<FabricMcpResult | unknown>;\n}\ninterface FabricMcpServer {\n [tool: string]: FabricMcpTool;\n}\n// Management verbs stay members of mcp even when the declare line below is\n// replaced by generated per-server declarations (see the dynamic option on\n// guestTypeDeclarations), so generated surfaces intersect with this type\n// rather than re-declaring them.\ninterface FabricMcpManagement {\n servers(): Promise<Array<{ name: string; description: string | null; transport: \"http\" | \"stdio\" }>>;\n reload(): Promise<{ servers: string[] }>;\n register(args: {\n name: string;\n description?: string;\n command?: string;\n args?: string[];\n cwd?: string;\n baseUrl?: string;\n headers?: Record<string, string>;\n env?: Record<string, string>;\n overwrite?: boolean;\n }): Promise<{ registered: string }>;\n call(args: { server: string; tool: string; args?: Record<string, unknown>; timeoutMs?: number }): Promise<unknown>;\n}\n// Loose static surface: any server/tool name compiles and argument shapes are\n// enforced at dispatch by the registry. With descriptor data available the\n// execution service replaces the declare-const-mcp line below with a\n// schema-typed rendering of the live cache (runtime/dynamic-guest-types.ts).\ntype FabricMcpApi = Record<string, FabricMcpServer> & FabricMcpManagement;\ninterface FabricCouncilRunOptions {\n task: string;\n roles: string[];\n runner?: FabricAgentRunner;\n transport?: FabricTransport;\n model?: string;\n thinking?: FabricThinking;\n tools?: string[];\n timeoutMs?: number;\n /** Filesystem execution directory; relative paths resolve from the parent agent cwd. */\n cwd?: string;\n worktree?: boolean;\n}\ninterface FabricCouncilApi {\n run(args: FabricCouncilRunOptions & { synthesize?: true }): Promise<FabricAgentResult>;\n run(args: FabricCouncilRunOptions & { synthesize: false }): Promise<FabricAgentResult[]>;\n}\ninterface FabricMeshIdentity {\n id: string;\n name: string;\n kind: \"main\" | \"actor\" | \"agent\";\n sessionId?: string;\n}\ninterface FabricMeshEvent {\n id: string;\n sequence: number;\n topic: string;\n kind: string;\n from: FabricMeshIdentity;\n to?: string;\n text?: string;\n data?: unknown;\n createdAt: number;\n}\ninterface FabricMeshStateEntry<T = unknown> {\n key: string;\n value: T;\n version: number;\n updatedAt: number;\n updatedBy: FabricMeshIdentity;\n}\ninterface FabricMeshApi {\n self(): Promise<FabricMeshIdentity>;\n publish(args: { topic: string; kind?: string; to?: string; text?: string; data?: unknown; message?: string; body?: string }): Promise<FabricMeshEvent>;\n read(args?: { after?: number; topic?: string; to?: string; limit?: number; max?: number }): Promise<FabricMeshEvent[]>;\n members(args: { scope?: FabricParticipantScope; kinds?: FabricParticipantKind[]; includeStale?: boolean; limit?: number; max?: number; include_stale?: boolean; withTotal: true }): Promise<{ members: FabricParticipantInfo[]; total: number; truncated: boolean }>;\n members(args?: { scope?: FabricParticipantScope; kinds?: FabricParticipantKind[]; includeStale?: boolean; limit?: number; max?: number; include_stale?: boolean; withTotal?: false }): Promise<FabricParticipantInfo[]>;\n get<T = unknown>(args: { key: string }): Promise<FabricMeshStateEntry<T> | null>;\n list<T = unknown>(args: { prefix?: string; limit?: number; max?: number; withTotal: true }): Promise<{ entries: Array<FabricMeshStateEntry<T>>; total: number; truncated: boolean }>;\n list<T = unknown>(args?: { prefix?: string; limit?: number; max?: number; withTotal?: false }): Promise<Array<FabricMeshStateEntry<T>>>;\n put<T = unknown>(args: { key: string; value: T; ifVersion?: number; if_version?: number; version?: number }): Promise<FabricMeshStateEntry<T>>;\n delete(args: { key: string; ifVersion?: number; if_version?: number; version?: number }): Promise<{ deleted: boolean; version?: number }>;\n}\n// Stable-provider argument bags declare the canonical keys plus the\n// near-miss spellings repaired during argument normalization\n// (providers/arg-normalization.ts and each provider's per-action table). The\n// registry's prepare stage repairs aliases before schema validation, so a\n// call spelled with an alias typechecks instead of tripping the\n// excess-property check; the canonical key wins on conflict, and anything\n// else fails additionalProperties:false validation with the offending\n// property path named. Keep these spillover fields in sync with the provider\n// normalization tables.\ntype FabricMemoryBranches = \"active\" | \"all\";\ntype FabricMemoryQueryMode = \"literal\" | \"phrase\" | \"regex\";\ntype FabricMemoryQueryMatch = \"all\" | \"any\";\ninterface FabricMemoryEntryRange {\n first: number;\n last: number;\n}\ninterface FabricMemoryRecallArgs {\n query?: string;\n queryMode?: FabricMemoryQueryMode;\n queryMatch?: FabricMemoryQueryMatch;\n expectedSourceHash?: string;\n expectedLineageFingerprint?: string;\n branches?: FabricMemoryBranches;\n scope?: string;\n offset?: number;\n pageSize?: number;\n snippetChars?: number;\n role?: string;\n tool?: string;\n ref?: string;\n provider?: string;\n action?: string;\n outcome?: \"succeeded\" | \"failed\" | \"aborted\" | \"timed_out\";\n since?: number;\n until?: number;\n entryRange?: FabricMemoryEntryRange;\n q?: string;\n limit?: number;\n max?: number;\n page_size?: number;\n snippet_chars?: number;\n query_mode?: FabricMemoryQueryMode;\n query_match?: FabricMemoryQueryMatch;\n entry_range?: FabricMemoryEntryRange;\n}\ninterface FabricMemoryExpandArgs {\n session: string;\n expectedSourceHash?: string;\n expectedLineageFingerprint?: string;\n branches?: FabricMemoryBranches;\n indices?: number[];\n entryIds?: string[];\n operationAddresses?: string[];\n entryRange?: FabricMemoryEntryRange;\n before?: number;\n after?: number;\n entryOffset?: number;\n textOffset?: number;\n maxChars?: number;\n maxEntries?: number;\n id?: string;\n file?: string;\n path?: string;\n session_id?: string;\n index?: number;\n entry_ids?: string[];\n operation_addresses?: string[];\n entry_range?: FabricMemoryEntryRange;\n entry_offset?: number;\n text_offset?: number;\n max_chars?: number;\n max_entries?: number;\n}\ninterface FabricMemoryCall<Ref extends string, Args> {\n ref: Ref;\n args: Args;\n}\ninterface FabricMemoryRecallEntryHit {\n kind: \"entry\";\n sessionId: string;\n tier: \"hot\" | \"cold\";\n index: number;\n entryId: string | null;\n parentId: string | null;\n operationAddress: string | null;\n type: string;\n role: string | null;\n tool: string | null;\n ref: string | null;\n provider: string | null;\n action: string | null;\n timestamp: number | null;\n isError: boolean;\n outcome?: \"succeeded\" | \"failed\" | \"aborted\" | \"timed_out\";\n score: number;\n snippet: string;\n truncated: boolean;\n follow: FabricMemoryCall<\"memory.expand\", FabricMemoryExpandArgs>;\n}\ninterface FabricMemoryRecallSessionHit {\n kind: \"session\";\n sessionId: string;\n tier: \"cold\";\n cwd: string;\n lastTimestamp: number | null;\n score: number;\n matchedTerms: number;\n matchedStructuralEntries: number;\n follow: FabricMemoryCall<\"memory.recall\", FabricMemoryRecallArgs>;\n}\ninterface FabricLcmMemoryHit {\n kind: \"lcm.raw\" | \"lcm.summary\";\n sessionId: string;\n score: number;\n snippet: string;\n truncated: boolean;\n source: { kind: \"raw\" | \"summary\"; projectKey: string; sessionId: string; entryId?: string; revision?: number; contentHash?: string; nodeId?: string; sourceHash: string };\n follow: FabricMemoryCall<\"memory.expand\", FabricMemoryExpandArgs>;\n}\ntype FabricMemoryRecallHit = FabricMemoryRecallEntryHit | FabricMemoryRecallSessionHit | FabricLcmMemoryHit;\ninterface FabricMemoryError {\n code: string;\n message: string;\n [key: string]: unknown;\n}\ninterface FabricMemoryCoverage {\n complete: boolean;\n indexedSessions: number;\n eligibleSessions: number;\n staleSessions: number;\n incompleteSessions: number;\n reasons: string[];\n error?: FabricMemoryError;\n}\ninterface FabricMemoryRecallResult {\n total: number;\n hits: FabricMemoryRecallHit[];\n next: FabricMemoryCall<\"memory.recall\", FabricMemoryRecallArgs> | null;\n coverage: FabricMemoryCoverage;\n error?: FabricMemoryError;\n}\ninterface FabricMemoryExpandedEntry {\n index: number;\n entryId: string | null;\n parentId: string | null;\n type: string | null;\n role: string | null;\n timestamp: number | null;\n isError: boolean;\n anchor?: boolean;\n text: string;\n textRange: { start: number; end: number; total: number; complete: boolean };\n parentEntryId?: string | null;\n operationAddress?: string | null;\n tool?: string | null;\n ref?: string | null;\n provider?: string | null;\n action?: string | null;\n outcome?: \"succeeded\" | \"failed\" | \"aborted\" | \"timed_out\";\n filesTouched?: Array<string | null>;\n operation?: unknown;\n branchFact?: unknown;\n structuredContent?: unknown;\n structuredTruncated?: boolean;\n factAddress?: string | null;\n carrierEntryId?: string | null;\n carrierParentId?: string | null;\n carrierFromId?: string | null;\n}\ninterface FabricMemoryExpandResult {\n session?: string;\n sourceHash?: string;\n branches?: FabricMemoryBranches;\n lineageFingerprint?: string;\n entryCount?: number;\n entries: FabricMemoryExpandedEntry[];\n next?: FabricMemoryCall<\"memory.expand\", FabricMemoryExpandArgs> | null;\n error?: FabricMemoryError;\n}\ninterface FabricMemoryWalkResult {\n visited: number;\n stopped: boolean;\n error?: FabricMemoryError;\n}\ninterface FabricMemorySessionInfo {\n id: string;\n file: string;\n cwd: string;\n mtime: number;\n entryCount: number;\n tier: \"hot\" | \"cold\";\n branches: FabricMemoryBranches;\n lineageFingerprint: string | null;\n}\ninterface FabricMemoryApi {\n recall(args?: FabricMemoryRecallArgs): Promise<FabricMemoryRecallResult>;\n expand(args: FabricMemoryExpandArgs): Promise<FabricMemoryExpandResult>;\n walk(\n args: FabricMemoryExpandArgs,\n visitor: (\n entry: FabricMemoryExpandedEntry,\n index: number,\n ) => boolean | void | Promise<boolean | void>,\n ): Promise<FabricMemoryWalkResult>;\n sessions(args?: {\n scope?: string;\n branches?: FabricMemoryBranches;\n limit?: number;\n max?: number;\n offset?: number;\n }): Promise<{\n scope?: string;\n branches?: FabricMemoryBranches;\n offset?: number;\n total?: number;\n truncated?: boolean;\n sessions?: FabricMemorySessionInfo[];\n error?: FabricMemoryError;\n }>;\n}\ninterface FabricStateTransitionArgs {\n label: string;\n from?: string;\n to: string;\n summary: string;\n evidence?: string[];\n tags?: string[];\n kind?: \"state\" | \"representation\";\n complexity?: { files: string[] };\n force?: boolean;\n name?: string;\n description?: string;\n}\ninterface FabricStateComplexityFile {\n file: string;\n supported: boolean;\n language?: string;\n current?: number;\n recorded?: number;\n delta?: number;\n recordedDelta?: number;\n}\ninterface FabricStateVerificationResult {\n certified: boolean;\n violated: boolean;\n certificationStatus: \"certified\" | \"failed\";\n results: unknown[];\n failures: unknown[];\n certificate?: unknown;\n reportingError?: string;\n evidenceDigest: string;\n resultDigest: string;\n}\ninterface FabricStateApi {\n transition(args: FabricStateTransitionArgs): Promise<{ event: FabricMeshEvent; head: unknown }>;\n get(): Promise<{\n head: unknown | null;\n goal: { check: string; description?: string } | null;\n complexity: { files: number; decisionPoints: number; lastNetDelta: number };\n certification: { current: unknown | null; recent: unknown[] };\n recentLabels: string[];\n }>;\n history(args?: { label?: string; limit?: number; includeArchived?: boolean; name?: string; max?: number }): Promise<{\n transitions: unknown[];\n labels: string[];\n certifications: unknown[];\n }>;\n complexity(args?: { files?: string[]; paths?: string[] }): Promise<{ files: FabricStateComplexityFile[]; netDelta: number }>;\n verify(args?: { labels?: string[]; includeArchived?: boolean; timeoutMs?: number; label?: string }): Promise<FabricStateVerificationResult>;\n goal(args: { check: string; description?: string; command?: string; cmd?: string; predicate?: string }): Promise<FabricMeshStateEntry<{ check: string; description?: string }>>;\n checkGoal(args?: { timeoutMs?: number }): Promise<{\n passed: boolean;\n output: string;\n exitCode: number | null;\n error?: string;\n }>;\n}\ntype FabricSchemaEvidence =\n | { kind: \"file_exists\"; path: string }\n | { kind: \"file_absent\"; path: string }\n | { kind: \"file_contains\"; path: string; literal: string }\n | { kind: \"file_sha256\"; path: string; sha256: string }\n | { kind: \"trusted_command\"; name: string };\ntype FabricSchemaFileOperation =\n | { kind: \"write\"; path: string; content: string; expected: { absent: true } | { sha256: string } }\n | { kind: \"edit\"; path: string; oldText: string; newText: string; expectedSha256: string }\n | { kind: \"delete\"; path: string; expectedSha256: string };\ninterface FabricSchemaEvidenceResult {\n evidence: FabricSchemaEvidence;\n status: \"confirmed\" | \"nonconfirmed\" | \"error\";\n detail: string;\n exitCode?: number | null;\n output?: string;\n observedSha256?: string;\n}\ninterface FabricSchemaStatus {\n mode: \"off\" | \"audit\" | \"enforce\";\n certificateTtlMs: number;\n maxFiles: number;\n maxBytes: number;\n trustedCommands: string[];\n generation: number;\n lastOutcome: \"committed\" | \"rolled_back\" | \"quarantined\" | null;\n hypotheses: Array<{\n id: string;\n label: string;\n status: string;\n generation: number;\n updatedAt: number;\n }>;\n}\ninterface FabricSchemaVerificationResult {\n verified: boolean;\n hypothesisId: string;\n certificate?: string;\n issuedAt?: number;\n expiresAt?: number;\n reason?: string;\n results: FabricSchemaEvidenceResult[];\n}\ninterface FabricSchemaCommitResult {\n outcome: \"committed\" | \"rolled_back\" | \"quarantined\";\n transactionId: string;\n generation?: number;\n paths?: string[];\n postconditions?: FabricSchemaEvidenceResult[];\n complexityReductionCertified?: boolean;\n stateTransition?: unknown;\n error?: string;\n rollbackError?: string;\n}\ninterface FabricSchemaApi {\n status(): Promise<FabricSchemaStatus>;\n hypothesize(args: {\n label: string;\n summary: string;\n evidence: FabricSchemaEvidence[];\n complexityReduction?: boolean;\n name?: string;\n description?: string;\n complexity_reduction?: boolean;\n }): Promise<{\n hypothesisId: string;\n status: string;\n state: unknown;\n fingerprint: string;\n generation: number;\n }>;\n verify(args: { hypothesisId: string; id?: string; hypothesis_id?: string }): Promise<FabricSchemaVerificationResult>;\n commit(args: {\n hypothesisId: string;\n certificate: string;\n operations: FabricSchemaFileOperation[];\n postconditions: FabricSchemaEvidence[];\n id?: string;\n hypothesis_id?: string;\n }): Promise<FabricSchemaCommitResult>;\n abort(args: { hypothesisId: string; certificate?: string; id?: string; hypothesis_id?: string }): Promise<{\n aborted: true;\n hypothesisId: string;\n }>;\n}\ninterface FabricCompactPendingIntent {\n reason?: string;\n instructions?: string;\n preserve?: string[];\n requestedBy: string;\n requestedAt: number;\n}\ninterface FabricCompactLastCommit {\n at: number;\n requestedBy: string;\n status: \"committed\" | \"skipped\" | \"cancelled\" | \"failed\";\n summary?: string;\n tokensBefore?: number;\n estimatedTokensAfter?: number;\n error?: string;\n persisted?: boolean;\n}\ninterface FabricCompactContextUsage {\n known: boolean;\n tokens: number | null;\n contextWindow: number | null;\n percent: number | null;\n remainingTokens: number | null;\n}\ninterface FabricCompactStatus {\n pending?: FabricCompactPendingIntent;\n last?: FabricCompactLastCommit;\n context?: FabricCompactContextUsage;\n engine?: string;\n targetContextRatio?: number;\n model?: string;\n sessionId?: string;\n}\ntype FabricComponentState = \"waiting\" | \"loading\" | \"active\" | \"unloading\" | \"failed\" | \"quarantined\" | \"disposed\";\ninterface FabricComponentEffectInfo {\n label: string;\n kind: \"none\" | \"scoped\" | \"transactional\" | \"emission\";\n resources: string[];\n ordering: \"commutative\" | \"ordered\" | \"unknown\";\n}\ninterface FabricComponentEffectConflict {\n withComponent: string;\n resources: string[];\n reason: \"shared_resource\" | \"unknown_resource\";\n}\ninterface FabricComponentInfo {\n id: string;\n component: string;\n parentId?: string;\n state: FabricComponentState;\n guarantee: \"managed\" | \"revertible\";\n requirements: string[];\n provisions: string[];\n missing: string[];\n optionalMissing: string[];\n effects?: FabricComponentEffectInfo[];\n effectConflicts?: FabricComponentEffectConflict[];\n targetDigest?: string;\n error?: string;\n cleanupErrors?: string[];\n revision: number;\n createdAt: number;\n updatedAt: number;\n}\ninterface FabricComponentsApi {\n list(): Promise<{\n definitions: Array<{ name: string; description?: string; revision: number; requirements: string[]; provisions: string[] }>;\n components: FabricComponentInfo[];\n }>;\n status(args: { id: string }): Promise<FabricComponentInfo>;\n graph(): Promise<{\n components: FabricComponentInfo[];\n edges: Array<{ from: string; to: string; ref: string; kind?: \"dependency\" | \"ownership\" }>;\n cycles: string[][];\n }>;\n reload(args?: { id?: string }): Promise<{ components: FabricComponentInfo[] }>;\n}\n\ninterface FabricCompactApi {\n request(args?: {\n reason?: string;\n instructions?: string;\n preserve?: string[];\n requestedBy?: string;\n instruction?: string;\n requested_by?: string;\n }): Promise<{ requested: true; intent: FabricCompactPendingIntent }>;\n status(): Promise<FabricCompactStatus>;\n cancel(): Promise<{ cancelled: true }>;\n}\n\ninterface FabricCodemapSymbolCounts {\n files: number;\n symbols: number;\n languages: Record<string, number>;\n fallbackFiles: number;\n truncated: boolean;\n elapsedMs: number;\n}\ninterface FabricCodemapCascadeEdge {\n file: string;\n score: number;\n commits: number;\n}\ninterface FabricCodemapCascade {\n seeds: string[];\n edges: FabricCodemapCascadeEdge[];\n commitsScanned: number;\n truncated: boolean;\n unavailable?: string;\n}\ninterface FabricCodemapApi {\n map(args?: {\n path?: string;\n maxTokens?: number;\n glob?: string;\n focus?: string;\n seeds?: string[];\n refresh?: boolean;\n }): Promise<{\n text: string;\n root: string;\n tokensEstimated: number;\n filesShown: number;\n symbolsShown: number;\n omittedFiles: number;\n omittedSymbols: number;\n truncated: boolean;\n indexed: FabricCodemapSymbolCounts;\n cascade?: FabricCodemapCascade;\n }>;\n cascade(args: {\n path?: string;\n seeds: string[];\n limit?: number;\n maxCommits?: number;\n }): Promise<FabricCodemapCascade>;\n}\n\ninterface FabricWorkflowAgentOptions extends Omit<FabricAgentRequest, \"task\"> {\n label?: string;\n}\ntype FabricActivityStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"blocked\" | \"stopped\";\ntype FabricActivityKind = \"agent\" | \"actor\" | \"tool\" | \"extension\" | \"mcp\" | \"mesh\" | \"task\" | \"custom\";\ninterface FabricWorkflowDisplay {\n name?: string;\n description?: string;\n}\ninterface FabricWorkflowPhaseOptions {\n id?: string;\n description?: string;\n total?: number;\n}\ninterface FabricWorkflowPhaseInput extends FabricWorkflowPhaseOptions {\n name: string;\n}\ninterface FabricWorkflowItem {\n id: string;\n label: string;\n status?: FabricActivityStatus;\n phase?: string;\n detail?: string;\n kind?: FabricActivityKind;\n current?: string;\n total?: number;\n completed?: number;\n data?: unknown;\n}\ninterface FabricWorkflowApi {\n agent<T = string>(prompt: string, options?: FabricWorkflowAgentOptions): Promise<T>;\n parallel<T, R>(items: T[], mapper: (item: T, index: number) => Promise<R> | R, concurrency?: number | { concurrency?: number }): Promise<R[]>;\n parallel<T>(thunks: Array<() => Promise<T> | T>, concurrency?: number | { concurrency?: number }): Promise<T[]>;\n pipeline<T>(items: T[], ...stages: Array<(value: unknown, original: T, index: number) => Promise<unknown> | unknown>): Promise<unknown[]>;\n configure(display: FabricWorkflowDisplay): Promise<FabricWorkflowDisplay>;\n phase(name: string, options?: FabricWorkflowPhaseOptions): Promise<{ name: string; index: number; id?: string }>;\n phase(input: FabricWorkflowPhaseInput): Promise<{ name: string; index: number; id?: string }>;\n item(item: FabricWorkflowItem): Promise<FabricWorkflowItem>;\n event(event: { message: string; level?: \"info\" | \"success\" | \"warning\" | \"error\"; data?: unknown }): Promise<void>;\n log(...values: unknown[]): void;\n budget: { total: number; spent(): number; remaining(): number };\n}\ndeclare const tools: FabricToolsApi;\ndeclare const omp: OmpToolsApi;\ndeclare const extensions: FabricExtensionsApi;\ndeclare const agents: FabricAgentsApi;\ndeclare const mesh: FabricMeshApi;\ndeclare const mcp: FabricMcpApi;\ndeclare const memory: FabricMemoryApi;\ndeclare const state: FabricStateApi;\ndeclare const schema: FabricSchemaApi;\ndeclare const components: FabricComponentsApi;\ndeclare const compact: FabricCompactApi;\ndeclare const codemap: FabricCodemapApi;\ndeclare const council: FabricCouncilApi;\ndeclare const workflow: FabricWorkflowApi;\ndeclare function agent<T = string>(prompt: string, options?: FabricWorkflowAgentOptions): Promise<T>;\ndeclare function parallel<T, R>(items: T[], mapper: (item: T, index: number) => Promise<R> | R, concurrency?: number | { concurrency?: number }): Promise<R[]>;\ndeclare function parallel<T>(thunks: Array<() => Promise<T> | T>, concurrency?: number | { concurrency?: number }): Promise<T[]>;\ndeclare function pipeline<T>(items: T[], ...stages: Array<(value: unknown, original: T, index: number) => Promise<unknown> | unknown>): Promise<unknown[]>;\ndeclare function phase(name: string, options?: FabricWorkflowPhaseOptions): Promise<{ name: string; index: number; id?: string }>;\ndeclare function phase(input: FabricWorkflowPhaseInput): Promise<{ name: string; index: number; id?: string }>;\ndeclare function log(...values: unknown[]): void;\ndeclare const budget: FabricWorkflowApi[\"budget\"];\ntype FabricRlmRequest = Omit<FabricAgentRequest, \"runner\" | \"recursive\" | \"cwd\"> & { runner?: \"omp\" };\ndeclare const rlm: { query(args: FabricRlmRequest): Promise<FabricAgentResult> };\ninterface FabricConsole {\n log(...args: unknown[]): void;\n info(...args: unknown[]): void;\n warn(...args: unknown[]): void;\n error(...args: unknown[]): void;\n}\ndeclare const console: FabricConsole;\ndeclare const payloads: Readonly<Record<string, string>>;\ndeclare function print(...args: unknown[]): void;\ndeclare function setTimeout(handler: (...args: any[]) => void, timeout?: number): number;\ndeclare function clearTimeout(handle: number): void;\ndeclare function setInterval(handler: (...args: any[]) => void, timeout?: number): number;\ndeclare function clearInterval(handle: number): void;\n`;\n\nconst FULL_CODE_GLOBAL_DECLARATIONS = [\n \"declare const omp: OmpToolsApi;\\n\",\n \"declare const extensions: FabricExtensionsApi;\\n\",\n];\n\nconst OMP_LOOSE_DECLARATION = \"declare const omp: OmpToolsApi;\\n\";\nconst MCP_LOOSE_DECLARATION = \"declare const mcp: FabricMcpApi;\\n\";\nconst EXTENSIONS_LOOSE_DECLARATION = \"declare const extensions: FabricExtensionsApi;\\n\";\n\nexport interface FabricGuestDeclarationOptions {\n /** Global names to omit (for example providers disabled by configuration). */\n excludeGlobals?: readonly string[];\n /**\n * Pre-rendered replacement blocks from buildDynamicGuestDeclarations().\n * Applied only when the loose anchor line is still present \u2014 excluded\n * globals (or orchestration-only mode, for extensions) keep nothing to\n * replace, and missing/undefined sections keep the loose surface.\n */\n dynamic?: FabricDynamicGuestDeclarations;\n /** Add captured core overloads to the full-code OMP declaration. */\n coreOverrides?: string;\n}\n\nconst globalDeclarationLine = (name: string): RegExp =>\n new RegExp(`^declare const ${name}: [^\\\\n]*;\\\\n`, \"m\");\n\nconst terminatedDeclaration = (block: string): string =>\n block.endsWith(\"\\n\") ? block : `${block}\\n`;\n\nexport const guestTypeDeclarations = (\n fullCodeMode: boolean,\n options: FabricGuestDeclarationOptions = {},\n): string => {\n const base = fullCodeMode\n ? GUEST_TYPE_DECLARATIONS\n : FULL_CODE_GLOBAL_DECLARATIONS.reduce(\n (declarations, declaration) => declarations.replace(declaration, \"\"),\n GUEST_TYPE_DECLARATIONS,\n );\n let result = (options.excludeGlobals ?? []).reduce(\n (declarations, name) => declarations.replace(globalDeclarationLine(name), \"\"),\n base,\n );\n if (fullCodeMode && options.coreOverrides && result.includes(OMP_LOOSE_DECLARATION)) {\n result = result.replace(\n OMP_LOOSE_DECLARATION,\n terminatedDeclaration(options.coreOverrides),\n );\n }\n if (options.dynamic?.mcp && result.includes(MCP_LOOSE_DECLARATION)) {\n result = result.replace(\n MCP_LOOSE_DECLARATION,\n terminatedDeclaration(options.dynamic.mcp),\n );\n }\n if (options.dynamic?.extensions && result.includes(EXTENSIONS_LOOSE_DECLARATION)) {\n result = result.replace(\n EXTENSIONS_LOOSE_DECLARATION,\n terminatedDeclaration(options.dynamic.extensions),\n );\n }\n return result;\n};\n"],
5
- "mappings": ";AAQO,IAAM,6CAA6C;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AACN;AAEO,IAAM,0BAA0B;AAAA,EACrC,MAAM,CAAC,UAAU,OAAO;AAAA,EACxB,MAAM,CAAC,SAAS;AAAA,EAChB,MAAM,CAAC;AAAA,EACP,OAAO,CAAC;AAAA,EACR,MAAM,CAAC,WAAW,MAAM;AAAA,EACxB,MAAM,CAAC,OAAO;AAAA,EACd,IAAI,CAAC,OAAO;AACd;AAEO,IAAM,0BAA0B;AAAA;AAAA;AAAA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kBAAkB,CAAC,GAAG;AAAA,IAC1C,CAAC,cAAc,SAAS,aAAa,QAAQ,sBAAsB,IAAI,GAAG,EAAE;AAAA,IAC5E;AAAA,EACF;AACA,MAAI,gBAAgB,QAAQ,iBAAiB,OAAO,SAAS,qBAAqB,GAAG;AACnF,aAAS,OAAO;AAAA,MACd;AAAA,MACA,sBAAsB,QAAQ,aAAa;AAAA,IAC7C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,OAAO,OAAO,SAAS,qBAAqB,GAAG;AAClE,aAAS,OAAO;AAAA,MACd;AAAA,MACA,sBAAsB,QAAQ,QAAQ,GAAG;AAAA,IAC3C;AAAA,EACF;AACA,MAAI,QAAQ,SAAS,cAAc,OAAO,SAAS,4BAA4B,GAAG;AAChF,aAAS,OAAO;AAAA,MACd;AAAA,MACA,sBAAsB,QAAQ,QAAQ,UAAU;AAAA,IAClD;AAAA,EACF;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import type { FabricDynamicGuestDeclarations } from \"../protocol.js\";\n\n// These names and compatibility fields are the single source of truth for\n// generated core-override overloads. Keep them beside OmpToolsApi below so an\n// override extends the same guest contract rather than copying its signatures.\n// Numeric fields widen to `number | string` in generated overloads too,\n// mirroring built-in runtime normalization; a strict override schema still\n// rejects the string form at validation time, and the registry error wins.\nexport const OMP_CORE_COMPATIBILITY_ARGUMENT_TYPE_NAMES = {\n read: \"OmpReadCompatibilityArgument\",\n bash: \"OmpBashCompatibilityArgument\",\n edit: \"OmpEditCompatibilityArgument\",\n write: \"OmpWriteCompatibilityArgument\",\n grep: \"OmpGrepCompatibilityArgument\",\n find: \"OmpFindCompatibilityArgument\",\n ls: \"OmpLsCompatibilityArgument\",\n} as const;\n\nexport const OMP_CORE_NUMERIC_FIELDS = {\n read: [\"offset\", \"limit\"],\n bash: [\"timeout\"],\n edit: [],\n write: [],\n grep: [\"context\", \"skip\"],\n find: [\"limit\"],\n ls: [\"limit\"],\n} as const;\n\nexport const GUEST_TYPE_DECLARATIONS = `\ntype JsonPrimitive = string | number | boolean | null;\ntype JsonValue = JsonPrimitive | JsonValue[] | { [key: string]: JsonValue };\ntype FabricTransport = \"auto\" | \"process\" | \"tmux\" | \"screen\" | \"localterm\" | \"herdr\";\ntype FabricAgentRunner = \"omp\" | \"claude\" | \"veda\";\ntype FabricThinking = \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\";\ninterface FabricActionEffect {\n kind: \"none\" | \"scoped\" | \"transactional\" | \"emission\";\n resources?: string[];\n ordering?: \"commutative\" | \"ordered\" | \"unknown\";\n}\ninterface FabricAction {\n ref: string;\n provider: string;\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n outputSchema?: Record<string, unknown>;\n risk: \"read\" | \"write\" | \"execute\" | \"network\" | \"agent\";\n namespace?: string;\n effect?: FabricActionEffect;\n}\ninterface FabricImageContent {\n type: \"image\";\n data: string;\n mimeType: string;\n}\ninterface FabricAgentRequest {\n task: string;\n images?: FabricImageContent[];\n name?: string;\n runner?: FabricAgentRunner;\n transport?: FabricTransport;\n model?: string;\n persona?: string;\n thinking?: FabricThinking;\n tools?: string[];\n addTools?: string[];\n timeoutMs?: number;\n extensions?: boolean;\n recursive?: boolean;\n /** Filesystem execution directory; relative paths resolve from the parent agent cwd. */\n cwd?: string;\n worktree?: boolean;\n schema?: Record<string, unknown>;\n prompt?: string;\n instructions?: string;\n timeout_ms?: number;\n residency?: FabricParticipantResidency;\n}\ninterface FabricHandoffCall {\n readonly ref: string;\n}\ninterface FabricHandoffFacts {\n readonly calls: readonly FabricHandoffCall[];\n count(ref?: string | readonly string[]): number;\n}\ntype FabricHandoffPredicate = (facts: Readonly<FabricHandoffFacts>) => boolean;\ninterface FabricHandoffRequest {\n model: string;\n task?: string;\n when?: FabricHandoffPredicate;\n name?: string;\n transport?: FabricTransport;\n thinking?: FabricThinking;\n tools?: string[];\n timeoutMs?: number;\n extensions?: boolean;\n recursive?: boolean;\n schema?: Record<string, unknown>;\n prompt?: string;\n instructions?: string;\n timeout_ms?: number;\n}\ninterface FabricHandoffResult {\n scheduled: true;\n status: \"deferred\";\n boundary: \"fabric_exec_end\";\n}\ninterface FabricMainAgentInfo {\n id: string;\n name: \"Main\";\n kind: \"main\";\n status: \"idle\" | \"running\" | \"remote\";\n runner: \"omp\";\n transport: \"host\";\n cwd?: string;\n sessionId?: string;\n model?: string;\n thinking?: string;\n startedAt?: number;\n updatedAt: number;\n pendingMessages: boolean;\n local: boolean;\n}\ninterface FabricPeerInfo {\n id: string;\n name: string;\n kind: \"peer\";\n status: \"idle\" | \"running\";\n runner: \"omp\";\n transport: \"host\";\n cwd: string;\n sessionId: string;\n model?: string;\n thinking?: string;\n startedAt: number;\n updatedAt: number;\n pendingMessages: boolean;\n local: false;\n}\ntype FabricParticipantKind = \"root\" | \"agent\" | \"actor\";\ntype FabricParticipantResidency = \"session\" | \"durable\";\ntype FabricParticipantScope = \"local\" | \"lineage\" | \"project\";\ntype FabricParticipantCapability = \"steer\" | \"followUp\" | \"stop\" | \"ask\" | \"actor-bindings\" | \"attach\" | \"fabric\";\ninterface FabricParticipantInfo {\n format: 1;\n id: string;\n kind: FabricParticipantKind;\n rootId: string;\n ownerHostId: string;\n ownerIdentityId: string;\n parentId?: string;\n name: string;\n status: string;\n runner: FabricAgentRunner;\n transport: FabricTransport | \"host\";\n capabilities: FabricParticipantCapability[];\n cwd?: string;\n sessionId?: string;\n model?: string;\n thinking?: string;\n startedAt: number;\n updatedAt: number;\n finishedAt?: number;\n pendingMessages?: boolean;\n currentTool?: string;\n turns?: number;\n toolCalls?: number;\n usage?: { input: number; output: number; cacheRead: number; cacheWrite: number; cost: number };\n actorQueued?: number;\n actorMessages?: number;\n controlProtocol: \"v1\" | \"legacy\";\n residency: FabricParticipantResidency;\n local: boolean;\n stale: boolean;\n}\ntype FabricLifecycleEventType =\n | \"omp.input\"\n | \"omp.agent_start\"\n | \"omp.agent_end\"\n | \"omp.turn_end\"\n | \"omp.tool_error\"\n | \"omp.session_compact\"\n | \"run.completed\"\n | \"run.failed\"\n | \"run.stopped\"\n | \"run.timed_out\"\n | \"tokens.usage\"\n | \"component.state\";\ntype FabricLifecycleDelivery = \"steer\" | \"followUp\";\ninterface FabricLifecycleSource {\n id: string;\n name: string;\n kind: FabricParticipantKind;\n rootId: string;\n runner: FabricAgentRunner;\n ownerHostId?: string;\n ownerIdentityId?: string;\n}\ninterface FabricLifecycleEvent {\n version: 1;\n id: string;\n sequence: number;\n event: FabricLifecycleEventType;\n source: FabricLifecycleSource;\n occurredAt: number;\n publishedAt: number;\n runId?: string;\n status?: string;\n data?: unknown;\n}\ninterface FabricLifecycleSubscription {\n format: 1;\n id: string;\n from: string;\n events: FabricLifecycleEventType[];\n to: string;\n delivery: FabricLifecycleDelivery;\n triggerTurn: boolean;\n once: boolean;\n afterSequence: number;\n createdAt: number;\n updatedAt: number;\n createdBy: { id: string; name: string; kind: \"main\" | \"agent\" | \"actor\"; sessionId?: string };\n lastDeliveredAt?: number;\n lastEventId?: string;\n lastError?: string;\n}\ninterface FabricAgentHandle {\n id: string;\n name: string;\n status: string;\n runner: FabricAgentRunner;\n transport: FabricTransport;\n cwd: string;\n model?: string;\n thinking?: FabricThinking;\n actorId?: string;\n actorName?: string;\n sessionId?: string;\n runnerSessionId?: string;\n attachCommand?: string;\n branch?: string;\n worktree?: string;\n text?: string;\n value?: unknown;\n error?: string;\n logFile?: string;\n residency?: FabricParticipantResidency;\n}\ninterface FabricRemoteControlResult {\n queued: true;\n messageId: string;\n routed: \"mesh\";\n acknowledged: true;\n}\ninterface FabricAgentResult extends FabricAgentHandle {\n task: string;\n startedAt: number;\n finishedAt?: number;\n turns: number;\n toolCalls: number;\n text: string;\n value?: unknown;\n error?: string;\n usage: { input: number; output: number; cacheRead: number; cacheWrite: number; cost: number };\n pendingMessages?: { steering: string[]; followUp: string[] };\n}\ninterface FabricModelInfo {\n runner?: FabricAgentRunner;\n provider: string;\n id: string;\n name: string;\n key: string;\n value?: string;\n resolvedModel?: string;\n displayName?: string;\n description?: string;\n supportsEffort?: boolean;\n supportedEffortLevels?: string[];\n supportsAdaptiveThinking?: boolean;\n supportsFastMode?: boolean;\n supportsAutoMode?: boolean;\n}\ninterface FabricLogLine {\n index?: number;\n offset: number;\n raw: string;\n parsed?: unknown;\n}\ninterface FabricAgentLog {\n id: string;\n runDirectory: string;\n logFile: string;\n status?: FabricAgentResult;\n events: FabricLogLine[];\n hasMore: boolean;\n before?: number;\n}\ninterface FabricActorLog {\n actorId: string;\n actorName: string;\n sessionFile: string;\n logDir: string;\n session: FabricLogLine[];\n sessionHasMore: boolean;\n sessionBefore?: number;\n run?: {\n runId: string;\n eventsFile: string;\n status?: FabricAgentResult;\n events: FabricLogLine[];\n hasMore: boolean;\n before?: number;\n };\n retainedRuns: string[];\n}\ninterface FabricCapabilityActionHead {\n key: string;\n parentKey: string;\n ref: string;\n name: string;\n description: string;\n descriptorHash: string;\n risk: \"read\" | \"write\" | \"execute\" | \"network\" | \"agent\";\n namespace?: string;\n effect?: FabricActionEffect;\n}\ninterface FabricCapabilityProviderHead {\n key: string;\n parentKey: string;\n name: string;\n description: string;\n descriptorHash: string;\n actions: FabricCapabilityActionHead[];\n}\ninterface FabricCapabilityCatalog {\n kind: \"omp-fabric.capability-catalog\";\n version: 1;\n root: {\n key: \"capability:fabric\";\n name: \"Fabric capabilities\";\n description: string;\n descriptorHash: string;\n };\n providers: FabricCapabilityProviderHead[];\n totalActions: number;\n indexedActions: number;\n complete: boolean;\n reasons: string[];\n}\ninterface FabricToolsApi {\n providers(): Promise<Array<{ name: string; description: string }>>;\n catalog(args?: { provider?: string; limit?: number }): Promise<FabricCapabilityCatalog>;\n list(args?: { provider?: string; namespace?: string; query?: string; limit?: number }): Promise<FabricAction[]>;\n search(query: string): Promise<FabricAction[]>;\n search(args: { query: string; limit?: number }): Promise<FabricAction[]>;\n describe(args: { ref: string }): Promise<FabricAction>;\n call(args: { ref: string; args?: Record<string, unknown> }): Promise<unknown>;\n progress(args: { message: string }): Promise<void>;\n models(): Promise<FabricModelInfo[]>;\n}\ninterface FabricCapturedToolResult {\n content: Array<{ type: string; text?: string; [key: string]: unknown }>;\n text: string;\n details?: unknown;\n isError: boolean;\n terminate?: boolean;\n source: { path: string; source: string; scope: string; origin: string; baseDir?: string };\n}\ninterface FabricCapturedTool {\n (args?: Record<string, unknown>): Promise<FabricCapturedToolResult>;\n}\ntype FabricExtensionsApi = Record<string, FabricCapturedTool>;\n// String-primary tools (read/bash/grep/find/ls) accept a bare string; the\n// runtime proxy coerces it to { <primaryField>: string }. Lets the model write\n// the natural form (omp.bash(\"ls\")) instead of omp.bash({ command: \"ls\" }).\n// Return shapes differ by tool: read/grep/find/ls return their text as a bare\n// string (e.g. const src: string = await omp.read({ path })); shell/edit/write\n// return { ok, output, details } (e.g. const { output } = await omp.bash(...)).\n// Common alias keys (cmd\u2192command, query\u2192pattern, file\u2192path, dir\u2192path) and a\n// flat edit shape ({ path, oldText, newText }) are also accepted; the runtime\n// proxy normalizes them to the canonical form before the host validates args.\n// Bash timeout is measured in seconds; timeoutMs is converted from milliseconds.\n// Extended near-miss repairs: find's name/filename/glob \u2192 pattern, write's\n// data \u2192 content, ls's folder \u2192 path, bash's script \u2192 command; numeric option\n// fields (limit/offset/context/timeout) also accept numeric strings, coerced\n// at runtime (2322 diagnostics are suppressed by the type-checker by design).\n// String-primary tools also take a two-arg (primary, options) form \u2014\n// omp.read(\"index.ts\", { limit: 120 }) merges to { path, ...options } at\n// runtime, the positional string winning the primary field on conflict.\n// shell/edit/write envelopes are proxy-guarded so string-method access\n// (.trim(), .split(), iteration) fails with an actionable TypeError pointing\n// at .output instead of QuickJS's context-free \"not a function\" \u2014 property-\n// miss (2339) checks are suppressed by design, so the runtime gives the hint.\ntype OmpPathArgument = {\n path?: string;\n file?: string;\n absolutePath?: string;\n file_path?: string;\n filePath?: string;\n filepath?: string;\n pathname?: string;\n target_file?: string;\n targetFile?: string;\n absolute_path?: string;\n fileAbsolutePath?: string;\n};\ntype OmpOptionalPathArgument = {\n path?: string;\n file?: string;\n absolutePath?: string;\n file_path?: string;\n filePath?: string;\n filepath?: string;\n pathname?: string;\n target_file?: string;\n targetFile?: string;\n absolute_path?: string;\n fileAbsolutePath?: string;\n dir?: string;\n folder?: string;\n directory?: string;\n directoryPath?: string;\n};\ntype OmpOldTextArgument = {\n oldText?: string;\n old?: string;\n old_string?: string;\n oldString?: string;\n old_str?: string;\n oldStr?: string;\n from?: string;\n old_value?: string;\n old_text?: string;\n oldContent?: string;\n old_content?: string;\n};\ntype OmpNewTextArgument = {\n newText?: string;\n new?: string;\n replacement?: string;\n new_string?: string;\n newString?: string;\n new_str?: string;\n newStr?: string;\n to?: string;\n new_value?: string;\n new_text?: string;\n newContent?: string;\n new_content?: string;\n};\ntype OmpEditOperation = OmpOldTextArgument & OmpNewTextArgument & { all?: boolean };\ntype OmpCommandArgument = { command?: string; cmd?: string; shell?: string; cmdline?: string; script?: string; commandLine?: string };\ntype OmpContentArgument = { content?: string; contents?: string; body?: string; text?: string; data?: string; fileContent?: string };\ntype OmpGrepPatternArgument = { pattern?: string; query?: string; regex?: string; search?: string; q?: string; expression?: string; text?: string };\ntype OmpFindPatternArgument = { pattern?: string; query?: string; regex?: string; search?: string; name?: string; filename?: string; glob?: string; expression?: string; include?: string };\n// Two-arg (primary, options) bags for the string-primary tools. Only option\n// aliases belong here (max/start/ctx/ic/...), never primary-field aliases \u2014\n// the primary field comes from the positional string.\ntype OmpReadOptions = { offset?: number; limit?: number; start?: number; max?: number };\n// cwd is honored per call by the omp provider, which binds the command to a\n// shell definition rooted there; relative paths resolve from the session cwd.\n// The alias spellings mirror the shell entries in __ompArgAliases: the\n// runtime repairs them, so the checker has to accept the same spellings or a\n// repairable call is rejected before it ever reaches the sandbox.\ntype OmpShellOptions = {\n timeout?: number; timeoutMs?: number; settle?: boolean;\n cwd?: string; workdir?: string; directory?: string; workingDirectory?: string;\n env?: Record<string, string>; pty?: boolean;\n};\ntype OmpBashOptions = OmpShellOptions;\ntype OmpGrepOptions = { path?: string; glob?: string; globPattern?: string; ignoreCase?: boolean; ic?: boolean; caseInsensitive?: boolean; literal?: boolean; context?: number; ctx?: number; skip?: number; gitignore?: boolean };\ntype OmpFindOptions = { path?: string; limit?: number; max?: number; gitignore?: boolean; hidden?: boolean };\ntype OmpLsOptions = { limit?: number; max?: number };\ntype OmpReadArgument = string | (OmpPathArgument & OmpReadOptions);\ntype OmpBashArgument = string | (OmpCommandArgument & OmpBashOptions);\ntype OmpEditFlatArgument = OmpPathArgument & OmpOldTextArgument & OmpNewTextArgument & { all?: boolean };\ntype OmpEditArgument = OmpPathArgument & ({ edits: OmpEditOperation[]; all?: boolean } | OmpEditFlatArgument);\ntype OmpWriteArgument = string | (OmpPathArgument & OmpContentArgument);\ntype OmpGrepArgument = string | (OmpGrepPatternArgument & OmpGrepOptions);\ntype OmpFindArgument = string | (OmpFindPatternArgument & OmpFindOptions);\ntype OmpLsArgument = string | (OmpOptionalPathArgument & OmpLsOptions);\ntype OmpNumericString<T> = T extends number ? T | string : T;\ntype OmpNumericStringOptions<T> = { [K in keyof T]: OmpNumericString<T[K]> };\ntype OmpReadCompatibilityArgument = string | (OmpPathArgument & OmpNumericStringOptions<OmpReadOptions>);\ntype OmpBashCompatibilityArgument = string | (OmpCommandArgument & OmpNumericStringOptions<OmpBashOptions>);\ntype OmpEditCompatibilityArgument = OmpEditFlatArgument;\ntype OmpWriteCompatibilityArgument = OmpWriteArgument;\ntype OmpGrepCompatibilityArgument = string | (OmpGrepPatternArgument & OmpNumericStringOptions<OmpGrepOptions>);\ntype OmpFindCompatibilityArgument = string | (OmpFindPatternArgument & OmpNumericStringOptions<OmpFindOptions>);\ntype OmpLsCompatibilityArgument = string | (OmpOptionalPathArgument & OmpNumericStringOptions<OmpLsOptions>);\ninterface OmpToolsApi {\n read(args: OmpReadArgument, options?: OmpReadOptions): Promise<string>;\n bash(args: OmpBashArgument, options?: OmpBashOptions): Promise<{ ok: true; output: string; details: unknown } | { ok: false; output: string; details: null; exitCode: number; error: string }>;\n edit(args: OmpEditArgument): Promise<{ ok: true; output: string; details: unknown }>;\n edit(path: string, oldText: string, newText: string): Promise<{ ok: true; output: string; details: unknown }>;\n write(args: OmpWriteArgument): Promise<{ ok: true; output: string; details: unknown }>;\n write(path: string, content: string): Promise<{ ok: true; output: string; details: unknown }>;\n grep(args: OmpGrepArgument): Promise<string>;\n grep(pattern: string, path?: string | OmpGrepOptions, skip?: number): Promise<string>;\n find(args: OmpFindArgument): Promise<string>;\n find(pattern: string, path?: string | OmpFindOptions, limit?: number): Promise<string>;\n ls(args?: OmpLsArgument, options?: OmpLsOptions): Promise<string>;\n}\ntype FabricActorHostEvent =\n | \"resources_discover\"\n | \"session_start\"\n | \"session_before_switch\"\n | \"session_switch\"\n | \"session_before_branch\"\n | \"session_branch\"\n | \"session_before_compact\"\n | \"session.compacting\"\n | \"session_compact\"\n | \"session_shutdown\"\n | \"session_before_tree\"\n | \"session_tree\"\n | \"goal_updated\"\n | \"input\"\n | \"before_agent_start\"\n | \"agent_start\"\n | \"agent_end\"\n | \"session_stop\"\n | \"turn_start\"\n | \"turn_end\"\n | \"message_start\"\n | \"message_update\"\n | \"message_end\"\n | \"context\"\n | \"before_provider_request\"\n | \"after_provider_response\"\n | \"tool_execution_start\"\n | \"tool_call\"\n | \"tool_execution_update\"\n | \"tool_result\"\n | \"tool_execution_end\"\n | \"user_bash\"\n | \"tool_error\";\ntype FabricActorDelivery = \"mailbox\" | \"steer\" | \"followUp\" | \"nextTurn\";\ninterface FabricActorHostMediaDescriptor {\n readonly type: \"image\";\n readonly mediaIndex: number;\n readonly mimeType: string;\n}\ninterface FabricActorHostSignal {\n readonly payload: unknown;\n readonly media?: readonly FabricActorHostMediaDescriptor[];\n readonly idle: boolean;\n readonly observedAt: number;\n}\ntype FabricActorActivation =\n | { readonly kind: \"hostEvent\"; readonly id: string; readonly source: string; readonly sequence: number; readonly createdAt: number; readonly event: FabricActorHostEvent; readonly mainRevision: number; readonly taskRevision: number; readonly signal?: FabricActorHostSignal }\n | { readonly kind: \"direct\"; readonly id: string; readonly source: string; readonly sequence: number; readonly createdAt: number }\n | { readonly kind: \"mesh\"; readonly id: string; readonly source: string; readonly sequence: number; readonly createdAt: number; readonly topic: string };\ninterface FabricActorValidityFacts {\n readonly activation: Readonly<FabricActorActivation>;\n readonly current: Readonly<{ latestActivationSequence: number; mainRevision: number; taskRevision: number; idle: boolean; now: number }>;\n}\ntype FabricActorValidityDecision = boolean | { valid: boolean; reason?: string };\ntype FabricActorBindingScope = \"session\" | \"project\";\ninterface FabricActorRunBinding { model?: string; thinking?: FabricThinking }\ntype FabricActorValidWhile = (facts: Readonly<FabricActorValidityFacts>) => FabricActorValidityDecision;\ninterface FabricActorRequestBase {\n scope?: \"session\" | \"project\" | \"global\";\n name: string;\n instructions: string;\n events?: FabricActorHostEvent[];\n topics?: string[];\n responseMode?: \"text\" | \"directive\";\n coalesce?: boolean;\n runner?: FabricAgentRunner;\n model?: string;\n thinking?: FabricThinking;\n tools?: string[];\n transport?: FabricTransport;\n cwd?: string;\n timeoutMs?: number;\n timeout_ms?: number;\n extensions?: boolean;\n requires?: Array<string | { ref: string; optional?: boolean }>;\n validWhile?: FabricActorValidWhile;\n residency?: FabricParticipantResidency;\n}\ntype FabricActorRequest = FabricActorRequestBase & (\n | { delivery?: \"mailbox\"; triggerTurn?: false }\n | { delivery: \"nextTurn\"; triggerTurn?: false }\n | { delivery: \"steer\" | \"followUp\"; triggerTurn: boolean }\n);\ninterface FabricActorInfo {\n id: string;\n scope: \"session\" | \"project\";\n name: string;\n status: \"idle\" | \"queued\" | \"running\" | \"stopped\";\n runner: FabricAgentRunner;\n events: FabricActorHostEvent[];\n topics: string[];\n delivery: FabricActorDelivery;\n responseMode: \"text\" | \"directive\";\n triggerTurn: boolean;\n coalesce: boolean;\n model?: string;\n thinking?: FabricThinking;\n binding?: FabricActorRunBinding & { scope: \"session\"; sessionId: string; updatedAt?: number };\n projectDefaults?: FabricActorRunBinding & { scope: \"project\" };\n tools?: string[];\n timeoutMs?: number;\n extensions?: boolean;\n requirements?: Array<{ ref: string; optional?: boolean }>;\n capabilityDigest?: string;\n missingCapabilities?: string[];\n validWhile?: { version: 1; source: string };\n residency: FabricParticipantResidency;\n queued: number;\n messages: number;\n createdAt: number;\n updatedAt: number;\n lastRunId?: string;\n lastError?: string;\n sessionFile?: string;\n logDir?: string;\n}\ninterface FabricModelSwitchRequest {\n /** provider/id, a models.aliases name, or a search term; resolution tries aliases first, then exact matches, then the closest fuzzy match (recency from pi-model-sort breaks ties) against authenticated models. */\n model: string;\n /** Optional provider filter applied before matching (e.g. \"anthropic\"). */\n provider?: string;\n}\ninterface FabricModelSwitchResult {\n switched: boolean;\n /** Active model as provider/id after the call (unchanged when reason is \"already-active\"). */\n model: string;\n name?: string;\n /** Previously active provider/id when known. Absent for already-active results. */\n previous?: string;\n /** Set when the selector resolved through a configured models.aliases name. */\n alias?: string;\n /** How the selector resolved: the alias name, or one of closest/recent/latest for inexact picks. Absent for exact provider/id or bare-id matches. */\n via?: string;\n reason?: \"already-active\";\n}\ninterface FabricActorMessage {\n id: string;\n actorId: string;\n actorName: string;\n direction: \"in\" | \"out\";\n source: string;\n createdAt: number;\n text?: string;\n data?: unknown;\n action?: \"silent\" | \"message\" | \"stop\";\n runId?: string;\n error?: string;\n stale?: boolean;\n reason?: string;\n}\n// agentId/agent_id spellings repair to id during agent arg normalization.\ntype FabricAgentTargetArgs = { id: string; agentId?: string; agent_id?: string };\ninterface FabricAgentsApi {\n run(args: FabricAgentRequest): Promise<FabricAgentResult>;\n handoff(args: FabricHandoffRequest): Promise<FabricHandoffResult>;\n spawn(args: FabricAgentRequest): Promise<FabricAgentHandle>;\n wait(args: FabricAgentTargetArgs): Promise<FabricAgentResult>;\n status(args: FabricAgentTargetArgs): Promise<FabricAgentResult | FabricAgentHandle | FabricMainAgentInfo | FabricActorInfo | FabricParticipantInfo>;\n list(args?: { scope?: FabricParticipantScope }): Promise<Array<FabricAgentResult | FabricAgentHandle | FabricParticipantInfo>>;\n members(args?: { scope?: FabricParticipantScope; kinds?: FabricParticipantKind[]; includeStale?: boolean }): Promise<FabricParticipantInfo[]>;\n self(): Promise<FabricParticipantInfo>;\n main(): Promise<FabricMainAgentInfo>;\n sessions(): Promise<FabricParticipantInfo[]>;\n peers(): Promise<FabricPeerInfo[]>;\n subscribe(args: {\n from: string;\n events: FabricLifecycleEventType[];\n to?: string;\n delivery: FabricLifecycleDelivery;\n triggerTurn: boolean;\n once?: boolean;\n }): Promise<FabricLifecycleSubscription>;\n subscriptions(args?: { from?: string; to?: string }): Promise<FabricLifecycleSubscription[]>;\n unsubscribe(args: FabricAgentTargetArgs): Promise<{ removed: boolean }>;\n models(args?: { runner?: FabricAgentRunner; refresh?: boolean }): Promise<FabricModelInfo[]>;\n stop(args: FabricAgentTargetArgs): Promise<FabricAgentResult | FabricActorInfo | FabricRemoteControlResult>;\n cleanup(args: FabricAgentTargetArgs & { deleteBranch?: boolean; delete_branch?: boolean }): Promise<{ cleaned: boolean }>;\n create(args: FabricActorRequest): Promise<FabricActorInfo>;\n setModel(args: { id: string; model?: string; scope?: FabricActorBindingScope }): Promise<FabricActorInfo>;\n switchModel(args: FabricModelSwitchRequest): Promise<FabricModelSwitchResult>;\n setThinking(args: { id: string; thinking?: FabricThinking; scope?: FabricActorBindingScope }): Promise<FabricActorInfo>;\n setTools(args: { id: string; tools: string[]; scope?: \"project\" | \"global\" }): Promise<FabricActorInfo>;\n setEvents(args: { id: string; events: FabricActorHostEvent[] }): Promise<FabricActorInfo>;\n setDeliveryPolicy(args: {\n id: string;\n delivery: FabricActorDelivery;\n triggerTurn: boolean;\n scope?: \"project\" | \"global\";\n }): Promise<FabricActorInfo>;\n setInstructions(args: {\n id: string;\n instructions: string;\n scope?: \"project\" | \"global\";\n }): Promise<FabricActorInfo>;\n ask(args: { id: string; message: string; data?: unknown; model?: string; thinking?: FabricThinking }): Promise<FabricActorMessage>;\n tell(args: { id: string; message: string; data?: unknown; model?: string; thinking?: FabricThinking }): Promise<{ queued: true; messageId: string }>;\n steer(args: { id: string; message: string; data?: unknown }): Promise<{ queued: true; messageId: string; routed?: \"local\" | \"main\" | \"mesh\"; acknowledged?: boolean }>;\n followUp(args: { id: string; message: string; data?: unknown }): Promise<{ queued: true; messageId: string; routed?: \"local\" | \"main\" | \"mesh\"; acknowledged?: boolean }>;\n setSteeringMode(args: { id: string; mode: \"all\" | \"one-at-a-time\" }): Promise<{ queued: true; messageId: string }>;\n setFollowUpMode(args: { id: string; mode: \"all\" | \"one-at-a-time\" }): Promise<{ queued: true; messageId: string }>;\n actorStatus(args: FabricAgentTargetArgs): Promise<FabricActorInfo>;\n actors(): Promise<FabricActorInfo[]>;\n messages(args: { id: string; limit?: number }): Promise<FabricActorMessage[]>;\n remove(args: { id: string }): Promise<{ removed: boolean }>;\n log(args: {\n id: string;\n type?: \"session\" | \"run\" | \"all\";\n lines?: number;\n before?: number;\n runId?: string;\n }): Promise<FabricActorLog | FabricAgentLog>;\n}\ninterface FabricMcpResult {\n text: string;\n content: unknown[];\n structuredContent: unknown;\n}\ninterface FabricMcpTool {\n (args?: Record<string, unknown>): Promise<FabricMcpResult | unknown>;\n}\ninterface FabricMcpServer {\n [tool: string]: FabricMcpTool;\n}\n// Management verbs stay members of mcp even when the declare line below is\n// replaced by generated per-server declarations (see the dynamic option on\n// guestTypeDeclarations), so generated surfaces intersect with this type\n// rather than re-declaring them.\ninterface FabricMcpManagement {\n servers(): Promise<Array<{ name: string; description: string | null; transport: \"http\" | \"stdio\" }>>;\n reload(): Promise<{ servers: string[] }>;\n register(args: {\n name: string;\n description?: string;\n command?: string;\n args?: string[];\n cwd?: string;\n baseUrl?: string;\n headers?: Record<string, string>;\n env?: Record<string, string>;\n overwrite?: boolean;\n }): Promise<{ registered: string }>;\n call(args: { server: string; tool: string; args?: Record<string, unknown>; timeoutMs?: number }): Promise<unknown>;\n}\n// Loose static surface: any server/tool name compiles and argument shapes are\n// enforced at dispatch by the registry. With descriptor data available the\n// execution service replaces the declare-const-mcp line below with a\n// schema-typed rendering of the live cache (runtime/dynamic-guest-types.ts).\ntype FabricMcpApi = Record<string, FabricMcpServer> & FabricMcpManagement;\ninterface FabricCouncilRunOptions {\n task: string;\n roles: string[];\n runner?: FabricAgentRunner;\n transport?: FabricTransport;\n model?: string;\n thinking?: FabricThinking;\n tools?: string[];\n timeoutMs?: number;\n /** Filesystem execution directory; relative paths resolve from the parent agent cwd. */\n cwd?: string;\n worktree?: boolean;\n}\ninterface FabricCouncilApi {\n run(args: FabricCouncilRunOptions & { synthesize?: true }): Promise<FabricAgentResult>;\n run(args: FabricCouncilRunOptions & { synthesize: false }): Promise<FabricAgentResult[]>;\n}\ninterface FabricMeshIdentity {\n id: string;\n name: string;\n kind: \"main\" | \"actor\" | \"agent\";\n sessionId?: string;\n}\ninterface FabricMeshEvent {\n id: string;\n sequence: number;\n topic: string;\n kind: string;\n from: FabricMeshIdentity;\n to?: string;\n text?: string;\n data?: unknown;\n createdAt: number;\n}\ninterface FabricMeshStateEntry<T = unknown> {\n key: string;\n value: T;\n version: number;\n updatedAt: number;\n updatedBy: FabricMeshIdentity;\n}\ninterface FabricMeshApi {\n self(): Promise<FabricMeshIdentity>;\n publish(args: { topic: string; kind?: string; to?: string; text?: string; data?: unknown; message?: string; body?: string }): Promise<FabricMeshEvent>;\n read(args?: { after?: number; topic?: string; to?: string; limit?: number; max?: number }): Promise<FabricMeshEvent[]>;\n members(args: { scope?: FabricParticipantScope; kinds?: FabricParticipantKind[]; includeStale?: boolean; limit?: number; max?: number; include_stale?: boolean; withTotal: true }): Promise<{ members: FabricParticipantInfo[]; total: number; truncated: boolean }>;\n members(args?: { scope?: FabricParticipantScope; kinds?: FabricParticipantKind[]; includeStale?: boolean; limit?: number; max?: number; include_stale?: boolean; withTotal?: false }): Promise<FabricParticipantInfo[]>;\n get<T = unknown>(args: { key: string }): Promise<FabricMeshStateEntry<T> | null>;\n list<T = unknown>(args: { prefix?: string; limit?: number; max?: number; withTotal: true }): Promise<{ entries: Array<FabricMeshStateEntry<T>>; total: number; truncated: boolean }>;\n list<T = unknown>(args?: { prefix?: string; limit?: number; max?: number; withTotal?: false }): Promise<Array<FabricMeshStateEntry<T>>>;\n put<T = unknown>(args: { key: string; value: T; ifVersion?: number; if_version?: number; version?: number }): Promise<FabricMeshStateEntry<T>>;\n delete(args: { key: string; ifVersion?: number; if_version?: number; version?: number }): Promise<{ deleted: boolean; version?: number }>;\n}\n// Stable-provider argument bags declare the canonical keys plus the\n// near-miss spellings repaired during argument normalization\n// (providers/arg-normalization.ts and each provider's per-action table). The\n// registry's prepare stage repairs aliases before schema validation, so a\n// call spelled with an alias typechecks instead of tripping the\n// excess-property check; the canonical key wins on conflict, and anything\n// else fails additionalProperties:false validation with the offending\n// property path named. Keep these spillover fields in sync with the provider\n// normalization tables.\ntype FabricMemoryBranches = \"active\" | \"all\";\ntype FabricMemoryQueryMode = \"literal\" | \"phrase\" | \"regex\";\ntype FabricMemoryQueryMatch = \"all\" | \"any\";\ninterface FabricMemoryEntryRange {\n first: number;\n last: number;\n}\ninterface FabricMemoryRecallArgs {\n query?: string;\n queryMode?: FabricMemoryQueryMode;\n queryMatch?: FabricMemoryQueryMatch;\n expectedSourceHash?: string;\n expectedLineageFingerprint?: string;\n branches?: FabricMemoryBranches;\n scope?: string;\n offset?: number;\n pageSize?: number;\n snippetChars?: number;\n role?: string;\n tool?: string;\n ref?: string;\n provider?: string;\n action?: string;\n outcome?: \"succeeded\" | \"failed\" | \"aborted\" | \"timed_out\";\n since?: number;\n until?: number;\n entryRange?: FabricMemoryEntryRange;\n q?: string;\n limit?: number;\n max?: number;\n page_size?: number;\n snippet_chars?: number;\n query_mode?: FabricMemoryQueryMode;\n query_match?: FabricMemoryQueryMatch;\n entry_range?: FabricMemoryEntryRange;\n}\ninterface FabricMemoryExpandArgs {\n session: string;\n expectedSourceHash?: string;\n expectedLineageFingerprint?: string;\n branches?: FabricMemoryBranches;\n indices?: number[];\n entryIds?: string[];\n operationAddresses?: string[];\n entryRange?: FabricMemoryEntryRange;\n before?: number;\n after?: number;\n entryOffset?: number;\n textOffset?: number;\n maxChars?: number;\n maxEntries?: number;\n id?: string;\n file?: string;\n path?: string;\n session_id?: string;\n index?: number;\n entry_ids?: string[];\n operation_addresses?: string[];\n entry_range?: FabricMemoryEntryRange;\n entry_offset?: number;\n text_offset?: number;\n max_chars?: number;\n max_entries?: number;\n}\ninterface FabricMemoryCall<Ref extends string, Args> {\n ref: Ref;\n args: Args;\n}\ninterface FabricMemoryRecallEntryHit {\n kind: \"entry\";\n sessionId: string;\n tier: \"hot\" | \"cold\";\n index: number;\n entryId: string | null;\n parentId: string | null;\n operationAddress: string | null;\n type: string;\n role: string | null;\n tool: string | null;\n ref: string | null;\n provider: string | null;\n action: string | null;\n timestamp: number | null;\n isError: boolean;\n outcome?: \"succeeded\" | \"failed\" | \"aborted\" | \"timed_out\";\n score: number;\n snippet: string;\n truncated: boolean;\n follow: FabricMemoryCall<\"memory.expand\", FabricMemoryExpandArgs>;\n}\ninterface FabricMemoryRecallSessionHit {\n kind: \"session\";\n sessionId: string;\n tier: \"cold\";\n cwd: string;\n lastTimestamp: number | null;\n score: number;\n matchedTerms: number;\n matchedStructuralEntries: number;\n follow: FabricMemoryCall<\"memory.recall\", FabricMemoryRecallArgs>;\n}\ninterface FabricLcmMemoryHit {\n kind: \"lcm.raw\" | \"lcm.summary\";\n sessionId: string;\n score: number;\n snippet: string;\n truncated: boolean;\n source: { kind: \"raw\" | \"summary\"; projectKey: string; sessionId: string; entryId?: string; revision?: number; contentHash?: string; nodeId?: string; sourceHash: string };\n follow: FabricMemoryCall<\"memory.expand\", FabricMemoryExpandArgs>;\n}\ntype FabricMemoryRecallHit = FabricMemoryRecallEntryHit | FabricMemoryRecallSessionHit | FabricLcmMemoryHit;\ninterface FabricMemoryError {\n code: string;\n message: string;\n [key: string]: unknown;\n}\ninterface FabricMemoryCoverage {\n complete: boolean;\n indexedSessions: number;\n eligibleSessions: number;\n staleSessions: number;\n incompleteSessions: number;\n reasons: string[];\n error?: FabricMemoryError;\n}\ninterface FabricMemoryRecallResult {\n total: number;\n hits: FabricMemoryRecallHit[];\n next: FabricMemoryCall<\"memory.recall\", FabricMemoryRecallArgs> | null;\n coverage: FabricMemoryCoverage;\n error?: FabricMemoryError;\n}\ninterface FabricMemoryExpandedEntry {\n index: number;\n entryId: string | null;\n parentId: string | null;\n type: string | null;\n role: string | null;\n timestamp: number | null;\n isError: boolean;\n anchor?: boolean;\n text: string;\n textRange: { start: number; end: number; total: number; complete: boolean };\n parentEntryId?: string | null;\n operationAddress?: string | null;\n tool?: string | null;\n ref?: string | null;\n provider?: string | null;\n action?: string | null;\n outcome?: \"succeeded\" | \"failed\" | \"aborted\" | \"timed_out\";\n filesTouched?: Array<string | null>;\n operation?: unknown;\n branchFact?: unknown;\n structuredContent?: unknown;\n structuredTruncated?: boolean;\n factAddress?: string | null;\n carrierEntryId?: string | null;\n carrierParentId?: string | null;\n carrierFromId?: string | null;\n}\ninterface FabricMemoryExpandResult {\n session?: string;\n sourceHash?: string;\n branches?: FabricMemoryBranches;\n lineageFingerprint?: string;\n entryCount?: number;\n entries: FabricMemoryExpandedEntry[];\n next?: FabricMemoryCall<\"memory.expand\", FabricMemoryExpandArgs> | null;\n error?: FabricMemoryError;\n}\ninterface FabricMemoryWalkResult {\n visited: number;\n stopped: boolean;\n error?: FabricMemoryError;\n}\ninterface FabricMemorySessionInfo {\n id: string;\n file: string;\n cwd: string;\n mtime: number;\n entryCount: number;\n tier: \"hot\" | \"cold\";\n branches: FabricMemoryBranches;\n lineageFingerprint: string | null;\n}\ninterface FabricMemoryApi {\n recall(args?: FabricMemoryRecallArgs): Promise<FabricMemoryRecallResult>;\n expand(args: FabricMemoryExpandArgs): Promise<FabricMemoryExpandResult>;\n walk(\n args: FabricMemoryExpandArgs,\n visitor: (\n entry: FabricMemoryExpandedEntry,\n index: number,\n ) => boolean | void | Promise<boolean | void>,\n ): Promise<FabricMemoryWalkResult>;\n sessions(args?: {\n scope?: string;\n branches?: FabricMemoryBranches;\n limit?: number;\n max?: number;\n offset?: number;\n }): Promise<{\n scope?: string;\n branches?: FabricMemoryBranches;\n offset?: number;\n total?: number;\n truncated?: boolean;\n sessions?: FabricMemorySessionInfo[];\n error?: FabricMemoryError;\n }>;\n}\ninterface FabricStateTransitionArgs {\n label: string;\n from?: string;\n to: string;\n summary: string;\n evidence?: string[];\n tags?: string[];\n kind?: \"state\" | \"representation\";\n complexity?: { files: string[] };\n force?: boolean;\n name?: string;\n description?: string;\n}\ninterface FabricStateComplexityFile {\n file: string;\n supported: boolean;\n language?: string;\n current?: number;\n recorded?: number;\n delta?: number;\n recordedDelta?: number;\n}\ninterface FabricStateVerificationResult {\n certified: boolean;\n violated: boolean;\n certificationStatus: \"certified\" | \"failed\";\n results: unknown[];\n failures: unknown[];\n certificate?: unknown;\n reportingError?: string;\n evidenceDigest: string;\n resultDigest: string;\n}\ninterface FabricStateApi {\n transition(args: FabricStateTransitionArgs): Promise<{ event: FabricMeshEvent; head: unknown }>;\n get(): Promise<{\n head: unknown | null;\n goal: { check: string; description?: string } | null;\n complexity: { files: number; decisionPoints: number; lastNetDelta: number };\n certification: { current: unknown | null; recent: unknown[] };\n recentLabels: string[];\n }>;\n history(args?: { label?: string; limit?: number; includeArchived?: boolean; name?: string; max?: number }): Promise<{\n transitions: unknown[];\n labels: string[];\n certifications: unknown[];\n }>;\n complexity(args?: { files?: string[]; paths?: string[] }): Promise<{ files: FabricStateComplexityFile[]; netDelta: number }>;\n verify(args?: { labels?: string[]; includeArchived?: boolean; timeoutMs?: number; label?: string }): Promise<FabricStateVerificationResult>;\n goal(args: { check: string; description?: string; command?: string; cmd?: string; predicate?: string }): Promise<FabricMeshStateEntry<{ check: string; description?: string }>>;\n checkGoal(args?: { timeoutMs?: number }): Promise<{\n passed: boolean;\n output: string;\n exitCode: number | null;\n error?: string;\n }>;\n}\ntype FabricSchemaEvidence =\n | { kind: \"file_exists\"; path: string }\n | { kind: \"file_absent\"; path: string }\n | { kind: \"file_contains\"; path: string; literal: string }\n | { kind: \"file_sha256\"; path: string; sha256: string }\n | { kind: \"trusted_command\"; name: string };\ntype FabricSchemaFileOperation =\n | { kind: \"write\"; path: string; content: string; expected: { absent: true } | { sha256: string } }\n | { kind: \"edit\"; path: string; oldText: string; newText: string; expectedSha256: string }\n | { kind: \"delete\"; path: string; expectedSha256: string };\ninterface FabricSchemaEvidenceResult {\n evidence: FabricSchemaEvidence;\n status: \"confirmed\" | \"nonconfirmed\" | \"error\";\n detail: string;\n exitCode?: number | null;\n output?: string;\n observedSha256?: string;\n}\ninterface FabricSchemaStatus {\n mode: \"off\" | \"audit\" | \"enforce\";\n certificateTtlMs: number;\n maxFiles: number;\n maxBytes: number;\n trustedCommands: string[];\n generation: number;\n lastOutcome: \"committed\" | \"rolled_back\" | \"quarantined\" | null;\n hypotheses: Array<{\n id: string;\n label: string;\n status: string;\n generation: number;\n updatedAt: number;\n }>;\n}\ninterface FabricSchemaVerificationResult {\n verified: boolean;\n hypothesisId: string;\n certificate?: string;\n issuedAt?: number;\n expiresAt?: number;\n reason?: string;\n results: FabricSchemaEvidenceResult[];\n}\ninterface FabricSchemaCommitResult {\n outcome: \"committed\" | \"rolled_back\" | \"quarantined\";\n transactionId: string;\n generation?: number;\n paths?: string[];\n postconditions?: FabricSchemaEvidenceResult[];\n complexityReductionCertified?: boolean;\n stateTransition?: unknown;\n error?: string;\n rollbackError?: string;\n}\ninterface FabricSchemaApi {\n status(): Promise<FabricSchemaStatus>;\n hypothesize(args: {\n label: string;\n summary: string;\n evidence: FabricSchemaEvidence[];\n complexityReduction?: boolean;\n name?: string;\n description?: string;\n complexity_reduction?: boolean;\n }): Promise<{\n hypothesisId: string;\n status: string;\n state: unknown;\n fingerprint: string;\n generation: number;\n }>;\n verify(args: { hypothesisId: string; id?: string; hypothesis_id?: string }): Promise<FabricSchemaVerificationResult>;\n commit(args: {\n hypothesisId: string;\n certificate: string;\n operations: FabricSchemaFileOperation[];\n postconditions: FabricSchemaEvidence[];\n id?: string;\n hypothesis_id?: string;\n }): Promise<FabricSchemaCommitResult>;\n abort(args: { hypothesisId: string; certificate?: string; id?: string; hypothesis_id?: string }): Promise<{\n aborted: true;\n hypothesisId: string;\n }>;\n}\ninterface FabricCompactPendingIntent {\n reason?: string;\n instructions?: string;\n preserve?: string[];\n requestedBy: string;\n requestedAt: number;\n}\ninterface FabricCompactLastCommit {\n at: number;\n requestedBy: string;\n status: \"committed\" | \"skipped\" | \"cancelled\" | \"failed\";\n summary?: string;\n tokensBefore?: number;\n estimatedTokensAfter?: number;\n error?: string;\n persisted?: boolean;\n}\ninterface FabricCompactContextUsage {\n known: boolean;\n tokens: number | null;\n contextWindow: number | null;\n percent: number | null;\n remainingTokens: number | null;\n}\ninterface FabricCompactStatus {\n pending?: FabricCompactPendingIntent;\n last?: FabricCompactLastCommit;\n context?: FabricCompactContextUsage;\n engine?: string;\n targetContextRatio?: number;\n model?: string;\n sessionId?: string;\n}\ntype FabricComponentState = \"waiting\" | \"loading\" | \"active\" | \"unloading\" | \"failed\" | \"quarantined\" | \"disposed\";\ninterface FabricComponentEffectInfo {\n label: string;\n kind: \"none\" | \"scoped\" | \"transactional\" | \"emission\";\n resources: string[];\n ordering: \"commutative\" | \"ordered\" | \"unknown\";\n}\ninterface FabricComponentEffectConflict {\n withComponent: string;\n resources: string[];\n reason: \"shared_resource\" | \"unknown_resource\";\n}\ninterface FabricComponentInfo {\n id: string;\n component: string;\n parentId?: string;\n state: FabricComponentState;\n guarantee: \"managed\" | \"revertible\";\n requirements: string[];\n provisions: string[];\n missing: string[];\n optionalMissing: string[];\n effects?: FabricComponentEffectInfo[];\n effectConflicts?: FabricComponentEffectConflict[];\n targetDigest?: string;\n error?: string;\n cleanupErrors?: string[];\n revision: number;\n createdAt: number;\n updatedAt: number;\n}\ninterface FabricComponentsApi {\n list(): Promise<{\n definitions: Array<{ name: string; description?: string; revision: number; requirements: string[]; provisions: string[] }>;\n components: FabricComponentInfo[];\n }>;\n status(args: { id: string }): Promise<FabricComponentInfo>;\n graph(): Promise<{\n components: FabricComponentInfo[];\n edges: Array<{ from: string; to: string; ref: string; kind?: \"dependency\" | \"ownership\" }>;\n cycles: string[][];\n }>;\n reload(args?: { id?: string }): Promise<{ components: FabricComponentInfo[] }>;\n}\n\ninterface FabricCompactApi {\n request(args?: {\n reason?: string;\n instructions?: string;\n preserve?: string[];\n requestedBy?: string;\n instruction?: string;\n requested_by?: string;\n }): Promise<{ requested: true; intent: FabricCompactPendingIntent }>;\n status(): Promise<FabricCompactStatus>;\n cancel(): Promise<{ cancelled: true }>;\n}\n\ninterface FabricCodemapSymbolCounts {\n files: number;\n symbols: number;\n languages: Record<string, number>;\n fallbackFiles: number;\n truncated: boolean;\n elapsedMs: number;\n}\ninterface FabricCodemapCascadeEdge {\n file: string;\n score: number;\n commits: number;\n}\ninterface FabricCodemapCascade {\n seeds: string[];\n edges: FabricCodemapCascadeEdge[];\n commitsScanned: number;\n truncated: boolean;\n unavailable?: string;\n}\ninterface FabricCodemapApi {\n map(args?: {\n path?: string;\n maxTokens?: number;\n glob?: string;\n focus?: string;\n seeds?: string[];\n refresh?: boolean;\n }): Promise<{\n text: string;\n root: string;\n tokensEstimated: number;\n filesShown: number;\n symbolsShown: number;\n omittedFiles: number;\n omittedSymbols: number;\n truncated: boolean;\n indexed: FabricCodemapSymbolCounts;\n cascade?: FabricCodemapCascade;\n }>;\n cascade(args: {\n path?: string;\n seeds: string[];\n limit?: number;\n maxCommits?: number;\n }): Promise<FabricCodemapCascade>;\n}\n\ninterface FabricWorkflowAgentOptions extends Omit<FabricAgentRequest, \"task\"> {\n label?: string;\n}\ntype FabricActivityStatus = \"pending\" | \"running\" | \"completed\" | \"failed\" | \"blocked\" | \"stopped\";\ntype FabricActivityKind = \"agent\" | \"actor\" | \"tool\" | \"extension\" | \"mcp\" | \"mesh\" | \"task\" | \"custom\";\ninterface FabricWorkflowDisplay {\n name?: string;\n description?: string;\n}\ninterface FabricWorkflowPhaseOptions {\n id?: string;\n description?: string;\n total?: number;\n}\ninterface FabricWorkflowPhaseInput extends FabricWorkflowPhaseOptions {\n name: string;\n}\ninterface FabricWorkflowItem {\n id: string;\n label: string;\n status?: FabricActivityStatus;\n phase?: string;\n detail?: string;\n kind?: FabricActivityKind;\n current?: string;\n total?: number;\n completed?: number;\n data?: unknown;\n}\ninterface FabricWorkflowApi {\n agent<T = string>(prompt: string, options?: FabricWorkflowAgentOptions): Promise<T>;\n parallel<T, R>(items: T[], mapper: (item: T, index: number) => Promise<R> | R, concurrency?: number | { concurrency?: number }): Promise<R[]>;\n parallel<T>(thunks: Array<() => Promise<T> | T>, concurrency?: number | { concurrency?: number }): Promise<T[]>;\n pipeline<T>(items: T[], ...stages: Array<(value: unknown, original: T, index: number) => Promise<unknown> | unknown>): Promise<unknown[]>;\n configure(display: FabricWorkflowDisplay): Promise<FabricWorkflowDisplay>;\n phase(name: string, options?: FabricWorkflowPhaseOptions): Promise<{ name: string; index: number; id?: string }>;\n phase(input: FabricWorkflowPhaseInput): Promise<{ name: string; index: number; id?: string }>;\n item(item: FabricWorkflowItem): Promise<FabricWorkflowItem>;\n event(event: { message: string; level?: \"info\" | \"success\" | \"warning\" | \"error\"; data?: unknown }): Promise<void>;\n log(...values: unknown[]): void;\n budget: { total: number; spent(): number; remaining(): number };\n}\ninterface FabricJudgmentChoiceQuestion {\n type: \"choice\";\n instructions: string;\n criteria: Record<string, string | null>;\n}\ninterface FabricJudgmentBoolQuestion {\n type: \"bool\";\n instructions: string;\n criteria?: { true?: string; false?: string };\n}\ninterface FabricJudgmentScoreQuestion {\n type: \"score\";\n instructions: string;\n criteria: [string, string, ...string[]];\n}\ntype FabricJudgmentQuestion =\n | FabricJudgmentChoiceQuestion\n | FabricJudgmentBoolQuestion\n | FabricJudgmentScoreQuestion;\ninterface FabricJudgmentChoiceAnswer {\n type: \"choice\";\n choice: string;\n probabilities: Record<string, number>;\n confidence: number;\n}\ninterface FabricJudgmentBoolAnswer {\n type: \"bool\";\n bool: number;\n}\ninterface FabricJudgmentScoreAnswer {\n type: \"score\";\n score: number;\n probabilities: Record<string, number>;\n confidence: number;\n}\ntype FabricJudgmentAnswer =\n | FabricJudgmentChoiceAnswer\n | FabricJudgmentBoolAnswer\n | FabricJudgmentScoreAnswer;\ninterface FabricJudgmentApi {\n ask(args: {\n state: unknown;\n questions: Record<string, FabricJudgmentQuestion>;\n }): Promise<\n | { ok: true; backend: string; answers: Record<string, FabricJudgmentAnswer> }\n | {\n ok: false;\n reason: \"disabled\" | \"unsupported\" | \"refused\" | \"failed\" | \"timeout\" | \"aborted\";\n detail?: string;\n }\n >;\n stats(): Promise<{\n enabled: boolean;\n requests: number;\n batched: number;\n questions: number;\n merged: number;\n failures: number;\n refusals: number;\n timeouts: number;\n lastBackend?: string;\n lastError?: string;\n }>;\n}\ndeclare const tools: FabricToolsApi;\ndeclare const omp: OmpToolsApi;\ndeclare const extensions: FabricExtensionsApi;\ndeclare const agents: FabricAgentsApi;\ndeclare const mesh: FabricMeshApi;\ndeclare const mcp: FabricMcpApi;\ndeclare const memory: FabricMemoryApi;\ndeclare const state: FabricStateApi;\ndeclare const schema: FabricSchemaApi;\ndeclare const components: FabricComponentsApi;\ndeclare const compact: FabricCompactApi;\ndeclare const codemap: FabricCodemapApi;\ndeclare const judgment: FabricJudgmentApi;\ndeclare const council: FabricCouncilApi;\ndeclare const workflow: FabricWorkflowApi;\ndeclare function agent<T = string>(prompt: string, options?: FabricWorkflowAgentOptions): Promise<T>;\ndeclare function parallel<T, R>(items: T[], mapper: (item: T, index: number) => Promise<R> | R, concurrency?: number | { concurrency?: number }): Promise<R[]>;\ndeclare function parallel<T>(thunks: Array<() => Promise<T> | T>, concurrency?: number | { concurrency?: number }): Promise<T[]>;\ndeclare function pipeline<T>(items: T[], ...stages: Array<(value: unknown, original: T, index: number) => Promise<unknown> | unknown>): Promise<unknown[]>;\ndeclare function phase(name: string, options?: FabricWorkflowPhaseOptions): Promise<{ name: string; index: number; id?: string }>;\ndeclare function phase(input: FabricWorkflowPhaseInput): Promise<{ name: string; index: number; id?: string }>;\ndeclare function log(...values: unknown[]): void;\ndeclare const budget: FabricWorkflowApi[\"budget\"];\ntype FabricRlmRequest = Omit<FabricAgentRequest, \"runner\" | \"recursive\" | \"cwd\"> & { runner?: \"omp\" };\ndeclare const rlm: { query(args: FabricRlmRequest): Promise<FabricAgentResult> };\ninterface FabricConsole {\n log(...args: unknown[]): void;\n info(...args: unknown[]): void;\n warn(...args: unknown[]): void;\n error(...args: unknown[]): void;\n}\ndeclare const console: FabricConsole;\ndeclare const payloads: Readonly<Record<string, string>>;\ndeclare function print(...args: unknown[]): void;\ndeclare function setTimeout(handler: (...args: any[]) => void, timeout?: number): number;\ndeclare function clearTimeout(handle: number): void;\ndeclare function setInterval(handler: (...args: any[]) => void, timeout?: number): number;\ndeclare function clearInterval(handle: number): void;\n`;\n\nconst FULL_CODE_GLOBAL_DECLARATIONS = [\n \"declare const omp: OmpToolsApi;\\n\",\n \"declare const extensions: FabricExtensionsApi;\\n\",\n];\n\nconst OMP_LOOSE_DECLARATION = \"declare const omp: OmpToolsApi;\\n\";\nconst MCP_LOOSE_DECLARATION = \"declare const mcp: FabricMcpApi;\\n\";\nconst EXTENSIONS_LOOSE_DECLARATION = \"declare const extensions: FabricExtensionsApi;\\n\";\n\nexport interface FabricGuestDeclarationOptions {\n /** Global names to omit (for example providers disabled by configuration). */\n excludeGlobals?: readonly string[];\n /**\n * Pre-rendered replacement blocks from buildDynamicGuestDeclarations().\n * Applied only when the loose anchor line is still present \u2014 excluded\n * globals (or orchestration-only mode, for extensions) keep nothing to\n * replace, and missing/undefined sections keep the loose surface.\n */\n dynamic?: FabricDynamicGuestDeclarations;\n /** Add captured core overloads to the full-code OMP declaration. */\n coreOverrides?: string;\n}\n\nconst globalDeclarationLine = (name: string): RegExp =>\n new RegExp(`^declare const ${name}: [^\\\\n]*;\\\\n`, \"m\");\n\nconst terminatedDeclaration = (block: string): string =>\n block.endsWith(\"\\n\") ? block : `${block}\\n`;\n\nexport const guestTypeDeclarations = (\n fullCodeMode: boolean,\n options: FabricGuestDeclarationOptions = {},\n): string => {\n const base = fullCodeMode\n ? GUEST_TYPE_DECLARATIONS\n : FULL_CODE_GLOBAL_DECLARATIONS.reduce(\n (declarations, declaration) => declarations.replace(declaration, \"\"),\n GUEST_TYPE_DECLARATIONS,\n );\n let result = (options.excludeGlobals ?? []).reduce(\n (declarations, name) => declarations.replace(globalDeclarationLine(name), \"\"),\n base,\n );\n if (fullCodeMode && options.coreOverrides && result.includes(OMP_LOOSE_DECLARATION)) {\n result = result.replace(\n OMP_LOOSE_DECLARATION,\n terminatedDeclaration(options.coreOverrides),\n );\n }\n if (options.dynamic?.mcp && result.includes(MCP_LOOSE_DECLARATION)) {\n result = result.replace(\n MCP_LOOSE_DECLARATION,\n terminatedDeclaration(options.dynamic.mcp),\n );\n }\n if (options.dynamic?.extensions && result.includes(EXTENSIONS_LOOSE_DECLARATION)) {\n result = result.replace(\n EXTENSIONS_LOOSE_DECLARATION,\n terminatedDeclaration(options.dynamic.extensions),\n );\n }\n return result;\n};\n"],
5
+ "mappings": ";AAQO,IAAM,6CAA6C;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AACN;AAEO,IAAM,0BAA0B;AAAA,EACrC,MAAM,CAAC,UAAU,OAAO;AAAA,EACxB,MAAM,CAAC,SAAS;AAAA,EAChB,MAAM,CAAC;AAAA,EACP,OAAO,CAAC;AAAA,EACR,MAAM,CAAC,WAAW,MAAM;AAAA,EACxB,MAAM,CAAC,OAAO;AAAA,EACd,IAAI,CAAC,OAAO;AACd;AAEO,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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