@nylorun/runtime 0.15.0-beta → 0.15.1-beta

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.1-beta
4
+
5
+ ### Patch Changes
6
+
7
+ - Pin core to the tested release.
8
+ - Pin harness to the tested release.
9
+ - Updated dependencies [4b9906f]
10
+ - Updated dependencies
11
+ - @nylorun/core@0.11.0-beta
12
+ - @nylorun/harness@0.21.2-beta
13
+
3
14
  ## 0.15.0-beta
4
15
 
5
16
  ### Major Changes
package/README.md CHANGED
@@ -18,7 +18,7 @@ npm run build --workspace @nylorun/runtime
18
18
  ## Running the Runtime
19
19
 
20
20
  The Runtime runs as the `ghcr.io/nylorun/runtime` image, next to Postgres,
21
- Restate and S2: `nylorun start` runs that stack on a developer machine. The
21
+ Restate and S2: `nylorun start` runs them, as a local Tenant, on a developer machine. The
22
22
  package is a library with no bin; its Host entry is `@nylorun/runtime/server`
23
23
  (`dist/host/main.js`), which requires `NYLORUN_DATABASE_URL`. For tests and
24
24
  ephemeral embeds, use `startEphemeralRuntime()` from `@nylorun/runtime/core`.
@@ -45,12 +45,12 @@ and `--service` picks what a process runs: `core` serves the Tenant API, Admin
45
45
  API and SSE and runs the stream relay, `loop` runs advances (the Worker), and
46
46
  `gates` is the Model Gate, the only process that reads a model credential and
47
47
  calls providers. `core` and `loop` may share a process; `gates` never joins
48
- them. The local stack packs `core,loop` into the `runtime` container and
48
+ them. A local Tenant packs `core,loop` into the `runtime` container and
49
49
  `gates` into the `gateway` container (the combined packing). `--role
50
50
  api|worker|all` is the deprecated name of `--service core`, `loop` and
51
51
  `core,loop`.
52
52
 
53
- The container is configured by its environment, which the stack's Compose file
53
+ The container is configured by its environment, which a local Tenant's Compose file
54
54
  sets: `NYLORUN_DATABASE_URL` (required), `NYLORUN_RESTATE_INGRESS_URL`,
55
55
  `NYLORUN_RESTATE_ADMIN_URL`, `NYLORUN_WORKER_URL` and
56
56
  `NYLORUN_RESTATE_IDENTITY_KEY` (Restate), `NYLORUN_S2_ENDPOINT` and
@@ -66,15 +66,15 @@ container it refuses to start without them. A `gates` process needs only
66
66
  `NYLORUN_GATES_ALLOWED_HOSTS`) and the Host's `tenant/` directory, which it
67
67
  never writes; it serves the database's one Tenant. `NYLORUN_PACKING` (`combined` or `split`) is logged at startup.
68
68
 
