@elaraai/e3-ui 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/src/data.d.ts +76 -71
  2. package/dist/src/data.d.ts.map +1 -1
  3. package/dist/src/data.js +79 -75
  4. package/dist/src/data.js.map +1 -1
  5. package/dist/src/decision/bind.d.ts +5 -5
  6. package/dist/src/decision/bind.js +1 -1
  7. package/dist/src/derive.d.ts +2 -1
  8. package/dist/src/derive.d.ts.map +1 -1
  9. package/dist/src/derive.js +23 -1
  10. package/dist/src/derive.js.map +1 -1
  11. package/dist/src/diff.d.ts +1 -1
  12. package/dist/src/diff.js +1 -1
  13. package/dist/src/func.d.ts +272 -0
  14. package/dist/src/func.d.ts.map +1 -0
  15. package/dist/src/func.js +222 -0
  16. package/dist/src/func.js.map +1 -0
  17. package/dist/src/index.d.ts +3 -1
  18. package/dist/src/index.d.ts.map +1 -1
  19. package/dist/src/index.js +3 -1
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/internal.d.ts +2 -1
  22. package/dist/src/internal.d.ts.map +1 -1
  23. package/dist/src/internal.js +2 -1
  24. package/dist/src/internal.js.map +1 -1
  25. package/dist/src/manifest.d.ts +17 -4
  26. package/dist/src/manifest.d.ts.map +1 -1
  27. package/dist/src/manifest.js +28 -4
  28. package/dist/src/manifest.js.map +1 -1
  29. package/dist/src/ontology.d.ts +77 -51
  30. package/dist/src/ontology.d.ts.map +1 -1
  31. package/dist/src/ontology.js +30 -2
  32. package/dist/src/ontology.js.map +1 -1
  33. package/dist/src/runtime/decision/queue.d.ts +2 -6
  34. package/dist/src/runtime/decision/queue.d.ts.map +1 -1
  35. package/dist/src/runtime/decision/queue.js +2 -6
  36. package/dist/src/runtime/decision/queue.js.map +1 -1
  37. package/dist/src/runtime/diff.d.ts +1 -1
  38. package/dist/src/runtime/diff.js +1 -1
  39. package/dist/src/runtime/ontology.d.ts +1 -1
  40. package/dist/src/runtime/ontology.js +1 -1
  41. package/dist/src/ui.d.ts +1 -1
  42. package/dist/src/ui.js +2 -2
  43. package/dist/src/ui.js.map +1 -1
  44. package/dist/test/data/data.examples.js +9 -9
  45. package/dist/test/data/data.examples.js.map +1 -1
  46. package/dist/test/decision/journal.examples.js +4 -4
  47. package/dist/test/decision/journal.examples.js.map +1 -1
  48. package/dist/test/decision/loop.examples.js +3 -3
  49. package/dist/test/decision/loop.examples.js.map +1 -1
  50. package/dist/test/decision/queue.examples.js +12 -12
  51. package/dist/test/decision/queue.examples.js.map +1 -1
  52. package/dist/test/diff/diff.examples.d.ts.map +1 -1
  53. package/dist/test/diff/diff.examples.js +34 -34
  54. package/dist/test/diff/diff.examples.js.map +1 -1
  55. package/dist/test/func/func.examples.d.ts +5 -0
  56. package/dist/test/func/func.examples.d.ts.map +1 -0
  57. package/dist/test/func/func.examples.js +73 -0
  58. package/dist/test/func/func.examples.js.map +1 -0
  59. package/dist/test/ontology/ontology.examples.d.ts +13 -393
  60. package/dist/test/ontology/ontology.examples.d.ts.map +1 -1
  61. package/dist/test/ontology/ontology.examples.js +121 -190
  62. package/dist/test/ontology/ontology.examples.js.map +1 -1
  63. package/package.json +7 -7
@@ -8,7 +8,7 @@
8
8
  * @packageDocumentation
9
9
  */
10
10
  import { NullType, BooleanType, FunctionType, StructType, VariantType, OptionType, type EastType, type ExprType } from '@elaraai/east';
