@procedures/compiler 0.0.0-stage → 0.2.3

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 (174) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +254 -2
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/checks.d.ts +24 -0
  5. package/dist/checks.d.ts.map +1 -0
  6. package/dist/checks.js +123 -0
  7. package/dist/checks.js.map +1 -0
  8. package/dist/codegen-closure.d.ts +19 -0
  9. package/dist/codegen-closure.d.ts.map +1 -0
  10. package/dist/codegen-closure.js +200 -0
  11. package/dist/codegen-closure.js.map +1 -0
  12. package/dist/codegen-text.d.ts +44 -0
  13. package/dist/codegen-text.d.ts.map +1 -0
  14. package/dist/codegen-text.js +360 -0
  15. package/dist/codegen-text.js.map +1 -0
  16. package/dist/diagnostics.d.ts +67 -0
  17. package/dist/diagnostics.d.ts.map +1 -0
  18. package/dist/diagnostics.js +38 -0
  19. package/dist/diagnostics.js.map +1 -0
  20. package/dist/effects.d.ts +63 -0
  21. package/dist/effects.d.ts.map +1 -0
  22. package/dist/effects.js +185 -0
  23. package/dist/effects.js.map +1 -0
  24. package/dist/explain.d.ts +58 -0
  25. package/dist/explain.d.ts.map +1 -0
  26. package/dist/explain.js +144 -0
  27. package/dist/explain.js.map +1 -0
  28. package/dist/facts.d.ts +66 -0
  29. package/dist/facts.d.ts.map +1 -0
  30. package/dist/facts.js +102 -0
  31. package/dist/facts.js.map +1 -0
  32. package/dist/fold.d.ts +27 -0
  33. package/dist/fold.d.ts.map +1 -0
  34. package/dist/fold.js +128 -0
  35. package/dist/fold.js.map +1 -0
  36. package/dist/index.d.ts +35 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +22 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/interceptor.d.ts +51 -0
  41. package/dist/interceptor.d.ts.map +1 -0
  42. package/dist/interceptor.js +116 -0
  43. package/dist/interceptor.js.map +1 -0
  44. package/dist/ir.d.ts +240 -0
  45. package/dist/ir.d.ts.map +1 -0
  46. package/dist/ir.js +74 -0
  47. package/dist/ir.js.map +1 -0
  48. package/dist/mermaid.d.ts +53 -0
  49. package/dist/mermaid.d.ts.map +1 -0
  50. package/dist/mermaid.js +423 -0
  51. package/dist/mermaid.js.map +1 -0
  52. package/dist/module.d.ts +20 -0
  53. package/dist/module.d.ts.map +1 -0
  54. package/dist/module.js +124 -0
  55. package/dist/module.js.map +1 -0
  56. package/dist/normalize.d.ts +43 -0
  57. package/dist/normalize.d.ts.map +1 -0
  58. package/dist/normalize.js +529 -0
  59. package/dist/normalize.js.map +1 -0
  60. package/dist/openrpc.d.ts +63 -0
  61. package/dist/openrpc.d.ts.map +1 -0
  62. package/dist/openrpc.js +57 -0
  63. package/dist/openrpc.js.map +1 -0
  64. package/dist/print.d.ts +8 -0
  65. package/dist/print.d.ts.map +1 -0
  66. package/dist/print.js +148 -0
  67. package/dist/print.js.map +1 -0
  68. package/dist/procedures/program/check.d.ts +14 -0
  69. package/dist/procedures/program/check.d.ts.map +1 -0
  70. package/dist/procedures/program/check.js +30 -0
  71. package/dist/procedures/program/check.js.map +1 -0
  72. package/dist/procedures/program/compile.d.ts +14 -0
  73. package/dist/procedures/program/compile.d.ts.map +1 -0
  74. package/dist/procedures/program/compile.js +35 -0
  75. package/dist/procedures/program/compile.js.map +1 -0
  76. package/dist/procedures/program/diagram.d.ts +14 -0
  77. package/dist/procedures/program/diagram.d.ts.map +1 -0
  78. package/dist/procedures/program/diagram.js +23 -0
  79. package/dist/procedures/program/diagram.js.map +1 -0
  80. package/dist/procedures/program/effects-output.d.ts +8 -0
  81. package/dist/procedures/program/effects-output.d.ts.map +1 -0
  82. package/dist/procedures/program/effects-output.js +13 -0
  83. package/dist/procedures/program/effects-output.js.map +1 -0
  84. package/dist/procedures/program/explain.d.ts +14 -0
  85. package/dist/procedures/program/explain.d.ts.map +1 -0
  86. package/dist/procedures/program/explain.js +43 -0
  87. package/dist/procedures/program/explain.js.map +1 -0
  88. package/dist/procedures/program/index.d.ts +5 -0
  89. package/dist/procedures/program/index.d.ts.map +1 -0
  90. package/dist/procedures/program/index.js +5 -0
  91. package/dist/procedures/program/index.js.map +1 -0
  92. package/dist/procedures/sdk/index.d.ts +3 -0
  93. package/dist/procedures/sdk/index.d.ts.map +1 -0
  94. package/dist/procedures/sdk/index.js +3 -0
  95. package/dist/procedures/sdk/index.js.map +1 -0
  96. package/dist/procedures/sdk/manifest.d.ts +11 -0
  97. package/dist/procedures/sdk/manifest.d.ts.map +1 -0
  98. package/dist/procedures/sdk/manifest.js +15 -0
  99. package/dist/procedures/sdk/manifest.js.map +1 -0
  100. package/dist/procedures/sdk/openrpc.d.ts +11 -0
  101. package/dist/procedures/sdk/openrpc.d.ts.map +1 -0
  102. package/dist/procedures/sdk/openrpc.js +13 -0
  103. package/dist/procedures/sdk/openrpc.js.map +1 -0
  104. package/dist/procedures/sdk/typescript.d.ts +11 -0
  105. package/dist/procedures/sdk/typescript.d.ts.map +1 -0
  106. package/dist/procedures/sdk/typescript.js +14 -0
  107. package/dist/procedures/sdk/typescript.js.map +1 -0
  108. package/dist/program.d.ts +84 -0
  109. package/dist/program.d.ts.map +1 -0
  110. package/dist/program.js +108 -0
  111. package/dist/program.js.map +1 -0
  112. package/dist/refs.d.ts +9 -0
  113. package/dist/refs.d.ts.map +1 -0
  114. package/dist/refs.js +9 -0
  115. package/dist/refs.js.map +1 -0
  116. package/dist/register.d.ts +6 -0
  117. package/dist/register.d.ts.map +1 -0
  118. package/dist/register.js +8 -0
  119. package/dist/register.js.map +1 -0
  120. package/dist/runtime.d.ts +68 -0
  121. package/dist/runtime.d.ts.map +1 -0
  122. package/dist/runtime.js +138 -0
  123. package/dist/runtime.js.map +1 -0
  124. package/dist/schema.d.ts +41 -0
  125. package/dist/schema.d.ts.map +1 -0
  126. package/dist/schema.js +325 -0
  127. package/dist/schema.js.map +1 -0
  128. package/dist/scopes.d.ts +25 -0
  129. package/dist/scopes.d.ts.map +1 -0
  130. package/dist/scopes.js +202 -0
  131. package/dist/scopes.js.map +1 -0
  132. package/dist/types.d.ts +129 -0
  133. package/dist/types.d.ts.map +1 -0
  134. package/dist/types.js +157 -0
  135. package/dist/types.js.map +1 -0
  136. package/dist/typescript-sdk.d.ts +34 -0
  137. package/dist/typescript-sdk.d.ts.map +1 -0
  138. package/dist/typescript-sdk.js +231 -0
  139. package/dist/typescript-sdk.js.map +1 -0
  140. package/package.json +83 -3
  141. package/src/checks.ts +128 -0
  142. package/src/codegen-closure.ts +224 -0
  143. package/src/codegen-text.ts +396 -0
  144. package/src/diagnostics.ts +98 -0
  145. package/src/effects.ts +231 -0
  146. package/src/explain.ts +194 -0
  147. package/src/facts.ts +161 -0
  148. package/src/fold.ts +136 -0
  149. package/src/index.ts +35 -0
  150. package/src/interceptor.ts +149 -0
  151. package/src/ir.ts +330 -0
  152. package/src/mermaid.ts +460 -0
  153. package/src/module.ts +171 -0
  154. package/src/normalize.ts +694 -0
  155. package/src/openrpc.ts +104 -0
  156. package/src/print.ts +143 -0
  157. package/src/procedures/program/check.ts +31 -0
  158. package/src/procedures/program/compile.ts +36 -0
  159. package/src/procedures/program/diagram.ts +25 -0
  160. package/src/procedures/program/effects-output.ts +16 -0
  161. package/src/procedures/program/explain.ts +46 -0
  162. package/src/procedures/program/index.ts +4 -0
  163. package/src/procedures/sdk/index.ts +2 -0
  164. package/src/procedures/sdk/manifest.ts +17 -0
  165. package/src/procedures/sdk/openrpc.ts +16 -0
  166. package/src/procedures/sdk/typescript.ts +17 -0
  167. package/src/program.ts +181 -0
  168. package/src/refs.ts +9 -0
  169. package/src/register.ts +10 -0
  170. package/src/runtime.ts +188 -0
  171. package/src/schema.ts +318 -0
  172. package/src/scopes.ts +196 -0
  173. package/src/types.ts +318 -0
  174. package/src/typescript-sdk.ts +282 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Mark Russell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,255 @@
