sanoma 0.7.0 → 0.8.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
@@ -9,7 +9,7 @@ mkdir acme && cd acme
9
9
  npx sanoma
10
10
  ```
11
11
 
12
- In an empty directory (dotfiles aside), `sanoma` starts a company there, then runs it: it copies the template this package ships (`template/`: `sanoma.config.ts`, a `publish-post` workflow with its scenarios, `policies/policy.cedar` and `policies/changes.cedar` (every change waits for `admin`), `resources/people.ts` with you as its first person (your GitHub login as `gh` is signed in, else this machine's user name, named as git's `user.name`), an empty `resources/` tree, `AGENTS.md`, `.env.example`), names the package after the directory, writes `.env` with a new `SANOMA_SECRETS_KEY` (keeping what a `.env` there already sets; no database URL, so the company runs on [its own Postgres](#postgres)), commits what it wrote (never a dotfile that was already there) as the first commit of a git repository on `main`, "Start a Sanoma company", as your git user, then installs with the package manager that ran it (`npm_config_user_agent`; pnpm when it names none), with `sanoma` at its own version and each other package the template names at `latest`, and adds the lockfile to that commit. The `sanoma` it installed then serves the company. Without git or a git user it stops before writing anything; a failed install leaves the commit, to install and run `sanoma` again in. A directory holding anything else and no `sanoma.config.ts` is refused, as for every command.
12
+ In an empty directory (dotfiles aside), `sanoma` starts a company there, then runs it: it copies the template this package ships (`template/`: `sanoma.config.ts` with the Ghost connector and the Anthropic one, the model the app's chat answers on, a `publish-post` workflow with its scenarios, `policies/policy.cedar` and `policies/changes.cedar` (every change waits for `admin`), `resources/people.ts` with you as its first person (your GitHub login as `gh` is signed in, else this machine's user name, named as git's `user.name`), an empty `resources/` tree, `AGENTS.md`, `.env.example`), names the package after the directory, writes `.env` with a new `SANOMA_SECRETS_KEY` (keeping what a `.env` there already sets; no database URL, so the company runs on [its own Postgres](#postgres)), commits what it wrote (never a dotfile that was already there) as the first commit of a git repository on `main`, "Start a Sanoma company", as your git user, then installs with the package manager that ran it (`npm_config_user_agent`; pnpm when it names none), with `sanoma` at its own version and each other package the template names at `latest`, and adds the lockfile to that commit. The `sanoma` it installed then serves the company; the chat asks for the Anthropic key, pasted on its connector page, before its first turn. Without git or a git user it stops before writing anything; a failed install leaves the commit, to install and run `sanoma` again in. A directory holding anything else and no `sanoma.config.ts` is refused, as for every command.
13
13
 
14
14
  ## Install
15
15
 
@@ -19,12 +19,12 @@ npm install sanoma @sanoma-ai/connector-ghost
19
19
 
20
20
  `sanoma` brings `@sanoma-ai/workflows`, `@sanoma-ai/app`, `zod`, `typescript`, `@types/node` and `oxlint` with it: a repo installs nothing else but its connectors. Node's types reach the repo's `tsc` through `sanoma` itself (its declarations reference them, resolved from where it is installed), under pnpm, npm or a link alike, so a repo lists no `@types/node`. A repo that lists its own of another major gets two sets of Node's declarations, which conflict: keep one, by matching sanoma's or letting the installer dedupe them. A tsconfig project that imports nothing from `sanoma` (a scripts directory with a tsconfig of its own, say) gets none this way: it sets `"types": ["node"]` and lists `@types/node` itself. Node 26 or later. Nothing else: the [Postgres](#postgres) it starts comes with it, as `@sanoma-ai/postgres-<platform>`, an optional dependency.
21
21
 
22
- A repo holds `sanoma.config.ts` at its root, with `workflows/`, optional `policies/` (Cedar files), `resources/` (data files, the people among them) and `scenarios/` (feature files) beside it, and a `tsconfig.json` that extends the one this package ships:
22
+ A repo holds `sanoma.config.ts` at its root, with `workflows/`, optional `policies/` (Cedar files), `resources/` (data files, the people among them) and `scenarios/` (feature files) beside it, optional `apps/` (see [Apps](#apps)), and a `tsconfig.json` that extends the one this package ships:
23
23
 
24
24
  ```json
25
25
  {
26
26
  "extends": "sanoma/tsconfig.json",
27
- "include": ["sanoma.config.ts", "workflows", "resources"]
27
+ "include": ["sanoma.config.ts", "workflows", "resources", "apps/*/app.ts", "apps/*/workflows", "apps/*/resources"]
28
28
  }
29
29
  ```
30
30
 
@@ -32,15 +32,11 @@ A repo holds `sanoma.config.ts` at its root, with `workflows/`, optional `polici
32
32
  // sanoma.config.ts
33
33
  import { ghost } from "@sanoma-ai/connector-ghost";
34
34
  import { defineConfig } from "sanoma";
35
- import publish from "./workflows/publish.ts";
36
35
 
37
- export default defineConfig({
38
- workflows: [publish],
39
- connectors: [ghost],
40
- });
36
+ export default defineConfig({ connectors: [ghost] });
41
37
  ```
42
38
 
43
- Each connector carries its driver and its fake, so the config names neither. The rest is the repo's layout: the app's name is `package.json`'s `name`, the scenarios are `scenarios/`, the data files `resources/` and the policies `policies/**/*.cedar`, beside `sanoma.config.ts` (see [People and policies](#people-and-policies)). The ledger is Postgres's, on the config's database; `ledger: jsonlLedger(dir)` keeps it in files instead.
39
+ Each connector carries its driver and its fake, so the config names neither, and every command that loads the config finds the workflows: each `.ts` file under `workflows/` and each app's `apps/<app>/workflows/` (but `*.test.ts`, `*.spec.ts` and `*.d.ts`) is imported, and its default export, which must be a workflow (`defineWorkflow`), is added to the config's `workflows`; a file without one is a helper the workflows import. A config may still list workflows (`workflows: [publish]`): one it lists is kept, once. The rest is the repo's layout: the app's name is `package.json`'s `name`, the scenarios are `scenarios/`, the data files `resources/` and the policies `policies/**/*.cedar`, beside `sanoma.config.ts` (see [People and policies](#people-and-policies)). The ledger is Postgres's, on the config's database; `ledger: jsonlLedger(dir)` keeps it in files instead.
44
40
 
45
41
  ```ts