11
- import { type TreePath } from '@elaraai/e3-types';
11
+ import type { DatasetDef, TaskDef } from '@elaraai/e3';
12
12
  /**
13
13
  * The two operating modes for {@link Data.bind}.
14
14
  *
@@ -107,7 +107,7 @@ export declare const DataBindHandleType: <T extends EastType | string>(t: T) =>
107
107
  }>;
108
108
  /**
109
109
  * The TypeScript type of a {@link Data.bind} handle bound to source type `T`
110
- * — i.e. the return of `Data.bind([T], …)`.
110
+ * — i.e. the return of `Data.bind(dataset)` for a `DatasetDef<T>`.
111
111
  *
112
112
  * @remarks
113
113
  * Unlike the bare `binding` field (a {@link DiffBindingType} descriptor that is
@@ -172,17 +172,83 @@ export declare const bindPlatformFn: import("@elaraai/east").GenericPlatformDefi
172
172
  * @property mode - Operating mode. `"staged"` (default) buffers edits
173
173
  * locally and commits on demand; `"direct"` writes through immediately.
174
174
  * @property patch - When supplied, the binding's commit / live writes
175
- * target this patch dataset (typed `PatchType(T)`). Must be a static
176
- * {@link TreePath} so manifest derivation can preload it; computed
177
- * East-side path expressions are not supported. When omitted, writes
178
- * target the source itself.
175
+ * target this patch dataset (typed `PatchType(T)`) instead of the
176
+ * source. Its path comes from the def, so it is statically known for
177
+ * manifest derivation by construction.
179
178
  */
180
179
  export interface DataBindOptions {
181
180
  /** Operating mode — `"staged"` (default) or `"direct"`. */
182
181
  mode?: DataBindModeLiteral;
183
- /** Optional separate patch dataset path. Must be statically known. */
184
- patch?: TreePath;
182
+ /** Optional separate patch dataset (typed `PatchType(T)`) the
183
+ * binding's commit / live writes target it instead of the source. */
184
+ patch?: DatasetDef;
185
185
  }
