@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
@@ -0,0 +1,272 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Reactive function binding for e3 UI tasks — call a named package
7
+ * function (`e3.function`) from East UI code, RPC-style.
8
+ *
9
+ * `Func.bind` is the function-shaped sibling of `Data.bind`: it returns a
10
+ * handle whose `call` launches the workspace-scoped function
11
+ * fire-and-forget from any sync UI callback, while `read` / `status` /
12
+ * `error` / `pending` observe the call lifecycle reactively inside
13
+ * `Reactive.Root`. See `libs/e3/design/e3-ui-functions.md`.
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ import { ArrayType, BooleanType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType, VariantType, type EastType, type ExprType } from '@elaraai/east';
18
+ import type { FunctionDef } from '@elaraai/e3';
19
+ /**
20
+ * Tracked-call lifecycle for a bound function.
21
+ *
22
+ * @remarks
23
+ * Client-defined — the sync-only function surface has no server-side call
24
+ * state. `idle` means the function has never been launched through this
25
+ * binding; `cancelled` means the client stopped waiting (via `cancel()` or
26
+ * a superseding `call`) — the server still ran the call to completion or
27
+ * its deadline.
28
+ *
29
+ * @property idle - Never launched
30
+ * @property running - A call is in flight
31
+ * @property succeeded - The most recent call returned a value (see `read`)
32
+ * @property failed - The most recent call failed (see `error`)
33
+ * @property cancelled - The client stopped waiting for the most recent call
34
+ */
35
+ export declare const FuncStatusType: VariantType<{
36
+ readonly idle: NullType;
37
+ readonly running: NullType;
38
+ readonly succeeded: NullType;
39
+ readonly failed: NullType;
40
+ readonly cancelled: NullType;
41
+ }>;
42
+ /**
43
+ * Type representing the FuncStatus structure.
44
+ */
45
+ export type FuncStatusType = typeof FuncStatusType;
46
+ /**
47
+ * Failure detail for a bound function call, mirroring the server's
48
+ * `ExecuteResult` outcome arms plus client-side transport errors.
49
+ *
50
+ * @remarks
51
+ * `stdout` / `stderr` ride along exactly as the server returns them
52
+ * (already truncated server-side); they are empty for `transport`
53
+ * failures, which never reached an execution.
54
+ *
55
+ * @property kind - Which way the call failed:
56
+ * `failed` (runner exited non-zero), `invalid` (argument or signature
57
+ * diagnostics), `too_large` (result exceeded the server limit),
58
+ * `timed_out` (server deadline hit), `transport` (HTTP/decode failure).
59
+ * @property message - One-line human-readable summary, always present
60
+ * @property stdout - Captured runner stdout (may be truncated)
61
+ * @property stderr - Captured runner stderr (may be truncated)
62
+ */
63
+ export declare const FuncErrorType: StructType<{
64
+ readonly kind: VariantType<{
65
+ readonly failed: StructType<{
66
+ readonly exitCode: IntegerType;
67
+ }>;
68
+ readonly invalid: StructType<{
69
+ readonly diagnostics: ArrayType<StringType>;
70
+ }>;
71
+ readonly too_large: StructType<{
72
+ readonly bytes: IntegerType;
73
+ readonly limit: IntegerType;
74
+ }>;
75
+ readonly timed_out: StructType<{
76
+ readonly ms: IntegerType;
77
+ }>;
78
+ readonly transport: StructType<{
79
+ readonly message: StringType;
80
+ }>;
81
+ }>;
82
+ readonly message: StringType;
83
+ readonly stdout: StringType;
84
+ readonly stderr: StringType;
85
+ }>;
86
+ /**
87
+ * Type representing the FuncError structure.
88
+ */
89
+ export type FuncErrorType = typeof FuncErrorType;
90
+ /**
91
+ * Descriptor for a function binding — carried on the handle's `binding`
92
+ * field for inspector surfaces.
93
+ *
94
+ * @property name - The bound function's name in the deployed package
95
+ */
96
+ export declare const FuncBindingType: StructType<{
97
+ readonly name: StringType;
98
+ }>;
99
+ /**
100
+ * Type representing the FuncBinding structure.
101
+ */
102
+ export type FuncBindingType = typeof FuncBindingType;
103
+ /**
104
+ * The struct returned by every {@link Func.bind} call. All closures are
105
+ * sync — the call's async effects happen behind the platform and are
106
+ * observed reactively.
107
+ *
108
+ * @remarks
109
+ * The field set is deliberately the function-shaped subset of
110
+ * `DataBindHandleType`'s vocabulary — `read` / `status` / `pending` mean
111
+ * the same kind of thing they mean on a dataset binding, plus the
112
+ * call-specific `call` / `error` / `cancel`. The value types live
113
+ * structurally in the `call` / `read` signatures, so a component requiring
114
+ * a specific {@link BoundFunc} rejects handles bound to any other
115
+ * signature at compile time.
116
+ *
117
+ * @param inputs - Positional parameter East types.
118
+ * @param output - Return East type.
119
+ * @returns The handle StructType for that signature.
120
+ *
121
+ * @property call - The one entry point: launch the function with these
122
+ * arguments, fire-and-forget, returning null immediately — callable from
123
+ * any sync UI callback. Latest-wins: calling while a call is in flight
124
+ * abandons the previous one.
125
+ * @property read - Last successful result; `none` until the first
126
+ * `succeeded` call, then survives until the next launch overwrites it.
127
+ * @property status - Lifecycle of the most recent `call` — see
128
+ * {@link FuncStatusType}.
129
+ * @property error - Last failure detail; `none` unless status is `failed`.
130
+ * @property pending - True while a call is in flight (== status `running`).
131
+ * @property cancel - Stop waiting for the in-flight call (no-op when idle
132
+ * or terminal). Client-side only: the server runs the call to completion
133
+ * or its deadline regardless; the late response is discarded.
134
+ * @property binding - Descriptor for this binding — see
135
+ * {@link FuncBindingType}.
136
+ */
137
+ export declare const FuncBindHandleType: <I extends EastType[], O extends EastType>(inputs: [...I], output: O) => StructType<{
138
+ readonly call: FunctionType<[...I], NullType>;
139
+ readonly read: FunctionType<[], OptionType<O>>;
140
+ readonly status: FunctionType<[], VariantType<{
141
+ readonly idle: NullType;
142
+ readonly running: NullType;
143
+ readonly succeeded: NullType;
144
+ readonly failed: NullType;
145
+ readonly cancelled: NullType;
146
+ }>>;
147
+ readonly error: FunctionType<[], OptionType<StructType<{
148
+ readonly kind: VariantType<{
149
+ readonly failed: StructType<{
150
+ readonly exitCode: IntegerType;
151
+ }>;
152
+ readonly invalid: StructType<{
153
+ readonly diagnostics: ArrayType<StringType>;
154
+ }>;
155
+ readonly too_large: StructType<{
156
+ readonly bytes: IntegerType;
157
+ readonly limit: IntegerType;
158
+ }>;
159
+ readonly timed_out: StructType<{
160
+ readonly ms: IntegerType;
161
+ }>;
162
+ readonly transport: StructType<{
163
+ readonly message: StringType;
164
+ }>;
165
+ }>;
166
+ readonly message: StringType;
167
+ readonly stdout: StringType;
168
+ readonly stderr: StringType;
169
+ }>>>;
170
+ readonly pending: FunctionType<[], BooleanType>;
171
+ readonly cancel: FunctionType<[], NullType>;
172
+ readonly binding: StructType<{
173
+ readonly name: StringType;
174
+ }>;
175
+ }>;
176
+ /**
177
+ * The TypeScript type of a {@link Func.bind} handle bound to the signature
178
+ * `(...Inputs) => Output` — i.e. the return of
179
+ * `Func.bind([[...Inputs], Output], name)`.
180
+ *
181
+ * @remarks
182
+ * The signature lives in the East type itself (the `call` / `read` field
183
+ * types), not a phantom TS brand, so it survives `$.let` / `$.const` and
184
+ * ordinary expression plumbing.
185
+ *
186
+ * @typeParam I - Positional parameter East types.
187
+ * @typeParam O - Return East type.
188
+ */
189
+ export type BoundFunc<I extends EastType[], O extends EastType> = ExprType<ReturnType<typeof FuncBindHandleType<I, O>>>;
190
+ /**
191
+ * The underlying `Func.bind` platform-function definition. End-users
192
+ * should call {@link Func.bind} (the typed factory in this module);
193
+ * runtime implementations register against this raw definition via
194
+ * `funcBindPlatformFn.implement(...)`.
195
+ *
196
+ * @remarks
197
+ * Generic over `H`, the fully-instantiated handle struct — the handle's
198
+ * shape IS the signature (runtimes recover the input types from the `call`
199
+ * field and the output type from `read`), so there are no duplicate
200
+ * signature arguments to drift out of sync.
201
+ */
202
+ export declare const funcBindPlatformFn: import("@elaraai/east").GenericPlatformDefinition<readonly ["H"], readonly [StringType], "H">;
203
+ /**
204
+ * Bind an `e3.function` to a reactive call handle.
205
+ *
206
+ * Takes the {@link FunctionDef} returned by `e3.function` — the binding's
207
+ * name, parameter types and return type are all taken from the def, the
208
+ * same way task wiring takes a dataset's path and type from its
209
+ * `DatasetDef`. The binding is correct by construction: it cannot drift
210
+ * from the deployed function's signature, because both come from the same
211
+ * object.
212
+ *
213
+ * @typeParam Inputs - Positional parameter East types (from the def).
214
+ * @typeParam Output - Return East type (from the def).
215
+ * @param fn - The `e3.function` definition to bind.
216
+ * @returns A handle struct described by {@link FuncBindHandleType} —
217
+ * `call` / `read` / `status` / `error` / `pending` / `cancel` /
218
+ * `binding`.
219
+ *
220
+ * @remarks
221
+ * The launch/observe split is the same shape `Data.bind` uses for
222
+ * `write` (sync IR, async effects behind the platform): `call` never
223
+ * blocks, and everything you'd want back from the call arrives through
224
+ * `read` / `status` / `error` on the next reactive render. All handles
225
+ * bound to the same function in the same workspace share one tracked
226
+ * channel — one component can launch while another renders the spinner.
227
+ *
228
+ * @example
229
+ * ```ts
230
+ * import { East, FloatType, IntegerType, NullType } from "@elaraai/east";
231
+ * import { Button, Reactive, Stat, UIComponentType, VStack } from "@elaraai/east-ui";
232
+ * import { Func } from "@elaraai/e3-ui";
233
+ * import e3 from "@elaraai/e3";
234
+ *
235
+ * const forecastFn = e3.function('forecast',
236
+ * East.function([IntegerType, FloatType], FloatType, ($, periods, growth) => ...));
237
+ *
238
+ * // Mirrors `funcBindCall` in test/func/func.examples.tsx.
239
+ * const funcBindCall = East.function([], UIComponentType, _$ => {
240
+ * return Reactive.Root(East.function([], UIComponentType, $ => {
241
+ * const forecast = $.let(Func.bind(forecastFn));
242
+ * const run = $.const(East.function([], NullType, $ => {
243
+ * $(forecast.call(12n, 1.05));
244
+ * }));
245
+ * return VStack.Root([
246
+ * Button.Root("Run forecast", { onClick: run, loading: forecast.pending() }),
247
+ * Stat.Root({ label: "Forecast", value: East.print(forecast.read()) }),
248
+ * ], { gap: "3" });
249
+ * }));
250
+ * });
251
+ * ```
252
+ */
253
+ declare function bindFunction<Inputs extends EastType[], Output extends EastType>(fn: FunctionDef<Inputs, Output>): BoundFunc<Inputs, Output>;
254
+ /**
255
+ * The Func namespace — reactive function (RPC) binding for e3 UI tasks.
256
+ *
257
+ * @remarks
258
+ * `Func.bind` binds a named function in the workspace's deployed package
259
+ * (`e3.function`) to a call handle: `call` launches it fire-and-forget,
260
+ * and `read` / `status` / `error` / `pending` observe the call lifecycle.
261
+ * An `e3.function` is a *bounded* RPC — the server enforces a wall-clock
262
+ * deadline and a result-size limit on the sync call path; long compute
263
+ * belongs in dataflow tasks (`Data.bind`'s `writeAndStart`).
264
+ *
265
+ * Use inside `Reactive.Root` for reactive re-rendering as the call
266
+ * progresses.
267
+ */
268
+ export declare const Func: {
269
+ readonly bind: typeof bindFunction;
270
+ };
271
+ export {};
272
+ //# sourceMappingURL=func.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"func.d.ts","sourceRoot":"","sources":["../../src/func.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAEH,SAAS,EACT,WAAW,EACX,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,KAAK,QAAQ,EACb,KAAK,QAAQ,EAChB,MAAM,eAAe,CAAC;A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;GAaG;AACH,eAAO,MAAM,IAAI;;CAEP,CAAC"}
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Reactive function binding for e3 UI tasks — call a named package
7
+ * function (`e3.function`) from East UI code, RPC-style.
8
+ *
9
+ * `Func.bind` is the function-shaped sibling of `Data.bind`: it returns a
10
+ * handle whose `call` launches the workspace-scoped function
11
+ * fire-and-forget from any sync UI callback, while `read` / `status` /
12
+ * `error` / `pending` observe the call lifecycle reactively inside
13
+ * `Reactive.Root`. See `libs/e3/design/e3-ui-functions.md`.
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ import { East, ArrayType, BooleanType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType, VariantType, } from '@elaraai/east';
18
+ // ============================================================================
19
+ // Status + error types
20
+ // ============================================================================
21
+ /**
22
+ * Tracked-call lifecycle for a bound function.
23
+ *
24
+ * @remarks
25
+ * Client-defined — the sync-only function surface has no server-side call
26
+ * state. `idle` means the function has never been launched through this
27
+ * binding; `cancelled` means the client stopped waiting (via `cancel()` or
28
+ * a superseding `call`) — the server still ran the call to completion or
29
+ * its deadline.
30
+ *
31
+ * @property idle - Never launched
32
+ * @property running - A call is in flight
33
+ * @property succeeded - The most recent call returned a value (see `read`)
34
+ * @property failed - The most recent call failed (see `error`)
35
+ * @property cancelled - The client stopped waiting for the most recent call
36
+ */
37
+ export const FuncStatusType = VariantType({
38
+ idle: NullType,
39
+ running: NullType,
40
+ succeeded: NullType,
41
+ failed: NullType,
42
+ cancelled: NullType,
43
+ });
44
+ /**
45
+ * Failure detail for a bound function call, mirroring the server's
46
+ * `ExecuteResult` outcome arms plus client-side transport errors.
47
+ *
48
+ * @remarks
49
+ * `stdout` / `stderr` ride along exactly as the server returns them
50
+ * (already truncated server-side); they are empty for `transport`
51
+ * failures, which never reached an execution.
52
+ *
53
+ * @property kind - Which way the call failed:
54
+ * `failed` (runner exited non-zero), `invalid` (argument or signature
55
+ * diagnostics), `too_large` (result exceeded the server limit),
56
+ * `timed_out` (server deadline hit), `transport` (HTTP/decode failure).
57
+ * @property message - One-line human-readable summary, always present
58
+ * @property stdout - Captured runner stdout (may be truncated)
59
+ * @property stderr - Captured runner stderr (may be truncated)
60
+ */
61
+ export const FuncErrorType = StructType({
62
+ kind: VariantType({
63
+ failed: StructType({ exitCode: IntegerType }),
64
+ invalid: StructType({ diagnostics: ArrayType(StringType) }),
65
+ too_large: StructType({ bytes: IntegerType, limit: IntegerType }),
66
+ timed_out: StructType({ ms: IntegerType }),
67
+ transport: StructType({ message: StringType }),
68
+ }),
69
+ message: StringType,
70
+ stdout: StringType,
71
+ stderr: StringType,
72
+ });
73
+ /**
74
+ * Descriptor for a function binding — carried on the handle's `binding`
75
+ * field for inspector surfaces.
76
+ *
77
+ * @property name - The bound function's name in the deployed package
78
+ */
79
+ export const FuncBindingType = StructType({
80
+ name: StringType,
81
+ });
82
+ // ============================================================================
83
+ // Bind handle — return type of `Func.bind`.
84
+ // ============================================================================
85
+ /**
86
+ * The struct returned by every {@link Func.bind} call. All closures are
87
+ * sync — the call's async effects happen behind the platform and are
88
+ * observed reactively.
89
+ *
90
+ * @remarks
91
+ * The field set is deliberately the function-shaped subset of
92
+ * `DataBindHandleType`'s vocabulary — `read` / `status` / `pending` mean
93
+ * the same kind of thing they mean on a dataset binding, plus the
94
+ * call-specific `call` / `error` / `cancel`. The value types live
95
+ * structurally in the `call` / `read` signatures, so a component requiring
96
+ * a specific {@link BoundFunc} rejects handles bound to any other
97
+ * signature at compile time.
98
+ *
99
+ * @param inputs - Positional parameter East types.
100
+ * @param output - Return East type.
101
+ * @returns The handle StructType for that signature.
102
+ *
103
+ * @property call - The one entry point: launch the function with these
104
+ * arguments, fire-and-forget, returning null immediately — callable from
105
+ * any sync UI callback. Latest-wins: calling while a call is in flight
106
+ * abandons the previous one.
107
+ * @property read - Last successful result; `none` until the first
108
+ * `succeeded` call, then survives until the next launch overwrites it.
109
+ * @property status - Lifecycle of the most recent `call` — see
110
+ * {@link FuncStatusType}.
111
+ * @property error - Last failure detail; `none` unless status is `failed`.
112
+ * @property pending - True while a call is in flight (== status `running`).
113
+ * @property cancel - Stop waiting for the in-flight call (no-op when idle
114
+ * or terminal). Client-side only: the server runs the call to completion
115
+ * or its deadline regardless; the late response is discarded.
116
+ * @property binding - Descriptor for this binding — see
117
+ * {@link FuncBindingType}.
118
+ */
119
+ export const FuncBindHandleType = (inputs, output) => StructType({
120
+ call: FunctionType(inputs, NullType),
121
+ read: FunctionType([], OptionType(output)),
122
+ status: FunctionType([], FuncStatusType),
123
+ error: FunctionType([], OptionType(FuncErrorType)),
124
+ pending: FunctionType([], BooleanType),
125
+ cancel: FunctionType([], NullType),
126
+ binding: FuncBindingType,
127
+ });
128
+ // ============================================================================
129
+ // Platform function — single generic over the instantiated handle type.
130
+ // ============================================================================
131
+ /**
132
+ * The underlying `Func.bind` platform-function definition. End-users
133
+ * should call {@link Func.bind} (the typed factory in this module);
134
+ * runtime implementations register against this raw definition via
135
+ * `funcBindPlatformFn.implement(...)`.
136
+ *
137
+ * @remarks
138
+ * Generic over `H`, the fully-instantiated handle struct — the handle's
139
+ * shape IS the signature (runtimes recover the input types from the `call`
140
+ * field and the output type from `read`), so there are no duplicate
141
+ * signature arguments to drift out of sync.
142
+ */
143
+ export const funcBindPlatformFn = East.genericPlatform("function_bind", ["H"], [StringType], "H", { optional: true });
144
+ // ============================================================================
145
+ // User-facing factory.
146
+ // ============================================================================
147
+ /**
148
+ * Bind an `e3.function` to a reactive call handle.
149
+ *
150
+ * Takes the {@link FunctionDef} returned by `e3.function` — the binding's
151
+ * name, parameter types and return type are all taken from the def, the
152
+ * same way task wiring takes a dataset's path and type from its
153
+ * `DatasetDef`. The binding is correct by construction: it cannot drift
154
+ * from the deployed function's signature, because both come from the same
155
+ * object.
156
+ *
157
+ * @typeParam Inputs - Positional parameter East types (from the def).
158
+ * @typeParam Output - Return East type (from the def).
159
+ * @param fn - The `e3.function` definition to bind.
160
+ * @returns A handle struct described by {@link FuncBindHandleType} —
161
+ * `call` / `read` / `status` / `error` / `pending` / `cancel` /
162
+ * `binding`.
163
+ *
164
+ * @remarks
165
+ * The launch/observe split is the same shape `Data.bind` uses for
166
+ * `write` (sync IR, async effects behind the platform): `call` never
167
+ * blocks, and everything you'd want back from the call arrives through
168
+ * `read` / `status` / `error` on the next reactive render. All handles
169
+ * bound to the same function in the same workspace share one tracked
170
+ * channel — one component can launch while another renders the spinner.
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * import { East, FloatType, IntegerType, NullType } from "@elaraai/east";
175
+ * import { Button, Reactive, Stat, UIComponentType, VStack } from "@elaraai/east-ui";
176
+ * import { Func } from "@elaraai/e3-ui";
177
+ * import e3 from "@elaraai/e3";
178
+ *
179
+ * const forecastFn = e3.function('forecast',
180
+ * East.function([IntegerType, FloatType], FloatType, ($, periods, growth) => ...));
181
+ *
182
+ * // Mirrors `funcBindCall` in test/func/func.examples.tsx.
183
+ * const funcBindCall = East.function([], UIComponentType, _$ => {
184
+ * return Reactive.Root(East.function([], UIComponentType, $ => {
185
+ * const forecast = $.let(Func.bind(forecastFn));
186
+ * const run = $.const(East.function([], NullType, $ => {
187
+ * $(forecast.call(12n, 1.05));
188
+ * }));
189
+ * return VStack.Root([
190
+ * Button.Root("Run forecast", { onClick: run, loading: forecast.pending() }),
191
+ * Stat.Root({ label: "Forecast", value: East.print(forecast.read()) }),
192
+ * ], { gap: "3" });
193
+ * }));
194
+ * });
195
+ * ```
196
+ */
197
+ function bindFunction(fn) {
198
+ const handleType = FuncBindHandleType([...fn.inputTypes], fn.outputType);
199
+ // The name must be a single literal Value IR node — the only shape
200
+ // manifest derivation (`derive.ts`) handles. `fn.name` is a static JS
201
+ // string at IR-build time, so this holds by construction.
202
+ const nameValue = East.value(fn.name, StringType);
203
+ return funcBindPlatformFn([handleType], nameValue);
204
+ }
205
+ /**
206
+ * The Func namespace — reactive function (RPC) binding for e3 UI tasks.
207
+ *
208
+ * @remarks
209
+ * `Func.bind` binds a named function in the workspace's deployed package
210
+ * (`e3.function`) to a call handle: `call` launches it fire-and-forget,
211
+ * and `read` / `status` / `error` / `pending` observe the call lifecycle.
212
+ * An `e3.function` is a *bounded* RPC — the server enforces a wall-clock
213
+ * deadline and a result-size limit on the sync call path; long compute
214
+ * belongs in dataflow tasks (`Data.bind`'s `writeAndStart`).
215
+ *
216
+ * Use inside `Reactive.Root` for reactive re-rendering as the call
217
+ * progresses.
218
+ */
219
+ export const Func = {
220
+ bind: bindFunction,
221
+ };
222
+ //# sourceMappingURL=func.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"func.js","sourceRoot":"","sources":["../../src/func.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EACH,IAAI,EACJ,SAAS,EACT,WAAW,EACX,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,GAGd,MAAM,eAAe,CAAC;AAGvB,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;IACtC,IAAI,EAAO,QAAQ;IACnB,OAAO,EAAI,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAK,QAAQ;IACnB,SAAS,EAAE,QAAQ;CACtB,CAAC,CAAC;AAOH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,WAAW,CAAC;QACd,MAAM,EAAK,UAAU,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;QAChD,OAAO,EAAI,UAAU,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7D,SAAS,EAAE,UAA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EAAE,CACrB,CAAC;AAEF,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,SAAS,YAAY,CACjB,EAA+B;IAE/B,MAAM,UAAU,GAAG,kBAAkB,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC;IACzE,mEAAmE;IACnE,sEAAsE;IACtE,0DAA0D;IAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAClD,OAAO,kBAAkB,CAAC,CAAC,UAAU,CAAC,EAAE,SAAS,CAA8B,CAAC;AACpF,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,IAAI,EAAE,YAAY;CACZ,CAAC"}
@@ -10,6 +10,7 @@
10
10
  * - `<Diff>` — review pending changes for any combination of bindings.
