sanoma 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/template/AGENTS.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanoma",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
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",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@sanoma-ai/app": "0.7.
|
|
66
|
+
"@sanoma-ai/app": "0.7.1",
|
|
67
67
|
"@sanoma-ai/bridge": "0.4.5",
|
|
68
|
-
"@sanoma-ai/workflows": "0.7.
|
|
68
|
+
"@sanoma-ai/workflows": "0.7.1",
|
|
69
69
|
"@types/node": "^26.6.4",
|
|
70
70
|
"oxlint": "^1.87.0",
|
|
71
71
|
"pg": "^8.23.1",
|
package/template/AGENTS.md
CHANGED
|
@@ -37,7 +37,7 @@ npm run env # rewrites .env.example from the connectors' variables
|
|
|
37
37
|
- 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.
|
|
38
38
|
- 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.
|
|
39
39
|
- 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.
|
|
40
|
-
- A site, `sites/<name>/routes/` (pages the app serves under `/sites/<name>/`, with an optional `sites/<name>/site.ts` naming it with `defineSite`), 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.
|
|
40
|
+
- 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.
|
|
41
41
|
- Never put credentials in a file here. They live in `.env` or on the app's connector pages, which store them encrypted in the database.
|
|
42
42
|
- Never delete `.sanoma/postgres`: unless `SANOMA_DATABASE_URL` names another database, it is the company's database, every record and run in it.
|
|
43
43
|
|