sanoma 0.10.2 → 0.10.4

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` 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 independent new `SANOMA_SIGNING_KEY` and `SANOMA_SECRETS_KEY` values (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.
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`, with git's `user.email` as the email a host's sign-in sends codes to), an empty `resources/` tree, `AGENTS.md`, `.env.example`), names the package after the directory, writes `.env` with independent new `SANOMA_SIGNING_KEY` and `SANOMA_SECRETS_KEY` values (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
 
@@ -52,7 +52,7 @@ export default defineWorkflow({
52
52
  });
53
53
  ```
54
54
 
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:
55
+ A workflow imports from `sanoma` what the lint lets it (`defineWorkflow`, `mayDecide`, `errorCode`, `z`, `sanoma`, the runtime's own operations, 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:
56
56
 
57
57
  ```ts
58
58
  // resources/data.ts
@@ -98,10 +98,12 @@ export const editor = sanoma.group({ name: "editor", members: [ada] });
98
98
  @hold("editor")
99
99
  @title("Review before it goes out")
100
100
  forbid (principal, action in [Sanoma::Action::"effect:publish", Sanoma::Action::"effect:send"], resource)
101
- unless { principal in Sanoma::Group::"editor" };
101
+ unless { principal in Sanoma::Group::"editor" || principal == Sanoma::Principal::"login" };
102
102
  ```
103
103
 
104
- Only a declared person signs in to the app (on this machine by picking their name; with GitHub sign-in by their verified email, then their `github` login), starts a run, calls an operation or decides an approval, and nobody decides an approval on a run they started while someone else in the group could (a founder alone in a group decides their own, and the ledger says so). Everything is allowed unless a `forbid` refuses it: one with `@hold` waits for that group's or person's approval, one without is denied with its `@reason`. A visitor of a public site, in the group `visitors` (or `anonymous`, when nobody is signed in), is the exception: it may start a run or call an operation directly only where a `permit` names it, the one `permit` a policy file may hold (`permit (principal in Sanoma::Group::"visitors", action == Sanoma::Action::"workflow:signup", resource);`), and inside a run it started its calls are allowed as anyone's, the forbids still holding. Write them against `.sanoma/schema.cedarschema`, which `sanoma check` and `sanoma` write from the config: each operation's id as an action in its effect's group, `workflow:<name>` for a run's start, the groups the people file declares, and each operation's input as `context.input`. `sanoma check` reports a policy problem at its place and runs no scenario until there are none; `sanoma` refuses to start on one. A scenario runs as the agent `scenarios` unless it says who is acting (`Given bo is acting`, `Given a visitor is acting`, `Given anonymous is acting`), and checks the policy with `Then ghost.post.publish was held for group "editor"` and `Then <op> was denied with "<reason>"`. The app's Permissions page shows what the policies answer for each group.
104
+ The `login` in its `unless` is the runtime's agent that sends sign-in codes (the built-in `login-code` workflow, when the config names `login: { sender }`): a policy that held its send would keep everyone from signing in by code, and `sanoma check` says so.
105
+
106
+ Only a declared person signs in to the app (on this machine by picking their name; on a host by an email code to their `email`, an invite link, or GitHub by their verified email, then their `github` login), starts a run, calls an operation or decides an approval, and nobody decides an approval on a run they started while someone else in the group could (a founder alone in a group decides their own, and the ledger says so). Everything is allowed unless a `forbid` refuses it: one with `@hold` waits for that group's or person's approval, one without is denied with its `@reason`. A visitor of a public site, in the group `visitors` (or `anonymous`, when nobody is signed in), is the exception: it may start a run or call an operation directly only where a `permit` names it, the one `permit` a policy file may hold (`permit (principal in Sanoma::Group::"visitors", action == Sanoma::Action::"workflow:signup", resource);`), and inside a run it started its calls are allowed as anyone's, the forbids still holding. Write them against `.sanoma/schema.cedarschema`, which `sanoma check` and `sanoma` write from the config: each operation's id as an action in its effect's group, `workflow:<name>` for a run's start, the groups the people file declares, and each operation's input as `context.input`. `sanoma check` reports a policy problem at its place and runs no scenario until there are none; `sanoma` refuses to start on one. A scenario runs as the agent `scenarios` unless it says who is acting (`Given bo is acting`, `Given a visitor is acting`, `Given anonymous is acting`), and checks the policy with `Then ghost.post.publish was held for group "editor"` and `Then <op> was denied with "<reason>"`. The app's Permissions page shows what the policies answer for each group.
105
107
 
106
108
  ## Commands
107
109
 
@@ -117,7 +119,7 @@ Run them from the directory that holds `sanoma.config.ts`. Each loads `.env` the
117
119
  | `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`. |
118
120
  | `sanoma --help` | The usage. |
119
121
 
120
- Exit codes: 2 for a mistake in the call or the repo (no `sanoma.config.ts`, an unknown command or option, a bad argument), printed with the usage where it helps; 1 for failed checks and failures while running; 0 otherwise. `SANOMA_APP_PORT` is the app's port (default 3000; 0 for any free port, which the printed address reports). `SANOMA_APP_HOST` is its address (default 127.0.0.1); `SANOMA_DOMAINS` gives a [public site](../app/README.md#public-sites) its domain, `<site>=<hostname>[,<site>=<hostname>…]` (`www=sanoma.example`, which a host resource's `domains` sets), and a malformed one exits 2; any other needs [GitHub sign-in](../app/README.md#github), which `SANOMA_GITHUB_CLIENT_ID` and `SANOMA_GITHUB_CLIENT_SECRET` turn on (both or neither, with `SANOMA_SIGNING_KEY` set; on a host beyond this machine, or with one of them set, the other may be the stored one the app's Connect page (under Hosting) saved when it created the GitHub App); a mistake in them exits 2 before anything starts, as does a problem in the policies. On SIGINT or SIGTERM the app, then the worker, then the Postgres it started, stop, and the process exits 0.
122
+ Exit codes: 2 for a mistake in the call or the repo (no `sanoma.config.ts`, an unknown command or option, a bad argument), printed with the usage where it helps; 1 for failed checks and failures while running; 0 otherwise. `SANOMA_APP_PORT` is the app's port (default 3000; 0 for any free port, which the printed address reports). `SANOMA_APP_HOST` is its address (default 127.0.0.1); `SANOMA_DOMAINS` gives a [public site](../app/README.md#public-sites) its domain, `<site>=<hostname>[,<site>=<hostname>…]` (`www=sanoma.example`, which a host resource's `domains` sets), and a malformed one exits 2; any other address signs people in with the [staff sign-in](../app/README.md#staff-sign-in-on-a-host) (an email code through the config's `login.sender`, invite links, and GitHub once `SANOMA_GITHUB_CLIENT_ID` and `SANOMA_GITHUB_CLIENT_SECRET` are both set, in the environment or stored by the app's Connect page (under Hosting) when it created the GitHub App), which needs `SANOMA_SIGNING_KEY`; a missing key, or one of the GitHub pair without the other, exits 2 before anything starts, as does a problem in the policies. On SIGINT or SIGTERM the app, then the worker, then the Postgres it started, stop, and the process exits 0.
121
123
 
122
124
  ### For a parent process
123
125
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" preserve="true" />
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";
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, sanoma, type Seed, type SanomaConfig, type SleepRequest, type StartedBy, type StepOptions, type Steps, type Trigger, type Use, type WorkflowDefinition, } from "@sanoma-ai/workflows";
3
3
  export { z } from "zod";
4
4
  export { type SecretConfiguration, type SecretBinding, type SecretStore, type SecretStoreCapabilities, type SecretAddress, type SecretValue, type Authentication, defineAuthentication, } from "@sanoma-ai/workflows";
5
5
  export { defineConnection, defineConnectionRule, connectionRef, type ConnectionRef, type ConnectionDefinition, type ConnectionRule, } from "@sanoma-ai/workflows";
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  // what `sanoma.config.ts` needs besides its connectors (`defineConfig`, the ledger stores, and
8
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 { defineApp, defineConfig, defineSteps, defineWorkflow, errorCode, jsonlLedger, mayDecide, memoryLedger, postgresLedger, } from "@sanoma-ai/workflows";
10
+ export { defineApp, defineConfig, defineSteps, defineWorkflow, errorCode, jsonlLedger, mayDecide, memoryLedger, postgresLedger, sanoma, } from "@sanoma-ai/workflows";
11
11
  export { z } from "zod";
12
12
  export { defineAuthentication, } from "@sanoma-ai/workflows";
13
13
  export { defineConnection, defineConnectionRule, connectionRef, } from "@sanoma-ai/workflows";
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,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;AACxB,OAAO,EAQL,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GAId,MAAM,sBAAsB,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,EAGd,MAAM,GAUP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAQL,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GAId,MAAM,sBAAsB,CAAC"}
package/dist/init.d.ts CHANGED
@@ -6,6 +6,8 @@ export interface Creator {
6
6
  id: string;
7
7
  name?: string;
8
8
  github?: string;
9
+ /** Their email: what the staff login sends a sign-in code to, and an invite is for, on a host. */
10
+ email?: string;
9
11
  }
10
12
  export interface StartOptions {
11
13
  /** Runs `<packageManager> install` in the directory; the default inherits this process's stdio. */
@@ -37,7 +39,8 @@ export declare function templatePeopleIds(): string[];
37
39
  /**
38
40
  * Who is starting the company: their GitHub login, as `gh` is signed in, which the GitHub sign-in
39
41
  * matches and the loopback sign-in takes as the id; else this machine's user name. Named as git's
40
- * `user.name`, which `startCompany` requires.
42
+ * `user.name`, which `startCompany` requires, with git's `user.email`, which a host's staff login
43
+ * sends sign-in codes to.
41
44
  */
42
45
  export declare function whoIsStarting(): Promise<Creator>;
43
46
  /** The package manager named first in `npm_config_user_agent` (`pnpm/11.1.0 npm/? node/v24…`), else pnpm. */
package/dist/init.js CHANGED
@@ -114,14 +114,16 @@ function machineUser() {
114
114
  /**
115
115
  * Who is starting the company: their GitHub login, as `gh` is signed in, which the GitHub sign-in
116
116
  * matches and the loopback sign-in takes as the id; else this machine's user name. Named as git's
117
- * `user.name`, which `startCompany` requires.
117
+ * `user.name`, which `startCompany` requires, with git's `user.email`, which a host's staff login
118
+ * sends sign-in codes to.
118
119
  */
119
120
  export async function whoIsStarting() {
120
- const [login, name] = await Promise.all([
121
+ const [login, name, email] = await Promise.all([
121
122
  output("gh", ["api", "user", "--jq", ".login"]),
122
123
  output("git", ["config", "user.name"]),
124
+ output("git", ["config", "user.email"]),
123
125
  ]);
124
- const named = name ? { name } : {};
126
+ const named = { ...(name && { name }), ...(/^[^\s@]+@[^\s@]+$/.test(email) && { email }) };
125
127
  if (/^[A-Za-z0-9-]+$/.test(login))
126
128
  return { id: free(login), github: login, ...named };
127
129
  return { id: free(machineUser()), ...named };
package/dist/init.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,cAAc,EACd,MAAM,EACN,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEhC,gGAAgG;AAChG,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,cAAc,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAErD,8DAA8D;AAC9D,MAAM,SAAS,GAAG,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;AAiBnF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAW,EACX,EAAE,OAAO,GAAG,WAAW,EAAE,OAAO,GAAG,aAAa,EAAE,GAAG,GAAG,GAAG,EAAE,GAAE,CAAC,E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IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,cAAc,8BAA8B,GAAG,eAAe,CAAC,CAAC,CAC9G,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/dist/serve.d.ts CHANGED
@@ -48,11 +48,12 @@ export type ReadSecrets = (names: string[]) => Promise<Map<string, string>>;
48
48
  export declare function parseDomains(value: string | undefined): Record<string, string> | undefined;
49
49
  /**
50
50
  * The app's host (`SANOMA_APP_HOST`, default 127.0.0.1), the public sites' domains
51
- * (`SANOMA_DOMAINS`, `parseDomains`) and, when the `SANOMA_GITHUB_*` variables are set, GitHub
52
- * sign-in; both or neither, and any host but this machine needs it. An empty value is the same
53
- * as unset. On a host beyond this machine, or with one of them set, one the environment leaves
54
- * unset is read from the stored secrets (`readSecrets`), where creating the GitHub App on the
55
- * app's connect page put them. A mistake in them is a UsageError.
51
+ * (`SANOMA_DOMAINS`, `parseDomains`) and its login: on this machine the loopback picker (the
52
+ * app's default); on any other host the staff login (`staffLogin` over Better Auth), which needs
53
+ * `SANOMA_SIGNING_KEY`, with GitHub as a method when `SANOMA_GITHUB_CLIENT_ID` and
54
+ * `SANOMA_GITHUB_CLIENT_SECRET` are both set, in the environment or in the stored secrets
55
+ * (`readSecrets`), where creating the GitHub App on the app's connect page put them. An empty
56
+ * value is the same as unset. A mistake in them is a UsageError.
56
57
  */
57
58
  export declare function appOptions(readSecrets?: ReadSecrets): Promise<Pick<AppOptions, "host" | "login" | "domains">>;
58
59
  /**
package/dist/serve.js CHANGED
@@ -2,8 +2,9 @@ import { spawn } from "node:child_process";
2
2
  import { realpathSync } from "node:fs";
3
3
  import { dirname, extname, isAbsolute, relative, sep } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { githubLogin, startApp } from "@sanoma-ai/app";
6
- import { errorMessage, isLoopback, resolveConfig, resolveDatabaseUrl, SanomaClient, startWorker, superviseWorker, } from "@sanoma-ai/workflows";
5
+ import { staffLogin, startApp } from "@sanoma-ai/app";
6
+ import { betterAuthStaffLogin } from "@sanoma-ai/connector-better-auth";
7
+ import { deploymentKey, errorMessage, isLoopback, resolveConfig, resolveDatabaseUrl, SanomaClient, startWorker, superviseWorker, } from "@sanoma-ai/workflows";
7
8
  import { describeConfig, readPeople, schemaOf, writeGenerated } from "@sanoma-ai/workflows/describe";
8
9
  import { domainsOf } from "@sanoma-ai/workflows/shared";
9
10
  import { UsageError } from "./config.js";
@@ -163,20 +164,28 @@ export function parseDomains(value) {
163
164
  }
164
165
  /**
165
166
  * The app's host (`SANOMA_APP_HOST`, default 127.0.0.1), the public sites' domains
166
- * (`SANOMA_DOMAINS`, `parseDomains`) and, when the `SANOMA_GITHUB_*` variables are set, GitHub
167
- * sign-in; both or neither, and any host but this machine needs it. An empty value is the same
168
- * as unset. On a host beyond this machine, or with one of them set, one the environment leaves
169
- * unset is read from the stored secrets (`readSecrets`), where creating the GitHub App on the
170
- * app's connect page put them. A mistake in them is a UsageError.
167
+ * (`SANOMA_DOMAINS`, `parseDomains`) and its login: on this machine the loopback picker (the
168
+ * app's default); on any other host the staff login (`staffLogin` over Better Auth), which needs
169
+ * `SANOMA_SIGNING_KEY`, with GitHub as a method when `SANOMA_GITHUB_CLIENT_ID` and
170
+ * `SANOMA_GITHUB_CLIENT_SECRET` are both set, in the environment or in the stored secrets
171
+ * (`readSecrets`), where creating the GitHub App on the app's connect page put them. An empty
172
+ * value is the same as unset. A mistake in them is a UsageError.
171
173
  */
172
174
  export async function appOptions(readSecrets) {
173
175
  const env = process.env;
174
176
  const domains = parseDomains(env.SANOMA_DOMAINS);
175
177
  const host = env.SANOMA_APP_HOST || undefined;
176
178
  const options = { host, ...(domains && { domains }) };
177
- const beyond = host !== undefined && !isLoopback(host);
179
+ if (host === undefined || isLoopback(host))
180
+ return options;
181
+ try {
182
+ deploymentKey("SANOMA_SIGNING_KEY");
183
+ }
184
+ catch (err) {
185
+ throw new UsageError(`SANOMA_APP_HOST=${host} signs people in, which ${errorMessage(err)}`);
186
+ }
178
187
  const found = new Map(GITHUB.flatMap((name) => (env[name] ? [[name, env[name]]] : [])));
179
- if ((beyond || found.size) && readSecrets && found.size < GITHUB.length) {
188
+ if (readSecrets && found.size < GITHUB.length) {
180
189
  const stored = await readSecrets([...GITHUB]).catch((err) => {
181
190
  throw new UsageError(`GitHub sign-in could not read the stored client id and secret: ${errorMessage(err)}`);
182
191
  });
@@ -185,21 +194,12 @@ export async function appOptions(readSecrets) {
185
194
  found.set(name, value);
186
195
  }
187
196
  const [clientId, clientSecret] = GITHUB.map((name) => found.get(name));
188
- if (!clientId && !clientSecret) {
189
- if (beyond)
190
- throw new UsageError(`SANOMA_APP_HOST=${host} needs GitHub sign-in: set ${GITHUB.join(", ")}`);
191
- return options;
192
- }
193
- if (!clientId || !clientSecret) {
197
+ if (Boolean(clientId) !== Boolean(clientSecret)) {
194
198
  const missing = GITHUB.filter((name) => !found.has(name));
195
199
  throw new UsageError(`GitHub sign-in needs ${GITHUB.join(", ")}: ${missing.join(", ")} not set`);
196
200
  }
197
- try {
198
- return { ...options, login: githubLogin({ clientId, clientSecret }) };
199
- }
200
- catch (err) {
201
- throw new UsageError(errorMessage(err));
202
- }
201
+ const github = clientId && clientSecret ? { github: { clientId, clientSecret } } : {};
202
+ return { ...options, login: staffLogin(betterAuthStaffLogin, github) };
203
203
  }
204
204
  /**
205
205
  * The sites' build, the worker under a supervisor (`superviseWorker`), the wakeup service when
package/dist/serve.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QA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144
144
  "mayDecide",
145
145
  "errorCode",
146
+ "sanoma",
146
147
  "z"
147
148
  ],
148
149
  "allowTypeImports": true,
@@ -154,6 +155,7 @@
154
155
  "defineWorkflow",
155
156
  "mayDecide",
156
157
  "errorCode",
158
+ "sanoma",
157
159
  "z"
158
160
  ],
159
161
  "allowTypeImports": true,
@@ -172,6 +174,8 @@
172
174
  "@sanoma-ai/workflows/plugin",
173
175
  "@sanoma-ai/workflows/scenario",
174
176
  "@sanoma-ai/workflows/scenarios",
177
+ "@sanoma-ai/workflows/cloud-identity",
178
+ "@sanoma-ai/workflows/kms-secrets",
175
179
  "@sanoma-ai/workflows/wakeup-service"
176
180
  ],
177
181
  "message": "A workflow must call vendors through ctx, so the policy sees every call: import the connector itself, `@sanoma-ai/connector-<vendor>`."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanoma",
3
- "version": "0.10.2",
3
+ "version": "0.10.4",
4
4
  "description": "One command over a Sanoma repo: run the worker and the app, check it, write its .env.example, export a run's ledger",
5
5
  "keywords": [
6
6
  "approvals",
@@ -69,9 +69,10 @@
69
69
  "access": "public"
70
70
  },
71
71
  "dependencies": {
72
- "@sanoma-ai/app": "0.10.1",
73
- "@sanoma-ai/bridge": "0.5.0",
74
- "@sanoma-ai/workflows": "0.10.1",
72
+ "@sanoma-ai/app": "0.10.2",
73
+ "@sanoma-ai/bridge": "0.5.1",
74
+ "@sanoma-ai/connector-better-auth": "0.2.0",
75
+ "@sanoma-ai/workflows": "0.10.3",
75
76
  "@types/node": "^26.6.4",
76
77
  "oxlint": "^1.87.0",
77
78
  "pg": "^8.23.1",
@@ -37,7 +37,7 @@ The app's chat answers on the company's Anthropic key (`@sanoma-ai/connector-ant
37
37
  - Define each workflow's `name` as a string literal, one workflow per file as its default export: the app finds the workflow in its file by it, and `sanoma` finds the file (a file of `workflows/` without a default export is a helper).
38
38
  - Every operation a workflow calls is listed in its `uses`; add the connector to `sanoma.config.ts` and to `package.json`.
39
39
  - Declare the company's own records as collections in `resources/data.ts`, which imports `collection` from `sanoma/data` and holds collections only: the runtime imports it, and so does a workflow that names a collection's operations (`import { outbound } from "../resources/data.ts"`, the one file outside `workflows/` a workflow may import). Every other data file declares resources: `export const <name> = <vendor>.<type>({ … })`, one export per resource; Sanoma loads the files, so a value may be computed, and the `check` script reports a file that does not load, at its line.
40
- - Only a person declared with `sanoma.person` (in `resources/people.ts` by convention, a data file like any other) signs in to the app (by `id` on this machine; with GitHub sign-in by email, then `github` login), starts a run, calls an operation or decides an approval, in the groups that list them (`sanoma.group({ name, members: [ada, refundBot] })`, the one place a membership is written). An agent (`sanoma.agent({ id, onBehalfOf: bo })`) is in the group `agents` besides; it never signs in. A new colleague is an edit to that file before their first sign-in. Nobody decides an approval on a run they started while someone else in the group could; alone in it, they decide, and the ledger says so.
40
+ - Only a person declared with `sanoma.person` (in `resources/people.ts` by convention, a data file like any other) signs in to the app (by `id` on this machine; on a host by an email code to their `email`, an invite link, or GitHub by email, then `github` login), starts a run, calls an operation or decides an approval, in the groups that list them (`sanoma.group({ name, members: [ada, refundBot] })`, the one place a membership is written). An agent (`sanoma.agent({ id, onBehalfOf: bo })`) is in the group `agents` besides; it never signs in. A new colleague is an edit to that file before their first sign-in. Nobody decides an approval on a run they started while someone else in the group could; alone in it, they decide, and the ledger says so.
41
41
  - The policies are `policies/*.cedar`, written in [Cedar](https://docs.cedarpolicy.com) against `.sanoma/schema.cedarschema`. Everything is allowed unless a `forbid` refuses it; the runtime writes the `permit` for people and agents, so a `permit` here is a problem unless it is for a public site's visitors (its principal `in Sanoma::Group::"visitors"` or `== Sanoma::Principal::"anonymous"`), who may do nothing else. A `forbid` with `@hold("<group>")` (or a person's id, or `"on-behalf-of"` for whom an agent acts) waits for that approver, with `@title` as its title in the Inbox, and the run goes on once they approve; one without `@hold` is denied, with `@reason` as the message. Actions are each operation's id (`Sanoma::Action::"ghost.post.publish"`), in its effect's group (`Sanoma::Action::"effect:publish"`), and `Sanoma::Action::"workflow:<name>"` for starting a run; `principal in Sanoma::Group::"editor"` is membership; `context.input` is the call's input. A change to this repository is decided on its merge, `Sanoma::Action::"sanoma.change.merge"`, on a `Sanoma::Change` whose attributes are its facts (`resource.touches.contains("resources/finance/")`: every path it edits and each parent directory); `policies/changes.cedar` holds every change for `admin`, and a change to `policies/` or the people waits for `admin` whatever the policies say. The app's Permissions page shows what they answer for each group. The `check` script reports a policy problem (a field, action or group the schema lacks, a `@hold` naming no one declared) at its `file:line:col`, and runs no scenario until there are none; `npm run dev` refuses to start on them.
42
42
  - Describe each workflow's expected runs in `scenarios/<workflow>/<name>.feature`, and run the `check` script after every change. A scenario runs as the runtime's own agent `scenarios` unless it says who is acting (`Given reviewer is acting`), and checks the policy with `Then <op> was held for group "<group>"` and `Then <op> was denied with "<reason>"`; a scenario's approver (`is approved by reviewer`) must be declared. `reviewer` in `resources/people.ts` is a stand-in who can sign in and approve: replace them with a real colleague, in the scenarios too.
43
43
  - A site, `sites/<name>/routes/` (pages the app serves under `/sites/<name>/`, with an optional `sites/<name>/site.ts` naming it with `defineSite`, its `icon` in the app's bar a Lucide icon's name such as `"calendar-days"`), is browser code: no server code, credential or `process.env` under `sites/`, which the `check` script holds it to, and the folder's name is its URL segment (lowercase letters, digits and dashes). Its route files import `createFileRoute` from `@tanstack/react-router`; what talks to the app from `sanoma/site`: routing (`Link`, `Outlet`, `useNavigate`, `defineSite`, …), `api`, `<RunForm workflow="<name>" />` (the app's start form for a workflow) and `useActor()` (who is signed in); and how a page looks from `sanoma/ui`, the app's own components, presentational only (`Button`, `Card`, `Table`, `PageHeader`, `Region`, `Facts`, `FloatingCard`, …): `import { RunForm } from "sanoma/site";` beside `import { Region } from "sanoma/ui";`. Colour a page with the theme's utilities (`bg-card`, `text-muted-foreground`, `border-border`, `bg-primary/10` for a tint), never raw colours: the app's theme has no `bg-white` or `text-red-500` (a public site with a look of its own brings its own stylesheet, as the app package's README shows). A page reaches data and workflows only through `api` from `sanoma/site`, as the person on the page: `api.data.<collection>.list()`, a vendor's read such as `api.<vendor>.<resource>.get(…)`, `await api.<workflow>(input)` or `api.<workflow>.start(input)` (the workflow's name in camelCase); see the app package's README (Sites). Name what a page calls with literals (`workflow="announce"`, `api.announce.start(…)`, not a variable): the app reads a site's calls from its code to list them under each workflow's Used by, and the `check` script fails on a call to a workflow, collection or operation that does not exist. While the `dev` script runs, an edit to a site shows in the open page as it is saved, and a new site folder is live without a restart.
@@ -6,7 +6,8 @@
6
6
  // resources/people.ts declares, and each operation's input as `context.input`.
7
7
  // A `permit` is only for a public site's visitors: its principal `in Sanoma::Group::"visitors"` or `== Sanoma::Principal::"anonymous"`.
8
8
 
9
- // Publishing or sending waits for someone in editor, unless someone in editor asked for it.
9
+ // Publishing or sending waits for someone in editor, unless someone in editor asked for it, or
10
+ // it is a sign-in code the runtime's agent `login` sends (the built-in `login-code` workflow).
10
11
  @id("editor-reviews")
11
12
  @hold("editor")
12
13
  @title("Review before it goes out")
@@ -15,4 +16,4 @@ forbid (
15
16
  action in [Sanoma::Action::"effect:publish", Sanoma::Action::"effect:send"],
16
17
  resource
17
18
  )
18
- unless { principal in Sanoma::Group::"editor" };
19
+ unless { principal in Sanoma::Group::"editor" || principal == Sanoma::Principal::"login" };