11
11
  * - `<Ontology>` — graph editor over an `OntologyType`-bound dataset.
12
12
  * - `Data.bind` — workspace-scoped reactive dataset binding.
13
+ * - `Func.bind` — workspace-scoped named-function (RPC) call binding.
13
14
  * - `ui()` — declare a first-class UI task.
14
15
  *
15
16
  * east-ui tags (`<VStack>`, `<Text>`, …) are imported from `@elaraai/east-ui`
@@ -24,13 +25,14 @@
24
25
  * @packageDocumentation
25
26
  */
26
27
  export { Data, DataBindModeType, type DataBindModeLiteral, DiffBindingType, type BoundValue, DataBindHandleType, type DataBindOptions, bindPlatformFn, } from './data.js';
28
+ export { Func, FuncStatusType, FuncErrorType, FuncBindingType, FuncBindHandleType, type BoundFunc, funcBindPlatformFn, } from './func.js';
27
29
  export { DataManifestType, type DataManifest, encodeManifest, decodeManifest } from './manifest.js';
28
30
  export { deriveManifest } from './derive.js';
29
31
  export { ui } from './ui.js';
30
32
  export { Diff } from './runtime/diff.js';
31
33
  export { DiffPayloadType, DiffStyleType, type DiffOptions, } from './diff.js';