69
- With an operator listener (the stack's default: container port 4001), the Host
69
+ With an operator listener (a local Tenant's default: container port 4001), the Host
70
70
  serves two ports. The public one serves the Tenant API, to browsers too when
71
71
  browser access is on, and answers admin routes with the opaque `404`. The
72
72
  operator one serves the Admin API, Host shutdown and the Tenant API, never to
73
73
  browsers; keep it on loopback or a private network and never proxy it. Outside
74
74
  a container, `adminPort` in `host.json` does the same on loopback.
75
75
 
76
- The Host root is `NYLORUN_HOME` or `~/.nylorun` (bind-mounted at `/nylorun` in
77
- the stack). What stays on the Host is under `tenant/`.
76
+ The Host root is `NYLORUN_HOME` or `~/.nylorun` (for a local Tenant,
77
+ `~/.nylorun/tenants/<name>/`, bind-mounted at `/nylorun` in its containers). What stays on the Host is under `tenant/`.
78
78
 
79
79
  ## Layout
80
80
 
@@ -101,7 +101,7 @@ the stack). What stays on the Host is under `tenant/`.
101
101
  Every route checks `Host` first (`421 host_rejected`) and rejects non-JSON bodies
102
102
  with `415 unsupported_media_type`. An `Origin` is `403 origin_rejected` on
103
103
  `/health`, `/ready`, admin routes, and everywhere when browser access is off.
104
- With browser access on (feature `browser-access`: the stack's default, or
104
+ With browser access on (feature `browser-access`: a local Tenant's default, or
105
105
  `browserAccess` in `host.json`), the Host answers preflights for browser routes
106
106
  from the route alone, and the Tenant admits an `Origin` only with a publishable
107
107
  key (`Nylorun-Key`) that lists it, adding CORS headers only then; Tenant keys
@@ -157,7 +157,7 @@ principal for `applicationKey`), and serves the Tenant a database already holds.
157
157
  data stays after `close()`; give each test Tenant its own database and drop it
158
158
  afterwards. Its
159
159
  streams and scheduling are in process and gone after `close()`. The smoke checks do
160
- not use it; they reset and seed the Tenant of a temporary Docker stack
160
+ not use it; they reset and seed a temporary local Tenant
161
161
  (`scripts/lib/stack-tenant.mjs`).
162
162
 
163
163
  ```ts
@@ -198,8 +198,8 @@ Tenant owns each sandbox; backend names are prefixed `nylorun-<tenant-id>-`.
198
198
  ## Local Project workflow
199
199
 
200
200
  A project depends on `@nylorun/agents` only. `npx nylorun start` in the project
201
- runs its local stack (Docker), whose Runtime creates the stack's one Tenant, and
202
- writes the Project link; the project's `npm run dev` runs `src/main.ts` under
201
+ runs its local Tenant (Docker), named after the project directory, and writes
202
+ the Project link (outside a project it runs the Tenant `default`); the project's `npm run dev` runs `src/main.ts` under
203
203
  `tsx watch`; `npx nylorun studio` opens Studio on that Tenant.
204
204
 
205
205
  ## Troubleshooting
@@ -210,11 +210,11 @@ writes the Project link; the project's `npm run dev` runs `src/main.ts` under
210
210
  | `GET /ready` is 503 and `/v1/admin/status` names a `tenant.cause` | The Tenant could not be opened; every Tenant request is the opaque `404`. Follow the cause's `repair`, then restart the Runtime |
211
211
  | `corrupt` / `migration-failed` / `envelope-invalid` / `open-failed` / `open-timeout` | Follow the cause's `repair` string |
212
212
  | `schema-too-new` | Run a Runtime at least as new as the one that migrated the database |
213
- | `database-layout-old` | The database holds `tenant_<id>` schemas of an older Runtime, or the `schema_version` tables of a pre-release one: point the Runtime at a new database (a new stack); the old one is left as it is |
213
+ | `database-layout-old` | The database holds `tenant_<id>` schemas of an older Runtime, or the `schema_version` tables of a pre-release one: point the Runtime at a new database (locally, a new Tenant: `nylorun start --tenant <new name>`); the old one is left as it is |
214
214
  | `426 protocol_unsupported` | Upgrade clients or Host to a compatible set |
215
215
  | `421 host_rejected` / `403 origin_rejected` | In a container, list the `Host` in `NYLORUN_ALLOWED_HOSTS`. From a browser, use a subject token and a publishable key that lists the page's origin, never a Tenant key |
216
216
  | `503` for a Tenant | Postgres or Restate is unreachable; `GET /ready` names which |
217
- | Port in use | Change `NYLORUN_PORT` in `~/.nylorun/stacks/<name>/docker/.env` and run `nylorun start` |
217
+ | Port in use | Change `NYLORUN_PORT` in `~/.nylorun/tenants/<name>/docker/.env` and run `nylorun start` |
218
218
  | Logs | `nylorun logs runtime` |
219
219
 
220
220
  Definitions have no `agent.run()`; applications use `@nylorun/agents`.
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.2.0",
3
3
  "info": {
4
4
  "title": "Nylorun Runtime: Admin API",
5
- "version": "0.15.0-beta",
5
+ "version": "0.15.1-beta",
6
6
  "description": "The Host's status, its Tenant's state and shutdown, with the admin key. Served on the operator listener when the Host has one; the public listener answers these routes with the opaque 404.",
7
7
  "x-nylorun-protocol": {
8
8
  "min": 4,
@@ -27,7 +27,7 @@
27
27
  "servers": [
28
28
  {
29
29
  "url": "{origin}",
30
- "description": "The operator listener: the local stack's, or where yours runs",
30
+ "description": "The operator listener: a local Tenant's, or where yours runs",
31
31
  "variables": {
32
32
  "origin": {
33
33
  "default": "http://localhost:8788"
@@ -100,7 +100,7 @@ export function tenantDocument() {
100
100
  servers: [
101
101
  {
102
102
  url: "{origin}",
103
- description: "A Runtime: the local stack (`nylorun start`), or where yours runs",
103
+ description: "A Runtime: a local Tenant (`nylorun start`), or where yours runs",
104
104
  variables: { origin: { default: "http://localhost:8787" } },
105
105
  },
106
106
  ],
@@ -128,7 +128,7 @@ export function adminDocument() {
128
128
  servers: [
129
129
  {
130
130
  url: "{origin}",
131
- description: "The operator listener: the local stack's, or where yours runs",
131
+ description: "The operator listener: a local Tenant's, or where yours runs",
132
132
  variables: { origin: { default: "http://localhost:8788" } },
133
133
  },
134
134
  ],
package/dist/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.2.0",
3
3
  "info": {
4
4
  "title": "Nylorun Runtime: Tenant API",
5
- "version": "0.15.0-beta",
5
+ "version": "0.15.1-beta",
6
6
  "description": "Agents, sessions and their events, vaults, access and the Tenant's settings. A Runtime serves one Tenant: its URL is the Tenant's, and no request names it. Every request sends `Nylorun-Protocol`. Who may call each operation is its `security` and its `x-nylorun-credentials`, `x-nylorun-scopes` (the subject scopes that reach it) and `x-nylorun-browser` fields.",
7
7
  "x-nylorun-protocol": {
8
8
  "min": 4,
@@ -27,7 +27,7 @@
27
27
  "servers": [
28
28
  {
29
29
  "url": "{origin}",
30
- "description": "A Runtime: the local stack (`nylorun start`), or where yours runs",
30
+ "description": "A Runtime: a local Tenant (`nylorun start`), or where yours runs",
31
31
  "variables": {
32
32
  "origin": {
33
33
  "default": "http://localhost:8787"
@@ -35,7 +35,7 @@ export async function assertLogicalReplication(sql) {
35
35
  (SELECT rolreplication OR rolsuper FROM pg_roles WHERE rolname = current_user) AS replicates`;
36
36
  if (row?.wal_level !== "logical")
37
37
  throw new Error(`Postgres has wal_level = ${row?.wal_level ?? "unknown"}; the stream relay needs logical replication. ` +
38
- "Set wal_level = logical and restart Postgres (`nylorun start` does this for the local stack; " +
38
+ "Set wal_level = logical and restart Postgres (`nylorun start` does this for a local Tenant; " +
39
39
  "on a managed Postgres, turn on its logical replication option). See DEPLOYMENT.md.");
40
40
  if (!row.replicates)
41
41
  throw new Error("The Runtime's Postgres role cannot replicate: grant it REPLICATION (ALTER ROLE … REPLICATION). See DEPLOYMENT.md.");
@@ -91,12 +91,12 @@ export async function assertCurrentLayout(q) {
91
91
  if (row?.tenant_schemas || row?.keyed_record)
92
92
  throw openError("database-layout-old", "The database was written by an older Runtime that kept several Tenants in one database " +
93
93
  "(tenant_<id> schemas). This release starts fresh with one Tenant per database and " +
94
- "never changes the old one: point the Runtime at a new database (with the local stack, " +
95
- "start a new stack).");
94
+ "never changes the old one: point the Runtime at a new database (locally, a new Tenant: " +
95
+ "`nylorun start --tenant <new name>`).");
96
96
  if (row?.versioned)
97
97
  throw openError("database-layout-old", "The database was created by a pre-release build of one Tenant per database, whose " +
98
98
  "migrations this release replaces. It is never changed: point the Runtime at a new " +
99
- "database (with the local stack, delete the stack and start it again).");
99
+ "database (locally, `nylorun reset` and then `nylorun start`).");
100
100
  }
