@nylorun/runtime 0.16.0-beta → 0.17.0-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 +58 -0
- package/README.md +39 -27
- package/dist/admin-openapi.json +307 -7
- package/dist/api/ag-ui/endpoint.js +1 -2
- package/dist/api/ag-ui/routes.d.ts +1 -1
- package/dist/api/ag-ui/routes.js +10 -12
- package/dist/api/components.d.ts +54 -116
- package/dist/api/components.js +8 -11
- package/dist/api/http/app.js +2 -0
- package/dist/api/http/define.d.ts +9 -12
- package/dist/api/http/define.js +11 -26
- package/dist/api/http/routes/access.d.ts +3 -19
- package/dist/api/http/routes/access.js +12 -172
- package/dist/api/http/routes/actions.js +0 -1
- package/dist/api/http/routes/artifacts.js +1 -3
- package/dist/api/http/routes/me.d.ts +13 -0
- package/dist/api/http/routes/me.js +45 -0
- package/dist/api/http/routes/sandboxes.d.ts +2 -2
- package/dist/api/http/routes/sandboxes.js +1 -3
- package/dist/api/http/routes/sessions.js +6 -12
- package/dist/api/http/routes/vaults.d.ts +12 -3
- package/dist/api/http/routes/vaults.js +122 -54
- package/dist/api/openapi.js +4 -10
- package/dist/artifacts/links.js +6 -6
- package/dist/artifacts/service.js +1 -1
- package/dist/gates/mcp-handler.js +5 -1
- package/dist/gates/tenant-vaults.d.ts +18 -9
- package/dist/gates/tenant-vaults.js +17 -12
- package/dist/host/admin-api.d.ts +12 -5
- package/dist/host/admin-api.js +72 -6
- package/dist/host/app.d.ts +0 -1
- package/dist/host/app.js +13 -23
- package/dist/host/config-for.d.ts +4 -0
- package/dist/host/config-for.js +2 -0
- package/dist/host/config.d.ts +0 -6
- package/dist/host/create-host.d.ts +3 -10
- package/dist/host/create-host.js +4 -1
- package/dist/host/gates.js +6 -1
- package/dist/host/main.js +32 -10
- package/dist/host/stack-config.d.ts +11 -8
- package/dist/host/stack-config.js +23 -12
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/keys/client.js +9 -1
- package/dist/keys/keys.d.ts +12 -2
- package/dist/keys/keys.js +8 -0
- package/dist/mcp/connect.js +2 -1
- package/dist/mcp/pool.d.ts +1 -0
- package/dist/mcp/pool.js +1 -0
- package/dist/openapi.json +2359 -4096
- package/dist/store/postgres/drizzle/0008_installation_vaults.sql +2 -0
- package/dist/store/postgres/drizzle/0009_oauth_pending.sql +19 -0
- package/dist/store/postgres/drizzle/0010_oss_auth_removals.sql +3 -0
- package/dist/store/postgres/drizzle/meta/_journal.json +21 -0
- package/dist/store/postgres/schema.d.ts +194 -170
- package/dist/store/postgres/schema.js +46 -28
- package/dist/store/postgres/store.js +51 -100
- package/dist/store/postgres/tenant.d.ts +1 -1
- package/dist/store/postgres/tenant.js +2 -2
- package/dist/store/types.d.ts +24 -30
- package/dist/streams/control.d.ts +0 -5
- package/dist/streams/control.js +0 -8
- package/dist/streams/types.d.ts +2 -11
- package/dist/streams/types.js +1 -1
- package/dist/tenant/auth.d.ts +13 -9
- package/dist/tenant/auth.js +25 -32
- package/dist/tenant/commands.js +3 -7
- package/dist/tenant/context.d.ts +20 -22
- package/dist/tenant/delivery-token.js +4 -4
- package/dist/tenant/effects.d.ts +5 -1
- package/dist/tenant/effects.js +5 -16
- package/dist/tenant/ephemeral.d.ts +14 -2
- package/dist/tenant/ephemeral.js +8 -1
- package/dist/tenant/host-token.js +5 -5
- package/dist/tenant/identity-file.d.ts +75 -0
- package/dist/tenant/identity-file.js +202 -0
- package/dist/tenant/issuers.d.ts +48 -0
- package/dist/tenant/issuers.js +311 -0
- package/dist/tenant/jwt.js +3 -3
- package/dist/tenant/operator-keys.d.ts +18 -0
- package/dist/tenant/operator-keys.js +55 -0
- package/dist/tenant/outbound.d.ts +30 -0
- package/dist/tenant/outbound.js +142 -10
- package/dist/tenant/principals.d.ts +2 -11
- package/dist/tenant/principals.js +10 -30
- package/dist/tenant/run-token.js +3 -3
- package/dist/tenant/runtime.d.ts +4 -0
- package/dist/tenant/runtime.js +14 -1
- package/dist/tenant/sandboxes.d.ts +5 -5
- package/dist/tenant/sandboxes.js +5 -5
- package/dist/tenant/session-streams.d.ts +6 -10
- package/dist/tenant/session-streams.js +9 -27
- package/dist/tenant/sessions.d.ts +2 -2
- package/dist/tenant/sessions.js +1 -1
- package/dist/tenant/signing-keys.d.ts +2 -1
- package/dist/tenant/signing-keys.js +2 -2
- package/dist/tenant/streams.d.ts +2 -3
- package/dist/tenant/streams.js +1 -5
- package/dist/tenant/types.d.ts +21 -0
- package/dist/vault/crypto.d.ts +7 -0
- package/dist/vault/crypto.js +16 -0
- package/dist/vault/oauth.d.ts +55 -0
- package/dist/vault/oauth.js +186 -0
- package/dist/vault/service.d.ts +54 -7
- package/dist/vault/service.js +261 -17
- package/dist/vault/sources.d.ts +54 -0
- package/dist/vault/sources.js +185 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/dist/host/cors.d.ts +0 -27
- package/dist/host/cors.js +0 -64
- package/dist/tenant/access-policy.d.ts +0 -30
- package/dist/tenant/access-policy.js +0 -52
- package/dist/tenant/browser.d.ts +0 -15
- package/dist/tenant/browser.js +0 -39
- package/dist/tenant/subject-limits.d.ts +0 -16
- package/dist/tenant/subject-limits.js +0 -45
- package/dist/tenant/tokens.d.ts +0 -14
- package/dist/tenant/tokens.js +0 -187
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.17.0-beta
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- bd478ee: **Subject tokens, browser keys and derived principals leave open source (F9 I3, protocol 7).** Upgrade these with the Runtime: they speak protocol 7, which this Runtime serves beside 4, 5 and 6; protocol 6 clients keep working on every route that remains. Browsers and apps present a trusted issuer's token (F9 I2), servers an operator key (F9 I1), and a person's own credentials come from the operator's credential resolver (F9 C1). See MIGRATION.md.
|
|
8
|
+
|
|
9
|
+
- **Breaking (`@nylorun/runtime`, `@nylorun/core`): subject tokens are gone.** `POST /v1/tokens`, `POST /v1/access/revocations`, subject-token verification, revocation epochs and the `subject.revoked` stream signal are removed; the routes answer `404`, and a JWT no trusted issuer signed is the opaque `404`. A stream opened with a token now ends only at its expiry (`event: nylorun.closed`, reason `token_expired`; `StreamClosedFrame` loses `revoked`). Migration `0010_oss_auth_removals` drops the `subject_epochs`, `subject_usage` and `publishable_keys` tables. The `token` caller is a trusted issuer's token only: it loses `role`, `limits` and `epoch`, and `issuer` is always set; `GET /v1/me` no longer reports `via: token`. Core drops `SUBJECT_TOKEN_TYPE`, `SUBJECT_TOKEN_AUDIENCE`, `subjectTokenIssuer` (the Runtime's own tokens use `tenantTokenIssuer`, same value), `CreateTokenRequest`/`Response`, `RevokeSubject*`, `SubjectTokenClaims`, `TOKEN_TTL_MIN_SECONDS` and `TOKEN_TTL_DEFAULT_SECONDS`; `TOKEN_SCOPES` is `agents:read`, `sessions:own`, `sandboxes:write`.
|
|
10
|
+
- **Breaking (`@nylorun/runtime`, `@nylorun/core`): the access policy and role limits are gone.** `GET`/`PUT /v1/access/policy` answer `404`, a turn is never refused with `429 limit_exceeded` for a role (limit requests at your proxy), and an existing `access.policy` setting is ignored. Core drops `AccessPolicy*`, `AccessRole*`, `RoleLimits*`, `DEFAULT_ACCESS_POLICY`, `PutAccessPolicyRequest` and `ROLE_NAME_PATTERN`.
|
|
11
|
+
- **Breaking (`@nylorun/runtime`, `@nylorun/core`): publishable keys and the Runtime's CORS are gone.** `/v1/access/publishable-keys*` answer `404`, `Nylorun-Key` is ignored, `NYLORUN_BROWSER_ACCESS` and `browserAccess` (host.json, `createHost`, `startEphemeralRuntime`) are removed, and the Runtime sends no CORS headers. A request with `Origin` reaches the Tenant routes of the public listener with no toggle: a trusted issuer's token is served, an application key or delivery token is `403 origin_rejected`; admin routes, `/health`, `/ready` and the operator listener still refuse `Origin`. Any `OPTIONS` request is `204` with `Allow` and no CORS header: the operator's proxy answers preflights. Route declarations lose `browser` (`x-nylorun-browser` leaves the OpenAPI document) and the `publishable` credential; the token security scheme is `issuerToken`. Core drops `PUBLISHABLE_KEY_HEADER`, `PUBLISHABLE_KEY_PATTERN`, `PUBLISHABLE_KEY_ID_PATTERN`, `tenantOfPublishableKey`, `newPublishableKey`, `newPublishableKeyId`, `PublishableKey*`, `OriginEntrySchema`, `originAllowed` and `LOOPBACK_ORIGIN_WILDCARDS`.
|
|
12
|
+
- **Breaking (`@nylorun/runtime`, `@nylorun/core`, `@nylorun/agents`): vault routes are application-only, and `vaults:own` is retired.** Every `/v1/vaults` route takes an application key acting for no one (operator keys, Studio); a request acting for a subject or a trusted issuer's token gets `403 scope_required`. `vaults:own` leaves `SUBJECT_SCOPES`, `TOKEN_SCOPES` and the issuer scopes; `Nylorun-Scopes` may still name it and it grants nothing. Existing user vaults stay attachable to their own owner's sessions. `client.createVault` takes `{ scope: "installation" }` or `ownerUserId`, and `client.listVaults()` takes an optional owner.
|
|
13
|
+
- **Breaking (`@nylorun/runtime`, `@nylorun/core`, `@nylorun/admin`, `nylorun`): derived principals are gone.** Only Studio's key is derived from the admin key. `NYLORUN_DERIVED_PRINCIPALS` is ignored and no longer written, `hostPrincipals` takes no `derived`, `startEphemeralRuntime` no `derivedPrincipals`, and `@nylorun/admin` drops `deriveTenantKey`, `PROJECT_PRINCIPAL_ID` and `admin.deriveTenantKey`. Keys an earlier Host derived stay in the database and keep working as ordinary keys; replace them with operator keys. Core renames `DERIVED_PRINCIPAL_ID_PATTERN` to `APPLICATION_KEY_ID_PATTERN`.
|
|
14
|
+
- **Breaking (`@nylorun/agents`):** `createTokenEndpoint`, `createBrowserClient` and the `@nylorun/agents/browser` entry, `client.tokens`, `TokensClient`, `PublishableKeysClient`, `client.access.getPolicy`/`putPolicy`/`revokeSubject`/`publishableKeys` and `Destination.publishableKey` are removed. `client.access.signingKeys` and `client.access.jwks()` stay, and `Destination.token` takes a trusted issuer's tokens.
|
|
15
|
+
- **Breaking (`@nylorun/cli`):** `nylo access policy|keys|revoke|token` are removed and name what replaces them; `nylo access signing-keys list|rotate|revoke` stays.
|
|
16
|
+
- **Breaking (`@nylorun/core`, `@nylorun/agents`, `@nylorun/studio`): the Studio embed message `open.babai` is now `open.session`** (`{ sessionId }`): it asks the embedding app to open that session in its own UI. Studio sends no such message itself.
|
|
17
|
+
- **Breaking (`nylorun`): Studio embedding is opt-in.** No origin may frame Studio by default; list your app's origins with `nylorun start --studio-embed-origin <origin>`. A Tenant's `.env` from an earlier nylorun keeps the origins it had until `--studio-embed-origin-reset`.
|
|
18
|
+
- `PROTOCOL_VERSION` is 7 and `HOST_PROTOCOL` 4–7; the Host features `subject-tokens`, `browser-access` and `derived-principals` are removed. `@nylorun/studio` and `@nylorun/create-agent` speak protocol 7.
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- 8773586: **Installation vaults and a credential resolver (F9 C1).** A session's MCP credential now comes from its attached vaults, then from the operator's own credential resolver; nothing changes for existing vaults, and the protocol stays at 6.
|
|
23
|
+
|
|
24
|
+
- Installation vaults: `POST /v1/vaults` takes `scope: "installation"` (no `ownerUserId`) from an application key acting for no one; a request acting for a subject gets `403`. The vault is owned by `installation`, now a reserved subject like `host`. Any session may attach one and select its credentials. `GET /v1/vaults` from an application key lists them after the named person's vaults, and lists only them without `ownerUserId`; a request acting for a subject never sees one (the opaque `404`). The host model vault stays hidden and unattachable. Migration 0008 adds the scope.
|
|
25
|
+
- The credential resolver: `NYLORUN_RESOLVER_URL` and `NYLORUN_RESOLVER_TOKEN` on the gateway (`TenantConfig.resolver` and `startEphemeralRuntime({ resolver })` in process). When the session's vaults hold nothing for a remote MCP server's URL, the Runtime POSTs `{ owner, session, turn, target: { kind: "mcp", server, agent, url } }` with the resolver's bearer: `200 { headers, expiresAt? }` is used, `404` goes without a credential, and anything else or no answer within 5 s refuses the server with `credential_unavailable`. Owner and turn come from the session row. Answers are cached per owner and URL until `expiresAt`, at most 5 minutes (60 s without one), and concurrent misses share one request. See DEPLOYMENT.md, Credentials.
|
|
26
|
+
- `nylorun`: the gateway's Compose service passes `NYLORUN_RESOLVER_URL` and `NYLORUN_RESOLVER_TOKEN` from the shell that runs `nylorun start` (unset by default).
|
|
27
|
+
- Studio: the Vault page is now **Connections**, and creates installation vaults.
|
|
28
|
+
|
|
29
|
+
- e1bfb4b: **MCP OAuth connect for installation vaults (F9 C2).** The installation can sign in once to a remote MCP server that uses OAuth, and every session that attaches the vault uses the credential. Additive; the protocol stays at 6.
|
|
30
|
+
|
|
31
|
+
- `POST /v1/vaults/{vaultId}/oauth/start` (application keys acting for no one, installation vaults only) takes `{ url, server, clientId? }` and answers `{ authorizeUrl, expiresAt }`. The Runtime discovers the server's authorization server (RFC 9728, then RFC 8414), registers itself (RFC 7591) unless `clientId` names a registered client, and starts an S256 PKCE sign-in whose `state` works once, for ten minutes. A server without registration and no `clientId` is `400 oauth_client_required`.
|
|
32
|
+
- `GET /v1/oauth/callback` takes the browser back: anonymous and unversioned like an artifact link, it exchanges the code and stores an `oauth` credential bound to the URL, named after `server` (connecting again rotates it), and answers a small HTML page. An unknown, used or expired `state` is `oauth_state_invalid`; the authorization server's refusal is `oauth_failed`. The callback's base is `NYLORUN_PUBLIC_URL` (`TenantConfig.publicUrl`), else the start request's origin.
|
|
33
|
+
- Every OAuth step runs in the gateway's keys module (F9-D14): the runtime container never sees a token, the PKCE verifier or a client secret, and makes no outbound call. Migration 0009 adds `oauth_pending`, with the verifier and secret sealed under the vault key. `Keys` gains `startOAuth` and `finishOAuth`.
|
|
34
|
+
- OAuth requests, including refresh of every OAuth vault credential, now go through `guardedFetch` (`tenant/outbound.ts`): the `NYLORUN_ENDPOINT_*` address policy checked on the address connected to, no redirects, a bounded answer. With `NYLORUN_ENDPOINT_PRIVATE=refuse` a token endpoint on a private address is refused, where refresh used to call it.
|
|
35
|
+
- `@nylorun/core`: `ERROR_CODES` adds `oauth_client_required`, `oauth_state_invalid` and `oauth_failed`; `StartOAuthRequestSchema` and `StartOAuthResponseSchema`.
|
|
36
|
+
- `nylorun mcp connect <url> --server <name> [--vault <id>] [--client-id <id>]`: creates the installation vault `mcp` if needed, opens the sign-in page and waits up to 10 minutes for the credential. See DEPLOYMENT.md, "Connecting a remote MCP server with OAuth".
|
|
37
|
+
|
|
38
|
+
- 5cfaed9: **Operator keys, and project links on them (F9 I1).** The Admin API manages the Tenant's application keys by name: `PUT /v1/admin/keys/{id}` creates a key or rotates it and returns it once, `GET /v1/admin/keys` lists every key's id, role and issue time (never the keys), and `DELETE /v1/admin/keys/{id}` removes one. A rotated or deleted key stops authenticating on its next request. Ids follow `^[a-z][a-z0-9-]{0,31}$`; `studio` (derived from the admin key) is refused. Keys keep today's format (64 hex) and only their SHA-256 is stored, in the existing principals table (no migration). Host feature `operator-keys` (additive, protocol unchanged); core adds the `OperatorKey`, `ListOperatorKeysResponse`, `PutOperatorKeyResponse` and `DeleteOperatorKeyResponse` schemas.
|
|
39
|
+
|
|
40
|
+
- `@nylorun/admin`: `admin.keys.put(id)`, `admin.keys.list()` and `admin.keys.delete(id)`; they refuse with `incompatible_host` when the Host lacks `operator-keys`.
|
|
41
|
+
- `nylorun key put|list|rm <id>` manages a running local Tenant's keys; `put` prints the key once on stdout.
|
|
42
|
+
- `nylorun start` no longer derives the project's key. It keeps `.nylorun/credentials.json` while its key still reaches the Tenant (one authenticated read); otherwise it gives the project the operator key `project`, which the Host root keeps in `project-credentials.json` (0600) so every checkout linked to the Tenant shares it. An existing derived project key keeps working and is adopted.
|
|
43
|
+
- `nylorun sandbox` uses the linked project's key, or the operator key `cli` it puts once and keeps in `<Host root>/cli-credentials.json` (0600).
|
|
44
|
+
- The ephemeral Runtime (`startEphemeralRuntime`) no longer registers the derived `project` principal; pass `derivedPrincipals: ["project"]` to keep it. Derived principals (`NYLORUN_DERIVED_PRINCIPALS`, `deriveTenantKey`) still work on a Host.
|
|
45
|
+
|
|
46
|
+
- c0b604e: **Trusted issuers (F9 I2).** The Tenant API accepts JWTs from the operator's own identity provider as bearers, configured in an identity file: `NYLORUN_IDENTITY_FILE` names a YAML file listing each issuer's `name`, `issuer`, `audience`, `jwks` URL or static PEM `keys`, a `subject` template over scalar claims (`u:{sub}`), `scopes` from a claim or a fixed list, `allowedScopes`, an optional `agents` allowlist, optional `sandboxes` grant templates (`{org_id}/*`) and `maxLifetime`. A malformed file stops the boot, naming the issuer and the field; a subject template without a claim is malformed. A bearer whose unverified `iss` names an issuer is verified with RS256, ES256 or EdDSA only, up to 16 KiB, `aud` matching, `exp` and `iat` required and `exp − iat` within `maxLifetime`, and becomes a token caller (`role: issuer:<name>`) with the issuer's scopes, agents and rendered sandbox grants; subject revocation does not reach it. JWKS keys are fetched only from the configured URL (no redirects), cached by `kid`, refetched at most once a minute for an unknown `kid`; while a JWKS is unreachable cached keys keep working and a new `kid` is `401 issuer_unavailable` (new error code). A browser request with an issuer token needs no publishable key (CORS comes from the operator's proxy). New: `GET /v1/me` reports the subject, scopes, agents, sandbox grants and `via` (`application:<id>`, `subject`, `token` or `issuer:<name>`) of any credential; the issuer-only scope `studio`; `ISSUER_SCOPES`, `CALLER_SCOPES` and `MeResponseSchema` in `@nylorun/core/contracts`; `parseIdentityFile` and `createTrustedIssuers` in `@nylorun/runtime`, and an `issuers` option on `startEphemeralRuntime`; Host feature `trusted-issuers` (additive, protocol unchanged). `nylorun start` sets `NYLORUN_IDENTITY_FILE=/nylorun/identity.yaml` on the runtime container when `<Host root>/identity.yaml` exists.
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Pin core to the tested release.
|
|
51
|
+
- Pin harness to the tested release.
|
|
52
|
+
- Updated dependencies [8773586]
|
|
53
|
+
- Updated dependencies [e1bfb4b]
|
|
54
|
+
- Updated dependencies [5cfaed9]
|
|
55
|
+
- Updated dependencies [bd478ee]
|
|
56
|
+
- Updated dependencies [c0b604e]
|
|
57
|
+
- Updated dependencies
|
|
58
|
+
- @nylorun/core@0.13.0-beta
|
|
59
|
+
- @nylorun/harness@0.22.1-beta
|
|
60
|
+
|
|
3
61
|
## 0.16.0-beta
|
|
4
62
|
|
|
5
63
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
The independent OSS **Runtime Host** consumes `@nylorun/harness/run` and
|
|
4
4
|
`@nylorun/core/contracts`. Cloud installs published `@nylorun/harness` from npm
|
|
5
5
|
and does not import this package. Client authoring and sessions belong to
|
|
6
|
-
`@nylorun/agents`; the Host's status and
|
|
6
|
+
`@nylorun/agents`; the Host's status and operator keys belong to `@nylorun/admin`.
|
|
7
7
|
Vocabulary: [src/CONTEXT.md](./src/CONTEXT.md).
|
|
8
8
|
|
|
9
9
|
Requires Node 24+. Build from the repository root:
|
|
@@ -34,9 +34,9 @@ database, in the fixed schemas `nylorun` (its state: the Session Store) and
|
|
|
34
34
|
transaction under an advisory lock, records them in `nylorun.__drizzle_migrations`, and
|
|
35
35
|
refuses a database holding a migration it does not ship (`schema-too-new`); then, on
|
|
36
36
|
first start, it creates the Tenant there: its id (`NYLORUN_TENANT_ID`, default a
|
|
37
|
-
new one), its name (`NYLORUN_TENANT_NAME`, default `default`)
|
|
38
|
-
the
|
|
39
|
-
|
|
37
|
+
new one), its name (`NYLORUN_TENANT_NAME`, default `default`) and its Studio principal,
|
|
38
|
+
whose key the admin key derives (the only derived key). Operator keys (`/v1/admin/keys`) add, rotate and delete the Tenant's
|
|
39
|
+
application keys after that; a rotated or deleted key stops authenticating at once. A database written by a Runtime that kept several Tenants in one
|
|
40
40
|
database (`tenant_<id>` schemas), or by a pre-release build of one Tenant per database
|
|
41
41
|
(`schema_version` tables), is refused: this release starts fresh on a new database. Restate runs one advance of a session at a time and holds the Tenant's sweep
|
|
42
42
|
timer (Durable Session Execution); every session's events are relayed from the record to
|
|
@@ -68,9 +68,12 @@ sets: `NYLORUN_DATABASE_URL` (required), `NYLORUN_RESTATE_INGRESS_URL`,
|
|
|
68
68
|
`NYLORUN_RESTATE_IDENTITY_KEY` (Restate), `NYLORUN_S2_ENDPOINT` and
|
|
69
69
|
`NYLORUN_S2_TOKEN`, and in container mode `NYLORUN_LISTEN_HOST`,
|
|
70
70
|
`NYLORUN_LISTEN_PORT`, `NYLORUN_ALLOWED_HOSTS` and `NYLORUN_PUBLIC_URL`, plus
|
|
71
|
-
|
|
71
|
+
the operator listener
|
|
72
72
|
(`NYLORUN_ADMIN_LISTEN_PORT`, `NYLORUN_ADMIN_LISTEN_HOST`,
|
|
73
|
-
`NYLORUN_ADMIN_ALLOWED_HOSTS`).
|
|
73
|
+
`NYLORUN_ADMIN_ALLOWED_HOSTS`). `NYLORUN_IDENTITY_FILE` names the identity
|
|
74
|
+
file, a YAML list of the trusted issuers whose JWTs the Tenant API accepts
|
|
75
|
+
(Host feature `trusted-issuers`), read once at boot; a malformed file stops the
|
|
76
|
+
boot ([DEPLOYMENT.md](../DEPLOYMENT.md#trusted-issuers)). A process that runs `loop` sends its model
|
|
74
77
|
calls to the gate at `NYLORUN_GATES_URL`; in a container it refuses to start
|
|
75
78
|
without it and `NYLORUN_GATES_TOKEN`. That token is core's credential: the gate
|
|
76
79
|
accepts only it for vault writes, token signing and Action deliveries. Model and
|
|
@@ -81,7 +84,11 @@ is refused with `409 run_stale`. A `gates` process needs only
|
|
|
81
84
|
`NYLORUN_DATABASE_URL`, `NYLORUN_GATES_TOKEN`, its listener
|
|
82
85
|
(`NYLORUN_GATES_LISTEN_HOST`, `NYLORUN_GATES_LISTEN_PORT`, default 4100, and
|
|
83
86
|
`NYLORUN_GATES_ALLOWED_HOSTS`) and the Host's `tenant/` directory, which it
|
|
84
|
-
never writes; it serves the database's one Tenant.
|
|
87
|
+
never writes; it serves the database's one Tenant. `NYLORUN_RESOLVER_URL` and
|
|
88
|
+
`NYLORUN_RESOLVER_TOKEN` (both or neither, gates only) name the operator's
|
|
89
|
+
credential resolver, which the gate asks for a person's MCP credential when the
|
|
90
|
+
session's vaults hold none ([DEPLOYMENT.md](../DEPLOYMENT.md#credentials)); an
|
|
91
|
+
embedding or `startEphemeralRuntime` takes `resolver: { url, token }` instead. With `egress`
|
|
85
92
|
(`--service gates,keys,egress`, for pod sandboxes) the same process runs
|
|
86
93
|
egress-gate on `NYLORUN_EGRESS_LISTEN_HOST`:`NYLORUN_EGRESS_LISTEN_PORT`
|
|
87
94
|
(default `0.0.0.0:4200`): a CONNECT proxy that admits a pod's egress token and
|
|
@@ -89,8 +96,8 @@ tunnels only to the hosts its sandbox spec allows, on 443 or 80, never to a
|
|
|
89
96
|
private address. `NYLORUN_PACKING` (`combined` or `split`) is logged at startup.
|
|
90
97
|
|
|
91
98
|
With an operator listener (a local Tenant's default: container port 4001), the Host
|
|
92
|
-
serves two ports. The public one serves the Tenant API, to browsers too
|
|
93
|
-
|
|
99
|
+
serves two ports. The public one serves the Tenant API, to browsers too (with a
|
|
100
|
+
trusted issuer's token), and answers admin routes with the opaque `404`. The
|
|
94
101
|
operator one serves the Admin API, Host shutdown and the Tenant API, never to
|
|
95
102
|
browsers; keep it on loopback or a private network and never proxy it. Outside
|
|
96
103
|
a container, `adminPort` in `host.json` does the same on loopback.
|
|
@@ -104,6 +111,7 @@ The Host root is `NYLORUN_HOME` or `~/.nylorun` (for a local Tenant,
|
|
|
104
111
|
<host root>/
|
|
105
112
|
host.json # format 1: hostId, host, port, adminPort?, runtimeVersion, …
|
|
106
113
|
host-credentials.json # adminKey (0600)
|
|
114
|
+
identity.yaml # optional: trusted issuers (NYLORUN_IDENTITY_FILE)
|
|
107
115
|
docker/ # compose.yaml, .env (0600), Restate identity key
|
|
108
116
|
tenant/ # vault-kek, plugin-data, logs, home, tmp, sandboxes
|
|
109
117
|
```
|
|
@@ -117,25 +125,30 @@ The Host root is `NYLORUN_HOME` or `~/.nylorun` (for a local Tenant,
|
|
|
117
125
|
| `GET /openapi.json` | none | The Tenant API's OpenAPI 3.2 document (below); refuses an `Origin` |
|
|
118
126
|
| `GET /v1/admin/status` | admin key | `AdminStatusSchema`: the Host, its protocol and its Tenant (`tenant`: id, name, `open` or `unavailable`, and the cause when it could not be opened); alias `GET /v1/admin/host`. On the operator listener when there is one |
|
|
119
127
|
| `POST /v1/admin/host/shutdown` | admin key | Host-private; not in `@nylorun/admin` |
|
|
128
|
+
| `PUT /v1/admin/keys/{id}` | admin key | Operator keys (Host feature `operator-keys`): creates key `id` or rotates it, and returns it once (`PutOperatorKeyResponse`); `studio` is refused |
|
|
129
|
+
| `GET /v1/admin/keys` | admin key | Every key of the Tenant: id, role, when issued (`ListOperatorKeysResponse`), never the keys |
|
|
130
|
+
| `DELETE /v1/admin/keys/{id}` | admin key | The key stops authenticating at once; `404` when there is none |
|
|
120
131
|
| `GET /v1/admin/openapi.json` | admin key | The Admin API's OpenAPI 3.2 document |
|
|
121
|
-
| `/v1/*` Tenant routes | application key,
|
|
132
|
+
| `/v1/*` Tenant routes | application key, trusted issuer's token or delivery token | Require `Nylorun-Protocol`; nothing names the Tenant |
|
|
133
|
+
| `POST /v1/vaults/{vaultId}/oauth/start` | application key | MCP OAuth connect into an installation vault (F9 C2): `{url, server, clientId?}` → `{authorizeUrl, expiresAt}`; the gateway's keys module does discovery, registration and the exchange. `oauth_client_required` without DCR or a `clientId` |
|
|
134
|
+
| `GET /v1/oauth/callback` | the `state` itself | Where the authorization server sends the browser back: no credential, no `Nylorun-Protocol`; finishes the connect once (`oauth_state_invalid` after) and answers a small HTML page. Its base is `NYLORUN_PUBLIC_URL`, else the start request's origin |
|
|
122
135
|
| `GET /v1/artifact-links/{token}` | the link itself | A capability link to one artifact version (protocol 6): no credential, no `Nylorun-Protocol`, Range supported; a folder's link opens its zip, or one of its files |
|
|
123
136
|
|
|
124
137
|
Every route checks `Host` first (`421 host_rejected`) and rejects non-JSON bodies
|
|
125
138
|
with `415 unsupported_media_type`, except an artifact upload (`POST /v1/artifacts`,
|
|
126
139
|
`POST /v1/artifacts/{id}/versions`), whose body is the file in any media type. An `Origin` is `403 origin_rejected` on
|
|
127
|
-
`/health`, `/ready`, admin routes
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
protocol 6 adds file and folder artifacts and message `parts`; at each turn's end the
|
|
140
|
+
`/health`, `/ready`, admin routes and the operator listener. On Tenant routes a browser
|
|
141
|
+
presents a trusted issuer's token; application keys and delivery tokens are refused
|
|
142
|
+
from browsers before they are looked up. The Runtime sends no CORS headers, and answers
|
|
143
|
+
`OPTIONS` with `204` and `Allow` only: the operator's reverse proxy answers preflights
|
|
144
|
+
([DEPLOYMENT.md](../DEPLOYMENT.md#calling-the-runtime-from-browsers-and-apps)). Missing or
|
|
145
|
+
unsupported protocol → `426` before authentication (the Host serves protocols 4 to 7;
|
|
146
|
+
protocol 7 removes subject tokens, the access policy, revocations, browser keys and
|
|
147
|
+
derived principals, whose routes answer `404`; protocol 6 adds file and folder artifacts and message `parts`; at each turn's end the
|
|
135
148
|
Runtime exports `/workspace/outputs` of the session's sandbox as a version of its
|
|
136
149
|
`outputs` folder, read at `/v1/artifacts/{id}/versions/{n|latest}/tree`, `/files/{path}`,
|
|
137
|
-
`/diff?from=` and `/zip`). Protocol 5 and
|
|
138
|
-
another Tenant (or malformed), a
|
|
150
|
+
`/diff?from=` and `/zip`). Protocol 5 and later clients name no Tenant. A protocol 4 client's `Nylorun-Tenant` naming
|
|
151
|
+
another Tenant (or malformed), a Tenant that
|
|
139
152
|
could not be opened and rejected credentials → opaque `404` with identical body. A path or method no route serves is `404 Route not found`
|
|
140
153
|
once the caller is known.
|
|
141
154
|
|
|
@@ -156,18 +169,17 @@ tool at one of them; for [Scalar](https://scalar.com), the package file of a ver
|
|
|
156
169
|
https://cdn.jsdelivr.net/npm/@nylorun/runtime@<version>/dist/openapi.json
|
|
157
170
|
```
|
|
158
171
|
|
|
159
|
-
Each operation's `security` says which credentials it takes (application key,
|
|
160
|
-
|
|
161
|
-
`x-nylorun-scopes` (the subject scopes that reach it)
|
|
162
|
-
may call it. Event streams are `text/event-stream` with an `itemSchema`. `runtime/openapi/` holds the committed snapshots: a change to a route changes
|
|
172
|
+
Each operation's `security` says which credentials it takes (application key, trusted
|
|
173
|
+
issuer's token, delivery token, admin key), and its `x-nylorun-credentials` and
|
|
174
|
+
`x-nylorun-scopes` (the subject scopes that reach it) fields say who may call it. Event streams are `text/event-stream` with an `itemSchema`. `runtime/openapi/` holds the committed snapshots: a change to a route changes
|
|
163
175
|
them (`node scripts/build-openapi.mjs --write`), and `check-package` fails until they are
|
|
164
176
|
updated.
|
|
165
177
|
|
|
166
178
|
## HTTP layer
|
|
167
179
|
|
|
168
180
|
Routes are Hono routes (`@hono/zod-openapi`), each declared once with who may call it
|
|
169
|
-
(`api/http/define.ts`): that declaration serves the route, checks subject scopes
|
|
170
|
-
|
|
181
|
+
(`api/http/define.ts`): that declaration serves the route, checks subject scopes and makes
|
|
182
|
+
the OpenAPI document. `host/` holds the listeners, the `Host`
|
|
171
183
|
check (in Node, before Hono) and the Host pipeline (`host/app.ts`); `api/` the Tenant and
|
|
172
184
|
Admin routes (`api/http/routes/`, `api/ag-ui/`, `api/a2a/`, `host/admin-api.ts`). Only `host/`
|
|
173
185
|
and `api/` import Hono.
|
|
@@ -239,7 +251,7 @@ the Project link (outside a project it runs the Tenant `default`); the project's
|
|
|
239
251
|
| `schema-too-new` | Run a Runtime at least as new as the one that migrated the database |
|
|
240
252
|
| `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 |
|
|
241
253
|
| `426 protocol_unsupported` | Upgrade clients or Host to a compatible set |
|
|
242
|
-
| `421 host_rejected` / `403 origin_rejected` | In a container, list the `Host` in `NYLORUN_ALLOWED_HOSTS`. From a browser,
|
|
254
|
+
| `421 host_rejected` / `403 origin_rejected` | In a container, list the `Host` in `NYLORUN_ALLOWED_HOSTS`. From a browser, send a trusted issuer's token, never a Tenant key |
|
|
243
255
|
| `503` for a Tenant | Postgres or Restate is unreachable; `GET /ready` names which |
|
|
244
256
|
| Port in use | Change `NYLORUN_PORT` in `~/.nylorun/tenants/<name>/docker/.env` and run `nylorun start` |
|
|
245
257
|
| Logs | `nylorun logs runtime` |
|
package/dist/admin-openapi.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"openapi": "3.2.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Nylorun Runtime: Admin API",
|
|
5
|
-
"version": "0.
|
|
6
|
-
"description": "The Host's status, its Tenant's state and
|
|
5
|
+
"version": "0.17.0-beta",
|
|
6
|
+
"description": "The Host's status, its Tenant's state, shutdown and the Tenant's operator keys, 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,
|
|
9
|
-
"max":
|
|
9
|
+
"max": 7,
|
|
10
10
|
"features": [
|
|
11
11
|
"runtime-tenants",
|
|
12
12
|
"admin-status",
|
|
@@ -15,15 +15,14 @@
|
|
|
15
15
|
"artifacts",
|
|
16
16
|
"tenant-fixture-model",
|
|
17
17
|
"transcript-events",
|
|
18
|
-
"derived-principals",
|
|
19
18
|
"subject-headers",
|
|
20
|
-
"subject-tokens",
|
|
21
|
-
"browser-access",
|
|
22
19
|
"ag-ui-endpoint",
|
|
23
20
|
"a2a-endpoint",
|
|
24
21
|
"action-endpoints",
|
|
25
22
|
"sandboxes",
|
|
26
|
-
"sandbox-pods"
|
|
23
|
+
"sandbox-pods",
|
|
24
|
+
"trusted-issuers",
|
|
25
|
+
"operator-keys"
|
|
27
26
|
]
|
|
28
27
|
}
|
|
29
28
|
},
|
|
@@ -340,6 +339,10 @@
|
|
|
340
339
|
"placement_refused",
|
|
341
340
|
"sandbox_lost",
|
|
342
341
|
"sandbox_expired",
|
|
342
|
+
"issuer_unavailable",
|
|
343
|
+
"oauth_client_required",
|
|
344
|
+
"oauth_state_invalid",
|
|
345
|
+
"oauth_failed",
|
|
343
346
|
"internal_error"
|
|
344
347
|
]
|
|
345
348
|
},
|
|
@@ -420,6 +423,93 @@
|
|
|
420
423
|
"status"
|
|
421
424
|
],
|
|
422
425
|
"additionalProperties": false
|
|
426
|
+
},
|
|
427
|
+
"ListOperatorKeysResponse": {
|
|
428
|
+
"type": "object",
|
|
429
|
+
"properties": {
|
|
430
|
+
"keys": {
|
|
431
|
+
"type": "array",
|
|
432
|
+
"items": {
|
|
433
|
+
"type": "object",
|
|
434
|
+
"properties": {
|
|
435
|
+
"id": {
|
|
436
|
+
"type": "string",
|
|
437
|
+
"minLength": 1
|
|
438
|
+
},
|
|
439
|
+
"role": {
|
|
440
|
+
"type": "string",
|
|
441
|
+
"minLength": 1
|
|
442
|
+
},
|
|
443
|
+
"createdAt": {
|
|
444
|
+
"type": "string",
|
|
445
|
+
"minLength": 1
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"required": [
|
|
449
|
+
"id",
|
|
450
|
+
"role",
|
|
451
|
+
"createdAt"
|
|
452
|
+
],
|
|
453
|
+
"additionalProperties": false
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
"required": [
|
|
458
|
+
"keys"
|
|
459
|
+
],
|
|
460
|
+
"additionalProperties": false
|
|
461
|
+
},
|
|
462
|
+
"PutOperatorKeyResponse": {
|
|
463
|
+
"type": "object",
|
|
464
|
+
"properties": {
|
|
465
|
+
"id": {
|
|
466
|
+
"type": "string",
|
|
467
|
+
"minLength": 1
|
|
468
|
+
},
|
|
469
|
+
"role": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"minLength": 1
|
|
472
|
+
},
|
|
473
|
+
"createdAt": {
|
|
474
|
+
"type": "string",
|
|
475
|
+
"minLength": 1
|
|
476
|
+
},
|
|
477
|
+
"key": {
|
|
478
|
+
"type": "string",
|
|
479
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
480
|
+
},
|
|
481
|
+
"rotated": {
|
|
482
|
+
"type": "boolean"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"required": [
|
|
486
|
+
"id",
|
|
487
|
+
"role",
|
|
488
|
+
"createdAt",
|
|
489
|
+
"key",
|
|
490
|
+
"rotated"
|
|
491
|
+
],
|
|
492
|
+
"additionalProperties": false
|
|
493
|
+
},
|
|
494
|
+
"DeleteOperatorKeyResponse": {
|
|
495
|
+
"type": "object",
|
|
496
|
+
"properties": {
|
|
497
|
+
"id": {
|
|
498
|
+
"type": "string",
|
|
499
|
+
"minLength": 1
|
|
500
|
+
},
|
|
501
|
+
"deleted": {
|
|
502
|
+
"type": "boolean",
|
|
503
|
+
"enum": [
|
|
504
|
+
true
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
"required": [
|
|
509
|
+
"id",
|
|
510
|
+
"deleted"
|
|
511
|
+
],
|
|
512
|
+
"additionalProperties": false
|
|
423
513
|
}
|
|
424
514
|
},
|
|
425
515
|
"parameters": {}
|
|
@@ -561,6 +651,216 @@
|
|
|
561
651
|
}
|
|
562
652
|
}
|
|
563
653
|
},
|
|
654
|
+
"/v1/admin/keys": {
|
|
655
|
+
"get": {
|
|
656
|
+
"summary": "List the Tenant's keys",
|
|
657
|
+
"description": "Every application key of the Tenant by name, with its role and when it was issued. Keys themselves are never shown again.",
|
|
658
|
+
"tags": [
|
|
659
|
+
"Admin"
|
|
660
|
+
],
|
|
661
|
+
"security": [
|
|
662
|
+
{
|
|
663
|
+
"adminKey": []
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
"responses": {
|
|
667
|
+
"200": {
|
|
668
|
+
"description": "The keys, by id",
|
|
669
|
+
"content": {
|
|
670
|
+
"application/json": {
|
|
671
|
+
"schema": {
|
|
672
|
+
"$ref": "#/components/schemas/ListOperatorKeysResponse"
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
"404": {
|
|
678
|
+
"description": "Not found: an unknown admin key, or the public listener",
|
|
679
|
+
"content": {
|
|
680
|
+
"application/json": {
|
|
681
|
+
"schema": {
|
|
682
|
+
"$ref": "#/components/schemas/Rejected"
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
"426": {
|
|
688
|
+
"description": "`Nylorun-Protocol` missing or unsupported",
|
|
689
|
+
"content": {
|
|
690
|
+
"application/json": {
|
|
691
|
+
"schema": {
|
|
692
|
+
"$ref": "#/components/schemas/ProtocolRejected"
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
"503": {
|
|
698
|
+
"description": "The Tenant is not open",
|
|
699
|
+
"content": {
|
|
700
|
+
"application/json": {
|
|
701
|
+
"schema": {
|
|
702
|
+
"$ref": "#/components/schemas/Rejected"
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
"/v1/admin/keys/{id}": {
|
|
711
|
+
"put": {
|
|
712
|
+
"summary": "Create or rotate a key",
|
|
713
|
+
"description": "Issues a new key named `id` and returns it this once. A key of that name is replaced: the old one stops authenticating at once. `studio` is refused.",
|
|
714
|
+
"tags": [
|
|
715
|
+
"Admin"
|
|
716
|
+
],
|
|
717
|
+
"security": [
|
|
718
|
+
{
|
|
719
|
+
"adminKey": []
|
|
720
|
+
}
|
|
721
|
+
],
|
|
722
|
+
"parameters": [
|
|
723
|
+
{
|
|
724
|
+
"schema": {
|
|
725
|
+
"type": "string",
|
|
726
|
+
"description": "The key's name: `^[a-z][a-z0-9-]{0,31}$`, never `studio`"
|
|
727
|
+
},
|
|
728
|
+
"required": true,
|
|
729
|
+
"description": "The key's name: `^[a-z][a-z0-9-]{0,31}$`, never `studio`",
|
|
730
|
+
"name": "id",
|
|
731
|
+
"in": "path"
|
|
732
|
+
}
|
|
733
|
+
],
|
|
734
|
+
"responses": {
|
|
735
|
+
"200": {
|
|
736
|
+
"description": "The new key, shown once",
|
|
737
|
+
"content": {
|
|
738
|
+
"application/json": {
|
|
739
|
+
"schema": {
|
|
740
|
+
"$ref": "#/components/schemas/PutOperatorKeyResponse"
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
"400": {
|
|
746
|
+
"description": "Not a key name, or `studio`",
|
|
747
|
+
"content": {
|
|
748
|
+
"application/json": {
|
|
749
|
+
"schema": {
|
|
750
|
+
"$ref": "#/components/schemas/Rejected"
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
"404": {
|
|
756
|
+
"description": "Not found: an unknown admin key, or the public listener",
|
|
757
|
+
"content": {
|
|
758
|
+
"application/json": {
|
|
759
|
+
"schema": {
|
|
760
|
+
"$ref": "#/components/schemas/Rejected"
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
"426": {
|
|
766
|
+
"description": "`Nylorun-Protocol` missing or unsupported",
|
|
767
|
+
"content": {
|
|
768
|
+
"application/json": {
|
|
769
|
+
"schema": {
|
|
770
|
+
"$ref": "#/components/schemas/ProtocolRejected"
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
"503": {
|
|
776
|
+
"description": "The Tenant is not open",
|
|
777
|
+
"content": {
|
|
778
|
+
"application/json": {
|
|
779
|
+
"schema": {
|
|
780
|
+
"$ref": "#/components/schemas/Rejected"
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
"delete": {
|
|
788
|
+
"summary": "Delete a key",
|
|
789
|
+
"description": "The key stops authenticating at once. `studio` is refused.",
|
|
790
|
+
"tags": [
|
|
791
|
+
"Admin"
|
|
792
|
+
],
|
|
793
|
+
"security": [
|
|
794
|
+
{
|
|
795
|
+
"adminKey": []
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
"parameters": [
|
|
799
|
+
{
|
|
800
|
+
"schema": {
|
|
801
|
+
"type": "string",
|
|
802
|
+
"description": "The key's name: `^[a-z][a-z0-9-]{0,31}$`, never `studio`"
|
|
803
|
+
},
|
|
804
|
+
"required": true,
|
|
805
|
+
"description": "The key's name: `^[a-z][a-z0-9-]{0,31}$`, never `studio`",
|
|
806
|
+
"name": "id",
|
|
807
|
+
"in": "path"
|
|
808
|
+
}
|
|
809
|
+
],
|
|
810
|
+
"responses": {
|
|
811
|
+
"200": {
|
|
812
|
+
"description": "The key is deleted",
|
|
813
|
+
"content": {
|
|
814
|
+
"application/json": {
|
|
815
|
+
"schema": {
|
|
816
|
+
"$ref": "#/components/schemas/DeleteOperatorKeyResponse"
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
"400": {
|
|
822
|
+
"description": "Not a key name, or `studio`",
|
|
823
|
+
"content": {
|
|
824
|
+
"application/json": {
|
|
825
|
+
"schema": {
|
|
826
|
+
"$ref": "#/components/schemas/Rejected"
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
"404": {
|
|
832
|
+
"description": "No key of that name; or an unknown admin key, or the public listener",
|
|
833
|
+
"content": {
|
|
834
|
+
"application/json": {
|
|
835
|
+
"schema": {
|
|
836
|
+
"$ref": "#/components/schemas/Rejected"
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
"426": {
|
|
842
|
+
"description": "`Nylorun-Protocol` missing or unsupported",
|
|
843
|
+
"content": {
|
|
844
|
+
"application/json": {
|
|
845
|
+
"schema": {
|
|
846
|
+
"$ref": "#/components/schemas/ProtocolRejected"
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
"503": {
|
|
852
|
+
"description": "The Tenant is not open",
|
|
853
|
+
"content": {
|
|
854
|
+
"application/json": {
|
|
855
|
+
"schema": {
|
|
856
|
+
"$ref": "#/components/schemas/Rejected"
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
},
|
|
564
864
|
"/v1/admin/openapi.json": {
|
|
565
865
|
"get": {
|
|
566
866
|
"summary": "Get this document",
|
|
@@ -29,7 +29,6 @@ function registerComponents(api) {
|
|
|
29
29
|
const FOR_A_PERSON = {
|
|
30
30
|
credentials: ["subject", "token"],
|
|
31
31
|
scopes: ["sessions:own"],
|
|
32
|
-
browser: true,
|
|
33
32
|
};
|
|
34
33
|
const events = (description) => ({
|
|
35
34
|
description,
|
|
@@ -50,7 +49,7 @@ export function agUiRoutes(api) {
|
|
|
50
49
|
path: "/v1/ag-ui/agents/{agentId}",
|
|
51
50
|
tags: TAGS,
|
|
52
51
|
summary: "Run an agent",
|
|
53
|
-
description: "For a person, named by a
|
|
52
|
+
description: "For a person, named by a trusted issuer's token or by `Nylorun-Subject`. The thread is one session per person, agent and thread, created on its first run with `forwardedProps.nylorun.session`. The trailing user message starts a turn (its id is the idempotency key); `resume` answers interrupts. A busy session is a `RUN_ERROR` in the stream.",
|
|
54
53
|
request: {
|
|
55
54
|
params: agentId,
|
|
56
55
|
body: {
|
|
@@ -2,7 +2,7 @@ import type { ServerResponse } from "node:http";
|
|
|
2
2
|
import { type Message } from "@ag-ui/core";
|
|
3
3
|
import { type AuthScope, type SessionAccess, type TenantContext } from "../../tenant/context.js";
|
|
4
4
|
/**
|
|
5
|
-
* Who an AG-UI request acts for, once its agent is known: a person (
|
|
5
|
+
* Who an AG-UI request acts for, once its agent is known: a person (an issuer token's subject,
|
|
6
6
|
* or `Nylorun-Subject`), who may use the agent; else 400, or the 404 of a missing agent.
|
|
7
7
|
*/
|
|
8
8
|
export declare function agUiCaller(scope: AuthScope, agentId: string): {
|