32
34
  export { Ontology } from './runtime/ontology.js';
33
- export { OntologyPayloadType, OntologyStyleType, type OntologyOptions, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, } from './ontology.js';
35
+ export { OntologyPayloadType, OntologyStyleType, type OntologyOptions, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, type OntologyStructType, OntologyViewType, type OntologyViewLiteral, } from './ontology.js';
34
36
  export { Decision } from './decision/index.js';
35
37
  export { DecisionType, DecisionOptionType, UrgencyType, type UrgencyLiteral, StakesLevelType, type StakesLevelLiteral, EvidenceType, AnswerType, type AnswerLiteral, VerdictType, ReferenceType, JudgementInputType, DecisionConstraintType, PromptType, LeverType, judgementInputType, type PromptInput, type LeverInput, type DecisionInput, type DecisionOptionInput, type EvidenceInput, type DecisionReferenceInput, type DecisionJudgementInput, } from './decision/types.js';
36
38
  export { decisionBind, decisionBindPlatformFn, DecisionHandleType, DecisionHandleRefType, CommitStateType, JudgementsType, type DecisionHandle, type DecisionBindOptions, } from './decision/bind.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACH,IAAI,EACJ,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,eAAe,EACf,KAAK,UAAU,EACf,kBAAkB,EAClB,KAAK,eAAe,EACpB,cAAc,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAG7B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACH,e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AK,sBAAsB,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/src/index.js CHANGED
