@eloxiv/cli 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 +21 -0
- package/README.md +12 -2
- package/dist/AgentSkills.d.ts +51 -0
- package/dist/AgentSkills.d.ts.map +1 -0
- package/dist/AgentSkills.js +264 -0
- package/dist/AgentSkills.js.map +1 -0
- package/dist/AgentWeb.d.ts +83 -0
- package/dist/AgentWeb.d.ts.map +1 -0
- package/dist/AgentWeb.js +436 -0
- package/dist/AgentWeb.js.map +1 -0
- package/dist/App.d.ts +213 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +357 -0
- package/dist/App.js.map +1 -0
- package/dist/Blueprint.d.ts +47 -0
- package/dist/Blueprint.d.ts.map +1 -0
- package/dist/Blueprint.js +241 -0
- package/dist/Blueprint.js.map +1 -0
- package/dist/Brand.d.ts +42 -0
- package/dist/Brand.d.ts.map +1 -0
- package/dist/Brand.js +370 -0
- package/dist/Brand.js.map +1 -0
- package/dist/Changelog.d.ts +22 -0
- package/dist/Changelog.d.ts.map +1 -0
- package/dist/Changelog.js +117 -0
- package/dist/Changelog.js.map +1 -0
- package/dist/Cli.d.ts +17 -0
- package/dist/Cli.d.ts.map +1 -0
- package/dist/Cli.js +810 -0
- package/dist/Cli.js.map +1 -0
- package/dist/DbAdmin.d.ts +18 -0
- package/dist/DbAdmin.d.ts.map +1 -0
- package/dist/DbAdmin.js +91 -0
- package/dist/DbAdmin.js.map +1 -0
- package/dist/Dependencies.d.ts +53 -0
- package/dist/Dependencies.d.ts.map +1 -0
- package/dist/Dependencies.js +132 -0
- package/dist/Dependencies.js.map +1 -0
- package/dist/Deploy.d.ts +39 -0
- package/dist/Deploy.d.ts.map +1 -0
- package/dist/Deploy.js +458 -0
- package/dist/Deploy.js.map +1 -0
- package/dist/Docs.d.ts +71 -0
- package/dist/Docs.d.ts.map +1 -0
- package/dist/Docs.js +240 -0
- package/dist/Docs.js.map +1 -0
- package/dist/Doctor.d.ts +56 -0
- package/dist/Doctor.d.ts.map +1 -0
- package/dist/Doctor.js +368 -0
- package/dist/Doctor.js.map +1 -0
- package/dist/Dossier.d.ts +23 -0
- package/dist/Dossier.d.ts.map +1 -0
- package/dist/Dossier.js +92 -0
- package/dist/Dossier.js.map +1 -0
- package/dist/Emit.d.ts +26 -0
- package/dist/Emit.d.ts.map +1 -0
- package/dist/Emit.js +51 -0
- package/dist/Emit.js.map +1 -0
- package/dist/Errors.d.ts +26 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +17 -0
- package/dist/Errors.js.map +1 -0
- package/dist/Evals.d.ts +52 -0
- package/dist/Evals.d.ts.map +1 -0
- package/dist/Evals.js +126 -0
- package/dist/Evals.js.map +1 -0
- package/dist/Files.d.ts +47 -0
- package/dist/Files.d.ts.map +1 -0
- package/dist/Files.js +145 -0
- package/dist/Files.js.map +1 -0
- package/dist/Generate.d.ts +80 -0
- package/dist/Generate.d.ts.map +1 -0
- package/dist/Generate.js +310 -0
- package/dist/Generate.js.map +1 -0
- package/dist/Guards.d.ts +45 -0
- package/dist/Guards.d.ts.map +1 -0
- package/dist/Guards.js +530 -0
- package/dist/Guards.js.map +1 -0
- package/dist/Inspect.d.ts +125 -0
- package/dist/Inspect.d.ts.map +1 -0
- package/dist/Inspect.js +270 -0
- package/dist/Inspect.js.map +1 -0
- package/dist/Keychain.d.ts +57 -0
- package/dist/Keychain.d.ts.map +1 -0
- package/dist/Keychain.js +73 -0
- package/dist/Keychain.js.map +1 -0
- package/dist/Lock.d.ts +13 -0
- package/dist/Lock.d.ts.map +1 -0
- package/dist/Lock.js +145 -0
- package/dist/Lock.js.map +1 -0
- package/dist/Mcp.d.ts +91 -0
- package/dist/Mcp.d.ts.map +1 -0
- package/dist/Mcp.js +128 -0
- package/dist/Mcp.js.map +1 -0
- package/dist/Merge.d.ts +18 -0
- package/dist/Merge.d.ts.map +1 -0
- package/dist/Merge.js +43 -0
- package/dist/Merge.js.map +1 -0
- package/dist/Migrate.d.ts +78 -0
- package/dist/Migrate.d.ts.map +1 -0
- package/dist/Migrate.js +288 -0
- package/dist/Migrate.js.map +1 -0
- package/dist/Plugins.d.ts +36 -0
- package/dist/Plugins.d.ts.map +1 -0
- package/dist/Plugins.js +304 -0
- package/dist/Plugins.js.map +1 -0
- package/dist/Postgres.d.ts +73 -0
- package/dist/Postgres.d.ts.map +1 -0
- package/dist/Postgres.js +294 -0
- package/dist/Postgres.js.map +1 -0
- package/dist/Publish.d.ts +23 -0
- package/dist/Publish.d.ts.map +1 -0
- package/dist/Publish.js +59 -0
- package/dist/Publish.js.map +1 -0
- package/dist/Registry.d.ts +539 -0
- package/dist/Registry.d.ts.map +1 -0
- package/dist/Registry.js +340 -0
- package/dist/Registry.js.map +1 -0
- package/dist/Remote.d.ts +90 -0
- package/dist/Remote.d.ts.map +1 -0
- package/dist/Remote.js +1006 -0
- package/dist/Remote.js.map +1 -0
- package/dist/Run.d.ts +120 -0
- package/dist/Run.d.ts.map +1 -0
- package/dist/Run.js +477 -0
- package/dist/Run.js.map +1 -0
- package/dist/SyncGen.d.ts +118 -0
- package/dist/SyncGen.d.ts.map +1 -0
- package/dist/SyncGen.js +392 -0
- package/dist/SyncGen.js.map +1 -0
- package/dist/Update.d.ts +301 -0
- package/dist/Update.d.ts.map +1 -0
- package/dist/Update.js +627 -0
- package/dist/Update.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +42 -0
- package/dist/bin.js.map +1 -0
- package/dist/docs/backlog.md +56 -0
- package/dist/docs/ci.md +277 -0
- package/dist/docs/cli.md +696 -0
- package/dist/docs/connectors/google.md +115 -0
- package/dist/docs/connectors/http-openapi.md +7 -0
- package/dist/docs/connectors/mcp.md +8 -0
- package/dist/docs/connectors/microsoft-graph.md +75 -0
- package/dist/docs/connectors/openai.md +25 -0
- package/dist/docs/connectors/slack.md +162 -0
- package/dist/docs/connectors/workos.md +39 -0
- package/dist/docs/contracts/README.md +173 -0
- package/dist/docs/contracts/action-consent.md +92 -0
- package/dist/docs/contracts/action-registry.md +85 -0
- package/dist/docs/contracts/actor.md +100 -0
- package/dist/docs/contracts/agent-resources.md +90 -0
- package/dist/docs/contracts/agent-runtime.md +257 -0
- package/dist/docs/contracts/approvals.md +126 -0
- package/dist/docs/contracts/audit.md +75 -0
- package/dist/docs/contracts/auth-provider.md +74 -0
- package/dist/docs/contracts/calendar-provider.md +46 -0
- package/dist/docs/contracts/client-sdk.md +245 -0
- package/dist/docs/contracts/collab-document.md +151 -0
- package/dist/docs/contracts/command.md +44 -0
- package/dist/docs/contracts/connections.md +235 -0
- package/dist/docs/contracts/context-accounting.md +50 -0
- package/dist/docs/contracts/daemon.md +243 -0
- package/dist/docs/contracts/db-tx.md +53 -0
- package/dist/docs/contracts/delegation.md +68 -0
- package/dist/docs/contracts/device-control.md +103 -0
- package/dist/docs/contracts/directory-provider.md +36 -0
- package/dist/docs/contracts/directory.md +161 -0
- package/dist/docs/contracts/document-source.md +33 -0
- package/dist/docs/contracts/files.md +115 -0
- package/dist/docs/contracts/flags.md +83 -0
- package/dist/docs/contracts/host.md +68 -0
- package/dist/docs/contracts/http-api.md +43 -0
- package/dist/docs/contracts/ingestion.md +130 -0
- package/dist/docs/contracts/ingress.md +141 -0
- package/dist/docs/contracts/invocation.md +260 -0
- package/dist/docs/contracts/local-client.md +110 -0
- package/dist/docs/contracts/locale.md +56 -0
- package/dist/docs/contracts/machine-identity.md +117 -0
- package/dist/docs/contracts/mail-provider.md +49 -0
- package/dist/docs/contracts/memory.md +53 -0
- package/dist/docs/contracts/messaging.md +40 -0
- package/dist/docs/contracts/metering.md +139 -0
- package/dist/docs/contracts/model-provider.md +84 -0
- package/dist/docs/contracts/module-manifest.md +213 -0
- package/dist/docs/contracts/notification-channel.md +90 -0
- package/dist/docs/contracts/notifications.md +123 -0
- package/dist/docs/contracts/outbox.md +80 -0
- package/dist/docs/contracts/privacy.md +110 -0
- package/dist/docs/contracts/progress.md +52 -0
- package/dist/docs/contracts/query-surface.md +108 -0
- package/dist/docs/contracts/readiness.md +63 -0
- package/dist/docs/contracts/release.md +142 -0
- package/dist/docs/contracts/result-rendering.md +61 -0
- package/dist/docs/contracts/sandbox.md +186 -0
- package/dist/docs/contracts/scheduler.md +148 -0
- package/dist/docs/contracts/screen-context.md +81 -0
- package/dist/docs/contracts/search.md +120 -0
- package/dist/docs/contracts/secrets.md +74 -0
- package/dist/docs/contracts/settings.md +109 -0
- package/dist/docs/contracts/sharing.md +77 -0
- package/dist/docs/contracts/slot.md +48 -0
- package/dist/docs/contracts/space.md +67 -0
- package/dist/docs/contracts/storage-adapter.md +45 -0
- package/dist/docs/contracts/storage-backend.md +56 -0
- package/dist/docs/contracts/sync.md +213 -0
- package/dist/docs/contracts/telemetry.md +80 -0
- package/dist/docs/contracts/theme-tokens.md +50 -0
- package/dist/docs/contracts/tool-source.md +58 -0
- package/dist/docs/contracts/versioning.md +99 -0
- package/dist/docs/contracts/view.md +65 -0
- package/dist/docs/contracts/work-items.md +99 -0
- package/dist/docs/contracts/workflow.md +82 -0
- package/dist/docs/decisions.md +163 -0
- package/dist/docs/example-app.md +192 -0
- package/dist/docs/getting-started.md +927 -0
- package/dist/docs/goal.md +54 -0
- package/dist/docs/parity.md +29 -0
- package/dist/docs/performance.md +129 -0
- package/dist/docs/registry/README.md +74 -0
- package/dist/docs/registry/app.md +38 -0
- package/dist/docs/registry/approvals-ui-foldkit.md +28 -0
- package/dist/docs/registry/calendar-ui-foldkit.md +27 -0
- package/dist/docs/registry/calendar.md +35 -0
- package/dist/docs/registry/chat-ui-foldkit.md +30 -0
- package/dist/docs/registry/desktop-rune.md +50 -0
- package/dist/docs/registry/desktop.md +32 -0
- package/dist/docs/registry/eloxiv-action.md +25 -0
- package/dist/docs/registry/eloxiv-connector.md +25 -0
- package/dist/docs/registry/eloxiv-module.md +25 -0
- package/dist/docs/registry/eloxiv-policy.md +25 -0
- package/dist/docs/registry/eloxiv-view.md +25 -0
- package/dist/docs/registry/hello-ui-foldkit.md +29 -0
- package/dist/docs/registry/hello.md +39 -0
- package/dist/docs/registry/home-ui-foldkit.md +27 -0
- package/dist/docs/registry/home.md +29 -0
- package/dist/docs/registry/inbox-ui-foldkit.md +27 -0
- package/dist/docs/registry/mail-ui-foldkit.md +27 -0
- package/dist/docs/registry/mail.md +34 -0
- package/dist/docs/registry/meeting-prep.md +26 -0
- package/dist/docs/registry/members-ui-foldkit.md +28 -0
- package/dist/docs/registry/mobile.md +37 -0
- package/dist/docs/registry/notes-ui-foldkit.md +27 -0
- package/dist/docs/registry/notes.md +26 -0
- package/dist/docs/registry/people-ui-foldkit.md +28 -0
- package/dist/docs/registry/people.md +38 -0
- package/dist/docs/registry/shell-foldkit.md +35 -0
- package/dist/docs/registry/theme.md +25 -0
- package/dist/docs/registry/ui-conformance.md +30 -0
- package/dist/docs/release.md +100 -0
- package/dist/docs/scaffold.md +826 -0
- package/dist/docs/security/threat-model.md +299 -0
- package/dist/docs/upstream/zero-cache-socket-handoff.md +105 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -3
- package/src/AgentSkills.ts +329 -0
- package/src/AgentWeb.ts +507 -0
- package/src/App.ts +435 -0
- package/src/Blueprint.ts +276 -0
- package/src/Brand.ts +415 -0
- package/src/Changelog.ts +136 -0
- package/src/Cli.ts +1458 -0
- package/src/DbAdmin.ts +115 -0
- package/src/Dependencies.ts +170 -0
- package/src/Deploy.ts +563 -0
- package/src/Docs.ts +309 -0
- package/src/Doctor.ts +424 -0
- package/src/Dossier.ts +148 -0
- package/src/Emit.ts +68 -0
- package/src/Errors.ts +18 -0
- package/src/Evals.ts +153 -0
- package/src/Files.ts +152 -0
- package/src/Generate.ts +402 -0
- package/src/Guards.ts +541 -0
- package/src/Inspect.ts +358 -0
- package/src/Keychain.ts +107 -0
- package/src/Lock.ts +174 -0
- package/src/Mcp.ts +159 -0
- package/src/Merge.ts +70 -0
- package/src/Migrate.ts +331 -0
- package/src/Plugins.ts +347 -0
- package/src/Postgres.ts +353 -0
- package/src/Publish.ts +64 -0
- package/src/Registry.ts +405 -0
- package/src/Remote.ts +1158 -0
- package/src/Run.ts +541 -0
- package/src/SyncGen.ts +570 -0
- package/src/Update.ts +873 -0
- package/src/bin.ts +46 -0
- package/src/index.ts +7 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# shell-foldkit
|
|
2
|
+
|
|
3
|
+
The web shell: a single-page app on Foldkit (The Elm Architecture over Effect), StyleX and Vite, the frame your screens live in (decision 10). It signs people in, switches organisations, routes every installed view that has a screen, shows slot contributions beside a screen, runs MAKE modules' sandboxed views (`/make/<module>`), approves a native app's desktop sign-in (`/desktop/sign-in`), and has an appearance dialog (light, dark, right to left). It reads the local replica and writes optimistically through `@eloxiv/client/foldkit`. Kind `shell`; it brings [`theme`](theme.md).
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add shell-foldkit # or any UI item, which brings it; eloxiv init --preset web adds it too
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It installs `shell-foldkit/` (Vite config, `index.html`, `src/`). `eloxiv dev` runs its dev server; `eloxiv build` builds it into `shell-foldkit/dist`; `eloxiv start shell` serves the build with its security headers.
|
|
12
|
+
|
|
13
|
+
## Use it
|
|
14
|
+
|
|
15
|
+
- **Screens** are files in `shell-foldkit/src/screens/`, each exporting `screen = defineScreen({ view, init, update, render, subscriptions, isReady })` (`src/screen.ts` documents the contract). The shell finds them at build time; a module's view gets a route only when a screen for it is installed. Since 0.8.0 each screen is a chunk of its own, loaded the first time a route shows it (with the screens beside it as panels), while the replica opens: the build reads the screen's `view`, `label`, `route`, `title`, `home` and `slots` from its `defineScreen({...})` call (`screenMeta.ts`, a Vite plugin in the shell's config) to route and link it before its code is there, so state them as plain literals; a screen whose fields are computed, spread or named by a constant, or made by anything but the shell's own `defineScreen` imported from `../screen.ts` (a local factory of that name included), is loaded with the shell instead. Since 0.8.3 a lazy screen whose loaded fields differ from the ones the build read is refused when it loads, with the error and reload shown for a chunk that cannot load. A screen for a kernel-provided capability names its own `route` and `title`; one may claim the home route (`home: true`). [Getting started](../getting-started.md#7-a-screen-on-the-client-sdk) writes one.
|
|
16
|
+
- **The UI kit** is `src/ui.ts` (accessible primitives: `button`, `textField`, `select`, `radioGroup`, `card`, `alert`, `errorView`), styled with StyleX from `src/styles.ts`; replace it and check yours with [`ui-conformance`](ui-conformance.md).
|
|
17
|
+
- **Desktop sign-in** (`/desktop/sign-in?challenge&redirect_uri&state`): the page a native app's daemon opens in the system browser (the daemon's default `signInPage` is `<ELOXIV_SHELL_URL>/desktop/sign-in`). Signed out, the sign-in form comes first and the page follows; signed in, it names who signs in, where the app receives the answer (`127.0.0.1:<port>`, or the app's scheme) and the request's fingerprint (the challenge's first eight characters), and approves only on the person's click (`approveDesktopSignIn`, the session as a bearer token), then sends the browser to the kernel's redirect, and only to the redirect the request named. A request without a well-formed challenge and state, or whose redirect is not a loopback address or an app scheme, is not offered for approval.
|
|
18
|
+
- `VITE_ELOXIV_URL` and `VITE_ELOXIV_SYNC_URL` set the kernel's and zero-cache's URLs (default `http://localhost:4100` and `http://localhost:4848`).
|
|
19
|
+
|
|
20
|
+
## Guarantees and limits
|
|
21
|
+
|
|
22
|
+
- **Code splitting (0.8.0).** The sign-in page loads the shell and the client core, not the screens: each screen, the MAKE view host (`makeView.ts`, loaded by the MAKE screen's mount) and what only they use load on demand. Eloxiv's browser packages are built as free of side effects (`vite.config.ts`), so the parts of `@eloxiv/contracts` and `@eloxiv/client` the shell never uses are left out. The client core still loads the sync engine (Zero) with the shell: the core opens the replica synchronously, and the sign-in itself runs on the core. A chunk that cannot be loaded (the network, or a newer release that replaced it while the page was open) shows "This page did not load" with a reload, never a blank page; a failed load is not retried on the same page.
|
|
23
|
+
- A screen is discarded when the route, the organisation or the session changes, so it never holds one organisation's rows after a switch; a late snapshot from the previous replica is dropped.
|
|
24
|
+
- It runs on the client core (`@eloxiv/client/runtime`, in process, since 0.7.0): the session, the organisation and its generation, the replica, live queries, optimistic writes and teardown are the core's, the same one the daemon serves native apps; screens reach them through `@eloxiv/client/foldkit` as before (`ReplicaKey`, `liveQuery`, `writeOptimistic`), the key's `opening` being the generation. `main.ts` passes the app's named queries (`queries` from `eloxiv.sync.ts`).
|
|
25
|
+
- Organisations the kernel could not list (a transient failure) show the error view with why (0.7.1), never an empty switcher or a screen loading for ever; the core lists them again and the shell follows.
|
|
26
|
+
- An offline reload (0.8.5) shows the organisation the session was last open in, from its IndexedDB replica, with an "Offline" indicator in the header (the core's `offline` session): the browser's storage keeps the person and organisation with the token they were open with (`eloxiv.session.context`, never a credential; `src/webSession.ts`), recalled only while the stored session holds that token, forgotten first with the session, when another token is stored, after a sign-out and when the kernel lists the person in no organisation. Writes go to the replica and are sent when the connection is back (within the sync engine's one-minute disconnect timeout); once the kernel answers, the indicator goes and the same screen carries on. Organisations not listed yet show as a notice above an open organisation's rows, not instead of them. With the browser's storage disabled (0.8.7), signing in works for the page alone, with no offline reload.
|
|
27
|
+
- Sign-out revokes the session and closes the replica's connection. It is durable: the revocation is kept in the browser's storage, and the stored session forgotten, before the signed-out state shows, and retried (every 15 s, when the network returns, at the next start) until the kernel confirms it. When storage is too full to keep the revocation, the sign-out leaves a mark for that token once its remembered context is gone (`eloxiv.session.signedOut`, 0.8.7): no tab remembers or reopens that session again, and the mark is retried as a revocation; a sign-out that cannot leave even that says it was not saved. Tabs share the session: a tab whose session another tab cleared, replaced or marked signed out checks it again at once (a `storage` event) and closes its context, and a tab's late `remember` cannot bring back a context another tab changed since (`eloxiv.session.context.rev`).
|
|
28
|
+
- A desktop sign-in is approved only by the person's explicit click on a page that says where the code goes; the page never approves on load, and refuses web redirects (the kernel refuses them too).
|
|
29
|
+
- It is a thin reference (decision 11): routing, sign-in, the organisation switcher, settings frame, the desktop sign-in approval and error view, not a design system.
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
eloxiv add hello hello-ui-foldkit && eloxiv dev # http://localhost:5173/hello
|
|
35
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# theme
|
|
2
|
+
|
|
3
|
+
The default design tokens ([ThemeTokens](../contracts/theme-tokens.md)): light and dark colours with WCAG AA contrast, radius, spacing and fonts, as a CSS stylesheet and as StyleX variables. Logical properties throughout, so right-to-left layouts mirror. Kind `theme`; [`shell-foldkit`](shell-foldkit.md) brings it.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add theme
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It installs `themes/default/tokens.ts` (the tokens), `theme.css` (the stylesheet `@eloxiv/shell-core` writes from them) and `tokens.stylex.ts` (colours, sizes, direction; the dark and rtl themes).
|
|
12
|
+
|
|
13
|
+
## Use it
|
|
14
|
+
|
|
15
|
+
Edit `tokens.ts` and regenerate the stylesheet and StyleX module, or propose overrides from your brand with `eloxiv brand extract <site or files>` ([brand](../cli.md#brand)). StyleX code imports `themes/default/tokens.stylex.ts`.
|
|
16
|
+
|
|
17
|
+
## Guarantees and limits
|
|
18
|
+
|
|
19
|
+
- The default palette meets AA contrast in light and dark; overrides are yours to check (`eloxiv brand` measures what it proposes).
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { colors } from "../../themes/default/tokens.stylex.ts"
|
|
25
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ui-conformance
|
|
2
|
+
|
|
3
|
+
The UI kit's conformance kit: probes that mount each primitive of a kit adapter (the shell's `ui.ts`, or your replacement of it) in a small Foldkit program and check its semantics, interaction, keyboard behaviour and state through Foldkit Scene, against an explicit contract major. Kind `ui`, but it adds no screen: it is test code for an app that replaces the kit.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add ui-conformance # brings the shell
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It installs `shell-foldkit/src/conformance/uiKit.ts`.
|
|
12
|
+
|
|
13
|
+
## Use it
|
|
14
|
+
|
|
15
|
+
Run the probes from a Vitest test against your kit:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { describe, it } from "vitest"
|
|
19
|
+
import { uiKitProbes } from "../shell-foldkit/src/conformance/uiKit.ts"
|
|
20
|
+
import * as ui from "../shell-foldkit/src/ui.ts"
|
|
21
|
+
|
|
22
|
+
describe("our UI kit", () => {
|
|
23
|
+
for (const probe of uiKitProbes({ major: 1, ...ui })) it(`${probe.category}: ${probe.name}`, probe.run)
|
|
24
|
+
})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Guarantees and limits
|
|
28
|
+
|
|
29
|
+
- The probes run against contract major 1 only: a kit declaring another major fails the first probe and every other with it. Within a major, probes are only added for new optional behaviour, never tightened.
|
|
30
|
+
- They check what a virtual-node test can (roles, labels, keyboard handling, state); real CSS, layout and focus in a browser need a Playwright test.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Releasing the packages
|
|
2
|
+
|
|
3
|
+
The public `@eloxiv/*` packages are published to npm, all at one version, under the MIT licence. A release is a pushed tag `v<version>` on a commit merged to `main`; the release workflow ([`.github/workflows/release.yml`](../.github/workflows/release.yml)) checks, builds and publishes it with npm trusted publishing, so there is no npm token anywhere. The tool behind every step is [`tools/done/src/release.ts`](../tools/done/src/release.ts).
|
|
4
|
+
|
|
5
|
+
## What is published
|
|
6
|
+
|
|
7
|
+
Every package under `packages/` that is not `private`, in this order (each after the packages it depends on; `node tools/done/src/release.ts order` prints it):
|
|
8
|
+
|
|
9
|
+
| Package | What apps use it for |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `@eloxiv/contracts` | module, action and event contracts, entities over Drizzle tables (every module and registry item) |
|
|
12
|
+
| `@eloxiv/registry` | the registry's built items, every published version (`registry/public/r`, copied into `r/` at build): the CLI's default registry, so `eloxiv add`, `diff` and `update` need no network access |
|
|
13
|
+
| `@eloxiv/cli` | `eloxiv`: making, assembling, running and checking an app; a devDependency of every app `init` creates |
|
|
14
|
+
| `@eloxiv/client` | the client SDK and client core (the shells, the desktop and mobile hosts, scripts) |
|
|
15
|
+
| `@eloxiv/daemon` | the device daemon (the desktop hosts' sidecar) |
|
|
16
|
+
| `@eloxiv/kernel` | the server (the `app` item's `server/`) |
|
|
17
|
+
| `@eloxiv/shell-core` | the shell contracts (the shells and the theme) |
|
|
18
|
+
| `@eloxiv/testing` | an app's tests and `eloxiv eval` |
|
|
19
|
+
|
|
20
|
+
The registry's sources (`registry/`, the private `@eloxiv/registry-source`), the examples, the benchmarks and the tools are private and never published.
|
|
21
|
+
|
|
22
|
+
What a published package holds and resolves:
|
|
23
|
+
|
|
24
|
+
- `dist` (the build), `src` (the kernel's and the testing kit's migrations and policies are read from there at run time, and `eloxiv docs search` searches it), the CLI's documentation in `dist/docs`, the contracts' JSON Schemas in `schema`, the daemon's sidecar build script and test fixtures; a README and the LICENSE.
|
|
25
|
+
- Entry points resolve from `dist` only. Inside this repository each export also includes the `@eloxiv/source` condition for TypeScript source during development; `publishConfig.exports` omits it, and pnpm publishes that as the package's `exports` so app tooling (the registry's Vite, TypeScript and Metro configs declare the condition) still resolves `dist`. Run `node tools/done/src/release.ts sync` after changing an export.
|
|
26
|
+
- Dependencies on other `@eloxiv/*` packages are `workspace:^` here and `^<version>` in the published manifest.
|
|
27
|
+
- `@eloxiv/registry` is data: `r/` (about 37 MB unpacked, 9 MB packed) and its manifest, no code. Its build (`packages/registry/scripts/copy-registry.ts`) copies the committed `registry/public/r`; `r/` is never committed. The CLI depends on it at `^<version>`: an app made from npm records `npm:@eloxiv/registry` as its registry ([the CLI](cli.md#init)), which each command reads from the running CLI's own copy.
|
|
28
|
+
|
|
29
|
+
**Registry items reach apps through releases.** A new item or item version merged to `main` is in an app's `eloxiv add` and `update` once a release publishes `@eloxiv/registry` with it, and once the app's CLI is at that release (`pnpm up @eloxiv/cli`, or a newer global install). Apps whose `eloxiv.json` names a directory or an https URL read that instead.
|
|
30
|
+
|
|
31
|
+
The registry items depend on the packages at one range, `PACKAGES` in [`registry/scripts/index.ts`](../registry/scripts/index.ts) (`^0.1.0`). A version outside it (0.2.0 for `^0.1.0`) needs the range changed and every item that names a package bumped (`pnpm --dir registry build` lists them), then the examples updated (`eloxiv update`); the metadata check fails until then.
|
|
32
|
+
|
|
33
|
+
## Releasing a version
|
|
34
|
+
|
|
35
|
+
1. Set the version: `mise run release:version 0.1.1`. It sets every public package's version, the versions compiled into the kernel and the daemon (`KERNEL_VERSION`, `DAEMON_VERSION`: health, MCP, the sidecar binary), and syncs the published exports. With recorded changesets, `pnpm changeset version` sets the packages' version from them (one fixed group, [`.changeset`](../.changeset/README.md)); run `mise run release:version <that version>` after it for the rest.
|
|
36
|
+
2. `mise run release:pack` locally if you like: the metadata check, the build, `pnpm pack` (with the `pack-order.cjs` hook, so every machine packs the same bytes) into `.eloxiv/release` (emptied first; `release.ts pack <dir>` packs elsewhere only into a new or empty directory) and every tarball checked; `node tools/done/src/release.ts smoke .eloxiv/release` installs them into an empty app with npm, imports every public entry point of each package on Node and Bun, and starts each daemon executable on its own runtime.
|
|
37
|
+
3. Merge the change to `main` as usual (CI's `tools/done/test/release.test.ts` checks the metadata, npm's packing of every entry point and the workflow).
|
|
38
|
+
4. Tag the merge commit (a commit on `main`: the workflow refuses any other) and push the tag:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
git tag v0.1.1 <merge commit> && git push origin v0.1.1
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The workflow has three jobs, all on GitHub-hosted runners (the only runners npm trusted publishing accepts).
|
|
45
|
+
|
|
46
|
+
**build** has no publishing authority: read-only access to the repository and no OIDC token. On a tag it first checks that the tagged commit is on `main`, then that the tag matches every public package's version and metadata. It builds and packs each package and checks every tarball (version, MIT licence, `^<version>` internal dependencies, no `workspace:` or source condition, every entry point and binary present, no tests or env files, expected size, each dependency field in its `package.json`'s order, and no file naming the building machine's checkout or home directory). Straight after, before any of the tarballs' code runs, it records each tarball's SHA-512 as a job output and uploads the tarballs.
|
|
47
|
+
|
|
48
|
+
**smoke** has no publishing authority either. It downloads a copy of the tarballs, checks it against build's digests and with `release.ts verify`, and smoke-tests it by installing the tarballs into an empty app (with the packages' peers), importing every public entry point of every package on Node and Bun (each subpath export, and each file a wildcard export such as `@eloxiv/testing/conformance/*` matches, so a runtime dependency missing from a manifest fails here; the React Native-only `@eloxiv/client/expo-sqlite` and the executables are resolved, not imported), starting each daemon executable on its own runtime (`@eloxiv/daemon/bin` on Bun, `bin-node` on Node) on an ephemeral port in a disposable state directory until it reports ready, and running `eloxiv --version`. It then asks npm what it would publish (a dry run, which also compares each version npm already has with its tarball). Nothing it runs can change build's artifact digests, which publish checks against.
|
|
49
|
+
|
|
50
|
+
**publish** runs only on a pushed `v*` tag, after smoke passes, in the `npm-release` environment, and is the only job that gets the OIDC token npm exchanges for a publish. It installs nothing from the repository. It checks again that the commit is on `main`, sets up Node and npm without any cache, downloads build's artifact, checks it against build's digests and with `release.ts verify`, then runs `npm publish <tarball> --ignore-scripts --access public` for each in dependency order. `--provenance` is passed only when the repository is public, because npm refuses provenance attestations from private repositories; provenance starts automatically on the first release after the repository becomes public.
|
|
51
|
+
|
|
52
|
+
A version already on npm is skipped only when npm's `dist.integrity` matches the tarball, so a failed run can safely be re-run. If the contents differ, or npm records no integrity for that version, the run stops before publishing anything and names the package: find out where that version came from, then release a new version. `mise run release:publish` does the same. Prereleases (`0.2.0-rc.1`) publish under the `next` tag. Manual runs (Actions → Release → Run workflow) run build and smoke only, on any branch or tag, and never publish.
|
|
53
|
+
|
|
54
|
+
## The first release, and trusted publishing (the owner)
|
|
55
|
+
|
|
56
|
+
npm attaches a trusted publisher only to a package that exists, so 0.1.0 is published by hand once, and trusted publishing is configured after it. The repository may stay private: the packages, the registry's items included, come from npm, and the hand-made release is published without provenance in any case (npm attests it only from CI). Before it:
|
|
57
|
+
|
|
58
|
+
- You are signed in to npm (`npm login`, two-factor) as an owner of the `eloxiv` organisation, with npm 11.15.0 or later for `npm trust` (`npm install -g npm@11`).
|
|
59
|
+
|
|
60
|
+
From a clean checkout of the merge commit:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
mise install
|
|
64
|
+
npm login
|
|
65
|
+
mise run release:publish # install, release:pack, then npm publish each package in dependency order (provenance off by hand)
|
|
66
|
+
git tag v0.1.0 && git push origin v0.1.0 # the workflow checks everything; it publishes nothing for this tag (below)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The workflow run for `v0.1.0` publishes nothing. It skips each version whose contents match your tarball, and if the runner's build differs from yours byte for byte it stops and names each package that differs, which is also harmless here, since every package is already published. (The runner's build of v0.1.0 matched seven of the eight hand-built tarballs; `@eloxiv/testing` differed only in the order of its `@eloxiv/*` dependencies in `package.json`, which pnpm writes in the order its lookups finish. `release.ts pack` now gives pnpm a `beforePacking` hook, [`pack-order.cjs`](../tools/done/src/pack-order.cjs), that writes every dependency field in the order of the package's own `package.json`, and `verify` refuses any other order, so a build packs to the same bytes in any checkout, home directory, locale and time zone.) From the next version on, the workflow publishes.
|
|
70
|
+
|
|
71
|
+
Then make the release workflow each package's trusted publisher, in the `npm-release` environment:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
for p in contracts registry cli client daemon kernel shell-core testing; do
|
|
75
|
+
npm trust github "@eloxiv/$p" --file release.yml --repo eloxiv/eloxiv --environment npm-release --allow-publish --yes
|
|
76
|
+
done
|
|
77
|
+
npm trust list @eloxiv/kernel # one configuration per package
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`--allow-publish` is needed: a configuration made without it allows only staged publishing. The same on npmjs.com, per package: Settings, Trusted publishing, GitHub Actions, with **Organization or user** `eloxiv`, **Repository** `eloxiv`, **Workflow filename** `release.yml` (the file name only), **Environment** `npm-release` (the publish job's environment: npm then refuses a publish from any job outside it), publishing allowed. A configuration must complete a publish within two days or it expires: tag the next release soon after, or remake it then. Once every package publishes through the workflow, each package's Settings can require two-factor authentication and disallow tokens, so only the workflow publishes.
|
|
81
|
+
|
|
82
|
+
The packages' `repository.url` (`git+https://github.com/eloxiv/eloxiv.git`) must match the repository exactly, as the metadata check requires; renaming or moving the repository needs it changed in every package and the trusted publishers remade.
|
|
83
|
+
|
|
84
|
+
## Protecting the release (the owner)
|
|
85
|
+
|
|
86
|
+
Create the `npm-release` environment restricted to `v*` tags before the first tagged release, so that only a tag run can enter it (a run that names a missing environment creates it unrestricted; custom branch and tag rules work on the current plan, as the `slack-live` environment shows):
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
gh api -X PUT repos/eloxiv/eloxiv/environments/npm-release \
|
|
90
|
+
-F 'deployment_branch_policy[protected_branches]=false' -F 'deployment_branch_policy[custom_branch_policies]=true'
|
|
91
|
+
gh api -X POST repos/eloxiv/eloxiv/environments/npm-release/deployment-branch-policies -f name='v*' -f type=tag
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The same on github.com: Settings, Environments, `npm-release`, Deployment branches and tags, Selected branches and tags, add the tag rule `v*`. Where the plan allows, also add required reviewers to the environment, and a tag ruleset that lets only release managers create `v*` tags (Settings, Rules, Rulesets, New tag ruleset, target `v*`, restrict creations). The repository is private on GitHub Free, where neither is available: the rulesets API answers 403, asking for GitHub Pro or a public repository.
|
|
95
|
+
|
|
96
|
+
### What the workflow cannot enforce
|
|
97
|
+
|
|
98
|
+
The checks run inside the workflow, and a repository writer can change the workflow. A writer can push a branch with a changed `release.yml`, tag a commit on it `v<version>` and push the tag; the changed file runs, the environment's `v*` rule admits the tag, and npm trusts the workflow's file name and environment, not its contents. The check that the commit is on `main` stops a writer only while they leave the workflow as it is. Closing this needs protection outside the repository's files: a tag ruleset restricting who creates `v*` tags, and required reviewers on `npm-release` (GitHub Pro or Team, or a public repository). Until then, the protection is who has write access, which today is the owner alone.
|
|
99
|
+
|
|
100
|
+
On this plan, npm's staged publishing gives the same protection from npm's side: a trusted publisher made with `--allow-stage-publish` instead of `--allow-publish` lets the workflow only stage a version, which an owner of the package then approves with two-factor authentication (`npm stage approve <id>`). The workflow would have to run `npm stage publish` in place of `npm publish`; it does not yet.
|