behavior-contracts 0.9.3 → 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.
- package/cli-contract.yaml +116 -24
- package/dist/authoring.d.ts +18 -1
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +11 -0
- package/dist/authoring.js.map +1 -1
- package/dist/behavior.d.ts +23 -0
- package/dist/behavior.d.ts.map +1 -1
- package/dist/behavior.js.map +1 -1
- package/dist/bind.d.ts +1 -1
- package/dist/bind.d.ts.map +1 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +21 -6
- package/dist/builder.js.map +1 -1
- package/dist/cli.js +65 -40
- package/dist/cli.js.map +1 -1
- package/dist/commands/codegen.d.ts +18 -12
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +111 -27
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/ts-extract.d.ts +26 -0
- package/dist/commands/ts-extract.d.ts.map +1 -0
- package/dist/commands/ts-extract.js +265 -0
- package/dist/commands/ts-extract.js.map +1 -0
- package/dist/generated/commands.d.ts.map +1 -1
- package/dist/generated/commands.js +8 -0
- package/dist/generated/commands.js.map +1 -1
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/contract.js +2 -2
- package/dist/generated/contract.js.map +1 -1
- package/dist/generated/program.d.ts +4 -0
- package/dist/generated/program.d.ts.map +1 -1
- package/dist/generated/program.js +7 -3
- package/dist/generated/program.js.map +1 -1
- package/dist/generated/types.d.ts +6 -2
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-go.d.ts +5 -7
- package/dist/generator/emit-typed-native-go.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-go.js +244 -404
- package/dist/generator/emit-typed-native-go.js.map +1 -1
- package/dist/generator/emit-typed-native-rust.d.ts +6 -8
- package/dist/generator/emit-typed-native-rust.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-rust.js +234 -371
- package/dist/generator/emit-typed-native-rust.js.map +1 -1
- package/dist/guard.d.ts +23 -0
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +52 -0
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +3 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/ir-handle.d.ts +30 -0
- package/dist/ir-handle.d.ts.map +1 -0
- package/dist/ir-handle.js +2 -0
- package/dist/ir-handle.js.map +1 -0
- package/dist/provenance.d.ts +1 -1
- package/dist/provenance.d.ts.map +1 -1
- package/package.json +9 -1
|
@@ -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,
|
|
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,CAAC,OAAO,EAAE;QAAE,IAAI,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;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,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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("--
|
|
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("--
|
|
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,WA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ypesOut?: string;
|
|
6
8
|
runtimeImport?: string;
|
|
@@ -21,7 +23,9 @@ export type GenerateExitResult = {
|
|
|
21
23
|
};
|
|
22
24
|
export interface CheckOptions {
|
|
23
25
|
lang: string;
|
|
24
|
-
|
|
26
|
+
from?: string;
|
|
27
|
+
behavior?: string;
|
|
28
|
+
in?: string;
|
|
25
29
|
out?: string;
|
|
26
30
|
sharedTypesOut?: string;
|
|
27
31
|
runtimeImport?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEzC,MAAM,MAAM,kBAAkB,GAC5B;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtC,MAAM,MAAM,eAAe,GACzB;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -53,13 +53,11 @@ export declare function goSharedTypesPackageName(sharedTypesImport: string): str
|
|
|
53
53
|
/**
|
|
54
54
|
* goSharedWireTypesPackage — the BC-GENERATED shared package (Task A cross-package). Emits the SAME seam the
|
|
55
55
|
* covered module emits in-package (emitGoProbeKinds + emitProbeWireTypes + emitGoWireTypes) into a standalone
|
|
56
|
-
* package, so a separate leaf-transport package can return `WireValue` (and the
|
|
57
|
-
* without an import cycle.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
* is the package's Go identifier (the last path segment of `sharedTypesImport`). */
|
|
62
|
-
export declare function goSharedWireTypesPackage(pkgName: string, ir?: unknown): string;
|
|
56
|
+
* package, so a separate leaf-transport package can take a `WireRow` payload + return `WireValue` (and the
|
|
57
|
+
* covered module reference them) without an import cycle. #183: the transport ABI is the generic `WireRow`
|
|
58
|
+
* payload built inline at the call site — there are NO per-node/per-role batch ports structs to emit here.
|
|
59
|
+
* Self-contained (only `strconv` for the numeric constructors). `pkgName` is the package's Go identifier. */
|
|
60
|
+
export declare function goSharedWireTypesPackage(pkgName: string): string;
|
|
63
61
|
/**
|
|
64
62
|
* goTypedNativeObserve — the TEST-ONLY observe companion (a SEPARATE file in the SAME package as the
|
|
65
63
|
* covered module). It carries the typed->Value serializers (ser_*) + the SCRIPTED analog of the consumer's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-typed-native-go.d.ts","sourceRoot":"","sources":["../../src/generator/emit-typed-native-go.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,KAAK,EAAe,aAAa,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAiClF;;;;+GAI+G;AAC/G,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAE1E;
|
|
1
|
+
{"version":3,"file":"emit-typed-native-go.d.ts","sourceRoot":"","sources":["../../src/generator/emit-typed-native-go.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,KAAK,EAAe,aAAa,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAiClF;;;;+GAI+G;AAC/G,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAE1E;AAo9FD;;;;;;6GAM6G;AAC7G,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAchE;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAqT7G;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAOlC,CAAC"}
|