@@ -10,6 +10,7 @@
10
10
  * - `<Diff>` — review pending changes for any combination of bindings.
11
11
  * - `<Ontology>` — graph editor over an `OntologyType`-bound dataset.
12
12
  * - `Data.bind` — workspace-scoped reactive dataset binding.
13
+ * - `Func.bind` — workspace-scoped named-function (RPC) call binding.
13
14
  * - `ui()` — declare a first-class UI task.
14
15
  *
15
16
  * east-ui tags (`<VStack>`, `<Text>`, …) are imported from `@elaraai/east-ui`
@@ -24,6 +25,7 @@
24
25
  * @packageDocumentation
25
26
  */
26
27
  export { Data, DataBindModeType, DiffBindingType, DataBindHandleType, bindPlatformFn, } from './data.js';
28
+ export { Func, FuncStatusType, FuncErrorType, FuncBindingType, FuncBindHandleType, funcBindPlatformFn, } from './func.js';
27
29
  export { DataManifestType, encodeManifest, decodeManifest } from './manifest.js';
28
30
  export { deriveManifest } from './derive.js';
29
31
  export { ui } from './ui.js';
@@ -32,7 +34,7 @@ export { Diff } from './runtime/diff.js';
32
34
  export { DiffPayloadType, DiffStyleType, } from './diff.js';