186
+ /**
187
+ * Bind a dataset to a reactive view of its current value, with optional
188
+ * local staging or a separate server-backed patch dataset.
189
+ *
190
+ * Takes the {@link DatasetDef} returned by `e3.input` (or a {@link TaskDef},
191
+ * which binds its output dataset) — the binding's path and value type are
192
+ * both taken from the def, the same way task wiring does.
193
+ *
194
+ * @typeParam T - The East type of the source dataset value (from the def).
195
+ * @param dataset - The dataset (or task) definition to bind.
196
+ * @param options - {@link DataBindOptions}. When omitted, defaults to
197
+ * `{ mode: "staged" }` (no separate patch dataset, edits buffered
198
+ * locally until commit).
199
+ * @returns A handle struct described by {@link DataBindHandleType} —
200
+ * `read` / `write` / `writeAndStart` / `source` / `pending` /
201
+ * `commit` / `discard` / `has` / `status` / `binding`.
202
+ *
203
+ * @remarks
204
+ * Per-mode semantics matrix (rows are `mode × patch`, columns are
205
+ * methods):
206
+ *
207
+ * | mode | patch | `read()` | `write(v)` | `commit()` | `discard()` | `pending()` |
208
+ * |---------|---------|-------------------------------------|-----------------------------------------|-----------------------------------------------------|------------------------------|---------------------|
209
+ * | direct | absent | source | dataset write | no-op | no-op | always false |
210
+ * | direct | present | apply(source, patch dataset) | write diff(source, v) → patch dataset | apply patch → source; clear patch dataset | clear patch dataset | patch non-trivial |
211
+ * | staged | absent | buffered ?? source | update buffer (pin snapshot first time) | apply buffer → source; drop buffer | drop buffer | buffer non-empty |
212
+ * | staged | present | buffered ?? apply(source, patch) | update buffer | write diff(source, buffer) → patch dataset; drop buffer | drop buffer (patch intact) | buffer non-empty |
213
+ *
214
+ * `writeAndStart(v)` kicks the workspace dataflow after the write — only
215
+ * meaningful for `mode = "direct"` without a `patch` dataset; in other
216
+ * modes it falls back to `write(v)` (the workspace dataflow is triggered
217
+ * on `commit` instead).
218
+ *
219
+ * The `binding` field surfaces this binding's descriptor as a
220
+ * {@link DiffBindingType} value — pass it directly to
221
+ * {@link Diff.Root}'s `bindings` array to surface the in-flight change
222
+ * in a Diff card.
223
+ *
224
+ * Use inside `Reactive.Root` so `read` / `pending` / `status` re-fire
225
+ * on every dataset or staging-buffer change.
226
+ *
227
+ * @example
228
+ * ```ts
229
+ * import { East, FloatType, NullType } from "@elaraai/east";
230
+ * import { Reactive, Slider, UIComponentType } from "@elaraai/east-ui";
231
+ * import { Data, Diff } from "@elaraai/e3-ui";
232
+ * import * as e3 from "@elaraai/e3";
233
+ *
234
+ * const thresholdInput = e3.input("threshold", FloatType, 38.0);
235
+ *
236
+ * // Mirrors `dataBindStaged` in test/data.examples.ts.
237
+ * const dataBindStaged = East.function([], UIComponentType, _$ => {
238
+ * return Reactive.Root(East.function([], UIComponentType, $ => {
239
+ * const view = $.let(Data.bind(thresholdInput));
240
+ * const value = $.let(view.read(), FloatType);
241
+ * return Slider.Root(value, {
242
+ * min: 30.0, max: 60.0, step: 1.0,
243
+ * onChangeEnd: East.function([FloatType], NullType, ($, v) => {
244
+ * $(view.write(v));
245
+ * }),
246
+ * });
247
+ * }));
248
+ * });
249
+ * ```
250
+ */
251
+ declare function bindData<T extends EastType>(dataset: DatasetDef<T> | TaskDef<T>, options?: DataBindOptions): BoundValue<T>;
186
252
  /**
187
253
  * The Data namespace — reactive dataset binding for e3 UI tasks.
188
254
  *
@@ -195,68 +261,7 @@ export interface DataBindOptions {
195
261
  * datasets change.
196
262
  */
