behavior-contracts 0.8.11 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -16
- package/cli-contract.yaml +46 -44
- package/dist/behavior.d.ts +10 -1
- package/dist/behavior.d.ts.map +1 -1
- package/dist/behavior.js +5 -0
- package/dist/behavior.js.map +1 -1
- package/dist/cli.js +16 -14
- package/dist/cli.js.map +1 -1
- package/dist/commands/codegen.d.ts +4 -3
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +8 -5
- package/dist/commands/codegen.js.map +1 -1
- package/dist/generated/commands.d.ts.map +1 -1
- package/dist/generated/commands.js +12 -16
- 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 +6 -8
- package/dist/generated/program.d.ts.map +1 -1
- package/dist/generated/program.js +6 -8
- package/dist/generated/program.js.map +1 -1
- package/dist/generated/types.d.ts +6 -8
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/generator/core.d.ts +9 -24
- package/dist/generator/core.d.ts.map +1 -1
- package/dist/generator/core.js +1 -1
- package/dist/generator/core.js.map +1 -1
- package/dist/generator/emit-shared-debox.d.ts.map +1 -1
- package/dist/generator/emit-shared-debox.js +2 -0
- package/dist/generator/emit-shared-debox.js.map +1 -1
- package/dist/generator/emit-shared-go-typed.d.ts +2 -0
- package/dist/generator/emit-shared-go-typed.d.ts.map +1 -1
- package/dist/generator/emit-shared-go-typed.js +31 -0
- package/dist/generator/emit-shared-go-typed.js.map +1 -1
- package/dist/generator/emit-shared-rust-typed.d.ts.map +1 -1
- package/dist/generator/emit-shared-rust-typed.js +13 -0
- package/dist/generator/emit-shared-rust-typed.js.map +1 -1
- package/dist/generator/emit-shared-typescript-typed.d.ts.map +1 -1
- package/dist/generator/emit-shared-typescript-typed.js +4 -0
- package/dist/generator/emit-shared-typescript-typed.js.map +1 -1
- package/dist/generator/emit-typed-native-go.d.ts +10 -0
- package/dist/generator/emit-typed-native-go.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-go.js +360 -204
- package/dist/generator/emit-typed-native-go.js.map +1 -1
- package/dist/generator/emit-typed-native-rust.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-rust.js +217 -224
- package/dist/generator/emit-typed-native-rust.js.map +1 -1
- package/dist/generator/index.d.ts +1 -1
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +1 -1
- package/dist/generator/index.js.map +1 -1
- package/dist/generator/typed.d.ts +9 -0
- package/dist/generator/typed.d.ts.map +1 -1
- package/dist/generator/typed.js +37 -0
- package/dist/generator/typed.js.map +1 -1
- package/dist/guard.d.ts +7 -0
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +9 -2
- package/dist/guard.js.map +1 -1
- package/package.json +1 -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 module here instead of 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:
|
|
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 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\": \"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\": \"go-wire-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Go package path the consumer's wire seam types live in; when set, the covered module imports it and qualifies the seam type names (e.g. WireValue → <pkg>.WireValue). Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"go-wire-value\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Name of the consumer's WireValue seam type. Default WireValue. Ignored by other emitters.\",\n \"value_name\": \"name\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"go-wire-row\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Name of the consumer's WireRow seam type. Default WireRow. Ignored by other emitters.\",\n \"value_name\": \"name\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"go-wire-list\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Name of the consumer's WireList seam type. Default WireList. Ignored by other emitters.\",\n \"value_name\": \"name\",\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\": true,\n \"description\": \"The committed module file to diff a fresh generation against.\",\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\": \"go-wire-import\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Go package path the consumer's wire seam types live in; when set, the covered module imports it and qualifies the seam type names (e.g. WireValue → <pkg>.WireValue). Ignored by other emitters.\",\n \"value_name\": \"spec\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"go-wire-value\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Name of the consumer's WireValue seam type. Default WireValue. Ignored by other emitters.\",\n \"value_name\": \"name\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"go-wire-row\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Name of the consumer's WireRow seam type. Default WireRow. Ignored by other emitters.\",\n \"value_name\": \"name\",\n \"schema\": {\n \"type\": \"string\"\n }\n },\n {\n \"name\": \"go-wire-list\",\n \"required\": false,\n \"description\": \"(--lang go-typed-native only) Name of the consumer's WireList seam type. Default WireList. Ignored by other emitters.\",\n \"value_name\": \"name\",\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.\",\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 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 module here instead of 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 only) Go package path for the BC-GENERATED\n shared wire types (WireValue/WireRow/WireList). When set, BC emits\n those types into that shared package and the covered module imports +\n qualifies them, so a separate leaf-transport package can return them\n without an import cycle (cross-package layout). Absent → in-package.\n 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: true\n description: The committed module file to diff a fresh generation against.\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 only) Go package path for the BC-GENERATED\n shared wire types (WireValue/WireRow/WireList). When set, BC emits\n those types into that shared package and the covered module imports +\n qualifies them, so a separate leaf-transport package can return them\n without an import cycle (cross-package layout). Absent → in-package.\n 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: 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";
|
|
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 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\": \"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 only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package 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\": true,\n \"description\": \"The committed module file to diff a fresh generation against.\",\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 only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package 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.\",\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,onTAAonT,CAAC;AAE1pT,MAAM,CAAC,MAAM,iBAAiB,GAAW,krXAAkrX,CAAC"}
|
|
@@ -5,20 +5,18 @@ export interface CommandHandlers {
|
|
|
5
5
|
in?: string;
|
|
6
6
|
out?: string;
|
|
7
7
|
runtimeImport?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
goWireList?: string;
|
|
8
|
+
sharedTypesImport?: string;
|
|
9
|
+
leafTransport?: string;
|
|
10
|
+
leafTransportImport?: string;
|
|
12
11
|
}, parentOpts: Record<string, unknown>) => Promise<void>;
|
|
13
12
|
check: (options: {
|
|
14
13
|
lang?: string;
|
|
15
14
|
in?: string;
|
|
16
15
|
out?: string;
|
|
17
16
|
runtimeImport?: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
goWireList?: string;
|
|
17
|
+
sharedTypesImport?: string;
|
|
18
|
+
leafTransport?: string;
|
|
19
|
+
leafTransportImport?: string;
|
|
22
20
|
}, parentOpts: Record<string, unknown>) => Promise<void>;
|
|
23
21
|
}
|
|
24
22
|
export declare function createProgram(handlers: CommandHandlers, version: string): Command;
|
|
@@ -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,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,
|
|
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,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;IAClO,KAAK,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,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;CAChO;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,GACd,OAAO,CAyHT"}
|
|
@@ -14,10 +14,9 @@ export function createProgram(handlers, version) {
|
|
|
14
14
|
.option("--in <ir-doc.json>", "Path to the serialized ComponentGraphIRDoc JSON file.")
|
|
15
15
|
.option("--out <file>", "Write the generated module here instead of stdout.")
|
|
16
16
|
.option("--runtime-import <spec>", "Override the runtime import specifier baked into the module.")
|
|
17
|
-
.option("--
|
|
18
|
-
.option("--
|
|
19
|
-
.option("--
|
|
20
|
-
.option("--go-wire-list <name>", "(--lang go-typed-native only) Name of the consumer's WireList seam type. Default WireList. Ignored by other emitters.")
|
|
17
|
+
.option("--shared-types-import <spec>", "(--lang go-typed-native only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package layout). Absent → in-package. Ignored by other emitters.")
|
|
18
|
+
.option("--leaf-transport <mapping...>", "(--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.")
|
|
19
|
+
.option("--leaf-transport-import <module>", "(--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.")
|
|
21
20
|
.action(async (opts, cmd) => {
|
|
22
21
|
await handlers.generate(opts, cmd.optsWithGlobals());
|
|
23
22
|
});
|
|
@@ -28,10 +27,9 @@ export function createProgram(handlers, version) {
|
|
|
28
27
|
.option("--in <ir-doc.json>", "Path to the serialized ComponentGraphIRDoc JSON file.")
|
|
29
28
|
.option("--out <file>", "The committed module file to diff a fresh generation against.")
|
|
30
29
|
.option("--runtime-import <spec>", "Override the runtime import specifier baked into the module.")
|
|
31
|
-
.option("--
|
|
32
|
-
.option("--
|
|
33
|
-
.option("--
|
|
34
|
-
.option("--go-wire-list <name>", "(--lang go-typed-native only) Name of the consumer's WireList seam type. Default WireList. Ignored by other emitters.")
|
|
30
|
+
.option("--shared-types-import <spec>", "(--lang go-typed-native only) Go package path for the BC-GENERATED shared wire types (WireValue/WireRow/WireList). When set, BC emits those types into that shared package and the covered module imports + qualifies them, so a separate leaf-transport package can return them without an import cycle (cross-package layout). Absent → in-package. Ignored by other emitters.")
|
|
31
|
+
.option("--leaf-transport <mapping...>", "(--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.")
|
|
32
|
+
.option("--leaf-transport-import <module>", "(--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.")
|
|
35
33
|
.action(async (opts, cmd) => {
|
|
36
34
|
await handlers.check(opts, cmd.optsWithGlobals());
|
|
37
35
|
});
|
|
@@ -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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
|
8
|
-
|
|
9
|
-
goWireList?: string;
|
|
6
|
+
sharedTypesImport?: string;
|
|
7
|
+
leafTransport?: string[];
|
|
8
|
+
leafTransportImport?: string;
|
|
10
9
|
}
|
|
11
10
|
export type GenerateExitCode = 0 | 1 | 2;
|
|
12
11
|
export type GenerateExitResult = {
|
|
@@ -24,10 +23,9 @@ export interface CheckOptions {
|
|
|
24
23
|
in: string;
|
|
25
24
|
out: string;
|
|
26
25
|
runtimeImport?: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
goWireList?: string;
|
|
26
|
+
sharedTypesImport?: string;
|
|
27
|
+
leafTransport?: string[];
|
|
28
|
+
leafTransportImport?: string;
|
|
31
29
|
}
|
|
32
30
|
export type CheckExitCode = 0 | 1 | 2;
|
|
33
31
|
export type CheckExitResult = {
|
|
@@ -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;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,
|
|
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;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,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,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,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"}
|
package/dist/generator/core.d.ts
CHANGED
|
@@ -13,24 +13,6 @@ import type { ComponentGraphIR } from "../behavior.js";
|
|
|
13
13
|
export type IoModel = "sync" | "async" | {
|
|
14
14
|
readonly asyncComponents: readonly string[];
|
|
15
15
|
};
|
|
16
|
-
/**
|
|
17
|
-
* GoWireOptions (go-typed-native) — the CONCRETE consumer wire seam names the covered read de-box
|
|
18
|
-
* classifies a node result against. bc does NOT define the wire types (that would own the wire format)
|
|
19
|
-
* and does NOT make them interfaces (a Go interface is vtable dynamic dispatch); it REFERENCES these
|
|
20
|
-
* concrete consumer type names and calls their methods directly (zero dynamic dispatch, zero dictionary):
|
|
21
|
-
* - `value` — the node-result WIRE type (methods `AsString/AsNumber/AsBool/AsRow/AsList`);
|
|
22
|
-
* - `row` — a wire map/record (methods `Keys/ProbeString/ProbeNumber/ProbeBool/ProbeRow/ProbeList`);
|
|
23
|
-
* - `list` — a wire array (methods `Len/ElemString/ElemNumber/ElemBool/ElemRow/ElemList`).
|
|
24
|
-
* Omitted → the IN-PACKAGE convention names `WireValue`/`WireRow`/`WireList` (the goldens + test companion
|
|
25
|
-
* provide concrete scripted implementations). `import` is the package the consumer's wire types live in
|
|
26
|
-
* (added to the covered module imports + used to qualify the names); omit for in-package types.
|
|
27
|
-
*/
|
|
28
|
-
export interface GoWireOptions {
|
|
29
|
-
value: string;
|
|
30
|
-
row: string;
|
|
31
|
-
list: string;
|
|
32
|
-
import?: string;
|
|
33
|
-
}
|
|
34
16
|
/**
|
|
35
17
|
* LeafTransportOptions (native codegen) — the op-agnostic leaf TRANSPORT the covered runner calls DIRECTLY
|
|
36
18
|
* at each covered node's execution point. bc no longer generates a per-node handler trait (the spurious
|
|
@@ -87,10 +69,12 @@ export interface EmitContext {
|
|
|
87
69
|
*/
|
|
88
70
|
ioModel: IoModel;
|
|
89
71
|
/**
|
|
90
|
-
* go-typed-native
|
|
91
|
-
*
|
|
72
|
+
* go-typed-native: BC が生成する共有ワイヤ型パッケージ(Task A cross-package)の import 指定子。設定時は
|
|
73
|
+
* BC 所有の `WireValue`/`WireRow`/`WireList` をその共有パッケージへ出し、covered/transport 双方がそれを
|
|
74
|
+
* import して参照する(別パッケージの transport が cycle 無しで返せる)。未指定なら in-package(covered
|
|
75
|
+
* モジュールが型を定義し無修飾で参照)。他言語 emitter(ts/py/php/rust)は無視。
|
|
92
76
|
*/
|
|
93
|
-
|
|
77
|
+
sharedTypesImport?: string;
|
|
94
78
|
/**
|
|
95
79
|
* native codegen の op-agnostic leaf transport シンボル表({@link LeafTransportOptions})。covered runner
|
|
96
80
|
* が各 covered node の実行点で直呼びする。未指定なら in-package 既定名(rust `leaf_<comp>` / go
|
|
@@ -154,10 +138,11 @@ export interface GenerateOptions {
|
|
|
154
138
|
*/
|
|
155
139
|
ioModel?: IoModel;
|
|
156
140
|
/**
|
|
157
|
-
* go-typed-native
|
|
158
|
-
*
|
|
141
|
+
* go-typed-native: BC が生成する共有ワイヤ型パッケージ(Task A cross-package)の import 指定子。設定時は
|
|
142
|
+
* BC 所有の `WireValue`/`WireRow`/`WireList` を共有パッケージへ出し covered/transport 双方が参照する。
|
|
143
|
+
* 未指定なら in-package。他言語 emitter は無視(no-op)。
|
|
159
144
|
*/
|
|
160
|
-
|
|
145
|
+
sharedTypesImport?: string;
|
|
161
146
|
/**
|
|
162
147
|
* native codegen の op-agnostic leaf transport シンボル表({@link LeafTransportOptions})。未指定なら
|
|
163
148
|
* in-package 既定名(rust `leaf_<comp>` / go `Leaf_<comp>`)。native emitter(rust/go)のみ消費。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/generator/core.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG;IAAE,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/generator/core.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG;IAAE,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAGzF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC,MAAM,EAA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AAC;IACtB,+BAA+B;IAC/B,IAAI,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC;CAChC;AAID;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAE3D;AAED,uCAAuC;AACvC,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AA8CD,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,YAAY,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,uCAAuC;IACvC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe,CAuCrF"}
|
package/dist/generator/core.js
CHANGED
|
@@ -120,7 +120,7 @@ export function generateModule(ir, options) {
|
|
|
120
120
|
componentNames,
|
|
121
121
|
runtimeImport: options.runtimeImport ?? plugin.defaultRuntimeImport,
|
|
122
122
|
ioModel: options.ioModel ?? "sync",
|
|
123
|
-
|
|
123
|
+
sharedTypesImport: options.sharedTypesImport,
|
|
124
124
|
leafTransport: options.leafTransport,
|
|
125
125
|
};
|
|
126
126
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/generator/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/generator/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAkD/D,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,IAAI,CAAuB;IAC3B,YAAY,IAA0B,EAAE,OAAe;QACrD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,SAAS,KAAK,CAAC,IAA0B,EAAE,OAAe;IACxD,MAAM,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AA4ED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;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CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG,SAAS,CA2ClI"}
|
|
@@ -38,6 +38,8 @@ export function notationOfRef(ref, plan) {
|
|
|
38
38
|
switch (ref.kind) {
|
|
39
39
|
case "scalar":
|
|
40
40
|
return ref.scalar;
|
|
41
|
+
case "value":
|
|
42
|
+
return "value"; // bc#156: 不透明値(入力専用宣言型。buildDeBoxPlan の default で fail-closed — 出力に現れない)
|
|
41
43
|
case "opt":
|
|
42
44
|
return `opt(${notationOfRef(ref.inner, plan)})`;
|
|
43
45
|
case "arr":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-shared-debox.js","sourceRoot":"","sources":["../../src/generator/emit-shared-debox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAA+B,MAAM,YAAY,CAAC;AA0CnE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY,EAAE,IAAc;IACxD,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC,MAAM,CAAC;QACpB,KAAK,KAAK;YACR,OAAO,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;QAClD,KAAK,KAAK;YACR,OAAO,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;QACjD,KAAK,KAAK;YACR,OAAO,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;QAClD,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;YACtC,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO,GAAG,CA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AAC,CAAC;YACX,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3G,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC;QACxC,CAAC;QACD;YACE,gGAAgG;YAChG,qEAAqE;YACrE,gBAAgB,CAAC,qCAAsC,IAAgB,CAAC,IAAI,GAAG,CAAC,CAAC;IACrF,CAAC;AACH,CAAC"}
|
|
@@ -35,6 +35,7 @@ import { setGoForceRunPlanHelpers } from "./emit-shared-go.js";
|
|
|
35
35
|
import type { Component } from "../behavior.js";
|
|
36
36
|
/** 可搬スカラ → Go の具体型名(de-box 後の struct field 型)。int/float は int64/float64 で区別。 */
|
|
37
37
|
declare function goScalar(scalar: "string" | "int" | "float" | "bool" | "null"): string;
|
|
38
|
+
export declare function setGoWireValueName(name: string): void;
|
|
38
39
|
/** TypeRef を Go の具体型名へ(named→struct 名、arr→slice、opt→ポインタ、scalar→具体型)。 */
|
|
39
40
|
declare function renderTypeRef(ref: TypeRef): string;
|
|
40
41
|
/** 型プランの named obj を Go struct 宣言へ(decls 順=決定的)。field は宣言順・export 名。gofmt と同じ
|
|
@@ -127,6 +128,7 @@ export declare const goTypedInternals: {
|
|
|
127
128
|
sanitize: typeof sanitize;
|
|
128
129
|
goFieldName: typeof goFieldName;
|
|
129
130
|
renderTypeRef: typeof renderTypeRef;
|
|
131
|
+
setGoWireValueName: typeof setGoWireValueName;
|
|
130
132
|
goScalar: typeof goScalar;
|
|
131
133
|
typedLocal: typeof typedLocal;
|
|
132
134
|
isTypedComponent: typeof isTypedComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-shared-go-typed.d.ts","sourceRoot":"","sources":["../../src/generator/emit-shared-go-typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,OAAO,EAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EAA2B,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,gBAAgB,CAAC;AAO9D,gFAAgF;AAChF,iBAAS,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAc9E;AAED,yEAAyE;AACzE,iBAAS,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"emit-shared-go-typed.d.ts","sourceRoot":"","sources":["../../src/generator/emit-shared-go-typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,OAAO,EAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EAA2B,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,gBAAgB,CAAC;AAO9D,gFAAgF;AAChF,iBAAS,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAc9E;AASD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,yEAAyE;AACzE,iBAAS,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAoB3C;AAED;8DAC8D;AAC9D,iBAAS,aAAa,CAAC,IAAI,EAAE,QAAQ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AAC,EAChC,IAAI,EAAE,QAAQ,EACd,QAAQ,SAAK,EACb,SAAS,SAAK,GACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,CAkE5C;AAoCD;;;GAGG;AACH,iBAAS,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAOhF;AAED,uCAAuC;AACvC,iBAAS,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAkB1C;AAID,iBAAS,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAMvD;AAED,6CAA6C;AAC7C,iBAAS,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAGlD;AAED,qFAAqF;AACrF,iBAAS,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAgD/C;AAED;;;;GAIG;AACH,iBAAS,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAqEvE;AAqBD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;uCAsBQ,SAAS;;;;;CAM7C,CAAC"}
|
|
@@ -21,11 +21,25 @@ function goScalar(scalar) {
|
|
|
21
21
|
return `${PKG}.Value`;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* bc#156: `value` TypeRef が綴じる BC 所有 WireValue 型名。既定は in-package の無修飾 `WireValue`。
|
|
26
|
+
* go cross-package(sharedTypesImport)では wire 型が共有パッケージへ移るため native emitter が
|
|
27
|
+
* `<pkg>.WireValue` を設定する(resolveGoWire(ctx).value と同一 SSoT — emitter が emit() 冒頭で設定)。
|
|
28
|
+
* transport 戻り値の wire 型名を解決するのと同じ機構で port の wire 型名も解決する(1 wire type 双方向)。
|
|
29
|
+
*/
|
|
30
|
+
let goWireValueName = "WireValue";
|
|
31
|
+
export function setGoWireValueName(name) {
|
|
32
|
+
goWireValueName = name;
|
|
33
|
+
}
|
|
24
34
|
/** TypeRef を Go の具体型名へ(named→struct 名、arr→slice、opt→ポインタ、scalar→具体型)。 */
|
|
25
35
|
function renderTypeRef(ref) {
|
|
26
36
|
switch (ref.kind) {
|
|
27
37
|
case "scalar":
|
|
28
38
|
return goScalar(ref.scalar);
|
|
39
|
+
case "value":
|
|
40
|
+
// bc#156: 汎用不透明値は #154 の BC 所有 WireValue(新しい型は作らない)。cross-package では
|
|
41
|
+
// 共有パッケージ修飾名(native emitter が setGoWireValueName で設定)。
|
|
42
|
+
return goWireValueName;
|
|
29
43
|
case "opt":
|
|
30
44
|
// nullable は Go ポインタで表す(nil = null)。scalar/struct いずれも `*T`。
|
|
31
45
|
return `*${renderTypeRef(ref.inner)}`;
|
|
@@ -107,6 +121,11 @@ function emitOneMarshaller(d, plan) {
|
|
|
107
121
|
function emitFieldMaterialize(target, src, ref, plan, indent) {
|
|
108
122
|
const t = "\t".repeat(indent);
|
|
109
123
|
switch (ref.kind) {
|
|
124
|
+
case "value":
|
|
125
|
+
// bc#156: `value` は入力専用の宣言型で出力 de-box には現れない。入力 port の decode(test glue の
|
|
126
|
+
// emitInDecoder)が BC 所有 WireValue コンストラクタ valueToWire を直接使う別経路で扱う。ここへ到達=
|
|
127
|
+
// 出力位置に value を置いた誤 IR = fail-closed(silent 再box を作らない)。
|
|
128
|
+
throw new Error(`typed go: 'value' has no output materialization (input-only declared type at ${src})`);
|
|
110
129
|
case "scalar": {
|
|
111
130
|
if (ref.scalar === "null") {
|
|
112
131
|
return `${t}${target} = ${src}`;
|
|
@@ -215,6 +234,9 @@ function emitFieldMaterialize(target, src, ref, plan, indent) {
|
|
|
215
234
|
*/
|
|
216
235
|
function materializeExpr(rawExpr, ref, _plan) {
|
|
217
236
|
switch (ref.kind) {
|
|
237
|
+
case "value":
|
|
238
|
+
// bc#156: input-only 宣言型。入力 decode は valueToWire を使う別経路(emitInDecoder)で扱う。
|
|
239
|
+
throw new Error(`typed go: 'value' has no output materialization (input-only declared type at ${rawExpr})`);
|
|
218
240
|
case "named":
|
|
219
241
|
return `mustMarshal_${ref.name}(${rawExpr})`;
|
|
220
242
|
case "scalar":
|
|
@@ -254,6 +276,9 @@ function typedFieldAccess(baseExpr, baseRef, fields, plan) {
|
|
|
254
276
|
*/
|
|
255
277
|
function serializeTyped(typedExpr, ref, _plan) {
|
|
256
278
|
switch (ref.kind) {
|
|
279
|
+
case "value":
|
|
280
|
+
// bc#156: input-only 宣言型 — 出力(canonical serialize)位置には現れない。fail-closed。
|
|
281
|
+
throw new Error(`typed go: 'value' has no serialization (input-only declared type at ${typedExpr})`);
|
|
257
282
|
case "named":
|
|
258
283
|
return `ser_${ref.name}(${typedExpr})`;
|
|
259
284
|
case "scalar":
|
|
@@ -506,6 +531,8 @@ function arrHelperKey(ref) {
|
|
|
506
531
|
switch (r.kind) {
|
|
507
532
|
case "scalar":
|
|
508
533
|
return r.scalar;
|
|
534
|
+
case "value":
|
|
535
|
+
return "value"; // bc#156: 決定的キー(node helper には現れないが total 化のため)
|
|
509
536
|
case "named":
|
|
510
537
|
return r.name;
|
|
511
538
|
case "arr":
|
|
@@ -673,6 +700,9 @@ function emitArrOptNodeHelpers(ctx, plan) {
|
|
|
673
700
|
/** arr/opt 要素の materialize 式(named→mustMarshal, scalar→mustScalar, arr/opt→ネスト helper)。 */
|
|
674
701
|
function elemMaterializeExpr(ref, varName = "e") {
|
|
675
702
|
switch (ref.kind) {
|
|
703
|
+
case "value":
|
|
704
|
+
// bc#156: input-only 宣言型 — 出力 node helper(mustArr 等)には現れない。fail-closed。
|
|
705
|
+
throw new Error(`typed go: 'value' has no element materialization (input-only declared type at ${varName})`);
|
|
676
706
|
case "named":
|
|
677
707
|
return `mustMarshal_${ref.name}(${varName})`;
|
|
678
708
|
case "scalar":
|
|
@@ -696,6 +726,7 @@ export const goTypedInternals = {
|
|
|
696
726
|
sanitize,
|
|
697
727
|
goFieldName,
|
|
698
728
|
renderTypeRef,
|
|
729
|
+
setGoWireValueName,
|
|
699
730
|
goScalar,
|
|
700
731
|
typedLocal,
|
|
701
732
|
isTypedComponent,
|