@junejuly-lockstep/model 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JuneJuly Health
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,38 @@
1
- # Temporary Holding Version
1
+ # @junejuly-lockstep/model
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The zod schemas and TypeScript types every Lockstep package shares: the journey model (XState v5
4
+ machine plus per-state `meta`), `lockstep.config.ts` (`LockstepConfig`), the run payload the
5
+ reconciler posts, verdicts, cards, and every API request and response shape. This is the only place
6
+ payload shapes live; the platform API and the `@junejuly-lockstep/reconciler` CLI both import it, so a
7
+ payload change is one PR touching both sides.
8
+
9
+ ESM only, Node 20.18 or newer. The package has no side effects.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pnpm add @junejuly-lockstep/model
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ts
20
+ import { readFileSync } from 'node:fs';
21
+ import { LockstepConfig, RunPayload } from '@junejuly-lockstep/model';
22
+
23
+ // Validate a client config the way the reconciler does (defaults are filled in).
24
+ const config = LockstepConfig.parse({
25
+ projectKey: 'FERN',
26
+ apiBaseUrl: 'https://api.lockstep.example',
27
+ seams: ['Client app', 'Edge', 'API layer', 'Service', 'Data', 'Notifications'],
28
+ bootCommand: 'pnpm start',
29
+ port: 3100,
30
+ });
31
+
32
+ // Every schema is also a type (`RunPayload` the schema, `RunPayload` the inferred type).
33
+ const parsed = RunPayload.safeParse(JSON.parse(readFileSync('.lockstep/run-payload.json', 'utf8')));
34
+ if (!parsed.success) console.error(parsed.error.flatten());
35
+ ```
36
+
37
+ Published from the [Lockstep monorepo](https://github.com/JuneJulyHealth/lockstep)
38
+ (`packages/model`). Versioned in lockstep with `@junejuly-lockstep/sdk` and `@junejuly-lockstep/reconciler`.