46
42
  // workflows/publish.ts
@@ -56,7 +52,7 @@ export default defineWorkflow({
56
52
  });
57
53
  ```
58
54
 
59
- A workflow imports from `sanoma` what the lint lets it (`defineWorkflow`, `mayDecide`, `errorCode`, `z`, and types); `zod` itself and `@sanoma-ai/workflows` are accepted too. The config file imports `defineConfig` (and a ledger store, `jsonlLedger`, `memoryLedger` or `postgresLedger`, when it names one) from `sanoma`, and its connectors from their packages. A site, `sites/<name>/` (pages the app serves under `/sites/<name>/`; `defineSite({ public: true, login })` in its `site.ts` marks one for visitors, served at the root of its own host too, and `locales` its languages), imports `defineSite`, the app's route APIs (`Link`, `Outlet`, `useNavigate`, …) and `api`, which calls the company's operations and workflows as the person on the page ([calling operations and workflows](https://www.npmjs.com/package/@sanoma-ai/app#calling-operations-and-workflows)), from `sanoma/site` with the rest of what talks to the app (`RunForm`, a workflow's start form, and `useActor`, who is signed in), how its pages look (the app's components, presentational only) from `sanoma/ui`, and `createFileRoute` from `@tanstack/react-router`; the [app's README](https://www.npmjs.com/package/@sanoma-ai/app#a-sites-imports) has the whole list. A data file under `resources/` imports `secret` and `sanoma` (the people types) from `sanoma/resources`, and `resources/data.ts`, the company's [collections](../workflows/README.md#collections), imports `collection` from `sanoma/data` and nothing else:
55
+ A workflow imports from `sanoma` what the lint lets it (`defineWorkflow`, `mayDecide`, `errorCode`, `z`, and types); `zod` itself and `@sanoma-ai/workflows` are accepted too. The config file imports `defineConfig` (and a ledger store, `jsonlLedger`, `memoryLedger` or `postgresLedger`, when it names one) from `sanoma`, and its connectors from their packages. A site, `sites/<name>/` (pages the app serves under `/sites/<name>/`; `defineSite({ public: true, login })` in its `site.ts` marks one for visitors, served at the root of its own host too, and `locales` its languages), imports `defineSite`, the app's route APIs (`Link`, `Outlet`, `useNavigate`, …) and `api`, which calls the company's operations and workflows as the person on the page ([calling operations and workflows](https://www.npmjs.com/package/@sanoma-ai/app#calling-operations-and-workflows)), from `sanoma/site` with the rest of what talks to the app (`RunForm`, a workflow's start form, and `useActor`, who is signed in), how its pages look (the app's components, presentational only) from `sanoma/ui`, Sanoma's claims about connectors, apps and solutions (`claims`, `appTier`, …) from `sanoma/claims`, and `createFileRoute` from `@tanstack/react-router`; the [app's README](https://www.npmjs.com/package/@sanoma-ai/app#a-sites-imports) has the whole list. A data file under `resources/` imports `secret` and `sanoma` (the people types) from `sanoma/resources`, and `resources/data.ts`, the company's [collections](../workflows/README.md#collections), imports `collection` from `sanoma/data` and nothing else:
60
56
 
61
57
  ```ts
62
58
  // resources/data.ts
@@ -69,7 +65,20 @@ export const outbound = collection({
69
65
  });