33
35
  // e3 `<Ontology>` tag + its types
34
36
  export { Ontology } from './runtime/ontology.js';
35
- export { OntologyPayloadType, OntologyStyleType, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, } from './ontology.js';
37
+ export { OntologyPayloadType, OntologyStyleType, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, OntologyViewType, } from './ontology.js';
36
38
  // Decision platform types + factory
37
39
  export { Decision } from './decision/index.js';
38
40
  export { DecisionType, DecisionOptionType, UrgencyType, StakesLevelType, EvidenceType, AnswerType, VerdictType, ReferenceType, JudgementInputType, DecisionConstraintType, PromptType, LeverType, judgementInputType, } from './decision/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACH,IAAI,EACJ,gBAAgB,EAEhB,eAAe,EAEf,kBAAkB,EAElB,cAAc,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAqB,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACH,eAAe,EACf,aAAa,GAEhB,MAAM,WAAW,CAAC;AAEnB,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EAEjB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,YAAY,GACf,MAAM,eAAe,CAAC;AAEvB,oCAAoC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,WAAW,EAEX,eAAe,EAEf,YAAY,EACZ,UAAU,EAEV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,kBAAkB,G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,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,WAAW,EAEX,eAAe,EAEf,YAAY,EACZ,UAAU,EAEV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,kBAAkB,GAQrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,cAAc,GAGjB,MAAM,oBAAoB,CAAC;AAC5B,0DAA0D;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAA6B,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAA+B,MAAM,uBAAuB,CAAC"}
