@valancex/valance 0.2.1 → 0.4.0

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 CHANGED
@@ -1,33 +1,36 @@
1
1
  # @valancex/valance
2
2
 
3
- The application-composition boundary over [NEXUS](https://github.com/ValanceX/Nexus) (behavior), [MESH](https://github.com/ValanceX/Mesh) (template semantics) and [PORT](https://github.com/ValanceX/Port) (target realization): one application, one NEXUS state, a view derived from it, MESH programs rendered to a PORT target.
3
+ Build an interactive application whose state lives in one place, whose screen is a function of that state, and whose only way to change anything is a command. One application, one state, a view derived from it, drawn in a page, on a server, or not at all. (Built on [NEXUS](https://github.com/ValanceX/Nexus), [MESH](https://github.com/ValanceX/Mesh) and [PORT](https://github.com/ValanceX/Port); you do not need to know them to start.)
4
+
5
+ **Documentation:** [Learn](https://github.com/ValanceX/Valance/blob/main/docs/learn/README.md) (start here) · [Use](https://github.com/ValanceX/Valance/blob/main/docs/use/README.md) (API reference and the contract) · [Understand](https://github.com/ValanceX/Valance/blob/main/docs/understand/README.md) (architecture and evidence).
4
6
 
5
7
  ```ts
6
- import * as Valance from "@valancex/valance"; // define, start, mount, hydrate (+ ApplicationHandle, Mounted, TargetFactory)
7
- import * as Web from "@valancex/valance/web"; // Web.target, Web.history (needs @valancex/port-web)
8
+ import * as Valance from "@valancex/valance"; // define, command, entry, start, mount, hydrate (+ ApplicationHandle, Mounted, TargetFactory)
9
+ import * as Web from "@valancex/valance/web"; // Web.run, Web.target, Web.history (needs @valancex/port-web)
8
10
  import { renderToHtml } from "@valancex/valance/web/server";
9
11
  ```
10
12
 
11
13
  - **Install** (a strict package manager resolves only what you declare, so declare the application-level and build-time packages yourself):
12
14
 
13
15
  ```console
14
- $ pnpm add @valancex/valance @valancex/nexus@^0.10.2 @valancex/mesh-runtime@^0.8.0 @valancex/port-web@^0.2.3 effect@^3.10.0
15
- $ pnpm add -D @valancex/mesh-compiler@^0.8.0
16
+ $ pnpm add @valancex/valance @valancex/nexus@^0.10.3 @valancex/mesh-runtime@^0.9.0 @valancex/port-web@^0.2.4 effect@^3.10.0
17
+ $ pnpm add -D @valancex/mesh-compiler@^0.9.0
16
18
  ```
17
19
 
18
20
  | Package | Range | Role |
19
21
  |---|---|---|
20
22
  | `@valancex/valance` | the release you target | this package |
21
- | `@valancex/nexus` | `^0.10.2` | **application-level**: your commands, state handles and capabilities are written against it. Also this package's own dependency, so use the same range and one copy is shared |
22
- | `@valancex/mesh-runtime` | `^0.8.0` | peer: renders programs at run time |
23
- | `@valancex/port-web` | `^0.2.3` | optional peer: needed for `./web` and `./web/server` |
23
+ | `@valancex/nexus` | `^0.10.3` | **application-level**: your commands, state handles and capabilities are written against it. Also this package's own dependency, so use the same range and one copy is shared |
24
+ | `@valancex/mesh-runtime` | `^0.8.0 \|\| ^0.9.0` | peer: renders programs at run time (the one runtime: NEXUS 0.10.3 shares it) |
25
+ | `@valancex/port-web` | `^0.2.4` | optional peer: needed for `./web` and `./web/server` |
24
26
  | `effect` | `^3.10.0` | peer |
25
- | `@valancex/mesh-compiler` | `^0.8.0` | **build time only** (devDependency): compiles MPRX to the `program` each view takes |
27
+ | `@valancex/mesh-compiler` | `^0.9.0` | **build time only** (devDependency): compiles MPRX to the `program` each view takes (`compileProgram`) |
26
28
 
29
+ - **Async work and startup:** a command can wait; once admitted it belongs to the application, and closing the application cancels it. Loading and failure are ordinary state. The optional `start` field of `define` names a command the application runs once when it starts (added in 0.4.0). See [Async work](https://github.com/ValanceX/Valance/blob/main/docs/learn/async-work.md) and [Startup work](https://github.com/ValanceX/Valance/blob/main/docs/learn/startup-work.md).
27
30
  - **Lifetimes:** the application, each mount and each history live in separate, caller-owned `Scope`s; closing one never closes another. Closing the application's `Scope` ends commits (state stays readable); mounts then end inert.
28
31
  - **Presentation:** a mount presents committed state as a latest-state consumer: it may skip superseded intermediate states and converges on the latest. Same view is an `update`, another view a `draw`; `hydrate` takes over server markup and then behaves like `mount`. A mount's failure is local to it; recovery is a fresh mount.
29
32
  - **History:** `Web.history` follows committed state and runs the application's own navigate command on popstate; it owns its listener's `Scope` only.
30
33
  - **Status:** pre-1.0. `./internal` is the composition protocol for binding authors and tests, unstable by design.
31
- - **The contract:** [`docs/V1_CONTRACT.md`](https://github.com/ValanceX/Valance/blob/main/docs/V1_CONTRACT.md) states what VALANCE guarantees, what the caller owns and what is not guaranteed. Engineering constraints: [`docs/CONSTRAINTS.md`](https://github.com/ValanceX/Valance/blob/main/docs/CONSTRAINTS.md). Historical investigation record: [`docs/FINDINGS.md`](https://github.com/ValanceX/Valance/blob/main/docs/FINDINGS.md). Release notes: [`docs/releases/v0.2.1.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.2.1.md) (current), [`v0.2.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.2.md), [`v0.1.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.1.md).
34
+ - **The contract:** [`docs/V1_CONTRACT.md`](https://github.com/ValanceX/Valance/blob/main/docs/V1_CONTRACT.md) states what VALANCE guarantees, what the caller owns and what is not guaranteed. Engineering constraints: [`docs/CONSTRAINTS.md`](https://github.com/ValanceX/Valance/blob/main/docs/CONSTRAINTS.md). Historical investigation record: [`docs/FINDINGS.md`](https://github.com/ValanceX/Valance/blob/main/docs/FINDINGS.md). Release notes: [`docs/releases/v0.3.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.3.md) (current), [`v0.2.1.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.2.1.md), [`v0.2.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.2.md), [`v0.1.md`](https://github.com/ValanceX/Valance/blob/main/docs/releases/v0.1.md).
32
35
 
33
36
  MIT licensed.
package/dist/index.d.ts CHANGED
@@ -5,7 +5,8 @@
5
5
  *
6
6
  * define(app) data: program, state, scope, command bindings. No target, no platform.
7
7
  * start(app, options) starts the NEXUS application in the CALLER's Scope; supplies the platform;
8
- * creates the application's state and its MESH host; returns the application's handle:
8
+ * creates the application's state and its MESH host; checks that every event the views' programs declare has
9
+ * a command-table key (MESH says what is declared; Contract §2); returns the application's handle:
9
10
  * its `state` and `invoke`, and nothing of the composition (see ./internal).
10
11
  * mount / hydrate connects a PORT target to a started application: draws (or adopts server
11
12
  * server output for) the current render, follows later renders as updates, and
@@ -17,7 +18,7 @@
17
18
  * Nothing here is target-specific. A target is whatever satisfies `Target`, which is PORT's
18
19
  * contract (draw / update / unmount, plus hydrate where a PORT has one) and nothing more.
19
20
  */
20
- import type { BoundaryValue, RenderTree } from "@valancex/mesh-runtime";
21
+ import type { BoundaryValue, RenderTree, SourceSpan } from "@valancex/mesh-runtime";
21
22
  import * as Nexus from "@valancex/nexus";
22
23
  import { type DispatchExit } from "./internal.js";
23
24
  import { Effect, Exit, Schema, Scope } from "effect";
@@ -30,12 +31,21 @@ export interface View<S> {
30
31
  /** State → the program root's scope values, shaped to the manifest. */
31
32
  readonly scope: (state: S) => Record<string, unknown>;
32
33
  }
34
+ /**
35
+ * What `commands` holds, by the shape of the key:
36
+ *
37
+ * `"component/name"` a binding (`entry(...)`), for exactly that component and command.
38
+ * `name` a NEXUS command, for every declared `component/name` whose name it is, and for `"app/name"`.
39
+ *
40
+ * Both forms may be mixed in one table. An exact `"component/name"` key always wins over a bare name for that declaration (see `ApplicationDefinition.commands`).
41
+ */
42
+ export type CommandTable<E, R extends Ambient> = Readonly<Record<string, Nexus.Mesh.Binding<E, R> | Nexus.Command.Command<any, any, E, R>>>;
33
43
  export interface ApplicationDefinition<S, E, R extends Ambient, V extends string> {
34
44
  readonly name: string;
35
45
  /** The application's one NEXUS state. `initial` is the default; `start` may be given another (hydration). */
36
46
  readonly state: {
37
47
  readonly schema: Schema.Schema<S>;
38
- readonly initial: S;
48
+ readonly initial: NoInfer<S>;
39
49
  };
40
50
  /** The MESH programs the application can show. The application's state outlives a change of program. */
41
51
  readonly views: {
@@ -43,11 +53,43 @@ export interface ApplicationDefinition<S, E, R extends Ambient, V extends string
43
53
  };
44
54
  /** Which program the current state shows. A function of application state: what the active view is, is the application's. */
45
55
  readonly view: (state: S) => V;
46
- /** Behavior: NEXUS commands over the state, bound to MESH command intents ("component/name"), for every view. */
47
- readonly commands: (state: Nexus.State.StateHandle<S>) => Readonly<Record<string, Nexus.Mesh.Binding<E, R>>>;
56
+ /**
57
+ * Behavior, for every view: a function of the application's state that returns the table. A key is one of two forms:
58
+ *
59
+ * - **`"component/name"`** binds exactly that declared event's command: `entry(command, input?)`, as always. `"app/name"` is the same form, for `invoke` and history.
60
+ * - **a bare `name`** is a NEXUS command (`command(state)(…)` or `Command.define`). It is bound to every declared `component/name` whose `name` it is, and to `"app/name"`.
61
+ *
62
+ * **Resolution**, for each declared `component/name` and for each `app/name`: the exact key in the table wins; otherwise the bare `name` is used; otherwise there is
63
+ * no command, and `start` fails with `ConformanceViolation` (declared events) or the key is `UnmappedCommand` (everything else). One rule, no other precedence.
64
+ *
65
+ * **Arguments of a bare command.** If its input is a struct, the arguments an event (or `invoke`) supplies are its fields **in the struct's field order**: the first
66
+ * argument is the first field, and so on. An argument the event does not supply is `undefined` (so a required field then fails validation), and arguments beyond the
67
+ * fields are ignored. The event's own parameter names are not used. If its input is not a struct, the first argument is the whole input. The input is validated by the
68
+ * command's schema as always. (A single object argument is not unpacked into fields.)
69
+ *
70
+ * A bare name must hold a command object. A function there (such as an `entry`) is a mistake and `start` dies with a defect naming it.
71
+ */
72
+ readonly commands: (state: Nexus.State.StateHandle<S>) => CommandTable<E, R>;
73
+ /**
74
+ * The key of a command-table entry (an exact `"component/name"` key, or a bare command name, which means `"app/name"`) that `start` runs, once, with no arguments, as the application's own command: admitted before `start` returns, owned
75
+ * by the application's registry like any admitted command (closing the Scope interrupts and awaits it before NEXUS terminates), with no caller. Its exit is
76
+ * not reported anywhere: work that can fail catches the failure into state, as an event command does. A key the table lacks fails `start` with `UnmappedCommand`.
77
+ */
78
+ readonly start?: string;
48
79
  }
49
- /** The definition, typed. An application is data: defining one starts nothing. */
50
- export declare const define: <S, E, R extends Ambient, V extends string>(definition: ApplicationDefinition<S, E, R, V>) => ApplicationDefinition<S, E, R, V>;
80
+ /** The failures a table can raise: the union over every command (and binding) in it, exactly. */
81
+ type ErrorOf<V> = V extends Nexus.Command.Command<any, any, infer Err, any> ? Err : V extends Nexus.Mesh.Binding<infer Err, any> ? Err : never;
82
+ /** The services a table needs: the union over every command (and binding) in it. */
83
+ type RequirementOf<V> = V extends Nexus.Command.Command<any, any, any, infer Req> ? Req : V extends Nexus.Mesh.Binding<any, infer Req> ? Req : never;
84
+ /**
85
+ * The definition, typed. An application is data: defining one starts nothing. `E` is the union of every failure in the command table (each command may fail
86
+ * differently), plus `CommandValidationError`: every command's input is validated, and a table of bare command names (which have no `entry` to carry it)
87
+ * would otherwise claim that failure cannot happen. `R` is the union of the services the table needs. Both are read from the table's own type, so no command's
88
+ * failure is narrowed to another's.
89
+ */
90
+ export declare const define: <S, T extends CommandTable<any, Ambient>, V extends string>(definition: Omit<ApplicationDefinition<S, never, never, V>, "commands"> & {
91
+ readonly commands: (state: Nexus.State.StateHandle<S>) => T;
92
+ }) => ApplicationDefinition<S, ErrorOf<T[keyof T]> | Nexus.Command.CommandValidationError, Extract<RequirementOf<T[keyof T]>, Ambient>, V>;
51
93
  /**
52
94
  * Binds the application's state, and returns the function that makes commands whose whole behavior is a pure transition of it:
53
95
  * `transition` receives the validated input and the current state, and returns the next state. The input is validated by `input`
@@ -55,6 +97,7 @@ export declare const define: <S, E, R extends Ambient, V extends string>(definit
55
97
  *
56
98
  * const command = Valance.command(state);
57
99
  * const add = command(Schema.Struct({ amount: Schema.Number }), ({ amount }, current) => ({ ...current, count: current.count + amount }));
100
+ * const increment = command((current) => ({ ...current, count: current.count + 1 })); // no input: the same as `command(Schema.Struct({}), (_input, current) => …)`
58
101
  *
59
102
  * It is the trusted, atomic writer of Contract §3, not the validating one: the result is committed AS RETURNED, without being checked
60
103
  * against the state's schema, and concurrent transitions all land. (It is `state.update`, never `state.set`.)
@@ -68,7 +111,10 @@ export declare const define: <S, E, R extends Ambient, V extends string>(definit
68
111
  * transition together cannot do this: TypeScript then types the returned literals from a type parameter of that same call, and widens them.)
69
112
  * A returned object is not checked for excess properties, the same as returning it from `state.update`.
70
113
  */
71
- export declare const command: <S>(state: Nexus.State.StateHandle<S>) => (<I>(input: Schema.Schema<I>, transition: (input: I, current: S) => S) => Nexus.Command.Command<I, void, never, never>);
114
+ export declare const command: <S>(state: Nexus.State.StateHandle<S>) => {
115
+ (transition: (current: S) => S): Nexus.Command.Command<{}, void, never, never>;
116
+ <I>(input: Schema.Schema<I>, transition: (input: I, current: S) => S): Nexus.Command.Command<I, void, never, never>;
117
+ };
72
118
  /**
73
119
  * An entry's behavior: it runs the command `run`, with the input `input` makes from the entry's arguments, as plain values in order (an absent
74
120
  * argument is `undefined`). Without `input` the command is given `{}`, the input of a command that takes none. `input`'s result is
@@ -79,7 +125,32 @@ export declare const command: <S>(state: Nexus.State.StateHandle<S>) => (<I>(inp
79
125
  * (`invoke`, history) is keyed `"app/..."`. Both are resolved in the one table, and an unknown key is the typed `UnmappedCommand`.
80
126
  */
81
127
  export declare const entry: <I, O, E, R>(run: Nexus.Command.Command<I, O, E, R>, input?: (...values: ReadonlyArray<unknown>) => unknown) => Nexus.Mesh.Binding<E | Nexus.Command.CommandValidationError, R>;
82
- export type StartError = Nexus.Application.ApplicationInitError | Nexus.State.StateInitError;
128
+ /**
129
+ * One event a view's program declares whose `component/command` key the application's command table lacks. `key`, `component` and `command`
130
+ * are MESH's declaration; `view` is the application's name for the program; `span` is MESH's, in the source of `component`'s template (it names no file).
131
+ */
132
+ export interface UnmappedDeclaration {
133
+ readonly view: string;
134
+ readonly component: string;
135
+ readonly event: string;
136
+ readonly command: string;
137
+ readonly key: string;
138
+ readonly span: SourceSpan;
139
+ }
140
+ /**
141
+ * `start`'s conformance failure (D ⊆ B, Contract §2): every event the programs of ALL the application's views declare needs an entry in the command table.
142
+ * `missing` lists each declaration whose key is absent: in the order of the definition's views, then MESH's order. It says only that a key is absent: nothing
143
+ * about a command, a binding, arguments or success.
144
+ */
145
+ export type ConformanceViolation = {
146
+ readonly _tag: "ConformanceViolation";
147
+ readonly missing: ReadonlyArray<UnmappedDeclaration>;
148
+ };
149
+ /**
150
+ * Why `start` yields no handle: NEXUS's state and platform failures; the diagnostics MESH reports for a view's program (the first view, in the definition's order,
151
+ * that has any: they depend on the program alone, never on state); or the conformance failure.
152
+ */
153
+ export type StartError = Nexus.Application.ApplicationInitError | Nexus.State.StateInitError | Nexus.Mesh.MeshDiagnostics | ConformanceViolation | Nexus.Mesh.UnmappedCommand;
83
154
  export interface StartOptions<S> {
84
155
  /** Supplied to NEXUS `Application.start`, where platform services (capabilities, Clock, …) enter. */
85
156
  readonly platform?: Nexus.Application.Platform;
@@ -166,4 +237,5 @@ export declare const mount: <S, E>(application: ApplicationHandle<S, E>, create:
166
237
  export declare const hydrate: <S, E, H>(application: ApplicationHandle<S, E>, create: TargetFactory<HydratableTarget<H>>) => Effect.Effect<Mounted<E> & {
167
238
  readonly hydration: H;
168
239
  }, Nexus.Mesh.MeshDiagnostics, Scope.Scope>;
240
+ export {};
169
241
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAuB,KAAK,YAAY,EAA6B,MAAM,eAAe,CAAC;AAClG,OAAO,EAAY,MAAM,EAAE,IAAI,EAAgB,MAAM,EAAE,KAAK,EAAU,MAAM,QAAQ,CAAC;AAErF,mGAAmG;AACnG,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa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IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/E;AA4FD;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,CAAC,EAAE,aAAa,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,aAAa,CAAC,MAAM,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,KAAK,CACxC,CAAC;AAE5H;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;CAAE,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,KAAK,CAChE,CAAC"}
package/dist/index.js CHANGED
@@ -1,10 +1,18 @@
1
+ import { declaredEvents } from "@valancex/mesh-runtime";
1
2
  import * as Nexus from "@valancex/nexus";
2
3
  import { handleOf, runningOf } from "./internal.js";
3
- import { Deferred, Effect, Exit, Fiber, Layer, Stream } from "effect";
4
- /** The definition, typed. An application is data: defining one starts nothing. */
4
+ import { Deferred, Effect, Exit, Fiber, Layer, Schema, Stream } from "effect";
5
+ /**
6
+ * The definition, typed. An application is data: defining one starts nothing. `E` is the union of every failure in the command table (each command may fail
7
+ * differently), plus `CommandValidationError`: every command's input is validated, and a table of bare command names (which have no `entry` to carry it)
8
+ * would otherwise claim that failure cannot happen. `R` is the union of the services the table needs. Both are read from the table's own type, so no command's
9
+ * failure is narrowed to another's.
10
+ */
5
11
  export const define = (definition) => definition;
6
12
  /** The diagnostic id of a command made by `command`: it has no author-chosen id, and the id only decorates `CommandValidationError.command`. */
7
13
  const TRANSITION_COMMAND = "valance.command";
14
+ /** The input of a command that takes none. */
15
+ const NO_INPUT = Schema.Struct({});
8
16
  /**
9
17
  * Binds the application's state, and returns the function that makes commands whose whole behavior is a pure transition of it:
10
18
  * `transition` receives the validated input and the current state, and returns the next state. The input is validated by `input`
@@ -12,6 +20,7 @@ const TRANSITION_COMMAND = "valance.command";
12
20
  *
13
21
  * const command = Valance.command(state);
14
22
  * const add = command(Schema.Struct({ amount: Schema.Number }), ({ amount }, current) => ({ ...current, count: current.count + amount }));
23
+ * const increment = command((current) => ({ ...current, count: current.count + 1 })); // no input: the same as `command(Schema.Struct({}), (_input, current) => …)`
15
24
  *
16
25
  * It is the trusted, atomic writer of Contract §3, not the validating one: the result is committed AS RETURNED, without being checked
17
26
  * against the state's schema, and concurrent transitions all land. (It is `state.update`, never `state.set`.)
@@ -25,7 +34,26 @@ const TRANSITION_COMMAND = "valance.command";
25
34
  * transition together cannot do this: TypeScript then types the returned literals from a type parameter of that same call, and widens them.)
26
35
  * A returned object is not checked for excess properties, the same as returning it from `state.update`.
27
36
  */
28
- export const command = (state) => (input, transition) => Nexus.Command.define(TRANSITION_COMMAND, input, (decoded) => Effect.asVoid(state.update((current) => Effect.sync(() => transition(decoded, current)))));
37
+ export const command = (state) => {
38
+ const make = (input, transition) => Nexus.Command.define(TRANSITION_COMMAND, input, (decoded) => Effect.asVoid(state.update((current) => Effect.sync(() => transition(decoded, current)))));
39
+ // The one-argument form is the two-argument form with the empty input: the same `Command`, validated, admitted and run in the same way.
40
+ return ((a, b) => b === undefined
41
+ ? make(NO_INPUT, (_input, current) => a(current))
42
+ : make(a, b));
43
+ };
44
+ /** The field names of a command's struct input, in order; `undefined` when the input is not a struct. */
45
+ const fieldsOf = (schema) => {
46
+ let ast = schema.ast;
47
+ while (ast._tag === "Refinement") {
48
+ ast = ast.from;
49
+ }
50
+ return ast._tag === "TypeLiteral" ? ast.propertySignatures.map((property) => String(property.name)) : undefined;
51
+ };
52
+ /** The binding of a bare command name: the arguments are the struct's fields in order, or the whole input when the input is not a struct. */
53
+ const bareBinding = (command) => {
54
+ const fields = fieldsOf(command.input);
55
+ return entry(command, (...values) => fields === undefined ? values[0] : Object.fromEntries(fields.map((field, index) => [field, values[index]])));
56
+ };
29
57
  /** What an entry's argument is to the application: the value itself, or `undefined` when the argument is absent. */
30
58
  const plain = (argument) => "value" in argument ? argument.value : undefined;
31
59
  /**
@@ -57,7 +85,49 @@ export const start = (app, options = {}) => Effect.gen(function* () {
57
85
  return Effect.forEach([...admitted], (command) => Fiber.interrupt(command), { discard: true }); // interrupts, and awaits each ACTUAL exit
58
86
  }));
59
87
  const state = yield* Nexus.Application.createState(nexus, app.state.schema, options.state ?? app.state.initial);
60
- const commands = app.commands(state);
88
+ const given = app.commands(state);
89
+ // Conformance, D ⊆ B (Contract §2). B is the table's own keys. D is what MESH says the programs of EVERY view declare (unselected views, inactive
90
+ // conditional branches and repeated bodies included): VALANCE asks MESH and reads no program. A program MESH rejects has no declared events, so it fails
91
+ // `start` first (its diagnostics do not depend on state), and D ⊆ B is evaluated only for a complete D. A MESH package failure is a defect, as in a render.
92
+ const declared = [];
93
+ for (const [view, { program }] of Object.entries(app.views)) {
94
+ const result = yield* Effect.promise(() => declaredEvents({ program: { root: program.root, templates: program.templates }, model: program.model }));
95
+ if (result.diagnostics !== undefined) {
96
+ return yield* Effect.fail({ _tag: "MeshDiagnostics", diagnostics: result.diagnostics });
97
+ }
98
+ declared.push(...result.events.map((event) => ({ view, event })));
99
+ }
100
+ // The table every later step uses: exact keys as given, then bare names bound where an exact key is absent (the rule on `ApplicationDefinition.commands`).
101
+ // Built from D, which is already known, so the registry, the hosts, `invoke` and conformance see ONE plain table of exact keys.
102
+ const commands = {};
103
+ const named = new Map();
104
+ for (const [key, value] of Object.entries(given)) {
105
+ if (key.includes("/")) {
106
+ commands[key] = value;
107
+ }
108
+ else if (typeof value === "function") {
109
+ throw new Error(`VALANCE: "${key}" is a bare command name, so it must hold a command; a binding (entry) belongs under a "component/name" key`);
110
+ }
111
+ else {
112
+ named.set(key, bareBinding(value));
113
+ }
114
+ }
115
+ for (const [name, binding] of named) {
116
+ commands[`app/${name}`] ??= binding;
117
+ }
118
+ for (const { event } of declared) {
119
+ const bound = named.get(event.command);
120
+ if (bound !== undefined) {
121
+ commands[`${event.component}/${event.command}`] ??= bound;
122
+ }
123
+ }
124
+ const missing = declared.flatMap(({ view, event }) => {
125
+ const key = `${event.component}/${event.command}`;
126
+ return Object.hasOwn(commands, key) ? [] : [{ view, component: event.component, event: event.event, command: event.command, key, span: event.span }];
127
+ });
128
+ if (missing.length > 0) {
129
+ return yield* Effect.fail({ _tag: "ConformanceViolation", missing });
130
+ }
61
131
  // One host per view, used to dispatch (render, handler) → intent → command. The one NEXUS state is shared by all of them.
62
132
  const hosts = new Map(Object.entries(app.views).map(([name, view]) => [name, Nexus.Mesh.host({ program: view.program, scope: Nexus.Selector.define(state, view.scope), commands })]));
63
133
  // The render of one given state. The adapter renders a host's scope value, not a value it is handed, and a
@@ -103,6 +173,18 @@ export const start = (app, options = {}) => Effect.gen(function* () {
103
173
  return binding === undefined ? Effect.fail({ _tag: "UnmappedCommand", component, name }) : inApplication(binding(args));
104
174
  },
105
175
  };
176
+ // Start-time work: the SAME admission as `invoke` and dispatch, with no caller. Last step before the handle exists, after every failure `start` can have, so a
177
+ // failed start runs nothing. The fiber registers itself first (`admit`); a Scope close that wins the race finds admission closed and the work dies unrun.
178
+ // `Effect.exit` keeps its exit from being an unhandled fiber failure: nobody joins it.
179
+ if (app.start !== undefined) {
180
+ const startKey = app.start.includes("/") ? app.start : `app/${app.start}`;
181
+ const binding = Object.hasOwn(commands, startKey) ? commands[startKey] : undefined;
182
+ const [component = "", name = ""] = startKey.split("/");
183
+ if (binding === undefined) {
184
+ return yield* Effect.fail({ _tag: "UnmappedCommand", component, name });
185
+ }
186
+ Nexus.Runtime.runFork(nexus.runtime, Effect.exit(admit(binding([]))));
187
+ }
106
188
  return handleOf(running);
107
189
  });
108
190
  const connect = (application, create, first) => Effect.gen(function* () {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAgD,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAiB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAyBrF,kFAAkF;AAClF,MAAM,CAAC,MAAM,MAAM,GAAG,CAA4C,UAA6C,EAAqC,EAAE,CAAC,UAAU,CAAC;AAElK,gJAAgJ;AAChJ,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,KAAiC,EAA2H,EAAE,CACvL,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjL,oHAAoH;AACpH,MAAM,KAAK,GAAG,CAAC,QAAmC,EAAW,EAAE,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAEjH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,GAAsC,EACt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AAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAErG,OAAO;QACL,KAAK,EAAE,MAAM;QACb,UAAU;QACV,OAAO;QACP,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;KAChC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAO,WAAoC,EAAE,MAA6B,EAAsE,EAAE,CACrK,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;AAE5H;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAU,WAAoC,EAAE,MAA0C,EAAkG,EAAE,CACnN,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valancex/valance",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "VALANCE application composition: starts a NEXUS application, renders it with MESH, and realizes it on a PORT target.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,11 +38,11 @@
38
38
  "dist"
39
39
  ],
40
40
  "dependencies": {
41
- "@valancex/nexus": "^0.10.2"
41
+ "@valancex/nexus": "^0.10.3"
42
42
  },
43
43
  "peerDependencies": {
44
- "@valancex/mesh-runtime": "^0.8.0",
45
- "@valancex/port-web": "^0.2.3",
44
+ "@valancex/mesh-runtime": "^0.8.0 || ^0.9.0",
45
+ "@valancex/port-web": "^0.2.4",
46
46
  "effect": "^3.10.0"
47
47
  },
48
48
  "peerDependenciesMeta": {
@@ -52,8 +52,9 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^22.0.0",
55
- "@valancex/mesh-runtime": "^0.8.0",
56
- "@valancex/port-web": "^0.2.3",
55
+ "@valancex/mesh-compiler": "^0.9.0",
56
+ "@valancex/mesh-runtime": "^0.9.0",
57
+ "@valancex/port-web": "^0.2.4",
57
58
  "effect": "^3.10.0",
58
59
  "typescript": "^5.6.0",
59
60
  "vitest": "^3.2.0"