70
66
  ```
71
67
 
72
- Every command that loads the config imports `resources/data.ts` too, when there is one, and adds its collections to the config's `collections` (each of its exports must be one), so `sanoma.config.ts` does not list them. A workflow that calls `ctx.data.outbound.get` imports `outbound` from `../resources/data.ts` to name it in `uses`: the one file outside `workflows/` the lint lets it import.
68
+ Every command that loads the config imports `resources/data.ts` too, and each app's, when there is one, and adds its collections to the config's `collections` (each of its exports must be one), so `sanoma.config.ts` does not list them. A workflow that calls `ctx.data.outbound.get` imports `outbound` from `../resources/data.ts` to name it in `uses`: the one file outside `workflows/` the lint lets it import.
69
+
70
+ ## Apps
71
+
72
+ An app is a folder of `apps/`, holding what the root does (`workflows/`, `resources/`, `policies/`, `scenarios/`, `sites/`) and an `app.ts` naming the repository it was merged from:
73
+
74
+ ```ts
75
+ // apps/crm/app.ts
76
+ import { defineApp } from "sanoma";
77
+
78
+ export default defineApp({ source: "https://github.com/acme/crm" });
79
+ ```
80
+
81
+ What an app declares is named with its folder, so two apps may both declare `customers`: `apps/crm/resources/data.ts`'s is `crm.customers` (`ctx.data.crm.customers.get(…)`, `api.data.crm.customers.list()`, the Cedar action `data.crm.customers.save`), `apps/crm/workflows/follow-up.ts`'s `follow-up` is `crm.follow-up` (`api.crmFollowUp`, `When crm.follow-up runs`), and `apps/crm/sites/pipeline/` is served at `/sites/crm/pipeline`. An app is taken and updated by the chat's agent as a git merge into its draft (`take_app`, `update_app`; see [the app's screens](../app/README.md#screens)). The company's own workflows, at the root, may import any app's `resources/data.ts` to join them; `sanoma check` warns of an import from one app's files into another's. See [Apps](../workflows/README.md#apps).
73
82
 
74
83
  ## People and policies
75
84
 
@@ -101,9 +110,10 @@ Run them from the directory that holds `sanoma.config.ts`. Each loads `.env` the
101
110
  | Command | What it does |
102
111
  | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
103
112
  | `sanoma` | Makes `SANOMA_SECRETS_KEY`, which encrypts the stored credentials, when the environment and `.env` have none, appending it to `.env` with one line saying so; makes sure Postgres answers, starting the company's own when no URL is named (see [Postgres](#postgres)), then starts the worker (promoted, so a local worker takes every queued run) and the app in one process, and prints `<appName> running <workflows>` and `<appName> at http://127.0.0.1:3000; ctrl-c to stop`; the worker says `sanoma: 2 of 5 connectors not configured yet: ghost, resend; …` first when some vendors' variables are missing or invalid (a call to one fails, naming them, until they are set; nothing when all are set). When the repo has [sites](#sites), it serves the app and the sites from a dev server that shows each edit as it is saved (see [Developing a site](#developing-a-site)). In [dev mode](#dev-mode) it runs them in a child it restarts. In an empty directory it first [starts a company](#start-a-company). The worker and the app are given the repo's git checkout as their `source`, which commits to the current branch, and opens drafts: a git worktree each, at `.sanoma/drafts/<id>` on the branch `draft/<id>` from the checked-out commit, with the repo's `node_modules` linked in (a link, which `node_modules/` in `.gitignore` does not match, so `.git/info/exclude` names it), where a writer that must not touch the live checkout commits instead, and whose `sanoma check` the app runs as a child holding only `PATH`, `HOME` and the database URL. A draft is open while `git worktree list` lists it; merging its branch is by hand. |