@@ -16,10 +16,11 @@
16
16
  * @packageDocumentation
17
17
  */
18
18
  export { Data, DataBindModeType, type DataBindModeLiteral, DiffBindingType, type BoundValue, DataBindHandleType, type DataBindOptions, bindPlatformFn, } from './data.js';
19
+ export { Func, FuncStatusType, FuncErrorType, FuncBindingType, FuncBindHandleType, type BoundFunc, funcBindPlatformFn, } from './func.js';
19
20
  export { DataManifestType, type DataManifest, encodeManifest, decodeManifest } from './manifest.js';
20
21
  export { deriveManifest } from './derive.js';
21
22
  export { Diff, DiffComponent, DiffPayloadType, DiffStyleType, type DiffOptions, } from './diff.js';
22
- export { Ontology, OntologyComponent, OntologyPayloadType, OntologyStyleType, type OntologyOptions, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, } from './ontology.js';
23
+ export { Ontology, OntologyComponent, OntologyPayloadType, OntologyStyleType, type OntologyOptions, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, type OntologyStructType, OntologyViewType, type OntologyViewLiteral, } from './ontology.js';
23
24
  export { Decision } from './decision/index.js';
24
25
  export { DecisionType, DecisionOptionType, UrgencyType, type UrgencyLiteral, StakesLevelType, type StakesLevelLiteral, EvidenceType, AnswerType, type AnswerLiteral, VerdictType, ReferenceType, JudgementInputType, DecisionConstraintType, PromptType, LeverType, judgementInputType, type PromptInput, type LeverInput, type DecisionInput, type DecisionOptionInput, type EvidenceInput, type DecisionReferenceInput, type DecisionJudgementInput, } from './decision/types.js';
