@agenticprimitives/orchestration 0.0.0-alpha.3 → 0.0.0-alpha.30

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 (118) hide show
  1. package/README.md +7 -0
  2. package/dist/admission.d.ts +75 -10
  3. package/dist/admission.d.ts.map +1 -1
  4. package/dist/admission.js +203 -8
  5. package/dist/admission.js.map +1 -1
  6. package/dist/answer-quality.d.ts +129 -0
  7. package/dist/answer-quality.d.ts.map +1 -0
  8. package/dist/answer-quality.js +197 -0
  9. package/dist/answer-quality.js.map +1 -0
  10. package/dist/approval.d.ts +20 -0
  11. package/dist/approval.d.ts.map +1 -0
  12. package/dist/approval.js +79 -0
  13. package/dist/approval.js.map +1 -0
  14. package/dist/artifacts.d.ts +9 -1
  15. package/dist/artifacts.d.ts.map +1 -1
  16. package/dist/artifacts.js +119 -2
  17. package/dist/artifacts.js.map +1 -1
  18. package/dist/authority.d.ts +176 -2
  19. package/dist/authority.d.ts.map +1 -1
  20. package/dist/conformance.d.ts +80 -0
  21. package/dist/conformance.d.ts.map +1 -0
  22. package/dist/conformance.js +264 -0
  23. package/dist/conformance.js.map +1 -0
  24. package/dist/derivation.d.ts +40 -0
  25. package/dist/derivation.d.ts.map +1 -0
  26. package/dist/derivation.js +158 -0
  27. package/dist/derivation.js.map +1 -0
  28. package/dist/digest.d.ts +10 -0
  29. package/dist/digest.d.ts.map +1 -0
  30. package/dist/digest.js +45 -0
  31. package/dist/digest.js.map +1 -0
  32. package/dist/evidence.d.ts +77 -0
  33. package/dist/evidence.d.ts.map +1 -0
  34. package/dist/evidence.js +101 -0
  35. package/dist/evidence.js.map +1 -0
  36. package/dist/export-port.d.ts +13 -0
  37. package/dist/export-port.d.ts.map +1 -0
  38. package/dist/export-port.js +2 -0
  39. package/dist/export-port.js.map +1 -0
  40. package/dist/index.d.ts +33 -11
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +39 -6
  43. package/dist/index.js.map +1 -1
  44. package/dist/input.d.ts +52 -0
  45. package/dist/input.d.ts.map +1 -1
  46. package/dist/input.js +15 -0
  47. package/dist/input.js.map +1 -1
  48. package/dist/intent.d.ts +37 -0
  49. package/dist/intent.d.ts.map +1 -0
  50. package/dist/intent.js +46 -0
  51. package/dist/intent.js.map +1 -0
  52. package/dist/judgment.d.ts +131 -0
  53. package/dist/judgment.d.ts.map +1 -0
  54. package/dist/judgment.js +249 -0
  55. package/dist/judgment.js.map +1 -0
  56. package/dist/loop.d.ts +74 -9
  57. package/dist/loop.d.ts.map +1 -1
  58. package/dist/loop.js +1057 -178
  59. package/dist/loop.js.map +1 -1
  60. package/dist/metrics.js +8 -8
  61. package/dist/metrics.js.map +1 -1
  62. package/dist/outcome.d.ts +223 -0
  63. package/dist/outcome.d.ts.map +1 -0
  64. package/dist/outcome.js +326 -0
  65. package/dist/outcome.js.map +1 -0
  66. package/dist/plan-digest.d.ts +16 -0
  67. package/dist/plan-digest.d.ts.map +1 -0
  68. package/dist/plan-digest.js +45 -0
  69. package/dist/plan-digest.js.map +1 -0
  70. package/dist/planner.d.ts +43 -0
  71. package/dist/planner.d.ts.map +1 -1
  72. package/dist/planner.js +132 -0
  73. package/dist/planner.js.map +1 -1
  74. package/dist/provenance.d.ts +37 -0
  75. package/dist/provenance.d.ts.map +1 -0
  76. package/dist/provenance.js +127 -0
  77. package/dist/provenance.js.map +1 -0
  78. package/dist/reconcile.d.ts +48 -0
  79. package/dist/reconcile.d.ts.map +1 -0
  80. package/dist/reconcile.js +20 -0
  81. package/dist/reconcile.js.map +1 -0
  82. package/dist/record.d.ts +129 -22
  83. package/dist/record.d.ts.map +1 -1
  84. package/dist/record.js +53 -1
  85. package/dist/record.js.map +1 -1
  86. package/dist/regression.d.ts +130 -0
  87. package/dist/regression.d.ts.map +1 -0
  88. package/dist/regression.js +113 -0
  89. package/dist/regression.js.map +1 -0
  90. package/dist/rollup.d.ts +72 -0
  91. package/dist/rollup.d.ts.map +1 -0
  92. package/dist/rollup.js +117 -0
  93. package/dist/rollup.js.map +1 -0
  94. package/dist/selection.d.ts +334 -0
  95. package/dist/selection.d.ts.map +1 -0
  96. package/dist/selection.js +481 -0
  97. package/dist/selection.js.map +1 -0
  98. package/dist/spans.d.ts +77 -2
  99. package/dist/spans.d.ts.map +1 -1
  100. package/dist/spans.js +98 -25
  101. package/dist/spans.js.map +1 -1
  102. package/dist/step-lifecycle.d.ts +303 -0
  103. package/dist/step-lifecycle.d.ts.map +1 -0
  104. package/dist/step-lifecycle.js +304 -0
  105. package/dist/step-lifecycle.js.map +1 -0
  106. package/dist/tool-invoker.d.ts +58 -3
  107. package/dist/tool-invoker.d.ts.map +1 -1
  108. package/dist/tool-invoker.js +26 -1
  109. package/dist/tool-invoker.js.map +1 -1
  110. package/dist/trace-facts.d.ts +93 -0
  111. package/dist/trace-facts.d.ts.map +1 -0
  112. package/dist/trace-facts.js +82 -0
  113. package/dist/trace-facts.js.map +1 -0
  114. package/dist/types.d.ts +210 -1
  115. package/dist/types.d.ts.map +1 -1
  116. package/dist/types.js +8 -0
  117. package/dist/types.js.map +1 -1
  118. package/package.json +17 -8
