@nylorun/cli 0.7.0-beta → 0.9.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 +49 -0
- package/README.md +12 -13
- package/dist/cli.js +11 -11
- package/dist/home.d.ts +2 -2
- package/dist/home.js +2 -2
- package/dist/installation/commands.js +6 -11
- package/dist/project/connection.js +1 -1
- package/dist/project/env.js +1 -1
- package/dist/project/link.d.ts +4 -4
- package/dist/project/link.js +10 -7
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @nylorun/cli
|
|
2
2
|
|
|
3
|
+
## 0.9.0-beta
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- b352feb: **File artifacts, message parts and capability links (protocol 6).** Upgrade these with the Runtime: they speak protocol 6, which this Runtime serves beside 4 and 5. See MIGRATION.md.
|
|
8
|
+
|
|
9
|
+
- **`@nylorun/runtime`: file artifacts.** A file is an artifact: an `af_` id, a name and numbered immutable versions, with rows in the new `artifacts` and `artifact_versions` tables (migration `0004_artifacts`) and bytes in the Object store (`BlobStore`). `POST /v1/artifacts?name=&sessionId=` uploads a file in one streamed request and `POST /v1/artifacts/{id}/versions` adds a version, within the Tenant's limits (`GET`/`PUT /v1/tenant/artifacts`: 100 MiB per file and 10 GiB in all by default); a body past either is `413 limit_exceeded`, refused mid-stream with nothing stored. `GET /v1/artifacts` lists them (by session), `GET /v1/artifacts/{id}` reads one with its versions, `GET /v1/artifacts/{id}/versions/{n|latest}/content` downloads through the Runtime with HTTP Range (`206`, `Content-Range`, `416`), and `DELETE /v1/artifacts/{id}` deletes it with its bytes. A session's artifacts go with it on a sessions reset, and appear in its history as `artifact.created`, `artifact.version.created` and `artifact.deleted` (new in the event catalog). A subject reaches only the artifacts of their own sessions.
|
|
10
|
+
- **`@nylorun/runtime`: capability links.** `POST /v1/artifacts/{id}/links` mints a short-lived path, `/v1/artifact-links/<token>`, that downloads one version (with Range) with no credential and no `Nylorun-Protocol`: an ES256 JWT (`typ: nylorun-artifact+jwt`) signed with the Tenant's signing key, at most 15 minutes, and dead once the artifact is deleted. The Host logs its path without the token.
|
|
11
|
+
- **Breaking (`@nylorun/core`, `@nylorun/runtime`): message `parts`.** A user message may carry `parts`: `text`, and `file` by `artifactId` (and `version`, else the latest, pinned when the message is accepted). Model-gate reads the file from the Object store: an image goes to the model as image input, a text file as text, and any other file fails the call (`invalid_request`). The record and the transcript hold only the reference. The gateway builds its `BlobStore` from `NYLORUN_OBJECT_STORE_*` (the Tenant's `fs` store without it). `PROTOCOL_VERSION` is 6; `HOST_PROTOCOL` is 4–6 and protocol 6 clients require the feature `artifacts`.
|
|
12
|
+
- **`@nylorun/runtime`: `save_artifact`.** A session with a sandbox gets the `nylorun.artifacts` capability, whose `save_artifact` tool saves a sandbox file (`path`) or text (`content`) as an artifact of the session, carrying the turn and tool call on its event.
|
|
13
|
+
- **Breaking (`@nylorun/runtime`): `MediaStore` is removed.** `MediaStore` and `localMedia` leave `@nylorun/runtime/node`, and `piModel` takes `files` (a resolver from an artifact reference to its bytes) instead of `media`; images are file artifacts. The image checks (`decodeImageBase64`, `validateImageBytes`, `IMAGE_MEDIA_TYPES`, `MAX_IMAGE_BYTES`) stay.
|
|
14
|
+
- **`@nylorun/agents`:** `client.artifacts` (`upload`, `uploadVersion`, `list`, `get`, `download` with a range, `link`, `delete`), also on `BrowserClient`, and `session.inputParts(parts)`. A request with a body of its own type keeps it.
|
|
15
|
+
- `@nylorun/admin`, `@nylorun/cli`, `nylorun`, `@nylorun/studio`: speak protocol 6.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Pin agents to the tested release.
|
|
20
|
+
- Pin admin to the tested release.
|
|
21
|
+
- Updated dependencies [b352feb]
|
|
22
|
+
- Updated dependencies [6077272]
|
|
23
|
+
- Updated dependencies [926711b]
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @nylorun/agents@0.13.0-beta
|
|
27
|
+
- @nylorun/admin@0.9.0-beta
|
|
28
|
+
|
|
29
|
+
## 0.8.0-beta
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- 4b9906f: **Breaking: "Tenant" replaces "stack", and `nylorun start` works anywhere.** Each local installation holds one Tenant, and its name is the Tenant's name, so help, output, errors and docs say Tenant. See MIGRATION.md.
|
|
34
|
+
|
|
35
|
+
- **Breaking (`nylorun`): selection.** Every command acts on the Tenant `--tenant <name>` names (replaces `--name`, which is removed), else `NYLORUN_TENANT` (replaces `NYLORUN_STACK`), else the Project link's `tenant`; `start` in a project names a new one after the project directory. Outside a project, or with `start --no-link`, commands act on the Tenant `default`. In a project without a link, commands other than `start` exit 2 and list the machine's Tenants. A name starting with `tn_` (a Tenant id) is refused.
|
|
36
|
+
- **Breaking (`nylorun`): files.** Host roots are under `~/.nylorun/tenants/<name>/` (was `~/.nylorun/stacks/<name>/`) with `tenant.json` (was `stack.json`); the `.env` key is `NYLORUN_TENANT_NAME` (was `NYLORUN_STACK_NAME`); `NYLORUN_COMPOSE_PROJECT` replaces `NYLORUN_STACK_PROJECT`. Compose projects stay `nylorun-<name>`. Every command first moves 0.4 Host roots from `~/.nylorun/stacks/` to `~/.nylorun/tenants/` (renaming `stack.json` and the `.env` key), so they keep their volumes and keys. `nylorun ls` lists only directories with `tenant.json`.
|
|
37
|
+
- **Breaking (`nylorun`): removed.** `nylorun legacy` and all handling of the single stack of releases before 0.4; the hidden `nylorun stack <cmd>` alias; `nylorun doctor stack|runtime`. Output says Tenant: `ls` prints `TENANT` and JSON `{ "tenants": [...] }`, `status` prints the Tenant id on its own line, and `doctor`'s row is `tenant`.
|
|
38
|
+
- **Breaking: Project link format 3.** `.nylorun/link.json` is `{ "format": 3, "tenant", "tenantId", "hostUrl", "hostId" }`; `tenant` replaces `stack`. `@nylorun/agents`, `@nylorun/cli` and `@nylorun/admin` refuse an older link and name `npx nylorun start`, which rewrites it. `@nylorun/core`'s `ProjectLinkFileSchema` parses formats 0–3 with `tenant`.
|
|
39
|
+
- **Breaking (`@nylorun/admin`):** `createAdmin({ tenant })` replaces `{ stack }`, `tenantHostRoot(name)` replaces `stackHostRoot(name)`, and local resolution reads `NYLORUN_TENANT` and the link's `tenant`.
|
|
40
|
+
- `@nylorun/cli`: `status` and `endpoints` drop the `stack` line and JSON key; messages say Tenant. `@nylorun/agents`: a Runtime too old for the client says "update the Runtime (npx nylorun@latest start)". `@nylorun/studio`: setup hints say Tenant. `@nylorun/create-agent`: the next steps describe `npx nylorun@beta start` as this project's Tenant and its link.
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Pin agents to the tested release.
|
|
45
|
+
- Pin admin to the tested release.
|
|
46
|
+
- Updated dependencies [4b9906f]
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- Updated dependencies
|
|
49
|
+
- @nylorun/agents@0.12.0-beta
|
|
50
|
+
- @nylorun/admin@0.8.0-beta
|
|
51
|
+
|
|
3
52
|
## 0.7.0-beta
|
|
4
53
|
|
|
5
54
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# @nylorun/cli
|
|
2
2
|
|
|
3
3
|
The Runtime client, command `nylo`: it acts on the one Tenant of an
|
|
4
|
-
installation, a local
|
|
5
|
-
and running
|
|
4
|
+
installation, a local Tenant or any Runtime reachable by URL and key. Setting up
|
|
5
|
+
and running local Tenants is [`nylorun`](../nylorun/README.md)'s job; the two
|
|
6
6
|
packages are independent and never call each other. Depends on
|
|
7
7
|
`@nylorun/agents` and `@nylorun/admin` only among Nylorun packages. Vocabulary:
|
|
8
8
|
[runtime/src/CONTEXT.md](../runtime/src/CONTEXT.md).
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
|
-
npx nylorun start # in the project: its
|
|
11
|
+
npx nylorun start # in the project: its Tenant and the Project link
|
|
12
12
|
npx @nylorun/cli status # the linked Tenant
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Commands
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
nylo status [--json] # the Tenant, its checks and counts
|
|
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
21
|
nylo access … # access policy, publishable and signing keys, subject tokens
|
|
@@ -28,9 +28,9 @@ Every command acts on the linked installation: the Project link and
|
|
|
28
28
|
credentials (below), or `NYLORUN_RUNTIME_URL` and `NYLORUN_SERVER_KEY` when the
|
|
29
29
|
Project has no link. An installation serves one Tenant, so nothing selects it.
|
|
30
30
|
|
|
31
|
-
Local
|
|
31
|
+
Local Tenant commands (`up`, `down`, `start`, `stop`, `logs`, `studio`) exit 2
|
|
32
32
|
naming `npx nylorun <command>`. `nylo tenant …` exits 2: `npx nylorun start`
|
|
33
|
-
creates the
|
|
33
|
+
creates the project's Tenant and the link, and `nylo status|reset|endpoints`
|
|
34
34
|
replace `nylo tenant status|reset|endpoints`. `nylorun dev` was removed: run
|
|
35
35
|
`npx nylorun start` once, then the project's own `npm run dev`
|
|
36
36
|
(`tsx watch src/main.ts`).
|
|
@@ -38,9 +38,9 @@ replace `nylo tenant status|reset|endpoints`. `nylorun dev` was removed: run
|
|
|
38
38
|
## `nylo status`
|
|
39
39
|
|
|
40
40
|
Reads the Tenant API status (`GET /v1/tenant`) and prints the Tenant, the
|
|
41
|
-
|
|
41
|
+
Runtime URL, the checks, the counts and the sandbox
|
|
42
42
|
backend. When the Tenant is not open it does not answer; `nylo status` then
|
|
43
|
-
asks the Admin API (`/v1/admin/status`, through the local
|
|
43
|
+
asks the Admin API (`/v1/admin/status`, through the local Tenant's Host root or
|
|
44
44
|
`NYLORUN_ADMIN_URL` and `NYLORUN_ADMIN_KEY`) and prints why, with the repair.
|
|
45
45
|
|
|
46
46
|
## `nylo reset`
|
|
@@ -53,15 +53,14 @@ not in a terminal. The Project link and credentials are kept.
|
|
|
53
53
|
|
|
54
54
|
`npx nylorun start` writes it; `nylo` only reads it. A **Project** stores only:
|
|
55
55
|
|
|
56
|
-
- `.nylorun/link.json`: `{ format:
|
|
57
|
-
(`tenantId` is information)
|
|
56
|
+
- `.nylorun/link.json`: `{ format: 3, tenant, hostUrl, hostId, tenantId }`
|
|
57
|
+
(`tenant` is the local Tenant's name; `tenantId` is information)
|
|
58
58
|
- `.nylorun/credentials.json`: the key of the derived principal `project` and
|
|
59
59
|
its id (0600)
|
|
60
60
|
- `.nylorun/.gitignore` containing `*`
|
|
61
61
|
|
|
62
|
-
A
|
|
63
|
-
|
|
64
|
-
stack and links it again.
|
|
62
|
+
A link from an older nylorun (format 0 to 2): `nylo` refuses it and says to run
|
|
63
|
+
`npx nylorun start`, which links the project again.
|
|
65
64
|
|
|
66
65
|
`createActionHandler` and `createClient` in `@nylorun/agents` read the link (or
|
|
67
66
|
the two variables), so the project's `npm run dev` and `npm start` need no
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ const usage = `nylo <status|reset|endpoints|access|configure|env|doctor>
|
|
|
12
12
|
|
|
13
13
|
Runtime client for the linked installation and its one Tenant (the Project link that
|
|
14
14
|
npx nylorun start writes, or NYLORUN_RUNTIME_URL and NYLORUN_SERVER_KEY):
|
|
15
|
-
status [--json] the Tenant, its checks and counts
|
|
15
|
+
status [--json] the Tenant, its checks and counts
|
|
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
|
|
@@ -25,14 +25,14 @@ npx nylorun start writes, or NYLORUN_RUNTIME_URL and NYLORUN_SERVER_KEY):
|
|
|
25
25
|
env print the linked Project's NYLORUN_* variables as exports
|
|
26
26
|
doctor sandbox [--json] show which sandbox backend this Tenant's Host offers
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/** Local
|
|
31
|
-
const
|
|
32
|
-
"up", "down", "start", "stop", "logs", "studio", "
|
|
28
|
+
Local Tenants are run by the nylorun package: npx nylorun start in a project creates its
|
|
29
|
+
Tenant and the Project link.`;
|
|
30
|
+
/** Local Tenant commands, which the nylorun package runs. */
|
|
31
|
+
const LOCAL_COMMANDS = new Set([
|
|
32
|
+
"up", "down", "start", "stop", "logs", "studio", "runtime", "restart", "run",
|
|
33
33
|
]);
|
|
34
34
|
const TENANT_REMOVED = `nylo tenant was removed: an installation serves one Tenant.
|
|
35
|
-
Run "npx nylorun start" in your project to create its
|
|
35
|
+
Run "npx nylorun start" in your project to create its Tenant and the Project link.
|
|
36
36
|
Then use nylo status, nylo reset and nylo endpoints on the linked installation.`;
|
|
37
37
|
function parseFlags(args, allowed = {}) {
|
|
38
38
|
const booleans = new Set();
|
|
@@ -99,15 +99,15 @@ async function main() {
|
|
|
99
99
|
if (command === "doctor") {
|
|
100
100
|
const [topic, ...options] = args;
|
|
101
101
|
if (topic !== "sandbox" || options.some((option) => option !== "--json"))
|
|
102
|
-
throw usageError("Usage: nylo doctor sandbox [--json]. Check the local
|
|
102
|
+
throw usageError("Usage: nylo doctor sandbox [--json]. Check the local Tenant with npx nylorun doctor.");
|
|
103
103
|
const { doctorSandbox } = await import("./doctor.js");
|
|
104
104
|
await doctorSandbox({ json: options.includes("--json") });
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
if (command === "dev")
|
|
108
108
|
throw usageError('nylorun dev was removed: run "npx nylorun start" once in your project, then your project\'s npm run dev.');
|
|
109
|
-
if (
|
|
110
|
-
throw usageError(`
|
|
109
|
+
if (LOCAL_COMMANDS.has(command))
|
|
110
|
+
throw usageError(`Local Tenants are run by the nylorun package: npx nylorun ${command}`);
|
|
111
111
|
if (command === "configure") {
|
|
112
112
|
const flags = parseFlags(args);
|
|
113
113
|
if (flags.rest.length)
|
|
@@ -120,7 +120,7 @@ async function main() {
|
|
|
120
120
|
process.once("SIGTERM", () => cancel("SIGTERM"));
|
|
121
121
|
const health = await fetch(`${auth.url}/health`).catch(() => undefined);
|
|
122
122
|
if (!health?.ok)
|
|
123
|
-
throw new CliError(`No Runtime is listening at ${auth.url}. Start the local
|
|
123
|
+
throw new CliError(`No Runtime is listening at ${auth.url}. Start the local Tenant with "npx nylorun start".`, 6);
|
|
124
124
|
const catalog = await fetchModelCatalog({ url: auth.url, key: auth.key });
|
|
125
125
|
const prompted = await configureProvider({
|
|
126
126
|
signal: controller.signal,
|
package/dist/home.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Where `nylo` keeps its own files (the installation id): an explicit home,
|
|
3
|
-
* `NYLORUN_HOME`, or `~/.nylorun`, which holds the local
|
|
4
|
-
* (`
|
|
3
|
+
* `NYLORUN_HOME`, or `~/.nylorun`, which holds the local Tenants' Host roots
|
|
4
|
+
* (`tenants/<name>/`). `@nylorun/admin` resolves a Tenant's Host root itself.
|
|
5
5
|
*/
|
|
6
6
|
export declare function resolveHome(home?: string, env?: Readonly<Record<string, string | undefined>>): string;
|
package/dist/home.js
CHANGED
|
@@ -2,8 +2,8 @@ import { homedir } from "node:os";
|
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
3
|
/**
|
|
4
4
|
* Where `nylo` keeps its own files (the installation id): an explicit home,
|
|
5
|
-
* `NYLORUN_HOME`, or `~/.nylorun`, which holds the local
|
|
6
|
-
* (`
|
|
5
|
+
* `NYLORUN_HOME`, or `~/.nylorun`, which holds the local Tenants' Host roots
|
|
6
|
+
* (`tenants/<name>/`). `@nylorun/admin` resolves a Tenant's Host root itself.
|
|
7
7
|
*/
|
|
8
8
|
export function resolveHome(home, env = process.env) {
|
|
9
9
|
if (home !== undefined && home.trim() !== "")
|
|
@@ -18,17 +18,14 @@ export async function statusCommand(args) {
|
|
|
18
18
|
throw new CliError("Usage: nylo status [--json]", 2);
|
|
19
19
|
const root = projectRoot();
|
|
20
20
|
const connection = await linkedConnection(root);
|
|
21
|
-
const stack = connection.link?.stack;
|
|
22
21
|
let reason;
|
|
23
22
|
try {
|
|
24
23
|
const body = await clientFor(connection).transport.json("/v1/tenant", "GET");
|
|
25
24
|
if (json) {
|
|
26
|
-
console.log(JSON.stringify(
|
|
25
|
+
console.log(JSON.stringify(body, null, 2));
|
|
27
26
|
return;
|
|
28
27
|
}
|
|
29
28
|
console.log(`${body.tenant.name} ${body.tenant.id}`);
|
|
30
|
-
if (stack)
|
|
31
|
-
console.log(`stack ${stack}`);
|
|
32
29
|
console.log(`runtime ${connection.url}`);
|
|
33
30
|
console.log(`path ${body.path}`);
|
|
34
31
|
console.log(`checks ${Object.entries(body.checks)
|
|
@@ -52,12 +49,10 @@ export async function statusCommand(args) {
|
|
|
52
49
|
: `The Tenant at ${connection.url} is not reachable.`, 1);
|
|
53
50
|
}
|
|
54
51
|
if (json) {
|
|
55
|
-
console.log(JSON.stringify({
|
|
52
|
+
console.log(JSON.stringify({ tenant }, null, 2));
|
|
56
53
|
return;
|
|
57
54
|
}
|
|
58
55
|
console.log(`${tenant.name ?? "(unreadable)"} ${tenant.id ?? "(unknown)"} ${tenant.state}`);
|
|
59
|
-
if (stack)
|
|
60
|
-
console.log(`stack ${stack}`);
|
|
61
56
|
console.log(`runtime ${connection.url}`);
|
|
62
57
|
if (tenant.cause) {
|
|
63
58
|
console.log(`reason ${tenant.cause.code}: ${tenant.cause.message}`);
|
|
@@ -76,10 +71,10 @@ export async function resetCommand(args) {
|
|
|
76
71
|
throw new CliError("Pass only one of --sessions, --sandboxes, --all.", 2);
|
|
77
72
|
const scope = flags.length ? SCOPES[flags[0]] : "sessions";
|
|
78
73
|
const connection = await linkedConnection(projectRoot());
|
|
79
|
-
const
|
|
80
|
-
const
|
|
74
|
+
const tenant = connection.link?.tenant;
|
|
75
|
+
const target = tenant ? `Tenant ${tenant} (${connection.url})` : `the Tenant on ${connection.url}`;
|
|
81
76
|
if (scope === "all" && !yes)
|
|
82
|
-
await confirmOrThrow(`Reset ALL data of
|
|
77
|
+
await confirmOrThrow(`Reset ALL data of ${target}? The Project link and credentials are kept. [y/N] `);
|
|
83
78
|
try {
|
|
84
79
|
await clientFor(connection).transport.json("/v1/tenant/reset", "POST", {
|
|
85
80
|
requestId: randomUUID(),
|
|
@@ -90,7 +85,7 @@ export async function resetCommand(args) {
|
|
|
90
85
|
catch (error) {
|
|
91
86
|
throw new CliError(error instanceof Error ? error.message : `Tenant reset failed: ${String(error)}`, 1);
|
|
92
87
|
}
|
|
93
|
-
console.log(`Reset
|
|
88
|
+
console.log(`Reset ${target} (${scope}).`);
|
|
94
89
|
}
|
|
95
90
|
async function confirmOrThrow(prompt) {
|
|
96
91
|
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
@@ -14,5 +14,5 @@ export async function linkedConnection(projectRoot, env = process.env) {
|
|
|
14
14
|
const key = env.NYLORUN_SERVER_KEY?.trim();
|
|
15
15
|
if (url && key)
|
|
16
16
|
return { url: url.replace(/\/$/, ""), key };
|
|
17
|
-
throw new CliError(`No Project link in ${projectRoot}. Run "npx nylorun start" in this project to start its
|
|
17
|
+
throw new CliError(`No Project link in ${projectRoot}. Run "npx nylorun start" in this project to start its Tenant and link it, or set NYLORUN_RUNTIME_URL and NYLORUN_SERVER_KEY.`, 1);
|
|
18
18
|
}
|
package/dist/project/env.js
CHANGED
|
@@ -7,7 +7,7 @@ export async function printLinkedEnvExports(projectRoot = process.cwd()) {
|
|
|
7
7
|
const link = await readLink(root);
|
|
8
8
|
const credentials = await readCredentials(root);
|
|
9
9
|
if (!link || !credentials) {
|
|
10
|
-
console.log('# No Project link in this directory. Run "npx nylorun start" in this project to start its
|
|
10
|
+
console.log('# No Project link in this directory. Run "npx nylorun start" in this project to start its Tenant and link it.');
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
console.log(`export NYLORUN_RUNTIME_URL=${shellQuote(link.hostUrl)}`);
|
package/dist/project/link.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Project-local link to an installation (format
|
|
2
|
+
* Project-local link to an installation (format 3). `nylorun start` writes it; `nylo` only
|
|
3
3
|
* reads it. `tenantId` is information: the installation serves one Tenant, so nothing selects it.
|
|
4
4
|
*/
|
|
5
5
|
export interface ProjectLink {
|
|
6
|
-
format:
|
|
7
|
-
/** The local
|
|
8
|
-
|
|
6
|
+
format: 3;
|
|
7
|
+
/** The local Tenant the link names (`~/.nylorun/tenants/<tenant>/`). */
|
|
8
|
+
tenant?: string;
|
|
9
9
|
hostUrl: string;
|
|
10
10
|
hostId: string;
|
|
11
11
|
tenantId?: string;
|
package/dist/project/link.js
CHANGED
|
@@ -29,19 +29,22 @@ export async function readLink(projectRoot) {
|
|
|
29
29
|
catch {
|
|
30
30
|
throw new CliError(`Invalid Project link at ${path}. Remove .nylorun/link.json and run "npx nylorun start".`, 1);
|
|
31
31
|
}
|
|
32
|
-
// Formats 0
|
|
33
|
-
if (value?.format === undefined ||
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
// Formats 0 to 2 are from older releases.
|
|
33
|
+
if (value?.format === undefined ||
|
|
34
|
+
value.format === 0 ||
|
|
35
|
+
value.format === 1 ||
|
|
36
|
+
value.format === 2)
|
|
37
|
+
throw new CliError(`The Project link at ${path} is from an older nylorun. Run "npx nylorun start" in this project to link it again.`, 1);
|
|
38
|
+
if (value.format !== 3)
|
|
36
39
|
throw new CliError(`Project link at ${path} has an unsupported format. Upgrade the CLI.`, 1);
|
|
37
40
|
if (typeof value.hostUrl !== "string" ||
|
|
38
41
|
typeof value.hostId !== "string" ||
|
|
39
|
-
(value.
|
|
42
|
+
(value.tenant !== undefined && typeof value.tenant !== "string") ||
|
|
40
43
|
(value.tenantId !== undefined && typeof value.tenantId !== "string"))
|
|
41
44
|
throw new CliError(`Invalid Project link at ${path}. Remove .nylorun/link.json and run "npx nylorun start".`, 1);
|
|
42
45
|
return {
|
|
43
|
-
format:
|
|
44
|
-
...(value.
|
|
46
|
+
format: 3,
|
|
47
|
+
...(value.tenant ? { tenant: value.tenant } : {}),
|
|
45
48
|
hostUrl: value.hostUrl.replace(/\/$/, ""),
|
|
46
49
|
hostId: value.hostId,
|
|
47
50
|
...(value.tenantId ? { tenantId: value.tenantId } : {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylorun/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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,14 +30,14 @@
|
|
|
30
30
|
"prepack": "npm run build"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nylorun/agents": "0.
|
|
34
|
-
"@nylorun/admin": "0.
|
|
33
|
+
"@nylorun/agents": "0.13.0-beta",
|
|
34
|
+
"@nylorun/admin": "0.9.0-beta",
|
|
35
35
|
"@earendil-works/pi-ai": "0.99.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
39
39
|
"@types/node": "^26.5.0",
|
|
40
|
-
"vitest": "^5.0.
|
|
40
|
+
"vitest": "^5.0.2"
|
|
41
41
|
},
|
|
42
42
|
"bin": {
|
|
43
43
|
"nylo": "dist/cli.js"
|