@oneie/sdk 0.17.5 → 0.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing.d.ts +244 -14
- package/dist/billing.d.ts.map +1 -1
- package/dist/billing.js +374 -55
- package/dist/billing.js.map +1 -1
- package/dist/broadcast.d.ts +1 -1
- package/dist/broadcast.d.ts.map +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8 -1
- package/dist/client.js.map +1 -1
- package/dist/evm-tx.d.ts +24 -0
- package/dist/evm-tx.d.ts.map +1 -0
- package/dist/evm-tx.js +128 -0
- package/dist/evm-tx.js.map +1 -0
- package/dist/generated/fn-map.d.ts +2 -2
- package/dist/generated/fn-map.d.ts.map +1 -1
- package/dist/generated/fn-map.js +32 -2
- package/dist/generated/fn-map.js.map +1 -1
- package/dist/generated/schemas/index.d.ts +2 -2
- package/dist/generated/schemas.d.ts +10 -10
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/meta.d.ts +13 -0
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +11 -0
- package/dist/meta.js.map +1 -1
- package/dist/prices/vendors.d.ts +7 -0
- package/dist/prices/vendors.d.ts.map +1 -0
- package/dist/prices/vendors.js +229 -0
- package/dist/prices/vendors.js.map +1 -0
- package/dist/prices.d.ts +41 -0
- package/dist/prices.d.ts.map +1 -0
- package/dist/prices.js +79 -0
- package/dist/prices.js.map +1 -0
- package/dist/proof-bar.d.ts +228 -0
- package/dist/proof-bar.d.ts.map +1 -0
- package/dist/proof-bar.js +252 -0
- package/dist/proof-bar.js.map +1 -0
- package/dist/receiver-layers.d.ts +52 -0
- package/dist/receiver-layers.d.ts.map +1 -1
- package/dist/receiver-layers.js +118 -5
- package/dist/receiver-layers.js.map +1 -1
- package/dist/receivers.d.ts +1311 -90
- package/dist/receivers.d.ts.map +1 -1
- package/dist/receivers.js +1568 -153
- package/dist/receivers.js.map +1 -1
- package/dist/secrets-give.d.ts +1 -1
- package/dist/secrets-give.d.ts.map +1 -1
- package/dist/secrets-give.js +1 -1
- package/dist/secrets-give.js.map +1 -1
- package/dist/secrets-list.d.ts +169 -0
- package/dist/secrets-list.d.ts.map +1 -0
- package/dist/secrets-list.js +13 -0
- package/dist/secrets-list.js.map +1 -0
- package/dist/secrets-one-vault.d.ts +33 -1
- package/dist/secrets-one-vault.d.ts.map +1 -1
- package/dist/secrets-one-vault.js +42 -2
- package/dist/secrets-one-vault.js.map +1 -1
- package/dist/secrets.d.ts +9 -0
- package/dist/secrets.d.ts.map +1 -1
- package/dist/secrets.js +12 -0
- package/dist/secrets.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/work-contract-grammar.json +64 -5
- package/dist/work-contract.d.ts +24 -0
- package/dist/work-contract.d.ts.map +1 -1
- package/dist/work-contract.js +60 -1
- package/dist/work-contract.js.map +1 -1
- package/package.json +14 -2
- package/src/generated/funs.json +1 -1
- package/dist/.build-fingerprint +0 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The proof bar: one spec, read by the web offer, the order's terms and `oneie prove`.
|
|
3
|
+
*
|
|
4
|
+
* text/escrow-compliance.md § 4 is the law this encodes: the buyer's named tasks, each with a
|
|
5
|
+
* written pass check; the same model and system prompt for both tools; at least 5 runs per task,
|
|
6
|
+
* medians reported; wall time, tokens as the provider billed them, success rate; thresholds chosen
|
|
7
|
+
* before payment. The claim and the refund trigger are the same objective fact, so ONE copy of it
|
|
8
|
+
* lives here and every surface imports it (the web offer re-exports it; the CLI bundles it).
|
|
9
|
+
*
|
|
10
|
+
* Pure: no I/O. `sha256Hex` uses WebCrypto, so it runs the same in a Worker, Node and Bun.
|
|
11
|
+
*/
|
|
12
|
+
/** The harness's version, part of every spec hash. Bump it when the runner, the token formula or
|
|
13
|
+
* the judge changes, so an old record can never read as comparable with a new one.
|
|
14
|
+
* /2 (2026-11-16): the crash rule — a run that exited non-zero or timed out is a FAILED run.
|
|
15
|
+
* /3 (2026-11-16): blame the side that failed — a silent or wrong CLI run is a failed CLI run; a
|
|
16
|
+
* broken MCP side is judged against the baseline fixed in the order, never a refund on its own.
|
|
17
|
+
* /4 (2026-11-16): the runner — pass checks run blind to the tool, a broken MCP is re-run once
|
|
18
|
+
* before the baseline is used, and the baseline counts only from ONE's record on its own machine.
|
|
19
|
+
* /5 (2026-11-16): the delivered spec hash (spec hash + accepted baseline record + CLI commands), the
|
|
20
|
+
* tool order shuffled per run and recorded, no run number given to a pass check.
|
|
21
|
+
* /6 (2026-11-16): the run conditions (model, system prompt hash, timeout) are in the spec hash; pass
|
|
22
|
+
* checks run in a per-run sandbox with a clean environment; the first recorded run counts. */
|
|
23
|
+
export declare const PROVE_HARNESS_VERSION = "oneie-prove/6";
|
|
24
|
+
/**
|
|
25
|
+
* Tokens as the provider billed them: every billed input kind plus output.
|
|
26
|
+
* Anthropic: input_tokens + cache_creation_input_tokens + cache_read_input_tokens + output_tokens.
|
|
27
|
+
* OpenAI: prompt_tokens + completion_tokens (cached prompt tokens are already inside prompt_tokens).
|
|
28
|
+
* A run that exited 0 and carries no usage is UNJUDGED, never zero. A run that crashed (non-zero exit
|
|
29
|
+
* or timeout) is a FAILED run: it counts against success and stays out of the wall and token medians.
|
|
30
|
+
*/
|
|
31
|
+
export declare const TOKEN_FORMULA = "anthropic: input_tokens + cache_creation_input_tokens + cache_read_input_tokens + output_tokens \u00B7 openai: prompt_tokens + completion_tokens";
|
|
32
|
+
/** The fewest named tasks a proof is run on. Fewer and one lucky task decides it. */
|
|
33
|
+
export declare const MIN_TASKS: 3;
|
|
34
|
+
/** The fewest runs per task per tool. A single run never decides a verdict. */
|
|
35
|
+
export declare const MIN_RUNS_PER_TASK: 5;
|
|
36
|
+
export type MetricKey = 'wall_ms' | 'tokens' | 'success';
|
|
37
|
+
export interface ProofMetric {
|
|
38
|
+
key: MetricKey;
|
|
39
|
+
label: string;
|
|
40
|
+
/** Which way is better. */
|
|
41
|
+
better: 'lower' | 'higher';
|
|
42
|
+
/** The bar in words, as the buyer agrees it. */
|
|
43
|
+
bar: string;
|
|
44
|
+
}
|
|
45
|
+
/** CLI against the buyer's own MCP, same tasks, same agent, same model. Agreed BEFORE payment. */
|
|
46
|
+
export declare const PROOF_METRICS: readonly ProofMetric[];
|
|
47
|
+
/** ONE's bar. ONE sets it on its own offer (the order records that ONE agreed it); a buyer supplies
|
|
48
|
+
* only their tasks and pass checks, never the thresholds. */
|
|
49
|
+
export declare const DEFAULT_PROOF_TERMS: {
|
|
50
|
+
readonly runsPerTask: 5;
|
|
51
|
+
/** CLI median wall time must be at most this fraction of the MCP's (1 = merely not slower; below 1 = faster). */
|
|
52
|
+
readonly maxWallRatio: 0.99;
|
|
53
|
+
/** CLI median tokens must be at most this fraction of the MCP's. */
|
|
54
|
+
readonly maxTokenRatio: 1;
|
|
55
|
+
/** CLI success rate must be at least this many percentage points of the MCP's (0 = no worse). */
|
|
56
|
+
readonly minSuccessDelta: 0;
|
|
57
|
+
};
|
|
58
|
+
export type ProofTerms = {
|
|
59
|
+
runsPerTask: number;
|
|
60
|
+
maxWallRatio: number;
|
|
61
|
+
maxTokenRatio: number;
|
|
62
|
+
minSuccessDelta: number;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* One run of one tool on one task. `tokens: null` = the run reported no usage. `crashed` = the tool
|
|
66
|
+
* exited non-zero or timed out: always a FAILED run, so a CLI that crashes can never escape the
|
|
67
|
+
* refund by printing nothing (row task:01a1e4165318b0f2a253a301).
|
|
68
|
+
*/
|
|
69
|
+
export interface Run {
|
|
70
|
+
task: string;
|
|
71
|
+
ms: number;
|
|
72
|
+
tokens: number | null;
|
|
73
|
+
ok: boolean;
|
|
74
|
+
crashed?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export declare function median(xs: readonly number[]): number;
|
|
77
|
+
export interface Verdict {
|
|
78
|
+
pass: boolean;
|
|
79
|
+
/** Why, per metric — the receipt the buyer reads. `mcp` is the baseline's number when basis is baseline. */
|
|
80
|
+
metrics: Array<{
|
|
81
|
+
key: MetricKey;
|
|
82
|
+
mcp: number;
|
|
83
|
+
cli: number;
|
|
84
|
+
pass: boolean;
|
|
85
|
+
}>;
|
|
86
|
+
/** Set when the runs cannot be judged at all — never read as a pass or a fail. */
|
|
87
|
+
unjudged?: string;
|
|
88
|
+
/** live = against this proof's own MCP runs; baseline = against the baseline fixed in the order. */
|
|
89
|
+
basis?: 'live' | 'baseline';
|
|
90
|
+
/** The buyer's MCP side failed during the proof (every run of a task failed, a silent run, or short runs). */
|
|
91
|
+
baselineBroken?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** The buyer's MCP, measured and judged BEFORE payment, and fixed into the order. */
|
|
94
|
+
export interface Baseline {
|
|
95
|
+
wall_ms: number;
|
|
96
|
+
tokens: number;
|
|
97
|
+
successPct: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Judge the buyer's MCP alone, BEFORE payment. Usable only when every task has the agreed runs, every
|
|
101
|
+
* run that exited 0 reported its usage, and every task succeeded at least once. An unusable baseline
|
|
102
|
+
* means no sale, never a refund.
|
|
103
|
+
*/
|
|
104
|
+
export declare function judgeBaseline(tasks: readonly string[], mcp: readonly Run[], terms?: ProofTerms): {
|
|
105
|
+
usable: true;
|
|
106
|
+
baseline: Baseline;
|
|
107
|
+
} | {
|
|
108
|
+
usable: false;
|
|
109
|
+
reason: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Judge a proof run. Pure: the numbers in, the verdict out. Blame the side that failed:
|
|
113
|
+
* - a CLI run that crashed, timed out or exited 0 with no usage is a FAILED CLI run (a refund can follow);
|
|
114
|
+
* - a broken MCP side (a task it never passed, a silent run, short runs) is judged against the
|
|
115
|
+
* `baseline` fixed in the order (basis: baseline), and with no baseline it is UNJUDGED with
|
|
116
|
+
* `baselineBroken` — never a fail, never a refund on its own.
|
|
117
|
+
* A run set that does not cover the agreed tasks with the CLI, or terms that let fewer than
|
|
118
|
+
* MIN_RUNS_PER_TASK runs decide, is UNJUDGED — an incomplete proof decides nothing.
|
|
119
|
+
*/
|
|
120
|
+
export declare function judgeProof(tasks: readonly string[], mcp: readonly Run[], cli: readonly Run[], terms?: ProofTerms, baseline?: Baseline): Verdict;
|
|
121
|
+
/** One named task as the order freezes it: its name and its written pass check. How it is RUN
|
|
122
|
+
* (the MCP and CLI commands) is not part of the bar — the CLI does not exist before payment. */
|
|
123
|
+
export interface ProofTask {
|
|
124
|
+
name: string;
|
|
125
|
+
passCheck: string;
|
|
126
|
+
}
|
|
127
|
+
/** What the order freezes and the spec hash covers: tasks + pass checks + thresholds + runs + harness. */
|
|
128
|
+
/**
|
|
129
|
+
* The run conditions: everything a run reads that could differ between two runs and that the harness
|
|
130
|
+
* can pin, in one record. In the spec hash, so a run on another model, system prompt or timeout is a
|
|
131
|
+
* run of another spec: refused against a baseline record, and never counted against an order.
|
|
132
|
+
* The machine is not here: a live comparison counts on any machine (both tools share it), and a
|
|
133
|
+
* baseline comparison checks the machine separately.
|
|
134
|
+
*/
|
|
135
|
+
export interface RunConditions {
|
|
136
|
+
/** The model id both tools run on (the billed model is checked on every run). */
|
|
137
|
+
model: string;
|
|
138
|
+
/** sha256 of the system prompt both tools run with. */
|
|
139
|
+
systemPromptSha256: string;
|
|
140
|
+
/** The per-run timeout, ms; a run past it is killed and is a failed run. */
|
|
141
|
+
timeoutMs: number;
|
|
142
|
+
}
|
|
143
|
+
/** What the order freezes and the spec hash covers: tasks + pass checks + thresholds + runs + harness + run conditions. */
|
|
144
|
+
export interface ProofBarSpec {
|
|
145
|
+
tasks: readonly ProofTask[];
|
|
146
|
+
terms: ProofTerms;
|
|
147
|
+
harnessVersion: string;
|
|
148
|
+
conditions: RunConditions;
|
|
149
|
+
}
|
|
150
|
+
export declare const MIN_TIMEOUT_MS = 1000;
|
|
151
|
+
export declare const MAX_TIMEOUT_MS = 3600000;
|
|
152
|
+
/** Why a spec cannot be frozen, or [] when it can. */
|
|
153
|
+
export declare function proofBarProblems(spec: ProofBarSpec): string[];
|
|
154
|
+
/**
|
|
155
|
+
* The canonical text of a spec. Built field by field in a fixed order, tasks sorted by name, so a
|
|
156
|
+
* buyer's spec file with reordered keys or tasks hashes the same as ONE's. Never JSON.stringify a
|
|
157
|
+
* parsed spec as given.
|
|
158
|
+
*/
|
|
159
|
+
export declare function canonicalProofBar(spec: ProofBarSpec): string;
|
|
160
|
+
/** SHA-256 of a UTF-8 string, lowercase hex. The same as the market's `sha256` (identity/ladder.ts). */
|
|
161
|
+
export declare function sha256Hex(value: string): Promise<string>;
|
|
162
|
+
/** The spec hash the order freezes and every proof record carries. */
|
|
163
|
+
export declare function specHash(spec: ProofBarSpec): Promise<string>;
|
|
164
|
+
/** One CLI command, delivered with the CLI. The MCP commands are the buyer's and live in the baseline record. */
|
|
165
|
+
export interface CliCommand {
|
|
166
|
+
name: string;
|
|
167
|
+
cli: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The delivered spec hash: the order's spec hash, the accepted baseline record's hash (which carries
|
|
171
|
+
* the buyer's MCP commands, fixed at acceptance) and the CLI commands delivered with the CLI. Chained,
|
|
172
|
+
* so it cannot drift from the order; the MCP side is taken from the accepted baseline, never from what
|
|
173
|
+
* ONE sends at delivery.
|
|
174
|
+
*/
|
|
175
|
+
export declare function deliveredSpecHash(specHashHex: string, baselineRecordSha256: string, cli: readonly CliCommand[]): Promise<string>;
|
|
176
|
+
/** What a re-run is checked against: from the order (spec, harness, baseline) and the delivery (commands). */
|
|
177
|
+
export interface ReRunBinding {
|
|
178
|
+
specHash: string;
|
|
179
|
+
harnessVersion: string;
|
|
180
|
+
baselineRecordSha256: string;
|
|
181
|
+
baselineMachineId: string;
|
|
182
|
+
deliveredSpecHash: string;
|
|
183
|
+
}
|
|
184
|
+
/** What a re-run's record carries (`oneie prove` record.json), as far as the binding reads it. */
|
|
185
|
+
export interface ReRunRecord {
|
|
186
|
+
specHash: string;
|
|
187
|
+
harnessVersion: string;
|
|
188
|
+
baselineRecordSha256: string | null;
|
|
189
|
+
deliveredSpecHash: string | null;
|
|
190
|
+
machineId: string;
|
|
191
|
+
verdict: {
|
|
192
|
+
pass: boolean;
|
|
193
|
+
unjudged?: string;
|
|
194
|
+
basis?: 'live' | 'baseline';
|
|
195
|
+
};
|
|
196
|
+
attempts: ReadonlyArray<{
|
|
197
|
+
log: {
|
|
198
|
+
sha256: string;
|
|
199
|
+
};
|
|
200
|
+
}>;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Does a re-run count? Only when it names the order's spec hash and harness, the accepted baseline
|
|
204
|
+
* record, the delivered commands (so neither side's commands were swapped), ships the log of every
|
|
205
|
+
* attempt with the hash its record states, and was judged. A comparison against the baseline counts
|
|
206
|
+
* only on the machine that baseline names; a live comparison counts on any machine, because both tools
|
|
207
|
+
* ran on the same one.
|
|
208
|
+
*/
|
|
209
|
+
export declare function reRunCounts(b: ReRunBinding, rec: ReRunRecord, logs: readonly string[]): Promise<{
|
|
210
|
+
counts: true;
|
|
211
|
+
pass: boolean;
|
|
212
|
+
} | {
|
|
213
|
+
counts: false;
|
|
214
|
+
reason: string;
|
|
215
|
+
}>;
|
|
216
|
+
/**
|
|
217
|
+
* The first recorded counts. One buyer re-run per order, and one review run of ONE's: whichever was
|
|
218
|
+
* recorded first (by its own time; a tie broken by id, so by neither side) is the one that counts.
|
|
219
|
+
* Every later record is kept and reported as recorded and not counted, never dropped.
|
|
220
|
+
*/
|
|
221
|
+
export declare function firstRecorded<T extends {
|
|
222
|
+
at: number;
|
|
223
|
+
id: string;
|
|
224
|
+
}>(records: readonly T[]): {
|
|
225
|
+
counts: T | null;
|
|
226
|
+
recorded: T[];
|
|
227
|
+
};
|
|
228
|
+
//# sourceMappingURL=proof-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAA;IAC1E,QAAQ,EAAE,aAAa,CAAC;QAAE,GAAG,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,CAAA;CACrD;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAY1K;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG;IAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,CAAC,EAAE,CAAA;CAAE,CAG9H"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The proof bar: one spec, read by the web offer, the order's terms and `oneie prove`.
|
|
3
|
+
*
|
|
4
|
+
* text/escrow-compliance.md § 4 is the law this encodes: the buyer's named tasks, each with a
|
|
5
|
+
* written pass check; the same model and system prompt for both tools; at least 5 runs per task,
|
|
6
|
+
* medians reported; wall time, tokens as the provider billed them, success rate; thresholds chosen
|
|
7
|
+
* before payment. The claim and the refund trigger are the same objective fact, so ONE copy of it
|
|
8
|
+
* lives here and every surface imports it (the web offer re-exports it; the CLI bundles it).
|
|
9
|
+
*
|
|
10
|
+
* Pure: no I/O. `sha256Hex` uses WebCrypto, so it runs the same in a Worker, Node and Bun.
|
|
11
|
+
*/
|
|
12
|
+
/** The harness's version, part of every spec hash. Bump it when the runner, the token formula or
|
|
13
|
+
* the judge changes, so an old record can never read as comparable with a new one.
|
|
14
|
+
* /2 (2026-11-16): the crash rule — a run that exited non-zero or timed out is a FAILED run.
|
|
15
|
+
* /3 (2026-11-16): blame the side that failed — a silent or wrong CLI run is a failed CLI run; a
|
|
16
|
+
* broken MCP side is judged against the baseline fixed in the order, never a refund on its own.
|
|
17
|
+
* /4 (2026-11-16): the runner — pass checks run blind to the tool, a broken MCP is re-run once
|
|
18
|
+
* before the baseline is used, and the baseline counts only from ONE's record on its own machine.
|
|
19
|
+
* /5 (2026-11-16): the delivered spec hash (spec hash + accepted baseline record + CLI commands), the
|
|
20
|
+
* tool order shuffled per run and recorded, no run number given to a pass check.
|
|
21
|
+
* /6 (2026-11-16): the run conditions (model, system prompt hash, timeout) are in the spec hash; pass
|
|
22
|
+
* checks run in a per-run sandbox with a clean environment; the first recorded run counts. */
|
|
23
|
+
export const PROVE_HARNESS_VERSION = 'oneie-prove/6';
|
|
24
|
+
/**
|
|
25
|
+
* Tokens as the provider billed them: every billed input kind plus output.
|
|
26
|
+
* Anthropic: input_tokens + cache_creation_input_tokens + cache_read_input_tokens + output_tokens.
|
|
27
|
+
* OpenAI: prompt_tokens + completion_tokens (cached prompt tokens are already inside prompt_tokens).
|
|
28
|
+
* A run that exited 0 and carries no usage is UNJUDGED, never zero. A run that crashed (non-zero exit
|
|
29
|
+
* or timeout) is a FAILED run: it counts against success and stays out of the wall and token medians.
|
|
30
|
+
*/
|
|
31
|
+
export const TOKEN_FORMULA = 'anthropic: input_tokens + cache_creation_input_tokens + cache_read_input_tokens + output_tokens · openai: prompt_tokens + completion_tokens';
|
|
32
|
+
/** The fewest named tasks a proof is run on. Fewer and one lucky task decides it. */
|
|
33
|
+
export const MIN_TASKS = 3;
|
|
34
|
+
/** The fewest runs per task per tool. A single run never decides a verdict. */
|
|
35
|
+
export const MIN_RUNS_PER_TASK = 5;
|
|
36
|
+
/** CLI against the buyer's own MCP, same tasks, same agent, same model. Agreed BEFORE payment. */
|
|
37
|
+
export const PROOF_METRICS = [
|
|
38
|
+
{ key: 'wall_ms', label: 'Wall time', better: 'lower', bar: "The CLI's median time over all runs is lower than the MCP's" },
|
|
39
|
+
{ key: 'tokens', label: 'Tokens', better: 'lower', bar: "The CLI's median tokens per run are no more than the MCP's" },
|
|
40
|
+
{ key: 'success', label: 'Success rate', better: 'higher', bar: 'The CLI completes at least as many runs as the MCP' },
|
|
41
|
+
];
|
|
42
|
+
/** ONE's bar. ONE sets it on its own offer (the order records that ONE agreed it); a buyer supplies
|
|
43
|
+
* only their tasks and pass checks, never the thresholds. */
|
|
44
|
+
export const DEFAULT_PROOF_TERMS = {
|
|
45
|
+
runsPerTask: MIN_RUNS_PER_TASK,
|
|
46
|
+
/** CLI median wall time must be at most this fraction of the MCP's (1 = merely not slower; below 1 = faster). */
|
|
47
|
+
maxWallRatio: 0.99,
|
|
48
|
+
/** CLI median tokens must be at most this fraction of the MCP's. */
|
|
49
|
+
maxTokenRatio: 1,
|
|
50
|
+
/** CLI success rate must be at least this many percentage points of the MCP's (0 = no worse). */
|
|
51
|
+
minSuccessDelta: 0,
|
|
52
|
+
};
|
|
53
|
+
export function median(xs) {
|
|
54
|
+
if (xs.length === 0)
|
|
55
|
+
return NaN;
|
|
56
|
+
const s = [...xs].sort((a, b) => a - b);
|
|
57
|
+
const m = Math.floor(s.length / 2);
|
|
58
|
+
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
|
|
59
|
+
}
|
|
60
|
+
const failCrash = (r) => (r.crashed ? { ...r, ok: false } : r);
|
|
61
|
+
const okMs = (rs) => rs.filter((r) => r.ok).map((r) => r.ms);
|
|
62
|
+
const billedOf = (rs) => rs.filter((r) => !r.crashed && r.tokens !== null).map((r) => r.tokens);
|
|
63
|
+
const rateOf = (rs) => (rs.length ? (100 * rs.filter((r) => r.ok).length) / rs.length : 0);
|
|
64
|
+
/** Why an MCP run set cannot stand as a baseline, or null when it can. */
|
|
65
|
+
function mcpBroken(tasks, mcp, runsPerTask) {
|
|
66
|
+
for (const t of tasks) {
|
|
67
|
+
const rs = mcp.filter((r) => r.task === t).map(failCrash);
|
|
68
|
+
if (rs.length < runsPerTask)
|
|
69
|
+
return `task "${t}" has ${rs.length} usable MCP runs; the terms need ${runsPerTask}`;
|
|
70
|
+
if (rs.some((r) => !r.crashed && r.tokens === null))
|
|
71
|
+
return `an MCP run of task "${t}" exited 0 but reported no usage`;
|
|
72
|
+
if (!rs.some((r) => r.ok))
|
|
73
|
+
return `the MCP failed every run of task "${t}"`;
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Judge the buyer's MCP alone, BEFORE payment. Usable only when every task has the agreed runs, every
|
|
79
|
+
* run that exited 0 reported its usage, and every task succeeded at least once. An unusable baseline
|
|
80
|
+
* means no sale, never a refund.
|
|
81
|
+
*/
|
|
82
|
+
export function judgeBaseline(tasks, mcp, terms = DEFAULT_PROOF_TERMS) {
|
|
83
|
+
if (tasks.length < MIN_TASKS)
|
|
84
|
+
return { usable: false, reason: `needs ${MIN_TASKS} named tasks, got ${tasks.length}` };
|
|
85
|
+
if (!(terms.runsPerTask >= MIN_RUNS_PER_TASK))
|
|
86
|
+
return { usable: false, reason: `the terms need at least ${MIN_RUNS_PER_TASK} runs per task` };
|
|
87
|
+
const broken = mcpBroken(tasks, mcp, terms.runsPerTask);
|
|
88
|
+
if (broken)
|
|
89
|
+
return { usable: false, reason: broken };
|
|
90
|
+
const m = mcp.filter((r) => tasks.includes(r.task)).map(failCrash);
|
|
91
|
+
return { usable: true, baseline: { wall_ms: median(okMs(m)), tokens: median(billedOf(m)), successPct: rateOf(m) } };
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Judge a proof run. Pure: the numbers in, the verdict out. Blame the side that failed:
|
|
95
|
+
* - a CLI run that crashed, timed out or exited 0 with no usage is a FAILED CLI run (a refund can follow);
|
|
96
|
+
* - a broken MCP side (a task it never passed, a silent run, short runs) is judged against the
|
|
97
|
+
* `baseline` fixed in the order (basis: baseline), and with no baseline it is UNJUDGED with
|
|
98
|
+
* `baselineBroken` — never a fail, never a refund on its own.
|
|
99
|
+
* A run set that does not cover the agreed tasks with the CLI, or terms that let fewer than
|
|
100
|
+
* MIN_RUNS_PER_TASK runs decide, is UNJUDGED — an incomplete proof decides nothing.
|
|
101
|
+
*/
|
|
102
|
+
export function judgeProof(tasks, mcp, cli, terms = DEFAULT_PROOF_TERMS, baseline) {
|
|
103
|
+
if (tasks.length < MIN_TASKS)
|
|
104
|
+
return { pass: false, metrics: [], unjudged: `needs ${MIN_TASKS} named tasks, got ${tasks.length}` };
|
|
105
|
+
if (!(terms.runsPerTask >= MIN_RUNS_PER_TASK))
|
|
106
|
+
return { pass: false, metrics: [], unjudged: `the terms need at least ${MIN_RUNS_PER_TASK} runs per task, got ${terms.runsPerTask}` };
|
|
107
|
+
for (const t of tasks) {
|
|
108
|
+
const c = cli.filter((r) => r.task === t).length;
|
|
109
|
+
if (c < terms.runsPerTask)
|
|
110
|
+
return { pass: false, metrics: [], unjudged: `task "${t}" has ${c} CLI runs; the terms need ${terms.runsPerTask}` };
|
|
111
|
+
}
|
|
112
|
+
const inTasks = (r) => tasks.includes(r.task);
|
|
113
|
+
// A CLI run that crashed or exited 0 with no usage is a failed CLI run, out of the medians.
|
|
114
|
+
const c = cli.filter(inTasks).map((r) => (r.crashed || r.tokens === null ? { ...r, ok: false, crashed: true } : r));
|
|
115
|
+
const cliWall = median(okMs(c));
|
|
116
|
+
const cliTok = median(billedOf(c));
|
|
117
|
+
const cliRate = rateOf(c);
|
|
118
|
+
const broken = mcpBroken(tasks, mcp, terms.runsPerTask);
|
|
119
|
+
let ref;
|
|
120
|
+
let basis;
|
|
121
|
+
if (!broken) {
|
|
122
|
+
const m = mcp.filter(inTasks).map(failCrash);
|
|
123
|
+
ref = { wall_ms: median(okMs(m)), tokens: median(billedOf(m)), successPct: rateOf(m) };
|
|
124
|
+
basis = 'live';
|
|
125
|
+
}
|
|
126
|
+
else if (baseline) {
|
|
127
|
+
ref = baseline;
|
|
128
|
+
basis = 'baseline';
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return { pass: false, metrics: [], unjudged: `the buyer's MCP baseline is broken (${broken}) and no baseline is fixed in the order`, baselineBroken: true };
|
|
132
|
+
}
|
|
133
|
+
const metrics = [
|
|
134
|
+
{ key: 'wall_ms', mcp: ref.wall_ms, cli: cliWall, pass: Number.isFinite(cliWall) && Number.isFinite(ref.wall_ms) && cliWall <= ref.wall_ms * terms.maxWallRatio },
|
|
135
|
+
{ key: 'tokens', mcp: ref.tokens, cli: cliTok, pass: cliTok <= ref.tokens * terms.maxTokenRatio },
|
|
136
|
+
{ key: 'success', mcp: ref.successPct, cli: cliRate, pass: cliRate - ref.successPct >= terms.minSuccessDelta },
|
|
137
|
+
];
|
|
138
|
+
return { pass: metrics.every((x) => x.pass), metrics, basis, ...(broken ? { baselineBroken: true } : {}) };
|
|
139
|
+
}
|
|
140
|
+
export const MIN_TIMEOUT_MS = 1_000;
|
|
141
|
+
export const MAX_TIMEOUT_MS = 3_600_000;
|
|
142
|
+
/** Why a spec cannot be frozen, or [] when it can. */
|
|
143
|
+
export function proofBarProblems(spec) {
|
|
144
|
+
const out = [];
|
|
145
|
+
if (spec.tasks.length < MIN_TASKS)
|
|
146
|
+
out.push(`needs ${MIN_TASKS} named tasks, got ${spec.tasks.length}`);
|
|
147
|
+
const names = spec.tasks.map((t) => t.name);
|
|
148
|
+
if (names.some((n) => !n || !n.trim()))
|
|
149
|
+
out.push('every task needs a name');
|
|
150
|
+
if (new Set(names).size !== names.length)
|
|
151
|
+
out.push('task names must be unique');
|
|
152
|
+
if (spec.tasks.some((t) => !t.passCheck || !t.passCheck.trim()))
|
|
153
|
+
out.push('every task needs a written pass check');
|
|
154
|
+
const runs = spec.terms.runsPerTask;
|
|
155
|
+
if (!(Number.isInteger(runs) && runs >= MIN_RUNS_PER_TASK && runs <= 100))
|
|
156
|
+
out.push(`runs per task must be a whole number of at least ${MIN_RUNS_PER_TASK} and at most 100, got ${runs}`);
|
|
157
|
+
for (const k of ['maxWallRatio', 'maxTokenRatio']) {
|
|
158
|
+
const v = spec.terms[k];
|
|
159
|
+
if (!(Number.isFinite(v) && v > 0 && v <= 10))
|
|
160
|
+
out.push(`terms.${k} must be above 0 and at most 10, got ${v}`);
|
|
161
|
+
}
|
|
162
|
+
const d = spec.terms.minSuccessDelta;
|
|
163
|
+
if (!(Number.isFinite(d) && d >= -100 && d <= 100))
|
|
164
|
+
out.push(`terms.minSuccessDelta must be from -100 to 100, got ${d}`);
|
|
165
|
+
if (!spec.harnessVersion)
|
|
166
|
+
out.push('harnessVersion is required');
|
|
167
|
+
const c = spec.conditions;
|
|
168
|
+
if (!c || typeof c.model !== 'string' || !c.model.trim())
|
|
169
|
+
out.push('conditions.model is required (the model id both tools run on)');
|
|
170
|
+
if (!/^[0-9a-f]{64}$/.test(String(c?.systemPromptSha256 ?? '')))
|
|
171
|
+
out.push('conditions.systemPromptSha256 must be the 64-hex sha256 of the system prompt');
|
|
172
|
+
const to = c?.timeoutMs;
|
|
173
|
+
if (!(Number.isInteger(to) && to >= MIN_TIMEOUT_MS && to <= MAX_TIMEOUT_MS))
|
|
174
|
+
out.push(`conditions.timeoutMs must be a whole number of ms from ${MIN_TIMEOUT_MS} to ${MAX_TIMEOUT_MS}, got ${to}`);
|
|
175
|
+
return out;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The canonical text of a spec. Built field by field in a fixed order, tasks sorted by name, so a
|
|
179
|
+
* buyer's spec file with reordered keys or tasks hashes the same as ONE's. Never JSON.stringify a
|
|
180
|
+
* parsed spec as given.
|
|
181
|
+
*/
|
|
182
|
+
export function canonicalProofBar(spec) {
|
|
183
|
+
const tasks = [...spec.tasks].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0)).map((t) => [t.name, t.passCheck]);
|
|
184
|
+
return JSON.stringify([
|
|
185
|
+
['harnessVersion', spec.harnessVersion],
|
|
186
|
+
['runsPerTask', spec.terms.runsPerTask],
|
|
187
|
+
['maxWallRatio', spec.terms.maxWallRatio],
|
|
188
|
+
['maxTokenRatio', spec.terms.maxTokenRatio],
|
|
189
|
+
['minSuccessDelta', spec.terms.minSuccessDelta],
|
|
190
|
+
['model', spec.conditions.model],
|
|
191
|
+
['systemPromptSha256', spec.conditions.systemPromptSha256],
|
|
192
|
+
['timeoutMs', spec.conditions.timeoutMs],
|
|
193
|
+
['tasks', tasks],
|
|
194
|
+
]);
|
|
195
|
+
}
|
|
196
|
+
/** SHA-256 of a UTF-8 string, lowercase hex. The same as the market's `sha256` (identity/ladder.ts). */
|
|
197
|
+
export async function sha256Hex(value) {
|
|
198
|
+
const hash = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(value));
|
|
199
|
+
return Array.from(new Uint8Array(hash)).map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
200
|
+
}
|
|
201
|
+
/** The spec hash the order freezes and every proof record carries. */
|
|
202
|
+
export function specHash(spec) {
|
|
203
|
+
return sha256Hex(canonicalProofBar(spec));
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* The delivered spec hash: the order's spec hash, the accepted baseline record's hash (which carries
|
|
207
|
+
* the buyer's MCP commands, fixed at acceptance) and the CLI commands delivered with the CLI. Chained,
|
|
208
|
+
* so it cannot drift from the order; the MCP side is taken from the accepted baseline, never from what
|
|
209
|
+
* ONE sends at delivery.
|
|
210
|
+
*/
|
|
211
|
+
export function deliveredSpecHash(specHashHex, baselineRecordSha256, cli) {
|
|
212
|
+
const cmds = [...cli].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0)).map((c) => [c.name, c.cli]);
|
|
213
|
+
return sha256Hex(JSON.stringify(['delivered', specHashHex, baselineRecordSha256, cmds]));
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Does a re-run count? Only when it names the order's spec hash and harness, the accepted baseline
|
|
217
|
+
* record, the delivered commands (so neither side's commands were swapped), ships the log of every
|
|
218
|
+
* attempt with the hash its record states, and was judged. A comparison against the baseline counts
|
|
219
|
+
* only on the machine that baseline names; a live comparison counts on any machine, because both tools
|
|
220
|
+
* ran on the same one.
|
|
221
|
+
*/
|
|
222
|
+
export async function reRunCounts(b, rec, logs) {
|
|
223
|
+
if (rec.specHash !== b.specHash)
|
|
224
|
+
return { counts: false, reason: "the re-run was made for another spec than the order's" };
|
|
225
|
+
if (rec.harnessVersion !== b.harnessVersion)
|
|
226
|
+
return { counts: false, reason: `the re-run was made by ${rec.harnessVersion}, not ${b.harnessVersion}` };
|
|
227
|
+
if (rec.baselineRecordSha256 !== b.baselineRecordSha256)
|
|
228
|
+
return { counts: false, reason: 'the re-run does not name the baseline record accepted in the order' };
|
|
229
|
+
if (rec.deliveredSpecHash !== b.deliveredSpecHash)
|
|
230
|
+
return { counts: false, reason: 'the re-run did not run the delivered commands (its delivered spec hash differs)' };
|
|
231
|
+
if (!rec.attempts.length || logs.length !== rec.attempts.length)
|
|
232
|
+
return { counts: false, reason: 'the re-run must ship the log of every attempt' };
|
|
233
|
+
for (let i = 0; i < logs.length; i++) {
|
|
234
|
+
if ((await sha256Hex(logs[i])) !== rec.attempts[i].log.sha256)
|
|
235
|
+
return { counts: false, reason: `the log of attempt ${i + 1} does not hash to what its record says` };
|
|
236
|
+
}
|
|
237
|
+
if (rec.verdict.unjudged)
|
|
238
|
+
return { counts: false, reason: `the re-run is unjudged: ${rec.verdict.unjudged}` };
|
|
239
|
+
if (rec.verdict.basis === 'baseline' && rec.machineId !== b.baselineMachineId)
|
|
240
|
+
return { counts: false, reason: 'a comparison against the baseline counts only on the machine that baseline names' };
|
|
241
|
+
return { counts: true, pass: rec.verdict.pass };
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The first recorded counts. One buyer re-run per order, and one review run of ONE's: whichever was
|
|
245
|
+
* recorded first (by its own time; a tie broken by id, so by neither side) is the one that counts.
|
|
246
|
+
* Every later record is kept and reported as recorded and not counted, never dropped.
|
|
247
|
+
*/
|
|
248
|
+
export function firstRecorded(records) {
|
|
249
|
+
const sorted = [...records].sort((a, b) => a.at - b.at || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
250
|
+
return { counts: sorted[0] ?? null, recorded: sorted.slice(1) };
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=proof-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof-bar.js","sourceRoot":"","sources":["../src/proof-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;+FAU+F;AAC/F,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,6IAA6I,CAAA;AAE/I,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAU,CAAA;AAEnC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAU,CAAA;AAa3C,kGAAkG;AAClG,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,6DAA6D,EAAE;IAC3H,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,4DAA4D,EAAE;IACtH,E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AC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnG,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AACjE,CAAC"}
|
|
@@ -24,6 +24,58 @@ export interface NamespaceLaw {
|
|
|
24
24
|
why: string;
|
|
25
25
|
}
|
|
26
26
|
export declare const RECEIVER_LAYERS: Readonly<Record<string, NamespaceLaw>>;
|
|
27
|
+
/**
|
|
28
|
+
* The generic doors — one exported list, the table in text/receivers.md
|
|
29
|
+
* § The language, row for row (job → door[]). `meta:catalog` leads with these
|
|
30
|
+
* and `did_you_mean` names the one for an unknown name's noun. The test
|
|
31
|
+
* `generic-doors.test.ts` parses that table and fails when it and this list
|
|
32
|
+
* disagree, so the list lives here and nowhere else.
|
|
33
|
+
*/
|
|
34
|
+
export declare const GENERIC_DOORS: ReadonlyArray<{
|
|
35
|
+
job: string;
|
|
36
|
+
doors: readonly string[];
|
|
37
|
+
}>;
|
|
38
|
+
/** Every generic door in table order, with the job it does. */
|
|
39
|
+
export declare const GENERIC_DOOR_LIST: ReadonlyArray<{
|
|
40
|
+
door: string;
|
|
41
|
+
job: string;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* The verb vocabulary — one meaning per verb, the fenced block in text/receivers.md
|
|
45
|
+
* § The language, exactly (deliverable 15). A new receiver `<noun>:<verb>` uses one of
|
|
46
|
+
* these; a verb outside the list needs a reviewed line saying what transition it guards,
|
|
47
|
+
* and that line goes into the doc block and this export together. The test
|
|
48
|
+
* `verb-vocabulary.test.ts` parses the block and fails when it and this list differ, and
|
|
49
|
+
* fails on any receiver whose verb (text after the first colon) is neither here nor on
|
|
50
|
+
* `verb-baseline.json`, a list that may only shrink.
|
|
51
|
+
*/
|
|
52
|
+
export declare const VERBS: Readonly<Record<string, string>>;
|
|
53
|
+
/**
|
|
54
|
+
* Receiver renames: the one-release alias for a name moved onto a vocabulary verb
|
|
55
|
+
* (ruled 2026-11-19, eng-director, on the verb-vocabulary red).
|
|
56
|
+
*
|
|
57
|
+
* Not `canonical:`. That field points one DECLARED duplicate at another, and both stay
|
|
58
|
+
* in RECEIVERS. A renamed name is gone from RECEIVERS: the registry holds only real
|
|
59
|
+
* names, so an alias is never offered to chat, MCP or the catalog. The ask door and
|
|
60
|
+
* `dispatchReceiver` read this map. They call the new receiver with `data` merged over
|
|
61
|
+
* the caller's payload (the name wins, as an instance patch does), and the ask door
|
|
62
|
+
* answers with `deprecated: { name, use }` so the caller learns the new name.
|
|
63
|
+
*
|
|
64
|
+
* The guard is `one.ie/web/tests/unit/receivers/receiver-renames.test.ts`: every target
|
|
65
|
+
* is declared and its verb is in VERBS, no old name is declared, and no alias points at
|
|
66
|
+
* another alias. Remove an entry one release after it lands.
|
|
67
|
+
*/
|
|
68
|
+
export interface ReceiverRename {
|
|
69
|
+
/** The declared receiver the old name now reaches. */
|
|
70
|
+
readonly to: string;
|
|
71
|
+
/** Fields the old name implied (a view, a kind), merged over the caller's payload. */
|
|
72
|
+
readonly data?: Readonly<Record<string, unknown>>;
|
|
73
|
+
/** The day the old name became an alias. */
|
|
74
|
+
readonly since: string;
|
|
75
|
+
}
|
|
76
|
+
export declare const RECEIVER_RENAMES: Readonly<Record<string, ReceiverRename>>;
|
|
77
|
+
/** The rename for a receiver name, or null when the name was never renamed. */
|
|
78
|
+
export declare function resolveRename(name: string): ReceiverRename | null;
|
|
27
79
|
export declare const NAMESPACE_TWINS: ReadonlyArray<{
|
|
28
80
|
pair: readonly [string, string];
|
|
29
81
|
newGoTo: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receiver-layers.d.ts","sourceRoot":"","sources":["../src/receiver-layers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,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