@cotal-ai/lang 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +57 -0
  2. package/dist/effects.d.ts +19 -0
  3. package/dist/effects.d.ts.map +1 -1
  4. package/dist/effects.js +23 -0
  5. package/dist/effects.js.map +1 -1
  6. package/dist/errors.d.ts +48 -2
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +90 -2
  9. package/dist/errors.js.map +1 -1
  10. package/dist/grammar.d.ts.map +1 -1
  11. package/dist/grammar.js +561 -128
  12. package/dist/grammar.js.map +1 -1
  13. package/dist/index.d.ts +10 -6
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +10 -6
  16. package/dist/index.js.map +1 -1
  17. package/dist/interpret.d.ts +81 -3
  18. package/dist/interpret.d.ts.map +1 -1
  19. package/dist/interpret.js +1446 -270
  20. package/dist/interpret.js.map +1 -1
  21. package/dist/journal.d.ts +218 -9
  22. package/dist/journal.d.ts.map +1 -1
  23. package/dist/journal.js +232 -12
  24. package/dist/journal.js.map +1 -1
  25. package/dist/keys.d.ts +39 -1
  26. package/dist/keys.d.ts.map +1 -1
  27. package/dist/keys.js +61 -0
  28. package/dist/keys.js.map +1 -1
  29. package/dist/library.d.ts +65 -0
  30. package/dist/library.d.ts.map +1 -0
  31. package/dist/library.js +525 -0
  32. package/dist/library.js.map +1 -0
  33. package/dist/notify-fact.d.ts +8 -0
  34. package/dist/notify-fact.d.ts.map +1 -0
  35. package/dist/notify-fact.js +69 -0
  36. package/dist/notify-fact.js.map +1 -0
  37. package/dist/pins.d.ts +82 -0
  38. package/dist/pins.d.ts.map +1 -0
  39. package/dist/pins.js +87 -0
  40. package/dist/pins.js.map +1 -0
  41. package/dist/primitives.d.ts +14 -0
  42. package/dist/primitives.d.ts.map +1 -1
  43. package/dist/primitives.js +45 -5
  44. package/dist/primitives.js.map +1 -1
  45. package/dist/sim.d.ts +9 -1
  46. package/dist/sim.d.ts.map +1 -1
  47. package/dist/sim.js +9 -1
  48. package/dist/sim.js.map +1 -1
  49. package/dist/syntax.d.ts +34 -0
  50. package/dist/syntax.d.ts.map +1 -0
  51. package/dist/syntax.js +178 -0
  52. package/dist/syntax.js.map +1 -0
  53. package/dist/values.d.ts +20 -1
  54. package/dist/values.d.ts.map +1 -1
  55. package/dist/values.js +0 -0
  56. package/dist/values.js.map +1 -1
  57. package/package.json +2 -2
