behavior-contracts 0.11.3 → 0.11.5
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/dist/authoring.d.ts +9 -3
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +5 -1
- package/dist/authoring.js.map +1 -1
- package/dist/behavior.d.ts +26 -0
- package/dist/behavior.d.ts.map +1 -1
- package/dist/behavior.js +14 -0
- package/dist/behavior.js.map +1 -1
- package/dist/cli.js +11 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/codegen.d.ts +11 -2
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +11 -14
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/ts-compile.d.ts +1 -7
- package/dist/commands/ts-compile.d.ts.map +1 -1
- package/dist/commands/ts-compile.js +31 -6
- package/dist/commands/ts-compile.js.map +1 -1
- package/dist/commands/ts-extract.d.ts +7 -2
- package/dist/commands/ts-extract.d.ts.map +1 -1
- package/dist/commands/ts-extract.js +12 -7
- package/dist/commands/ts-extract.js.map +1 -1
- package/dist/generator/core.d.ts +45 -7
- package/dist/generator/core.d.ts.map +1 -1
- package/dist/generator/core.js +69 -2
- package/dist/generator/core.js.map +1 -1
- package/dist/generator/emit-php.d.ts.map +1 -1
- package/dist/generator/emit-php.js +4 -3
- package/dist/generator/emit-php.js.map +1 -1
- package/dist/generator/emit-python.d.ts.map +1 -1
- package/dist/generator/emit-python.js +4 -3
- package/dist/generator/emit-python.js.map +1 -1
- package/dist/generator/emit-typed-native-go.d.ts +2 -2
- package/dist/generator/emit-typed-native-go.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-go.js +9 -9
- package/dist/generator/emit-typed-native-go.js.map +1 -1
- package/dist/generator/emit-typed-native-rust.d.ts +2 -2
- package/dist/generator/emit-typed-native-rust.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-rust.js +9 -9
- package/dist/generator/emit-typed-native-rust.js.map +1 -1
- package/dist/generator/index.d.ts +2 -2
- 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/lowering.d.ts +1 -1
- package/dist/lowering.d.ts.map +1 -1
- package/dist/lowering.js +1 -0
- package/dist/lowering.js.map +1 -1
- package/dist/provenance.d.ts +28 -17
- package/dist/provenance.d.ts.map +1 -1
- package/dist/provenance.js +33 -26
- package/dist/provenance.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/generator/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/generator/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAoD/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,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AC/D,CAAC;IACF,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QACtB,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,sBAAsB,MAAM,CAAC,aAAa,EAAE;KAClF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-php.d.ts","sourceRoot":"","sources":["../../src/generator/emit-php.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"emit-php.d.ts","sourceRoot":"","sources":["../../src/generator/emit-php.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAuC,aAAa,EAAE,MAAM,WAAW,CAAC;AA2GpF,eAAO,MAAM,UAAU,EAAE,aAMxB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { entryPortOrder } from "./core.js";
|
|
1
2
|
import { emitDocLiteral } from "./literal.js";
|
|
2
3
|
/** PHP 単一引用符リテラル(識別子・fingerprint 用 — ASCII 前提)。 */
|
|
3
4
|
function phpSq(s) {
|
|
@@ -16,10 +17,10 @@ function phpVarName(port) {
|
|
|
16
17
|
* Guarded by `class_exists` so a re-require of the same file is idempotent (the module otherwise defines
|
|
17
18
|
* NO top-level symbols by design). `bind` is unchanged. The method name = the authored method (php camelCase).
|
|
18
19
|
*/
|
|
19
|
-
function emitNamespaceClass(namespace, components, runtimeImport) {
|
|
20
|
+
function emitNamespaceClass(namespace, components, runtimeImport, declared) {
|
|
20
21
|
const cls = namespace.replace(/[^A-Za-z0-9_]/g, "");
|
|
21
22
|
const methods = components.map((c) => {
|
|
22
|
-
const ports =
|
|
23
|
+
const ports = entryPortOrder(c, declared);
|
|
23
24
|
const params = ports.map(phpVarName);
|
|
24
25
|
const arr = `[${ports.map((p, i) => `${phpSq(p)} => $${params[i]}`).join(", ")}]`;
|
|
25
26
|
const method = c.name.replace(/[^A-Za-z0-9_]/g, "_");
|
|
@@ -79,7 +80,7 @@ try {
|
|
|
79
80
|
} catch (\\${runtimeImport}\\ProvenanceError $e) {
|
|
80
81
|
throw new \\RuntimeException("behavior-contracts generated module: IR fingerprint mismatch (baked={$irFingerprint}) — the generated code was modified or corrupted (fail-closed)", 0, $e);
|
|
81
82
|
}
|
|
82
|
-
${ctx.namespace !== undefined ? emitNamespaceClass(ctx.namespace, ctx.ir.components, runtimeImport) : ""}
|
|
83
|
+
${ctx.namespace !== undefined ? emitNamespaceClass(ctx.namespace, ctx.ir.components, runtimeImport, ctx.declaredEntryPortOrder) : ""}
|
|
83
84
|
// bind — inject handlers (boundary injection; catalog name → implementation) and
|
|
84
85
|
// get one executor closure per component. Each call delegates to the runtime
|
|
85
86
|
// core's Behavior::runBehavior over the embedded IR (dynamic-path equivalent — §7.3).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-php.js","sourceRoot":"","sources":["../../src/generator/emit-php.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,mDAAmD;AACnD,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;AAC9D,CAAC;AAED,iEAAiE;AACjE,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,kBAAkB,CAAC,SAAiB,EAAE,UAAgC,EAAE,aAAqB;
|
|
1
|
+
{"version":3,"file":"emit-php.js","sourceRoot":"","sources":["../../src/generator/emit-php.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE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AAE,SAAS,EAAE,kDAAkD;IAC7E,aAAa,EAAE,MAAM;IACrB,oBAAoB,EAAE,mBAAmB;IACzC,IAAI;CACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-python.d.ts","sourceRoot":"","sources":["../../src/generator/emit-python.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"emit-python.d.ts","sourceRoot":"","sources":["../../src/generator/emit-python.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAuC,aAAa,EAAE,MAAM,WAAW,CAAC;AAmHpF,eAAO,MAAM,aAAa,EAAE,aAM3B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { entryPortOrder } from "./core.js";
|
|
1
2
|
import { emitDocLiteral } from "./literal.js";
|
|
2
3
|
/** Python 文字列リテラル(JSON エスケープは Python でも合法)。 */
|
|
3
4
|
function pyStr(s) {
|
|
@@ -25,10 +26,10 @@ function pyMethodName(name) {
|
|
|
25
26
|
* (the same dynamic path `bind` uses) — the class = the declaring class (namespace), the params = the
|
|
26
27
|
* authored args, the name = the method (nominal name is cosmetic in dynamic Python). `bind` is unchanged.
|
|
27
28
|
*/
|
|
28
|
-
function emitNamespaceClass(namespace, components) {
|
|
29
|
+
function emitNamespaceClass(namespace, components, declared) {
|
|
29
30
|
const cls = namespace.replace(/[^A-Za-z0-9_]/g, "");
|
|
30
31
|
const methods = components.map((c) => {
|
|
31
|
-
const ports =
|
|
32
|
+
const ports = entryPortOrder(c, declared);
|
|
32
33
|
const params = ports.map(pyParamName);
|
|
33
34
|
const dict = `{${ports.map((p, i) => `${pyStr(p)}: ${params[i]}`).join(", ")}}`;
|
|
34
35
|
const sig = [...params, "handlers"].join(", ");
|
|
@@ -102,7 +103,7 @@ def bind(handlers):
|
|
|
102
103
|
return _call
|
|
103
104
|
|
|
104
105
|
return {name: _make(name) for name in COMPONENT_NAMES}
|
|
105
|
-
${ctx.namespace !== undefined ? emitNamespaceClass(ctx.namespace, ctx.ir.components) : ""}`;
|
|
106
|
+
${ctx.namespace !== undefined ? emitNamespaceClass(ctx.namespace, ctx.ir.components, ctx.declaredEntryPortOrder) : ""}`;
|
|
106
107
|
}
|
|
107
108
|
export const pythonEmitter = {
|
|
108
109
|
language: "python",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-python.js","sourceRoot":"","sources":["../../src/generator/emit-python.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,+CAA+C;AAC/C,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,GAAG,CAAC;IAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK;IACrG,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI;IAC/F,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO;IAC7F,UAAU,EAAE,OAAO;CACpB,CAAC,CAAC;AAEH,uFAAuF;AACvF,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC5E,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,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,EAAE,QAAQ;IAClB,cAAc,EAAE,SAAS,EAAE,mDAAmD;IAC9E,aAAa,EAAE,KAAK;IACpB,oBAAoB,EAAE,oBAAoB;IAC1C,IAAI;CACL,CAAC"}
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* relation READS #323 needs are the componentRef + relationKind:single shape, which this covers).
|
|
44
44
|
* A component with a map/cond node is not native-eligible and falls through to the generic body.
|
|
45
45
|
*/
|
|
46
|
-
import type { EmitterPlugin, LeafTransportOptions } from "./core.js";
|
|
46
|
+
import type { DeclaredEntryPortOrder, EmitterPlugin, LeafTransportOptions } from "./core.js";
|
|
47
47
|
/** goSharedTypesPackageName — the SSoT for deriving the shared wire types package's Go identifier from a
|
|
48
48
|
* `--shared-types-import` path: the last path segment, sanitized to a legal Go identifier. Used by BOTH
|
|
49
49
|
* resolveGoWire (to selector-qualify the hoisted wire types in the covered module) and the CLI's
|
|
@@ -68,7 +68,7 @@ export declare function goSharedWireTypesPackage(pkgName: string): string;
|
|
|
68
68
|
* whole-file zero (the ser_* NewObj is test glue, never on the consumer's read hot path). Emitted only for
|
|
69
69
|
* the fully-covered case (the equivalence harness); production consumers never use it.
|
|
70
70
|
*/
|
|
71
|
-
export declare function goTypedNativeObserve(ir: unknown, runtimeImport?: string, leaf?: LeafTransportOptions, namespace?: string): string;
|
|
71
|
+
export declare function goTypedNativeObserve(ir: unknown, runtimeImport?: string, leaf?: LeafTransportOptions, namespace?: string, declared?: DeclaredEntryPortOrder): string;
|
|
72
72
|
/**
|
|
73
73
|
* goTypedNativeEmitter — language id `go-typed-native` (bc#77). Emits the generic straight-line
|
|
74
74
|
* body (for non-covered components / helpers) plus the COMBINED READ layer (native ports struct
|
|
@@ -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;
|
|
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,sBAAsB,EAAe,aAAa,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAiC1G;;;;+GAI+G;AAC/G,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAE1E;AAo/FD;;;;;;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,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,sBAAsB,GAAG,MAAM,CA2TpK;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAOlC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeneratorFailure } from "./core.js";
|
|
1
|
+
import { entryPortOrder, GeneratorFailure } from "./core.js";
|
|
2
2
|
import { isControlGate, mapNodeElemIsOpaqueWire, nodeWirePassthrough } from "../behavior.js";
|
|
3
3
|
import { goStraightlineInternals } from "./emit-shared-go.js";
|
|
4
4
|
import { goTypedInternals } from "./emit-shared-go-typed.js";
|
|
@@ -1347,8 +1347,8 @@ function inputScalarKind(schema) {
|
|
|
1347
1347
|
* observe passes these decoded args positionally. A missing key leaves the zero value (every covered input
|
|
1348
1348
|
* is required + always supplied by the corpus); a present-but-wrong-scalar is a fail-closed decode error.
|
|
1349
1349
|
*/
|
|
1350
|
-
function emitInDecoder(comp, plan) {
|
|
1351
|
-
const ports =
|
|
1350
|
+
function emitInDecoder(comp, plan, declared) {
|
|
1351
|
+
const ports = entryPortOrder(comp, declared);
|
|
1352
1352
|
if (ports.length === 0 || comp.inputPorts === undefined)
|
|
1353
1353
|
return ""; // no input → observe calls the entry with no args.
|
|
1354
1354
|
// #192: decode the generic *Obj test input into the entry's POSITIONAL args (named returns = the params,
|
|
@@ -1642,7 +1642,7 @@ function emitParallelStageArm(comp, stage, atPos, concurrency, metas, typedNodes
|
|
|
1642
1642
|
* consumer (graphddb) drives it and keeps the struct native. A Value observation is produced ONLY
|
|
1643
1643
|
* by the separate serialize wrapper (run_native_raw_<comp>, below), the single outer Value boundary.
|
|
1644
1644
|
*/
|
|
1645
|
-
function emitNativeRawRunner(comp, plan, flags, wire, leaf) {
|
|
1645
|
+
function emitNativeRawRunner(comp, plan, flags, wire, leaf, declared) {
|
|
1646
1646
|
const ep = execPlan(comp);
|
|
1647
1647
|
const order = ep.order;
|
|
1648
1648
|
const cplan = buildComponentPlan(comp, goStraightlineInternals.dialect, "scope");
|
|
@@ -1683,7 +1683,7 @@ function emitNativeRawRunner(comp, plan, flags, wire, leaf) {
|
|
|
1683
1683
|
// output recursion) into the node's outType struct.
|
|
1684
1684
|
// #192: 1:1 map of the authored signature — positional params (one per input port, box removed), not
|
|
1685
1685
|
// an `In_<comp>` struct. Go allows unused function params, so no `_ = param` guard is needed.
|
|
1686
|
-
const entryParams =
|
|
1686
|
+
const entryParams = entryPortOrder(comp, declared)
|
|
1687
1687
|
.map((p) => `${goParamName(p)} ${inputPortGoType(comp.inputPorts[p], plan, `input port '${p}' of component '${comp.name}'`)}`)
|
|
1688
1688
|
.join(", ");
|
|
1689
1689
|
lines.push(`func ${runnerName(comp.name)}(${entryParams}) (${outStructType}, error) {`);
|
|
@@ -2815,7 +2815,7 @@ function emit(ctx) {
|
|
|
2815
2815
|
const mm = emitMapElemMaterializers(c, typedNodes, plan);
|
|
2816
2816
|
if (mm)
|
|
2817
2817
|
elemCopiers.push(mm);
|
|
2818
|
-
const r = emitNativeRawRunner(c, plan, flags, wire, leaf);
|
|
2818
|
+
const r = emitNativeRawRunner(c, plan, flags, wire, leaf, ctx.declaredEntryPortOrder);
|
|
2819
2819
|
runnerCodes.push(r.code);
|
|
2820
2820
|
}
|
|
2821
2821
|
const structSurface = emitStructSurface(native);
|
|
@@ -2928,7 +2928,7 @@ ${emitGoWireTypes()}
|
|
|
2928
2928
|
* whole-file zero (the ser_* NewObj is test glue, never on the consumer's read hot path). Emitted only for
|
|
2929
2929
|
* the fully-covered case (the equivalence harness); production consumers never use it.
|
|
2930
2930
|
*/
|
|
2931
|
-
export function goTypedNativeObserve(ir, runtimeImport, leaf, namespace) {
|
|
2931
|
+
export function goTypedNativeObserve(ir, runtimeImport, leaf, namespace, declared) {
|
|
2932
2932
|
const components = ir.components;
|
|
2933
2933
|
const native = components.filter(isNativeRaw);
|
|
2934
2934
|
const plan = buildTypePlan(ir);
|
|
@@ -2945,7 +2945,7 @@ export function goTypedNativeObserve(ir, runtimeImport, leaf, namespace) {
|
|
|
2945
2945
|
// #192: decode the generic *Obj test input into the entry's POSITIONAL args (test glue — ONE decode at
|
|
2946
2946
|
// the top; a REQUIRED declared input absent is a fail-closed decode error here, never on the entry path),
|
|
2947
2947
|
// then call the 1:1 entry positionally. A no-input entry is called with no args (no decoder).
|
|
2948
|
-
const args =
|
|
2948
|
+
const args = entryPortOrder(c, declared).map((p) => goParamName(p));
|
|
2949
2949
|
const decode = args.length === 0
|
|
2950
2950
|
? ""
|
|
2951
2951
|
: `\t\t${args.join(", ")}, ierr := decode_${sanitize(c.name)}(input)\n\t\tif ierr != nil {\n\t\t\treturn nil, ierr\n\t\t}\n`;
|
|
@@ -2955,7 +2955,7 @@ export function goTypedNativeObserve(ir, runtimeImport, leaf, namespace) {
|
|
|
2955
2955
|
.join("\n");
|
|
2956
2956
|
// input decoders (TEST glue): generic *Obj -> concrete In_<comp>. Scalar fields read the typed value
|
|
2957
2957
|
// (a `.(T)` here is on the SDK/wire Value in the OBSERVE companion, never in the covered module).
|
|
2958
|
-
const inDecoders = native.map((c) => emitInDecoder(c, plan)).join("\n\n");
|
|
2958
|
+
const inDecoders = native.map((c) => emitInDecoder(c, plan, declared)).join("\n\n");
|
|
2959
2959
|
// every covered node returns a WireValue the inline de-box classifies — so the scripted wire adapter is
|
|
2960
2960
|
// needed whenever any component has a handler node.
|
|
2961
2961
|
const anyDeBox = native.some((c) => c.body.some((n) => !("cond" in n)));
|