197
263
  export declare const Data: {
198
- /**
199
- * Bind a dataset path to a reactive view of its current value, with
200
- * optional local staging or a separate server-backed patch dataset.
201
- *
202
- * @typeParam T - The East type of the source dataset value.
203
- * @param types - Single-element type-args tuple `[T]`.
204
- * @param source - The source dataset path.
205
- * @param options - {@link DataBindOptions}. When omitted, defaults to
206
- * `{ mode: "staged" }` (no separate patch dataset, edits buffered
207
- * locally until commit).
208
- * @returns A handle struct described by {@link DataBindHandleType} —
209
- * `read` / `write` / `writeAndStart` / `source` / `pending` /
210
- * `commit` / `discard` / `has` / `status` / `binding`.
211
- *
212
- * @remarks
213
- * Per-mode semantics matrix (rows are `mode × patch`, columns are
214
- * methods):
215
- *
216
- * | mode | patch | `read()` | `write(v)` | `commit()` | `discard()` | `pending()` |
217
- * |---------|---------|-------------------------------------|-----------------------------------------|-----------------------------------------------------|------------------------------|---------------------|
218
- * | direct | absent | source | dataset write | no-op | no-op | always false |
219
- * | direct | present | apply(source, patch dataset) | write diff(source, v) → patch dataset | apply patch → source; clear patch dataset | clear patch dataset | patch non-trivial |
220
- * | staged | absent | buffered ?? source | update buffer (pin snapshot first time) | apply buffer → source; drop buffer | drop buffer | buffer non-empty |
221
- * | staged | present | buffered ?? apply(source, patch) | update buffer | write diff(source, buffer) → patch dataset; drop buffer | drop buffer (patch intact) | buffer non-empty |
222
- *
223
- * `writeAndStart(v)` kicks the workspace dataflow after the write — only
224
- * meaningful for `mode = "direct"` without a `patch` dataset; in other
225
- * modes it falls back to `write(v)` (the workspace dataflow is triggered
226
- * on `commit` instead).
227
- *
228
- * The `binding` field surfaces this binding's descriptor as a
229
- * {@link DiffBindingType} value — pass it directly to
230
- * {@link Diff.Root}'s `bindings` array to surface the in-flight change
231
- * in a Diff card.
232
- *
233
- * Use inside `Reactive.Root` so `read` / `pending` / `status` re-fire
234
- * on every dataset or staging-buffer change.
235
- *
236
- * @example
237
- * ```ts
238
- * import { East, FloatType, NullType } from "@elaraai/east";
239
- * import { Reactive, Slider, UIComponentType } from "@elaraai/east-ui";
240
- * import { Data, Diff } from "@elaraai/e3-ui";
241
- * import * as e3 from "@elaraai/e3";
242
- *
243
- * const thresholdInput = e3.input("threshold", FloatType, 38.0);
244
- *
245
- * // Mirrors `dataBindStaged` in test/data.examples.ts.
246
- * const dataBindStaged = East.function([], UIComponentType, _$ => {
247
- * return Reactive.Root(East.function([], UIComponentType, $ => {
248
- * const view = $.let(Data.bind([FloatType], thresholdInput.path));
249
- * const value = $.let(view.read(), FloatType);
250
- * return Slider.Root(value, {
251
- * min: 30.0, max: 60.0, step: 1.0,
252
- * onChangeEnd: East.function([FloatType], NullType, ($, v) => {
253
- * $(view.write(v));
254
- * }),
255
- * });
256
- * }));
257
- * });
258
- * ```
259
- */
260
- readonly bind: <T extends EastType>(types: [T], source: TreePath, options?: DataBindOptions) => BoundValue<T>;
264
+ readonly bind: typeof bindData;
261
265
  };
266
+ export {};
262
267
  //# sourceMappingURL=data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAEH,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,UAAU,EAIV,KAAK,QAAQ,EACb,KAAK,QAAQ,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAMnF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AACH,+CAA+C;AAC/C,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC;AAEvD,uDAAuD;AACvD,MAAM,MAA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,eAAe,GAC1B,UAAU,CAAC,CAAC,CAAC,CAYf;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI;;CAEP,CAAC"}
package/dist/src/data.js CHANGED
@@ -104,6 +104,84 @@ export const bindPlatformFn = East.genericPlatform("data_bind", ["T"], [TreePath
104
104
  status: FunctionType([], DatasetStatusType),
105
105
  binding: DiffBindingType,
106
106
  }), { optional: true });