package/dist/syntax.js ADDED
@@ -0,0 +1,178 @@
1
+ /**
2
+ * The syntax table: every node type acorn can produce, sorted into the sets the language is made of.
3
+ *
4
+ * ONE TABLE, READ BY BOTH HALVES. The validator admits exactly {@link ADMITTED_NODES} and
5
+ * {@link STRUCTURAL_NODES}, refuses each row of {@link FORBIDDEN_NODES} with its own code, and refuses
6
+ * everything else with L1029. The interpreter executes exactly the admitted set. `surface.smoke`
7
+ * holds the two halves to this file: every admitted node type is executed by a program, every
8
+ * `case` label in the interpreter's node switches is on this table, and every node type acorn knows
9
+ * lands in exactly one set. Before this table existed the two halves were two hand-kept lists, and
10
+ * `x++`, `?.`, rest parameters and `**` were admitted by one and refused by the other.
11
+ */
12
+ /** Node types the interpreter executes. A validated program is made of these and nothing else. */
13
+ export const ADMITTED_NODES = new Set([
14
+ // statements
15
+ "Program",
16
+ "ExpressionStatement",
17
+ "VariableDeclaration",
18
+ "FunctionDeclaration",
19
+ "BlockStatement",
20
+ "IfStatement",
21
+ "WhileStatement",
22
+ "ForStatement",
23
+ "ForOfStatement",
24
+ "ReturnStatement",
25
+ "BreakStatement",
26
+ "ContinueStatement",
27
+ "ThrowStatement",
28
+ "TryStatement",
29
+ "SwitchStatement",
30
+ "EmptyStatement",
31
+ // expressions
32
+ "Literal",
33
+ "Identifier",
34
+ "TemplateLiteral",
35
+ "ArrayExpression",
36
+ "ObjectExpression",
37
+ "MemberExpression",
38
+ "ChainExpression",
39
+ "UnaryExpression",
40
+ "UpdateExpression",
41
+ "BinaryExpression",
42
+ "LogicalExpression",
43
+ "ConditionalExpression",
44
+ "AssignmentExpression",
45
+ "AwaitExpression",
46
+ "ArrowFunctionExpression",
47
+ "FunctionExpression",
48
+ "CallExpression",
49
+ ]);
50
+ /**
51
+ * Node types that only occur INSIDE an admitted node and are executed as part of it: a `Property`
52
+ * inside an object literal, a `SwitchCase` inside a `switch`, a pattern inside a declaration.
53
+ */
54
+ export const STRUCTURAL_NODES = new Set([
55
+ "VariableDeclarator",
56
+ "Property",
57
+ "SpreadElement",
58
+ "RestElement",
59
+ "AssignmentPattern",
60
+ "ObjectPattern",
61
+ "ArrayPattern",
62
+ "TemplateElement",
63
+ "SwitchCase",
64
+ "CatchClause",
65
+ ]);
66
+ /** Node types rejected outright, with the code and the repair to suggest. */
67
+ export const FORBIDDEN_NODES = Object.freeze({
68
+ ClassDeclaration: {
69
+ code: "L1001",
70
+ cause: "There are no classes in this language. State lives in records and behaviour lives in functions.",
71
+ fix: "Replace the class with a function that returns a record.",
72
+ },
73
+ ClassExpression: {
74
+ code: "L1001",
75
+ cause: "There are no classes in this language. State lives in records and behaviour lives in functions.",
76
+ fix: "Replace the class with a function that returns a record.",
77
+ },
78
+ ThisExpression: {
79
+ code: "L1002",
80
+ cause: "`this` does not exist, so nothing can capture a calling context by accident.",
81
+ fix: "Pass what the function needs as an argument.",
82
+ },
83
+ ForInStatement: {
84
+ code: "L1004",
85
+ cause: "`for...in` walks an unspecified order and reaches inherited names, so it cannot be deterministic.",
86
+ fix: "Iterate explicitly: `for (const k of keys(record)) { ... }`.",
87
+ },
88
+ YieldExpression: {
89
+ code: "L1005",
90
+ cause: "Generators suspend and resume outside the effect journal, so a resumed run could not reproduce them.",
91
+ fix: "Use a loop, and `await` the effects inside it.",
92
+ },
93
+ TaggedTemplateExpression: {
94
+ code: "L1018",
95
+ cause: "A tagged template runs user code during evaluation of a literal, which hides an effect inside what looks like data.",
96
+ fix: "Use a plain template literal, or call the function explicitly.",
97
+ },
98
+ NewExpression: {
99
+ code: "L1019",
100
+ cause: "There are no constructors, so `new` has nothing to construct.",
101
+ fix: "Build a record literal, or call a function that returns one.",
102
+ },
103
+ ImportDeclaration: {
104
+ code: "L1020",
105
+ cause: "A program is exactly one module, because a run pins to the content hash of its source.",
106
+ fix: "Define the function in this file. Shared procedures are ordinary functions.",
107
+ },
108
+ ImportExpression: {
109
+ code: "L1020",
110
+ cause: "A program is exactly one module, because a run pins to the content hash of its source; a dynamic `import()` would load code the hash does not cover.",
111
+ fix: "Define the function in this file. Shared procedures are ordinary functions.",
112
+ },
113
+ ExportNamedDeclaration: {
114
+ code: "L1020",
115
+ cause: "A program is exactly one module and has nothing to export to.",
116
+ fix: "Remove the `export`.",
117
+ },
118
+ ExportDefaultDeclaration: {
119
+ code: "L1020",
120
+ cause: "A program is exactly one module and has nothing to export to.",
121
+ fix: "Remove the `export`.",
122
+ },
123
+ ExportAllDeclaration: {
124
+ code: "L1020",
125
+ cause: "A program is exactly one module and has nothing to export to.",
126
+ fix: "Remove the `export`.",
127
+ },
128
+ DoWhileStatement: {
129
+ code: "L1022",
130
+ cause: "`do...while` is not in the language.",
131
+ fix: "Use `while` with the condition checked first, or a `for` loop.",
132
+ },
133
+ LabeledStatement: {
134
+ code: "L1017",
135
+ cause: "Labels turn the derived flowchart's back-edges into arbitrary jumps.",
136
+ fix: "Restructure with a helper function or a boolean flag.",
137
+ },
138
+ SequenceExpression: {
139
+ code: "L1026",
140
+ cause: "The comma operator evaluates several expressions and keeps only the last, which hides work inside one expression.",
141
+ fix: "Write one statement per expression.",
142
+ },
143
+ MetaProperty: {
144
+ code: "L1020",
145
+ cause: "`import.meta` and `new.target` describe a module system and constructors, and this language has neither.",
146
+ fix: "Use `run()` for this run's own metadata.",
147
+ },
148
+ DebuggerStatement: {
149
+ code: "L1029",
150
+ cause: "`debugger` addresses a host debugger, and there is no host to address.",
151
+ fix: "Use `log(...)` to trace a value.",
152
+ },
153
+ });
154
+ /** Node types that occur only inside a forbidden node and are reported through their parent's row. */
155
+ export const FORBIDDEN_CHILDREN = Object.freeze([
156
+ "ClassBody",
157
+ "MethodDefinition",
158
+ "PropertyDefinition",
159
+ "StaticBlock",
160
+ "PrivateIdentifier",
161
+ "Super",
162
+ "ImportSpecifier",
163
+ "ImportDefaultSpecifier",
164
+ "ImportNamespaceSpecifier",
165
+ "ExportSpecifier",
166
+ ]);
167
+ /**
168
+ * Every node type acorn 8 emits for `ecmaVersion: 2023, sourceType: "module"`, whether or not it
169
+ * is in the language. `surface.smoke` asserts each one lands in exactly one of the sets above, so a
170
+ * node type acorn adds or one this file forgets is a red suite rather than a runtime surprise.
171
+ */
172
+ export const KNOWN_NODES = Object.freeze([
173
+ ...ADMITTED_NODES,
174
+ ...STRUCTURAL_NODES,
175
+ ...Object.keys(FORBIDDEN_NODES),
176
+ ...FORBIDDEN_CHILDREN,
177
+ ]);
178
+ //# sourceMappingURL=syntax.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntax.js","sourceRoot":"","sources":["../src/syntax.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,kGAAkG;AAClG,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACzD,aAAa;IACb,SAAS;IACT,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,gBAAgB;IAChB,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;IAChB,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,cAAc;IACd,SAAS;IACT,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,uBAAuB;IACvB,sBAAsB;IACtB,iBAAiB;IACjB,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;CACjB,CAAC,CA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ist/values.d.ts CHANGED
@@ -11,12 +11,31 @@ import type { ScopeFrame } from "./keys.js";
11
11
  /** Deep-freeze a value on its way across an effect boundary. Cycles are not reachable here: a
12
12
  * value that crosses a boundary has to canonicalize, and a cycle does not. */
