@sanoma-ai/workflows 0.10.2 → 0.10.3
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 +43 -11
- package/dist/apply.js +1 -1
- package/dist/apply.js.map +1 -1
- package/dist/call.d.ts +5 -2
- package/dist/call.js +65 -20
- package/dist/call.js.map +1 -1
- package/dist/change.d.ts +5 -6
- package/dist/change.js +6 -9
- package/dist/change.js.map +1 -1
- package/dist/client.d.ts +18 -0
- package/dist/client.js +35 -3
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +42 -4
- package/dist/config.js +71 -10
- package/dist/config.js.map +1 -1
- package/dist/db.d.ts +2 -0
- package/dist/db.js +7 -0
- package/dist/db.js.map +1 -1
- package/dist/deadlines.d.ts +26 -13
- package/dist/deadlines.js +50 -11
- package/dist/deadlines.js.map +1 -1
- package/dist/define.d.ts +22 -0
- package/dist/define.js +2 -0
- package/dist/define.js.map +1 -1
- package/dist/deployment-key.d.ts +20 -1
- package/dist/deployment-key.js +28 -3
- package/dist/deployment-key.js.map +1 -1
- package/dist/describe.js +28 -1
- package/dist/describe.js.map +1 -1
- package/dist/description.d.ts +3 -0
- package/dist/description.js +2 -0
- package/dist/description.js.map +1 -1
- package/dist/host.d.ts +13 -4
- package/dist/host.js +14 -5
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +30 -1
- package/dist/ledger.js +31 -0
- package/dist/ledger.js.map +1 -1
- package/dist/login-code.d.ts +17 -0
- package/dist/login-code.js +32 -0
- package/dist/login-code.js.map +1 -0
- package/dist/op.d.ts +78 -10
- package/dist/op.js +20 -0
- package/dist/op.js.map +1 -1
- package/dist/outline.js +3 -3
- package/dist/outline.js.map +1 -1
- package/dist/resource.d.ts +6 -4
- package/dist/resource.js +8 -5
- package/dist/resource.js.map +1 -1
- package/dist/resources.d.ts +4 -2
- package/dist/resources.js +15 -6
- package/dist/resources.js.map +1 -1
- package/dist/run.d.ts +3 -0
- package/dist/run.js.map +1 -1
- package/dist/runtime-ops.d.ts +123 -0
- package/dist/runtime-ops.js +222 -0
- package/dist/runtime-ops.js.map +1 -0
- package/dist/seal.d.ts +27 -0
- package/dist/seal.js +76 -0
- package/dist/seal.js.map +1 -0
- package/dist/secret-store.d.ts +6 -4
- package/dist/secret-store.js +11 -6
- package/dist/secret-store.js.map +1 -1
- package/dist/secret.d.ts +7 -0
- package/dist/secret.js +13 -1
- package/dist/secret.js.map +1 -1
- package/dist/shared.d.ts +15 -4
- package/dist/shared.js +27 -7
- package/dist/shared.js.map +1 -1
- package/dist/ssh-key.d.ts +11 -0
- package/dist/ssh-key.js +44 -0
- package/dist/ssh-key.js.map +1 -0
- package/dist/tokens.d.ts +35 -0
- package/dist/tokens.js +71 -0
- package/dist/tokens.js.map +1 -0
- package/dist/wakeup-service.js +2 -7
- package/dist/wakeup-service.js.map +1 -1
- package/dist/wakeup.d.ts +18 -0
- package/dist/wakeup.js +15 -0
- package/dist/wakeup.js.map +1 -1
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +17 -9
- package/dist/worker.js.map +1 -1
- package/oxlint.json +1 -1
- package/package.json +1 -1
- package/src/apply.ts +1 -1
- package/src/call.ts +88 -18
- package/src/change.ts +9 -20
- package/src/client.ts +48 -7
- package/src/config.ts +111 -17
- package/src/db.ts +8 -1
- package/src/deadlines.ts +66 -20
- package/src/define.ts +25 -0
- package/src/deployment-key.ts +34 -8
- package/src/describe.ts +39 -2
- package/src/description.ts +2 -0
- package/src/host.ts +22 -6
- package/src/index.ts +18 -1
- package/src/ledger.ts +52 -1
- package/src/login-code.ts +52 -0
- package/src/op.ts +84 -11
- package/src/outline.ts +3 -3
- package/src/resource.ts +8 -5
- package/src/resources.ts +13 -4
- package/src/run.ts +3 -0
- package/src/runtime-ops.ts +234 -0
- package/src/seal.ts +95 -0
- package/src/secret-store.ts +12 -9
- package/src/secret.ts +16 -1
- package/src/shared.ts +31 -7
- package/src/ssh-key.ts +48 -0
- package/src/tokens.ts +100 -0
- package/src/wakeup-service.ts +2 -8
- package/src/wakeup.ts +21 -0
- package/src/worker.ts +29 -11
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ export const shop = withSetup(defineConnector("shop", specs, info), {
|
|
|
53
53
|
|
|
54
54
|
`withSetup` lays what it is given over what the connector already carries, and keeps it on the connector's vendor record, so a spread copy of the connector keeps it too. A config that needs a driver made otherwise (another bridge, other options) swaps the driver and keeps the fake: `withSetup(github, { driver: () => githubDriver({ bridge }) })`. It is for connector packages and configs, not for workflows, which the lint does not let import it. Both are optional: a connector without a driver declares its operations and implements none, so a workflow using one is refused; a connector without a fake has none for sandbox runs, which the app's connector page says.
|
|
55
55
|
|
|
56
|
-
A connector that signs visitors in to a public site attaches a login half too, as `login`: `withSetup(connector, { login: (context) => half })`. The app calls it once per public site whose `site.ts` names the connector (`defineSite({ public: true, login: "<vendor>" })`), when it starts, with a `LoginContext` (the database, a key of its own derived from `SANOMA_SIGNING_KEY` to sign its cookies with, a vendor's secrets, the site's origins); a login that keeps tables in the database migrates them there, serialized and idempotent. The `LoginHalf` it makes (see its type) answers the provider's stable subject for a request, never a principal: the app makes the visitor's principal from it, so a connector cannot set a visitor's groups. A visitor's address, for rate limits, is the `CLIENT_IP_HEADER` header the app sets, never `X-Forwarded-For`. One vendor's connectors attach one `login`, as for a driver. [`@sanoma-ai/connector-better-auth`](https://www.npmjs.com/package/@sanoma-ai/connector-better-auth) is one, email and password on the company's database. The app makes it as it starts and sends it every request to the site's own host ([public sites](https://www.npmjs.com/package/@sanoma-ai/app#public-sites)).
|
|
56
|
+
A connector that signs visitors in to a public site attaches a login half too, as `login`: `withSetup(connector, { login: (context) => half })`. The app calls it once per public site whose `site.ts` names the connector (`defineSite({ public: true, login: "<vendor>" })`), when it starts, with a `LoginContext` (the database, a key of its own derived from `SANOMA_SIGNING_KEY` to sign its cookies with, a vendor's secrets, the site's origins, and `sendCode(email, code)` when the config names a `login.sender`); a login that keeps tables in the database migrates them there, serialized and idempotent. The `LoginHalf` it makes (see its type) answers the provider's stable subject for a request, with the email when it verified one, never a principal: the app makes the visitor's principal from it, so a connector cannot set a visitor's groups. A visitor's address, for rate limits, is the `CLIENT_IP_HEADER` header the app sets, never `X-Forwarded-For`. One vendor's connectors attach one `login`, as for a driver. [`@sanoma-ai/connector-better-auth`](https://www.npmjs.com/package/@sanoma-ai/connector-better-auth) is one, email and password (and an email code, with a sender) on the company's database; it also exports `betterAuthStaffLogin`, the staff sign-in the app uses on a host (`LoginContext.staff`: who is declared, the GitHub client, and where a sign-in is recorded). The app makes it as it starts and sends it every request to the site's own host ([public sites](https://www.npmjs.com/package/@sanoma-ai/app#public-sites)).
|
|
57
57
|
|
|
58
58
|
A model connector attaches a model half, as `model`: `withSetup(connector, { model: (context) => provider })`, an AI SDK provider (`ProviderV4` from `@ai-sdk/provider`) with the vendor's adapter as the transport. The app makes it for its model registry, once per resolved config and client (again after one that throws), where its models are `<vendor>/<model-id>`; it answers `languageModel("default")` with the connector's own default. Its `ModelContext` gives it the secrets as a login's does (the selected store and explicit bindings), which it reads when a model is called; its driver declares the key in `env`, with no operations if it needs none. One vendor's connectors attach one `model`. [`@sanoma-ai/connector-anthropic`](https://www.npmjs.com/package/@sanoma-ai/connector-anthropic) is one.
|
|
59
59
|
|
|
@@ -137,10 +137,28 @@ export const refundBot = sanoma.agent({ id: "refund-bot", onBehalfOf: bo });
|
|
|
137
137
|
export const finance = sanoma.group({ name: "finance", members: [ada] });
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
A membership is written on the group alone. An agent is in the group `agents` besides its own, with `onBehalfOf` the person whose instruction it carries; the runtime's own agents (`scenarios`, `host-check`, `schedule`, `wakeup`, which registers a wakeup) are declared by no file. They have no vendor object: no driver, no drift. `readPeople(root)` loads them from the files that may declare them (`mayDeclarePeople`: those importing `sanoma` from `sanoma/resources`), again only when one of them changed, so a request costs a `stat` per file, and `principalOf(id, people)` is who an id is: its groups, by inverting the members, and its `onBehalfOf`. Once a person is declared, `SanomaClient.start`, `call`, `decide`, `setCredential`, `setSecret`, `clearCredential` and `clearSecret` admit only a declared id (`not_admitted`, "<id> is not declared in resources/people.ts"), as the app's login admits only a declared person; while none is, any id is taken as given; while the people files have problems, nobody is admitted but the runtime's agents.
|
|
140
|
+
A membership is written on the group alone. An agent is in the group `agents` besides its own, with `onBehalfOf` the person whose instruction it carries; the runtime's own agents (`scenarios`, `host-check`, `schedule`, `wakeup`, which registers a wakeup, and `login`, which sends sign-in codes) are declared by no file. They have no vendor object: no driver, no drift. `readPeople(root)` loads them from the files that may declare them (`mayDeclarePeople`: those importing `sanoma` from `sanoma/resources`), again only when one of them changed, so a request costs a `stat` per file, and `principalOf(id, people)` is who an id is: its groups, by inverting the members, and its `onBehalfOf`. Once a person is declared, `SanomaClient.start`, `call`, `decide`, `setCredential`, `setSecret`, `clearCredential` and `clearSecret` admit only a declared id (`not_admitted`, "<id> is not declared in resources/people.ts"), as the app's login admits only a declared person; while none is, any id is taken as given; while the people files have problems, nobody is admitted but the runtime's agents.
|
|
141
141
|
|
|
142
142
|
A visitor of a public site is a principal too, which no data file declares: `visitorPrincipal(login, subject)` is one signed in through a visitor login (`visitor:<login>:<subject>`, in the group `visitors`), and `ANONYMOUS_PRINCIPAL` the one a page with nobody signed in runs as (`anonymous`, in no group); `isVisitor(principal)` tells either by its id. `admit` takes a visitor's id whatever the files say and stamps its groups, never the ones given; the staff logins (a sign-in) admit none, and a visitor sets no credential and decides no approval. So `visitors` and `anonymous` are no group's name, and `anonymous` and the `visitor:…` form no person's or agent's id (`readPeople` reports them, as it does `agents`).
|
|
143
143
|
|
|
144
|
+
A script or another service acts through an API token: `client.tokens.mint({ subject, groups })` makes one, `sca_` and 32 random bytes in base64url, and returns `{ id, token }`, the token shown this once (only its SHA-256 is kept, in `sanoma_api_tokens`); `subject` is whom it acts for (`visitor:better-auth:<id>`, say). A public site's host takes it as `Authorization: Bearer <token>`, and the request acts as `token:<id>` in the token's `groups` (admission keeps them, where a visitor's are stamped `visitors`), with no email; `client.tokens.revoke({ id })` ends it, and an unknown or revoked token is a 401.
|
|
145
|
+
|
|
146
|
+
#### Signing in on a host
|
|
147
|
+
|
|
148
|
+
The app on a host signs people in by an email code, an invite link, or GitHub ([the app's README](https://www.npmjs.com/package/@sanoma-ai/app#staff-sign-in-on-a-host)). The code goes out through the operation the config names as `login.sender`, a connector's send that takes `{ to, subject, text }`:
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
import { resend } from "@sanoma-ai/connector-resend";
|
|
152
|
+
|
|
153
|
+
export default defineConfig({
|
|
154
|
+
connectors: [resend],
|
|
155
|
+
login: { sender: resend.emails.send },
|
|
156
|
+
// …
|
|
157
|
+
});
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
With one, the runtime registers the built-in workflow `login-code` (so a company workflow may not be named that), which the app starts as the agent `login` with the code sealed under `SANOMA_SIGNING_KEY` together with the email it is for (`sealLoginCode(to, code)`, so a copy of a run's input mails it to nobody else); its one call mails "Your <company> sign-in code", under the policy and in the ledger like any send, the mail's `text` recorded as `<text>`. A policy that holds sends exempts it (`unless { … || principal == Sanoma::Principal::"login" }`): otherwise `describeConfig` reports a problem on `policies`, naming the policy and the fix. `resolveConfig` refuses a sender that is no connector's operation, does not send, has no driver, or takes no email. Each sign-in and each invite is a ledger record outside any run (`signin.recorded { person, method }` under `signin:<person>`, `invite.minted { person, by, expiresAt }` under `invite:<person>`), written by `client.recordSignIn(person, method)` and `client.recordInvite(person, { by, expiresAt })`; `client.lastSignIns(people)` reads when each last signed in and how. `sealInvite({ email })` seals an invite request for five minutes under `SANOMA_SIGNING_KEY` (`openInvite` opens one), which an instance holding the same key answers with a one-use invite link at `POST /auth/invite`.
|
|
161
|
+
|
|
144
162
|
### Policies
|
|
145
163
|
|
|
146
164
|
The policy is [Cedar](https://docs.cedarpolicy.com): `policies/**/*.cedar` in the root, evaluated in process with `@cedar-policy/cedar-wasm` against a schema built from the resolved config and the people (`schemaOf`). Everything is allowed unless a `forbid` refuses it: the runtime adds the one `permit`, so a company's policies are `forbid`s. That permit leaves [visitors](#people) out at a run's start and at a direct call: a visitor may do neither until a company `permit` names it, the one kind of `permit` a company file may hold, its principal exactly `in Sanoma::Group::"visitors"` or `== Sanoma::Principal::"anonymous"`. Inside a run a visitor was let start, its calls are allowed as anyone's, the forbids still holding, so one permit per workflow is enough and the run's operations stay out of a visitor's direct reach. A visitor's start or direct call no permit allows is denied ("A visitor may do nothing until a policy permits it", `VISITOR_DENIED`), never held; `allowAll`, a repo with no policies, denies them the same, and a visitor starts none of the runtime's own workflows but `call`.
|
|
@@ -215,7 +233,7 @@ A run's ctx calls run one at a time, in program order. Even inside `Promise.all`
|
|
|
215
233
|
|
|
216
234
|
A workflow gets these on `ctx` by listing them in `uses`, next to its operations: `"approval"` (see [Approvals](#approvals)), `"sleep"` and `"all"`. `describeConfig` lists them as each workflow's `builtins`.
|
|
217
235
|
|
|
218
|
-
Every workflow has `ctx.runId` and `ctx.now()`, without `uses`. `await ctx.now()` is the time in epoch milliseconds, recorded so a replay reads the same. A date is made from it: with `const now = await ctx.now()`, `new Date(now).toISOString()` is ISO 8601 text, which a collection's `date` field takes (`.slice(0, 10)` for the day alone), and `new Date(now + 86_400_000)` is a day later, from the same reading. The lint refuses only the uses of `Date` that read the clock, `Date.now()`, `new Date()` and `Date()` (and `Date` passed on, which it cannot follow); `new Date(value)`, `Date.parse`, `Date.UTC` and `instanceof Date` read none (see [Keeping workflows replay-safe](#keeping-workflows-replay-safe)). Read a date in UTC (`toISOString`, `getUTCHours`) and parse ISO 8601 text with an offset: the local-time methods (`getHours`, `toLocaleString`) and other text depend on the worker's time zone, which a replay on another worker may not share.
|
|
236
|
+
Every workflow has `ctx.runId`, `ctx.startedBy` and `ctx.now()`, without `uses`. `ctx.startedBy` is who started the run, `{ id, email?, subject? }` (`StartedBy`): the principal's id (a person's, `visitor:<login>:<subject>`, `token:<id>`), for a visitor the email their site's login verified, and for an api token the subject its row acts for (`SanomaClient.tokens`, read at the start, never taken from the caller), so a workflow can tell whose a record is. `await ctx.now()` is the time in epoch milliseconds, recorded so a replay reads the same. A date is made from it: with `const now = await ctx.now()`, `new Date(now).toISOString()` is ISO 8601 text, which a collection's `date` field takes (`.slice(0, 10)` for the day alone), and `new Date(now + 86_400_000)` is a day later, from the same reading. The lint refuses only the uses of `Date` that read the clock, `Date.now()`, `new Date()` and `Date()` (and `Date` passed on, which it cannot follow); `new Date(value)`, `Date.parse`, `Date.UTC` and `instanceof Date` read none (see [Keeping workflows replay-safe](#keeping-workflows-replay-safe)). Read a date in UTC (`toISOString`, `getUTCHours`) and parse ISO 8601 text with an offset: the local-time methods (`getHours`, `toLocaleString`) and other text depend on the worker's time zone, which a replay on another worker may not share.
|
|
219
237
|
|
|
220
238
|
`ctx.sleep({ until })` takes an ISO 8601 date-time with an offset (`2026-10-07T09:00:00Z`) or epoch milliseconds, and a time already past does not wait; `ctx.sleep({ minutes: 5 })` takes a duration from `ms`, `seconds`, `minutes`, `hours` and `days`, none negative. A request it can't read fails the run with `invalid_input`, as does an operation input its schema refuses. Each sleep writes a `sleep.started` record before it waits, with `until`: the time asked for, or for a duration, the record's `at` plus the duration, as the runtime saw it.
|
|
221
239
|
|
|
@@ -231,6 +249,20 @@ const comments = await ctx.all(threads.map((id) => () => ctx.forum.comments.list
|
|
|
231
249
|
|
|
232
250
|
The lint refuses `Promise.all` and `Promise.allSettled` in workflows, pointing at `ctx.all`, and `Promise.race` and `Promise.any`: calls through `ctx` run one at a time, so nothing races; pick one call, or sleep and then check.
|
|
233
251
|
|
|
252
|
+
#### The runtime's own operations
|
|
253
|
+
|
|
254
|
+
What a workflow cannot do itself, the runtime does as operations of the vendor `sanoma`, in every config with their driver: `import { sanoma } from "sanoma"`, list them in `uses` and call `ctx.sanoma.<group>.<op>`. They are decided by the policy (`Sanoma::Action::"sanoma.secret.generate"`), recorded in the ledger, never answer a secret's value, never take a `SANOMA_…` name (the runtime's own keys and credentials), and are no [direct calls](#direct-calls).
|
|
255
|
+
|
|
256
|
+
| Operation | Input | Output | What it does |
|
|
257
|
+
| ------------------------ | --------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
258
|
+
| `sanoma.secret.generate` | `{ name, kind: "random" \| "ssh-rsa" }` | `{ name, publicKey? }` | Stores a value under `name` (upper case) unless one is stored: `random`, 32 random bytes as a `generate` marker makes; `ssh-rsa`, an RSA key pair as going live's deploy key, its private half (PEM) stored and its public half (`ssh-rsa <base64>`) answered, from what is stored, so a name stored already answers its own. Effect `write` |
|
|
259
|
+
| `sanoma.secret.delete` | `{ name }` | `{}` | Deletes the stored value; none stored is nothing to do. Effect `write` |
|
|
260
|
+
| `sanoma.invite.mint` | `{ host, email, key: secret("NAME") }` | `{ url }` | Seals an invite request for `email` (good for five minutes) under the signing key stored as `NAME`, an instance's `SANOMA_SIGNING_KEY` (`sealInvite` with that key), posts it to `<host>/auth/invite` and answers the one-use link it mints; the ledger records `url` as `"<url>"`. Retried on a status worth retrying. Effect `access` |
|
|
261
|
+
| `sanoma.token.mint` | `{ subject, groups, store: "NAME" }` | `{ id }` | Mints an api token (`SanomaClient.tokens`) acting for `subject` in `groups`, stores it under `store` (refused when `store` holds a value), and answers its id alone; a host takes it as `secret("NAME")`. Not retried. Effect `access` |
|
|
262
|
+
| `sanoma.token.revoke` | `{ id }` | `{}` | Revokes the token: it resolves to nobody from now on. Effect `access` |
|
|
263
|
+
|
|
264
|
+
A sandbox run calls them over its own secrets and tokens, in memory, and `invite.mint` posts nothing there.
|
|
265
|
+
|
|
234
266
|
#### Step names
|
|
235
267
|
|
|
236
268
|
Every call is a step with a name, which a test and the graph name it by: `ctx.github.repository.import(input, { name: "Import the repository" })` and `ctx.sleep({ days: 1 }, { name: "Wait a day" })` give one, and an approval is named by its title. Without one, a call is named by its operation's id (`github.repository.import`), a sleep `Sleep` (`DEFAULT_SLEEP_NAME`, exported from the main entry and `@sanoma-ai/workflows/shared`). A name given, and an approval's title, is a string literal or a top-level `const` of the file holding one, so the outline reads it; it is one step's only (`two steps of this workflow are named "Draft"`), and a name given may not be what unnamed calls are called, an operation's id (three dotted words) or `Sleep`, so a name in a test means one call. Unnamed calls may share their default: one operation in two arms of an `if`, a retry in a `catch`, two sleeps. A call in a loop is one step, however often it runs. The outline resolves each call's name (`name` on `op`, `sleep` and `approval` nodes: the name given, the title, the operation's id or `Sleep`), except a call with a computed segment (`ctx[vendor].post.create`) and no name, which the operation it calls names in a run, and an approval whose title is no literal, which its title names in a run. The ledger has the name of every step (`name` on `op.called`, `sleep.started` and `approval.requested`, where a policy hold's is the held call's); records written before steps had names have none. `StepOptions` is the options' type.
|
|
@@ -420,7 +452,7 @@ export const github = defineConnector("github", { repository });
|
|
|
420
452
|
|
|
421
453
|
A resource type is a connector's group under its own `type`; `defineConnector` refuses one of another vendor, or under another key, or on a connector without `info.package` (data files import the types from `<package>/resources`), and keeps the list on the connector, beside its vendor info. Its operations are `<vendor>.<type>.import` (`{ id }`, an identity or a binding id) and `<vendor>.<type>.read` (`{ id, state?, handle? }`, a state from an earlier call), both answering `{ id, gone: true }` when the vendor has no such object and `{ id, gone: false, state, handle? }` when it has, both effect `read`, idempotent, with the id as the policy's `target`. "Missing" is part of the contract: the driver decides it, so a caller never parses a vendor's error for it. A driver implements them like any other. `handle` is the driver's own data about the object, opaque to everyone else, passed back unchanged (an OpenTofu driver keeps the provider's private data and state version in it); the operations declare it `opaque`, so the ledger records it as `"<handle>"`, never its bytes. Any operation may name such fields (`opaque` in its spec).
|
|
422
454
|
|
|
423
|
-
A `writable` type has four change operations besides
|
|
455
|
+
A `writable` type has four change operations besides. The built-in apply workflow (`APPLY_WORKFLOW`, `"apply"`, a name a config's own workflow may not take) calls them for the declared resources, and only it changes a declared object; any workflow may name them in its `uses` and call them for an object no data file declares, as a control plane makes and deletes a host per customer. Such a call is an ordinary write, held to the policy and recorded in the ledger like any other, and a run of any workflow but apply is refused (`invalid_input`, before the policy is asked) the call aimed at a declared object: an `update` or `delete` whose `id` the lockfile binds, or a `create` whose identity (what the type's `find` makes of `desired`) a data file declares or the lockfile binds. A direct call of one is refused as for any write. `plan` (effect `read`, idempotent) takes `{ id?, state?, handle?, desired? }` (no `id` for a create, no `desired` for a delete) and returns `{ action, planned?, unknown, replace }`: `none`, `create`, `update`, `replace` or `delete`, the new state without write-only fields, the dotted paths known only after apply, and those whose change replaces the object. `create` (effect `write`, `target` `new:<vendor>.<type>`) takes `{ desired }` and returns `{ id, state, handle? }`, `id` its binding id; `update` takes `{ id, state?, handle?, desired, expect? }` and returns the same, refusing with a `DriverError` whose `vendorCode` is `plan_changed` when the fresh plan's `action` or `replace` differs from `expect`; `delete` (idempotent) takes `{ id, state?, handle? }` and returns `{ id, gone: true }`, an object already gone included. `desired` may hold secret markers at write-only fields, which the driver resolves (`resolveSecrets`) just before the vendor call (`plan` stores no generated secret: one not stored yet gets a throwaway value); no output holds a write-only value.
|
|
424
456
|
|
|
425
457
|
Calling the type declares one resource, which is what a data file does: `repository({ owner: "acme", name: "sanoma" })` returns a frozen `Declared`, `{ vendor: "github", type: "repository", name: "acme/sanoma", desired: { owner: "acme", name: "sanoma" }, refs: {} }`, branded with its `<vendor>.<type>` under the `DECLARED` symbol. It refuses a field the schema does not have, a field the vendor owns (unless `identity` names it), a value the schema rejects, or an empty identity. A type without `find` (Stripe's, whose objects Stripe names) declares resources without a `name`: they are found only by their bindings ([below](#bindings)).
|
|
426
458
|
|
|
@@ -563,7 +595,7 @@ A host's revision is drift too (see [Hosts](#hosts)): the run resolves its ref w
|
|
|
563
595
|
|
|
564
596
|
### Apply
|
|
565
597
|
|
|
566
|
-
`apply` is the built-in workflow that makes the vendors match the data files, beside `drift` and listed the same way (`builtin: true`). It `uses` the `import` of each resource type with a driver, the change operations of each writable one, and `approval`; it is the only workflow that may call a change operation. Its input is `{ only?, bind?, answers? }` (any other field refused): `only` the declared ids (`<file>#<export>`) or orphaned lockfile keys to plan, else all; `bind`, a declared id to the vendor's id of the object to bind it to; `answers`, by id or key, `recreate` or `forget` for a gone object, `forget` or `delete` for an orphaned binding.
|
|
598
|
+
`apply` is the built-in workflow that makes the vendors match the data files, beside `drift` and listed the same way (`builtin: true`). It `uses` the `import` of each resource type with a driver, the change operations of each writable one, and `approval`; it is the only workflow that may call a change operation on a declared resource. Its input is `{ only?, bind?, answers? }` (any other field refused): `only` the declared ids (`<file>#<export>`) or orphaned lockfile keys to plan, else all; `bind`, a declared id to the vendor's id of the object to bind it to; `answers`, by id or key, `recreate` or `forget` for a gone object, `forget` or `delete` for an orphaned binding.
|
|
567
599
|
|
|
568
600
|
```ts
|
|
569
601
|
const runId = await client.apply(
|
|
@@ -581,11 +613,11 @@ This package knows nothing of OpenTofu. Resource types from an OpenTofu provider
|
|
|
581
613
|
|
|
582
614
|
### Hosts
|
|
583
615
|
|
|
584
|
-
A host is a resource type that runs the company (a container, a Render service, a Fly app): `defineResource({ …, writable: true, host })`, where `host` (`HostSpec`) says where the type takes the runtime's inputs, by dotted path into its fields (`inputs: { source, ref, secrets, port, domains? }`, `secrets` a write-only field; `domains`, when the type takes it, a public site's domain by site name, which the host hands the app as `SANOMA_DOMAINS` and `describeConfig` reports a problem for, at the declaration, when it names a site that is not public or gives one domain two sites: `sanoma.example is the domain of both www and docs`), which field apply fills with the commit (`revision`, which a data file may not declare: it names a branch, never a commit), what it can do (`capabilities: { lifetime, publicUrl, buildsFromGit, staticEgress }`, `lifetime` `long-lived` or `stops-when-quiet`, `HostLifetime`), and how its state reads (`outputs(state) → { url, revision?, healthy }`). `defineResource` refuses a `host` that names no field, or whose `secrets` is not write-only. A write-only field may be a map of secrets (`secrets: { SANOMA_DATABASE_URL: secret("DATABASE_URL") }`): its markers are kept as one at the field is. A host type is `stateless` (a `ResourceSpec` field, default true for a host): its objects keep no data, so replacing or recreating one is routine. `source` is a clone URL, or a reference to a declared repository with a `by` field holding one.
|
|
616
|
+
A host is a resource type that runs the company (a container, a Render service, a Fly app): `defineResource({ …, writable: true, host })`, where `host` (`HostSpec`) says where the type takes the runtime's inputs, by dotted path into its fields (`inputs: { source, ref, secrets, port, domains? }`, `secrets` a write-only field; `domains`, when the type takes it, a public site's domain by site name, which the host hands the app as `SANOMA_DOMAINS` and `describeConfig` reports a problem for, at the declaration, when it names a site that is not public or gives one domain two sites: `sanoma.example is the domain of both www and docs`), which field apply fills with the commit (`revision`, which a data file may not declare: it names a branch, never a commit), what it can do (`capabilities: { lifetime, publicUrl, buildsFromGit, staticEgress }`, `lifetime` `long-lived` or `stops-when-quiet`, `HostLifetime`), and how its state reads (`outputs(state) → { url, revision?, healthy }`). `defineResource` refuses a `host` that names no field, or whose `secrets` is not write-only. A host whose vendor mints the instance's bootstrap (its database URL, keys and tokens) and binds it itself declares `bindsBootstrap: true` and takes no `secrets` (Sanoma Cloud's `cloud.host`); `defineResource` refuses one that gives both, or neither. A write-only field may be a map of secrets (`secrets: { SANOMA_DATABASE_URL: secret("DATABASE_URL") }`): its markers are kept as one at the field is. A host type is `stateless` (a `ResourceSpec` field, default true for a host): its objects keep no data, so replacing or recreating one is routine. `source` is a clone URL, or a reference to a declared repository with a `by` field holding one.
|
|
585
617
|
|
|
586
618
|
A config whose connectors declare a host type has the built-in operation `sanoma.source.resolve` (`SOURCE_RESOLVE`, effect `read`): `{ url, ref } → { revision }`, by `git ls-remote` on this machine (a branch, then a tag, peeled; a full commit id is itself). Apply calls it for each host it plans, and gives the host the commit as its `revision` and the clone URL as its `source` (a referenced repository's, from its `by` field); a host whose ref does not resolve, or whose repository has no clone URL yet (apply the repository first), is a problem of the plan. The drift run calls it for every host it reads. A sandbox run calls its fake instead (`fakeSourceDriver`), with no git or network: a full commit id is itself, any other ref the SHA-1 of `<url>#<ref>`, the same on every run. A host's `secrets` map may name sanoma's own secrets (`SANOMA_…`), and no other field of any type may. `resolveRevision(url, ref)` is the same, outside a run.
|
|
587
619
|
|
|
588
|
-
A wakeup is a resource type that starts a stopped instance at a time, for what is due while its host is stopped: `defineResource({ …, writable: true, wakeup })`, where `wakeup` (`WakeupSpec`) names the field that references the host (`inputs.host`), the type's own operation the runtime registers each deadline through (`register`, called with `{ at }`, which replaces whatever the wakeup held) and how its state reads (`outputs(state) → { healthy }`); `defineResource` and `resolveConfig` refuse one that does not meet it. Declaring one in a data file is the switch, with no mode flag: `declaredWakeup(config)` reads it, and several are a problem of the data files. A wake is `GET {url}/wake`, with no query: resume if stopped. A config with `wakeup: true` runs the wakeup service itself and must not stop, so `startWorker` refuses it beside a declared wakeup.
|
|
620
|
+
A wakeup is a resource type that starts a stopped instance at a time, for what is due while its host is stopped: `defineResource({ …, writable: true, wakeup })`, where `wakeup` (`WakeupSpec`) names the field that references the host (`inputs.host`), the type's own operation the runtime registers each deadline through (`register`, called with `{ at }`, which replaces whatever the wakeup held) and how its state reads (`outputs(state) → { healthy }`); `defineResource` and `resolveConfig` refuse one that does not meet it. Declaring one in a data file is the switch, with no mode flag: `declaredWakeup(config)` reads it, and several are a problem of the data files. A wake is `GET {url}/wake`, with no query: resume if stopped. A config with `wakeup: true` runs the wakeup service itself and must not stop, so `startWorker` refuses it beside a declared wakeup. With none declared, a worker given `onStopped` takes the wakeup its environment names (`envWakeup(process.env)`, an `EnvWakeup` of `{ url, token }` when both `SANOMA_HOST_URL` (`HOST_URL`, an http(s) URL as the wakeup service keeps one) and `SANOMA_WAKEUP_TOKEN` are set, as a host Sanoma Cloud made sets them) and registers each deadline itself: `PUT {url}/__sanoma/wake` (`WAKE_PATH`) with the token as a bearer and `{ at }`, answered 204, no driver. An instance with `wakeup: true` ignores it.
|
|
589
621
|
|
|
590
622
|
A config whose connectors declare a host type also has the runtime's own wakeup, `sanoma.wakeup({ host })` (`import { sanoma } from "sanoma/resources"` in a data file), no connector named: an instance of a [wakeup service](#the-wakeup-service) for a `cloudflare.container`, `docker.container` or `testhost.app`, the fallback for a host with no clock of its own (a host's own vendor's wakeup comes first). Its driver creates, reads and deletes the instance at `SANOMA_WAKEUP_URL` with the account's `SANOMA_WAKEUP_ACCOUNT_TOKEN`, registering the instance's own `SANOMA_WAKEUP_TOKEN`, and `sanoma.wakeup.register` sends `PUT {url}/wakeup/wake { at }` with that token; `fakeSanomaWakeup()` from `@sanoma-ai/workflows/fake` is the service in memory, which sends `GET {host}/wake` at `at`.
|
|
591
623
|
|
|
@@ -605,7 +637,7 @@ A database is a resource type that holds the company's database (a Neon project,
|
|
|
605
637
|
|
|
606
638
|
Never put a secret in a workflow's input or an operation's input or output. They are persisted verbatim: DBOS keeps every step's input and output in Postgres, the ledger records each call's input and output, an approval a policy asks for carries the held call's input, and the app shows all of it to anyone who can reach it. A driver reads its credentials when it is called (from the environment or a secret store), and an operation that creates a secret (an API key, a password reset link) returns a reference to where it is stored, not the secret.
|
|
607
639
|
|
|
608
|
-
A secret a resource needs is named, never written. A data file gives `secret("NAME")` (from `sanoma/resources`; `NAME` upper case, as a variable's; sanoma's own, `SANOMA_…`, only in a host's `secrets`) at a write-only field (or an entry of a write-only map), and `secret("NAME", { generate: true })` for one apply makes when none is stored: `database_password: secret("SUPABASE_DB_PASSWORD", { generate: true })`. Declarations, checkpoints and the ledger hold its marker, `{ "$secret": "NAME", "generate": true }`; the resource type refuses one at any other field, and its schema does not judge it. The driver resolves the markers just before the vendor call, `await resolveSecrets(input, call.secrets)`: each is replaced by the stored value, a `generate` one with none stored first made (32 random bytes, base64url) and stored, and one with nothing stored fails the call for good. `call.secrets` is `{ get(name), ensure(name, make) }`, resolved through the configured store and explicit bindings (see [Credentials](#credentials)); a fake's and a sandbox run's are in memory (`memorySecrets()`, which a driver's tests use too).
|
|
640
|
+
A secret a resource needs is named, never written. A data file gives `secret("NAME")` (from `sanoma/resources`; `NAME` upper case, as a variable's; sanoma's own, `SANOMA_…`, only in a host's `secrets`) at a write-only field (or an entry of a write-only map), and `secret("NAME", { generate: true })` for one apply makes when none is stored: `database_password: secret("SUPABASE_DB_PASSWORD", { generate: true })`. Declarations, checkpoints and the ledger hold its marker, `{ "$secret": "NAME", "generate": true }`; the resource type refuses one at any other field, and its schema does not judge it. The driver resolves the markers just before the vendor call, `await resolveSecrets(input, call.secrets)`: each is replaced by the stored value, a `generate` one with none stored first made (32 random bytes, base64url) and stored, and one with nothing stored fails the call for good. `call.secrets` is `{ get(name), ensure(name, make), delete?(name) }`, resolved through the configured store and explicit bindings (see [Credentials](#credentials)); a fake's and a sandbox run's are in memory (`memorySecrets()`, which a driver's tests use too).
|
|
609
641
|
|
|
610
642
|
### Versions
|
|
611
643
|
|
|
@@ -621,7 +653,7 @@ Queues used to be one `sanoma` queue for every app and are now `sanoma:<appName>
|
|
|
621
653
|
|
|
622
654
|
A run is replayed after a restart by calling the function again and reading each step's result back, so workflows must do the same thing every time, and must reach vendors only through `ctx` so the policy sees every call. Two checks guard against getting that wrong by accident, on files under `workflows/`. They are not a sandbox: they read the source, and code written to get around them can.
|
|
623
655
|
|
|
624
|
-
oxlint, with the rules this package ships in `oxlint.json`, refuses the clock (`Date.now()`, `new Date()` and `Date()`, through the plugin's rule `sanoma/date`, which allows `new Date(await ctx.now())`; `performance`), randomness (`Math.random`, `crypto`), the network (`fetch`, `WebSocket`), timers, `process`, `globalThis`, `Promise.all` and its kin (use `ctx.all`; nothing races), and imports of `@sanoma-ai/testing`, `@sanoma-ai/app`, `@sanoma-ai/workflows/describe`, `@sanoma-ai/workflows/fake`, `@sanoma-ai/workflows/plugin`, `@sanoma-ai/workflows/scenario`, `@sanoma-ai/workflows/scenarios`, `@sanoma-ai/workflows/wakeup-service`, `@sanoma-ai/connector-*/fake` and `@sanoma-ai/connector-*/driver`. From `@sanoma-ai/workflows` it allows only `defineWorkflow`, `mayDecide`, `errorCode`, `z` (which `sanoma` re-exports) and types (the list is `allowImportNames` in `oxlint.json`; the `sanoma` package's own `oxlint.json` allows the same names from `sanoma` and refuses its subpaths): the rest could start runs or approve the run's own approvals (`SanomaClient`, `startWorker`), forge the audit record (`jsonlLedger`, `memoryLedger`: a store keeps the first record per id) or read credentials. Each message names the `ctx` replacement. `sanoma check` runs it, through `sanoma/oxlint.json`, which carries these rules; without `sanoma`, extend this package's from your `.oxlintrc.json` by its path: oxlint resolves `extends` as a file, not a package name, so `@sanoma-ai/workflows/oxlint` would not load. The `workflows/**` glob resolves against your config:
|
|
656
|
+
oxlint, with the rules this package ships in `oxlint.json`, refuses the clock (`Date.now()`, `new Date()` and `Date()`, through the plugin's rule `sanoma/date`, which allows `new Date(await ctx.now())`; `performance`), randomness (`Math.random`, `crypto`), the network (`fetch`, `WebSocket`), timers, `process`, `globalThis`, `Promise.all` and its kin (use `ctx.all`; nothing races), and imports of `@sanoma-ai/testing`, `@sanoma-ai/app`, `@sanoma-ai/workflows/describe`, `@sanoma-ai/workflows/fake`, `@sanoma-ai/workflows/plugin`, `@sanoma-ai/workflows/scenario`, `@sanoma-ai/workflows/scenarios`, `@sanoma-ai/workflows/wakeup-service`, `@sanoma-ai/connector-*/fake` and `@sanoma-ai/connector-*/driver`. From `@sanoma-ai/workflows` it allows only `defineWorkflow`, `mayDecide`, `errorCode`, `z`, `sanoma` ([the runtime's own operations](#the-runtimes-own-operations)) (which `sanoma` re-exports) and types (the list is `allowImportNames` in `oxlint.json`; the `sanoma` package's own `oxlint.json` allows the same names from `sanoma` and refuses its subpaths): the rest could start runs or approve the run's own approvals (`SanomaClient`, `startWorker`), forge the audit record (`jsonlLedger`, `memoryLedger`: a store keeps the first record per id) or read credentials. Each message names the `ctx` replacement. `sanoma check` runs it, through `sanoma/oxlint.json`, which carries these rules; without `sanoma`, extend this package's from your `.oxlintrc.json` by its path: oxlint resolves `extends` as a file, not a package name, so `@sanoma-ai/workflows/oxlint` would not load. The `workflows/**` glob resolves against your config:
|
|
625
657
|
|
|
626
658
|
```json
|
|
627
659
|
{
|
|
@@ -631,7 +663,7 @@ oxlint, with the rules this package ships in `oxlint.json`, refuses the clock (`
|
|
|
631
663
|
|
|
632
664
|
`describeConfig` (`@sanoma-ai/workflows/describe`) reads each workflow's file once, the one way the worker does, and lists on the workflow's entry, in `problems`, what oxlint can't express: imports come only from `@sanoma-ai/workflows` or `sanoma`, a `@sanoma-ai/connector-<vendor>` package, zod, or a relative file that stays inside the file's `workflows/` directory (so not `../sanoma.config.ts`, which holds the config); no namespace import of either package; no dynamic `import()`; and no `instanceof` against `DriverError`, `SanomaError`, `PolicyDeniedError` or `RejectedError`. On a replay DBOS rethrows a serialized copy of an error, which is no instance of its class, so a branch on `instanceof` would go another way than the first time and the run's steps would fall out of step. Read `errorCode(err)` instead.
|
|
633
665
|
|
|
634
|
-
In each workflow's `run` it also lists what the run's graph could not show, the same problems that make the outline `{ error }` and `startWorker` refuse (see [Outline](#outline)): `ctx` used other than called directly or read for `ctx.runId` (passed to a helper, aliased, destructured, or `run` taking it destructured); a call on `ctx` that is no operation or built-in (`ctx.ghost.post()`); `ctx.all` over members made elsewhere (write the list, or `items.map(…)`, in the call); a `ctx` call inside a function the outline does not read (one defined inside `run`, or a callback not passed to `ctx.all`, `.map`, `.forEach` or `.reduce`) or in a `finally`; and, in `run`, in a `finally` and in the callbacks that make `ctx` calls, a `return` before the end, a `throw` outside a `catch`, a `break` out of a loop or to a label, and `continue`; and a [step name](#step-names) that is not a literal or reads as an operation's id or `Sleep`, and two steps given one name. A function without `ctx` calls computes, and may do as it likes. Each message says what to write instead: inline the helper, use `if`/`else` around the rest, name the call. Each problem has its `line` and `column` in the entry's `file` (an unreadable file, or one that holds no workflow of the entry's name, is the outline's error at 1:1); `sanoma check` prints them, as `problemLine` does, and the app's startup warns of them. A test holds a repo to the same:
|
|
666
|
+
In each workflow's `run` it also lists what the run's graph could not show, the same problems that make the outline `{ error }` and `startWorker` refuse (see [Outline](#outline)): `ctx` used other than called directly or read for `ctx.runId` or `ctx.startedBy` (passed to a helper, aliased, destructured, or `run` taking it destructured); a call on `ctx` that is no operation or built-in (`ctx.ghost.post()`); `ctx.all` over members made elsewhere (write the list, or `items.map(…)`, in the call); a `ctx` call inside a function the outline does not read (one defined inside `run`, or a callback not passed to `ctx.all`, `.map`, `.forEach` or `.reduce`) or in a `finally`; and, in `run`, in a `finally` and in the callbacks that make `ctx` calls, a `return` before the end, a `throw` outside a `catch`, a `break` out of a loop or to a label, and `continue`; and a [step name](#step-names) that is not a literal or reads as an operation's id or `Sleep`, and two steps given one name. A function without `ctx` calls computes, and may do as it likes. Each message says what to write instead: inline the helper, use `if`/`else` around the rest, name the call. Each problem has its `line` and `column` in the entry's `file` (an unreadable file, or one that holds no workflow of the entry's name, is the outline's error at 1:1); `sanoma check` prints them, as `problemLine` does, and the app's startup warns of them. A test holds a repo to the same:
|
|
635
667
|
|
|
636
668
|
```ts
|
|
637
669
|
import { describeConfig } from "@sanoma-ai/workflows/describe";
|
|
@@ -805,7 +837,7 @@ Each node's `path` is its place in the outline: its index among its siblings, un
|
|
|
805
837
|
|
|
806
838
|
`defineWorkflow` records the file it is called from as the workflow's `file`, by itself; nothing passes it, and a definition made from code with no file (an eval, a bundle without one) is refused. The outline is read from that file, which must hold the workflow as an object literal with its `name` (a string literal, or a top-level `const` of the file holding one) and a `run` function taking `ctx` by name; otherwise it is `{ error }`, saying why (the file could not be read or parsed, holds no workflow of that name, or `run` destructures `ctx`). It is `{ error }` too, one line per problem at `file:line:column`, when `run` holds what the graph cannot draw: the control flow and uses of `ctx` that `lintWorkflow` refuses (see [Keeping workflows replay-safe](#keeping-workflows-replay-safe)). Either way `startWorker` refuses the config, since nothing could say where the workflow's calls are.
|
|
807
839
|
|
|
808
|
-
The worker reads each workflow's outline when it starts and holds every run to it. Each `ctx` call captures where the workflow made it, from the stack, and the worker finds the call node whose code holds that position; a call from anywhere else fails the run with `call_not_in_outline`, naming the file, line and column and what to do (inline the helper): from a function the outline does not read, from another file, from a `finally`, or through an alias (`const create = ctx.ghost.post.create`). `ctx.now()` and `ctx.
|
|
840
|
+
The worker reads each workflow's outline when it starts and holds every run to it. Each `ctx` call captures where the workflow made it, from the stack, and the worker finds the call node whose code holds that position; a call from anywhere else fails the run with `call_not_in_outline`, naming the file, line and column and what to do (inline the helper): from a function the outline does not read, from another file, from a `finally`, or through an alias (`const create = ctx.ghost.post.create`). `ctx.now()`, `ctx.runId` and `ctx.startedBy` are exempt: a read of the clock, and values. The records a call writes name its node as `node` (its `path`): `op.called`, `sleep.started`, `approval.requested` (a policy hold's approval names the held call's node) and each `group` of a `ctx.all`, so a UI places a run's steps in the code exactly, a loop's every pass on its one node. Records written by a worker from before calls were placed have no `node`.
|
|
809
841
|
|
|
810
842
|
Status: early (0.x). The API may change between minor versions.
|
|
811
843
|
|
package/dist/apply.js
CHANGED
|
@@ -10,7 +10,7 @@ export { APPLY_WORKFLOW } from "./shared.js";
|
|
|
10
10
|
// would make each match its declaration, asks one approval wherever the policy holds a change,
|
|
11
11
|
// then makes the changes in dependency order, keeping the lockfile's bindings as it goes. It is a
|
|
12
12
|
// workflow like any other, held to the same lint, so every vendor call goes through `ctx`. Only
|
|
13
|
-
// it may call a writable type's change operations (`isChangeOp`).
|
|
13
|
+
// it may call a writable type's change operations (`isChangeOp`) on a declared object.
|
|
14
14
|
/** What a person answers for a bound object the vendor no longer has (`gone`), or a binding no declaration has (`orphan`). */
|
|
15
15
|
export const PLAN_ANSWERS = ["recreate", "forget", "delete"];
|
|
16
16
|
/**
|
package/dist/apply.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../src/apply.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAiB,cAAc,EAA2B,MAAM,aAAa,CAAC;AACrF,OAAO,EACL,OAAO,EAKP,SAAS,EACT,SAAS,EACT,QAAQ,EAGR,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,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AAC,SAAS,CAAC,CAAC,CAAC,MAAM;wBAC7E,GAAG,CAAC,KAAK,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;wBACnC,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC9D,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;qBAC7C,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,IAAI,iBAAiB,CAAC,GAAG,CAAC;wBAAE,MAAM,GAAG,CAAC;oBACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;oBAC3B,OAAO,CAAC,IAAI,CAAC;wBACX,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,MAAM,EAAE,IAAI,CAAC,MAAM;wBACnB,MAAM,EAAE,QAAQ;wBAChB,GAAG,CAAC,IAAI,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;wBACjC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC;qBACzB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,MAAM,QAAQ,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;YACpF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAwB,CAAC;QAC3D,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/call.d.ts
CHANGED
|
@@ -16,8 +16,11 @@ import type { Run, StartHold, WorkerState } from "./run.ts";
|
|
|
16
16
|
* for good, and are recorded.
|
|
17
17
|
*/
|
|
18
18
|
export declare function isInfrastructureError(err: unknown, state: Pick<WorkerState, "stopped">): boolean;
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The value as the ledger records it: each of the operation's `opaque` fields as `"<name>"`, and
|
|
21
|
+
* in a run of `workflow` `login-code`, the mail's `text` and `html` too, so no colleague reads another's code.
|
|
22
|
+
*/
|
|
23
|
+
export declare function recorded(op: Op, value: unknown, workflow?: string): unknown;
|
|
21
24
|
/**
|
|
22
25
|
* Where a call is, as its records say: its outline node's `path`, and the step's name, as the
|
|
23
26
|
* outline resolved it (`OutlineNode`'s `name`), or for a call the outline could not name, the
|
package/dist/call.js
CHANGED
|
@@ -9,8 +9,9 @@ import { isOp } from "./op.js";
|
|
|
9
9
|
import { callAt, callName } from "./outline.js";
|
|
10
10
|
import { allowAll, policyOpOf } from "./policy.js";
|
|
11
11
|
import { reservedFor, runtimeHold } from "./change.js";
|
|
12
|
+
import { isChangeOp } from "./resource.js";
|
|
12
13
|
import { readPeople } from "./resources.js";
|
|
13
|
-
import { approverLabel, CALL_WORKFLOW, CHANGE_MERGE, DATA_VENDOR, errorMessage, fitsOp, WORKFLOW_ACTION, } from "./shared.js";
|
|
14
|
+
import { APPLY_WORKFLOW, approverLabel, CALL_WORKFLOW, CHANGE_MERGE, DATA_VENDOR, errorMessage, fitsOp, LOGIN_CODE_WORKFLOW, problemLine, WORKFLOW_ACTION, } from "./shared.js";
|
|
14
15
|
/** DBOS took the run from this execution: it cancelled the run, or another process took it over. */
|
|
15
16
|
const takenByDbos = (err) => causes(err).some((e) => e instanceof DBOSErrors.DBOSWorkflowCancelledError || e instanceof DBOSWorkflowConflictError);
|
|
16
17
|
/**
|
|
@@ -27,12 +28,18 @@ const takenByDbos = (err) => causes(err).some((e) => e instanceof DBOSErrors.DBO
|
|
|
27
28
|
export function isInfrastructureError(err, state) {
|
|
28
29
|
return takenByDbos(err) || (state.stopped && errorCode(err) === undefined);
|
|
29
30
|
}
|
|
30
|
-
/** The
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/** The fields of a mail a `login-code` run sends that the ledger never shows: its body, which holds the code. */
|
|
32
|
+
const LOGIN_CODE_BODY = ["text", "html"];
|
|
33
|
+
/**
|
|
34
|
+
* The value as the ledger records it: each of the operation's `opaque` fields as `"<name>"`, and
|
|
35
|
+
* in a run of `workflow` `login-code`, the mail's `text` and `html` too, so no colleague reads another's code.
|
|
36
|
+
*/
|
|
37
|
+
export function recorded(op, value, workflow) {
|
|
38
|
+
const hidden = [...(op.opaque ?? []), ...(workflow === LOGIN_CODE_WORKFLOW ? LOGIN_CODE_BODY : [])];
|
|
39
|
+
if (!hidden.length || typeof value !== "object" || value === null || Array.isArray(value))
|
|
33
40
|
return value;
|
|
34
41
|
const out = { ...value };
|
|
35
|
-
for (const name of
|
|
42
|
+
for (const name of hidden)
|
|
36
43
|
if (out[name] !== undefined)
|
|
37
44
|
out[name] = `<${name}>`;
|
|
38
45
|
return out;
|
|
@@ -43,14 +50,12 @@ const MAX_ATTEMPTS = 3;
|
|
|
43
50
|
const isSchemaError = (err) => err instanceof Error && err.name === "ZodError";
|
|
44
51
|
/**
|
|
45
52
|
* Whether DBOS should try an idempotent step again: not when the reply failed the output
|
|
46
|
-
* schema (it would fail again), and not when the
|
|
47
|
-
*
|
|
48
|
-
* `instanceof`: the error may come from another copy of this package.
|
|
53
|
+
* schema (it would fail again), and not when the error says its answer is final (`retryable:
|
|
54
|
+
* false`: a `DriverError` for a 4xx, a `SecretStoreError` other than `unavailable`). Read by
|
|
55
|
+
* property, never `instanceof`: the error may come from another copy of this package.
|
|
49
56
|
*/
|
|
50
57
|
function shouldRetry(err) {
|
|
51
|
-
|
|
52
|
-
return false;
|
|
53
|
-
return !(errorCode(err) === "driver_failed" && isFinal(err));
|
|
58
|
+
return !isSchemaError(err) && !isFinal(err);
|
|
54
59
|
}
|
|
55
60
|
/*
|
|
56
61
|
* A run's ctx calls run one at a time, in program order, even when the workflow starts several
|
|
@@ -124,10 +129,12 @@ export function buildCtx(wf, run) {
|
|
|
124
129
|
}
|
|
125
130
|
if (uses.includes("all"))
|
|
126
131
|
members.all = placed("all", (node, list) => all(run, list, node.path));
|
|
127
|
-
return guarded(members, "ctx", wf.name);
|
|
132
|
+
return guarded(members, "ctx", wf.name, { startedBy: startedByOf(run.actor) });
|
|
128
133
|
}
|
|
129
|
-
/**
|
|
130
|
-
|
|
134
|
+
/** Who started the run, as `ctx.startedBy` shows it: a plain frozen record, whose absent fields read as undefined. */
|
|
135
|
+
const startedByOf = ({ id, email, subject }) => Object.freeze({ id, ...(email && { email }), ...(subject && { subject }) });
|
|
136
|
+
/** `members`, each object in it included, refusing any member not in it (`strict`), with `plain`'s as they are. */
|
|
137
|
+
function guarded(members, path, workflow, plain = {}) {
|
|
131
138
|
const out = {};
|
|
132
139
|
for (const [key, value] of Object.entries(members)) {
|
|
133
140
|
out[key] =
|
|
@@ -135,7 +142,7 @@ function guarded(members, path, workflow) {
|
|
|
135
142
|
? guarded(value, `${path}.${key}`, workflow)
|
|
136
143
|
: value;
|
|
137
144
|
}
|
|
138
|
-
return strict(out, path, workflow);
|
|
145
|
+
return strict({ ...out, ...plain }, path, workflow);
|
|
139
146
|
}
|
|
140
147
|
/**
|
|
141
148
|
* The frame above `fn`, the `ctx` member running, read from a stack trace rather than
|
|
@@ -309,6 +316,41 @@ function ask(policy, id, answer, state = { stopped: false }) {
|
|
|
309
316
|
}
|
|
310
317
|
return policy.version === undefined ? decision : { ...decision, policyVersion: policy.version };
|
|
311
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* Refuses a change operation (`isChangeOp`) aimed at an object the data files declare, which only
|
|
321
|
+
* apply changes: an `update` or `delete` of an id the lockfile binds or a data file names, and a
|
|
322
|
+
* `create` or `update` whose identity (what its type's `find` makes of `desired`) a data file
|
|
323
|
+
* declares or the lockfile binds. Any other object is the workflow's own, its change an ordinary
|
|
324
|
+
* write. While the files have problems, which objects they declare is not known, so it refuses.
|
|
325
|
+
*/
|
|
326
|
+
async function refuseDeclared(run, op, input) {
|
|
327
|
+
const type = `${op.vendor}.${op.resource}`;
|
|
328
|
+
const { id, desired } = input;
|
|
329
|
+
const targets = [];
|
|
330
|
+
if (op.name !== "create" && typeof id === "string")
|
|
331
|
+
targets.push(id);
|
|
332
|
+
const find = run.state.types.get(type)?.find;
|
|
333
|
+
if (op.name !== "delete" && desired && find) {
|
|
334
|
+
try {
|
|
335
|
+
targets.push(find(desired));
|
|
336
|
+
}
|
|
337
|
+
catch (err) {
|
|
338
|
+
throw new SanomaError("invalid_input", `${op.id}: its desired names no ${type} (${errorMessage(err)}), so it cannot be told from a declared one`, { op: op.id, workflow: run.workflow });
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (!targets.length)
|
|
342
|
+
return;
|
|
343
|
+
const declared = await run.state.declaredObjects();
|
|
344
|
+
if (declared.problems.length) {
|
|
345
|
+
throw new SanomaError("invalid_input", `${op.id} waits for the data files to be fixed, since only apply changes a declared resource: ${declared.problems.map(problemLine).join("; ")}`, { op: op.id, workflow: run.workflow });
|
|
346
|
+
}
|
|
347
|
+
for (const target of targets) {
|
|
348
|
+
const key = declared.keys.get(`${type} ${target}`);
|
|
349
|
+
if (key === undefined)
|
|
350
|
+
continue;
|
|
351
|
+
throw new SanomaError("invalid_input", `${op.id} changes ${key}, a declared resource, which only apply does: change the data file instead`, { op: op.id, workflow: run.workflow, declared: key });
|
|
352
|
+
}
|
|
353
|
+
}
|
|
312
354
|
async function callOp(run, id, input, place, ref) {
|
|
313
355
|
// The worker's declaration, never the workflow's: its effect, schemas and retry setting.
|
|
314
356
|
const op = run.state.ops.get(id);
|
|
@@ -319,9 +361,8 @@ async function callOp(run, id, input, place, ref) {
|
|
|
319
361
|
? `No connector or driver for ${id} in this worker`
|
|
320
362
|
: `No connector or fake for ${id} in this worker: no fake its connectors attach implements it`);
|
|
321
363
|
}
|
|
322
|
-
// Only
|
|
323
|
-
|
|
324
|
-
const reserved = reservedFor(op, run.state.types);
|
|
364
|
+
// Only change takes a change's steps; `resolveConfig` refuses any other workflow that uses one.
|
|
365
|
+
const reserved = reservedFor(op);
|
|
325
366
|
if (reserved && run.workflow !== reserved.workflow) {
|
|
326
367
|
throw new SanomaError("invalid_input", `${op.id} ${reserved.does}, which only ${reserved.workflow} does`, {
|
|
327
368
|
op: op.id,
|
|
@@ -348,10 +389,14 @@ async function callOp(run, id, input, place, ref) {
|
|
|
348
389
|
const decideStep = () => DBOS.runStep(async () => {
|
|
349
390
|
if (run.sandbox === undefined)
|
|
350
391
|
await run.state.connections?.assertCurrent(connection, run.actor.id);
|
|
392
|
+
// Read in the step, so a replay reuses the first answer, and asked again after each
|
|
393
|
+
// approval, so a call made after a long wait sees the files as they are then.
|
|
394
|
+
if (run.workflow !== APPLY_WORKFLOW && isChangeOp(op, run.state.types))
|
|
395
|
+
await refuseDeclared(run, op, parsed);
|
|
351
396
|
return decide(run, op, parsed, connection);
|
|
352
397
|
}, { name: `policy:${op.id}` });
|
|
353
398
|
let decision = await decideStep();
|
|
354
|
-
const logged = recorded(op, parsed);
|
|
399
|
+
const logged = recorded(op, parsed, run.workflow);
|
|
355
400
|
const call = {
|
|
356
401
|
type: "op.called",
|
|
357
402
|
op: op.id,
|
|
@@ -439,7 +484,7 @@ async function callOp(run, id, input, place, ref) {
|
|
|
439
484
|
}
|
|
440
485
|
const { output, at, durationMs } = result;
|
|
441
486
|
try {
|
|
442
|
-
await write(run, entry(run, { ...call, output: recorded(op, output), durationMs, attempt: result.attempt }, { seq, at }));
|
|
487
|
+
await write(run, entry(run, { ...call, output: recorded(op, output, run.workflow), durationMs, attempt: result.attempt }, { seq, at }));
|
|
443
488
|
}
|
|
444
489
|
catch (err) {
|
|
445
490
|
// The vendor acted, and nothing records it. A workflow that caught this and called again
|