107
+ /**
108
+ * Bind a dataset to a reactive view of its current value, with optional
109
+ * local staging or a separate server-backed patch dataset.
110
+ *
111
+ * Takes the {@link DatasetDef} returned by `e3.input` (or a {@link TaskDef},
112
+ * which binds its output dataset) — the binding's path and value type are
113
+ * both taken from the def, the same way task wiring does.
114
+ *
115
+ * @typeParam T - The East type of the source dataset value (from the def).
116
+ * @param dataset - The dataset (or task) definition to bind.
117
+ * @param options - {@link DataBindOptions}. When omitted, defaults to
118
+ * `{ mode: "staged" }` (no separate patch dataset, edits buffered
119
+ * locally until commit).
120
+ * @returns A handle struct described by {@link DataBindHandleType} —
121
+ * `read` / `write` / `writeAndStart` / `source` / `pending` /
122
+ * `commit` / `discard` / `has` / `status` / `binding`.
123
+ *
124
+ * @remarks
125
+ * Per-mode semantics matrix (rows are `mode × patch`, columns are
126
+ * methods):
127
+ *
128
+ * | mode | patch | `read()` | `write(v)` | `commit()` | `discard()` | `pending()` |
129
+ * |---------|---------|-------------------------------------|-----------------------------------------|-----------------------------------------------------|------------------------------|---------------------|
130
+ * | direct | absent | source | dataset write | no-op | no-op | always false |
131
+ * | direct | present | apply(source, patch dataset) | write diff(source, v) → patch dataset | apply patch → source; clear patch dataset | clear patch dataset | patch non-trivial |
132
+ * | staged | absent | buffered ?? source | update buffer (pin snapshot first time) | apply buffer → source; drop buffer | drop buffer | buffer non-empty |
133
+ * | staged | present | buffered ?? apply(source, patch) | update buffer | write diff(source, buffer) → patch dataset; drop buffer | drop buffer (patch intact) | buffer non-empty |
134
+ *
135
+ * `writeAndStart(v)` kicks the workspace dataflow after the write — only
136
+ * meaningful for `mode = "direct"` without a `patch` dataset; in other
137
+ * modes it falls back to `write(v)` (the workspace dataflow is triggered
138
+ * on `commit` instead).
139
+ *
140
+ * The `binding` field surfaces this binding's descriptor as a
141
+ * {@link DiffBindingType} value — pass it directly to
142
+ * {@link Diff.Root}'s `bindings` array to surface the in-flight change
143
+ * in a Diff card.
144
+ *
145
+ * Use inside `Reactive.Root` so `read` / `pending` / `status` re-fire
146
+ * on every dataset or staging-buffer change.
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * import { East, FloatType, NullType } from "@elaraai/east";
151
+ * import { Reactive, Slider, UIComponentType } from "@elaraai/east-ui";
152
+ * import { Data, Diff } from "@elaraai/e3-ui";
153
+ * import * as e3 from "@elaraai/e3";
154
+ *
155
+ * const thresholdInput = e3.input("threshold", FloatType, 38.0);
156
+ *
157
+ * // Mirrors `dataBindStaged` in test/data.examples.ts.
158
+ * const dataBindStaged = East.function([], UIComponentType, _$ => {
159
+ * return Reactive.Root(East.function([], UIComponentType, $ => {
160
+ * const view = $.let(Data.bind(thresholdInput));
161
+ * const value = $.let(view.read(), FloatType);
162
+ * return Slider.Root(value, {
163
+ * min: 30.0, max: 60.0, step: 1.0,
164
+ * onChangeEnd: East.function([FloatType], NullType, ($, v) => {
165
+ * $(view.write(v));
166
+ * }),
167
+ * });
168
+ * }));
169
+ * });
170
+ * ```
171
+ */
172
+ function bindData(dataset, options) {
173
+ // A TaskDef binds its output dataset; a DatasetDef binds itself.
174
+ const def = dataset.kind === 'task' ? dataset.output : dataset;
175
+ // Source / patch paths come from the defs, so they are statically known
176
+ // by construction — manifest derivation (`deriveManifest`) needs each as
177
+ // a single literal `Value` IR node, which `East.value(...)` forces.
178
+ const sourceValue = East.value(def.path, TreePathType);
179
+ const modeValue = East.value(variant(options?.mode ?? "staged", null), DataBindModeType);
180
+ const patchValue = options?.patch === undefined
181
+ ? East.value(none, OptionType(TreePathType))
182
+ : East.value(some(options.patch.path), OptionType(TreePathType));
183
+ return bindPlatformFn([def.type], sourceValue, patchValue, modeValue);
184
+ }
107
185
  /**
108
186
  * The Data namespace — reactive dataset binding for e3 UI tasks.
109
187
  *
@@ -116,80 +194,6 @@ export const bindPlatformFn = East.genericPlatform("data_bind", ["T"], [TreePath
116
194
  * datasets change.
117
195
  */