101
101
  /**
102
102
  * The database's schema version: the number of migrations its journal records, or undefined
@@ -40,6 +40,6 @@ export function repairFor(code) {
40
40
  case "open-failed":
41
41
  return "inspect the Runtime log, repair what it names, then restart the Runtime";
42
42
  case "database-layout-old":
43
- return "this release starts fresh: point the Runtime at a new database (a new stack: `nylorun start`); the old database is left as it is";
43
+ return "this release starts fresh: point the Runtime at a new database (locally, a new Tenant: `nylorun start --tenant <new name>`); the old database is left as it is";
44
44
  }
45
45
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const RUNTIME_VERSION = "0.15.0-beta";
1
+ export declare const RUNTIME_VERSION = "0.15.1-beta";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Kept in step with package.json by runtime/scripts/check-package.mjs, which runs in npm run check.
2
2
  // release:prepare also rewrites this when it bumps @nylorun/runtime.
3
- export const RUNTIME_VERSION = "0.15.0-beta";
3
+ export const RUNTIME_VERSION = "0.15.1-beta";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylorun/runtime",
3
- "version": "0.15.0-beta",
3
+ "version": "0.15.1-beta",
4
4
  "description": "Nylorun Runtime: the agent execution Host on Postgres, Restate and S2, and model providers.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -65,8 +65,8 @@
65
65
  "@hono/node-server": "^2.1.1",
66
66
  "@hono/zod-openapi": "^1.6.3",
67
67
  "@modelcontextprotocol/sdk": "^1.30.0",
68
- "@nylorun/core": "0.10.0-beta",
69
- "@nylorun/harness": "0.21.1-beta",
68
+ "@nylorun/core": "0.11.0-beta",
69
+ "@nylorun/harness": "0.21.2-beta",
70
70
  "@restatedev/restate-sdk": "1.16.9",
71
71
  "@s2-dev/streamstore": "0.27.0",
72
72
  "drizzle-orm": "^0.45.3",