113
+ | `sanoma demo` | `sanoma` as a demo of the repo ([the app's Demo](../app/README.md#demo)), on `<database>_demo` beside the company's own database (its seed empties the database it runs on): every vendor on its fake, anyone who opens it signed in as one of the people `resources/people.ts` declares (`?as=<id>` choosing whom: a moment's URL is `/<path>?as=<person>`, else the first person), the worlds and moments of `scenarios/` seeded as it starts and every hour, a banner saying nothing is saved, no Chat and no Go live. `SANOMA_DEMO=1` makes `sanoma serve` a demo the same way, on the database it names (the demo's own), on any host and without GitHub sign-in, for a host to run; `sanoma worker` and `sanoma app` refuse it (exit 2), since the demo's fakes live in the one process that runs both. |
104
114
  | `sanoma worker`, `sanoma app` | One of the two alone, for a deployment that runs them apart (`app` builds the app with the [sites](#sites)). Neither starts or probes Postgres: a URL named is the runtime's to reach; with none they use the company's own only while another `sanoma` runs it, and exit 2 otherwise. |
105
115
  | `sanoma wakeup` | The [wakeup service](#the-wakeup-service) alone, on the config's database (found as `worker` and `app` find it, never started), at `SANOMA_APP_HOST` and `SANOMA_APP_PORT` (default 3100), with `/healthz`. |
106
- | `sanoma check` | Writes [`.sanoma/api.ts`](#sites) and `.sanoma/schema.cedarschema` first, each when it changed; then `tsc -p tsconfig.json`; oxlint over `workflows/`, `resources/` and `sites/` (those that exist) with the repo's `.oxlintrc.json`, written when missing (see [the lint](#the-lint)); every problem `describeConfig` finds (an import a workflow may not make, what its graph cannot draw, a data file outside the subset: what the worker would refuse; a site's call to a workflow, collection or operation the config does not have, or a public site's start or direct call no `permit` lets a visitor make; a domain a host gives a site that is not public, or gives two sites); every problem in the [policies](#people-and-policies), at its `file:line:col` with the policy's id; with [sites](#sites), the app built with them, `tsc -p sites/tsconfig.json` and what is wrong under `content/`; then, unless the policies have a problem, every scenario against the fakes, on a database of its own (`<database>_check`, on the company's own Postgres when no URL is named, stopped after when `check` started it), each step that did not hold a problem. Prints each problem on a line, `file:line:col: message` or `scenario › step: message`, and exits 1 when there is one; before them each warning, `file:line:col: warning: message` (a public site's page the sitemap cannot list the entries of), which never fails it. No vitest. |
116
+ | `sanoma check` | Writes [`.sanoma/api.ts`](#sites) and `.sanoma/schema.cedarschema` first, each when it changed; then `tsc -p tsconfig.json`; oxlint over `workflows/`, `resources/`, `sites/` and `apps/` (those that exist) with the repo's `.oxlintrc.json`, written when missing (see [the lint](#the-lint)); every problem `describeConfig` finds (an import a workflow may not make, what its graph cannot draw, a data file outside the subset: what the worker would refuse; a site's call to a workflow, collection or operation the config does not have, or a public site's start or direct call no `permit` lets a visitor make; a domain a host gives a site that is not public, or gives two sites); every problem in the [policies](#people-and-policies), at its `file:line:col` with the policy's id; with [sites](#sites), the app built with them, `tsc -p sites/tsconfig.json` and what is wrong under `content/`; then, unless the policies have a problem, every scenario against the fakes, on a database of its own (`<database>_check`, on the company's own Postgres when no URL is named, stopped after when `check` started it), each step that did not hold a problem. Prints each problem on a line, `file:line:col: message` or `scenario › step: message`, and exits 1 when there is one; before them each warning, `file:line:col: warning: message` (a public site's page the sitemap cannot list the entries of, an import from one app into another), which never fails it. No vitest. |
107
117
  | `sanoma env [--check]` | Writes `.env.example`: the variables `sanoma` reads, then every variable the connectors' drivers declare, by vendor, with its description; optional ones commented out. `--check` writes nothing and exits 1 with "`.env.example` is out of date: run `sanoma env`" when the file differs, for CI. |
108
118
  | `sanoma ledger export <runId> [--out <file>]` | A run's ledger records from the config's store (the Postgres ledger on its database when it names none, the company's own started for the read when no URL is named), as JSON lines (the shape `jsonlLedger` keeps), to stdout or `--out`. |
109
119
  | `sanoma --help` | The usage. |
@@ -133,7 +143,7 @@ With none named, a company runs on its own PostgreSQL 18, from the `@sanoma-ai/p
133
143
 
134
144
  ## The lint
135
145
 
136
- `sanoma check` lints `workflows/`, `resources/` and `sites/`, those that exist, with oxlint, run in the repo's root on the repo's own `.oxlintrc.json`, so an editor's oxlint reads the same file and the rules' `workflows/**` globs match against the root. `sanoma check` writes that file when there is none:
146
+ `sanoma check` lints `workflows/`, `resources/`, `sites/` and `apps/`, those that exist, with oxlint, run in the repo's root on the repo's own `.oxlintrc.json`, so an editor's oxlint reads the same file and the rules' `workflows/**` globs match against the root. `sanoma check` writes that file when there is none:
137
147
 
138
148
  ```json
139
149
  {
@@ -195,6 +205,6 @@ A company uses one through the runtime's own wakeup, `sanoma.wakeup({ host })` (
195
205
 
196
206
  `sanoma worker` and `sanoma app` are the deployment's two processes. A host that composes its own process keeps `startWorker` from `@sanoma-ai/workflows` and `startApp` from `@sanoma-ai/app`, which the bin runs.
197
207
 
198
- [`runtime/`](runtime/Dockerfile) is the image a container host runs: Node 26, git, pnpm and `provider-bridge`, and no company code. At start it clones `SANOMA_SOURCE` at `SANOMA_REVISION` (with `SANOMA_SOURCE_TOKEN` as an HTTP header when set), runs `pnpm install --frozen-lockfile` and `sanoma serve` on `0.0.0.0` and `PORT` (default 3000); the host passes `SANOMA_DATABASE_URL`, `SANOMA_SECRETS_KEY` and, as the app is not on loopback, the `SANOMA_GITHUB_*` sign-in variables too. Its health check is the app's `/healthz`. `sanoma serve` (not `sanoma app`, which runs no worker) also answers a [wakeup](../workflows/README.md#hosts)'s `GET /wake` before any login: 204, never cached, whatever the query. Its worker runs under a supervisor (`superviseWorker`): with a wakeup declared and the app beyond loopback (on this machine alone, the wakeup would wake the deployed instance) it stops itself when nothing can run soon, and a fresh one starts on a wake (resume if stopped), or on a write from the app (a run's start, apply, an approval's decision), never on a page read. `sanoma worker` never stops its worker: nothing in its process would start it again. A repo with [sites](#sites) is built at start, as `sanoma serve` does anywhere, into `.sanoma/app/` in the clone: the app listens once the build is done (the health check's start period allows 5 minutes for the clone, the install and the build); the image itself holds no build. `provider-bridge` is built from source at a pinned commit; `--build-arg BRIDGE_FROM=release --build-arg BRIDGE_VERSION=<x.y.z>` downloads a release instead. CI builds the image without pushing it; it runs no company in it, so it builds no site either. A release pushes it to Docker Hub as `sanomaai/runtime:<sanoma version>` ([Release](../../README.md#release) has the hand command).
208
+ [`runtime/`](runtime/Dockerfile) is the image a container host runs: Node 26, git, pnpm and `provider-bridge`, and no company code. At start it clones `SANOMA_SOURCE` at `SANOMA_REVISION` (with `SANOMA_SOURCE_TOKEN` as an HTTP header when set), runs `pnpm install --frozen-lockfile` and `sanoma serve` on `0.0.0.0` and `PORT` (default 3000); the host passes `SANOMA_DATABASE_URL`, `SANOMA_SECRETS_KEY` and, as the app is not on loopback, the `SANOMA_GITHUB_*` sign-in variables too. Its health check is the app's `/healthz`. `sanoma serve` (not `sanoma app`, which runs no worker) also answers a [wakeup](../workflows/README.md#hosts)'s `GET /wake` before any login: 204, never cached, whatever the query. The app answers the company's GitHub App's webhook at `POST /webhooks/github` too ([the app's webhooks](../app/README.md#login)): a push to `main` applies the declared hosts, so a merge made on GitHub deploys, and a push to a draft's branch is fetched into the draft (`follow` on its worktree) and plans its change again. On a laptop, which GitHub cannot reach, none arrives. Its worker runs under a supervisor (`superviseWorker`): with a wakeup declared and the app beyond loopback (on this machine alone, the wakeup would wake the deployed instance) it stops itself when nothing can run soon, and a fresh one starts on a wake (resume if stopped), or on a write from the app (a run's start, apply, an approval's decision), never on a page read. `sanoma worker` never stops its worker: nothing in its process would start it again. A repo with [sites](#sites) is built at start, as `sanoma serve` does anywhere, into `.sanoma/app/` in the clone: the app listens once the build is done (the health check's start period allows 5 minutes for the clone, the install and the build); the image itself holds no build. `provider-bridge` is built from source at a pinned commit; `--build-arg BRIDGE_FROM=release --build-arg BRIDGE_VERSION=<x.y.z>` downloads a release instead. CI builds the image without pushing it; it runs no company in it, so it builds no site either. A release pushes it to Docker Hub as `sanomaai/runtime:<sanoma version>` ([Release](../../README.md#release) has the hand command).
199
209
 
200
210
  Status: early (0.x). License: FSL-1.1-ALv2.
package/dist/check.d.ts CHANGED
@@ -10,14 +10,15 @@ export interface CheckOptions {
10
10
  * `policies/**\/*.cedar` (`policyProblems`, as `resolveConfig` reads them); the generated files written first (`writeGenerated`: `.sanoma/api.ts` and the Cedar schema,
11
11
  * each when it changed); `tsc -p tsconfig.json` in
12
12
  * its root; oxlint in the root, with the repo's `.oxlintrc.json` (written when missing, to extend
13
- * this package's `oxlint.json`), over `workflows/`, `resources/` and `sites/`; every problem
13
+ * this package's `oxlint.json`), over `workflows/`, `resources/`, `sites/` and `apps/`; every problem
14
14
  * `describeConfig` finds in the data files and the workflows' files (the import rules and what
15
15
  * the outline cannot draw: what the worker refuses to start with), and each site's call to what
16
16
  * the config does not have; with sites, their generated files written first and, beside those
17
17
  * three, the app built with them and `tsc -p sites/tsconfig.json` (`checkSites`), and what is
18
18
  * wrong under `content/` (as `writeSiteFiles` reads it). Their problems in the order tsc, the sites' tsc, oxlint,
19
19
  * the policies, the config, the folders refused as sites, the content's problems, the sites' build. Then, unless the policies do not hold, every scenario against the fakes (`runScenarios`), each step that did not hold a
20
- * problem. `ok` when there are no problems; the sites' `warnings` beside them never make it not.
20
+ * problem. `ok` when there are no problems; the warnings beside them (the sites', and an import
21
+ * from one app's folder into another's) never make it not.
21
22
  * With them, the repo's Permissions grid (`permissionsGrid`, as the app's Permissions page has
22
23
  * it), from the same config and description, which a change is reviewed by: none when the
23
24
  * policies do not hold, since every cell would be the refusing policy's deny.
package/dist/check.js CHANGED
@@ -4,25 +4,26 @@ import { join, relative } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { promisify } from "node:util";
6
6
  import { errorMessage } from "@sanoma-ai/workflows";
7
- import { describeConfig, permissionsGrid, readPeople, schemaOf, writeGenerated, } from "@sanoma-ai/workflows/describe";
7
+ import { crossAppImports, describeConfig, permissionsGrid, readPeople, schemaOf, writeGenerated, } from "@sanoma-ai/workflows/describe";
8
8
  import { problemLine, warningLine } from "@sanoma-ai/workflows/shared";
9
9
  import { runScenarios } from "@sanoma-ai/workflows/scenarios";
10
10
  import { runtimeFrom, siteBuild } from "./sites.js";
11
- /** The directories oxlint reads, those that exist. */
12
- const LINTED = ["workflows", "resources", "sites"];
11
+ /** The directories oxlint reads, those that exist: the apps' hold the same kinds, which the same rules match. */
12
+ const LINTED = ["workflows", "resources", "sites", "apps"];
13
13
  /**
14
14
  * Checks a repo the way its tests would, without a test framework: what is wrong in its
15
15
  * `policies/**\/*.cedar` (`policyProblems`, as `resolveConfig` reads them); the generated files written first (`writeGenerated`: `.sanoma/api.ts` and the Cedar schema,
16
16
  * each when it changed); `tsc -p tsconfig.json` in
17
17
  * its root; oxlint in the root, with the repo's `.oxlintrc.json` (written when missing, to extend
18
- * this package's `oxlint.json`), over `workflows/`, `resources/` and `sites/`; every problem
18
+ * this package's `oxlint.json`), over `workflows/`, `resources/`, `sites/` and `apps/`; every problem
19
19
  * `describeConfig` finds in the data files and the workflows' files (the import rules and what
20
20
  * the outline cannot draw: what the worker refuses to start with), and each site's call to what
21
21
  * the config does not have; with sites, their generated files written first and, beside those
22
22
  * three, the app built with them and `tsc -p sites/tsconfig.json` (`checkSites`), and what is
23
23
  * wrong under `content/` (as `writeSiteFiles` reads it). Their problems in the order tsc, the sites' tsc, oxlint,
24
24
  * the policies, the config, the folders refused as sites, the content's problems, the sites' build. Then, unless the policies do not hold, every scenario against the fakes (`runScenarios`), each step that did not hold a
25
- * problem. `ok` when there are no problems; the sites' `warnings` beside them never make it not.
25
+ * problem. `ok` when there are no problems; the warnings beside them (the sites', and an import
26
+ * from one app's folder into another's) never make it not.
26
27
  * With them, the repo's Permissions grid (`permissionsGrid`, as the app's Permissions page has
27
28
  * it), from the same config and description, which a change is reviewed by: none when the
28
29
  * policies do not hold, since every cell would be the refusing policy's deny.
@@ -44,7 +45,7 @@ export async function check({ config, root, resolved }, { databaseUrl, log }) {
44
45
  lint(root, log),
45
46
  ]);
46
47
  const read = configProblems(description, root);
47
- const unmounted = refused.map((name) => `sites/${name}: a site's folder name is a URL segment (lowercase letters, digits and dashes)`);
48
+ const unmounted = refused.map((dir) => `${dir}: a site's folder name is a URL segment (lowercase letters, digits and dashes)`);
48
49
  const problems = [
49
50
  ...tsc,
50
51
  ...checked.typed,
@@ -56,7 +57,7 @@ export async function check({ config, root, resolved }, { databaseUrl, log }) {
56
57
  ...checked.built,
57
58
  ];
58
59
  if (resolved.scenarios === undefined) {
59
- log("no scenarios: the config's root has no `scenarios/` directory");
60
+ log("no scenarios: neither the config's root nor an app has a `scenarios/` directory");
60
61
  }
61
62
  else if (policies.length) {
62
63
  log("no scenarios: the policies do not hold");
@@ -67,7 +68,10 @@ export async function check({ config, root, resolved }, { databaseUrl, log }) {
67
68
  for (const f of failed)
68
69
  problems.push(`${f.scenario} › ${f.step}: ${f.message}`);
69
70
  }
70
- const warnings = description.sites.flatMap((site) => site.warnings.map(warningLine));
71
+ const warnings = [
72
+ ...description.sites.flatMap((site) => site.warnings),
73
+ ...crossAppImports(root, description.apps),
74
+ ].map(warningLine);
71
75
  const grid = policies.length ? undefined : permissionsGrid(resolved, description);
72
76
  return { ok: problems.length === 0, problems, warnings, ...(grid && { grid }) };
73
77
  }
package/dist/check.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAoB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAEL,cAAc,EACd,eAAe,EACf,UAAU,EACV,QAAQ,EACR,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQpD,sDAAsD;AACtD,MAAM,MAAM,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAU,EAClC,EAAE,WAAW,EAAE,GAAG,EAAgB;IAElC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACd,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC;IACzC,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAA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KAAK,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,sBAAsB,IAAI,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACjG,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1 @@
1
+ export { appClaim, appTier, type AppClaim, type Claims, claims, connectorTier, type ConnectorClaim, SANOMA_ORG, type SolutionClaim, type Tier, TIERS, } from "@sanoma-ai/workflows/shared";
package/dist/claims.js ADDED
@@ -0,0 +1,6 @@
1
+ // Sanoma's claims (`sanoma/claims`): the tier, review and blocks Sanoma records about connectors
2
+ // and apps, and the solutions, each a kind of customer with its apps and demo. Data, changed by a
3
+ // pull request to the sanoma repository. A company's sites import it statically, as sanoma.ai's
4
+ // solution pages do; the listing of apps on GitHub (`sanoma.apps.list`) joins it at run time.
5
+ export { appClaim, appTier, claims, connectorTier, SANOMA_ORG, TIERS, } from "@sanoma-ai/workflows/shared";
6
+ //# sourceMappingURL=claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claims.js","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,kGAAkG;AAClG,gGAAgG;AAChG,8FAA8F;AAC9F,OAAO,EACL,QAAQ,EACR,OAAO,EAGP,MAAM,EACN,aAAa,EAEb,UAAU,EAGV,KAAK,GACN,MAAM,6BAA6B,CAAC"}
package/dist/cli.js CHANGED
@@ -25,6 +25,10 @@ Runs the repo in the working directory, from its sanoma.config.ts (after its .en
25
25
  and the repo's sites/, when it has any, from a dev server that shows each
26
26
  edit as it is saved. In an empty directory, first starts a company there: the
27
27
  template, .env, an install and a git repository
28
+ sanoma demo sanoma as a demo, on <database>_demo: every vendor on its fake, anyone signed
29
+ in as one of the company's people (?as=<id>), the world and moments of
30
+ scenarios/ seeded on start and every hour, nothing kept; SANOMA_DEMO=1 does
31
+ the same on a host, on the database it names
28
32
  sanoma worker the worker alone, for a deployment
29
33
  sanoma app the app alone (built with the sites), for a deployment
30
34
  sanoma wakeup the wakeup service alone, on the config's database: it calls each instance
@@ -87,6 +91,10 @@ export async function main(argv) {
87
91
  const repo = devRepo(process.cwd(), linked);
88
92
  return repo === undefined ? serveCommand(true) : dev(repo, linked);
89
93
  }
94
+ case "demo":
95
+ // As `sanoma serve` reads it on a host: the app's options take it from the environment.
96
+ process.env.SANOMA_DEMO = "1";
97
+ return serveCommand(true, { demo: true });
90
98
  case "serve":
91
99
  // --dev (hidden): the child dev mode supervises, serving the sites as `sanoma` does.
92
100
  return serveCommand(values.dev ?? false);
@@ -140,13 +148,21 @@ const port = (fallback = 3000) => Number(process.env.SANOMA_APP_PORT ?? fallback
140
148
  * problem with them is a `UsageError`, so nothing starts on policies that do not hold. Without
141
149
  * `policies`, they are left to the caller (`check` reports them). With `postgres`, its database
142
150
  * answers first (`withPostgres`: "start" starts the company's own, "find" only finds it running),
143
- * so the config resolves on it.
151
+ * so the config resolves on it. With `demo` (`sanoma demo`, whose seed empties its database), the
152
+ * config runs on `<database>_demo` beside that one, never on the company's own data.
144
153
  */
145
- async function load({ policies = true, postgres } = {}) {
154
+ async function load({ policies = true, postgres, demo = false, } = {}) {
146
155
  const loaded = await loadConfig();
147
156
  const ensured = postgres && (await withPostgres(namedDatabaseUrl(loaded.config), loaded.root, postgres === "start"));
148
- const { resolveConfig } = await import("@sanoma-ai/workflows");
157
+ const { resolveConfig, resolveDatabaseUrl } = await import("@sanoma-ai/workflows");
149
158
  try {
159
+ if (demo) {
160
+ // As `check` runs its scenarios on `_check`: the runtime makes the database when it is not there.
161
+ const own = new URL(resolveDatabaseUrl(loaded.config));
162
+ own.pathname = `${own.pathname}_demo`;
163
+ process.env.SANOMA_DATABASE_URL = own.toString();
164
+ loaded.config = { ...loaded.config, databaseUrl: own.toString() };
165
+ }
150
166
  const resolved = resolveConfig(loaded.config);
151
167
  if (policies && resolved.policyProblems.length) {
152
168
  throw new UsageError(`The policies do not hold:\n${resolved.policyProblems.join("\n")}`);
@@ -208,8 +224,8 @@ async function keep({ config, resolved, postgres }, start) {
208
224
  * `sanoma serve` (and `sanoma` outside dev mode): Postgres (the company's own unless one is
209
225
  * named), then the worker and the app in this process. With `devServer` (`sanoma`), a repo's sites are served from Vite's dev server, not built.
210
226
  */
211
- async function serveCommand(devServer) {
212
- const loaded = await load({ postgres: "start" });
227
+ async function serveCommand(devServer, { demo = false } = {}) {
228
+ const loaded = await load({ postgres: "start", demo });
213
229
  return keep(loaded, async (config, resolved) => {
214
230
  (await import("./key.js")).ensureSecretsKey(process.cwd(), log);
215
231
  const { serve } = await import("./serve.js");
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAkC,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI7C,4GAA4G;AAC5G,oGAAoG;AACpG,iFAAiF;AAEjF,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCb,CAAC;AAEF,iHAAiH;AACjH,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAElD,MAAM,SAAS,GAAG,CAAC,GAAY,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC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extends LoadedConfig {
18
18
  * config made without it gets this file as its `file`. Throws a `UsageError` when the file is
19
19
  * missing or its default export is no config.
20
20
  *
21
- * Then `<root>/resources/data.ts`, when there is one, is imported by its real path, as the
22
- * workflows that name its collections import it: each of its exports is a collection, added to
23
- * the config's `collections` (one it lists already is kept, once). An export that is not a
24
- * collection is a `UsageError` naming the file.
21
+ * Then every `.ts` file under `<root>/workflows/` and each app's `apps/<app>/workflows/` is
22
+ * imported by its real path: a default export is a workflow (`defineWorkflow`), added to the
23
+ * config's `workflows` (one it lists already is kept, once; two of one name are `resolveConfig`'s
24
+ * to refuse), and a file without one is a helper. A default export that is no workflow is a
25
+ * `UsageError` naming the file.
26
+ *
27
+ * Then `<root>/resources/data.ts` and each app's `apps/<app>/resources/data.ts`, when there is
28
+ * one, is imported by its real path, as the workflows that name its collections import it: each
29
+ * of its exports is a collection, added to the config's `collections` (one it lists already is
30
+ * kept, once). An export that is not a collection is a `UsageError` naming the file.
25
31
  */
26
32
  export declare function loadConfig(cwd?: string): Promise<LoadedConfig>;
package/dist/config.js CHANGED
@@ -19,10 +19,16 @@ export class UsageError extends Error {
19
19
  * config made without it gets this file as its `file`. Throws a `UsageError` when the file is
20
20
  * missing or its default export is no config.
21
21
  *
22
- * Then `<root>/resources/data.ts`, when there is one, is imported by its real path, as the
23
- * workflows that name its collections import it: each of its exports is a collection, added to
24
- * the config's `collections` (one it lists already is kept, once). An export that is not a
25
- * collection is a `UsageError` naming the file.
22
+ * Then every `.ts` file under `<root>/workflows/` and each app's `apps/<app>/workflows/` is
23
+ * imported by its real path: a default export is a workflow (`defineWorkflow`), added to the
24
+ * config's `workflows` (one it lists already is kept, once; two of one name are `resolveConfig`'s
25
+ * to refuse), and a file without one is a helper. A default export that is no workflow is a
26
+ * `UsageError` naming the file.
27
+ *
28
+ * Then `<root>/resources/data.ts` and each app's `apps/<app>/resources/data.ts`, when there is
29
+ * one, is imported by its real path, as the workflows that name its collections import it: each
30
+ * of its exports is a collection, added to the config's `collections` (one it lists already is
31
+ * kept, once). An export that is not a collection is a `UsageError` naming the file.
26
32
  */
27
33
  export async function loadConfig(cwd = process.cwd()) {
28
34
  const env = join(cwd, ".env");
@@ -36,31 +42,51 @@ export async function loadConfig(cwd = process.cwd()) {
36
42
  const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(file).href)));
37
43
  const config = mod.default;
38
44
  if (!isConfig(config)) {
39
- throw new UsageError(`${file} must export a config as its default export: \`export default defineConfig({ workflows, connectors })\``);
45
+ throw new UsageError(`${file} must export a config as its default export: \`export default defineConfig({ connectors })\``);
40
46
  }
41
47
  config.file ??= file;
42
48
  const root = config.root ?? dirname(file);
43
- await addCollections(config, root);
44
- return { config, root };
45
- }
46
- /** Adds the collections `<root>/resources/data.ts` exports to the config's, when the file exists. */
47
- async function addCollections(config, root) {
48
- const path = join(root, "resources", "data.ts");
49
- // A `collections` that is no list is resolveConfig's to explain.
50
- if (!existsSync(path) || (config.collections !== undefined && !Array.isArray(config.collections)))
51
- return;
52
- const file = realpathSync(path);
53
49
  // Imported here, not at the top: `cli.ts` loads this module before any command needs the runtime.
54
- const { isCollection } = await import("@sanoma-ai/workflows");
55
- const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(file).href)));
56
- const collections = new Set(config.collections);
57
- for (const [name, value] of Object.entries(mod)) {
58
- if (!isCollection(value)) {
59
- throw new UsageError(`${file} exports ${name}, which is not a collection: resources/data.ts holds collections only, each \`export const ${name} = collection({ name, key, fields })\` with collection from "sanoma/data"`);
50
+ const { filesUnder, isCollection, kindDirs } = await import("@sanoma-ai/workflows");
51
+ // A `workflows` or `collections` that is no list is resolveConfig's to explain.
52
+ if (config.workflows === undefined || Array.isArray(config.workflows)) {
53
+ const workflows = new Set(config.workflows);
54
+ const paths = kindDirs(root, "workflows").flatMap((dir) => filesUnder(dir, isSource));
55
+ // Imported at once, added in the files' order.
56
+ const modules = (await Promise.all(paths.map(importReal)));
57
+ for (const [i, { default: wf }] of modules.entries()) {
58
+ const path = paths[i];
59
+ if (wf === undefined)
60
+ continue;
61
+ if (!isWorkflow(wf)) {
62
+ throw new UsageError(`${realpathSync(path)}'s default export is not a workflow: a file of workflows/ exports one, \`export default defineWorkflow({ … })\`, or none (a helper the workflows import)`);
63
+ }
64
+ workflows.add(wf);
60
65
  }
61
- collections.add(value);
66
+ if (workflows.size > 0)
67
+ config.workflows = [...workflows];
62
68
  }
63
- config.collections = [...collections];
69
+ if (config.collections === undefined || Array.isArray(config.collections)) {
70
+ const collections = new Set(config.collections);
71
+ for (const path of kindDirs(root, "resources").map((dir) => join(dir, "data.ts"))) {
72
+ if (!existsSync(path))
73
+ continue;
74
+ for (const [name, value] of Object.entries((await importReal(path)))) {
75
+ if (!isCollection(value)) {
76
+ throw new UsageError(`${realpathSync(path)} exports ${name}, which is not a collection: resources/data.ts holds collections only, each \`export const ${name} = collection({ name, key, fields })\` with collection from "sanoma/data"`);
77
+ }
78
+ collections.add(value);
79
+ }
80
+ }
81
+ if (collections.size > 0)
82
+ config.collections = [...collections];
83
+ }
84
+ return { config, root };
64
85
  }
65
- const isConfig = (x) => typeof x === "object" && x !== null && "workflows" in x && "connectors" in x;
86
+ /** The module at `path`, imported by its real path: the module a relative import of it is. */
87
+ const importReal = (path) => import(__rewriteRelativeImportExtension(pathToFileURL(realpathSync(path)).href));
88
+ /** A workflow file's name: `.ts`, but a test (`.test.ts`, `.spec.ts`) or a declaration. */
89
+ const isSource = (name) => name.endsWith(".ts") && !/\.(test|spec|d)\.ts$/.test(name);
90
+ const isWorkflow = (x) => typeof x === "object" && x !== null && x.kind === "workflow";
91
+ const isConfig = (x) => typeof x === "object" && x !== null && "connectors" in x;
66
92
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI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CAAC;AAEvF,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAqB,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,YAAY,IAAI,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference types="node" preserve="true" />
2
- export { type ApprovalRequest, type ApprovalResult, type ApprovalState, type Approver, type Builtin, type Connector, type Ctx, defineConfig, defineSteps, defineWorkflow, type Driver, errorCode, type ErrorCode, type Expect, jsonlLedger, type LedgerRecord, type LedgerStore, mayDecide, memoryLedger, postgresLedger, type Principal, type RunView, type Seed, type SanomaConfig, type SleepRequest, type StepOptions, type Steps, type Trigger, type Use, type WorkflowDefinition, } from "@sanoma-ai/workflows";
2
+ export { type AppDefinition, type ApprovalRequest, type ApprovalResult, type ApprovalState, type Approver, type Builtin, type Connector, type Ctx, defineApp, defineConfig, defineSteps, defineWorkflow, type Driver, errorCode, type ErrorCode, type Expect, jsonlLedger, type LedgerRecord, type LedgerStore, mayDecide, memoryLedger, postgresLedger, type Principal, type RunView, type Seed, type SanomaConfig, type SleepRequest, type StepOptions, type Steps, type Trigger, type Use, type WorkflowDefinition, } from "@sanoma-ai/workflows";
3
3
  export { z } from "zod";
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@
5
5
  // What a company repo imports, from one package: what the lint lets a workflow import
6
6
  // (`allowImportNames` in `@sanoma-ai/workflows`'s `oxlint.json`: the author surface and `z`), and
7
7
  // what `sanoma.config.ts` needs besides its connectors (`defineConfig`, the ledger stores, and
8
- // `defineSteps` for the company's own scenario steps), with the types those use. Everything else (the client, the worker) stays in `@sanoma-ai/workflows`
8
+ // `defineSteps` for the company's own scenario steps), `defineApp` for an app's `app.ts`, with the types those use. Everything else (the client, the worker) stays in `@sanoma-ai/workflows`
9
9
  // and the bin.
10
- export { defineConfig, defineSteps, defineWorkflow, errorCode, jsonlLedger, mayDecide, memoryLedger, postgresLedger, } from "@sanoma-ai/workflows";
10
+ export { defineApp, defineConfig, defineSteps, defineWorkflow, errorCode, jsonlLedger, mayDecide, memoryLedger, postgresLedger, } from "@sanoma-ai/workflows";
11
11
  export { z } from "zod";
12
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,0FAA0F;AAC1F,mFAAmF;AACnF,8CAA8C;AAC9C,sFAAsF;AACtF,kGAAkG;AAClG,+FAA+F;AAC/F,0JAA0J;AAC1J,eAAe;AACf,OAAO,EAQL,YAAY,EACZ,WAAW,EACX,cAAc,EAEd,SAAS,EAGT,WAAW,EAGX,SAAS,EACT,YAAY,EACZ,cAAc,GAWf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,0FAA0F;AAC1F,mFAAmF;AACnF,8CAA8C;AAC9C,sFAAsF;AACtF,kGAAkG;AAClG,+FAA+F;AAC/F,6LAA6L;AAC7L,eAAe;AACf,OAAO,EASL,SAAS,EACT,YAAY,EACZ,WAAW,EACX,cAAc,EAEd,SAAS,EAGT,WAAW,EAGX,SAAS,EACT,YAAY,EACZ,cAAc,GAWf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}