118
196
  export const Data = {
119
- /**
120
- * Bind a dataset path to a reactive view of its current value, with
121
- * optional local staging or a separate server-backed patch dataset.
122
- *
123
- * @typeParam T - The East type of the source dataset value.
124
- * @param types - Single-element type-args tuple `[T]`.
125
- * @param source - The source dataset path.
126
- * @param options - {@link DataBindOptions}. When omitted, defaults to
127
- * `{ mode: "staged" }` (no separate patch dataset, edits buffered
128
- * locally until commit).
129
- * @returns A handle struct described by {@link DataBindHandleType} —
130
- * `read` / `write` / `writeAndStart` / `source` / `pending` /
131
- * `commit` / `discard` / `has` / `status` / `binding`.
132
- *
133
- * @remarks
134
- * Per-mode semantics matrix (rows are `mode × patch`, columns are
135
- * methods):
136
- *
137
- * | mode | patch | `read()` | `write(v)` | `commit()` | `discard()` | `pending()` |
138
- * |---------|---------|-------------------------------------|-----------------------------------------|-----------------------------------------------------|------------------------------|---------------------|
139
- * | direct | absent | source | dataset write | no-op | no-op | always false |
140
- * | direct | present | apply(source, patch dataset) | write diff(source, v) → patch dataset | apply patch → source; clear patch dataset | clear patch dataset | patch non-trivial |
141
- * | staged | absent | buffered ?? source | update buffer (pin snapshot first time) | apply buffer → source; drop buffer | drop buffer | buffer non-empty |
142
- * | staged | present | buffered ?? apply(source, patch) | update buffer | write diff(source, buffer) → patch dataset; drop buffer | drop buffer (patch intact) | buffer non-empty |
143
- *
144
- * `writeAndStart(v)` kicks the workspace dataflow after the write — only
145
- * meaningful for `mode = "direct"` without a `patch` dataset; in other
146
- * modes it falls back to `write(v)` (the workspace dataflow is triggered
147
- * on `commit` instead).
148
- *
149
- * The `binding` field surfaces this binding's descriptor as a
150
- * {@link DiffBindingType} value — pass it directly to
151
- * {@link Diff.Root}'s `bindings` array to surface the in-flight change
152
- * in a Diff card.
153
- *
154
- * Use inside `Reactive.Root` so `read` / `pending` / `status` re-fire
155
- * on every dataset or staging-buffer change.
156
- *
157
- * @example
158
- * ```ts
159
- * import { East, FloatType, NullType } from "@elaraai/east";
160
- * import { Reactive, Slider, UIComponentType } from "@elaraai/east-ui";
161
- * import { Data, Diff } from "@elaraai/e3-ui";
162
- * import * as e3 from "@elaraai/e3";
163
- *
164
- * const thresholdInput = e3.input("threshold", FloatType, 38.0);
165
- *
166
- * // Mirrors `dataBindStaged` in test/data.examples.ts.
167
- * const dataBindStaged = East.function([], UIComponentType, _$ => {
168
- * return Reactive.Root(East.function([], UIComponentType, $ => {
169
- * const view = $.let(Data.bind([FloatType], thresholdInput.path));
170
- * const value = $.let(view.read(), FloatType);
171
- * return Slider.Root(value, {
172
- * min: 30.0, max: 60.0, step: 1.0,
173
- * onChangeEnd: East.function([FloatType], NullType, ($, v) => {
174
- * $(view.write(v));
175
- * }),
176
- * });
177
- * }));
178
- * });
179
- * ```
180
- */
181
- bind(types, source, options) {
182
- // Source / patch paths must be statically known so manifest
183
- // derivation (`deriveManifest`) can preload them. We wrap each
184
- // explicitly via `East.value(...)` to force a single literal
185
- // `Value` IR node — the only IR shape `derive.ts` needs to
186
- // handle.
187
- const sourceValue = East.value(source, TreePathType);
188
- const modeValue = East.value(variant(options?.mode ?? "staged", null), DataBindModeType);
189
- const patchValue = options?.patch === undefined
190
- ? East.value(none, OptionType(TreePathType))
191
- : East.value(some(options.patch), OptionType(TreePathType));
192
- return bindPlatformFn(types, sourceValue, patchValue, modeValue);
193
- },
197
+ bind: bindData,
194
198
  };