25
26
  export { decisionBind, decisionBindPlatformFn, DecisionHandleType, DecisionHandleRefType, CommitStateType, JudgementsType, type DecisionHandle, type DecisionBindOptions, } from './decision/bind.js';
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EACH,IAAI,EACJ,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,eAAe,EACf,KAAK,UAAU,EACf,kBAAkB,EAClB,KAAK,eAAe,EACpB,cAAc,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACH,IAAI,EACJ,aAAa,EACb,eAAe,EACf,aAAa,EACb,KAAK,WAAW,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,eAAe,EACpB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,KAAK,cAAc,EACnB,eAAe,EACf,KAAK,kBAAkB,EACvB,YAAY,EACZ,UAAU,EACV,KAAK,aAAa,EAClB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,oBAAoB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,eAAe,EACf,wBAAwB,EACxB,0BAA0B,EAC1B,KAAK,sBAAsB,GAC9B,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EACH,IAAI,EACJ,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,eAAe,EACf,KAAK,UAAU,EACf,kBAAkB,EAClB,KAAK,eAAe,EACpB,cAAc,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,IAAI,EACJ,cAAc,EACd,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,KAAK,SAAS,EACd,kBAAkB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,KAAK,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACH,IAAI,EACJ,aAAa,EACb,eAAe,EACf,aAAa,EACb,KAAK,WAAW,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,eAAe,EACpB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,YAAY,EACZ,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,mBAAmB,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,KAAK,cAAc,EACnB,eAAe,EACf,KAAK,kBAAkB,EACvB,YAAY,EACZ,UAAU,EACV,KAAK,aAAa,EAClB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,oBAAoB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,eAAe,EACf,wBAAwB,EACxB,0BAA0B,EAC1B,KAAK,sBAAsB,GAC9B,MAAM,uBAAuB,CAAC"}
@@ -16,10 +16,11 @@
16
16
  * @packageDocumentation