1
- # Temporary Holding Version
1
+ # @procedures/compiler
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/@procedures/compiler?color=2346c4&label=npm)](https://www.npmjs.com/package/@procedures/compiler)
4
+
5
+ ```sh
6
+ npm install @procedures/compiler
7
+ ```
8
+
9
+ The compiler of procedure programs. A program is a procedure as data: a JSON tree of calls, names and references ([PROGRAM-FORMAT.md](../documentation/PROGRAM-FORMAT.md)).
10
+
11
+ - `checkProgram()` examines the whole program before the first procedure starts. It finds each problem and the effects of the program.
12
+ - `compileProgram()` writes the checked program as a plain `async (ctx, input) => output` function.
13
+ - `diagramProgram()` draws the program as a Mermaid flowchart.
14
+ - `explainProgram()` tells the effects of the program and the answer of the capability for each call.
15
+ - `toOpenRpc()` and `toTypeScriptSdk()` write an OpenRPC document and a typed TypeScript SDK from a manifest.
16
+ - The procedures `program.check`, `program.compile`, `program.diagram`, `program.explain`, `sdk.openrpc` and `sdk.typescript` give the same functions to the clients of a host.
17
+
18
+ The package works in a browser. It reads the facts of the procedures from a manifest (`procedure.manifest`) or from a registry.
19
+
20
+ ## Why a check before the run
21
+
22
+ The interpreter of `@procedures/client` finds a problem only when it arrives at the problem. Example: step 1 writes a file, step 2 writes a commit, and step 3 calls a procedure that the capability refuses. The refusal comes after two writes.
23
+
24
+ `checkProgram()` finds the refusal of step 3 before step 1 starts. When the result has an error, the host does not start the program.
25
+
26
+ ## What the check finds
27
+
28
+ | Code | Severity | The problem |
29
+ |---|---|---|
30
+ | `unknown-name` | error | A `$ref` reads a name that no scope has. |
31
+ | `use-before-definition` | error | A `$ref` reads the `$name` of a later step of the chain. |
32
+ | `unknown-procedure` | error | No procedure has the path, or the host does not expose it in its manifest. |
33
+ | `not-exposed` | error | The registry has the procedure, but the expose rule of the host refuses it. |
34
+ | `capability-refused` | error | The capability refuses the call: its effects, or a destructive procedure. |
35
+ | `effects-unknown` | error with a capability that limits effects, else info | The compiler cannot see what a call runs (`dag.traverse`, a defined body that the manifest does not show). The check fails closed. |
36
+ | `input-schema` | error | A literal part of an input does not agree with the JSON Schema of the procedure. |
37
+ | `invalid-control-flow` | error | The input of `client.chain`, `client.map` or another control-flow procedure does not agree with its schema. |
38
+ | `fn-not-call` | error | The `fn` of `client.map` or `client.reduce` is not one call. |
39
+ | `depth-limit`, `data-depth`, `cyclic-input` | error | The input goes past a limit of the hydration. |
40
+ | `invalid-path`, `root-not-call` | error | A `$proc` path is not valid, or the program is not a call. |
41
+ | `never-trap` | warning | A `$never` call is data in a place where a call usually starts: a chain step, a condition, a `fn`, a list that is not a chain. |
42
+ | `unscoped-ref` | warning | A `$ref` is outside each scope, so it is data. |
43
+ | `name-not-bound`, `duplicate-name` | warning | A `$name` that no `$ref` can read, or two steps with one name. |
44
+ | `input-replaced` | warning | Control flow adds `cwd` to an input that is not an object, so the input is lost. |
45
+ | `implicit-chain`, `deferred-call` | info | An array of calls operates as one chain, or a call waits for its runner. |
46
+
47
+ Each diagnostic has a JSON pointer (RFC 6901) to its part of the program.
48
+
49
+ ## Effects
50
+
51
+ The check gives the effects of the whole program, from the bottom up:
52
+
53
+ - `effects` is the upper bound. It has the reads and the writes of each call that can start. A call that does not declare its effects makes the list unknown: the list is absent.
54
+ - `mustEffects` is the lower bound: the effects of each run in which no call fails. Two branches give the intersection of their effects. A later operand of `client.and` gives nothing.
55
+
56
+ `effects` has the form of the `effects` of a manifest entry, so a host can give it to `capabilityRefusal()`.
57
+
58
+ ## Use the check
59
+
60
+ ```typescript
61
+ import { checkProgram } from "@procedures/compiler";
62
+
63
+ // A host: the registry gives the procedures and the bodies of the defined procedures
64
+ const result = checkProgram(program, {
65
+ registry,
66
+ expose: policy.expose,
67
+ capability: { effects: { writes: [] } },
68
+ });
69
+ if (!result.ok) {
70
+ for (const diagnostic of result.diagnostics) console.log(diagnostic.pointer, diagnostic.message);
71
+ }
72
+
73
+ // A browser: only the manifest of the host
74
+ const manifest = await client.exec(["procedure", "manifest"], {});
75
+ const checked = checkProgram(program, { manifest });
76
+ ```
77
+
78
+ Give `mode: "body"` for the body of a procedure that `procedure.define` makes. Then the scope has the name `input`.
79
+
80
+ ## Check each program of a host
81
+
82
+ `programCheckInterceptor()` checks the program of each call to a data-driven procedure before the procedure starts. When the check finds an error, the host refuses the call, and no step starts. The MCP server of `@procedures/mcp-dev-tools` uses it.
83
+
84
+ ```typescript
85
+ import { programCheckInterceptor } from "@procedures/compiler";
86
+
87
+ const server = new ProcedureServer({
88
+ registry,
89
+ expose,
90
+ interceptors: [programCheckInterceptor({ registry, expose })],
91
+ });
92
+ ```
93
+
94
+ - The error has the code of the interpreter for the same problem: `NOT_EXPOSED`, `NOT_FOUND`, `FORBIDDEN` with its reason, or `VALIDATION_ERROR`.
95
+ - The check is conservative. It refuses a call in a branch that does not run, and a refused call inside `client.tryCatch`.
96
+ - The interceptor keeps the facts of the registry until the registry changes.
97
+ - `refuses` selects the diagnostics that refuse a program. The default refuses each error.
98
+
99
+ ## Use the compiler
100
+
101
+ ```typescript
102
+ import { compileProgram } from "@procedures/compiler";
103
+
104
+ const compiled = await compileProgram(program, { registry, language: "ts" });
105
+
106
+ // The closure code: a host runs it in a procedure handler. It uses no eval.
107
+ const output = await compiled.run(ctx, input);
108
+
109
+ // The source text: an ES module whose default export is the function
110
+ await writeFile("program.ts", compiled.code);
111
+ ```
112
+
113
+ The compiled function makes each call through `ctx.client.call`, in the order of the interpreter. Each call keeps its validation, admission, deadline and interceptors. The function does the work of the control-flow procedures in line: it does not start `client.chain` or `client.map`.
114
+
115
+ A call whose procedure takes its input raw (`client.eval`, `dag.traverse`, `procedure.define`) is a dynamic node. The function gives such a procedure the raw input and the scope, and the interpreter of the client operates it.
116
+
117
+ `client.exec(program, input)` puts the fields of `input` over the input of the root call. That changes the program, so the compiled function gives such an input to the interpreter.
118
+
119
+ `fold: true` computes the pure core procedures with literal inputs at compile time. Only a core procedure of `@procedures/client` with `reads: []` and `writes: []` folds. A folded call does not start, so an interceptor does not see it.
120
+
121
+ The result has `code` (the module), `body` (the function body for a host that evaluates code), `sourceMap` (the lines of the code and their pointers), `registryHash` (the hash of the manifest) and the result of the check. Give `registryHash` to the host with the code: a different hash means different procedures.
122
+
123
+ ## Draw a program
124
+
125
+ ```typescript
126
+ import { diagramProgram } from "@procedures/compiler";
127
+
128
+ const { mermaid, diagnostics } = diagramProgram(program, { registry });
129
+ ```
130
+
131
+ The flowchart comes from the IR, so it shows the order of the interpreter. A solid arrow is the order of the steps. A dotted arrow carries data.
132
+
133
+ | Part of the program | Part of the flowchart |
134
+ |---|---|
135
+ | A call | A box with the key of the procedure. A call in an input comes before its call. |
136
+ | `client.chain` | A subgraph with the steps in order |
137
+ | `client.parallel` | A fork node, an arrow to each task, and a join node |
138
+ | `client.conditional` | The condition, then a decision node with a `then` arrow and an `else` arrow |
139
+ | `client.tryCatch` | A `try` subgraph, and an `error` arrow from the subgraph to the catch part |
140
+ | `client.map`, `client.reduce` | A loop node: an `each item` arrow to `fn`, an arrow back, and a `done` arrow |
141
+ | `client.and`, `client.or` | The operands in order, and a stop arrow from each operand to the join node |
142
+ | `$ref` | A dotted arrow from the part that binds the name to the part that reads it |
143
+ | A dynamic call | A box with double sides and the reason. A `runs` subgraph shows its program, when the compiler can see it. |
144
+ | A deferred call, a `$never` call | A box with a dashed border: the call is data |
145
+
146
+ - A node with an error of the check has the class `error`. A `$ref` to an unknown name gets its own node.
147
+ - `mermaidText()` keeps letters, digits, spaces and some punctuation. It writes each other character as an entity code, for example `#34;` for a quote.
148
+ - Thus no text of a program can break the syntax of the flowchart. Quotes, brackets, `<`, line breaks and Unicode line separators are safe.
149
+ - `toMermaid(ir)` draws an IR that you have already. The golden flowcharts are in `test/golden/*.mmd`.
150
+
151
+ ## Explain a program
152
+
153
+ ```typescript
154
+ import { explainProgram } from "@procedures/compiler";
155
+
156
+ const explanation = explainProgram(program, { registry, capability: { effects: { writes: [] } } });
157
+ console.log(explanation.summary);
158
+ // The program has 5 calls of 4 procedures. The program can read store and can change store. ...
159
+ ```
160
+
161
+ `explainProgram()` uses `checkProgram()` and `explainInvocation()` of `@procedures/client`. The result has these parts:
162
+
163
+ - `effects` and `mustEffects`: the effects of the check.
164
+ - `calls`: each call in the order of the tree, with its key, path, pointer and kind (`call`, `control` or `dynamic`).
165
+ - For each call: the declared `effects`, `known`, `exposed`, and `permitted`, `reason` and `message` under the capability.
166
+ - `diagnostics`: the problems of the check.
167
+ - `summary`: the same information in short sentences. An application can show it to a user before the program starts.
168
+
169
+ ## OpenRPC and a typed SDK
170
+
171
+ ```typescript
172
+ import { toOpenRpc, toTypeScriptSdk } from "@procedures/compiler";
173
+
174
+ const manifest = await client.exec(["procedure", "manifest"], {});
175
+ const document = toOpenRpc(manifest);
176
+ const source = toTypeScriptSdk(manifest);
177
+ ```
178
+
179
+ `toOpenRpc()` gives an OpenRPC 1.3 document with one method for each procedure:
180
+
181
+ - The name of the method is the key of the procedure. `x-path` is the path.
182
+ - The one parameter `input` has the input schema. The result `output` has the output schema.
183
+ - `x-effects` has the declared effects. `x-data-driven` marks a procedure that operates its input as a program.
184
+ - The keys have a fixed order, and the methods are in the order of their names. Thus one manifest always gives the same text.
185
+
186
+ `toTypeScriptSdk()` gives the source of a TypeScript module without imports:
187
+
188
+ - An input type and an output type for each procedure, from the JSON Schemas.
189
+ - The interface `Sdk`, with a method for each procedure at `sdk.<namespace>.<name>`.
190
+ - The function `createSdk(client)`. Each method sends its path and its input to `client.call(path, input)`.
191
+
192
+ ```typescript
193
+ import { createSdk } from "./sdk.js";
194
+
195
+ // In a procedure handler: ctx.client calls the procedures of the host
196
+ const sdk = createSdk(ctx.client);
197
+ const value = await sdk.client.identity({ value: 1 });
198
+
199
+ // With a Client
200
+ const remote = createSdk({ call: (path, input) => client.exec(path, input) });
201
+ ```
202
+
203
+ The converter of the schemas knows a part of JSON Schema:
204
+
205
+ - An object with its `required` list. A property name that is not an identifier gets quotes.
206
+ - An array, a string, a number, an integer, a boolean and `null`.
207
+ - `enum`, `const`, `anyOf` and `oneOf` as unions.
208
+ - `additionalProperties` as an index signature.
209
+ - Each other schema gives `unknown`.
210
+
211
+ A test writes the SDK of the core procedures to a temporary folder. It type-checks the SDK with the TypeScript and the strict options of this package.
212
+
213
+ ## The procedures
214
+
215
+ ```typescript
216
+ import "@procedures/compiler/register";
217
+
218
+ const checked = await client.exec(["program", "check"], { program, capability: { effects: { writes: [] } } });
219
+ const compiled = await client.exec(["program", "compile"], { program, language: "ts" });
220
+ const drawn = await client.exec(["program", "diagram"], { program, direction: "LR" });
221
+ const explained = await client.exec(["program", "explain"], { program });
222
+ const document = await client.exec(["sdk", "openrpc"], { namespace: "client" });
223
+ const sdk = await client.exec(["sdk", "typescript"], {});
224
+ ```
225
+
226
+ - The four `program.*` procedures take the program as data (the `raw-input` tag): nothing of it starts.
227
+ - `program.check`, `program.compile` and `program.explain` take a `capability` in the input. Without it, they use the capability of the caller, as `program.diagram` does.
228
+ - `program.compile` gives the source text, not the closure code.
229
+ - `sdk.openrpc` and `sdk.typescript` describe the registry of the caller, as `procedure.manifest` does. The input `namespace` selects one namespace.
230
+ - The six procedures read the registry and obey the expose rule of the host. They change nothing.
231
+ - The MCP server of `@procedures/mcp-dev-tools` gives the `program.*` procedures as tools. The namespace `sdk` is not a tool namespace.
232
+ - `createRegistry(compilerModule)` gives them without the global registry.
233
+
234
+ ## The intermediate representation
235
+
236
+ The normalize pass makes the IR. Each node has the pointer of its source.
237
+
238
+ | Node | Source |
239
+ |---|---|
240
+ | `literal` | Data, a `$literal`, a `$never` call, a `$ref` outside each scope |
241
+ | `object`, `array` | Plain data with calls or references in it |
242
+ | `reference` | A `$ref` in a scope, with the binding that the scopes pass finds |
243
+ | `call` | A call that starts, with its hydrated input |
244
+ | `deferred` | A call that waits for its runner (`$parent` or a context name) |
245
+ | `chain`, `parallel`, `conditional`, `try`, `and`, `or`, `map`, `reduce` | The core control-flow procedures, explicit or implicit |
246
+ | `dynamic` | A call of a procedure that takes its input raw, and a control-flow call with an input that is not valid |
247
+ | `fail` | A step of the interpreter that throws: a hydration limit, a `fn` that is not a call |
248
+
249
+ `printIR()` gives the IR as text. The passes are also exports: `normalize()`, `resolveScopes()`, `inferEffects()`, `checkCalls()`, `foldProgram()`, `compileClosure()` and `emitText()`.
250
+
251
+ ## Tests
252
+
253
+ A property test makes hundreds of random programs. It starts each program three times: with the interpreter, with the closure code and with the source text. The three runs must give the same result or error. They must start the same procedures in the same order. A second property examines that each run has only the inferred effects.
254
+
255
+ A third property draws the flowchart of each random program and examines the grammar of each line. The golden files in `test/golden` hold the IR, the source text, the flowcharts, an OpenRPC document and an SDK. To accept an intended change, start `npx vitest run -u` in this package and examine the diff.
@@ -0,0 +1 @@
1
+ {"version":"7.0.2","root":[[193,207],[303,321]],"packageJsons":["../../../node_modules/.pnpm/@mark1russell7+quantity@0.2.0_zod@4.6.5/node_modules/@mark1russell7/quantity/package.json","../../../node_modules/.pnpm/@mark1russell7+service@0.4.0_zod@4.6.5/node_modules/@mark1russell7/service/package.json","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/package.json","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/package.json","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/package.json","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/package.json","../../client/package.json","../package.json"],"missingPackageJsons":["../../../node_modules/.pnpm/@mark1russell7+quantity@0.2.0_zod@4.6.5/node_modules/@mark1russell7/quantity/build/package.json","../../../node_modules/.pnpm/@mark1russell7+service@0.4.0_zod@4.6.5/node_modules/@mark1russell7/service/build/package.json","../../../node_modules/.pnpm/@mark1russell7+service@0.4.0_zod@4.6.5/node_modules/ioredis/package.json","../../../node_modules/tslib/package.json","../../client/node_modules/@mark1russell7/service/clock/package.json","../node_modules/@procedures/client/browser/package.json","../node_modules/tslib/package.json"],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.es2021.d.ts","lib.es2022.d.ts","lib.es2023.d.ts","lib.es2024.d.ts","lib.es2025.d.ts","lib.esnext.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.es2021.promise.d.ts","lib.es2021.string.d.ts","lib.es2021.weakref.d.ts","lib.es2021.intl.d.ts","lib.es2022.array.d.ts","lib.es2022.error.d.ts","lib.es2022.intl.d.ts","lib.es2022.object.d.ts","lib.es2022.string.d.ts","lib.es2022.regexp.d.ts","lib.es2023.array.d.ts","lib.es2023.collection.d.ts","lib.es2023.intl.d.ts","lib.es2024.arraybuffer.d.ts","lib.es2024.collection.d.ts","lib.es2024.object.d.ts","lib.es2024.promise.d.ts","lib.es2024.regexp.d.ts","lib.es2024.sharedmemory.d.ts","lib.es2024.string.d.ts","lib.es2025.collection.d.ts","lib.es2025.float16.d.ts","lib.es2025.intl.d.ts","lib.es2025.iterator.d.ts","lib.es2025.promise.d.ts","lib.es2025.regexp.d.ts","lib.esnext.array.d.ts","lib.esnext.collection.d.ts","lib.esnext.date.d.ts","lib.esnext.decorators.d.ts","lib.esnext.disposable.d.ts","lib.esnext.error.d.ts","lib.esnext.intl.d.ts","lib.esnext.sharedmemory.d.ts","lib.esnext.temporal.d.ts","lib.esnext.typedarrays.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../../client/dist/procedures/schema.d.ts","../../client/dist/client/validation/types.d.ts","../../client/dist/procedures/collection/storage.d.ts","../../client/dist/events/types.d.ts","../../client/dist/procedures/ref.d.ts","../../client/dist/procedures/types.d.ts","../../client/dist/procedures/registry.d.ts","../../client/dist/client/deadline.d.ts","../../client/dist/procedures/capability.d.ts","../../client/dist/procedures/invoke.d.ts","../../client/dist/client/errors/types.d.ts","../../client/dist/client/errors/codes.d.ts","../../client/dist/client/errors/registry.d.ts","../../client/dist/client/errors/factory.d.ts","../../client/dist/client/errors/http-status.d.ts","../../client/dist/client/errors/http-errors.d.ts","../../client/dist/client/errors/index.d.ts","../../client/dist/client/types.d.ts","../../../node_modules/.pnpm/@mark1russell7+quantity@0.2.0_zod@4.6.5/node_modules/@mark1russell7/quantity/build/quantity-crdp15ks.d.ts","../../../node_modules/.pnpm/@mark1russell7+quantity@0.2.0_zod@4.6.5/node_modules/@mark1russell7/quantity/build/index.d.ts","../../client/dist/duration.d.ts","../../client/dist/client/middleware/contexts.d.ts","../../client/dist/client/context.d.ts","../../client/dist/client/consumption.d.ts","../../client/dist/client/call-types.d.ts","../../client/dist/client/client.d.ts","../../client/dist/adapters/http/shared/constants.d.ts","../../client/dist/adapters/http/shared/status-codes.d.ts","../../client/dist/adapters/http/shared/headers.d.ts","../../client/dist/adapters/http/shared/strategies.d.ts","../../client/dist/adapters/http/shared/errors.d.ts","../../client/dist/adapters/http/shared/index.d.ts","../../client/dist/adapters/http/client/types.d.ts","../../client/dist/adapters/http/client/transport.d.ts","../../client/dist/adapters/http/client/index.d.ts","../../client/dist/adapters/local/client/types.d.ts","../../client/dist/adapters/local/client/transport.d.ts","../../client/dist/adapters/local/client/index.d.ts","../../../node_modules/.pnpm/@mark1russell7+service@0.4.0_zod@4.6.5/node_modules/@mark1russell7/service/build/clock-d-38uh_z.d.ts","../../../node_modules/.pnpm/@mark1russell7+service@0.4.0_zod@4.6.5/node_modules/@mark1russell7/service/build/clock.d.ts","../../client/dist/clock.d.ts","../../client/dist/machines.d.ts","../../client/dist/server/types.d.ts","../../client/dist/adapters/websocket/client/types.d.ts","../../client/dist/adapters/websocket/client/transport.d.ts","../../client/dist/adapters/websocket/client/index.d.ts","../../client/dist/adapters/mock/client/types.d.ts","../../client/dist/adapters/mock/client/transport.d.ts","../../client/dist/adapters/mock/client/builder.d.ts","../../client/dist/adapters/mock/client/index.d.ts","../../client/dist/client/middleware/retry.d.ts","../../client/dist/client/middleware/items.d.ts","../../client/dist/client/middleware/cache.d.ts","../../client/dist/client/middleware/timeout.d.ts","../../client/dist/client/middleware/circuit-breaker.d.ts","../../client/dist/client/middleware/rate-limit.d.ts","../../client/dist/client/middleware/resilience.d.ts","../../client/dist/client/middleware/pagination.d.ts","../../client/dist/client/middleware/auth.d.ts","../../client/dist/client/middleware/tracing.d.ts","../../client/dist/client/validation/middleware.d.ts","../../client/dist/client/validation/index.d.ts","../../client/dist/client/typed.d.ts","../../client/dist/client/index.d.ts","../../client/dist/server/server.d.ts","../../client/dist/procedures/idempotency.d.ts","../../client/dist/server/procedure-server.d.ts","../../client/dist/server/request-auth.d.ts","../../client/dist/procedures/interceptors.d.ts","../../client/dist/server/host-procedures.d.ts","../../client/dist/server/method.d.ts","../../client/dist/procedures/effects.d.ts","../../client/dist/procedures/manifest.d.ts","../../client/dist/procedures/define.d.ts","../../client/dist/procedures/collection/schemas.d.ts","../../client/dist/procedures/collection/procedures.d.ts","../../client/dist/procedures/collection/index.d.ts","../../client/dist/procedures/discovery.d.ts","../../client/dist/procedures/module.d.ts","../../client/dist/procedures/core/schemas.d.ts","../../client/dist/procedures/core/logic.d.ts","../../client/dist/procedures/core/results.d.ts","../../client/dist/procedures/core/math.d.ts","../../client/dist/procedures/core/comparison.d.ts","../../client/dist/procedures/core/string.d.ts","../../client/dist/procedures/core/type.d.ts","../../client/dist/procedures/core/object.d.ts","../../client/dist/procedures/core/array.d.ts","../../client/dist/procedures/core/meta.d.ts","../../client/dist/procedures/core/index.d.ts","../../client/dist/procedures/runtime-programs.d.ts","../../client/dist/procedures/define-procedure.d.ts","../../client/dist/procedures/index.d.ts","../../client/dist/procedures/policy.d.ts","../../client/dist/timers.d.ts","../../client/dist/adapters/port/transport.d.ts","../../client/dist/tracing/traceparent.d.ts","../../client/dist/protocol.d.ts","../../client/dist/server/browser-guard.d.ts","../../client/dist/server/host-policy.d.ts","../../client/dist/client/route-resolver.d.ts","../../client/dist/client/batch-executor.d.ts","../../client/dist/events/bus.d.ts","../../client/dist/events/index.d.ts","../../client/dist/browser.d.ts","../src/ir.ts","../src/facts.ts","../src/effects.ts","../src/schema.ts","../src/diagnostics.ts","../src/checks.ts","../src/runtime.ts","../src/codegen-closure.ts","../src/codegen-text.ts","../src/refs.ts","../src/normalize.ts","../src/scopes.ts","../src/fold.ts","../src/program.ts","../src/explain.ts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/standard-schema.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ar.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/az.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bg.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bn.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ca.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ckb.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/cs.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/da.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/de.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/el.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/eo.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/es.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fa.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fi.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr-ca.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/gu.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/he.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hi.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hr.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hu.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/id.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/is.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/it.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ja.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ka.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kh.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/km.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kn.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ko.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/mk.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ms.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ne.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nl.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nn.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/no.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ota.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ps.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pl.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt-br.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ro.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sk.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sl.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sv.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ta.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tg.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/th.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tk.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tr.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ua.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uk.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ur.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uz.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/vi.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-cn.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-tw.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/yo.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/index.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/compile.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-generator.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/index.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/checks.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/from-json-schema.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/deep-partial.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/in-out.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.d.cts","../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/index.d.cts","../src/types.ts","../src/procedures/program/effects-output.ts","../src/procedures/program/check.ts","../src/procedures/program/compile.ts","../src/mermaid.ts","../src/procedures/program/diagram.ts","../src/procedures/program/explain.ts","../src/openrpc.ts","../src/procedures/sdk/manifest.ts","../src/procedures/sdk/openrpc.ts","../src/typescript-sdk.ts","../src/procedures/sdk/typescript.ts","../src/module.ts","../src/interceptor.ts","../src/print.ts","../src/index.ts","../src/register.ts","../src/procedures/program/index.ts","../src/procedures/sdk/index.ts"],"fileInfos":[{"version":"16934abaab7026ac114da441aabea1a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638","e5cb86a5fc491796ecd1d2dd348d208f","feb6c6fb19cdb246a5d8acb36a6901c7","9443a7f109277ffaa79d893ed2549995","793cee405385076e27c24f409659dccd","09f69c6610266eaee1ac9e3e30df2c71","62bad718844246b8e17547f37bad6085",{"version":"926204c28cd3d073865348473ae28d2e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f25e42c801b2cb3cf2b39792006a9beb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1708ea4d34dc37fadadc63ca01127e80","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2b056277dd138e8f5650fc04e20eaa8d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1da2c1f258970fd3cc91184f69e91a9d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4ef72aa378127e7b7abba915b0110b1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3ec74c6a7d4463f0254db3a74cf75646","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"84c2bdfa470d075526cce6322d81b0b6","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0b3844c2b8c73e4e1ab91431411cad11","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4fc71cf4a15b8d99675a31df77f26e07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d1b49564ddaeca3df5b6dbae925d2242","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6a25be566d60ccfc2d6e8b7bfdeefa83","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8a20e27646985dfd58c57ca6566553dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9969f02ad3cdcbf4f709405cda44167f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9c9be4792a7a4f42c15ae7360bf28779","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8cf777fe00349b71ee9c4b6f3fe7fd19","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"74f96bc192530c9723f572bfff3d3078","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1df91c56b25955c56387426f378173c5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"38856f70edcd2115c355d96ec77cc09e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"de8700156c1275465bcd473c28b359aa","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d47cfdb6ede40518357bb5a4cd7cd9fb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6e5773860cd9e5b15e683113f642ab47","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"30ff5fe1682f7fcd629880476ca3c2e0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf23d7d1b40b9015b694ddc2f011752f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2cc585d42e2c548f9f24a30a1989fd33","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"713906ce9d332d2242b7f05ed9304be3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0219894bfe5042c7e1aa2d22e4a91ed0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6009ffff7e43c93318804d2d28e37fe3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"03be89b227587594fbb50509fc1c2e45","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b30df52dc24740c0bad7c55c3511df7d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ab8d3c9b5ed5c2ab8f383607eef439f0","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d950ec671d0a8e07f3c1a31e94abed86","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1abef2ace5eccb02d60dd73cd5a5ee4c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5f0a3044029d1cc081b5887eb4deb07","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d57c697f1446940ec4bfe669c962e2c4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"be41035d7b941482a1e1ae6a5c5dcca5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"10f7d9da7564f27f8ddf4a162b6da6d3","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1d0520af549e0c3581f15173cc713ca1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d65083f97fd741cff028472563eddb79","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"da7f24f00653ebac660ac1c0821ed33d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7cb5ae9e65516ea2235f0721f6aac43c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"5bac83d1dccda3197da2606db1ac3c89","impliedNodeFormat":99},{"version":"006bbe75d9dc7ccf680d5b3118033f1f","impliedNodeFormat":99},{"version":"67820a5fcc47f78aa82c9b0ff630a44d","impliedNodeFormat":99},{"version":"337b6cdf77b57ce90d09ddac000c74fc","impliedNodeFormat":99},{"version":"c9e5a8b8853281fd2a7490f1150a4593","impliedNodeFormat":99},{"version":"977cfa0e70eae9a396843eac6e67efa6","impliedNodeFormat":99},{"version":"8d9042d3b304792479c25ade194f1bad","impliedNodeFormat":99},{"version":"1f55ed21bf520915c4c9aeda10d31f45","impliedNodeFormat":99},{"version":"48cc158308806fc03a0c33bac87c9389","impliedNodeFormat":99},{"version":"237950bb8577250f6fc512d4a8c9ec87","impliedNodeFormat":99},{"version":"0868d21131f63c6318ecade7eb7210be","impliedNodeFormat":99},{"version":"8dcbe656772cea64e3bb7ff0b5d59f37","impliedNodeFormat":99},{"version":"a5a0d22c49f369c16e12c1e5813ab6d3","impliedNodeFormat":99},{"version":"c51a9a4153a693d98890ac03ee84c855","impliedNodeFormat":99},{"version":"9ac07717997d43affd1498e85689a1a3","impliedNodeFormat":99},{"version":"a7e8132761007fe6701dbf4326024341","impliedNodeFormat":99},{"version":"f1a5fa6676aa7ac22654446cad9d3d95","impliedNodeFormat":99},{"version":"4c11e2a8740860fa46e4ec7c077b0aec","impliedNodeFormat":99},{"version":"0c62ab8a6c6c17a6170cb9cb43cd0fd4","impliedNodeFormat":99},{"version":"ef04761e17067dfda48057ed3deb2d70","impliedNodeFormat":99},{"version":"44ebf9c9d31295ba6c8e8269158d9a08","impliedNodeFormat":99},{"version":"23e2467c2b42be0e0e30c434125a9bf7","impliedNodeFormat":99},{"version":"4a1dc81d4a48c84e39c5573bc6a36181","impliedNodeFormat":99},{"version":"313de785aa7f53811273f58137396514","impliedNodeFormat":99},{"version":"1b9b690b1f336ef9423e124a808fe9bc","impliedNodeFormat":99},{"version":"1e294f2d41148543bdc673d2bff201c1","impliedNodeFormat":99},{"version":"7cf32e882dd594ac59d9e80978aa42ea","impliedNodeFormat":99},{"version":"8b5081e477e7845ac094d6b6cb5e8ec0","impliedNodeFormat":99},{"version":"973904e4766d26c9c60b05f71e718c7b","impliedNodeFormat":99},{"version":"41e03d403b9e0d632f3af81214cd8345","impliedNodeFormat":99},{"version":"523c21a5413305f17526b5b6cf535179","impliedNodeFormat":99},{"version":"eef5d85571d408190ce31d195bf03ed2","impliedNodeFormat":99},{"version":"115ccee921a92e3cade320d8c78eafc6","impliedNodeFormat":99},{"version":"e97d44ee39595a8d8e1e6cdaaf7b4fed","impliedNodeFormat":99},{"version":"265783c002544231a2c57c1b345e1cea","impliedNodeFormat":99},{"version":"3492503daa6bca0bbbbb5a1dffcbc28c","impliedNodeFormat":99},{"version":"2271435d60ba7a766a8c224d3d3ff69f","impliedNodeFormat":99},{"version":"00bc3f83d4845807f8271ab3c745ff67","impliedNodeFormat":99},{"version":"cb253c36ff68485e2c8706a6bbc2ec0e","impliedNodeFormat":99},{"version":"2daa311686c19678d59d0d3d017b8585","impliedNodeFormat":99},{"version":"7f11723418740531ec8f18f99675044e","impliedNodeFormat":99},{"version":"60d3806d52580ec961a83b0585a7f328","impliedNodeFormat":99},{"version":"c84033a035e3223e4c8e6597de17e34f","impliedNodeFormat":99},{"version":"df356f2b4a8cd3a121c404fdb408e10d","impliedNodeFormat":99},{"version":"7dcbe7011088254a72fb413dadca58d1","impliedNodeFormat":99},{"version":"742ea0384304d954f45ce2b6697c7f91","impliedNodeFormat":99},{"version":"f911f4d32a20b760f2082e6fbde5514f","impliedNodeFormat":99},{"version":"a4acfea690d58c4b47dfe275e2743f7f","impliedNodeFormat":99},{"version":"001090557d1d3df1f2482abcf561af1e","impliedNodeFormat":99},{"version":"bc833b857dd9a2ad2a2cc5b60a309d4e","impliedNodeFormat":99},{"version":"d0dd0a02f8c8f11b782f5144ca08db94","impliedNodeFormat":99},{"version":"21433b1e768e15bfe77c63a9b48129ec","impliedNodeFormat":99},{"version":"d79590e60df4adfdd1c6e6c31e7ddf2d","impliedNodeFormat":99},{"version":"7df7c12156e08542ad15262c05194dec","impliedNodeFormat":99},{"version":"443968f2e765f35e0e6919efbe2ecaf5","impliedNodeFormat":99},{"version":"951da67f7f3dbb230f93e18a93119875","impliedNodeFormat":99},{"version":"bd4831330348d981b0f1410853eed767","impliedNodeFormat":99},{"version":"8c4b62b4a00c51da5f8b7caffe0f03ee","impliedNodeFormat":99},{"version":"9d8af42705105f6cfb47f9977e7e284b","impliedNodeFormat":99},{"version":"cafd4971c8d191559ccf3da376bb0fd6","impliedNodeFormat":99},{"version":"a58c141c24aa04a112fc8161e137592d","impliedNodeFormat":99},{"version":"d7ebd2c11fe146421387e883bb5c2ccd","impliedNodeFormat":99},{"version":"c261f3352382743318751612666c0f97","impliedNodeFormat":99},{"version":"c459f8dc2e984ab671662db372f49932","impliedNodeFormat":99},{"version":"16a73e4f9e9624e100119801052dc414","impliedNodeFormat":99},{"version":"dbff35b7a2b96efb2e37796539f645d5","impliedNodeFormat":99},{"version":"437e3c97f8de63e451c7e02fdbe47b4d","impliedNodeFormat":99},{"version":"43f5748650e99b4a1400717ceeb6da8c","impliedNodeFormat":99},{"version":"73102c1ff81b38ac4f96268acbc2823b","impliedNodeFormat":99},{"version":"754cd9e61e4f9feafe2404c533c8a936","impliedNodeFormat":99},{"version":"a7be7da3e0ff8a23e075c90fda9b6a33","impliedNodeFormat":99},{"version":"5a6e5aeecea8b44bac91fe48e7628d87","impliedNodeFormat":99},{"version":"ed8bf8b7b6254862a4836633e9c3f0f1","impliedNodeFormat":99},{"version":"549cdf7be9336865a24bbec9308f85c0","impliedNodeFormat":99},{"version":"484dc5040b1f3d2fd749a7531d0c6405","impliedNodeFormat":99},{"version":"0ba7ff53392a2a3b944cacbcf0b78b07","impliedNodeFormat":99},{"version":"17ca75b48a8fc1862386fea6fa7bdbff","impliedNodeFormat":99},{"version":"9b4982c4091dd5f18b8c1c81cf137c07","impliedNodeFormat":99},{"version":"5758228826deea77ba36666c076f1c0a","impliedNodeFormat":99},{"version":"4645c760c24932f240081a5688f9e5f4","impliedNodeFormat":99},{"version":"80d6a2ecb0aa22e5ee13b8ab2762cf32","impliedNodeFormat":99},{"version":"8f129880dcb2313f3badfed346ec2581","impliedNodeFormat":99},{"version":"035542f7200f4d22e59ecfa10f94739e","impliedNodeFormat":99},{"version":"2db291ced724b83ae656c59391a00271","impliedNodeFormat":99},{"version":"a9ac721f09236b64e6854577cfc36eaf","impliedNodeFormat":99},{"version":"5c207e5b00d64cd0c543e274e6036525","impliedNodeFormat":99},{"version":"b483fb83736a2f60e7194b82d08fb9c6","impliedNodeFormat":99},{"version":"efd280bdeb72be78b6ea34915ef99611","impliedNodeFormat":99},{"version":"dcdd6487a6e5216fafcf5f65da2cc51c","impliedNodeFormat":99},{"version":"925ec76390339184338710dad0d25956","impliedNodeFormat":99},{"version":"b6be181d2552152e604924fd778377b5","impliedNodeFormat":99},{"version":"470e247d47debe2ea3c38259a6501c4c","impliedNodeFormat":99},{"version":"cdde658c7e1d8ea776570f1a5bfdaea1","impliedNodeFormat":99},{"version":"d8897812d9461364c1cd0a7ab2ae3359","impliedNodeFormat":99},{"version":"727eddfa962c0d5525390790aab9887d","impliedNodeFormat":99},{"version":"42d636c6f1c779ae3aa3e110c1b5a353","impliedNodeFormat":99},{"version":"976728a6668b70e6f1f0957c4fc9ca80","impliedNodeFormat":99},{"version":"7bdf4473435fd37a93cd98ec19ca9996","impliedNodeFormat":99},{"version":"f2a6f84008e97af5558200cf59b6efb2","impliedNodeFormat":99},{"version":"f2b7e4cef7d066005ed1c264156e24c9","impliedNodeFormat":99},{"version":"ef8f19666296edc7210bd61a0bf2a704","impliedNodeFormat":99},{"version":"aa5917b17f32412bc9a80d56b59fd652","impliedNodeFormat":99},{"version":"0932ed4363b078dbdd8c1162783ab9cb","impliedNodeFormat":99},{"version":"9419011376155b09d207e3430d3fee58","impliedNodeFormat":99},{"version":"7ee2ab115efa72fc789fcfd2e14ff97d","impliedNodeFormat":99},{"version":"7fd44c1c64919cb0c12d7377420f0baa","signature":"f59c47a838c79a7d51b4614cb231df13","impliedNodeFormat":99},{"version":"e7e47e85c09038fffb1fc8b2b3910279","signature":"42bb3b4afc10220b4c761796df176559","impliedNodeFormat":99},{"version":"4d6ad7de17a256a0467c3c735b65ec4f","signature":"673776c7c4b3f21ea59350db0fb62e58","impliedNodeFormat":99},{"version":"66c72d821a766a9f8c67b2b17e264f35","signature":"7a9b2f7a57782b243f181ce5b9674536","impliedNodeFormat":99},{"version":"5dd7a5da14e93e0de7f53f4bd178ad57","signature":"1350ec019f6c8ceeb32ac38eb835fe41","impliedNodeFormat":99},{"version":"25078edc61e36704814cb4ae3423c73e","signature":"cc431712d81919a7e4d753fa97490964","impliedNodeFormat":99},{"version":"7f28ea1adf0949a9623e008a79412daa","signature":"b3d4574118fc2a64516666a2485e2cbb","impliedNodeFormat":99},{"version":"3332a642dec073a095df442dea0430e8","signature":"47cd66054cc63b9b50f52d0a4b8c0f21","impliedNodeFormat":99},{"version":"bf5ea713fb782226835b9e7ea93e09b9","signature":"67c58eac71209949efc7b5cfdd7b156a","impliedNodeFormat":99},{"version":"1e4a6d7bd9a002dd462eb3dbad4c4854","signature":"b2b63e833cb6d88831a50f5f2ef13eac","impliedNodeFormat":99},{"version":"411de83e277acc30868b4853ddca4a70","signature":"ae9b98b54b36edb14211c3048e187bef","impliedNodeFormat":99},{"version":"f2878c4338cf5be3a3f3ed329a62a401","signature":"95a6a44c2edc46a7fe9c46fa8df83c4c","impliedNodeFormat":99},{"version":"1622a735df707b0a8e77c39ed8d8d0cf","signature":"df419db835406e05d8112e32399408f3","impliedNodeFormat":99},{"version":"392d962ab1da52e29269c24b1574e4fb","signature":"f2f0632ba7453c69e7834971edf509e7","impliedNodeFormat":99},{"version":"82ef76a9eed20df624d7ef78e70e182b","signature":"12c196826690cdeecb8df628e9be2007","impliedNodeFormat":99},"46adab8b8b66b08b5e7c0e8fab6a1ca6","a9fe29dcdd4288cacf574947747a4572","daada721cfdc43aa8e7c2e2d14d760de","1875116298cba1325500d3f1eac8bbf9","53a6603f36cd656a1fb80328ec67c2da","5d253feb3ce379964ce328df2e292f33","2ea6f8b0175c6790a666f87545015791","4ef66462d69c6b7504ef14011caac866","2f9112269cc3c45d1fb3d62f3ccb7097","ffb6ed8d47df8ca98044478684c0af40","cbc1f06fbfe43eb20a752fa368855819","2de5baa83f63307a4dd74d7aa2dd5254","3eeffcd208fa163e66f8769b350f0445","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","ee9981834b9f6f6958887811182849e8","5175ffa851d494a5195ffdebf8ed7285","89cf60624d459ce663be118a626d5fdc","1d1bc42979730b680201df62a3c1ac22","cb5ffae433c93a1431c0000260c7d0c3","9bb07208f876b5e95d56a3d2e9b9a427","0b02ecd3af1ccccee2f5c605903848f8","7454a3a8b97184f2d9432fa08bea4550","5ec4d3086f21642d2aeae2133b49ceeb","8318e3c39365fe3a3cfb375f5c29ab04","9e29bd130ef2dafefc736f6ab792a301","cde3fe3c0bfe6e037b07e7251fb1c3d3","c5a965bdb35a433f7fb044dcb56d485c","96b06af537c71de0a80e9ed880958afd","3008879c54fc6e5b56c202a9d7b09211","1339976f87e671ebf4b5ff1f36594612","0a95994056ab784c17e3331cd56bff1c","a9356de7c324c6f49c15587032b1f65f","f763a0656991aee48818a73fe218b09c","1904e67dd51f8bf1517f05edbfada0ea",{"version":"3122588dc59dae613cedd5b2e25a8cd9","signature":"d27373ba3b6b9cab9646f0bb1edc7d7c","impliedNodeFormat":99},{"version":"00a80f0164c79cb33551625cf89ac72f","signature":"05af04c1e5ce81eadaa6220c70b988c7","impliedNodeFormat":99},{"version":"6ea6d367da5e3eba1e3b026edb8d2f25","signature":"dc41c444c7177fcda1d8273577168fe8","impliedNodeFormat":99},{"version":"afab1f96f2c770fce58ff85269f92c6d","signature":"10e448febaee53bc3fdf5798bed75d9e","impliedNodeFormat":99},{"version":"ff0007af12b416d530849c7fa41aa76a","signature":"dde65d10294ca19361d745a2f3ac1dea","impliedNodeFormat":99},{"version":"398216cc16f9749e7714b3d797ead08f","signature":"558fe2ad4dfe2dc385127217a1d35f1c","impliedNodeFormat":99},{"version":"93978eba9d9c4a0d88a168f7a736762a","signature":"b1c44cfff52ee3af92fd13af4fb12ab1","impliedNodeFormat":99},{"version":"d5a3a2a56d1d0c582aa33c19ea19f5a4","signature":"e8715475742bbb4cf1f66d79c8084e53","impliedNodeFormat":99},{"version":"93b9fd656dc4a0e00930fefb1b47d396","signature":"d02ffaf539aa380aeee353f7aac7503b","impliedNodeFormat":99},{"version":"9c3bf56b20bdc83d63b6f68dd4e7c73d","signature":"3984c1f0768cb63a7717c9a9f4954fcd","impliedNodeFormat":99},{"version":"c185f1d6a2ce5cff611a587460d93587","signature":"92b000522fa477e4533494c6938d0d84","impliedNodeFormat":99},{"version":"9c6c512f43588907a1d3cca53f441606","signature":"6adb6f05513fb2bda57be9d22a10498a","impliedNodeFormat":99},{"version":"6721fadf462c0e68ebb07ec89dc3cbba","signature":"298be7d877848c73f5f01c3e3371565b","impliedNodeFormat":99},{"version":"268b2c7b4cacd5fdd0dca5985de768d3","signature":"f898051a0fd5db7ee3707d2df5e52358","impliedNodeFormat":99},{"version":"b524a5432eb70e78f6ce7625f5f983e8","signature":"08d03a2b3c1ac19906c26e46fe3d6c87","impliedNodeFormat":99},{"version":"540a6414bdcc0046e77293f7c860788f","signature":"1779954d42d1ac81d71bf3c7da2da46f","impliedNodeFormat":99},{"version":"3c75cb3f11ee4d5bc9c7408415c35eff","signature":"00629cc3dfccc7c85a4daeaa425e89c6","impliedNodeFormat":99},{"version":"d91439c51bb9f45041cb2ed6cc9fb219","impliedNodeFormat":99},{"version":"679dec08e474b1bf05583eb8fde05494","impliedNodeFormat":99}],"fileIdsList":[[106],[126],[301],[290],[290,293],[212,284,288,290,291,292,293,294,295,296,297,298,299,300],[208,210,293],[290,291],[209,215,290,292],[210,212,214,215,216,217],[212,214,216,217],[214,217],[212,214,216],[209,212,214,215,217],[208,210,211,212,213,214,215,216,217,218,219,220,284,285,286,287,288,289],[208,210,211,214],[210,211,214],[214],[208,209,211,212,213,215,216,217],[208,209,210,214,290],[214,215,216,217],[216],[221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283],[119,120,121],[105,119,120],[108,119],[114],[105],[114,115,116,117,118],[105,114],[123,124],[105,123],[93,94,97,105],[105,134,135],[134,135,136],[105,134],[105,108],[105,130],[131,132],[105,131],[108,128,129,130],[95,96,97,108,112,128,129,130,151,152,153,154,155,156,157,158,159,160,180,181,182,183,184,185,187,188,189,191],[93,112,188],[93,108,111],[89,91,92,93,94,105,110,112],[93],[105,109],[98,99],[98,99,102],[98,99,100,101,102,103],[98],[95,104,105,108,110,113,122,125,133,137,138,139,140,141,142,143,144,145,146,147,149,150],[93,105,108,109],[105,108,109,128,129],[89,108],[105,128],[105,108,109],[105,108,109,138,140,142,143],[105,108,109,128],[93,94,111,112],[110],[91,93,97,104],[89,148],[89,105],[88,105],[127],[107],[91],[91,190],[93,95],[90,162,163],[89],[93,167,168,169,170,171,172,173,174,175,176],[88,89],[88,93,160,178],[88,93],[93,105,108],[88,92,93,94,96,153,159,160,161,164,165,166,177,179],[93,97,108],[91,92,93,94,96],[93,94],[88,89,90,91,92],[93,94,97,108,130,154,186],[93,154,156],[93,105],[90,93,94,97,108,130,152,153],[130],[192,193,194,195,196,197],[193,199],[192,193,197],[192,193,194],[192,193,194,197,203,206],[192],[192,193,194,203],[193,194,195,196,197,198,199,200,201,203,204,205,206,207,303,307,310,313,315,316,317],[192,194,197,206],[192,193,197,206],[192,303,305,306,308,309,312,314],[192,193,194,197,202],[193],[192,206,303,304],[192,303,307],[192,303],[192,207,303,304],[305,306,308,309],[312,314],[192,303,310,311],[192,303,311,313],[192,193,194,195,197,198,199,200,201,203,204,205],[315],[192,193],[192,193,197,202],[192,197,302]],"options":{"allowUnreachableCode":false,"allowUnusedLabels":false,"composite":true,"declaration":true,"declarationMap":true,"exactOptionalPropertyTypes":true,"isolatedDeclarations":true,"importHelpers":true,"module":199,"newLine":2,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noPropertyAccessFromIndexSignature":true,"noUncheckedIndexedAccess":true,"noEmitOnError":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitOverride":true,"noUncheckedSideEffectImports":true,"outDir":"./","removeComments":false,"rootDir":"../src","skipLibCheck":true,"strict":true,"stripInternal":true,"skipDefaultLibCheck":false,"sourceMap":true,"target":99,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true,"allowSyntheticDefaultImports":true,"esModuleInterop":true},"referencedMap":[[107,1],[127,2],[302,3],[294,4],[300,5],[295,5],[297,5],[291,4],[301,6],[296,7],[298,5],[299,5],[292,8],[293,9],[287,10],[215,11],[286,12],[217,13],[216,14],[290,15],[289,16],[288,17],[219,18],[218,11],[210,12],[214,19],[211,20],[212,21],[221,22],[222,22],[223,22],[224,22],[225,22],[226,22],[227,22],[228,22],[229,22],[230,22],[231,22],[232,22],[233,22],[234,22],[235,22],[236,22],[238,22],[237,22],[239,22],[240,22],[241,22],[242,22],[243,22],[244,22],[245,22],[284,23],[246,22],[247,22],[248,22],[249,22],[250,22],[251,22],[252,22],[253,22],[254,22],[255,22],[256,22],[257,22],[258,22],[259,22],[260,22],[261,22],[263,22],[262,22],[265,22],[264,22],[266,22],[267,22],[268,22],[269,22],[270,22],[271,22],[272,22],[273,22],[274,22],[275,22],[276,22],[277,22],[278,22],[279,22],[280,22],[283,22],[281,22],[282,22],[122,24],[121,25],[120,26],[118,27],[116,28],[119,29],[115,27],[117,30],[125,31],[124,32],[123,33],[136,34],[137,35],[135,36],[134,37],[183,38],[133,39],[132,40],[131,41],[192,42],[189,43],[112,44],[113,45],[111,46],[110,47],[95,28],[101,48],[103,49],[104,50],[100,51],[151,52],[146,47],[140,53],[142,54],[109,55],[139,56],[145,47],[143,57],[144,58],[138,59],[141,57],[147,47],[188,60],[150,61],[105,62],[149,63],[148,64],[89,65],[128,66],[108,67],[190,68],[191,69],[96,70],[164,71],[163,46],[162,72],[175,46],[171,46],[177,73],[170,46],[176,46],[174,46],[167,74],[172,46],[173,46],[179,75],[161,76],[165,46],[159,46],[153,77],[180,78],[156,79],[97,80],[160,76],[166,81],[181,46],[92,46],[94,46],[88,72],[93,82],[187,83],[157,84],[158,85],[154,86],[155,87],[152,87],[130,28],[198,88],[200,89],[201,90],[195,91],[207,92],[194,93],[205,94],[318,95],[316,96],[193,93],[307,97],[315,98],[203,99],[310,93],[317,100],[305,101],[306,101],[308,102],[304,103],[309,104],[320,105],[321,106],[311,103],[312,107],[314,108],[206,109],[319,110],[199,93],[196,111],[204,112],[303,113],[313,93]],"latestChangedDtsFile":"./procedures/sdk/index.d.ts"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The checks pass: the problems of each call before the first call starts.
3
+ *
4
+ * - An unknown path, or a path that the host does not expose.
5
+ * - A call that the capability refuses (`capabilityRefusal()` of the client, with the declared
6
+ * effects of the manifest), and a call whose program the compiler cannot see under a capability
7
+ * that limits the effects (fail closed).
8
+ * - An input that does not agree with the JSON Schema of the procedure.
9
+ *
10
+ * In the interpreter each call of a program goes through the admission: a call of the host, or a
11
+ * nested call of a data-driven procedure. So the pass examines each call of the IR.
12
+ */
13
+ import { type Capability } from "@procedures/client/browser";
14
+ import { type IRNode } from "./ir.js";
15
+ import { type ProcedureFacts } from "./facts.js";
16
+ import { type EffectsAnalysis } from "./effects.js";
17
+ import type { Diagnostic } from "./diagnostics.js";
18
+ /** The options of the pass. */
19
+ export interface CheckPassOptions {
20
+ readonly capability?: Capability<unknown> | undefined;
21
+ }
22
+ /** This function examines each call of the IR. */
23
+ export declare function checkCalls(root: IRNode, facts: ProcedureFacts, effects: EffectsAnalysis, options?: CheckPassOptions): Diagnostic[];
24
+ //# sourceMappingURL=checks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAwC,KAAK,UAAU,EAAoC,MAAM,4BAA4B,CAAC;AACrI,OAAO,EAAc,KAAK,MAAM,EAAQ,MAAM,SAAS,CAAC;AACxD,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,+BAA+B;AAC/B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;CACvD;AAsBD,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAE,gBAAqB,GAAG,UAAU,EAAE,CAiFtI"}
package/dist/checks.js ADDED
@@ -0,0 +1,123 @@
1
+ /**
2
+ * The checks pass: the problems of each call before the first call starts.
3
+ *
4
+ * - An unknown path, or a path that the host does not expose.
5
+ * - A call that the capability refuses (`capabilityRefusal()` of the client, with the declared
6
+ * effects of the manifest), and a call whose program the compiler cannot see under a capability
7
+ * that limits the effects (fail closed).
8
+ * - An input that does not agree with the JSON Schema of the procedure.
9
+ *
10
+ * In the interpreter each call of a program goes through the admission: a call of the host, or a
11
+ * nested call of a data-driven procedure. So the pass examines each call of the IR.
12
+ */
13
+ import { capabilityRefusal } from "@procedures/client/browser";
14
+ import { isCallLike, walk } from "./ir.js";
15
+ import { isStringPath } from "./facts.js";
16
+ import { isUnknown, toEffects } from "./effects.js";
17
+ import { checkShape, shapeOf, withExtra } from "./schema.js";
18
+ /** A capability without its deadline: the static check does not know the time of the run. */
19
+ function withoutDeadline(capability) {
20
+ if (!capability || capability.deadline === undefined)
21
+ return capability;
22
+ const { deadline: _deadline, ...rest } = capability;
23
+ return rest;
24
+ }
25
+ /** True when the capability limits the reads or the writes, or refuses destructive procedures. */
26
+ function limitsEffects(capability) {
27
+ const permitted = capability?.effects;
28
+ if (!permitted)
29
+ return false;
30
+ const limited = (permit) => permit !== undefined && permit !== "any";
31
+ return limited(permitted.reads) || limited(permitted.writes) || permitted.destructive === false;
32
+ }
33
+ /** A procedure that has only a path and effects, for `capabilityRefusal()`. */
34
+ function asProcedure(path, effects) {
35
+ return { path, metadata: effects ? { effects } : {} };
36
+ }
37
+ /** This function examines each call of the IR. */
38
+ export function checkCalls(root, facts, effects, options = {}) {
39
+ const diagnostics = [];
40
+ const capability = withoutDeadline(options.capability);
41
+ const limited = limitsEffects(capability);
42
+ const visit = (node) => {
43
+ if (node.kind === "deferred") {
44
+ if (isStringPath(node.path) && node.path.length > 0 && !facts.entry(node.path)) {
45
+ diagnostics.push({
46
+ severity: "warning",
47
+ code: "unknown-procedure",
48
+ message: `No procedure has the path ${node.key}. This call waits for its runner, and the runner cannot start it.`,
49
+ pointer: node.pointer,
50
+ });
51
+ }
52
+ return;
53
+ }
54
+ if (!isCallLike(node))
55
+ return;
56
+ if (node.kind === "dynamic" && node.model)
57
+ walk(node.model, visit);
58
+ const path = node.path;
59
+ if (!isStringPath(path) || path.length === 0 || path.some((segment) => segment.length === 0))
60
+ return;
61
+ const entry = facts.entry(path);
62
+ if (!entry) {
63
+ diagnostics.push({
64
+ severity: "error",
65
+ code: "unknown-procedure",
66
+ message: `No procedure has the path ${node.key}: the host does not have it, or it does not expose it.`,
67
+ pointer: node.pointer,
68
+ });
69
+ return;
70
+ }
71
+ if (!facts.exposed(path)) {
72
+ diagnostics.push({
73
+ severity: "error",
74
+ code: "not-exposed",
75
+ message: `The host does not expose ${node.key}. A program runs its calls through data-driven procedures, and they can call only exposed procedures.`,
76
+ pointer: node.pointer,
77
+ });
78
+ }
79
+ if (capability) {
80
+ const refusal = capabilityRefusal(asProcedure(path, entry.effects), capability);
81
+ if (refusal) {
82
+ diagnostics.push({ severity: "error", code: "capability-refused", message: `The capability refuses this call (${refusal.reason}): ${refusal.message}.`, pointer: node.pointer });
83
+ }
84
+ }
85
+ if (node.kind === "call" || node.kind === "dynamic") {
86
+ const runs = effects.nested.get(node);
87
+ if (runs && isUnknown(runs)) {
88
+ diagnostics.push({
89
+ severity: limited ? "error" : "info",
90
+ code: "effects-unknown",
91
+ message: limited
92
+ ? `${node.key} runs a program that the compiler cannot see, and the capability limits the effects. The check fails closed: run program.check on a host that can see the program.`
93
+ : `${node.key} runs a program that the compiler cannot see, so the effects of the program are not known.`,
94
+ pointer: node.pointer,
95
+ });
96
+ }
97
+ else if (runs && capability) {
98
+ const refusal = capabilityRefusal(asProcedure(path, toEffects(runs.may)), capability);
99
+ if (refusal) {
100
+ diagnostics.push({
101
+ severity: "error",
102
+ code: "capability-refused",
103
+ message: `The capability refuses a call that ${node.key} runs (${refusal.reason}): ${refusal.message.replace(node.key, `the program of ${node.key}`)}.`,
104
+ pointer: node.pointer,
105
+ });
106
+ }
107
+ }
108
+ if (!(node.kind === "dynamic" && (node.reason === "invalid-control-flow" || node.reason === "cyclic"))) {
109
+ for (const issue of checkShape(withExtra(shapeOf(node.input), node.extra), entry.input)) {
110
+ diagnostics.push({
111
+ severity: "error",
112
+ code: "input-schema",
113
+ message: `The input of ${node.key} does not agree with its schema: ${issue.path ? `${issue.path}: ` : ""}${issue.message}.`,
114
+ pointer: issue.pointer,
115
+ });
116
+ }
117
+ }
118
+ }
119
+ };
120
+ walk(root, visit);
121
+ return diagnostics;
122
+ }
123
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The closure code: the IR to a JavaScript function made of closures. A host runs it without
3
+ * `eval` and without `new Function`.
4
+ *
5
+ * The function does the steps of the interpreter in the same order. Each call goes through
6
+ * `ctx.client.call`, so it keeps its admission, validation, deadline and interceptors. The
7
+ * control-flow procedures do not start: the function does their work in line. A dynamic node
8
+ * calls its procedure with the raw input, and the interpreter of the client runs it.
9
+ */
10
+ import type { ProgramIR } from "./ir.js";
11
+ import { type CompiledProgram } from "./runtime.js";
12
+ /** The options of the closure code. */
13
+ export interface ClosureOptions {
14
+ /** The keys of the procedures that take raw input, for `client.exec(program, input)`. */
15
+ readonly rawKeys: readonly string[];
16
+ }
17
+ /** This function makes the closure code of a program. */
18
+ export declare function compileClosure(ir: ProgramIR, options: ClosureOptions): CompiledProgram;
19
+ //# sourceMappingURL=codegen-closure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegen-closure.d.ts","sourceRoot":"","sources":["../src/codegen-closure.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAqB,SAAS,EAAiB,MAAM,SAAS,CAAC;AAC3E,OAAO,EAcL,KAAK,eAAe,EAGrB,MAAM,cAAc,CAAC;AAUtB,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,eAAe,CAUtF"}