13
13
  export declare function deepFreeze<T>(value: T): T;
14
+ /** Stamp a freshly built container with the depth of the frame building it. Returns the container. */
15
+ export declare function born<T>(value: T, depth: number): T;
16
+ /** The depth a container was born at. */
17
+ export declare function birthDepth(value: object): number;
18
+ /**
19
+ * Define an OWN property, never a prototype. `obj[key] = value` with key `__proto__` sets the
20
+ * prototype instead of a field, so every place the interpreter materializes a program-authored key
21
+ * (record literals, member writes, rest patterns) goes through here.
22
+ */
23
+ export declare function setOwn(target: object, key: string, value: unknown): void;
24
+ /**
25
+ * A value refused at an effect boundary, and WHY: a function is its own refusal (L3042) and every
26
+ * other shape without a canonical form is the same refusal (L3041), so the interpreter picks the
27
+ * code from `why` rather than from the message.
28
+ */
29
+ export declare class NotCrossable extends TypeError {
30
+ readonly why: "function" | "undefined" | "non-finite" | "opaque";
31
+ constructor(why: "function" | "undefined" | "non-finite" | "opaque", message: string);
32
+ }
14
33
  /**
15
34
  * A value that cannot canonicalize cannot be journalled, and a value that cannot be journalled
16
35
  * cannot be replayed. Catching it at the boundary is strictly better than discovering it at
17
36
  * digest time, because here we still know which argument it was.
18
37
  */
19
- export declare function assertCrossable(value: unknown, path?: string): void;
38
+ export declare function assertCrossable(value: unknown, path?: string, seen?: Set<object>): void;
20
39
  /**
21
40
  * The seeded PRNG.
22
41
  *
@@ -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;AAED;;;;GAIG;AACH,wBAAgB,e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I,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,SAAS,IAAI,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;QAC9F,4EAA4E;QAC5E,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;YAAE,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACF"}
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.22.0",
4
+ "version": "0.24.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -30,6 +30,6 @@
30
30
  "scripts": {
31
31
  "typecheck": "tsc -p tsconfig.json --noEmit",
32
32
  "build": "tsc -p tsconfig.json",
33
- "test": "tsx smoke/grammar.smoke.ts && tsx smoke/keys.smoke.ts && tsx smoke/journal.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"
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"
34
34
  }
35
35
  }