behavior-contracts 0.9.2 → 0.10.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 (88) hide show
  1. package/cli-contract.yaml +116 -24
  2. package/dist/authoring.d.ts +18 -1
  3. package/dist/authoring.d.ts.map +1 -1
  4. package/dist/authoring.js +11 -0
  5. package/dist/authoring.js.map +1 -1
  6. package/dist/behavior.d.ts +23 -0
  7. package/dist/behavior.d.ts.map +1 -1
  8. package/dist/behavior.js +18 -10
  9. package/dist/behavior.js.map +1 -1
  10. package/dist/bind.d.ts +1 -1
  11. package/dist/bind.d.ts.map +1 -1
  12. package/dist/builder.d.ts.map +1 -1
  13. package/dist/builder.js +21 -6
  14. package/dist/builder.js.map +1 -1
  15. package/dist/cli.js +65 -40
  16. package/dist/cli.js.map +1 -1
  17. package/dist/commands/codegen.d.ts +18 -12
  18. package/dist/commands/codegen.d.ts.map +1 -1
  19. package/dist/commands/codegen.js +111 -27
  20. package/dist/commands/codegen.js.map +1 -1
  21. package/dist/commands/ts-extract.d.ts +26 -0
  22. package/dist/commands/ts-extract.d.ts.map +1 -0
  23. package/dist/commands/ts-extract.js +265 -0
  24. package/dist/commands/ts-extract.js.map +1 -0
  25. package/dist/generated/commands.d.ts.map +1 -1
  26. package/dist/generated/commands.js +8 -0
  27. package/dist/generated/commands.js.map +1 -1
  28. package/dist/generated/contract.d.ts.map +1 -1
  29. package/dist/generated/contract.js +2 -2
  30. package/dist/generated/contract.js.map +1 -1
  31. package/dist/generated/program.d.ts +4 -0
  32. package/dist/generated/program.d.ts.map +1 -1
  33. package/dist/generated/program.js +7 -3
  34. package/dist/generated/program.js.map +1 -1
  35. package/dist/generated/types.d.ts +6 -2
  36. package/dist/generated/types.d.ts.map +1 -1
  37. package/dist/generator/emit-shared-go.d.ts.map +1 -1
  38. package/dist/generator/emit-shared-go.js +40 -19
  39. package/dist/generator/emit-shared-go.js.map +1 -1
  40. package/dist/generator/emit-shared-rust.d.ts.map +1 -1
  41. package/dist/generator/emit-shared-rust.js +50 -30
  42. package/dist/generator/emit-shared-rust.js.map +1 -1
  43. package/dist/generator/emit-shared-typescript.d.ts.map +1 -1
  44. package/dist/generator/emit-shared-typescript.js +26 -4
  45. package/dist/generator/emit-shared-typescript.js.map +1 -1
  46. package/dist/generator/emit-typed-native-go.d.ts +5 -7
  47. package/dist/generator/emit-typed-native-go.d.ts.map +1 -1
  48. package/dist/generator/emit-typed-native-go.js +292 -420
  49. package/dist/generator/emit-typed-native-go.js.map +1 -1
  50. package/dist/generator/emit-typed-native-rust.d.ts +6 -8
  51. package/dist/generator/emit-typed-native-rust.d.ts.map +1 -1
  52. package/dist/generator/emit-typed-native-rust.js +275 -382
  53. package/dist/generator/emit-typed-native-rust.js.map +1 -1
  54. package/dist/generator/native-expr.d.ts +7 -0
  55. package/dist/generator/native-expr.d.ts.map +1 -1
  56. package/dist/generator/native-expr.js +11 -0
  57. package/dist/generator/native-expr.js.map +1 -1
  58. package/dist/generator/straightline.d.ts +5 -0
  59. package/dist/generator/straightline.d.ts.map +1 -1
  60. package/dist/generator/straightline.js +1 -0
  61. package/dist/generator/straightline.js.map +1 -1
  62. package/dist/generator/typed.d.ts +17 -11
  63. package/dist/generator/typed.d.ts.map +1 -1
  64. package/dist/generator/typed.js +19 -12
  65. package/dist/generator/typed.js.map +1 -1
  66. package/dist/guard.d.ts +23 -0
  67. package/dist/guard.d.ts.map +1 -1
  68. package/dist/guard.js +52 -0
  69. package/dist/guard.js.map +1 -1
  70. package/dist/index.d.ts +3 -32
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +10 -5
  73. package/dist/index.js.map +1 -1
  74. package/dist/ir-handle.d.ts +30 -0
  75. package/dist/ir-handle.d.ts.map +1 -0
  76. package/dist/ir-handle.js +2 -0
  77. package/dist/ir-handle.js.map +1 -0
  78. package/dist/plan.d.ts +7 -0
  79. package/dist/plan.d.ts.map +1 -1
  80. package/dist/plan.js +7 -2
  81. package/dist/plan.js.map +1 -1
  82. package/dist/primitives.d.ts +4 -3
  83. package/dist/primitives.d.ts.map +1 -1
  84. package/dist/primitives.js +8 -7
  85. package/dist/primitives.js.map +1 -1
  86. package/dist/provenance.d.ts +1 -1
  87. package/dist/provenance.d.ts.map +1 -1
  88. package/package.json +9 -1