@@ -3,20 +3,75 @@ import type { SuppliedInputV1 } from './input.js';
3
3
  /** Context handed to the invoker for one step (for logging / args resolution; never authority). */
4
4
  export interface InvokeContext {
5
5
  intent: Intent;
6
+ /** Spec 420 — a COMPARISON's dry run: an invoker whose tool declares `dryRun: 'invoke'` runs its read-only preconditions
7
+ * (find the fact, check the turn) and returns what it WOULD do — or its refusal — and writes NOTHING. */
8
+ dryRun?: boolean;
6
9
  step: PlanStep;
7
10
  /** 0-based index of this step within the current plan. */
8
11
  index: number;
9
12
  /** Spec 350 §3.1 — present for medium+ risk steps. An invoker MUST make the call idempotent on it: a
10
13
  * retry of a payment is not a re-read, and the loop may re-run a step after a resume. */
11
14
  idempotencyKey?: string;
15
+ /** Spec 410 §3 — the step's LOGICAL operation identity, always present: the admitted binding's `operationId`,
16
+ * else the idempotency key, else `runRef:stepRef`. An adapter records it with the effect it makes (a write
17
+ * ledger, a send ledger) so a reconcile can find the operation before a retry acts again. */
18
+ operationId: string;
12
19
  /** Spec 350 §3.4 — the answers supplied for THIS step on a resume (data, a signature, a confirmation).
13
20
  * Empty on a first run. A tool that lacks something throws `InputRequired` instead of guessing. */
14
21
  supplied?: SuppliedInputV1[];
22
+ /** Spec 408 §2.3 — the digest of the plan this step belongs to, as the verifier judged it. An invoker that
23
+ * redeems a plan-bound mandate on chain presents it (`DigestBindingEnforcer`, kind `plan`). */
24
+ planDigest?: string;
25
+ /** Spec 409 §4 — has this run SEEN UNTRUSTED CONTENT before this step: any earlier observation (executed or
26
+ * replayed) whose result carries `untrusted: true` (a web page, a file, an external MCP server's answer). A
27
+ * self-authorized write consults it: after untrusted content, a write parks as a proposal instead of running
28
+ * on words the planner may have taken from an attacker. Evidence, never authority — no verifier reads it. */
29
+ untrustedSeen?: boolean;
30
+ /** Spec 445 decision 8 — set on an OUTBOUND step (`ToolSpec.outbound`) the loop gated and the asker confirmed: the
31
+ * `outboundDigest` of exactly what is being sent. An invoker's own disclosure guard may accept it as the
32
+ * confirmation for these very arguments. Absent ⇒ the loop did not gate this step (a clean run, or a mandate). */
33
+ outboundConfirmed?: string;
15
34
  }
35
+ /** What an adapter can show for what it observed: a response digest, a receipt URL, a chain read, a reconcile hit. */
36
+ export interface EvidenceRefV1 {
37
+ kind: 'response-digest' | 'receipt-url' | 'chain-read' | 'read-back' | 'reconcile' | (string & {});
38
+ ref: string;
39
+ }
40
+ export type ObservedOutcome = 'attempted' | 'accepted' | 'committed' | 'confirmed';
41
+ export interface ToolObservationV1 {
42
+ /** `attempted`: the call left and nothing came back the adapter can vouch for. `accepted`: the provider
43
+ * acknowledged (a 202, a queued message) and has not committed. `committed`: the provider says it is done.
44
+ * `confirmed`: the harness read the effect back INDEPENDENTLY of the call that made it. */
45
+ outcome: ObservedOutcome;
46
+ /** The provider's own identifier for the effect: message id, tx hash, task id, record version. */
47
+ providerRef?: string;
48
+ /** RFC 3339 — the harness clock when the adapter returned. */
49
+ observedAt: string;
50
+ evidence: EvidenceRefV1[];
51
+ }
52
+ /** What an invoker resolves when it can say what it saw. A raw value is still accepted and read as `attempted`. */
53
+ export interface ToolInvocationResultV1<T = unknown> {
54
+ output: T;
55
+ observation: ToolObservationV1;
56
+ }
57
+ export declare function isToolInvocationResult(v: unknown): v is ToolInvocationResultV1;
58
+ /** An invocation result over a raw value, for an adapter that has nothing more to show than that it returned. */
59
+ export declare function observed<T>(output: T, outcome: ObservedOutcome, o?: {
60
+ providerRef?: string;
61
+ evidence?: EvidenceRefV1[];
62
+ now?: () => Date;
63
+ }): ToolInvocationResultV1<T>;
16
64
  /**
17
- * Execute a single tool. Resolve with the tool's result, or REJECT to signal a step failure (the loop then
18
- * re-plans, bounded). A resolved value is treated as success — an invoker that wants to surface a tool-level
19
- * error as a failure must throw (fail-closed; the loop does not inspect result shapes for hidden errors).
65
+ * Execute a single tool. Resolve with the tool's result — a `ToolInvocationResultV1` when the adapter can say
66
+ * what it saw (spec 410 §2), or a raw value, which the loop records as `attempted` (a read as `confirmed`: the
67
+ * read IS the observation). REJECT to signal a step failure (the loop then re-plans, bounded). A resolved
68
+ * value is treated as success — an invoker that wants to surface a tool-level error as a failure must throw
69
+ * (fail-closed; the loop does not inspect result shapes for hidden errors).
20
70
  */
