behavior-contracts 0.10.1 → 0.11.1
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 +246 -350
- package/cli-contract.yaml +49 -51
- package/dist/authoring.d.ts +80 -420
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +53 -1157
- package/dist/authoring.js.map +1 -1
- package/dist/behavior.d.ts +31 -15
- package/dist/behavior.d.ts.map +1 -1
- package/dist/behavior.js +55 -0
- package/dist/behavior.js.map +1 -1
- package/dist/builder.d.ts +4 -4
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +18 -16
- package/dist/builder.js.map +1 -1
- package/dist/cli.js +5 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +12 -56
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/ts-compile.d.ts +23 -0
- package/dist/commands/ts-compile.d.ts.map +1 -0
- package/dist/commands/ts-compile.js +693 -0
- package/dist/commands/ts-compile.js.map +1 -0
- package/dist/commands/ts-extract.d.ts +55 -7
- package/dist/commands/ts-extract.d.ts.map +1 -1
- package/dist/commands/ts-extract.js +177 -64
- package/dist/commands/ts-extract.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.js +4 -4
- package/dist/generated/program.js.map +1 -1
- package/dist/generator/core.d.ts +11 -1
- package/dist/generator/core.d.ts.map +1 -1
- package/dist/generator/core.js +5 -4
- package/dist/generator/core.js.map +1 -1
- package/dist/generator/emit-php.d.ts +0 -17
- package/dist/generator/emit-php.d.ts.map +1 -1
- package/dist/generator/emit-php.js +25 -1
- package/dist/generator/emit-php.js.map +1 -1
- package/dist/generator/emit-python.d.ts +0 -7
- package/dist/generator/emit-python.d.ts.map +1 -1
- package/dist/generator/emit-python.js +34 -1
- package/dist/generator/emit-python.js.map +1 -1
- package/dist/generator/emit-straightline-typed-typescript.js +1 -1
- package/dist/generator/emit-straightline-typed-typescript.js.map +1 -1
- package/dist/generator/emit-typed-native-go.d.ts +1 -1
- package/dist/generator/emit-typed-native-go.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-go.js +122 -112
- package/dist/generator/emit-typed-native-go.js.map +1 -1
- package/dist/generator/emit-typed-native-rust.d.ts +3 -2
- package/dist/generator/emit-typed-native-rust.d.ts.map +1 -1
- package/dist/generator/emit-typed-native-rust.js +61 -125
- package/dist/generator/emit-typed-native-rust.js.map +1 -1
- package/dist/generator/emit-typescript-native.js +1 -1
- package/dist/generator/emit-typescript-native.js.map +1 -1
- package/dist/generator/emit-typescript.js +1 -1
- package/dist/generator/emit-typescript.js.map +1 -1
- package/dist/generator/typed.d.ts +5 -1
- package/dist/generator/typed.d.ts.map +1 -1
- package/dist/generator/typed.js +40 -9
- package/dist/generator/typed.js.map +1 -1
- package/dist/guard.d.ts +11 -0
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +35 -8
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +20 -57
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -101
- package/dist/index.js.map +1 -1
- package/dist/lowering.d.ts +251 -0
- package/dist/lowering.d.ts.map +1 -0
- package/dist/lowering.js +682 -0
- package/dist/lowering.js.map +1 -0
- package/dist/provenance.js +4 -4
- package/dist/provenance.js.map +1 -1
- package/dist/runtime.d.ts +52 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +77 -0
- package/dist/runtime.js.map +1 -0
- package/dist/spec-versions.d.ts +25 -0
- package/dist/spec-versions.d.ts.map +1 -0
- package/dist/spec-versions.js +26 -0
- package/dist/spec-versions.js.map +1 -0
- package/dist/type-gate.d.ts +12 -0
- package/dist/type-gate.d.ts.map +1 -1
- package/dist/type-gate.js +79 -3
- package/dist/type-gate.js.map +1 -1
- package/package.json +5 -1
- package/dist/bind.d.ts +0 -88
- package/dist/bind.d.ts.map +0 -1
- package/dist/bind.js +0 -155
- package/dist/bind.js.map +0 -1
- package/dist/lower.d.ts +0 -35
- package/dist/lower.d.ts.map +0 -1
- package/dist/lower.js +0 -118
- package/dist/lower.js.map +0 -1
package/dist/authoring.d.ts
CHANGED
|
@@ -1,460 +1,120 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* authoring.ts —
|
|
3
|
-
*
|
|
4
|
-
* SCP の原則 C2「difference is catalog only」を authoring 層で成立させる COMMON 実装。
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - **
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - **
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* は評価の**前に**メソッド / ヘルパ / クラスのソースを走査し、これらのトークンを一律
|
|
37
|
-
* fail-closed で拒否する({@link scanNativeControlSyntax}。文字列リテラル・テンプレート
|
|
38
|
-
* リテラルのテキスト部・コメント・正規表現リテラルは除外し、`${...}` 内コードは走査する)。
|
|
39
|
-
*
|
|
40
|
-
* **残余リスク(source scan の外 — ここに限り誤った DAG が黙って出得る。正直な限界)**:
|
|
41
|
-
* - クラス外で定義された関数(モジュールレベル / import されたヘルパ / `eval` /
|
|
42
|
-
* `new Function`)を record 中に呼び、その内部でネイティブ制御構文を recorder に
|
|
43
|
-
* 適用した場合。scan はクラス(と親クラス連鎖)のソースしか見ない。
|
|
44
|
-
* - `for` / `while` のループ条件に recorder を書いた場合(ToBoolean(Proxy)=true のため
|
|
45
|
-
* ビルドがハング / 空振りする — silent な誤 DAG ではないが loud なエラーでもない)。
|
|
46
|
-
* - recorder に触れない任意 JS(閉包変数への分岐等)が record 結果を変える場合
|
|
47
|
-
* (concept.md §5.1 で禁止だが機械検出されない)。
|
|
48
|
-
* - behavior クラスを ES5 等へ downlevel するトランスパイラ(ヘルパ由来の `?:` 等が
|
|
49
|
-
* 注入され偽陽性になる)。behavior クラスのソースは modern ES のまま実行すること。
|
|
50
|
-
* 「誤った DAG が黙って出ることはない」はこの残余を除いた範囲でのみ成立する。
|
|
51
|
-
*
|
|
52
|
-
* JS の評価では recorder 値上のネイティブ `?:` / `&&` / `??` / `===` / `+` は観測できない
|
|
53
|
-
* (ToBoolean にトラップが無い等)ため、**式・構造化制御は既存 IR 語彙と 1:1 の関数表面**で
|
|
54
|
-
* 書く(新しい意味論は導入しない — 各関数は expression-ir.md §3 の operator /
|
|
55
|
-
* scp-ir-architecture.md §5 のノード種に 1:1 で lower される):
|
|
56
|
-
*
|
|
57
|
-
* - Expression: `concat` / `add` … / `eq` … / `and` / `or` / `not` / `coalesce`(`??`)/
|
|
58
|
-
* `len` / `opt`(`?.` = refOpt)。オブジェクト・配列・スカラのリテラルはそのまま書ける
|
|
59
|
-
* (`{obj:...}` / `{arr:[...]}` へ自動 lower)。
|
|
60
|
-
* - Conditional / Guard: {@link when}。分岐が**純式のみ**なら Expression IR の `cond` へ、
|
|
61
|
-
* 分岐に **Component 宣言を含む**なら gate(CondNode)+ null-binding skip / Φ ノードへ
|
|
62
|
-
* lower する(semantic-contract-programming.md「構造化制御構文」の Compiler 規則そのもの)。
|
|
63
|
-
* - Map: ノード結果 recorder の **ネイティブ `.map(callback)`**(v2 語彙 `when`(要素 guard,
|
|
64
|
-
* callback 内の {@link when})/ `into` / `batched`(第2引数 opts)に対応)。
|
|
65
|
-
*
|
|
66
|
-
* lowering 先は **既存の component-graph IR そのもの**(behavior.ts / scp-ir-architecture.md §5。
|
|
67
|
-
* IR スキーマは変えない)。生成 IR は `assertPortableComponentGraph` を通り、`runBehavior` で
|
|
68
|
-
* そのまま実行できる。
|
|
69
|
-
*/
|
|
70
|
-
import type { Catalog, CatalogEntry, Component, PortSchema, PortableType } from "./behavior.js";
|
|
71
|
-
import type { ComponentGraphIR as CompiledIR } from "./ir-handle.js";
|
|
72
|
-
export type AuthoringFailureCode = "NOT_A_BEHAVIOR_CLASS" | "NO_PUBLIC_METHOD" | "NO_FRAME" | "NOT_RECORDABLE" | "NATIVE_CONTROL_SYNTAX" | "COMPUTED_ACCESS" | "WHOLE_INPUT" | "BAD_PORT_VALUE" | "UNKNOWN_PORT" | "MISSING_PORT" | "PORT_TYPE_MISMATCH" | "NOT_PORTABLE_COMPONENT" | "BAD_CONDITION" | "BAD_BRANCH" | "NESTED_BRANCH" | "MAP_IN_BRANCH" | "NESTED_MAP" | "MAP_NOT_LOWERABLE" | "MAP_MULTI_COMPONENT" | "FANOUT_NOT_LOWERABLE" | "FANOUT_MULTI_COMPONENT" | "FANOUT_IN_BRANCH" | "BAD_AS_TARGET" | "BAD_TYPE_NOTATION" | "BAD_LEAF_META" | "BAD_OUTPUT" | "PORT_OPTIONALITY_CONFLICT";
|
|
73
|
-
export declare class AuthoringFailure extends Error {
|
|
74
|
-
code: AuthoringFailureCode;
|
|
75
|
-
constructor(code: AuthoringFailureCode, message: string);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* `SemanticBehavior` — 共有 authoring の基底クラス(既定の root マーカー)。
|
|
79
|
-
* 継承したクラスの各 public メソッドが 1 root Behavior として publish される。
|
|
80
|
-
* マーカー以外の実装・状態は持たない(authoring は effect 非依存・宣言のみ)。
|
|
81
|
-
*/
|
|
82
|
-
export declare class SemanticBehavior {
|
|
83
|
-
}
|
|
84
|
-
/** `compileBehaviors` が受け付けるクラス(0 引数 new 可能)。 */
|
|
85
|
-
export type BehaviorClass = new () => object;
|
|
86
|
-
/**
|
|
87
|
-
* `@behavior` — クラスデコレータ形の root マーカー(`SemanticBehavior` 継承と**同義**。
|
|
88
|
-
* 同じクラス本体はどちらのマーカーでも同一 IR に lower される)。
|
|
89
|
-
* TC39 standard / legacy いずれのデコレータ位置でも、素の関数呼び出しでも使える。
|
|
90
|
-
*/
|
|
91
|
-
export declare function behavior<T extends BehaviorClass>(cls: T, _context?: unknown): T;
|
|
92
|
-
/**
|
|
93
|
-
* `In<T>` — 公開メソッドの `$` 引数の型(Input Port の compile-time 契約)。
|
|
94
|
-
* ランタイム値は recorder Proxy(`$` の各フィールドアクセスが `{ref:[<field>]}` へ lower され、
|
|
95
|
-
* アクセスされたフィールド名が component の `inputPorts` に記録される)。
|
|
96
|
-
*/
|
|
97
|
-
export type In<T> = Readonly<T>;
|
|
2
|
+
* authoring.ts — native TS authoring surface(markers + leaf-schema 導出、reader 非依存)。
|
|
3
|
+
*
|
|
4
|
+
* SCP の原則 C2「difference is catalog only」を authoring 層で成立させる COMMON 実装。consumer
|
|
5
|
+
* (graphddb / litedbmodel / …)は **Catalog(leaf 専用コンポーネント)だけ**を供給し、Behavior の
|
|
6
|
+
* 合成・命名・root 指定・配線・structured control は共有層が担う。本体の読み取り(`$` 参照・式・
|
|
7
|
+
* 構造化制御 → component-graph IR への lowering)は **AST リーダー**(`commands/ts-compile.ts` +
|
|
8
|
+
* `commands/ts-extract.ts` + 規則 SSoT の `lowering.ts`)が行う。このモジュールは reader を持たず、
|
|
9
|
+
* 次のものだけを提供する:
|
|
10
|
+
*
|
|
11
|
+
* - **root / leaf マーカー**: `@behavior`(各 public static メソッド = 1 root Behavior)/ `@leaf`
|
|
12
|
+
* (各 public static メソッド = 1 leaf)。どちらも runtime no-op — AST リーダーが名前で識別する。
|
|
13
|
+
* - **numeric Input Port 精度**: `Int`(i64)/ `Float`(f64)。裸の `number` は型抽出で fail-closed。
|
|
14
|
+
* - **authoring builder**: `opt`(`?.` = refOpt の source 表現・passthrough)/ `refsConnection`
|
|
15
|
+
* (fanout の dedupe + implicit-source 剥がし)。式・構造化制御はネイティブ TS 構文(`+`/`?:`/
|
|
16
|
+
* `.map` 等)で書き、AST リーダーが expression/control IR へ 1:1 で lower する。
|
|
17
|
+
* - **leaf-schema 導出**: `@leaf` シグネチャから抽出した `LeafMeta`(`extractLeafMeta`)を
|
|
18
|
+
* `CatalogEntry` へ射影する `catalogEntryFromLeaf` / `portSchemaFromPortable`。consumer は
|
|
19
|
+
* catalog を手書きしない(§4.1)。
|
|
20
|
+
*/
|
|
21
|
+
import type { CatalogEntry, PortSchema, PortableType } from "./behavior.js";
|
|
22
|
+
import type { FanoutOptions } from "./lowering.js";
|
|
23
|
+
export { AuthoringFailure } from "./lowering.js";
|
|
24
|
+
export type { AuthoringFailureCode } from "./lowering.js";
|
|
25
|
+
/**
|
|
26
|
+
* `@behavior` — root マーカー。`@behavior static` メソッド = 1 root Behavior(合成コンポーネント)。
|
|
27
|
+
* runtime は no-op(AST リーダーが名前で識別・実行しない)。plain 呼び出し(`behavior(fn)` — node
|
|
28
|
+
* type-stripping 用)・TC39 method-decorator いずれの適用位置でも型が通ればよい。
|
|
29
|
+
*/
|
|
30
|
+
export declare function behavior<T>(target: T, _context?: unknown): T;
|
|
31
|
+
/**
|
|
32
|
+
* `@leaf` — leaf マーカー。`@leaf static` メソッド = 1 leaf(catalog エントリは AST が
|
|
33
|
+
* シグネチャから導く — struct 設定なし)。runtime は no-op(AST リーダーが名前で識別・実行しない)。
|
|
34
|
+
*/
|
|
35
|
+
export declare function leaf<T>(target: T, _context?: unknown): T;
|
|
98
36
|
declare const bcIntBrand: unique symbol;
|
|
99
37
|
declare const bcFloatBrand: unique symbol;
|
|
100
|
-
/** Input Port を portable `int`(i64) として宣言する数値型(`$:
|
|
38
|
+
/** Input Port を portable `int`(i64) として宣言する数値型(`$: { id: Int }`)。`number` に代入可能。 */
|
|
101
39
|
export type Int = number & {
|
|
102
40
|
readonly [bcIntBrand]: "int";
|
|
103
41
|
};
|
|
104
|
-
/** Input Port を portable `float`(f64) として宣言する数値型(`$:
|
|
42
|
+
/** Input Port を portable `float`(f64) として宣言する数値型(`$: { ratio: Float }`)。`number` に代入可能。 */
|
|
105
43
|
export type Float = number & {
|
|
106
44
|
readonly [bcFloatBrand]: "float";
|
|
107
45
|
};
|
|
108
46
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* `TsToPortable<T>` — TS 型 → 対応する `PortableType` runtime 注記の型レベル写像
|
|
115
|
-
* ({@link PortableTypeToTs} の逆向き)。`.as<T>(t)` の runtime 引数 `t` を、generic `<T>` が
|
|
116
|
-
* 表す確定型と**一致する PortableType リテラル**にだけ制約するために使う。矛盾(例
|
|
117
|
-
* `.as<string>({ obj: {…} })`)は tsc エラー(BC は runtime `t` だけを読み・型は推論しない)。
|
|
47
|
+
* `WireValue` — **不透明 wire 値**の Input Port 宣言型(portable `value`)。DB ドライバ境界のように
|
|
48
|
+
* **本質的に generic** な束縛値(strict-typing-and-debox.md §D4b)を綴るための唯一の型で、`WireValue[]`
|
|
49
|
+
* は heterogeneous な束縛値列(`{arr:"value"}` = `Vec<WireValue>` / `[]WireValue`)になる。名前は生成物
|
|
50
|
+
* 側の BC 所有 wire 型(`WireValue`/`WireRow`/`WireList`)と同一 — 宣言(TS)と生成コードで同じ語を使う。
|
|
118
51
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
T
|
|
129
|
-
] extends [number] ? ("int" | "float") : [
|
|
130
|
-
T
|
|
131
|
-
] extends [boolean] ? "bool" : [
|
|
132
|
-
T
|
|
133
|
-
] extends [null] ? "null" : null extends T ? {
|
|
134
|
-
opt: TsToPortable<Exclude<T, null | undefined>>;
|
|
135
|
-
} : undefined extends T ? {
|
|
136
|
-
opt: TsToPortable<Exclude<T, null | undefined>>;
|
|
137
|
-
} : T extends readonly (infer U)[] ? {
|
|
138
|
-
arr: TsToPortable<U>;
|
|
139
|
-
} : T extends object ? {
|
|
140
|
-
obj: {
|
|
141
|
-
[K in keyof T]-?: TsToPortable<T[K]>;
|
|
142
|
-
};
|
|
143
|
-
} : never;
|
|
144
|
-
/**
|
|
145
|
-
* `TypedRecorded<T>` — node 結果 recorder の型付きビュー(`behaviorComponents` の leaf 呼びが返す)。
|
|
146
|
-
* 実行時は {@link Recorded}(Proxy)そのものだが、compile-time では:
|
|
147
|
-
* - `.as<U>(t)` が **runtime `PortableType`({@link TsToPortable}<U> に一致)を必須引数**に取り、
|
|
148
|
-
* `TypedRecorded<U>` を返す(`<U>` を runtime `t` に束縛 = 型と runtime 注記の一致を tsc が強制)。
|
|
149
|
-
* - フィールドアクセス(`article.tagRefs`)・`.map` は既存の record ергономикс を保つため
|
|
150
|
-
* 緩く型付ける(base 型は leaf signature 由来・projection 点で `.as` が確定させる — §4.4)。
|
|
151
|
-
*/
|
|
152
|
-
export interface TypedRecorded<T = unknown> {
|
|
153
|
-
as<U>(t: TsToPortable<U>): TypedRecorded<U>;
|
|
154
|
-
map(cb: (el: any) => any, opts?: MapOptions): TypedRecorded;
|
|
155
|
-
refsConnection(cb: (el: any) => any, opts?: FanoutOptions): TypedRecorded;
|
|
156
|
-
[field: string]: any;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* `.map` の opts キーの閉集合(**runtime-enumerable SoT**)。{@link MapOptions} の型はここから
|
|
160
|
-
* 導出し(`Record<...> `)、新 opts キーを足すときはここに 1 語追加するのが正。matrix の網羅ゲート
|
|
161
|
-
* (#132)はこの配列から導出するので、SoT にキーを足して matrix にケースが無ければ CI が RED になる。
|
|
162
|
-
* 注: 要素ごと skip の `when` は opts キーではなく callback 内 `when(...)` guard 由来(`map.when` へ
|
|
163
|
-
* lower)なので、ここには含めない(authoring 手段が別。matrix 側で別途カバーする)。
|
|
164
|
-
*/
|
|
165
|
-
export declare const MAP_OPTION_KEYS: readonly ["into", "batched"];
|
|
166
|
-
/** `.map` の 1 opts キー({@link MAP_OPTION_KEYS} から導出)。 */
|
|
167
|
-
export type MapOptionKey = (typeof MAP_OPTION_KEYS)[number];
|
|
168
|
-
interface MapOptionShapes {
|
|
169
|
-
/** v2 zip-attach キー(scp-ir-architecture.md §5.1 `map.into`)。 */
|
|
170
|
-
into: string;
|
|
171
|
-
/** v2 バッチ fan-out(`map.batched`)。 */
|
|
172
|
-
batched: boolean;
|
|
173
|
-
}
|
|
174
|
-
/** `.map` の opts。キー集合は {@link MAP_OPTION_KEYS} が SoT(型は shape から取り、キーは SoT に一致)。 */
|
|
175
|
-
type MapOptions = {
|
|
176
|
-
[K in MapOptionKey]?: MapOptionShapes[K];
|
|
177
|
-
};
|
|
178
|
-
/**
|
|
179
|
-
* `refsConnection`(v3 fanout)の opts キーの閉集合(**runtime-enumerable SoT**)。graphddb の
|
|
180
|
-
* `@refs` 読みが宣言する dedupe/drop 契約。{@link FanoutOptions} の型はここから導出。新 opts キーは
|
|
181
|
-
* ここに追加するのが正で、matrix 網羅ゲート(#132)がこの配列から導出する(未カバー → CI RED)。
|
|
182
|
-
*/
|
|
183
|
-
export declare const FANOUT_OPTION_KEYS: readonly ["dedupeKey", "drop", "implicitSource"];
|
|
184
|
-
/** `refsConnection` の 1 opts キー({@link FANOUT_OPTION_KEYS} から導出)。 */
|
|
185
|
-
export type FanoutOptionKey = (typeof FANOUT_OPTION_KEYS)[number];
|
|
186
|
-
interface FanoutOptionShapes {
|
|
187
|
-
/** first-seen dedupe の基準となる結果要素の port(必須)。 */
|
|
188
|
-
dedupeKey: string;
|
|
189
|
-
/** dangling(null body)の扱い(既定 "dangling")。 */
|
|
190
|
-
drop?: "dangling" | "none";
|
|
191
|
-
/** 結果要素から除去する暗黙ソースフィールド名。 */
|
|
192
|
-
implicitSource?: string;
|
|
193
|
-
}
|
|
194
|
-
/** `refsConnection` の opts(キー集合は {@link FANOUT_OPTION_KEYS} が SoT)。 */
|
|
195
|
-
type FanoutOptions = Pick<FanoutOptionShapes, FanoutOptionKey>;
|
|
196
|
-
/** `+`(文字列連結)。n-ary(min 2)。 */
|
|
197
|
-
export declare function concat(...parts: unknown[]): Recorded;
|
|
198
|
-
export declare const add: (a: unknown, b: unknown) => Recorded;
|
|
199
|
-
export declare const sub: (a: unknown, b: unknown) => Recorded;
|
|
200
|
-
export declare const mul: (a: unknown, b: unknown) => Recorded;
|
|
201
|
-
export declare const div: (a: unknown, b: unknown) => Recorded;
|
|
202
|
-
export declare const mod: (a: unknown, b: unknown) => Recorded;
|
|
203
|
-
export declare const neg: (a: unknown) => Recorded;
|
|
204
|
-
export declare const eq: (a: unknown, b: unknown) => Recorded;
|
|
205
|
-
export declare const ne: (a: unknown, b: unknown) => Recorded;
|
|
206
|
-
export declare const lt: (a: unknown, b: unknown) => Recorded;
|
|
207
|
-
export declare const le: (a: unknown, b: unknown) => Recorded;
|
|
208
|
-
export declare const gt: (a: unknown, b: unknown) => Recorded;
|
|
209
|
-
export declare const ge: (a: unknown, b: unknown) => Recorded;
|
|
210
|
-
export declare const and: (a: unknown, b: unknown) => Recorded;
|
|
211
|
-
export declare const or: (a: unknown, b: unknown) => Recorded;
|
|
212
|
-
export declare const not: (a: unknown) => Recorded;
|
|
213
|
-
/** `??`。 */
|
|
214
|
-
export declare const coalesce: (a: unknown, b: unknown) => Recorded;
|
|
215
|
-
export declare const len: (a: unknown) => Recorded;
|
|
216
|
-
/**
|
|
217
|
-
* `opt(x)` — `?.`(optional chaining)の record 形。ref recorder を refOpt に変換する
|
|
218
|
-
* (以降のプロパティアクセスは中間 null で null を返す — expression-ir.md `refOpt`)。
|
|
219
|
-
*/
|
|
220
|
-
export declare function opt(x: unknown): Recorded;
|
|
221
|
-
/**
|
|
222
|
-
* catalogComponents — consumer の Catalog から、authoring 本体で呼べる leaf コンポーネント
|
|
223
|
-
* 関数群を作る(C2: consumer が供給するのはこの Catalog だけ)。
|
|
52
|
+
* これにより **全 op を単一の op-agnostic transport** で賄える(`@leaf static executeSQL(sql: string,
|
|
53
|
+
* params: WireValue[], …)`)。行型・バインド形ごとに leaf を増やす(leaf zoo)と、1 回で済むはずの
|
|
54
|
+
* typed↔汎用 de-box 境界が N 箇所へ散る — それを防ぐのがこの宣言型の役割。
|
|
55
|
+
*
|
|
56
|
+
* **出力位置では「出力ワイヤ透過」の宣言**(bc#164): `@leaf` 戻り型 / 束縛注記(`const x: WireValue[] = …`)
|
|
57
|
+
* が不透明ワイヤ形なら結果は de-box されずワイヤのまま流れ、下流の op-agnostic leaf が `typed→Value` の
|
|
58
|
+
* 再 box 無しで消費する。**具体型を宣言した点だけが de-box 点**になる(=de-box は鎖全体で 1 回)。透過が
|
|
59
|
+
* 許すのは「出力そのもの/出力配列の直下要素」だけで、record field や map value に埋もれた `WireValue` は
|
|
60
|
+
* de-box 契約が無く lowering が LOUD に落とす(規則の SSoT は `setNodeOutType`・lowering.ts)。
|
|
224
61
|
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
62
|
+
* 形は**メンバを持たない宣言型**(`{}` と同じ代入規則): 任意の wire 値・任意の行型をそのまま渡せる
|
|
63
|
+
* (`Db.pluck(users, …)` — `users: UserRow[]` を `rows: WireValue[]` へ)。ブランドを持たせると TS の
|
|
64
|
+
* weak-type 検査が `UserRow` を弾き、汎用境界に cast が必要になる。識別は名前一致ではなく **宣言元**
|
|
65
|
+
* (このパッケージ内で宣言された `WireValue` か)で行う — `bcExportNameOf`(ts-compile.ts)と同じ規律。
|
|
229
66
|
*/
|
|
230
|
-
export
|
|
231
|
-
|
|
232
|
-
};
|
|
67
|
+
export interface WireValue {
|
|
68
|
+
}
|
|
233
69
|
/**
|
|
234
|
-
* `
|
|
235
|
-
*
|
|
236
|
-
* この写像で **runtime 注記(`ports`/`output`)に束縛**するために使う。宣言した runtime
|
|
237
|
-
* 型と impl の TS 型が矛盾すれば tsc エラーになる(型は consumer が確定・BC は推論しない)。
|
|
238
|
-
*
|
|
239
|
-
* - `"string"` → `string` / `"int" | "float"` → `number` / `"bool"` → `boolean` /
|
|
240
|
-
* `"null"` → `null`
|
|
241
|
-
* - `{opt: T}` → `PortableTypeToTs<T> | null | undefined`(nullable)
|
|
242
|
-
* - `{arr: T}` → `PortableTypeToTs<T>[]`
|
|
243
|
-
* - `{map: T}` → `Record<string, PortableTypeToTs<T>>`(動的 string キー・同種値)
|
|
244
|
-
* - `{obj: {k: T, …}}` → `{ k: PortableTypeToTs<T>, … }`
|
|
70
|
+
* `opt(x)` — optional-chain source マーカー。`opt(x).field` / `opt(x)` は AST リーダーが `refOpt`
|
|
71
|
+
* (欠損許容参照)へ lower する。runtime は passthrough(実行されない・型のためだけの identity)。
|
|
245
72
|
*/
|
|
246
|
-
export
|
|
247
|
-
opt: infer U;
|
|
248
|
-
} ? PortableTypeToTs<U> | null | undefined : T extends {
|
|
249
|
-
arr: infer U;
|
|
250
|
-
} ? PortableTypeToTs<U>[] : T extends {
|
|
251
|
-
map: infer U;
|
|
252
|
-
} ? Record<string, PortableTypeToTs<U>> : T extends {
|
|
253
|
-
obj: infer O;
|
|
254
|
-
} ? {
|
|
255
|
-
[K in keyof O]: PortableTypeToTs<O[K]>;
|
|
256
|
-
} : never;
|
|
257
|
-
/** opt でラップされた Port キー(省略可能キーにする)。 */
|
|
258
|
-
type OptionalPortKeys<P extends Record<string, PortableType>> = {
|
|
259
|
-
[K in keyof P]: P[K] extends {
|
|
260
|
-
opt: PortableType;
|
|
261
|
-
} ? K : never;
|
|
262
|
-
}[keyof P];
|
|
73
|
+
export declare function opt<T>(x: T): T;
|
|
263
74
|
/**
|
|
264
|
-
* `
|
|
265
|
-
* `
|
|
75
|
+
* `refsConnection(list, cb, opts)` — refs fanout の runtime SSoT。`list` の各要素へ `cb` を当て、
|
|
76
|
+
* `dedupeKey` で重複を落とし(`null`/`undefined` の dangling は drop)、`implicitSource` フィールドを
|
|
77
|
+
* 剥がして `{ items, cursor }` を返す。AST リーダーは `.refsConnection` 呼びを fanout ノードへ lower し、
|
|
78
|
+
* この関数は ts-runtime 実行で同じ意味論を再現する。
|
|
266
79
|
*/
|
|
267
|
-
export
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
[K in OptionalPortKeys<P>]?: PortableTypeToTs<P[K]>;
|
|
80
|
+
export declare function refsConnection<E, R extends Record<string, unknown>>(list: readonly E[], cb: (el: E) => R, opts: FanoutOptions): {
|
|
81
|
+
items: R[];
|
|
82
|
+
cursor: string | null;
|
|
271
83
|
};
|
|
272
84
|
/**
|
|
273
|
-
* leaf
|
|
274
|
-
*
|
|
85
|
+
* `LeafMeta` — `@leaf` シグネチャから `extractLeafMeta` が抽出する leaf の確定情報(runtime SSoT)。
|
|
86
|
+
* - `cardinality`: 型から導けない意味情報(one → item / many → items)。
|
|
87
|
+
* - `ports`: 入力 Port schema(各 Port の確定型を PortableType で宣言)。
|
|
88
|
+
* - `output`: 出力(`cardinality:"many"` のときは要素型)の確定型。
|
|
275
89
|
*/
|
|
276
90
|
export interface LeafMeta<P extends Record<string, PortableType> = Record<string, PortableType>, R extends PortableType = PortableType, Card extends "one" | "many" = "one" | "many"> {
|
|
277
|
-
/** cardinality(型から導けない意味情報。one → item / many → items)。 */
|
|
278
91
|
cardinality: Card;
|
|
279
|
-
/** 入力 Port schema(runtime SSoT。各 Port の確定型を PortableType で宣言)。 */
|
|
280
92
|
ports: P;
|
|
281
|
-
/** 出力(`cardinality:"many"` のときは要素型)の確定型(runtime SSoT)。 */
|
|
282
93
|
output: R;
|
|
283
|
-
/**
|
|
284
|
-
* この leaf の op-agnostic transport シンボル名(#176・SPEC 固定)。consumer が実装する native
|
|
285
|
-
* transport 関数の**契約名** `<transport>(payload: WireRow) -> (WireValue, error)`。宣言時に固定し、
|
|
286
|
-
* catalog → IR node(`leafSymbol`)へ機械的に焼き、native emitter が resolveLeafSymbol の第一候補として
|
|
287
|
-
* 読む(CLI `--leaf-transport` override はその後、既定 `Leaf_<comp>` は最後)。省略時は override/既定に委ねる。
|
|
288
|
-
*/
|
|
289
|
-
transport?: string;
|
|
290
|
-
/** 動的 port 群(`item.<field>` 等)の受容 opt-in(既定 false — CatalogEntry と同義)。 */
|
|
291
|
-
additionalPorts?: boolean;
|
|
292
|
-
/** 可搬 IR に載せられるか(既定 true — CatalogEntry と同義。false は ts-runtime 専用 leaf)。 */
|
|
293
|
-
portableToIR?: boolean;
|
|
294
94
|
}
|
|
295
95
|
/**
|
|
296
|
-
* `
|
|
297
|
-
*
|
|
298
|
-
* **導出**する(consumer は catalog を手書きしない・二重宣言しない — §4.1)。generic は fn の
|
|
299
|
-
* シグネチャに束縛され、`.__ports` / `.__output` phantom で TS の型情報を持ち回る。
|
|
96
|
+
* `LeafDefinition` — leaf 1 件の runtime 注記(name + meta)と impl fn。AST リーダーが `@leaf`
|
|
97
|
+
* シグネチャから `{ name, meta }` を構築し `catalogEntryFromLeaf` に渡して CatalogEntry を導出する。
|
|
300
98
|
*/
|
|
301
99
|
export interface LeafDefinition<P extends Record<string, PortableType> = Record<string, PortableType>, R extends PortableType = PortableType> {
|
|
302
100
|
readonly name: string;
|
|
303
101
|
readonly meta: LeafMeta<P, R>;
|
|
304
|
-
/**
|
|
305
|
-
* leaf 実装“本体”(ctx は環境境界注入。IR には載らない — C4)。stored 型は緩い
|
|
306
|
-
* (`(p, ctx) => unknown`): 厳密な signature 束縛は {@link defineLeaf} の**パラメータ**
|
|
307
|
-
* (generic P/R 由来)が担い、tsc がそこで矛盾を落とす。stored フィールドの緩さは
|
|
308
|
-
* `LeafDefinition<specific>` を `LeafDefinition`(既定パラメータ)へ代入可能にするための
|
|
309
|
-
* variance 対策(`fn` は contravariant なので厳密型のままだと合成レコードが不通過になる)。
|
|
310
|
-
*/
|
|
311
102
|
readonly fn: (p: any, ctx: any) => unknown;
|
|
312
103
|
}
|
|
313
104
|
/**
|
|
314
|
-
* `
|
|
315
|
-
*
|
|
316
|
-
* `defineLeaf` の戻り型ゲートに使う(fn 戻り型を推論源にせず照合先にすることで、`P2T<R>` を
|
|
317
|
-
* 通した逆方向推論が招く tsc "excessively deep" を回避する — この分離が設計上 load-bearing)。
|
|
318
|
-
*/
|
|
319
|
-
export type LeafImplMatches<Card extends "one" | "many", R extends PortableType, Out> = Card extends "many" ? [Out] extends [readonly PortableTypeToTs<R>[]] ? true : false : [Out] extends [PortableTypeToTs<R>] ? true : false;
|
|
320
|
-
/**
|
|
321
|
-
* impl 戻り型が宣言 output と矛盾したときの branded エラー型(`defineLeaf` の戻り型がこれに
|
|
322
|
-
* 化けると LeafDefinition として使えず、下流(`behaviorComponents` 等)で tsc が落ちる)。
|
|
323
|
-
*/
|
|
324
|
-
export interface LeafImplMismatch {
|
|
325
|
-
readonly __IMPL_RETURN_DOES_NOT_MATCH_DECLARED_OUTPUT__: true;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* defineLeaf — leaf を**型付き静的関数として 1 回定義**する(SA8・§4.1(B))。
|
|
329
|
-
*
|
|
330
|
-
* `fn` の引数型(= 入力 Port)は `meta.ports`、戻り型(= 出力)は `meta.output` + `cardinality`
|
|
331
|
-
* の runtime `PortableType` 注記へ**束縛**される。impl の TS 型が宣言と矛盾すると `defineLeaf` の
|
|
332
|
-
* 戻り型が {@link LeafImplMismatch} に化け、`LeafDefinition` として使えず **tsc エラー**になる
|
|
333
|
-
* (例: `output:"string"` なのに `(): number => …`)。BC core は runtime 注記だけを読み、TS の型は
|
|
334
|
-
* 推論しない(consumer-interface.md C3・不変)。`ctx`(環境依存物 = client/config/hooks の境界注入)
|
|
335
|
-
* は impl の第2引数で受ける(IR には載らない — C4)。
|
|
336
|
-
*
|
|
337
|
-
* @param name catalog 名(IR の componentRef が参照する名前)。
|
|
338
|
-
* @param meta cardinality(型で表せない意味情報)+ ports/output(runtime 型 SSoT)。
|
|
339
|
-
* @param fn leaf 実装本体(型付き。呼ばれ方=IR/dispatch は書かない)。
|
|
340
|
-
*/
|
|
341
|
-
export declare function defineLeaf<const P extends Record<string, PortableType>, const R extends PortableType, const Card extends "one" | "many", const Out, Ctx = unknown>(name: string, meta: LeafMeta<P, R, Card>, fn: (p: PortsToTs<P>, ctx: Ctx) => Out): LeafImplMatches<Card, R, Out> extends true ? LeafDefinition<P, R> : LeafImplMismatch;
|
|
342
|
-
/**
|
|
343
|
-
* `PortableType` → `PortSchema.type` 文字列(hand-written catalog と同一の語彙)+
|
|
344
|
-
* elemType の導出。既存 catalog(authoring.test.ts の `kv` / codegen-corpus の inputPorts)は
|
|
345
|
-
* スカラを `"string"`/`"int"`/`"float"`/`"bool"` の TS 風文字列で、配列を
|
|
346
|
-
* `{ type:"array", elemType: <PortableType> }` で書く。この導出はその shape を再現する:
|
|
347
|
-
*
|
|
348
|
-
* - スカラ → `{ type: <scalar> }`
|
|
349
|
-
* - `{opt: T}` → 内側 T の schema に `required:false` を上書き(nullable Port)
|
|
350
|
-
* - `{arr: T}` → `{ type:"array", elemType: T }`(map-over-input の $as 要素型解決源 — bc#101)
|
|
351
|
-
* - `{map: T}` → `{ type:"map", elemType: T }`(動的 string キー・同種値型のマップ)
|
|
352
|
-
* - `{obj: …}` → `{ type:"object" }`(object Port — 内部 field 型は catalog schema では持たない)
|
|
105
|
+
* `portSchemaFromPortable` — PortableType を CatalogEntry の PortSchema へ射影する(scalar / opt /
|
|
106
|
+
* arr / map / obj)。`required` は Port が省略可でない(`opt` ラップでない)ことを表す。
|
|
353
107
|
*/
|
|
354
108
|
export declare function portSchemaFromPortable(pt: PortableType, required: boolean): PortSchema;
|
|
355
109
|
/**
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* -
|
|
360
|
-
* する契約 — 例 `{arr:"value"}` は Vec<WireValue>)。
|
|
361
|
-
* - **動的 port**(`additionalPorts:true` leaf の未宣言キー)→ その leaf は「任意型の追加 port を受ける」と
|
|
362
|
-
* **宣言**しているので、契約は不透明 `value`(=leaf の additionalPorts 宣言の意味そのもの。推論ではなく
|
|
363
|
-
* 宣言の読み取り。authoring 入力は型消去されるため wired 値の静的型は一般に不確定であり、`value` が
|
|
364
|
-
* その port の honest な契約)。
|
|
365
|
-
* recordComponentCall / map・fanout fold の 3 箇所だけがこれを呼ぶ(手書き portSchemas 禁止)。
|
|
366
|
-
*/
|
|
367
|
-
export declare function derivePortSchemas(entry: CatalogEntry, ports: Record<string, unknown>): Record<string, PortSchema>;
|
|
368
|
-
/**
|
|
369
|
-
* catalogEntryFromLeaf — defineLeaf の runtime 注記から `CatalogEntry` を **導出**する
|
|
370
|
-
* (consumer は catalog を手書きしない — §4.1)。
|
|
371
|
-
* - `inputPorts` = 各 Port の PortableType を PortSchema へ射影(scalar/opt/arr/obj)。
|
|
372
|
-
* - `output.shape` = cardinality(one→item / many→items)。
|
|
110
|
+
* `catalogEntryFromLeaf` — leaf の runtime 注記から `CatalogEntry` を **導出**する(consumer は
|
|
111
|
+
* catalog を手書きしない — §4.1)。
|
|
112
|
+
* - `inputPorts` = 各 Port の PortableType を PortSchema へ射影(scalar / opt / arr / map / obj)。
|
|
113
|
+
* - `output.shape` = cardinality(one → item / many → items)。
|
|
373
114
|
* - `elemType` = `output`(その leaf が返す要素の確定型。typed codegen / map 要素型の SSoT)。
|
|
374
|
-
* - `portableToIR` / `additionalPorts` は meta から(既定 true / false)。
|
|
375
|
-
*/
|
|
376
|
-
export declare function catalogEntryFromLeaf(def: LeafDefinition): CatalogEntry;
|
|
377
|
-
/**
|
|
378
|
-
* behaviorComponents — `defineLeaf` 結果のレコードから **portable catalog を導出**し、
|
|
379
|
-
* authoring 本体で呼べる leaf コンポーネント関数群を返す(`catalogComponents(catalog)` と
|
|
380
|
-
* **同一の call-shape** `{ [name]: (ports) => Recorded }`・同一の {@link recordComponentCall}
|
|
381
|
-
* 機構)。consumer は catalog も handlers も手書きしない(§4.1 / SA4)。
|
|
382
115
|
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
* port 検証・lowering を通る。
|
|
116
|
+
* `leafSymbol`(#176 op-agnostic transport 名)は leaf 宣言側では固定せず、native emitter が CLI
|
|
117
|
+
* `--leaf-transport` override / 既定 `Leaf_<comp>` で解決する。
|
|
386
118
|
*/
|
|
387
|
-
export declare function
|
|
388
|
-
[K in keyof C]: C[K] extends LeafDefinition<infer _P, infer R> ? (ports: PortsToTs<C[K]["meta"]["ports"]>) => TypedRecorded<PortableTypeToTs<R>> : never;
|
|
389
|
-
};
|
|
390
|
-
/**
|
|
391
|
-
* deriveCatalog — `defineLeaf` レコードから `Catalog`(name → CatalogEntry)を導出する
|
|
392
|
-
* (guard / typed codegen / fingerprint の SSoT を得たい consumer 向け。`behaviorComponents`
|
|
393
|
-
* が内部で使うのと同一の {@link catalogEntryFromLeaf} 射影)。
|
|
394
|
-
*/
|
|
395
|
-
export declare function deriveCatalog(leaves: Record<string, LeafDefinition>): Catalog;
|
|
396
|
-
/**
|
|
397
|
-
* when — Conditional(`?:`)/ Guard(`&&`)の record 形(semantic-contract-programming.md
|
|
398
|
-
* 「構造化制御構文」の Compiler 規則を評価モードで実装する):
|
|
399
|
-
*
|
|
400
|
-
* - 両分岐(else 省略時は then のみ)が**純式のみ** → Expression IR `{cond:[c,t,e]}` へ
|
|
401
|
-
* inline lower(body ノードは増えない。else 省略は `null`)。
|
|
402
|
-
* - 分岐に **Component 宣言を含む** → 分岐ごとに gate(CondNode + null-binding skip)を
|
|
403
|
-
* 立て、両分岐が値を持つ場合は Φ(CondNode)ノードで合流する(採用側のみ実行される)。
|
|
404
|
-
* Guard 形(else 無し)は then の値をそのまま返す — 条件不成立時は当該ノードが Skip され、
|
|
405
|
-
* 下流へは未生成 Port の Skip 伝播規則で連鎖する。
|
|
406
|
-
* - `.map` コールバック内では **per-element guard**(v2 `map.when`)として record される
|
|
407
|
-
* (guard 形のみ。false の要素は handler 未呼び出しで結果から除外)。
|
|
408
|
-
*
|
|
409
|
-
* 条件は recorder 式でなければならない(ネイティブ `===` / `&&` の結果は record できない —
|
|
410
|
-
* eq/and/... builder を使う)。
|
|
411
|
-
*/
|
|
412
|
-
export declare function when(condition: unknown, then: () => unknown, otherwise?: () => unknown): Recorded;
|
|
413
|
-
export interface CompileBehaviorsOptions {
|
|
414
|
-
/** 生成 IR の exprVersion(既定: SPEC_VERSIONS.expression)。 */
|
|
415
|
-
exprVersion?: number;
|
|
416
|
-
/** plan の concurrency(既定 16)。 */
|
|
417
|
-
concurrency?: number;
|
|
418
|
-
/**
|
|
419
|
-
* Input Port schema の上書き(メソッド名 → Port 名 → schema)。ビルド時評価は `$` の
|
|
420
|
-
* アクセスから Port **名**を導出するが、TS の型(`In<...>`)はランタイムに残らないため、
|
|
421
|
-
* 型文字列を IR に載せたい consumer はここで供給する(型抽出ツールの接続点)。
|
|
422
|
-
*/
|
|
423
|
-
inputPorts?: Record<string, Record<string, PortSchema>>;
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* compileBehaviors — `SemanticBehavior` 継承(または `@behavior` 付き)クラスを
|
|
427
|
-
* component-graph IR(scp-ir-architecture.md §5)へ lower する共有 Compiler。
|
|
428
|
-
*
|
|
429
|
-
* - **各 public メソッド = 1 root Behavior**(`components[]` の 1 エントリ。名前 = メソッド名)。
|
|
430
|
-
* `#`-private はランタイム不可視でそもそも列挙されない。TS の `private` 修飾子は型消去で
|
|
431
|
-
* ランタイムに残らないため、**評価ベースのヘルパ規約は `#` または `_`-prefix**(`_` 始まりは
|
|
432
|
-
* publish されない)。ヘルパはメソッド本体からの呼び出しで record にインライン展開される。
|
|
433
|
-
* - 評価の**前に**メソッド / ヘルパ / クラスソースを {@link scanNativeControlSyntax} で走査し、
|
|
434
|
-
* 評価では観測できないネイティブ制御構文(`?:` / `&&` / `||` / `??` / `?.` / `!` /
|
|
435
|
-
* `==`/`===`/`!=`/`!==` / `if` / `switch` / 複合論理代入)を `NATIVE_CONTROL_SYNTAX` で
|
|
436
|
-
* fail-closed に拒否する(bc#24 audit fix — 残余はヘッダ docstring 参照)。
|
|
437
|
-
* - メソッド本体は throwing-sentinel recorder で 1 回評価され、`$` 参照・component 呼び出し・
|
|
438
|
-
* structured control({@link when} / `.map`)が body ノード・Wire・plan に lower される。
|
|
439
|
-
* - 生成 IR は `assertPortableComponentGraph` を必ず通してから返す(fail-closed の自己検査)。
|
|
440
|
-
* 実行は既存の `runBehavior` がそのまま担う。
|
|
441
|
-
*
|
|
442
|
-
* effect(Query/Command)はここでは一切扱わない — {@link classifyBehaviorEffect} を参照。
|
|
443
|
-
*/
|
|
444
|
-
export declare function compileBehaviors(cls: BehaviorClass, opts?: CompileBehaviorsOptions): CompiledIR;
|
|
445
|
-
/**
|
|
446
|
-
* referencedComponents — lowering 済み合成コンポーネントの body が参照する catalog 名
|
|
447
|
-
* (componentRef / map。重複除去・出現順)。
|
|
448
|
-
*/
|
|
449
|
-
export declare function referencedComponents(component: Component): string[];
|
|
450
|
-
export type BehaviorEffect = "read-only" | "writing";
|
|
451
|
-
/**
|
|
452
|
-
* classifyBehaviorEffect — CQRS の Query/Command 分類を **component graph から導出**する
|
|
453
|
-
* consumer 向けヘルパ。authoring は effect 非依存(Query/Command の語彙を持たない)であり、
|
|
454
|
-
* 分類は「body が consumer の write-catalog(`PutItem`/`Insert`/… — consumer が指定)を
|
|
455
|
-
* 参照するか」という graph の性質にすぎない、という責務分離(bc#24 / litedbmodel v2 §2.4)の
|
|
456
|
-
* 実装点。
|
|
457
|
-
*/
|
|
458
|
-
export declare function classifyBehaviorEffect(component: Component, writeComponents: Iterable<string>): BehaviorEffect;
|
|
459
|
-
export {};
|
|
119
|
+
export declare function catalogEntryFromLeaf(def: LeafDefinition): CatalogEntry;
|
|
460
120
|
//# sourceMappingURL=authoring.d.ts.map
|
package/dist/authoring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAiB,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAE5D;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAExD;AAOD,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AACxC,OAAO,CAAC,MAAM,YAAY,EAAE,OAAO,MAAM,CAAC;AAC1C,oFAAoF;AACpF,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAC5D,2FAA2F;AAC3F,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAGlE;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,SAAS;CAAG;AAI7B;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAE9B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,IAAI,EAAE,SAAS,CAAC,EAAE,EAClB,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAChB,IAAI,EAAE,aAAa,GAClB;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAiBvC;AAID;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CACvB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EACrE,CAAC,SAAS,YAAY,GAAG,YAAY,EACrC,IAAI,SAAS,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM;IAE5C,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,EAAE,CAAC,CAAC;IACT,MAAM,EAAE,CAAC,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc,CAC7B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EACrE,CAAC,SAAS,YAAY,GAAG,YAAY;IAErC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE9B,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CAC5C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,GAAG,UAAU,CA0BtF;AAOD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,YAAY,CActE"}
|