@northtalk/ts 0.5.1 → 0.7.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.
- package/{binary-value-xvJoGg0C.d.ts → binary-value-M8v567iA.d.ts} +1 -1
- package/{checker-CUhn2XaM.js → checker-Coml0Tf9.js} +581 -71
- package/{core-BuTAYRm-.d.ts → core-D4qYURer.d.ts} +1 -1
- package/{debug-DRhMZAxw.d.ts → debug-C_Ob5rkl.d.ts} +137 -12
- package/debug.d.ts +1 -1
- package/debug.js +1 -1
- package/{driver-CHDcuqUy.d.ts → driver-CLi_OmyQ.d.ts} +1 -1
- package/driver.d.ts +1 -1
- package/driver.js +1 -1
- package/encoding-BL2ECJmg.js +338 -0
- package/{engine-Cc3yofGM.d.ts → engine-BBNHy4-F.d.ts} +2 -2
- package/{engine-CXf5FCwi.js → engine-DhBk0lTt.js} +6 -6
- package/{errors-D11zizZg.js → errors-P3ga1I-9.js} +124 -21
- package/{group-BflSou2n.js → group-BqccKTWz.js} +406 -75
- package/{http-fetch-DFwVIOQg.js → http-fetch-DA-NbFIM.js} +2 -2
- package/http.d.ts +1 -1
- package/http.js +5 -5
- package/index-CBuczWK0.d.ts +9 -0
- package/index.d.ts +6 -12
- package/index.js +15 -14
- package/{inline-grants-XbX9HL_w.js → inline-grants-BT2nnfLA.js} +4 -5
- package/{lean-BebPaTMK.js → lean-BJmLobmd.js} +13 -8
- package/{lean-CjWVuOrC.d.ts → lean-CFLJ9VrX.d.ts} +155 -6
- package/lean.d.ts +5 -6
- package/lean.js +15 -14
- package/{manifest-CCfpn0kC.js → manifest-37x-HSxH.js} +4 -3
- package/message-layer.d.ts +2 -2
- package/message-layer.js +2 -2
- package/notify.d.ts +1 -1
- package/notify.js +1 -1
- package/{objects-DmUc0lha.js → objects-DE6kRk0r.js} +1 -1
- package/{objects-DC6HjzBY.d.ts → objects-DVlpWsi0.d.ts} +11 -3
- package/{operations-DnCcztkZ.js → operations-CGjDlkGU.js} +73 -15
- package/package.json +5 -1
- package/peer-capability-elnbQy-J.js +149 -0
- package/peer.d.ts +173 -0
- package/peer.js +542 -0
- package/{readers-MmyZ_d0w.d.ts → readers-ChQ0e92c.d.ts} +1 -1
- package/{readers-CsvlahLi.js → readers-yMS1eAOp.js} +1 -1
- package/{request-pump-binary-oqjWFqZA.js → request-pump-binary-BS1J8DF2.js} +4 -4
- package/{router-BZ-aYeXA.js → router-Bm7A2kjt.js} +4 -4
- package/{router-D56rSkU8.d.ts → router-D0rf5SkW.d.ts} +2 -2
- package/session.d.ts +2 -2
- package/session.js +65 -17
- package/setup.d.ts +3 -2
- package/setup.js +13 -16
- package/sqlite.d.ts +2 -2
- package/sqlite.js +5 -5
- package/{store-DHlo6fP5.js → store-D80OlpyG.js} +2 -2
- package/store-capability-DBLlWaNO.js +187 -0
- package/store.d.ts +2 -2
- package/store.js +2 -2
- package/{user-capability-BcRQyyEw.js → user-capability-D6hGa3eF.js} +3 -4
- package/wasm.d.ts +16 -7
- package/wasm.js +52 -23
- package/encoding-RUuES_e4.js +0 -99
- package/manifest-DVrx-pT2.d.ts +0 -122
- package/store-capability-BrUUAwVS.js +0 -389
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { L as nothing, N as map, Q as text, T as instant, i as ScriptError, t as HostError, u as bool } from "./errors-D11zizZg.js";
|
|
3
|
-
import { St as validComputedMessageName, dt as errorMessages, i as arithmetic, n as ScriptError$1, vt as defineValueCapability, xt as shape } from "./operations-DnCcztkZ.js";
|
|
4
|
-
import { r as registerStandardChecks } from "./encoding-RUuES_e4.js";
|
|
5
|
-
//#region src/standard-capabilities.ts
|
|
6
|
-
const costOf = (costs, name) => {
|
|
7
|
-
const cost = costs && Object.hasOwn(costs, name) ? costs[name] : void 0;
|
|
8
|
-
if (!cost || !Number.isSafeInteger(cost.fuel) || cost.fuel < 0 || cost.alloc !== void 0 && (!Number.isSafeInteger(cost.alloc) || cost.alloc < 0)) throw new HostError("invalid value", `Invalid or missing cost for ${name}`);
|
|
9
|
-
return Object.freeze({
|
|
10
|
-
fuel: cost.fuel,
|
|
11
|
-
...cost.alloc === void 0 ? {} : { alloc: cost.alloc }
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
const fixed = (capability) => {
|
|
15
|
-
for (const op of capability.operations.values()) {
|
|
16
|
-
Object.freeze(op.args);
|
|
17
|
-
Object.freeze(op.errors);
|
|
18
|
-
Object.freeze(op);
|
|
19
|
-
}
|
|
20
|
-
return capability;
|
|
21
|
-
};
|
|
22
|
-
const instantShape = Object.freeze({
|
|
23
|
-
k: "kind",
|
|
24
|
-
kind: "instant"
|
|
25
|
-
});
|
|
26
|
-
const textShape$1 = Object.freeze({
|
|
27
|
-
k: "kind",
|
|
28
|
-
kind: "text"
|
|
29
|
-
});
|
|
30
|
-
const valueShape = Object.freeze({ k: "value" });
|
|
31
|
-
const dataListShape = Object.freeze({
|
|
32
|
-
k: "list",
|
|
33
|
-
of: Object.freeze({ k: "any" })
|
|
34
|
-
});
|
|
35
|
-
/** The Pump's Clock reading; there is no Host clock implementation. */
|
|
36
|
-
const clockCapability = (costs) => fixed(defineValueCapability("clock", { now: {
|
|
37
|
-
mode: "immediate",
|
|
38
|
-
args: [],
|
|
39
|
-
result: instantShape,
|
|
40
|
-
errors: [],
|
|
41
|
-
cost: costOf(costs, "now"),
|
|
42
|
-
do: (call) => instant(call.now)
|
|
43
|
-
} }));
|
|
44
|
-
/** The Host owns durable timers, scoped by Script and name. */
|
|
45
|
-
const timerCapability = (impl, costs) => {
|
|
46
|
-
if (!impl || typeof impl.schedule !== "function" || typeof impl.cancel !== "function") throw new HostError("invalid value", "Timer needs Schedule and Cancel");
|
|
47
|
-
return fixed(defineValueCapability("timer", {
|
|
48
|
-
schedule: {
|
|
49
|
-
mode: "fire-and-forget",
|
|
50
|
-
args: [
|
|
51
|
-
textShape$1,
|
|
52
|
-
instantShape,
|
|
53
|
-
textShape$1,
|
|
54
|
-
dataListShape
|
|
55
|
-
],
|
|
56
|
-
errors: [],
|
|
57
|
-
cost: costOf(costs, "schedule"),
|
|
58
|
-
fire: (call, name, at, message, args) => impl.schedule(call, name.asText(), at, message.asText(), args)
|
|
59
|
-
},
|
|
60
|
-
cancel: {
|
|
61
|
-
mode: "fire-and-forget",
|
|
62
|
-
args: [textShape$1],
|
|
63
|
-
errors: [],
|
|
64
|
-
cost: costOf(costs, "cancel"),
|
|
65
|
-
fire: (call, name) => impl.cancel(call, name.asText())
|
|
66
|
-
}
|
|
67
|
-
}));
|
|
68
|
-
};
|
|
69
|
-
/** The Host shows Values in text form and answers read with a line of text. */
|
|
70
|
-
const consoleCapability = (impl, costs) => {
|
|
71
|
-
if (!impl || typeof impl.write !== "function" || typeof impl.read !== "function") throw new HostError("invalid value", "Console needs Write and Read");
|
|
72
|
-
return fixed(defineValueCapability("console", {
|
|
73
|
-
write: {
|
|
74
|
-
mode: "fire-and-forget",
|
|
75
|
-
args: [valueShape],
|
|
76
|
-
errors: [],
|
|
77
|
-
cost: costOf(costs, "write"),
|
|
78
|
-
fire: (call, value) => impl.write(call, value)
|
|
79
|
-
},
|
|
80
|
-
read: {
|
|
81
|
-
mode: "suspending",
|
|
82
|
-
args: [],
|
|
83
|
-
result: textShape$1,
|
|
84
|
-
errors: [],
|
|
85
|
-
maxPendingMs: 2147483647,
|
|
86
|
-
cost: costOf(costs, "read"),
|
|
87
|
-
start: (call) => impl.read(call)
|
|
88
|
-
}
|
|
89
|
-
}));
|
|
90
|
-
};
|
|
91
|
-
const civilShape = Object.freeze({
|
|
92
|
-
k: "kind",
|
|
93
|
-
kind: "civil date"
|
|
94
|
-
});
|
|
95
|
-
const optionalTextShape = Object.freeze({
|
|
96
|
-
k: "optional",
|
|
97
|
-
of: textShape$1
|
|
98
|
-
});
|
|
99
|
-
const secondsShape = Object.freeze({
|
|
100
|
-
k: "quantity",
|
|
101
|
-
unit: "s"
|
|
102
|
-
});
|
|
103
|
-
const disambiguations = /* @__PURE__ */ new Set([
|
|
104
|
-
"compatible",
|
|
105
|
-
"earlier",
|
|
106
|
-
"later",
|
|
107
|
-
"reject"
|
|
108
|
-
]);
|
|
109
|
-
const zoneText = (value) => value?.asText();
|
|
110
|
-
const calendarError = (code, data) => data.get("zone").kind === "text" && (code === "unknown zone" || code === "ambiguous time" && data.get("civil").kind === "civil date");
|
|
111
|
-
const checkToInstant = (args) => {
|
|
112
|
-
const civil = args[0];
|
|
113
|
-
const disambiguation = zoneText(args[1]);
|
|
114
|
-
const bad = !("hour" in civil.asCivilDate()) ? civil : args.length === 3 && disambiguation !== void 0 && !disambiguations.has(disambiguation) ? args[1] : void 0;
|
|
115
|
-
if (bad) throw new ScriptError$1("out of domain", [["function", text("toInstant")], ["value", bad]], true);
|
|
116
|
-
};
|
|
117
|
-
/** The Host owns zone data; the Grant binding supplies its default zone. */
|
|
118
|
-
const calendarCapability = (impl, costs) => {
|
|
119
|
-
for (const name of [
|
|
120
|
-
"today",
|
|
121
|
-
"now",
|
|
122
|
-
"toCivil",
|
|
123
|
-
"toInstant",
|
|
124
|
-
"offset",
|
|
125
|
-
"zone"
|
|
126
|
-
]) if (!impl || typeof impl[name] !== "function") throw new HostError("invalid value", `Calendar needs ${name}`);
|
|
127
|
-
const unknownZone = [{
|
|
128
|
-
code: "unknown zone",
|
|
129
|
-
fields: { zone: textShape$1 }
|
|
130
|
-
}];
|
|
131
|
-
const operations = {
|
|
132
|
-
today: {
|
|
133
|
-
mode: "immediate",
|
|
134
|
-
args: [optionalTextShape],
|
|
135
|
-
result: civilShape,
|
|
136
|
-
errors: unknownZone,
|
|
137
|
-
cost: costOf(costs, "today"),
|
|
138
|
-
do: (call, zone) => impl.today(call, zoneText(zone))
|
|
139
|
-
},
|
|
140
|
-
now: {
|
|
141
|
-
mode: "immediate",
|
|
142
|
-
args: [optionalTextShape],
|
|
143
|
-
result: civilShape,
|
|
144
|
-
errors: unknownZone,
|
|
145
|
-
cost: costOf(costs, "now"),
|
|
146
|
-
do: (call, zone) => impl.now(call, zoneText(zone))
|
|
147
|
-
},
|
|
148
|
-
toCivil: {
|
|
149
|
-
mode: "immediate",
|
|
150
|
-
args: [instantShape, optionalTextShape],
|
|
151
|
-
result: civilShape,
|
|
152
|
-
errors: unknownZone,
|
|
153
|
-
cost: costOf(costs, "toCivil"),
|
|
154
|
-
do: (call, value, zone) => impl.toCivil(call, value, zoneText(zone))
|
|
155
|
-
},
|
|
156
|
-
toInstant: {
|
|
157
|
-
mode: "immediate",
|
|
158
|
-
args: [
|
|
159
|
-
civilShape,
|
|
160
|
-
optionalTextShape,
|
|
161
|
-
optionalTextShape
|
|
162
|
-
],
|
|
163
|
-
result: instantShape,
|
|
164
|
-
errors: [...unknownZone, {
|
|
165
|
-
code: "ambiguous time",
|
|
166
|
-
fields: {
|
|
167
|
-
civil: civilShape,
|
|
168
|
-
zone: textShape$1
|
|
169
|
-
}
|
|
170
|
-
}],
|
|
171
|
-
cost: costOf(costs, "toInstant"),
|
|
172
|
-
do: (call, ...args) => {
|
|
173
|
-
const second = zoneText(args[1]);
|
|
174
|
-
const isZone = args.length === 2 && second !== void 0 && !disambiguations.has(second);
|
|
175
|
-
return impl.toInstant(call, args[0], isZone ? "compatible" : second ?? "compatible", isZone ? second : zoneText(args[2]));
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
offset: {
|
|
179
|
-
mode: "immediate",
|
|
180
|
-
args: [instantShape, optionalTextShape],
|
|
181
|
-
result: secondsShape,
|
|
182
|
-
errors: unknownZone,
|
|
183
|
-
cost: costOf(costs, "offset"),
|
|
184
|
-
do: (call, value, zone) => impl.offset(call, value, zoneText(zone))
|
|
185
|
-
},
|
|
186
|
-
zone: {
|
|
187
|
-
mode: "immediate",
|
|
188
|
-
args: [optionalTextShape],
|
|
189
|
-
result: textShape$1,
|
|
190
|
-
errors: unknownZone,
|
|
191
|
-
cost: costOf(costs, "zone"),
|
|
192
|
-
do: (call, zone) => impl.zone(call, zoneText(zone))
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
for (const [name, op] of Object.entries(operations)) registerStandardChecks(op, {
|
|
196
|
-
error: calendarError,
|
|
197
|
-
...name === "toInstant" ? { arguments: checkToInstant } : {},
|
|
198
|
-
...[
|
|
199
|
-
"today",
|
|
200
|
-
"now",
|
|
201
|
-
"toCivil"
|
|
202
|
-
].includes(name) ? { result: (value) => !("hour" in value.asCivilDate()) === (name === "today") } : {}
|
|
203
|
-
});
|
|
204
|
-
return fixed(defineValueCapability("calendar", operations));
|
|
205
|
-
};
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region src/store-capability.ts
|
|
208
|
-
/** A Core-raised error as the Host sees it, with its catalogue message. */
|
|
209
|
-
const hostScriptError = (code, fields) => {
|
|
210
|
-
const message = (errorMessages[code] ?? code).replaceAll(/{(\w+)}/g, (_, name) => {
|
|
211
|
-
const field = fields.find(([k]) => k === name);
|
|
212
|
-
return field ? field[1].toString() : `{${name}}`;
|
|
213
|
-
});
|
|
214
|
-
return new ScriptError(code, message, map(fields.map(([k, v]) => [k, v])));
|
|
215
|
-
};
|
|
216
|
-
/** The `+` rules outside any Run, uncharged (chapter 9, Adding). */
|
|
217
|
-
const add = (a, b) => {
|
|
218
|
-
try {
|
|
219
|
-
return arithmetic("add", a, b);
|
|
220
|
-
} catch (error) {
|
|
221
|
-
throw error instanceof ScriptError$1 ? hostScriptError(error.code, error.fields) : error;
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
const textShape = shape.text;
|
|
225
|
-
const keyShape = textShape;
|
|
226
|
-
const amountShape = shape.oneOf(shape.number, {
|
|
227
|
-
k: "kind",
|
|
228
|
-
kind: "quantity"
|
|
229
|
-
});
|
|
230
|
-
const OPERATIONS = [
|
|
231
|
-
"get",
|
|
232
|
-
"set",
|
|
233
|
-
"delete",
|
|
234
|
-
"keys",
|
|
235
|
-
"increment",
|
|
236
|
-
"swap",
|
|
237
|
-
"watch",
|
|
238
|
-
"unwatch"
|
|
239
|
-
];
|
|
240
|
-
const isText = (data, field) => data.get(field).kind === "text";
|
|
241
|
-
const errorFields = {
|
|
242
|
-
"can't store": (data) => isText(data, "kind"),
|
|
243
|
-
"store full": (data) => [
|
|
244
|
-
"size",
|
|
245
|
-
"keys",
|
|
246
|
-
"value"
|
|
247
|
-
].includes(data.get("limit").asText() ?? ""),
|
|
248
|
-
"store busy": (data) => isText(data, "key"),
|
|
249
|
-
"watch limit": (data) => [
|
|
250
|
-
"watches",
|
|
251
|
-
"size",
|
|
252
|
-
"pending"
|
|
253
|
-
].includes(data.get("limit").asText() ?? ""),
|
|
254
|
-
"wrong kind": (data) => isText(data, "expected") && isText(data, "got") && data.entries().some(([k]) => k === "value"),
|
|
255
|
-
"incompatible units": (data) => isText(data, "left") && isText(data, "right"),
|
|
256
|
-
overflow: (data) => isText(data, "operator")
|
|
257
|
-
};
|
|
258
|
-
const checkKey = (args) => {
|
|
259
|
-
if (args[0].asText() === "") throw new ScriptError$1("invalid key", [], true);
|
|
260
|
-
};
|
|
261
|
-
const effectiveMessage = (args) => args[2]?.asText() ?? "storeChanged";
|
|
262
|
-
const checkUnwatch = (args) => {
|
|
263
|
-
if (args[0].asText() === "") throw new ScriptError$1("invalid watch", [["field", text("name")]], true);
|
|
264
|
-
};
|
|
265
|
-
const checkWatch = (args) => {
|
|
266
|
-
checkUnwatch(args);
|
|
267
|
-
const message = effectiveMessage(args);
|
|
268
|
-
if (message.includes(":") || !validComputedMessageName(message, 1)) throw new ScriptError$1("invalid watch", [["field", text("message")]], true);
|
|
269
|
-
};
|
|
270
|
-
const argumentChecks = {
|
|
271
|
-
watch: checkWatch,
|
|
272
|
-
unwatch: checkUnwatch
|
|
273
|
-
};
|
|
274
|
-
const errors = (...codes) => codes.map((code) => ({ code }));
|
|
275
|
-
const writes = [
|
|
276
|
-
"can't store",
|
|
277
|
-
"store full",
|
|
278
|
-
"store busy"
|
|
279
|
-
];
|
|
280
|
-
const key = (args) => args[0].asText();
|
|
281
|
-
/** The Store is the Host's; the Grant binding names it, and `impl` coordinates every binding. */
|
|
282
|
-
const storeCapability = (impl, costs) => {
|
|
283
|
-
for (const name of [
|
|
284
|
-
...OPERATIONS,
|
|
285
|
-
"begin",
|
|
286
|
-
"commit",
|
|
287
|
-
"rollback",
|
|
288
|
-
"release"
|
|
289
|
-
]) if (!impl || typeof impl[name] !== "function") throw new HostError("invalid value", `Store needs ${name}`);
|
|
290
|
-
const operations = {
|
|
291
|
-
watch: {
|
|
292
|
-
mode: "immediate",
|
|
293
|
-
args: [
|
|
294
|
-
textShape,
|
|
295
|
-
textShape,
|
|
296
|
-
shape.optional(textShape)
|
|
297
|
-
],
|
|
298
|
-
result: shape.nothing,
|
|
299
|
-
errors: errors("watch limit"),
|
|
300
|
-
cost: costOf(costs, "watch"),
|
|
301
|
-
do: (call, ...args) => {
|
|
302
|
-
impl.watch(call, key(args), args[1].asText(), effectiveMessage(args));
|
|
303
|
-
return nothing;
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
unwatch: {
|
|
307
|
-
mode: "immediate",
|
|
308
|
-
args: [textShape],
|
|
309
|
-
result: shape.nothing,
|
|
310
|
-
errors: [],
|
|
311
|
-
cost: costOf(costs, "unwatch"),
|
|
312
|
-
do: (call, ...args) => {
|
|
313
|
-
impl.unwatch(call, key(args));
|
|
314
|
-
return nothing;
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
get: {
|
|
318
|
-
mode: "immediate",
|
|
319
|
-
args: [keyShape, shape.optional(shape.any)],
|
|
320
|
-
result: shape.any,
|
|
321
|
-
errors: [],
|
|
322
|
-
cost: costOf(costs, "get"),
|
|
323
|
-
do: (call, ...args) => impl.get(call, key(args), args[1])
|
|
324
|
-
},
|
|
325
|
-
set: {
|
|
326
|
-
mode: "immediate",
|
|
327
|
-
args: [keyShape, shape.any],
|
|
328
|
-
result: shape.nothing,
|
|
329
|
-
errors: errors(...writes),
|
|
330
|
-
cost: costOf(costs, "set"),
|
|
331
|
-
segmentBound: true,
|
|
332
|
-
do: (call, ...args) => {
|
|
333
|
-
impl.set(call, key(args), args[1]);
|
|
334
|
-
return nothing;
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
delete: {
|
|
338
|
-
mode: "immediate",
|
|
339
|
-
args: [keyShape],
|
|
340
|
-
result: shape.nothing,
|
|
341
|
-
errors: errors("store busy"),
|
|
342
|
-
cost: costOf(costs, "delete"),
|
|
343
|
-
segmentBound: true,
|
|
344
|
-
do: (call, ...args) => {
|
|
345
|
-
impl.delete(call, key(args));
|
|
346
|
-
return nothing;
|
|
347
|
-
}
|
|
348
|
-
},
|
|
349
|
-
keys: {
|
|
350
|
-
mode: "immediate",
|
|
351
|
-
args: [shape.optional(textShape)],
|
|
352
|
-
result: shape.listOf(textShape),
|
|
353
|
-
errors: [],
|
|
354
|
-
cost: costOf(costs, "keys"),
|
|
355
|
-
do: (call, prefix) => impl.keys(call, prefix?.asText())
|
|
356
|
-
},
|
|
357
|
-
increment: {
|
|
358
|
-
mode: "immediate",
|
|
359
|
-
args: [keyShape, shape.optional(amountShape)],
|
|
360
|
-
result: amountShape,
|
|
361
|
-
errors: errors("wrong kind", "incompatible units", "overflow", "store full", "store busy"),
|
|
362
|
-
cost: costOf(costs, "increment"),
|
|
363
|
-
segmentBound: true,
|
|
364
|
-
do: (call, ...args) => impl.increment(call, key(args), args[1])
|
|
365
|
-
},
|
|
366
|
-
swap: {
|
|
367
|
-
mode: "immediate",
|
|
368
|
-
args: [
|
|
369
|
-
keyShape,
|
|
370
|
-
shape.any,
|
|
371
|
-
shape.any
|
|
372
|
-
],
|
|
373
|
-
result: shape.bool,
|
|
374
|
-
errors: errors(...writes),
|
|
375
|
-
cost: costOf(costs, "swap"),
|
|
376
|
-
segmentBound: true,
|
|
377
|
-
do: (call, ...args) => bool(impl.swap(call, key(args), args[1], args[2]))
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
const coordinator = impl;
|
|
381
|
-
const capability = defineValueCapability("store", operations, { coordinator: () => coordinator }, (context) => impl.release(context));
|
|
382
|
-
for (const [name, op] of capability.operations) registerStandardChecks(op, {
|
|
383
|
-
error: (code, data) => Boolean(op.errors?.some((e) => e.code === code) && errorFields[code]?.(data)),
|
|
384
|
-
...name === "keys" ? {} : { arguments: argumentChecks[name] ?? checkKey }
|
|
385
|
-
});
|
|
386
|
-
return fixed(capability);
|
|
387
|
-
};
|
|
388
|
-
//#endregion
|
|
389
|
-
export { clockCapability as a, fixed as c, calendarCapability as i, timerCapability as l, hostScriptError as n, consoleCapability as o, storeCapability as r, costOf as s, add as t };
|