21
71
  export type ToolInvoker = (toolId: string, args: Record<string, unknown>, ctx: InvokeContext) => Promise<unknown>;
72
+ /**
73
+ * Spec 410 §2 "done when" — a stranger given only the receipt can answer "which end committed this, and what did
74
+ * it see". Rendered from the observation's words, never composed: the four outcomes each have one sentence.
75
+ */
76
+ export declare function describeObservation(o: ToolObservationV1 | undefined): string;
22
77
  //# sourceMappingURL=tool-invoker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-invoker.d.ts","sourceRoot":"","sources":["../src/tool-invoker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY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M,CAU5E"}
@@ -1,2 +1,27 @@
1
- export {};
1
+ const OUTCOMES = new Set(['attempted', 'accepted', 'committed', 'confirmed']);
2
+ export function isToolInvocationResult(v) {
3
+ const r = v;
4
+ return !!r && typeof r === 'object' && 'output' in r && !!r.observation && typeof r.observation === 'object'
5
+ && OUTCOMES.has(String(r.observation.outcome)) && typeof r.observation.observedAt === 'string' && Array.isArray(r.observation.evidence);
6
+ }
7
+ /** An invocation result over a raw value, for an adapter that has nothing more to show than that it returned. */
8
+ export function observed(output, outcome, o = {}) {
9
+ return { output, observation: { outcome, ...(o.providerRef ? { providerRef: o.providerRef } : {}), observedAt: (o.now ?? (() => new Date()))().toISOString(), evidence: o.evidence ?? [] } };
10
+ }
11
+ /**
12
+ * Spec 410 §2 "done when" — a stranger given only the receipt can answer "which end committed this, and what did
13
+ * it see". Rendered from the observation's words, never composed: the four outcomes each have one sentence.
14
+ */
15
+ export function describeObservation(o) {
16
+ if (!o)
17
+ return 'nothing was observed: the receipt predates the observation record, and only the output digest stands';
18
+ const saw = o.evidence.length ? ` It saw: ${o.evidence.map((e) => `${e.kind} ${e.ref}`).join('; ')}.` : ' It showed nothing beyond the call.';
19
+ const ref = o.providerRef ? ` The provider's reference is ${o.providerRef}.` : '';
20
+ switch (o.outcome) {
21
+ case 'attempted': return `Neither end is known to have committed this: the call left at ${o.observedAt} and nothing came back the adapter could vouch for.${ref}${saw}`;
22
+ case 'accepted': return `The provider accepted this at ${o.observedAt} and had not committed it when the adapter returned.${ref}${saw}`;
23
+ case 'committed': return `The provider says it committed this at ${o.observedAt}; the harness has not read it back independently.${ref}${saw}`;
24
+ case 'confirmed': return `Confirmed at ${o.observedAt}: the harness read the effect back independently of the call that made it.${ref}${saw}`;
25
+ }
26
+ }
2
27
  //# sourceMappingURL=tool-invoker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-invoker.js","sourceRoot":"","sources":["../src/tool-invoker.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"tool-invoker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G,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,qCAAqC,CAAC;IAC9I,MAAM,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAClF,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC;QAClB,KAAK,WAAW,CAAC,CAAC,OAAO,iEAAiE,CAAC,CAAC,UAAU,sDAAsD,GAAG,GAAG,GAAG,EAAE,CAAC;QACxK,KAAK,UAAU,CAAC,CAAC,OAAO,iCAAiC,CAAC,CAAC,UAAU,uDAAuD,GAAG,GAAG,GAAG,EAAE,CAAC;QACxI,KAAK,WAAW,CAAC,CAAC,OAAO,0CAA0C,CAAC,CAAC,UAAU,oDAAoD,GAAG,GAAG,GAAG,EAAE,CAAC;QAC/I,KAAK,WAAW,CAAC,CAAC,OAAO,gBAAgB,CAAC,CAAC,UAAU,6EAA6E,GAAG,GAAG,GAAG,EAAE,CAAC;IAChJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,93 @@