195
199
  //# sourceMappingURL=data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/data.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EACH,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,UAAU,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M,IAAI,GAAG;IAChB,IAAI,EAAE,QAAQ;CACR,CAAC"}
@@ -52,7 +52,7 @@ export type CommitStateType = typeof CommitStateType;
52
52
  /**
53
53
  * Build the judgements dataset type for a constraint contract — staged
54
54
  * judgements keyed by case id. Bind it with
55
- * `Data.bind([Decision.Types.Judgements(Contract)], judgementsInput.path)`.
55
+ * `Data.bind(judgementsInput)`.
56
56
  */
57
57
  export declare function judgementsType<C extends EastType = DecisionConstraintType>(constraint?: C): DictType<StringType, StructType<{
58
58
  readonly caseId: StringType;
@@ -4549,10 +4549,10 @@ export declare const decisionBindPlatformFn: import("@elaraai/east").GenericPlat
4549
4549
  * Options for {@link decisionBind}.
4550
4550
  *
4551
4551
  * @property decisions - The bound decision views — one
4552
- * `Data.bind([ArrayType(Decision.Types.Decision)], …)` handle per
4552
+ * `Data.bind(…)` handle per
4553
4553
  * reasoning task (source ⊕ patch each)
4554
4554
  * @property judgements - The bound judgements view —
4555
- * `Data.bind([Decision.Types.Judgements(Contract)], …)` (the staged
4555
+ * `Data.bind(…)` (the staged
4556
4556
  * operator input)
4557
4557
  * @property slice - Optional initial state for the handle-owned slice over
4558
4558
  * the queue (`Slice.state({ filters: [...] })`). Seeded once; the
@@ -4584,8 +4584,8 @@ export interface DecisionBindOptions<C extends EastType = DecisionConstraintType
4584
4584
  *
4585
4585
  * @example
4586
4586
  * ```tsx
4587
- * const rosterView = $.let(Data.bind([ArrayType(Decision.Types.Decision)], rosterOut.path, { patch: rosterPatch.path }));
4588
- * const judgementsView = $.let(Data.bind([Decision.Types.Judgements(RosterConstraint)], judgementsInput.path));
4587
+ * const rosterView = $.let(Data.bind(rosterOut, { patch: rosterPatch }));
4588
+ * const judgementsView = $.let(Data.bind(judgementsInput));
4589
4589
  * const handle = $.let(Decision.bind([RosterConstraint], { decisions: [rosterView], judgements: judgementsView }));
4590
4590
  * ```
4591
4591
  */
@@ -56,7 +56,7 @@ export const CommitStateType = VariantType({
56
56
  /**
57
57
  * Build the judgements dataset type for a constraint contract — staged
58
58
  * judgements keyed by case id. Bind it with
59
- * `Data.bind([Decision.Types.Judgements(Contract)], judgementsInput.path)`.
59
+ * `Data.bind(judgementsInput)`.
60
60
  */
61
61
  export function judgementsType(constraint) {
62
62
  return DictType(StringType, judgementInputType(constraint));
@@ -7,7 +7,8 @@
7
7
  *
8
8
  * Finds every `Data.bind(...)` platform call (the walker recurses into
9
9
  * nested `FunctionIR` bodies) and reads its source + (optional) patch
10
- * path arguments.
10
+ * path arguments, plus every `Func.bind(...)` platform call and reads
11
+ * its literal function name.
11
12
  *
12
13
  * Both arguments are required to be statically known JS-side
13
14
  * `TreePath`s — the public `Data.bind` factory enforces this through
@@ -1 +1 @@
1
- {"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/derive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAA8C,MAAM,eAAe,CAAC;AAGpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAKlD,yDAAyD;AACzD,wBAAgB,cAAc,CAC1B,EAAE,EAAE;IAAE,IAAI,IAAI;QAAE,EAAE,EAAE,EAAE,CAAA;KAAE,CAAA;CAAE,GAC3B,YAAY,CA4Bd"}
1
+ {"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/derive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAA8C,MAAM,eAAe,CAAC;AAGpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQlD,yDAAyD;AACzD,wBAAgB,cAAc,CAC1B,EAAE,EAAE;IAAE,IAAI,IAAI;QAAE,EAAE,EAAE,EAAE,CAAA;KAAE,CAAA;CAAE,GAC3B,YAAY,CAiCd"}
@@ -5,13 +5,20 @@
5
5
  import { variant, walkIR, literalValueOf } from '@elaraai/east';
6
6
  /** Platform-fn name we extract paths from. */
7
7
  const DATA_BIND = "data_bind";
8
+ /** Platform-fn name we extract bound function names from. */
9
+ const FUNCTION_BIND = "function_bind";
8
10
  /** Walk `fn`'s IR and derive its bound-path manifest. */
9
11
  export function deriveManifest(fn) {
10
12
  const paths = [];
13
+ const functions = [];
11
14
  walkIR(fn.toIR().ir, (node) => {
12
15
  if (node.type !== 'Platform')
13
16
  return;
14
17
  const platform = node;
18
+ if (platform.value.name === FUNCTION_BIND) {
19
+ functions.push(readFunctionName(platform.value.arguments[0]));
20
+ return;
21
+ }
15
22
  if (platform.value.name !== DATA_BIND)
16
23
  return;
17
24
  // arg[0] — source: always a NewArray of Variant("field", Value(string)).
@@ -30,7 +37,22 @@ export function deriveManifest(fn) {
30
37
  throw new Error(`Data.bind: patch variant tag must be "some" or "none"; got "${patchVariant.case}".`);
31
38
  }
32
39
  });
33
- return { paths: dedupePaths(paths) };
40
+ return { paths: dedupePaths(paths), functions: [...new Set(functions)] };
41
+ }
42
+ /**
43
+ * Read a literal function name from a `Value` IR node — the only shape
44
+ * `Func.bind` produces (its TS signature requires a JS string).
45
+ */
46
+ function readFunctionName(ir) {
47
+ if (ir.type !== 'Value') {
48
+ throw new Error(`Func.bind: the function name must be a literal string; got dynamic IR (${ir.type}). ` +
49
+ `Pass a JS string, not a computed expression.`);
50
+ }
51
+ const name = literalValueOf(ir);
52
+ if (typeof name !== 'string') {
53
+ throw new Error(`Func.bind: the function name must be a string literal; got ${typeof name}.`);
54
+ }
55
+ return name;
34
56
  }
35
57
  /**
36
58
  * Read a literal `TreePath` from a `NewArray` IR node. Each element is
@@ -1 +1 @@
1
- {"version":3,"file":"derive.js","sourceRoot":"","sources":["../../src/derive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIhE,8CAA8C;AAC9C,MAAM,SAAS,GAAG,WAAW,CAAC;AAE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MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACpB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,SAAS;QAC1B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACZ,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -271,7 +271,7 @@ export declare const Diff: {
271
271
  * // Mirrors `diffDefaults` in test/diff.examples.ts (wired via Assert.examples).
272
272
  * const diffDefaults = East.function([], UIComponentType, _$ => {
273
273
  * return Reactive.Root(East.function([], UIComponentType, $ => {
274
- * const view = $.let(Data.bind([FloatType], maxWeeklyHoursInput.path));
274
+ * const view = $.let(Data.bind(maxWeeklyHoursInput));
275
275
  * return Diff.Root({ bindings: [view.binding] });
276
276
  * }));
277
277
  * });
package/dist/src/diff.js CHANGED
@@ -162,7 +162,7 @@ export const Diff = {
162
162
  * // Mirrors `diffDefaults` in test/diff.examples.ts (wired via Assert.examples).
163
163
  * const diffDefaults = East.function([], UIComponentType, _$ => {
164
164
  * return Reactive.Root(East.function([], UIComponentType, $ => {
165
- * const view = $.let(Data.bind([FloatType], maxWeeklyHoursInput.path));
165
+ * const view = $.let(Data.bind(maxWeeklyHoursInput));
166
166
  * return Diff.Root({ bindings: [view.binding] });
167
167
  * }));
168
168
  * });