17
17
  */
18
18
  export { Data, DataBindModeType, DiffBindingType, DataBindHandleType, bindPlatformFn, } from './data.js';
19
+ export { Func, FuncStatusType, FuncErrorType, FuncBindingType, FuncBindHandleType, funcBindPlatformFn, } from './func.js';
19
20
  export { DataManifestType, encodeManifest, decodeManifest } from './manifest.js';
20
21
  export { deriveManifest } from './derive.js';
21
22
  export { Diff, DiffComponent, DiffPayloadType, DiffStyleType, } from './diff.js';
22
- export { Ontology, OntologyComponent, OntologyPayloadType, OntologyStyleType, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, } from './ontology.js';
23
+ export { Ontology, OntologyComponent, OntologyPayloadType, OntologyStyleType, NodeKindType, LinkKindType, NodeType, LinkType, OntologyMetadataType, OntologyType, OntologyViewType, } from './ontology.js';
23
24
  export { Decision } from './decision/index.js';
24
25
  export { DecisionType, DecisionOptionType, UrgencyType, StakesLevelType, EvidenceType, AnswerType, VerdictType, ReferenceType, JudgementInputType, DecisionConstraintType, PromptType, LeverType, judgementInputType, } from './decision/types.js';
25
26
  export { decisionBind, decisionBindPlatformFn, DecisionHandleType, DecisionHandleRefType, CommitStateType, JudgementsType, } from './decision/bind.js';
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EACH,IAAI,EACJ,gBAAgB,EAEhB,eAAe,EAEf,kBAAkB,EAElB,cAAc,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAqB,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACH,IAAI,EACJ,aAAa,EACb,eAAe,EACf,aAAa,GAEhB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,QAAQ,EACR,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EAEjB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,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