1
+ import type { RunRecordV1 } from './record.js';
2
+ /** How the request reached the harness. Ids only. */
3
+ export interface RunDoorV1 {
4
+ kind: 'a2a-message' | 'harness-ask' | 'routed' | 'trigger' | 'resume' | 'home-mcp' | 'channel-mention' | 'background';
5
+ /** A2A 1.0 `Message.messageId` / `contextId` / task id, when the door was an A2A message. */
6
+ messageId?: string;
7
+ contextId?: string;
8
+ taskId?: string;
9
+ /** Spec 397 — through a HOST (the Home MCP): which registered client of the person, and under which template
10
+ * (`ask-as-me`, `act-as-me`). Ids only; the wire itself is never here. */
11
+ client?: string;
12
+ template?: string;
13
+ }
14
+ /** One language-model call the run made. Times in ms. */
15
+ /** What a provider REPORTED a model call used (never an estimate): input and output tokens, and where the provider
16
+ * says so, the input served from its prompt cache and the output spent on reasoning. */
17
+ export interface ModelUsageV1 {
18
+ tokensIn: number;
19
+ tokensOut: number;
20
+ cachedIn?: number;
21
+ reasoningOut?: number;
22
+ }
23
+ /** Sum usages (an absent one contributes nothing). */
24
+ export declare function addUsage(a: ModelUsageV1 | undefined, b: ModelUsageV1 | undefined): ModelUsageV1 | undefined;
25
+ export interface ModelCallV1 {
26
+ /** `judge`: the call that chose a skill (spec 415 selection); `structured`: a step's own structured call. */
27
+ role: 'plan' | 'compose' | 'structured' | 'judge';
28
+ /** Spec 417 §5 — the step whose call this was (a skill's answer); absent for the plan, the compose and the judge. */
29
+ stepRef?: string;
30
+ /** The call failed (no answer came back); its time and tokens still count. */
31
+ failed?: boolean;
32
+ model?: string;
33
+ provider?: string;
34
+ /** A digest of the prompt (never the prompt) — two runs share a prompt exactly when these match. */
35
+ promptDigest?: string;
36
+ tokensIn?: number;
37
+ tokensOut?: number;
38
+ /** Spec 388 — why this provider carried the call (a reason code). */
39
+ routeReason?: string;
40
+ startMs?: number;
41
+ endMs?: number;
42
+ /** The gateway receipt that answers for this call (`inference.receipt:<id>` in inference.svc's vault). */
43
+ receiptRef?: string;
44
+ /** The PROFILE the caller named (never a model) and the version it ran under. */
45
+ profile?: string;
46
+ profileVersion?: string;
47
+ costMicroUsd?: number;
48
+ /** Which attempt inside the profile answered; `fallbackOf` names the receipt of the attempt it replaced. */
49
+ attempt?: number;
50
+ fallbackOf?: string;
51
+ }
52
+ /** The configuration a run ran under — each part something a comparison may change on its own. */
53
+ export interface VariantV1 {
54
+ /** The playbook, by its definition commitment; absent = the bare harness. */
55
+ playbook?: string;
56
+ /** supplied | compiled | model | rule-based. */
57
+ plannerKind?: string;
58
+ /** Spec 388 route policy (`budget`, a pinned provider …). */
59
+ routePolicy?: string;
60
+ /** The runtime's build (deployment version id / commit). */
61
+ build?: string;
62
+ /** Harness-capability toggles by notation (`retrieval/kb` → `off`). Absent ⇒ defaults. */
63
+ toggles?: Record<string, string>;
64
+ }
65
+ /** The seeded records a run began from, by digest (a comparison's fixture). Absent for a live run. */
66
+ export interface StartingStateRefV1 {
67
+ digest: string;
68
+ }
69
+ export type EngagementEffectV1 = 'changed-plan' | 'changed-step' | 'changed-answer' | 'no-change' | 'refused';
70
+ /** One engagement of a harness capability — on the run (no `stepRef`) or on one step. */
71
+ export interface HarnessEngagementV1 {
72
+ capability: string;
73
+ effect: EngagementEffectV1;
74
+ version?: string;
75
+ stepRef?: string;
76
+ /** Spec 415 §3a — for a `skill-selection/*` engagement: candidates offered, chosen, and the rejected neighbour (IRIs). */
77
+ offered?: string[];
78
+ chose?: string[];
79
+ rejected?: string[];
80
+ /** Spec 415 A4 — the request typed in the domain ontology (class IRIs; `https://agenticprimitives.dev/ns/execution#OutsideDomain`). */
81
+ intent?: {
82
+ requests?: string;
83
+ about?: string[];
84
+ };
85
+ }
86
+ /** A variant's identity: SHA-256 over its canonical JSON (keys sorted — RFC 8785 for these string-valued parts). */
87
+ export declare function variantDigestOf(v: VariantV1): Promise<`sha256:${string}`>;
88
+ /** The planner kind as a harness-capability notation. */
89
+ export declare function plannerCapabilityOf(kind: string | undefined): string | undefined;
90
+ /** Every engagement the record shows, derived, merged with the explicit stamps (first mention wins per capability
91
+ * and step). Deterministic: the same record yields the same list. */
92
+ export declare function engagementsOf(record: RunRecordV1): HarnessEngagementV1[];
93
+ //# sourceMappingURL=trace-facts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-facts.d.ts","sourceRoot":"","sources":["../src/trace-facts.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,qDAAqD;AACrD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ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yDAAyD;AACzD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKhF;AAED;sEACsE;AACtE,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAyCxE"}
@@ -0,0 +1,82 @@
1
+ import { canonicalJson, isArtifactRef, resultFactsOf } from './artifacts.js';
2
+ /** Sum usages (an absent one contributes nothing). */
3
+ export function addUsage(a, b) {
4
+ if (!a)
5
+ return b;
6
+ if (!b)
7
+ return a;
8
+ const opt = (x, y) => (x === undefined && y === undefined ? undefined : (x ?? 0) + (y ?? 0));
9
+ const cachedIn = opt(a.cachedIn, b.cachedIn), reasoningOut = opt(a.reasoningOut, b.reasoningOut);
10
+ return { tokensIn: a.tokensIn + b.tokensIn, tokensOut: a.tokensOut + b.tokensOut, ...(cachedIn !== undefined ? { cachedIn } : {}), ...(reasoningOut !== undefined ? { reasoningOut } : {}) };
11
+ }
12
+ /** A variant's identity: SHA-256 over its canonical JSON (keys sorted — RFC 8785 for these string-valued parts). */
13
+ export async function variantDigestOf(v) {
14
+ const bytes = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(canonicalJson(v))));
15
+ return `sha256:${Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')}`;
16
+ }
17
+ /** The planner kind as a harness-capability notation. */
18
+ export function plannerCapabilityOf(kind) {
19
+ if (!kind)
20
+ return undefined;
21
+ if (kind === 'supplied')
22
+ return 'planner/supplied';
23
+ if (kind === 'compiled')
24
+ return 'planner/compiled-shape';
25
+ return 'planner/model';
26
+ }
27
+ /** Every engagement the record shows, derived, merged with the explicit stamps (first mention wins per capability
28
+ * and step). Deterministic: the same record yields the same list. */
29
+ export function engagementsOf(record) {
30
+ const out = [];
31
+ const seen = new Set();
32
+ const add = (e) => {
33
+ const k = `${e.capability}|${e.stepRef ?? ''}`;
34
+ if (seen.has(k))
35
+ return;
36
+ seen.add(k);
37
+ out.push(e);
38
+ };
39
+ for (const e of record.engaged ?? [])
40
+ add(e);
41
+ // The planner proposed the plan (a supplied plan is still "the plan came from here").
42
+ const planner = plannerCapabilityOf(record.variant?.plannerKind);
43
+ if (planner)
44
+ add({ capability: planner, effect: record.plan.steps.length ? 'changed-plan' : 'no-change' });
45
+ // Plan admission: a refusal that forced a replan changed the plan; one that ended the run refused.
46
+ const refusals = record.events.filter((e) => e.type === 'PlanRefused');
47
+ if (refusals.length)
48
+ add({ capability: 'plan-admission', effect: refusals.some((r) => r.replanning) ? 'changed-plan' : 'refused' });
49
+ // A playbook governed the run.
50
+ if (record.receipts.some((r) => r.skillRef))
51
+ add({ capability: 'playbook', effect: 'changed-plan' });
52
+ // Fan-out (spec 380): the loop expands one step into `<base>#<k>` steps — its own id convention — so an expanded
53
+ // step on the record IS the evidence the plan was widened.
54
+ if (record.steps.some((s) => /#\d+$/.test(s.stepRef)))
55
+ add({ capability: 'fan-out', effect: 'changed-plan' });
56
+ const receipts = new Map(record.receipts.map((r) => [r.stepRef, r]));
57
+ const replayed = new Set(record.events.filter((e) => e.type === 'StepReplayed').map((e) => e.stepRef));
58
+ const approvalRefused = new Set(record.events.filter((e) => e.type === 'ApprovalRefused').map((e) => e.stepRef));
59
+ for (const s of record.steps) {
60
+ const r = receipts.get(s.stepRef);
61
+ const facts = resultFactsOf(s.result);
62
+ // Spec 413 — the declared retrieval step grounds what is SAID: passages that came back changed the answer.
63
+ if (s.stepRef === 'retrieve')
64
+ add({ capability: 'retrieval/kb', stepRef: s.stepRef, effect: s.ok && typeof facts?.count === 'number' && facts.count > 0 ? 'changed-answer' : 'no-change' });
65
+ if (replayed.has(s.stepRef) || s.replayed)
66
+ add({ capability: 'durable-resume', stepRef: s.stepRef, effect: 'changed-step' });
67
+ if (r?.authority?.afterApproval)
68
+ add({ capability: 'approval', stepRef: s.stepRef, effect: 'changed-step' });
69
+ if (approvalRefused.has(s.stepRef))
70
+ add({ capability: 'approval', stepRef: s.stepRef, effect: 'refused' });
71
+ if (r?.decisions?.length)
72
+ add({ capability: 'decision-rules', stepRef: s.stepRef, effect: 'changed-step' });
73
+ if (r?.binding?.correlation?.delegatedTo)
74
+ add({ capability: 'handoff', stepRef: s.stepRef, effect: 'changed-step' });
75
+ else if (typeof facts?.via?.runRef === 'string')
76
+ add({ capability: 'routing', stepRef: s.stepRef, effect: 'changed-step' });
77
+ if (isArtifactRef(s.result))
78
+ add({ capability: 'context-offload', stepRef: s.stepRef, effect: 'changed-step' });
79
+ }
80
+ return out;
81
+ }
82
+ //# sourceMappingURL=trace-facts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-facts.js","sourceRoot":"","sources":["../src/trace-facts.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAuB7E,sDAAsD;AACtD,MAAM,UAAU,QAAQ,CAAC,CAA2B,EAAE,CAA2B;IAC/E,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,CAAC,CAAU,EAAE,CAAU,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/G,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,GAAG,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;IACjG,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,S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C;YAAE,GAAG,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAClH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/types.d.ts CHANGED
@@ -9,9 +9,98 @@ export interface Intent {
9
9
  constraints?: Record<string, unknown>;
10
10
  /** Optional context the planner may use (principal handle, locale…). Opaque to the loop. */
11
11
  context?: Record<string, unknown>;
12
+ /** Spec 410 §5 — the versions this intent is acted under: the ontology manifest digest and the compiled
13
+ * definition's digest. Set by the runtime before the intent is offered for a mandate; the intent digest
14
+ * (RFC 8785 over the whole object) then binds them, and the verifier recomputes under the versions it
15
+ * runs with. Opaque to the loop; the shape is `delegation.VersionBindingV1`. */
16
+ versions?: {
17
+ ontologyManifestDigest: string;
18
+ semanticsDigest: string;
19
+ };
20
+ /** Spec 445 decision 8 (EVAL-13) — THE EVALUATION MARKER (`evaluation.EvaluationMarkerV1`, structural here): this
21
+ * intent was asked by an evaluation. Its run HOLDS every self-acting write (`RunIntentOpts.dryRunSelfActs` is implied):
22
+ * the step is reached and recorded `skipped` ("held: evaluation run"), the invoker writes nothing. ANY present value
23
+ * holds — the marker only restricts, so it needs no permission and is never authority. A host copies the ask body's
24
+ * `evaluation` field here. */
25
+ evaluation?: {
26
+ type: string;
27
+ holdWrites?: boolean;
28
+ source?: string;
29
+ } | Record<string, unknown>;
30
+ /** Spec 448 rule 5 (audit H-5) — WHO WROTE THE PARTS OF THIS INTENT. Absent ⇒ every part is the principal's own words,
31
+ * which ONLY the principal's own surface may assert (her Home's Ask, her own authenticated request). A host that puts
32
+ * text someone else wrote — a trigger's payload, a message, a mail, a webhook body, a plan step proposed by another
33
+ * participant — into `goal` or `context` and leaves it unmarked has a defect: the loop would read that text as her
34
+ * instruction. Build such an intent with `relayedIntent` / `markThirdParty`. A marked part starts the run as having
35
+ * read untrusted content (the outbound gate trips on it), reaches the planner framed as data, and is not "her words"
36
+ * to admission or to a receipt's derivation. */
37
+ provenance?: IntentProvenanceV1;
38
+ }
39
+ /** Where a third-party part of an intent came from. `from` names the author when the host knows it. */
40
+ export interface IntentSourceV1 {
41
+ kind: 'trigger' | 'message' | 'mail' | 'webhook' | 'plan-step' | 'agent' | (string & {});
42
+ from?: string;
12
43
  }
44
+ /** Spec 448 rule 5 — the provenance of an intent's parts. Only what is marked is third-party. */
45
+ export interface IntentProvenanceV1 {
46
+ /** Present when `goal` is NOT the principal's own words: who wrote it. */
47
+ goal?: IntentSourceV1;
48
+ /** The `context` keys whose values someone other than the principal wrote, and who. */
49
+ context?: Record<string, IntentSourceV1>;
50
+ /** Present when `constraints` is NOT the principal's own: who wrote it (audit H-5 fix-up 2). */
51
+ constraints?: IntentSourceV1;
52
+ }
53
+ /** Spec 445 decision 8 — was this intent asked by an evaluation (it carries a marker, of any shape)? */
54
+ export declare function isEvaluationIntent(intent: Pick<Intent, 'evaluation'> | null | undefined): boolean;
13
55
  /** A capability the agent MAY compose. The planner picks from these; the loop refuses any other tool id. */
14
56
  export type OutcomeClass = 'lookup' | 'submission' | 'authoritative';
57
+ /**
58
+ * Spec 410 §2 — the adapter's declaration, on the tool contract. `verificationWindow` is the time between the
59
+ * harness's check and the provider's commit, as an ISO 8601 duration (`PT30S`) or the word `unbounded` — a
60
+ * legal and visible answer. `retry` says what a second identical call does; `cancellation` what a cancel can
61
+ * do — `none` means the word is absent from every projection of this tool.
62
+ */
63
+ export interface AdapterDeclarationV1 {
64
+ verificationWindow: string;
65
+ retry: 'idempotent-by-key' | 'never' | 'compensating';
66
+ cancellation: 'none' | 'before-commit' | 'compensating';
67
+ }
68
+ /**
69
+ * Spec 426 — AN EXECUTOR INVOKE DECLARATION: "call executor E's skill S as me, and hand me back its receipt."
70
+ * A capability carrying this is dispatched by ONE generic invoker (no runtime tool per domain): it resolves
71
+ * `executor` to a URL + client through OPERATOR CONFIG (never a hardcoded host — `executor` is a NAME, not a
72
+ * URL), obtains a session for the RUN'S PRINCIPAL, sends one A2A `message/send` carrying `metadata.skill =
73
+ * intent`, and records the receipt in `run.provenance`. An `invoke` block IMPLIES self-acting (v1): the write
74
+ * is to the principal's own domain, so the session is the authority and no mandate is minted — the generic
75
+ * invoker takes the session from the principal structurally, never from an arg (§6; `check:invoke-is-self-acting`).
76
+ */
77
+ export type ExecutorInvokeV1 = {
78
+ /** An A2A executor: `message/send` as the principal, under a session minted for the executor's client. */
79
+ transport: 'a2a.message-send';
80
+ /** A NAME the operator maps to { url, client } — never a URL (ADR-0021: no host in a tool or a package). */
81
+ executor: string;
82
+ /** The executor's skill id → `metadata.skill`: which of its skills it runs. */
83
+ intent: string;
84
+ /** How the capability's args map onto the message. */
85
+ args: {
86
+ /** The arg holding the free-text part ("what happened, in my words") → the message text. */
87
+ goal: string;
88
+ /** Args passed through as message metadata. */
89
+ metadata?: string[];
90
+ };
91
+ } | {
92
+ /** A stateless MCP server the operator maps by name (`kind: 'mcp'`): ONE `tools/call`, no session — a public
93
+ * read that decides nothing about anyone; what comes back is the server's answer, evidence with its source named. */
94
+ transport: 'mcp.tools-call';
95
+ /** A NAME the operator maps to { url } — never a URL (ADR-0021). */
96
+ executor: string;
97
+ /** The MCP tool name (`tools/call` → `params.name`). */
98
+ intent: string;
99
+ /** The capability's arg names forwarded as the tool's `arguments` (absent ⇒ every arg). */
100
+ args: {
101
+ arguments?: string[];
102
+ };
103
+ };
15
104
  export interface ToolSpec {
16
105
  /** Stable tool id (matches the invoker's dispatch key, e.g. an MCP tool name). */
17
106
  id: string;
@@ -36,6 +125,10 @@ export interface ToolSpec {
36
125
  action: string;
37
126
  resourceArg?: string;
38
127
  authorityArg?: string;
128
+ /** Spec 408 §2.2 — this tool REDEEMS the mandate on chain (a payment, a chartered treasury's transfer):
129
+ * every enforcer fires at redemption, so a caveat with no off-chain judge may be recorded as enforced
130
+ * there. Absent ⇒ the step is judged strictly off chain. Declared on the tool, never by a plan. */
131
+ redeemsOnChain?: boolean;
39
132
  };
40
133
  /**
41
134
  * Spec 366 — the argument naming the agent this act is ABOUT and is ANSWERED BY. When it resolves to an
@@ -92,6 +185,42 @@ export interface ToolSpec {
92
185
  * can tell an act authorized by a session from one authorized by a signature.
93
186
  */
94
187
  selfAuthorized?: true;
188
+ /** Spec 448 rule 8 + §0 (audit H-8 / T3-2) — the callers OTHER than the agent itself to whom this self-acting tool is
189
+ * offered: an authenticated `party`, a `pairwise` pseudonym, `anonymous`. Absent ⇒ a host that admits other callers
190
+ * (`service-host`) offers it only to the agent itself: "the caller is the principal" is the precondition of
191
+ * `selfAuthorized`, and only the agent itself proved it. Declared on the built-in tool, per tool, in words. */
192
+ selfAuthorizedCallers?: ReadonlyArray<'party' | 'pairwise' | 'anonymous'>;
193
+ /** Spec 448 rule 5 (audit T4-3) — this tool's results are the principal's OWN records or values the agent produced:
194
+ * text in them is not a third party's, so only a value it labels `untrusted` marks the run. Absent ⇒ any text in a
195
+ * result is untrusted (it may be a page, a message, another agent's answer). Declared on the built-in tool only. */
196
+ firstPartyResult?: true;
197
+ /**
198
+ * Spec 426 — this tool is an EXECUTOR INVOKE: it has no built-in invoker; the one generic invoker reads this
199
+ * block, calls the resolved executor as the run's principal, and returns its receipt. Compiled from the
200
+ * contract's `invoke` declaration (the only place a tool gains a behaviour by declaration, not runtime code).
201
+ * Its presence IMPLIES `selfAuthorized` (v1 is self-acting); a value-moving or cross-principal invoke is out of
202
+ * scope and keeps its own mandate-gated tool. The generic invoker, not this field, is the gate.
203
+ */
204
+ invoke?: ExecutorInvokeV1;
205
+ /**
206
+ * Spec 445 decision 8 — THIS TOOL SENDS DATA TO ANOTHER PARTY (another agent, an external MCP server, a remote
207
+ * host): what its arguments carry leaves the principal's estate. `true`, or `{ partyArg }` naming the argument that
208
+ * holds the party (shown to the person when the step parks).
209
+ *
210
+ * The loop gates it: once the run has read untrusted content (`untrustedSeen`, replayed observations included), or
211
+ * when any of the step's arguments is threaded (`$ref`) from an untrusted result, an outbound step is NOT executed
212
+ * silently. It runs under a verified mandate (the effectful-step authority path), or it PARKS for the asker's
213
+ * confirmation (`InputRequestV1` kind `confirmation`), and runs only when the resume carries `{ confirmed: true,
214
+ * data: { disclosure } }` whose `disclosure` is `outboundDigest(toolId, args)` — exactly what would be sent. A clean
215
+ * run (nothing untrusted read) sends without a prompt. Declared on the tool, never by a plan; a contract may ADD it
216
+ * (it only tightens) and never remove it. Behaviour containment, never authority: it grants nothing.
217
+ */
218
+ outbound?: true | {
219
+ partyArg: string;
220
+ };
221
+ /** Spec 420 — this tool's invoker honours `ctx.dryRun` (checks its preconditions, writes nothing), so a comparison may
222
+ * INVOKE it instead of holding it before invocation — its refusal ("nothing I remember contains …") is then testable. */
223
+ dryRun?: 'invoke';
95
224
  /**
96
225
  * Spec 363 W5 — the DECISION POINTS this capability consults, by id.
97
226
  *
@@ -110,6 +239,14 @@ export interface ToolSpec {
110
239
  toolId: string;
111
240
  args: Record<string, unknown>;
112
241
  };
242
+ /** Spec 410 §2 — what this tool's ADAPTER declares about the effect it makes. Required of every tool that
243
+ * submits or commits (`establishes` ≠ lookup); a generated surface may say "cancel" only when
244
+ * `cancellation` is not `none`. Declared, never inferred from a response. */
245
+ adapter?: AdapterDeclarationV1;
246
+ /** Spec 410 §7 — WHAT THIS TOOL'S WRITE CARRIES, per argument, as ontology classes (`{ body: ['apvault:ContactEmail'] }`).
247
+ * The information-flow caveat on a mandate names what a write may carry; the verifier compares the classes of
248
+ * the arguments a step presents against it. Declared by the adapter's author, never inferred from a value. */
249
+ carries?: Readonly<Record<string, readonly string[]>>;
113
250
  /** An irreversible action: imposes `fresh-authorization` whatever the tier. */
114
251
  irreversible?: boolean;
115
252
  /** Spec 358 W4 — this tool's result ENUMERATES the objects of a domain relation (an ontology IRI,
@@ -167,6 +304,9 @@ export interface PlanStep {
167
304
  };
168
305
  }
169
306
  /** The ordered tool composition the planner produced for an intent. */
307
+ /** Spec 421 W1 — the reserved continuation step ("show me what these reads return, then I will plan the rest"). A plan
308
+ * node, never a tool the loop invokes or a verifier judges. */
309
+ export declare const CONTINUE_STEP_ID = "plan.continue";
170
310
  export interface Plan {
171
311
  steps: PlanStep[];
172
312
  /** Optional one-line reasoning (audit/telemetry only — never trusted as authority). */
@@ -193,6 +333,29 @@ export interface StepObservation {
193
333
  * `onMissingMandate: 'report'`; the default is still to throw). It is 401, never 403: no authority was
194
334
  * judged, so this is not a denial and must never be reported as one. */
195
335
  export type RunOutcome = 'completed' | 'failed' | 'denied' | 'suspended' | 'authority-required';
336
+ /** Spec 448 rule 4 (I3) — a run that was ending and parked while unwinding: the outcome it was ending with, why, and the
337
+ * compensations already settled as owed. Durable run state: a host keeps it with the checkpoint and hands it back on
338
+ * `resume.unwinding`. */
339
+ export interface UnwindingV1 {
340
+ outcome: 'denied' | 'failed';
341
+ error: string;
342
+ owed: NonNullable<RunResult['compensationsOwed']>;
343
+ }
344
+ /** Spec 448 rule 4 (I3) — one step that ran, declared a compensation and has not been unwound: what a parked run must
345
+ * carry so a later refusal can still undo it. The receipt vouches for the result the compensation's arguments come from. */
346
+ export interface ObligationV1 {
347
+ stepRef: string;
348
+ index: number;
349
+ toolId: string;
350
+ /** The compensation the tool DECLARED when the step ran. A resume compares it with what the tool declares now: tool
351
+ * declarations change across deploys while runs are parked. */
352
+ compensation?: {
353
+ toolId: string;
354
+ args: Record<string, unknown>;
355
+ };
356
+ result?: unknown;
357
+ receipt: import('./authority.js').StepReceipt;
358
+ }
196
359
  /** The result of running an intent to completion (or fail-closed). */
197
360
  export interface RunResult {
198
361
  outcome: RunOutcome;
@@ -210,6 +373,12 @@ export interface RunResult {
210
373
  receipts: import('./authority.js').StepReceipt[];
211
374
  /** Set when `outcome === 'suspended'`: what to hand back to resume. */
212
375
  resumeToken?: string;
376
+ /** Spec 448 rule 4 — set when the run parked (`suspended`, `authority-required`): the digest of `plan`, which a
377
+ * plan-bound mandate for the resume must carry. A signer binds THIS, never a digest of a plan it rebuilt. */
378
+ planDigest?: string;
379
+ /** Spec 448 rule 5 — set when the run parked after reading text its principal did not write. A resume passes it back
380
+ * as `resume.untrustedSeen` (the host's checkpoint, never the caller's word): what tainted the run may not replay. */
381
+ untrustedSeen?: true;
213
382
  /** Set when `outcome === 'suspended'` because a tool asked the person for something (spec 350 §3.4).
214
383
  * The surface renders it; the answers come back as `RunIntentOpts.supplied` on the resume. */
215
384
  prompt?: import('./input.js').InputRequestV1;
@@ -227,10 +396,50 @@ export interface RunResult {
227
396
  };
228
397
  risk: import('./authority.js').ResolvedStep['risk'];
229
398
  args: Record<string, unknown>;
399
+ /** Spec 410 §7 — what the tool declares its inputs carry, so the requirement can name what the write may carry. */
400
+ carries?: ToolSpec['carries'];
401
+ /** Spec 421 W2 — whose words each argument came from (the planner's raw values, before resolution). */
402
+ derivation?: Record<string, import('./derivation.js').ArgDerivationV1>;
230
403
  };
404
+ /**
405
+ * RUN-7 (spec 445 W0) — COMPENSATIONS THE RUN OWES AND DID NOT PERFORM. A compensation is a step: it runs only if
406
+ * its tool is exposed and, when it exercises a capability, only under a verdict against a mandate that covers it.
407
+ * One that could not be judged is never run unverified and never dropped — it is named here (and on its own receipt,
408
+ * stepRef `<step>:compensate`), so the caller can obtain the authority and perform it. Present on any outcome whose
409
+ * unwinding left something undone; absent when nothing is owed.
410
+ */
411
+ /** @preview durable resume across turns is PREVIEW (docs/step-lifecycle.md, "Known issues").
412
+ * Set on a `suspended` result whose prompt is an effect-uncertain COMPENSATION: the run was ending and waits, mid-unwind,
413
+ * for the principal. The resume passes it back (`resume.unwinding`); no further step of the plan runs. */
414
+ unwinding?: UnwindingV1;
415
+ /** Set on a result that is not terminal: the steps that ran and must still be unwound if the run ends refused. Durable
416
+ * run state — a host keeps it with the checkpoint and hands it back on `resume.obligations`.
417
+ * @preview durable resume across turns is PREVIEW (docs/step-lifecycle.md, "Known issues"). */
418
+ obligations?: ObligationV1[];
419
+ compensationsOwed?: Array<{
420
+ /** `<forStepRef>:compensate` — the receipt that records it. */
421
+ stepRef: string;
422
+ /** The executed step this would unwind. */
423
+ forStepRef: string;
424
+ toolId: string;
425
+ capability?: {
426
+ id: string;
427
+ action: string;
428
+ resource?: string;
429
+ authority?: string;
430
+ };
431
+ risk: import('./authority.js').ResolvedStep['risk'];
432
+ /** The compensation's resolved arguments (from the original tool's result — data, to be judged, not trusted). */
433
+ args: Record<string, unknown>;
434
+ /** Why it did not run. */
435
+ /** `declaration-changed`: the step ran under a compensation its tool no longer declares (or declares differently) — it
436
+ * cannot be discharged automatically any more. */
437
+ reason: 'no-mandate' | 'not-authorized' | 'approval-required' | 'tool-not-exposed' | 'failed' | 'declaration-changed';
438
+ detail: string;
439
+ }>;
231
440
  }
232
441
  /** Stable error codes the loop / planners raise (fail-closed; never a silent empty success). */
233
- export type OrchestrationErrorCode = 'no_plan' | 'unknown_tool' | 'empty_plan' | 'max_steps' | 'planner_failed' | 'no_authority_port' | 'no_approval_port' | 'no_mandate_presented' | 'keyring_needs_selector' | 'fan_out_unbound' | 'fan_out_not_array' | 'fan_out_refused' | 'fan_out_over_limit';
442
+ export type OrchestrationErrorCode = 'no_plan' | 'reconcile_indeterminate' | 'unknown_tool' | 'empty_plan' | 'max_steps' | 'planner_failed' | 'no_authority_port' | 'no_approval_port' | 'no_policy_port' | 'no_approval_verifier' | 'no_mandate_presented' | 'keyring_needs_selector' | 'fan_out_unbound' | 'fan_out_not_array' | 'fan_out_refused' | 'resume_integrity' | 'effect_already_started' | 'fan_out_over_limit';
234
443
  export declare class OrchestrationError extends Error {
235
444
  readonly code: OrchestrationErrorCode;
236
445
  constructor(code: OrchestrationErrorCode, message: string);
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,EAAG,kCAA2C,CAAC;AACxE,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AACjD,eAAO,MAAM,QAAQ,EAAG,gCAAyC,CAAC;AAElE,sGAAsG;AACtG,MAAM,WAAW,MAAM;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