@nylorun/cli 0.9.0-beta → 0.10.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 +28 -0
- package/README.md +2 -3
- package/dist/access/commands.d.ts +6 -22
- package/dist/access/commands.js +9 -109
- package/dist/cli.js +1 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @nylorun/cli
|
|
2
2
|
|
|
3
|
+
## 0.10.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
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Pin agents to the tested release.
|
|
23
|
+
- Pin admin to the tested release.
|
|
24
|
+
- Updated dependencies [5cfaed9]
|
|
25
|
+
- Updated dependencies [bd478ee]
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @nylorun/agents@0.14.0-beta
|
|
29
|
+
- @nylorun/admin@0.10.0-beta
|
|
30
|
+
|
|
3
31
|
## 0.9.0-beta
|
|
4
32
|
|
|
5
33
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ npx @nylorun/cli status # the linked Tenant
|
|
|
18
18
|
nylo status [--json] # the Tenant, its checks and counts
|
|
19
19
|
nylo reset [--sessions|--sandboxes|--all] [--yes]
|
|
20
20
|
nylo endpoints [--json]|ping <agent> # the registered Action endpoints and their health
|
|
21
|
-
nylo access …
|
|
21
|
+
nylo access signing-keys … # the Tenant's signing keys: list, rotate, revoke
|
|
22
22
|
nylo configure # set or replace the Tenant's model provider
|
|
23
23
|
nylo env # export lines for the linked Project
|
|
24
24
|
nylo doctor sandbox [--json] # sandbox backend via the Tenant API
|
|
@@ -55,8 +55,7 @@ not in a terminal. The Project link and credentials are kept.
|
|
|
55
55
|
|
|
56
56
|
- `.nylorun/link.json`: `{ format: 3, tenant, hostUrl, hostId, tenantId }`
|
|
57
57
|
(`tenant` is the local Tenant's name; `tenantId` is information)
|
|
58
|
-
- `.nylorun/credentials.json`: the key
|
|
59
|
-
its id (0600)
|
|
58
|
+
- `.nylorun/credentials.json`: the operator key `project` and its id (0600)
|
|
60
59
|
- `.nylorun/.gitignore` containing `*`
|
|
61
60
|
|
|
62
61
|
A link from an older nylorun (format 0 to 2): `nylo` refuses it and says to run
|
|
@@ -1,24 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `nylo access`: the linked Tenant's signing keys, which sign delivery tokens and capability
|
|
3
|
+
* links. Uses the Project's application key, like every other Tenant command. (Subject tokens,
|
|
4
|
+
* the access policy, browser keys and revocations left the Runtime in protocol 7.)
|
|
5
|
+
*/
|
|
1
6
|
import { type AgentsClient } from "@nylorun/agents";
|
|
2
|
-
export declare const accessUsage = "nylo access
|
|
3
|
-
/** The starter policy `policy init` writes. */
|
|
4
|
-
export declare const STARTER_POLICY: {
|
|
5
|
-
version: 1;
|
|
6
|
-
roles: {
|
|
7
|
-
user: {
|
|
8
|
-
scopes: ("agents:read" | "sessions:own")[];
|
|
9
|
-
agents: "*";
|
|
10
|
-
limits: {
|
|
11
|
-
turnsPerHour: number;
|
|
12
|
-
concurrentTurns: number;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
anon: {
|
|
17
|
-
scopes: never[];
|
|
18
|
-
agents: never[];
|
|
19
|
-
};
|
|
20
|
-
tokens: {
|
|
21
|
-
maxTtlSeconds: number;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
7
|
+
export declare const accessUsage = "nylo access signing-keys <list|rotate|revoke>\n\n signing-keys list list the signing keys\n signing-keys rotate [--force] rotate; --force ends outstanding delivery tokens and links\n signing-keys revoke <kid> revoke a previous or standby key";
|
|
24
8
|
export declare function accessCommand(input: readonly string[], client?: () => Promise<AgentsClient>): Promise<void>;
|
package/dist/access/commands.js
CHANGED
|
@@ -1,42 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `nylo access`: the linked Tenant's
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* `nylo access`: the linked Tenant's signing keys, which sign delivery tokens and capability
|
|
3
|
+
* links. Uses the Project's application key, like every other Tenant command. (Subject tokens,
|
|
4
|
+
* the access policy, browser keys and revocations left the Runtime in protocol 7.)
|
|
5
5
|
*/
|
|
6
|
-
import { readFile } from "node:fs/promises";
|
|
7
6
|
import { createClient, resolveConnection, } from "@nylorun/agents";
|
|
8
7
|
import { CliError } from "../errors.js";
|
|
9
|
-
export const accessUsage = `nylo access
|
|
8
|
+
export const accessUsage = `nylo access signing-keys <list|rotate|revoke>
|
|
10
9
|
|
|
11
|
-
policy get print the access policy
|
|
12
|
-
policy set <file> replace it with a JSON file
|
|
13
|
-
policy init write a starter "user" role (sessions:own agents:read, every agent,
|
|
14
|
-
60 turns per hour, 2 at once)
|
|
15
10
|
signing-keys list list the signing keys
|
|
16
|
-
signing-keys rotate [--force] rotate; --force
|
|
17
|
-
signing-keys revoke <kid> revoke a previous or standby key
|
|
18
|
-
keys list list the publishable keys
|
|
19
|
-
keys create --name <n> [--origin <o>]…
|
|
20
|
-
a publishable key for a web page or an app
|
|
21
|
-
(origins: https://app.example.com or http://localhost:*)
|
|
22
|
-
keys set-origins <id> [<o>…] replace a key's origins ([] for native apps only)
|
|
23
|
-
keys revoke <id> revoke a publishable key
|
|
24
|
-
revoke <subject> end a subject's tokens and open streams
|
|
25
|
-
token --subject <s> --role <r> [--ttl <seconds>]
|
|
26
|
-
mint a subject token (for trying the API with curl)`;
|
|
27
|
-
/** The starter policy `policy init` writes. */
|
|
28
|
-
export const STARTER_POLICY = {
|
|
29
|
-
version: 1,
|
|
30
|
-
roles: {
|
|
31
|
-
user: {
|
|
32
|
-
scopes: ["sessions:own", "agents:read"],
|
|
33
|
-
agents: "*",
|
|
34
|
-
limits: { turnsPerHour: 60, concurrentTurns: 2 },
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
anon: { scopes: [], agents: [] },
|
|
38
|
-
tokens: { maxTtlSeconds: 600 },
|
|
39
|
-
};
|
|
11
|
+
signing-keys rotate [--force] rotate; --force ends outstanding delivery tokens and links
|
|
12
|
+
signing-keys revoke <kid> revoke a previous or standby key`;
|
|
40
13
|
const usageError = (message = accessUsage) => new CliError(message, 2);
|
|
41
14
|
async function linkedClient() {
|
|
42
15
|
let connection;
|
|
@@ -49,41 +22,8 @@ async function linkedClient() {
|
|
|
49
22
|
return createClient({ url: connection.url, key: connection.key });
|
|
50
23
|
}
|
|
51
24
|
const print = (value) => console.log(JSON.stringify(value, null, 2));
|
|
52
|
-
function option(args, name) {
|
|
53
|
-
const index = args.indexOf(name);
|
|
54
|
-
if (index === -1)
|
|
55
|
-
return undefined;
|
|
56
|
-
const value = args[index + 1];
|
|
57
|
-
if (!value || value.startsWith("--"))
|
|
58
|
-
throw usageError(`${name} requires a value.`);
|
|
59
|
-
args.splice(index, 2);
|
|
60
|
-
return value;
|
|
61
|
-
}
|
|
62
25
|
export async function accessCommand(input, client = linkedClient) {
|
|
63
|
-
const [topic, action, ...
|
|
64
|
-
const args = [...rest];
|
|
65
|
-
if (topic === "policy") {
|
|
66
|
-
if (action === "get" && args.length === 0)
|
|
67
|
-
return print(await (await client()).access.getPolicy());
|
|
68
|
-
if (action === "init" && args.length === 0)
|
|
69
|
-
return print(await (await client()).access.putPolicy(STARTER_POLICY));
|
|
70
|
-
if (action === "set" && args.length === 1) {
|
|
71
|
-
let parsed;
|
|
72
|
-
try {
|
|
73
|
-
parsed = JSON.parse(await readFile(args[0], "utf8"));
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
throw new CliError(`Could not read ${args[0]}: ${error instanceof Error ? error.message : String(error)}`, 1);
|
|
77
|
-
}
|
|
78
|
-
// Accept the file as the policy itself or as `{ policy }`, as `policy get` prints it.
|
|
79
|
-
const candidate = parsed && typeof parsed === "object" && "policy" in parsed
|
|
80
|
-
? parsed.policy
|
|
81
|
-
: parsed;
|
|
82
|
-
// The Runtime validates it and names what is wrong.
|
|
83
|
-
return print(await (await client()).access.putPolicy(candidate));
|
|
84
|
-
}
|
|
85
|
-
throw usageError();
|
|
86
|
-
}
|
|
26
|
+
const [topic, action, ...args] = input;
|
|
87
27
|
if (topic === "signing-keys") {
|
|
88
28
|
const keys = async () => (await client()).access.signingKeys;
|
|
89
29
|
if (action === "list" && args.length === 0)
|
|
@@ -98,47 +38,7 @@ export async function accessCommand(input, client = linkedClient) {
|
|
|
98
38
|
return print(await (await keys()).revoke(args[0]));
|
|
99
39
|
throw usageError();
|
|
100
40
|
}
|
|
101
|
-
if (topic === "keys")
|
|
102
|
-
|
|
103
|
-
if (action === "list" && args.length === 0)
|
|
104
|
-
return print(await (await keys()).list());
|
|
105
|
-
if (action === "create") {
|
|
106
|
-
const name = option(args, "--name");
|
|
107
|
-
const origins = [];
|
|
108
|
-
for (let origin = option(args, "--origin"); origin; origin = option(args, "--origin"))
|
|
109
|
-
origins.push(origin);
|
|
110
|
-
if (!name || args.length > 0)
|
|
111
|
-
throw usageError();
|
|
112
|
-
return print(await (await keys()).create({ name, origins }));
|
|
113
|
-
}
|
|
114
|
-
if (action === "set-origins" && args.length >= 1) {
|
|
115
|
-
const [keyId, ...origins] = args;
|
|
116
|
-
return print(await (await keys()).update(keyId, { origins }));
|
|
117
|
-
}
|
|
118
|
-
if (action === "revoke" && args.length === 1)
|
|
119
|
-
return print(await (await keys()).revoke(args[0]));
|
|
120
|
-
throw usageError();
|
|
121
|
-
}
|
|
122
|
-
if (topic === "revoke") {
|
|
123
|
-
if (!action || args.length > 0)
|
|
124
|
-
throw usageError();
|
|
125
|
-
return print(await (await client()).access.revokeSubject(action));
|
|
126
|
-
}
|
|
127
|
-
if (topic === "token") {
|
|
128
|
-
const all = [action, ...args].filter((arg) => arg !== undefined);
|
|
129
|
-
const subject = option(all, "--subject");
|
|
130
|
-
const role = option(all, "--role");
|
|
131
|
-
const ttl = option(all, "--ttl");
|
|
132
|
-
if (!subject || !role || all.length > 0)
|
|
133
|
-
throw usageError();
|
|
134
|
-
const ttlSeconds = ttl === undefined ? undefined : Number(ttl);
|
|
135
|
-
if (ttlSeconds !== undefined && !Number.isInteger(ttlSeconds))
|
|
136
|
-
throw usageError("--ttl must be a whole number of seconds.");
|
|
137
|
-
return print(await (await client()).tokens.create({
|
|
138
|
-
subject,
|
|
139
|
-
role,
|
|
140
|
-
...(ttlSeconds === undefined ? {} : { ttlSeconds }),
|
|
141
|
-
}));
|
|
142
|
-
}
|
|
41
|
+
if (topic === "policy" || topic === "keys" || topic === "revoke" || topic === "token")
|
|
42
|
+
throw usageError(`nylo access ${topic} was removed: the Runtime no longer mints subject tokens or keeps an access policy, browser keys or revocations (protocol 7). Trust your identity provider's tokens with an identity file, and give servers an operator key (nylorun key put <id>).`);
|
|
143
43
|
throw usageError();
|
|
144
44
|
}
|
package/dist/cli.js
CHANGED
|
@@ -16,11 +16,7 @@ npx nylorun start writes, or NYLORUN_RUNTIME_URL and NYLORUN_SERVER_KEY):
|
|
|
16
16
|
reset [--sessions|--sandboxes|--all] [--yes]
|
|
17
17
|
clear the Tenant's sessions, sandboxes or all its data
|
|
18
18
|
endpoints [--json]|ping <agent> the registered Action endpoints and their health
|
|
19
|
-
access
|
|
20
|
-
access keys list|create|set-origins|revoke publishable keys for web pages and apps
|
|
21
|
-
access signing-keys list|rotate|revoke the Tenant's token signing keys
|
|
22
|
-
access revoke <subject> end a subject's tokens and open streams
|
|
23
|
-
access token --subject <s> --role <r> mint a subject token for trying the API
|
|
19
|
+
access signing-keys list|rotate|revoke the Tenant's token signing keys (nylo access --help)
|
|
24
20
|
configure set the linked Tenant's model provider
|
|
25
21
|
env print the linked Project's NYLORUN_* variables as exports
|
|
26
22
|
doctor sandbox [--json] show which sandbox backend this Tenant's Host offers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylorun/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-beta",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Nylorun Runtime client: the linked installation's Tenant, its access and its model provider",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"prepack": "npm run build"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nylorun/agents": "0.
|
|
34
|
-
"@nylorun/admin": "0.
|
|
33
|
+
"@nylorun/agents": "0.14.0-beta",
|
|
34
|
+
"@nylorun/admin": "0.10.0-beta",
|
|
35
35
|
"@earendil-works/pi-ai": "0.99.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|