@cotal-ai/lang 0.24.0 → 0.26.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/README.md +11 -0
- package/dist/engine/bridge.d.ts +71 -0
- package/dist/engine/bridge.d.ts.map +1 -0
- package/dist/engine/bridge.js +277 -0
- package/dist/engine/bridge.js.map +1 -0
- package/dist/engine/ctx.d.ts +140 -0
- package/dist/engine/ctx.d.ts.map +1 -0
- package/dist/engine/ctx.js +834 -0
- package/dist/engine/ctx.js.map +1 -0
- package/dist/engine/frame.d.ts +69 -0
- package/dist/engine/frame.d.ts.map +1 -0
- package/dist/engine/frame.js +105 -0
- package/dist/engine/frame.js.map +1 -0
- package/dist/engine/host.d.ts +77 -0
- package/dist/engine/host.d.ts.map +1 -0
- package/dist/engine/host.js +134 -0
- package/dist/engine/host.js.map +1 -0
- package/dist/engine/worker-entry.d.ts +26 -0
- package/dist/engine/worker-entry.d.ts.map +1 -0
- package/dist/engine/worker-entry.js +175 -0
- package/dist/engine/worker-entry.js.map +1 -0
- package/dist/engine/worker.d.ts +156 -0
- package/dist/engine/worker.d.ts.map +1 -0
- package/dist/engine/worker.js +123 -0
- package/dist/engine/worker.js.map +1 -0
- package/dist/errors.d.ts +44 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +97 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/interpret.d.ts +7 -38
- package/dist/interpret.d.ts.map +1 -1
- package/dist/interpret.js +45 -1003
- package/dist/interpret.js.map +1 -1
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +75 -1
- package/dist/journal.js.map +1 -1
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +13 -1
- package/dist/library.js.map +1 -1
- package/dist/perform.d.ts +138 -0
- package/dist/perform.d.ts.map +1 -0
- package/dist/perform.js +1052 -0
- package/dist/perform.js.map +1 -0
- package/dist/pins.d.ts +28 -8
- package/dist/pins.d.ts.map +1 -1
- package/dist/pins.js +31 -11
- package/dist/pins.js.map +1 -1
- package/dist/sim.d.ts +15 -1
- package/dist/sim.d.ts.map +1 -1
- package/dist/sim.js.map +1 -1
- package/dist/transform/emit.d.ts +23 -0
- package/dist/transform/emit.d.ts.map +1 -0
- package/dist/transform/emit.js +934 -0
- package/dist/transform/emit.js.map +1 -0
- package/dist/transform/index.d.ts +34 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/index.js +31 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/scope.d.ts +58 -0
- package/dist/transform/scope.d.ts.map +1 -0
- package/dist/transform/scope.js +500 -0
- package/dist/transform/scope.js.map +1 -0
- package/dist/transform/seam.d.ts +78 -0
- package/dist/transform/seam.d.ts.map +1 -0
- package/dist/transform/seam.js +111 -0
- package/dist/transform/seam.js.map +1 -0
- package/dist/values.d.ts +15 -0
- package/dist/values.d.ts.map +1 -1
- package/dist/values.js +79 -0
- package/dist/values.js.map +1 -1
- package/package.json +9 -4
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The seam, as data: the members the emitted module may reach, and the names it may not collide with.
|
|
3
|
+
*
|
|
4
|
+
* The transform and its host share this seam, and neither side widens it on its own. That is
|
|
5
|
+
* mechanized from this file: `transform.smoke` re-parses the emitted string, resolves its scopes,
|
|
6
|
+
* and requires ZERO unbound references and every `<ctx>.<member>` it reaches to be listed here. A
|
|
7
|
+
* member added without changing this table is a change a reader sees in one place, not a call
|
|
8
|
+
* buried in an emitter.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The members the seam grants, each with the range of ARGUMENT COUNTS the emitter may pass.
|
|
12
|
+
*
|
|
13
|
+
* The arity is written here rather than left implicit in the emitter because a member's shape is as
|
|
14
|
+
* much of the contract as its name, and the two that vary are exactly where a divergence hid from a
|
|
15
|
+
* names-only comparison: `call` grew a fourth and then a fifth argument for the optional call
|
|
16
|
+
* against a host member declared with three, and the differential found it rather than the surface.
|
|
17
|
+
* `transform.smoke` checks every emitted call site against this range in both directions - no site
|
|
18
|
+
* outside it, and no bound without a site that reaches it - and `engine.smoke` checks the host's
|
|
19
|
+
* `ctx` against the same table: names by set-equality, and `ctx[name].length === max` for each. That
|
|
20
|
+
* last is the contracted spelling, and it is `max` rather than `min` for a measured reason: a
|
|
21
|
+
* TypeScript optional parameter is a plain parameter after erasure and still counts toward
|
|
22
|
+
* `Function.length`, so a `<= min` rule
|
|
23
|
+
* would be vacuous on every fixed member and false on all four variadic ones. The MIN end cannot be
|
|
24
|
+
* read from a function at all - erasure has discarded which parameters were optional - so it is
|
|
25
|
+
* behavioural on the host's side: each variadic member has a cell calling it in its shortest form.
|
|
26
|
+
*
|
|
27
|
+
* `fuel` is the step check (budget L4013 + yield); `get`/`set`/`call` are the member law
|
|
28
|
+
* (L4014/L4018/L4020, curated tables, birth depth L2032, freeze L2031); `born` stamps a literal;
|
|
29
|
+
* `effect` is a journalled primitive, with a static per-call-site payload; `free` is a free name
|
|
30
|
+
* that journals nothing; `await` is the thenable gate; `template` is the interpolation law;
|
|
31
|
+
* `binary`/`unary` are the operator coercion law (L4018 + the operators' meaning); `iter` is the
|
|
32
|
+
* iterability law (L4015); `caught` heads every emitted catch clause (rethrow the six uncatchable
|
|
33
|
+
* classes, else the walker's frozen `{code, kind, message}` record).
|
|
34
|
+
*/
|
|
35
|
+
export const SEAM_MEMBERS = Object.freeze({
|
|
36
|
+
fuel: [0, 0],
|
|
37
|
+
// 2, or 3 with the dead-zone rule's binding name, which turns an absent own `v` into L2004.
|
|
38
|
+
get: [2, 3],
|
|
39
|
+
// 3, or 4 with that binding name on a write that can land in the dead zone (the declaration's
|
|
40
|
+
// own initializing write never carries it).
|
|
41
|
+
set: [3, 4],
|
|
42
|
+
// 3 ordinary; 4 with the optional-call flag, where the arguments arrive as a thunk; 5 when the
|
|
43
|
+
// chain continues past the optional call and the rest of it travels as a continuation.
|
|
44
|
+
call: [3, 5],
|
|
45
|
+
born: [1, 1],
|
|
46
|
+
effect: [3, 3],
|
|
47
|
+
// 1 for a free name in value position, 2 for a call to one.
|
|
48
|
+
free: [1, 2],
|
|
49
|
+
await: [1, 1],
|
|
50
|
+
template: [2, 2],
|
|
51
|
+
binary: [3, 3],
|
|
52
|
+
unary: [2, 2],
|
|
53
|
+
iter: [1, 1],
|
|
54
|
+
caught: [1, 1],
|
|
55
|
+
// Member 14: L4011 at a non-function callee. `const f = 1; f()` is a program the
|
|
56
|
+
// validator ADMITS (measured at 9dc154f8), and the walker answers L4011 where a native call
|
|
57
|
+
// answers a host TypeError. Emitted behind a `typeof` fast path, so a call to a real function
|
|
58
|
+
// never reaches the host.
|
|
59
|
+
callee: [1, 1],
|
|
60
|
+
});
|
|
61
|
+
/** The member NAMES the seam grants. Derived from the table above, so the two cannot disagree. */
|
|
62
|
+
export const SEAM_RULED = new Set(Object.keys(SEAM_MEMBERS));
|
|
63
|
+
/**
|
|
64
|
+
* Members the emitter reaches that are SURFACED but not yet ruled.
|
|
65
|
+
*
|
|
66
|
+
* Kept apart from {@link SEAM_RULED} on purpose. The alternative to naming the debt is either to
|
|
67
|
+
* stop building or to let a proposed member sit indistinguishable from a granted one, and the
|
|
68
|
+
* second is the forbidden move wearing a green suite. `TransformMeta.proposed` reports which of
|
|
69
|
+
* these an emission actually reached, and `transform.smoke` pins that set, so the debt is a
|
|
70
|
+
* measured number rather than a memory.
|
|
71
|
+
*/
|
|
72
|
+
export const SEAM_PROPOSED = Object.freeze({});
|
|
73
|
+
/**
|
|
74
|
+
* Every operator selector the emitter hands `unary`, and no other.
|
|
75
|
+
*
|
|
76
|
+
* `!` and `typeof` never reach here: neither can refuse, so both are emitted natively. `update` is
|
|
77
|
+
* `UpdateExpression`'s operand read, and it carries the coercion refusal rather than the walker's
|
|
78
|
+
* bare `Number(...)`. The walker's answer there (NaN for a record, 6 for `"5"++`) is the
|
|
79
|
+
* silent-coercion class, filed as issue 646 and carried as a declared divergence with named cells.
|
|
80
|
+
* An op set is as much a contract as a member name, which is why it is written down here rather
|
|
81
|
+
* than left implicit in the emitter.
|
|
82
|
+
*/
|
|
83
|
+
export const UNARY_OPS = Object.freeze(["-", "+", "~", "update"]);
|
|
84
|
+
/**
|
|
85
|
+
* Pick emitter names that cannot collide with anything the program spells.
|
|
86
|
+
*
|
|
87
|
+
* The module shape is a CLOSED function expression with zero free identifiers. That replaced an
|
|
88
|
+
* earlier premise this file carried, which a review falsified: the validator admits `$x`, `__y`,
|
|
89
|
+
* and a program-declared `__ctx`. So the ctx parameter's name is derived from the source rather
|
|
90
|
+
* than assumed, and the derivation is deterministic: the same source picks the
|
|
91
|
+
* same names on every run, which is what makes `transform` byte-reproducible.
|
|
92
|
+
*/
|
|
93
|
+
export function pickNames(identifiers) {
|
|
94
|
+
const free = (base) => {
|
|
95
|
+
if (!identifiers.has(base))
|
|
96
|
+
return base;
|
|
97
|
+
for (let i = 0;; i += 1) {
|
|
98
|
+
const candidate = `${base}$${i}`;
|
|
99
|
+
if (!identifiers.has(candidate))
|
|
100
|
+
return candidate;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const prefix = (base) => {
|
|
104
|
+
let candidate = base;
|
|
105
|
+
for (let i = 0; [...identifiers].some((n) => n.startsWith(candidate)); i += 1)
|
|
106
|
+
candidate = `${base}$${i}_`;
|
|
107
|
+
return candidate;
|
|
108
|
+
};
|
|
109
|
+
return { ctx: free("__ctx"), temp: prefix("__t"), label: prefix("__l") };
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=seam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seam.js","sourceRoot":"","sources":["../../src/transform/seam.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAwD,MAAM,CAAC,MAAM,CAAC;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AAM,UAAU,SAAS,CAAC,WAAgC;IACxD,MAAM,IAAI,GAAG,CAAC,IAAY,EAAU,EAAE;QACpC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACxC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,SAAS,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC;gBAAE,OAAO,SAAS,CAAC;QACpD,CAAC;IACH,CAAC,CAAC;IACF,MAAM,MAAM,GAAG,CAAC,IAAY,EAAU,EAAE;QACtC,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC;YAAE,SAAS,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;QAC3G,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IACF,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3E,CAAC"}
|
package/dist/values.d.ts
CHANGED
|
@@ -30,6 +30,20 @@ export declare class NotCrossable extends TypeError {
|
|
|
30
30
|
readonly why: "function" | "undefined" | "non-finite" | "opaque";
|
|
31
31
|
constructor(why: "function" | "undefined" | "non-finite" | "opaque", message: string);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* A log line is DATA for a human reading the trace, and on the ENGINE code never crosses to it: the
|
|
35
|
+
* engine's log sink (src/engine/ctx.ts) refuses a function anywhere inside a logged value before the
|
|
36
|
+
* line reaches any transport, naming the value and the path. Measured before the rule: the worker
|
|
37
|
+
* thread died on the host's own DataCloneError, whose message carried the emitted module body verbatim.
|
|
38
|
+
* The WALKER is deliberately untouched: it is the replay engine for every run recorded under language
|
|
39
|
+
* version 1, and a v1 record whose program logs a builtin (`log(map)`) must replay as it was recorded
|
|
40
|
+
* (a checked-in recording in journal.smoke holds that), so this is a rule of the engine, declared as a
|
|
41
|
+
* divergence in the differential, not a change to v1. Everything else a program can build crosses to a
|
|
42
|
+
* trace as it is - `undefined` and a non-finite number included, because the trace is not the journal
|
|
43
|
+
* and a human wants to see them - so this is deliberately NOT `assertCrossable`. `seen` marks
|
|
44
|
+
* everything visited: a second visit answers the same question, and a cycle terminates.
|
|
45
|
+
*/
|
|
46
|
+
export declare function assertNoCode(value: unknown, path: string, seen?: Set<object>): void;
|
|
33
47
|
/**
|
|
34
48
|
* A value that cannot canonicalize cannot be journalled, and a value that cannot be journalled
|
|
35
49
|
* cannot be replayed. Catching it at the boundary is strictly better than discovering it at
|
|
@@ -51,4 +65,5 @@ export declare class Prng {
|
|
|
51
65
|
constructor(seed: string);
|
|
52
66
|
next(scope: readonly ScopeFrame[]): number;
|
|
53
67
|
}
|
|
68
|
+
export declare function assertScopeValueCrossable(value: unknown, where: string, scopeKind: string): void;
|
|
54
69
|
//# sourceMappingURL=values.d.ts.map
|
package/dist/values.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C;+EAC+E;AAC/E,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAMzC;AAkBD,sGAAsG;AACtG,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG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;GAIG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAExE;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,SAAS;IAEvC,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ;gBAAvD,GAAG,EAAE,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,EAChE,OAAO,EAAE,MAAM;CAKlB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,cAAoB,GAAG,IAAI,CAczF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,SAAU,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAoExF;AAED;;;;;;;;GAQG;AACH,qBAAa,IAAI;IAGH,QAAQ,CAAC,IAAI,EAAE,MAAM;IAFjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;gBAE9B,IAAI,EAAE,MAAM;IAEjC,IAAI,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM;CAU3C;AA+BD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAmBhG"}
|
package/dist/values.js
CHANGED
|
@@ -69,6 +69,34 @@ export class NotCrossable extends TypeError {
|
|
|
69
69
|
this.name = "NotCrossable";
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* A log line is DATA for a human reading the trace, and on the ENGINE code never crosses to it: the
|
|
74
|
+
* engine's log sink (src/engine/ctx.ts) refuses a function anywhere inside a logged value before the
|
|
75
|
+
* line reaches any transport, naming the value and the path. Measured before the rule: the worker
|
|
76
|
+
* thread died on the host's own DataCloneError, whose message carried the emitted module body verbatim.
|
|
77
|
+
* The WALKER is deliberately untouched: it is the replay engine for every run recorded under language
|
|
78
|
+
* version 1, and a v1 record whose program logs a builtin (`log(map)`) must replay as it was recorded
|
|
79
|
+
* (a checked-in recording in journal.smoke holds that), so this is a rule of the engine, declared as a
|
|
80
|
+
* divergence in the differential, not a change to v1. Everything else a program can build crosses to a
|
|
81
|
+
* trace as it is - `undefined` and a non-finite number included, because the trace is not the journal
|
|
82
|
+
* and a human wants to see them - so this is deliberately NOT `assertCrossable`. `seen` marks
|
|
83
|
+
* everything visited: a second visit answers the same question, and a cycle terminates.
|
|
84
|
+
*/
|
|
85
|
+
export function assertNoCode(value, path, seen = new Set()) {
|
|
86
|
+
if (typeof value === "function") {
|
|
87
|
+
throw new NotCrossable("function", `${path} is a function. A log line is data for a human reading the trace, and code does not cross to it; log what it computes instead`);
|
|
88
|
+
}
|
|
89
|
+
if (value === null || typeof value !== "object" || seen.has(value))
|
|
90
|
+
return;
|
|
91
|
+
seen.add(value);
|
|
92
|
+
if (Array.isArray(value)) {
|
|
93
|
+
for (let i = 0; i < value.length; i += 1)
|
|
94
|
+
assertNoCode(value[i], `${path}[${i}]`, seen);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
for (const [k, v] of Object.entries(value))
|
|
98
|
+
assertNoCode(v, `${path}.${k}`, seen);
|
|
99
|
+
}
|
|
72
100
|
/**
|
|
73
101
|
* A value that cannot canonicalize cannot be journalled, and a value that cannot be journalled
|
|
74
102
|
* cannot be replayed. Catching it at the boundary is strictly better than discovering it at
|
|
@@ -156,4 +184,55 @@ export class Prng {
|
|
|
156
184
|
return v / 2 ** 48;
|
|
157
185
|
}
|
|
158
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* The value rule over a SCOPE's settled value. The exemption it carries is ABSENCE, and it is
|
|
189
|
+
* POSITIONAL, so it has to follow the scope's KIND rather than its shape.
|
|
190
|
+
*
|
|
191
|
+
* `parallel`, `fanOut` and `race` settle an INTERPRETER ASSEMBLY: a record or array of branch
|
|
192
|
+
* values, or `{ index, value }` for a race. A branch whose last line is a statement produced no
|
|
193
|
+
* value, which is legal and ordinary, so `undefined` in a branch SLOT is absence rather than a value
|
|
194
|
+
* that failed the rule. That is the exemption, and it is exactly one level deep, where the assembly
|
|
195
|
+
* puts branch outcomes. A branch that returns `{ x: undefined }` is refused exactly as an effect
|
|
196
|
+
* result carrying the same record is: that `undefined` is a field the PROGRAM wrote.
|
|
197
|
+
*
|
|
198
|
+
* `conclave` HAS NO ASSEMBLY. Its settled value is the body's own value, so level one is already the
|
|
199
|
+
* program's own record fields, and giving them the slot exemption hands it to exactly the values it
|
|
200
|
+
* was never meant to cover. Measured, on the rule's first version: a conclave body returning
|
|
201
|
+
* `{ x: e.missing }` completed, the durable store wrote the field away as `{}` with nothing raised,
|
|
202
|
+
* and a replay handed the program `keys(r) == []` where the live run had `["x"]`. The same silent
|
|
203
|
+
* false replay the rule exists to stop, with `undefined` in the place of a function. So a conclave
|
|
204
|
+
* exempts only a body that produced NO VALUE AT ALL, and everything inside a value it did produce
|
|
205
|
+
* answers to the effect door's rule.
|
|
206
|
+
*
|
|
207
|
+
* UNKNOWN KINDS TAKE THE STRICTER READING, because a kind this function has not been taught about
|
|
208
|
+
* is one nobody has decided the shape of, and the wrong default there is the silent one.
|
|
209
|
+
*
|
|
210
|
+
* It lives here rather than beside either caller because BOTH doors need the same rule: the write
|
|
211
|
+
* fence in `perform.ts` and the load scan in `journal.ts`. Two copies of a rule this positional is
|
|
212
|
+
* how the two ends stop agreeing.
|
|
213
|
+
*/
|
|
214
|
+
const ASSEMBLING_SCOPES = new Set(["parallel", "race", "fanOut"]);
|
|
215
|
+
export function assertScopeValueCrossable(value, where, scopeKind) {
|
|
216
|
+
if (value === undefined)
|
|
217
|
+
return;
|
|
218
|
+
if (!ASSEMBLING_SCOPES.has(scopeKind)) {
|
|
219
|
+
assertCrossable(value, where);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (Array.isArray(value)) {
|
|
223
|
+
value.forEach((el, i) => {
|
|
224
|
+
if (el !== undefined)
|
|
225
|
+
assertCrossable(el, `${where}[${i}]`);
|
|
226
|
+
});
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype) {
|
|
230
|
+
for (const [k, el] of Object.entries(value)) {
|
|
231
|
+
if (el !== undefined)
|
|
232
|
+
assertCrossable(el, `${where}.${k}`);
|
|
233
|
+
}
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
assertCrossable(value, where);
|
|
237
|
+
}
|
|
159
238
|
//# sourceMappingURL=values.js.map
|
package/dist/values.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C;+EAC+E;AAC/E,MAAM,UAAU,UAAU,CAAI,KAAQ;IACpC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrB,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC;QAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,KAAK,GAAkB,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAE9D,sGAAsG;AACtG,MAAM,UAAU,IAAI,CAAI,KAAQ,EAAE,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,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/lang",
|
|
3
3
|
"description": "cotal-lang: the restricted-JS workflow language. Parser and validator, the effect interface, the step journal, the interpreter, and the simulation handler. Depends on nothing else in the repo.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.26.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -15,11 +15,15 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./engine/worker-entry": {
|
|
20
|
+
"import": "./dist/engine/worker-entry.js"
|
|
18
21
|
}
|
|
19
22
|
},
|
|
20
23
|
"dependencies": {
|
|
21
24
|
"acorn": "^8.15.0",
|
|
22
|
-
"json-canonicalize": "2.0.0"
|
|
25
|
+
"json-canonicalize": "2.0.0",
|
|
26
|
+
"ses": "^2.3.0"
|
|
23
27
|
},
|
|
24
28
|
"files": [
|
|
25
29
|
"dist"
|
|
@@ -28,8 +32,9 @@
|
|
|
28
32
|
"access": "public"
|
|
29
33
|
},
|
|
30
34
|
"scripts": {
|
|
31
|
-
"typecheck": "tsc -p tsconfig.json
|
|
35
|
+
"typecheck": "tsc -p tsconfig.check.json",
|
|
32
36
|
"build": "tsc -p tsconfig.json",
|
|
33
|
-
"test": "tsx smoke/grammar.smoke.ts && tsx smoke/keys.smoke.ts && tsx smoke/journal.smoke.ts && tsx smoke/pins.smoke.ts && tsx smoke/scopes.smoke.ts && tsx smoke/sim.smoke.ts && tsx smoke/interpret.smoke.ts && tsx smoke/fuel.smoke.ts && tsx smoke/dryrun.smoke.ts && tsx smoke/examples.smoke.ts && tsx smoke/options.smoke.ts && tsx smoke/notify-fact.smoke.ts && tsx smoke/migrate.smoke.ts && tsx smoke/semantics.smoke.ts && tsx smoke/surface.smoke.ts"
|
|
37
|
+
"test": "pnpm run build:emit && tsx smoke/grammar.smoke.ts && tsx smoke/keys.smoke.ts && tsx smoke/journal.smoke.ts && tsx smoke/pins.smoke.ts && tsx smoke/scopes.smoke.ts && tsx smoke/sim.smoke.ts && tsx smoke/interpret.smoke.ts && tsx smoke/fuel.smoke.ts && tsx smoke/dryrun.smoke.ts && tsx smoke/examples.smoke.ts && tsx smoke/options.smoke.ts && tsx smoke/notify-fact.smoke.ts && tsx smoke/migrate.smoke.ts && tsx smoke/semantics.smoke.ts && tsx smoke/surface.smoke.ts && tsx smoke/transform.smoke.ts && tsx smoke/differential.smoke.ts && tsx smoke/engine.smoke.ts",
|
|
38
|
+
"build:emit": "tsc -p tsconfig.json --noCheck"
|
|
34
39
|
}
|
|
35
40
|
}
|