@@ -0,0 +1,265 @@
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
9
+ // ════════════════════════════════════════════════════════════════════════════
10
+ // ts-extract — the BUILD-TIME TypeScript bridge behind `bc generate --from <.ts>`.
11
+ //
12
+ // The consumer authors behaviors in TS SOURCE and never touches the IR (#176). For a `.ts` --from module the
13
+ // CLI uses the TypeScript compiler to do two build-time-only jobs, then hands the result to the SAME
14
+ // compileBehaviors → generateModule pipeline the rest of the CLI uses:
15
+ //
16
+ // 1. INPUT-PORT TYPE EXTRACTION (extractInputPorts): a ts.Program + type-checker resolves each public
17
+ // method's `$: In<T>` parameter type and maps its members to the `PortSchema` structure compileBehaviors'
18
+ // `inputPorts` option expects (Record<method, Record<port, PortSchema>>). `In<T>` types are erased at
19
+ // runtime, so this is THE type-extraction seam authoring.ts documents ("型抽出ツールの接続点"). BC never
20
+ // infers types (consumer-interface.md C3) — extraction reads the consumer's DECLARED TS type and
21
+ // fail-closes LOUD on anything it cannot map faithfully to a PortSchema (never a silent unknown/value).
22
+ // 2. TRANSPILE + LOAD (transpileAndLoad): Node's own type-stripping rejects `@behavior` DECORATOR syntax,
23
+ // so a `.ts` is transpiled with the TS compiler (legacy decorator emit — see below) to a sibling ESM
24
+ // module and imported. Its `behavior-contracts` import resolves through the consumer's node_modules to
25
+ // the SAME package instance as the CLI (shared @behavior/defineLeaf compile frame).
26
+ //
27
+ // `typescript` is a build-time-only OPTIONAL PEER dependency (see package.json). It is imported dynamically
28
+ // HERE and nowhere on the runtime entry (../index.ts), so the published runtime stays dependency-free.
29
+ // ════════════════════════════════════════════════════════════════════════════
30
+ import { readFileSync, writeFileSync, rmSync } from "node:fs";
31
+ import { pathToFileURL } from "node:url";
32
+ import { dirname, join } from "node:path";
33
+ import { randomUUID } from "node:crypto";
34
+ import { portSchemaFromPortable } from "../authoring.js";
35
+ /** Dynamic-import the OPTIONAL PEER `typescript`. Absent → a loud, actionable error (a `.ts` --from module
36
+ * needs the TS compiler; a consumer authoring TS already has it, or can pass a prebuilt `.js`/`.mjs`). */
37
+ async function loadTypeScript(fromPath) {
38
+ try {
39
+ return (await import("typescript")).default ?? (await import("typescript"));
40
+ }
41
+ catch {
42
+ throw new Error(`--from '${fromPath}' is a .ts module, which requires the 'typescript' peer dependency to type-extract ` +
43
+ `+ transpile it. Install typescript (it is a build-time-only optional peer), or pass a prebuilt .js/.mjs.`);
44
+ }
45
+ }
46
+ /** Is this specifier a TypeScript SOURCE module (needs the TS compiler) vs a compiled `.js`/`.mjs`? */
47
+ export function isTypeScriptSource(fromPath) {
48
+ return /\.(?:m|c)?ts$/i.test(fromPath) && !/\.d\.ts$/i.test(fromPath);
49
+ }
50
+ // ── (1) input-port type extraction ──────────────────────────────────────────────────────────────────────
51
+ /**
52
+ * Extract `Record<method, Record<port, PortSchema>>` from a consumer `.ts` behavior module for the class
53
+ * `behaviorName` — the `inputPorts` structure compileBehaviors consumes. Uses a ts.Program + checker so
54
+ * `In<T>` (imported from behavior-contracts) and named/imported member interfaces resolve. Each public
55
+ * method's first parameter (`$`) type → its members → {@link tsTypeToPortSchema}. A method with no `$` (or no
56
+ * members) contributes no entry. Fail-closed LOUD on any unmappable member type.
57
+ */
58
+ export async function extractInputPorts(fromPath, behaviorName) {
59
+ const ts = await loadTypeScript(fromPath);
60
+ const program = ts.createProgram([fromPath], {
61
+ module: ts.ModuleKind.NodeNext,
62
+ moduleResolution: ts.ModuleResolutionKind.NodeNext,
63
+ target: ts.ScriptTarget.ES2022,
64
+ strict: true,
65
+ skipLibCheck: true,
66
+ allowImportingTsExtensions: true,
67
+ noEmit: true,
68
+ });
69
+ const checker = program.getTypeChecker();
70
+ const sf = program.getSourceFile(fromPath);
71
+ if (sf === undefined)
72
+ throw new Error(`--from '${fromPath}': the TypeScript compiler could not read the source file`);
73
+ const cls = findClass(ts, sf, behaviorName);
74
+ if (cls === undefined)
75
+ throw new Error(`--behavior '${behaviorName}' is not a class declared in --from '${fromPath}'`);
76
+ const out = {};
77
+ for (const member of cls.members) {
78
+ if (!ts.isMethodDeclaration(member))
79
+ continue;
80
+ if (member.modifiers?.some((m) => m.kind === ts.SyntaxKind.StaticKeyword))
81
+ continue;
82
+ const name = member.name && ts.isIdentifier(member.name) ? member.name.text : undefined;
83
+ // mirror compileBehaviors' public-method rule: skip constructor / `_`-helper / `#`-private / computed names.
84
+ if (name === undefined || name.startsWith("_"))
85
+ continue;
86
+ const param = member.parameters[0]; // `$` (the Input Port bundle); a method may legitimately take none.
87
+ if (param === undefined)
88
+ continue;
89
+ const paramType = checker.getTypeAtLocation(param);
90
+ const ports = {};
91
+ for (const prop of paramType.getProperties()) {
92
+ const portName = prop.getName();
93
+ const memberType = checker.getTypeOfSymbolAtLocation(prop, param);
94
+ const where = `--behavior ${behaviorName} method '${name}' input port '$.${portName}'`;
95
+ ports[portName] = tsTypeToPortSchema(ts, checker, memberType, param, where);
96
+ }
97
+ if (Object.keys(ports).length > 0)
98
+ out[name] = ports;
99
+ }
100
+ return out;
101
+ }
102
+ /** Depth-first search for a class declaration named `name`. */
103
+ function findClass(ts, root, name) {
104
+ let found;
105
+ const visit = (node) => {
106
+ if (found)
107
+ return;
108
+ if (ts.isClassDeclaration(node) && node.name?.text === name) {
109
+ found = node;
110
+ return;
111
+ }
112
+ ts.forEachChild(node, visit);
113
+ };
114
+ visit(root);
115
+ return found;
116
+ }
117
+ /** One input port's TS member type → PortSchema, reusing the authoring SSoT {@link portSchemaFromPortable}
118
+ * (PortableType → PortSchema). The optionality of the top-level port is carried by an `{opt:…}` wrapper (the
119
+ * SAME derivation catalogEntryFromLeaf uses): opt → required:false, else required:true. */
120
+ function tsTypeToPortSchema(ts, checker, type, at, where) {
121
+ const portable = tsTypeToPortable(ts, checker, type, at, where);
122
+ const required = !(typeof portable === "object" && portable !== null && "opt" in portable);
123
+ return portSchemaFromPortable(portable, required);
124
+ }
125
+ /**
126
+ * Faithful TS type → PortableType mapping (the closed vocabulary behavior.ts declares). Fail-closed LOUD on
127
+ * anything not representable as a PortableType (never a silent `unknown`/`value`), mirroring the strict-typing
128
+ * discipline:
129
+ * string → "string" · boolean → "bool" · null → "null" · `T | undefined`/optional → {opt: T} ·
130
+ * `T[]` → {arr: T} · object/interface → {obj: {k: …}} .
131
+ * `number` is REJECTED: TS `number` is ambiguous between the portable `int` (i64) and `float` (f64) and BC
132
+ * does not infer — there is no single faithful mapping (a wrong guess emits the wrong native scalar type).
133
+ */
134
+ function tsTypeToPortable(ts, checker, type, at, where) {
135
+ const fail = (msg) => {
136
+ throw new Error(`${where}: ${msg} (TS type '${checker.typeToString(type)}' is not a faithful PortSchema)`);
137
+ };
138
+ const F = ts.TypeFlags;
139
+ // union: strip null/undefined (optionality); boolean is itself a true|false union.
140
+ if (type.isUnion()) {
141
+ const voidish = type.types.filter((t) => t.flags & (F.Undefined | F.Null | F.Void));
142
+ const rest = type.types.filter((t) => !(t.flags & (F.Undefined | F.Null | F.Void)));
143
+ if (rest.length === 0)
144
+ return "null"; // only null/undefined declared
145
+ if (rest.every((t) => t.flags & F.BooleanLike))
146
+ return voidish.length ? { opt: "bool" } : "bool";
147
+ if (rest.length === 1) {
148
+ const base = tsTypeToPortable(ts, checker, rest[0], at, where);
149
+ return voidish.length ? { opt: base } : base;
150
+ }
151
+ return fail("a union of multiple non-null types has no portable representation");
152
+ }
153
+ // branded numeric precision: the authoring `Int`/`Float` aliases are `number & { [uniqueSym]: "int"|"float" }`
154
+ // intersections. Detect the brand STRUCTURALLY (the "int"/"float" string-literal value the brand carries), so
155
+ // re-exports / aliases (`type MyId = Int`) still resolve — never by the alias display name.
156
+ if (type.isIntersection()) {
157
+ const brand = numericBrandOf(ts, checker, type, at);
158
+ if (brand)
159
+ return brand;
160
+ return fail("an intersection type has no portable representation (use the Int/Float authoring aliases for numbers)");
161
+ }
162
+ if (type.flags & F.StringLike)
163
+ return "string";
164
+ if (type.flags & F.BooleanLike)
165
+ return "bool";
166
+ if (type.flags & F.NumberLike)
167
+ return fail("TS 'number' is ambiguous between the portable 'int' (i64) and 'float' (f64); BC does not infer — " +
168
+ "declare the port with the Int or Float authoring alias (no auto int/float rule)");
169
+ if (type.flags & F.Null)
170
+ return "null";
171
+ if (type.flags & (F.Any | F.Unknown))
172
+ return fail("'any'/'unknown' has no portable type");
173
+ if (checker.isArrayType(type)) {
174
+ const elem = getArrayElementType(ts, checker, type) ?? fail("array element type is unresolvable");
175
+ return { arr: tsTypeToPortable(ts, checker, elem, at, where) };
176
+ }
177
+ if (type.flags & F.Object) {
178
+ const props = type.getProperties();
179
+ if (props.length === 0)
180
+ return fail("an empty/opaque object has no portable representation");
181
+ const obj = {};
182
+ for (const prop of props) {
183
+ const pType = checker.getTypeOfSymbolAtLocation(prop, at);
184
+ obj[prop.getName()] = tsTypeToPortable(ts, checker, pType, at, `${where}.${prop.getName()}`);
185
+ }
186
+ return { obj };
187
+ }
188
+ return fail("unrepresentable type");
189
+ }
190
+ /** The portable scalar an `Int`/`Float` brand carries, or undefined if `type` is not a numeric brand. A brand
191
+ * is `number & { [uniqueSym]: "int"|"float" }`: an intersection with a NumberLike constituent AND a property
192
+ * whose type is the string literal "int"/"float". Detection is structural (by that literal value, not the
193
+ * property key or alias name), so re-exports / aliases resolve. */
194
+ function numericBrandOf(ts, checker, type, at) {
195
+ if (!type.isIntersection())
196
+ return undefined;
197
+ if (!type.types.some((t) => t.flags & ts.TypeFlags.NumberLike))
198
+ return undefined;
199
+ for (const prop of type.getProperties()) {
200
+ const pt = checker.getTypeOfSymbolAtLocation(prop, at);
201
+ if (pt.flags & ts.TypeFlags.StringLiteral) {
202
+ const v = pt.value;
203
+ if (v === "int" || v === "float")
204
+ return v;
205
+ }
206
+ }
207
+ return undefined;
208
+ }
209
+ /** The element type of an array type (`getElementTypeOfArrayType` when present, else the type argument). */
210
+ function getArrayElementType(ts, checker, type) {
211
+ const viaApi = checker
212
+ .getElementTypeOfArrayType?.(type);
213
+ if (viaApi)
214
+ return viaApi;
215
+ const args = checker.getTypeArguments(type);
216
+ return args[0];
217
+ }
218
+ // ── (2) transpile + load ─────────────────────────────────────────────────────────────────────────────────
219
+ /**
220
+ * Transpile a consumer `.ts` behavior module to a sibling ESM file, import it, and return its namespace. The
221
+ * temp file is written NEXT TO the source so its `behavior-contracts` (and any relative) imports resolve
222
+ * identically to the source — the precondition for sharing the process-global @behavior/defineLeaf compile
223
+ * frame with the CLI.
224
+ *
225
+ * Emit: `experimentalDecorators: true` (LEGACY decorator emit). `@behavior` is a dual-mode marker (TC39
226
+ * standard AND legacy), and legacy emit keeps the class body clean (`class X {}` then
227
+ * `X = __decorate([behavior], X)`), whereas STANDARD downlevel emit injects helper code (`typeof Symbol ===
228
+ * "function" …`) INTO the class source — which compileBehaviors' native-control-syntax scanner (it reads
229
+ * `class.toString()`) would reject. Module: ESNext, so the output is ESM regardless of the consumer dir's
230
+ * package.json `type`.
231
+ */
232
+ export async function transpileAndLoad(fromPath) {
233
+ const ts = await loadTypeScript(fromPath);
234
+ const source = (() => {
235
+ try {
236
+ return readFileSync(fromPath, "utf8");
237
+ }
238
+ catch {
239
+ throw new Error(`cannot read --from '${fromPath}'`);
240
+ }
241
+ })();
242
+ const { outputText, diagnostics } = ts.transpileModule(source, {
243
+ fileName: fromPath,
244
+ compilerOptions: {
245
+ module: ts.ModuleKind.ESNext,
246
+ target: ts.ScriptTarget.ES2022,
247
+ experimentalDecorators: true,
248
+ emitDecoratorMetadata: false,
249
+ },
250
+ reportDiagnostics: true,
251
+ });
252
+ if (diagnostics && diagnostics.length > 0) {
253
+ const msg = diagnostics.map((d) => ts.flattenDiagnosticMessageText(d.messageText, "\n")).join("; ");
254
+ throw new Error(`--from '${fromPath}' failed to transpile: ${msg}`);
255
+ }
256
+ const tmp = join(dirname(fromPath), `.bcgen-${randomUUID()}.mjs`);
257
+ writeFileSync(tmp, outputText);
258
+ try {
259
+ return (await import(__rewriteRelativeImportExtension(pathToFileURL(tmp).href)));
260
+ }
261
+ finally {
262
+ rmSync(tmp, { force: true }); // ESM caches by URL — already loaded; the temp artifact is disposable.
263
+ }
264
+ }
265
+ //# sourceMappingURL=ts-extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ts-extract.js","sourceRoot":"","sources":["../../src/commands/ts-extract.ts"],"names":[],"mappings":";;;;;;;;AAAA,+EAA+E;AAC/E,mFAAmF;AACnF,EAAE;AACF,6GAA6G;AAC7G,qGAAqG;AACrG,uEAAuE;AACvE,EAAE;AACF,wGAAwG;AACxG,+GAA+G;AAC/G,2GAA2G;AAC3G,oGAAoG;AACpG,sGAAsG;AACtG,6GAA6G;AAC7G,4GAA4G;AAC5G,0GAA0G;AAC1G,4GAA4G;AAC5G,yFAAyF;AACzF,EAAE;AACF,4GAA4G;AAC5G,uGAAuG;AACvG,+EAA+E;AAC/E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAUzD;0GAC0G;AAC1G,KAAK,UAAU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AC,GACnD,OAAO,CAAC,UAAU,CAAC,CAwBrB"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/generated/commands.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,eAAe,CAAC,GACtD,OAAO,CAAC,UAAU,CAAC,CA0BrB;AAED,wBAAsB,OAAO,CAC3B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,YAAY,EAAE,YAAY,CAAC,GACnD,OAAO,CAAC,UAAU,CAAC,CA0BrB"}
@@ -7,6 +7,10 @@ export async function bcGenerate(executable, options) {
7
7
  if (options) {
8
8
  if (options.lang !== undefined)
9
9
  cmdArgs.push("--lang", String(options.lang));
10
+ if (options.from !== undefined)
11
+ cmdArgs.push("--from", String(options.from));
12
+ if (options.behavior !== undefined)
13
+ cmdArgs.push("--behavior", String(options.behavior));
10
14
  if (options.in !== undefined)
11
15
  cmdArgs.push("--in", String(options.in));
12
16
  if (options.out !== undefined)
@@ -40,6 +44,10 @@ export async function bcCheck(executable, options) {
40
44
  if (options) {
41
45
  if (options.lang !== undefined)
42
46
  cmdArgs.push("--lang", String(options.lang));
47
+ if (options.from !== undefined)
48
+ cmdArgs.push("--from", String(options.from));
49
+ if (options.behavior !== undefined)
50
+ cmdArgs.push("--behavior", String(options.behavior));
43
51
  if (options.in !== undefined)
44
52
  cmdArgs.push("--in", String(options.in));
45
53
  if (options.out !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/generated/commands.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,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AAS;YAAE,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC9H,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IACvE,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,GAA0D,CAAC;QACrE,OAAO;YACL,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjD,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;YACtB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;SACvB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAAmzX,CAAC;AAEh1X,eAAO,MAAM,iBAAiB,EAAE,MAA4xb,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAA2/gB,CAAC;AAExhhB,eAAO,MAAM,iBAAiB,EAAE,MAA64kB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // Auto-generated by cli-contracts. Do not edit.
2
2
  // Embedded contract for the extract subcommand.
3
- export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: behavior-contracts CLI\n version: 0.1.0\n description: >-\n bc — the build-time codegen CLI over behavior-contracts' public API.\n Reads a serialized ComponentGraphIRDoc (the unbranded JSON IR), adopts it\n via loadCompiledIR, and runs the same generateModule the in-process API runs\n to emit a runtime-free native module (data baked as literals). The IR doc is\n a build-time input only; nothing reads it at runtime.\n license:\n name: MIT\n contact:\n name: foo-ogawa\n url: https://github.com/foo-ogawa/behavior-contracts\n\nartifact_slots:\n ir-doc:\n direction: read\n description: Serialized ComponentGraphIRDoc (unbranded JSON IR) — the codegen input.\n generated-module:\n direction: write\n description: Generated native module source (baked-literal, runtime-free).\n\ncommand_sets:\n bc:\n summary: build-time codegen CLI over behavior-contracts' public API.\n executable: bc\n\n global_options:\n - name: version\n aliases: [V]\n description: Print version and exit.\n schema:\n type: boolean\n\n - name: help\n aliases: [h]\n description: Show help and exit.\n schema:\n type: boolean\n\n commands:\n # ── generate ─────────────────────────────────────────\n generate:\n summary: Emit a native module from a serialized IR doc.\n description: >-\n Reads the --in ComponentGraphIRDoc, adopts it via loadCompiledIR, and\n runs generateModule for the --lang emitter. Writes the module source\n to --out if given, else to stdout. Rejects an unregistered --lang.\n usage:\n - bc generate --lang rust-typed-native --in ir-doc.json\n - bc generate --lang go-typed-native --in ir-doc.json --out gen.go\n - bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\n\n options:\n - name: lang\n required: true\n description: >-\n Target emitter (must be a registered language, e.g.\n rust-typed-native, go-typed-native, typescript-typed).\n value_name: emitter\n schema:\n type: string\n\n - name: in\n required: true\n description: Path to the serialized ComponentGraphIRDoc JSON file.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: false\n description: Write the generated covered module here instead of stdout.\n value_name: file\n schema:\n type: string\n file:\n mode: write\n\n - name: shared-types-out\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Write the BC-OWNED\n shared wire types module (WireValue/WireRow/WireList + probe kinds,\n rust also the shared BehaviorError; plus the cross-package/-crate\n batch ports structs) here. This is the module a covered module built\n with --shared-types-import imports. Independent of --out: a build may\n emit the covered module, the shared module, or both. For go the\n emitted package name is derived from --shared-types-import (so\n --shared-types-import is required with go). Rejected for other\n emitters. A standalone --shared-types-out does NOT print the covered\n module to stdout.\n value_name: file\n schema:\n type: string\n file:\n mode: write\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Package (go) / crate\n (rust) path for the BC-GENERATED shared wire types (WireValue/\n WireRow/WireList; rust also the shared BehaviorError). When set, BC\n emits those types into that shared package/crate and the covered\n module imports them (go: package-qualified; rust: use <path>::*), so\n a separate leaf-transport package/crate can return them without an\n import cycle (cross-package / cross-crate layout). Absent →\n in-package. Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Module generated (written to --out, or printed to stdout).\n stdout:\n format: text\n '1':\n description: >-\n Generation failed (unreadable/invalid --in, or --lang is not a\n registered emitter).\n stderr:\n format: text\n '2':\n description: Usage error — a required option (--lang or --in) was omitted.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects:\n - file_write\n sideEffectNote: >-\n Writes to the filesystem only when --out is specified; otherwise\n output goes to stdout.\n\n # ── check ────────────────────────────────────────────\n check:\n summary: Verify a committed module matches a fresh generation (drift gate).\n description: >-\n Regenerates the module from --in for --lang and byte-compares it\n against the committed --out file. Exits non-zero on drift. This is the\n build's codegen drift gate.\n usage:\n - bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\n\n options:\n - name: lang\n required: true\n description: Target emitter (must be a registered language).\n value_name: emitter\n schema:\n type: string\n\n - name: in\n required: true\n description: Path to the serialized ComponentGraphIRDoc JSON file.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: false\n description: >-\n The committed covered-module file to diff a fresh generation\n against. At least one of --out / --shared-types-out is required.\n value_name: file\n schema:\n type: string\n file:\n mode: read\n exists: true\n\n - name: shared-types-out\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) The committed BC-OWNED\n shared wire types module to diff a fresh generation against (drift\n gate for the file emitted by `generate --shared-types-out`). May be\n checked together with --out in one invocation; at least one of\n --out / --shared-types-out is required. For go, --shared-types-import\n is required (it names the package). Rejected for other emitters.\n value_name: file\n schema:\n type: string\n file:\n mode: read\n exists: true\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Package (go) / crate\n (rust) path for the BC-GENERATED shared wire types (WireValue/\n WireRow/WireList; rust also the shared BehaviorError). When set, BC\n emits those types into that shared package/crate and the covered\n module imports them (go: package-qualified; rust: use <path>::*), so\n a separate leaf-transport package/crate can return them without an\n import cycle (cross-package / cross-crate layout). Absent →\n in-package. Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Up to date — the committed --out matches a fresh generation.\n stdout:\n format: text\n '1':\n description: >-\n Drift detected (--out differs or does not exist), or generation\n failed (unreadable/invalid --in, or unregistered --lang).\n stderr:\n format: text\n '2':\n description: >-\n Usage error — a required option (--lang or --in) was omitted, or\n neither --out nor --shared-types-out was given.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: []\n";
4
- export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"behavior-contracts CLI\",\n \"version\": \"0.1.0\",\n \"description\": \"bc — the build-time codegen CLI over behavior-contracts' public API. Reads a serialized ComponentGraphIRDoc (the unbranded JSON IR), adopts it via loadCompiledIR, and runs the same generateModule the in-process API runs to emit a runtime-free native module (data baked as literals). The IR doc is a build-time input only; nothing reads it at runtime.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-ogawa\",\n \"url\": \"https://github.com/foo-ogawa/behavior-contracts\"\n }\n },\n \"artifact_slots\": {\n \"ir-doc\": {\n \"direction\": \"read\",\n \"description\": \"Serialized ComponentGraphIRDoc (unbranded JSON IR) — the codegen input.\"\n },\n \"generated-module\": {\n \"direction\": \"write\",\n \"description\": \"Generated native module source (baked-literal, runtime-free).\"\n }\n },\n \"command_sets\": {\n \"bc\": {\n \"summary\": \"build-time codegen CLI over behavior-contracts' public API.\",\n \"executable\": \"bc\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Print version and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Show help and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"generate\": {\n \"summary\": \"Emit a native module from a serialized IR doc.\",\n \"description\": \"Reads the --in ComponentGraphIRDoc, adopts it via loadCompiledIR, and runs generateModule for the --lang emitter. Writes the module source to --out if given, else to stdout. Rejects an unregistered --lang.\",\n \"usage\": [\n \"bc generate --lang rust-typed-native --in ir-doc.json\",\n \"bc generate --lang go-typed-native --in ir-doc.json --out gen.go\",\n \"bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language, e.g. rust-typed-native, go-typed-native, typescript-typed).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": true,\n \"description\": \"Path to the serialized ComponentGraphIRDoc JSON file.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": false,\n \"description\": \"Write the generated covered module here instead of stdout.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"write\"\n }\n },\n {\n \"name\": \"shared-types-out\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Write the BC-OWNED shared wire types module (WireValue/WireRow/WireList + probe kinds, rust also the shared BehaviorError; plus the cross-package/-crate batch ports structs) here. This is the module a covered module built with --shared-types-import imports. Independent of --out: a build may emit the covered module, the shared module, or both. For go the emitted package name is derived from --shared-types-import (so --shared-types-import is required with go). Rejected for other emitters. A standalone --shared-types-out does NOT print the covered module to stdout.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"write\"\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Module generated (written to --out, or printed to stdout).\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Generation failed (unreadable/invalid --in, or --lang is not a registered emitter).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — a required option (--lang or --in) was omitted.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": [\n \"file_write\"\n ],\n \"sideEffectNote\": \"Writes to the filesystem only when --out is specified; otherwise output goes to stdout.\"\n }\n },\n \"check\": {\n \"summary\": \"Verify a committed module matches a fresh generation (drift gate).\",\n \"description\": \"Regenerates the module from --in for --lang and byte-compares it against the committed --out file. Exits non-zero on drift. This is the build's codegen drift gate.\",\n \"usage\": [\n \"bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": true,\n \"description\": \"Path to the serialized ComponentGraphIRDoc JSON file.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": false,\n \"description\": \"The committed covered-module file to diff a fresh generation against. At least one of --out / --shared-types-out is required.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true\n }\n },\n {\n \"name\": \"shared-types-out\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) The committed BC-OWNED shared wire types module to diff a fresh generation against (drift gate for the file emitted by `generate --shared-types-out`). May be checked together with --out in one invocation; at least one of --out / --shared-types-out is required. For go, --shared-types-import is required (it names the package). Rejected for other emitters.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Up to date — the committed --out matches a fresh generation.\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Drift detected (--out differs or does not exist), or generation failed (unreadable/invalid --in, or unregistered --lang).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — a required option (--lang or --in) was omitted, or neither --out nor --shared-types-out was given.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": []\n }\n }\n }\n }\n }\n}";
3
+ export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: behavior-contracts CLI\n version: 0.1.0\n description: >-\n bc — the build-time codegen CLI over behavior-contracts' public API.\n The consumer authors behaviors in TS only (@behavior / defineLeaf /\n behaviorComponents) and never touches the IR. `bc generate --from\n <behaviors.ts> --behavior <ClassName>` uses the TypeScript compiler to\n type-extract each method's `$: In<T>` input-port types and to transpile +\n load the module (decorators supported), then runs ts→ir→native end to end\n in-process (compileBehaviors → generateModule), emitting a runtime-free\n native module (data baked as literals). The IR exists only inside the CLI;\n nothing reads it at runtime. `typescript` is a build-time-only optional peer\n dependency used solely on this `--from <.ts>` path; the runtime entry stays\n dependency-free. `--in <ir-doc.json>` (a pre-serialized ComponentGraphIRDoc)\n remains as an internal/test input alongside --from.\n license:\n name: MIT\n contact:\n name: foo-ogawa\n url: https://github.com/foo-ogawa/behavior-contracts\n\nartifact_slots:\n behaviors-module:\n direction: read\n description: >-\n The consumer's behavior module exporting an @behavior / SemanticBehavior\n class — the TS-authoring codegen input (`--from`). A `.ts` SOURCE is the\n primary form (the TS compiler type-extracts `$: In<T>` input ports +\n transpiles decorators); a compiled `.js`/`.mjs` is also accepted (no input\n types). BC runs ts→ir→native.\n ir-doc:\n direction: read\n description: >-\n Serialized ComponentGraphIRDoc (unbranded JSON IR) — the internal/test\n codegen input (`--in`). The TS-authoring surface uses --from instead.\n generated-module:\n direction: write\n description: Generated native module source (baked-literal, runtime-free).\n\ncommand_sets:\n bc:\n summary: build-time codegen CLI over behavior-contracts' public API.\n executable: bc\n\n global_options:\n - name: version\n aliases: [V]\n description: Print version and exit.\n schema:\n type: boolean\n\n - name: help\n aliases: [h]\n description: Show help and exit.\n schema:\n type: boolean\n\n commands:\n # ── generate ─────────────────────────────────────────\n generate:\n summary: Emit a native module from a TS behavior module (--from) or a serialized IR doc (--in).\n description: >-\n TS-authoring flow (--from): imports the consumer's compiled behavior\n module and reads its --behavior export (an @behavior / SemanticBehavior\n class), then runs ts→ir→native in-process (compileBehaviors →\n generateModule) for the --lang emitter. The IR is CLI-internal and\n never touches the consumer surface. Internal/test flow (--in): reads\n the ComponentGraphIRDoc, adopts it via loadCompiledIR, and runs the\n same generateModule. Exactly one of --from / --in is required (--from\n also requires --behavior). Writes the module source to --out if given,\n else to stdout. Rejects an unregistered --lang.\n usage:\n - bc generate --lang rust-typed-native --from behaviors.js --behavior UserRepo --out gen.rs\n - bc generate --lang go-typed-native --from behaviors.mjs --behavior UserRepo --out gen.go\n - bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\n\n options:\n - name: lang\n required: true\n description: >-\n Target emitter (must be a registered language, e.g.\n rust-typed-native, go-typed-native, typescript-typed).\n value_name: emitter\n schema:\n type: string\n\n - name: from\n required: false\n description: >-\n TS-authoring input. A `.ts` SOURCE is the primary form: the\n TypeScript compiler type-extracts each method's `$: In<T>`\n input-port types (so an input-typed behavior emits native) and\n transpiles + loads the module with decorators (Node type-stripping\n rejects @behavior). A compiled `.js`/`.mjs` is also accepted (no\n input-port types → native emit limited to no-dynamic-input shapes).\n BC reads the --behavior export and runs compileBehaviors →\n generateModule. The module's `behavior-contracts` import must\n resolve to the same installed package as bc (shared\n @behavior/defineLeaf registry). A `.ts` requires the optional peer\n dependency `typescript`. Mutually exclusive with --in.\n value_name: behaviors.(ts|js|mjs)\n schema:\n type: string\n file:\n mode: read\n exists: true\n encoding: utf-8\n\n - name: behavior\n required: false\n description: >-\n (with --from) The name of the exported @behavior / SemanticBehavior\n class to compile (one class = its public methods each a root\n Behavior). Required whenever --from is given.\n value_name: ClassName\n schema:\n type: string\n\n - name: in\n required: false\n description: >-\n Internal/test input: path to a serialized ComponentGraphIRDoc JSON\n file. The TS-authoring surface uses --from instead. Mutually\n exclusive with --from.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: false\n description: Write the generated covered module here instead of stdout.\n value_name: file\n schema:\n type: string\n file:\n mode: write\n\n - name: shared-types-out\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Write the BC-OWNED\n shared wire types module (WireValue/WireRow/WireList + probe kinds,\n rust also the shared BehaviorError; plus the cross-package/-crate\n batch ports structs) here. This is the module a covered module built\n with --shared-types-import imports. Independent of --out: a build may\n emit the covered module, the shared module, or both. For go the\n emitted package name is derived from --shared-types-import (so\n --shared-types-import is required with go). Rejected for other\n emitters. A standalone --shared-types-out does NOT print the covered\n module to stdout.\n value_name: file\n schema:\n type: string\n file:\n mode: write\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Package (go) / crate\n (rust) path for the BC-GENERATED shared wire types (WireValue/\n WireRow/WireList; rust also the shared BehaviorError). When set, BC\n emits those types into that shared package/crate and the covered\n module imports them (go: package-qualified; rust: use <path>::*), so\n a separate leaf-transport package/crate can return them without an\n import cycle (cross-package / cross-crate layout). Absent →\n in-package. Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Module generated (written to --out, or printed to stdout).\n stdout:\n format: text\n '1':\n description: >-\n Generation failed (--from module unimportable / missing --behavior\n export / compile error; or unreadable/invalid --in; or --lang is\n not a registered emitter).\n stderr:\n format: text\n '2':\n description: >-\n Usage error — --lang omitted, neither --from nor --in given (or\n both), or --from without --behavior.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects:\n - file_write\n sideEffectNote: >-\n Writes to the filesystem only when --out is specified; otherwise\n output goes to stdout.\n\n # ── check ────────────────────────────────────────────\n check:\n summary: Verify a committed module matches a fresh generation (drift gate).\n description: >-\n Regenerates the module for --lang from the SAME input as generate\n (--from a TS behavior module + --behavior, or --in an IR doc) and\n byte-compares it against the committed --out file. Exits non-zero on\n drift. This is the build's codegen drift gate.\n usage:\n - bc check --lang rust-typed-native --from behaviors.js --behavior UserRepo --out gen.rs\n - bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\n\n options:\n - name: lang\n required: true\n description: Target emitter (must be a registered language).\n value_name: emitter\n schema:\n type: string\n\n - name: from\n required: false\n description: >-\n TS-authoring input (same as generate --from): a `.ts` SOURCE (TS\n compiler type-extracts `$: In<T>` + transpiles decorators; needs the\n optional peer `typescript`) or a compiled `.js`/`.mjs`. Regenerated\n + byte-compared against --out. Requires --behavior. Mutually\n exclusive with --in.\n value_name: behaviors.(ts|js|mjs)\n schema:\n type: string\n file:\n mode: read\n exists: true\n encoding: utf-8\n\n - name: behavior\n required: false\n description: >-\n (with --from) The name of the exported @behavior / SemanticBehavior\n class to compile. Required whenever --from is given.\n value_name: ClassName\n schema:\n type: string\n\n - name: in\n required: false\n description: >-\n Internal/test input: path to a serialized ComponentGraphIRDoc JSON\n file. Mutually exclusive with --from.\n value_name: ir-doc.json\n schema:\n type: string\n file:\n mode: read\n exists: true\n media_type: application/json\n encoding: utf-8\n\n - name: out\n required: false\n description: >-\n The committed covered-module file to diff a fresh generation\n against. At least one of --out / --shared-types-out is required.\n value_name: file\n schema:\n type: string\n file:\n mode: read\n exists: true\n\n - name: shared-types-out\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) The committed BC-OWNED\n shared wire types module to diff a fresh generation against (drift\n gate for the file emitted by `generate --shared-types-out`). May be\n checked together with --out in one invocation; at least one of\n --out / --shared-types-out is required. For go, --shared-types-import\n is required (it names the package). Rejected for other emitters.\n value_name: file\n schema:\n type: string\n file:\n mode: read\n exists: true\n\n - name: runtime-import\n required: false\n description: Override the runtime import specifier baked into the module.\n value_name: spec\n schema:\n type: string\n\n - name: shared-types-import\n required: false\n description: >-\n (--lang go-typed-native / rust-typed-native) Package (go) / crate\n (rust) path for the BC-GENERATED shared wire types (WireValue/\n WireRow/WireList; rust also the shared BehaviorError). When set, BC\n emits those types into that shared package/crate and the covered\n module imports them (go: package-qualified; rust: use <path>::*), so\n a separate leaf-transport package/crate can return them without an\n import cycle (cross-package / cross-crate layout). Absent →\n in-package. Ignored by other emitters.\n value_name: spec\n schema:\n type: string\n\n - name: leaf-transport\n required: false\n repeatable: true\n description: >-\n (--lang rust-typed-native / go-typed-native only) Map a covered leaf\n (catalog component) to the op-agnostic transport symbol the runner\n calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not\n listed uses the in-package default name (rust leaf_<comp> / go\n Leaf_<comp>). Ignored by other emitters.\n value_name: mapping\n schema:\n type: array\n items:\n type: string\n\n - name: leaf-transport-import\n required: false\n description: >-\n (--lang rust-typed-native / go-typed-native only) Module the leaf\n transport symbols are imported from (rust `use <module>::{…}`, go\n package import + selector); absent → resolve in-scope / same\n package. Ignored by other emitters.\n value_name: module\n schema:\n type: string\n\n exits:\n '0':\n description: Up to date — the committed --out matches a fresh generation.\n stdout:\n format: text\n '1':\n description: >-\n Drift detected (--out differs or does not exist), or generation\n failed (--from module unimportable / missing --behavior export /\n compile error; or unreadable/invalid --in; or unregistered --lang).\n stderr:\n format: text\n '2':\n description: >-\n Usage error — --lang omitted, neither --from nor --in given (or\n both), --from without --behavior, or neither --out nor\n --shared-types-out was given.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: []\n";
4
+ export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"behavior-contracts CLI\",\n \"version\": \"0.1.0\",\n \"description\": \"bc — the build-time codegen CLI over behavior-contracts' public API. The consumer authors behaviors in TS only (@behavior / defineLeaf / behaviorComponents) and never touches the IR. `bc generate --from <behaviors.ts> --behavior <ClassName>` uses the TypeScript compiler to type-extract each method's `$: In<T>` input-port types and to transpile + load the module (decorators supported), then runs ts→ir→native end to end in-process (compileBehaviors → generateModule), emitting a runtime-free native module (data baked as literals). The IR exists only inside the CLI; nothing reads it at runtime. `typescript` is a build-time-only optional peer dependency used solely on this `--from <.ts>` path; the runtime entry stays dependency-free. `--in <ir-doc.json>` (a pre-serialized ComponentGraphIRDoc) remains as an internal/test input alongside --from.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-ogawa\",\n \"url\": \"https://github.com/foo-ogawa/behavior-contracts\"\n }\n },\n \"artifact_slots\": {\n \"behaviors-module\": {\n \"direction\": \"read\",\n \"description\": \"The consumer's behavior module exporting an @behavior / SemanticBehavior class — the TS-authoring codegen input (`--from`). A `.ts` SOURCE is the primary form (the TS compiler type-extracts `$: In<T>` input ports + transpiles decorators); a compiled `.js`/`.mjs` is also accepted (no input types). BC runs ts→ir→native.\"\n },\n \"ir-doc\": {\n \"direction\": \"read\",\n \"description\": \"Serialized ComponentGraphIRDoc (unbranded JSON IR) — the internal/test codegen input (`--in`). The TS-authoring surface uses --from instead.\"\n },\n \"generated-module\": {\n \"direction\": \"write\",\n \"description\": \"Generated native module source (baked-literal, runtime-free).\"\n }\n },\n \"command_sets\": {\n \"bc\": {\n \"summary\": \"build-time codegen CLI over behavior-contracts' public API.\",\n \"executable\": \"bc\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Print version and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Show help and exit.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"generate\": {\n \"summary\": \"Emit a native module from a TS behavior module (--from) or a serialized IR doc (--in).\",\n \"description\": \"TS-authoring flow (--from): imports the consumer's compiled behavior module and reads its --behavior export (an @behavior / SemanticBehavior class), then runs ts→ir→native in-process (compileBehaviors → generateModule) for the --lang emitter. The IR is CLI-internal and never touches the consumer surface. Internal/test flow (--in): reads the ComponentGraphIRDoc, adopts it via loadCompiledIR, and runs the same generateModule. Exactly one of --from / --in is required (--from also requires --behavior). Writes the module source to --out if given, else to stdout. Rejects an unregistered --lang.\",\n \"usage\": [\n \"bc generate --lang rust-typed-native --from behaviors.js --behavior UserRepo --out gen.rs\",\n \"bc generate --lang go-typed-native --from behaviors.mjs --behavior UserRepo --out gen.go\",\n \"bc generate --lang typescript-typed --in ir-doc.json --runtime-import ./runtime.js\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language, e.g. rust-typed-native, go-typed-native, typescript-typed).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"from\",\n \"required\": false,\n \"description\": \"TS-authoring input. A `.ts` SOURCE is the primary form: the TypeScript compiler type-extracts each method's `$: In<T>` input-port types (so an input-typed behavior emits native) and transpiles + loads the module with decorators (Node type-stripping rejects @behavior). A compiled `.js`/`.mjs` is also accepted (no input-port types → native emit limited to no-dynamic-input shapes). BC reads the --behavior export and runs compileBehaviors → generateModule. The module's `behavior-contracts` import must resolve to the same installed package as bc (shared @behavior/defineLeaf registry). A `.ts` requires the optional peer dependency `typescript`. Mutually exclusive with --in.\",\n \"value_name\": \"behaviors.(ts|js|mjs)\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"behavior\",\n \"required\": false,\n \"description\": \"(with --from) The name of the exported @behavior / SemanticBehavior class to compile (one class = its public methods each a root Behavior). Required whenever --from is given.\",\n \"value_name\": \"ClassName\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": false,\n \"description\": \"Internal/test input: path to a serialized ComponentGraphIRDoc JSON file. The TS-authoring surface uses --from instead. Mutually exclusive with --from.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": false,\n \"description\": \"Write the generated covered module here instead of stdout.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"write\"\n }\n },\n {\n \"name\": \"shared-types-out\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Write the BC-OWNED shared wire types module (WireValue/WireRow/WireList + probe kinds, rust also the shared BehaviorError; plus the cross-package/-crate batch ports structs) here. This is the module a covered module built with --shared-types-import imports. Independent of --out: a build may emit the covered module, the shared module, or both. For go the emitted package name is derived from --shared-types-import (so --shared-types-import is required with go). Rejected for other emitters. A standalone --shared-types-out does NOT print the covered module to stdout.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"write\"\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Module generated (written to --out, or printed to stdout).\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Generation failed (--from module unimportable / missing --behavior export / compile error; or unreadable/invalid --in; or --lang is not a registered emitter).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — --lang omitted, neither --from nor --in given (or both), or --from without --behavior.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": [\n \"file_write\"\n ],\n \"sideEffectNote\": \"Writes to the filesystem only when --out is specified; otherwise output goes to stdout.\"\n }\n },\n \"check\": {\n \"summary\": \"Verify a committed module matches a fresh generation (drift gate).\",\n \"description\": \"Regenerates the module for --lang from the SAME input as generate (--from a TS behavior module + --behavior, or --in an IR doc) and byte-compares it against the committed --out file. Exits non-zero on drift. This is the build's codegen drift gate.\",\n \"usage\": [\n \"bc check --lang rust-typed-native --from behaviors.js --behavior UserRepo --out gen.rs\",\n \"bc check --lang rust-typed-native --in ir-doc.json --out gen.rs\"\n ],\n \"options\": [\n {\n \"name\": \"lang\",\n \"required\": true,\n \"description\": \"Target emitter (must be a registered language).\",\n \"value_name\": \"emitter\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"from\",\n \"required\": false,\n \"description\": \"TS-authoring input (same as generate --from): a `.ts` SOURCE (TS compiler type-extracts `$: In<T>` + transpiles decorators; needs the optional peer `typescript`) or a compiled `.js`/`.mjs`. Regenerated + byte-compared against --out. Requires --behavior. Mutually exclusive with --in.\",\n \"value_name\": \"behaviors.(ts|js|mjs)\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"behavior\",\n \"required\": false,\n \"description\": \"(with --from) The name of the exported @behavior / SemanticBehavior class to compile. Required whenever --from is given.\",\n \"value_name\": \"ClassName\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"in\",\n \"required\": false,\n \"description\": \"Internal/test input: path to a serialized ComponentGraphIRDoc JSON file. Mutually exclusive with --from.\",\n \"value_name\": \"ir-doc.json\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true,\n \"media_type\": \"application/json\",\n \"encoding\": \"utf-8\"\n }\n },\n {\n \"name\": \"out\",\n \"required\": false,\n \"description\": \"The committed covered-module file to diff a fresh generation against. At least one of --out / --shared-types-out is required.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true\n }\n },\n {\n \"name\": \"shared-types-out\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) The committed BC-OWNED shared wire types module to diff a fresh generation against (drift gate for the file emitted by `generate --shared-types-out`). May be checked together with --out in one invocation; at least one of --out / --shared-types-out is required. For go, --shared-types-import is required (it names the package). Rejected for other emitters.\",\n \"value_name\": \"file\",\n \"schema\": {\n \"type\": \"string\"\n },\n \"file\": {\n \"mode\": \"read\",\n \"exists\": true\n }\n },\n {\n \"name\": \"runtime-import\",\n \"required\": false,\n \"description\": \"Override the runtime import specifier baked into the module.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"shared-types-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native / rust-typed-native) Package (go) / crate (rust) path for the BC-GENERATED shared wire types (WireValue/ WireRow/WireList; rust also the shared BehaviorError). When set, BC emits those types into that shared package/crate and the covered module imports them (go: package-qualified; rust: use <path>::*), so a separate leaf-transport package/crate can return them without an import cycle (cross-package / cross-crate layout). Absent → in-package. Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"leaf-transport\",\n \"required\": false,\n \"repeatable\": true,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Map a covered leaf (catalog component) to the op-agnostic transport symbol the runner calls directly, as <leaf>=<symbol>; repeat per leaf. A leaf not listed uses the in-package default name (rust leaf_<comp> / go Leaf_<comp>). Ignored by other emitters.\",\n \"value_name\": \"mapping\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"name\": \"leaf-transport-import\",\n \"required\": false,\n \"description\": \"(--lang rust-typed-native / go-typed-native only) Module the leaf transport symbols are imported from (rust `use <module>::{…}`, go package import + selector); absent → resolve in-scope / same package. Ignored by other emitters.\",\n \"value_name\": \"module\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"Up to date — the committed --out matches a fresh generation.\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Drift detected (--out differs or does not exist), or generation failed (--from module unimportable / missing --behavior export / compile error; or unreadable/invalid --in; or unregistered --lang).\",\n \"stderr\": {\n \"format\": \"text\"\n }\n },\n \"2\": {\n \"description\": \"Usage error — --lang omitted, neither --from nor --in given (or both), --from without --behavior, or neither --out nor --shared-types-out was given.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": []\n }\n }\n }\n }\n }\n}";
5
5
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,0yXAA0yX,CAAC;AAEh1X,MAAM,CAAC,MAAM,iBAAiB,GAAW,mxbAAmxb,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,k/gBAAk/gB,CAAC;AAExhhB,MAAM,CAAC,MAAM,iBAAiB,GAAW,o4kBAAo4kB,CAAC"}
@@ -2,6 +2,8 @@ import { Command } from "commander";
2
2
  export interface CommandHandlers {
3
3
  generate: (options: {
4
4
  lang?: string;
5
+ from?: string;
6
+ behavior?: string;
5
7
  in?: string;
6
8
  out?: string;
7
9
  sharedTypesOut?: string;
@@ -12,6 +14,8 @@ export interface CommandHandlers {
12
14
  }, parentOpts: Record<string, unknown>) => Promise<void>;
13
15
  check: (options: {
14
16
  lang?: string;
17
+ from?: string;
18
+ behavior?: string;
15
19
  in?: string;
16
20
  out?: string;
17
21
  sharedTypesOut?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,C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CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7R,KAAK,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3R;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,GACd,OAAO,CA+HT"}
@@ -9,9 +9,11 @@ export function createProgram(handlers, version) {
9
9
  .description("build-time codegen CLI over behavior-contracts' public API.");
10
10
  program
11
11
  .command("generate")
12
- .description("Emit a native module from a serialized IR doc.")
12
+ .description("Emit a native module from a TS behavior module (--from) or a serialized IR doc (--in).")
13
13
  .option("--lang <emitter>", "Target emitter (must be a registered language, e.g. rust-typed-native, go-typed-native, typescript-typed).")
14
- .option("--in <ir-doc.json>", "Path to the serialized ComponentGraphIRDoc JSON file.")
14
+ .option("--from <behaviors.(ts|js|mjs)>", "TS-authoring input. A `.ts` SOURCE is the primary form: the TypeScript compiler type-extracts each method's `$: In<T>` input-port types (so an input-typed behavior emits native) and transpiles + loads the module with decorators (Node type-stripping rejects @behavior). A compiled `.js`/`.mjs` is also accepted (no input-port types → native emit limited to no-dynamic-input shapes). BC reads the --behavior export and runs compileBehaviors → generateModule. The module's `behavior-contracts` import must resolve to the same installed package as bc (shared @behavior/defineLeaf registry). A `.ts` requires the optional peer dependency `typescript`. Mutually exclusive with --in.")
15
+ .option("--behavior <ClassName>", "(with --from) The name of the exported @behavior / SemanticBehavior class to compile (one class = its public methods each a root Behavior). Required whenever --from is given.")
16
+ .option("--in <ir-doc.json>", "Internal/test input: path to a serialized ComponentGraphIRDoc JSON file. The TS-authoring surface uses --from instead. Mutually exclusive with --from.")
15
17
  .option("--out <file>", "Write the generated covered module here instead of stdout.")
16
18
  .option("--shared-types-out <file>", "(--lang go-typed-native / rust-typed-native) Write the BC-OWNED shared wire types module (WireValue/WireRow/WireList + probe kinds, rust also the shared BehaviorError; plus the cross-package/-crate batch ports structs) here. This is the module a covered module built with --shared-types-import imports. Independent of --out: a build may emit the covered module, the shared module, or both. For go the emitted package name is derived from --shared-types-import (so --shared-types-import is required with go). Rejected for other emitters. A standalone --shared-types-out does NOT print the covered module to stdout.")
17
19
  .option("--runtime-import <spec>", "Override the runtime import specifier baked into the module.")
@@ -25,7 +27,9 @@ export function createProgram(handlers, version) {
25
27
  .command("check")
26
28
  .description("Verify a committed module matches a fresh generation (drift gate).")
27
29
  .option("--lang <emitter>", "Target emitter (must be a registered language).")
28
- .option("--in <ir-doc.json>", "Path to the serialized ComponentGraphIRDoc JSON file.")
30
+ .option("--from <behaviors.(ts|js|mjs)>", "TS-authoring input (same as generate --from): a `.ts` SOURCE (TS compiler type-extracts `$: In<T>` + transpiles decorators; needs the optional peer `typescript`) or a compiled `.js`/`.mjs`. Regenerated + byte-compared against --out. Requires --behavior. Mutually exclusive with --in.")
31
+ .option("--behavior <ClassName>", "(with --from) The name of the exported @behavior / SemanticBehavior class to compile. Required whenever --from is given.")
32
+ .option("--in <ir-doc.json>", "Internal/test input: path to a serialized ComponentGraphIRDoc JSON file. Mutually exclusive with --from.")
29
33
  .option("--out <file>", "The committed covered-module file to diff a fresh generation against. At least one of --out / --shared-types-out is required.")
30
34
  .option("--shared-types-out <file>", "(--lang go-typed-native / rust-typed-native) The committed BC-OWNED shared wire types module to diff a fresh generation against (drift gate for the file emitted by `generate --shared-types-out`). May be checked together with --out in one invocation; at least one of --out / --shared-types-out is required. For go, --shared-types-import is required (it names the package). Rejected for other emitters.")
31
35
  .option("--runtime-import <spec>", "Override the runtime import specifier baked into the module.")
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAOjE,MAAM,UAAU,aAAa,CAC3B,QAAyB,EACzB,OAAe;IAEf,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO;SACJ,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC;SACjC,WAAW,CAAC,6DAA6D,CAAC,CAAC;IAG9E,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,gDAAgD,CAAC;SAC7D,MAAM,CAAC,kBAAkB,EAAE,4GAA4G,CAAC;SACxI,MAAM,CAAC,oBAAoB,EAAE,uDAAuD,CAAC;SACrF,MAAM,CAAC,cAAc,EAAE,4DAA4D,CAAC;SACpF,MAAM,CAAC,2BAA2B,EAAE,umBAAumB,CAAC;SAC5oB,MAAM,CAAC,yBAAyB,EAAE,8DAA8D,CAAC;SACjG,MAAM,CAAC,8BAA8B,EAAE,kfAAkf,CAA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Out?: string;
6
8
  runtimeImport?: string;
@@ -21,7 +23,9 @@ export type GenerateExitResult = {
21
23
  };
22
24
  export interface CheckOptions {
23
25
  lang: string;
24
- in: string;
26
+ from?: string;
27
+ behavior?: string;
28
+ in?: string;
25
29
  out?: string;
26
30
  sharedTypesOut?: string;
27
31
  runtimeImport?: string;