@nylorun/create-agent 0.8.1-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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0-beta
4
+
5
+ ### Minor Changes
6
+
7
+ - c49efed: **Breaking (pre-1.0 minor):** Generated starter matches Runtime Clients layout.
8
+
9
+ - Adds `src/main.ts` with `connectAgents({ agents })`.
10
+ - `start` → `node dist/src/main.js`; `studio` → `nylorun-studio`.
11
+ - `@nylorun/cli` and `@nylorun/studio` move to `devDependencies`; production depends on `@nylorun/agents` (and `zod`) only.
12
+ - `--no-studio` removes Studio without rewriting `dev`.
13
+ - Before `npm run dev`, checks the prerequisites (Node 24+ and `nylorun-runtime` on PATH). If one is missing, it stops after creating the project and prints the install commands; it never installs them.
14
+
15
+ ### Patch Changes
16
+
17
+ - Update the tested Harness, SDK, Runtime, and Studio compatibility combination.
18
+
3
19
  ## 0.8.1-beta
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -1,26 +1,59 @@
1
1
  # @nylorun/create-agent
2
2
 
3
+ Install the prerequisites first (the creator checks them and never installs
4
+ them):
5
+
3
6
  ```sh
7
+ node --version # 24 or newer
8
+ npm install --global @nylorun/runtime@beta # provides nylorun-runtime
4
9
  npm create @nylorun/agent@beta my-agent
5
10
  ```
6
11
 
7
- Creates a Node 24 project with `@nylorun/agents`, `@nylorun/cli`, Zod, and optional Studio. The registry in `agents/index.ts` exports agent definitions. The starter includes one ordinary `lookup_order` tool; ask “Look up order demo-123”.
12
+ Creates a Node 24 project with `@nylorun/agents` and Zod in production, plus
13
+ `@nylorun/cli` and optional Studio as development tools. The registry in
14
+ `agents/index.ts` exports agent definitions. `src/main.ts` calls
15
+ `connectAgents` for both `npm run dev` and `npm start`. The starter includes
16
+ one ordinary `lookup_order` tool; ask “Look up order demo-123”.
8
17
 
9
- Creation installs dependencies and starts development. Use `-- --no-studio` for headless development or `-- --no-open` to suppress browser opening. `--yes` affects installation only. The first `nylorun dev` or `nylorun serve` starts the local Runtime and asks for the model provider when the terminal is interactive and stores the credential in the Runtime vault. A non-interactive start without a credential exits and names that setup. `NYLORUN_DEV_MODEL=fixture` skips it.
18
+ Creation installs dependencies and starts development. If a prerequisite is
19
+ missing, it stops after creating the project and prints what to install. Use `-- --no-studio` to
20
+ omit Studio from the project, or `-- --no-open` to suppress browser opening.
21
+ `--yes` affects installation only. The first `nylorun dev` starts the local
22
+ Runtime and asks for the model provider when the terminal is interactive and
23
+ stores the credential in the Runtime vault. A non-interactive start without a
24
+ credential exits and names that setup. `NYLORUN_DEV_MODEL=fixture` skips it.
10
25
 
11
26
  ```sh
12
27
  cd my-agent
13
28
  npm run dev
29
+ npm run studio
14
30
  npm run build
15
31
  npm start
16
32
  ```
17
33
 
18
- Development restarts the Runtime and connected executor on source changes. `npm start` runs `nylorun serve`, which uses `dist/agents/index.js` and runs headless. Studio can attach separately and can replace an API-key credential. `nylorun configure` replaces the credential against an already running Runtime. Local Runtime credentials, the vault, and SQLite are stored in gitignored `.nylorun/`. Definitions have no model provider or `agent.run()`.
19
-
20
- `starter/` is the canonical template. `compatibility.json` pins core, harness, SDK, Runtime, Studio and CLI. The examples recipe adds local package dependencies. Run `npm run examples:sync` after template changes, then `npm install --prefix examples`. Sync preserves authored agents, tests, credentials, and local state; it rejects conflicting edits to generated files.
21
-
22
- The default examples registry contains the release starter. Advanced examples remain outside that registry for later migration.
23
-
24
- After building, `node create-agent/scripts/smoke-starter.mjs` installs packed packages outside the workspace and checks the actual Studio/tool workflow, history, reload, source restart, compiled start, headless mode, and shutdown. It uses a deterministic fixture without live provider calls. Browser checks require Chrome (or `NYLORUN_CHROME_PATH`).
25
-
26
- See [RELEASING](../RELEASING.md) for the Changesets beta workflow. Nothing is published by the smoke check.
34
+ `npm run studio` runs `nylorun-studio` and can start before or after `dev`.
35
+ `npm start` runs `node dist/src/main.js` with the same entry as development.
36
+ Export the Project environment (`eval "$(npx nylorun runtime status --env)"`)
37
+ before a production start when there is no Project link. Studio can replace an
38
+ API-key credential. `nylorun configure` replaces the credential against an
39
+ already running Runtime. Local Runtime credentials, the vault, and SQLite are
40
+ stored in gitignored `.nylorun/`. Definitions have no model provider or
41
+ `agent.run()`.
42
+
43
+ `starter/` is the canonical template. `compatibility.json` pins core, harness,
44
+ agents, admin, Runtime, Studio and CLI. The examples recipe adds local package
45
+ dependencies. Run `npm run examples:sync` after template changes, then
46
+ `npm install --prefix examples`. Sync preserves authored agents, tests,
47
+ credentials, and local state; it rejects conflicting edits to generated files.
48
+
49
+ The default examples registry contains the release starter. Advanced examples
50
+ remain outside that registry for later migration.
51
+
52
+ After building, `node create-agent/scripts/smoke-starter.mjs` installs packed
53
+ packages outside the workspace and checks the actual Studio/tool workflow,
54
+ history, reload, source restart, compiled start, headless mode, and shutdown.
55
+ It uses a deterministic fixture without live provider calls. Browser checks
56
+ require Chrome (or `NYLORUN_CHROME_PATH`).
57
+
58
+ See [RELEASING](../RELEASING.md) for the Changesets beta workflow. Nothing is
59
+ published by the smoke check.
@@ -1,8 +1,9 @@
1
1
  {
2
- "harness": "0.18.0-beta",
3
- "studio": "0.8.0-beta",
4
- "runtime": "0.9.0-beta",
5
- "agents": "0.5.0-beta",
6
- "core": "0.4.0-beta",
7
- "cli": "0.2.1-beta"
2
+ "harness": "0.19.0-beta",
3
+ "studio": "0.9.0-beta",
4
+ "runtime": "0.10.0-beta",
5
+ "agents": "0.6.0-beta",
6
+ "admin": "0.2.0-beta",
7
+ "core": "0.5.0-beta",
8
+ "cli": "0.3.0-beta"
8
9
  }
package/dist/cli.js CHANGED
@@ -1,11 +1,28 @@
1
1
  #!/usr/bin/env node
2
2
  import { mkdir, rename, rm, writeFile, readFile } from "node:fs/promises";
3
- import { existsSync } from "node:fs";
3
+ import { existsSync, statSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
- import { dirname, join } from "node:path";
5
+ import { delimiter, dirname, join } from "node:path";
6
6
  import { createProject, CreationError } from "./project.js";
7
7
  import { parse, usage } from "./arguments.js";
8
8
  import { CreationCancelled, runCommand } from "./process.js";
9
+ function findOnPath(name) {
10
+ const extensions = process.platform === "win32"
11
+ ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean)
12
+ : [""];
13
+ for (const dir of (process.env.PATH ?? "").split(delimiter).filter(Boolean))
14
+ for (const extension of extensions) {
15
+ const candidate = join(dir, `${name}${extension.toLowerCase()}`);
16
+ try {
17
+ if (statSync(candidate).isFile())
18
+ return candidate;
19
+ }
20
+ catch {
21
+ /* not here */
22
+ }
23
+ }
24
+ return undefined;
25
+ }
9
26
  async function main() {
10
27
  const argv = process.argv.slice(2);
11
28
  if (argv.length === 1 && ["--help", "-h"].includes(argv[0])) {
@@ -35,6 +52,8 @@ async function main() {
35
52
  remove: async (path) => rm(path, { recursive: true, force: true }),
36
53
  write: async (path, content) => writeFile(path, content),
37
54
  run: (command, args, directory) => runCommand(command, args, directory, controller.signal),
55
+ nodeVersion: process.versions.node,
56
+ findOnPath,
38
57
  };
39
58
  const compatibility = JSON.parse(await readFile(join(dirname(fileURLToPath(import.meta.url)), "compatibility.json"), "utf8"));
40
59
  await createProject(options, compatibility, dependencies);
@@ -1,8 +1,9 @@
1
1
  {
2
- "harness": "0.18.0-beta",
3
- "studio": "0.8.0-beta",
4
- "runtime": "0.9.0-beta",
5
- "agents": "0.5.0-beta",
6
- "core": "0.4.0-beta",
7
- "cli": "0.2.1-beta"
2
+ "harness": "0.19.0-beta",
3
+ "studio": "0.9.0-beta",
4
+ "runtime": "0.10.0-beta",
5
+ "agents": "0.6.0-beta",
6
+ "admin": "0.2.0-beta",
7
+ "core": "0.5.0-beta",
8
+ "cli": "0.3.0-beta"
8
9
  }
@@ -3,6 +3,7 @@ export type Compatibility = Readonly<{
3
3
  cli: string;
4
4
  harness: string;
5
5
  agents: string;
6
+ admin: string;
6
7
  studio: string;
7
8
  runtime: string;
8
9
  }>;
@@ -27,4 +28,8 @@ export type CreatorDependencies = Readonly<{
27
28
  remove: (path: string) => Promise<void>;
28
29
  write: (path: string, content: string) => Promise<void>;
29
30
  run: (command: string, args: readonly string[], directory: string) => Promise<Process>;
31
+ /** `process.versions.node`: the Runtime needs Node 24 or newer. */
32
+ nodeVersion: string;
33
+ /** Path of `name` on PATH, or undefined (finds `nylorun-runtime`). */
34
+ findOnPath: (name: string) => string | undefined;
30
35
  }>;
package/dist/project.js CHANGED
@@ -46,6 +46,11 @@ export async function createProject(options, compatibility, dependencies) {
46
46
  }
47
47
  dependencies.log("Installing dependencies...");
48
48
  await stage("Installation", ["install", ...(options.yes ? ["--yes"] : [])]);
49
+ const missing = missingPrerequisites(dependencies, compatibility.runtime);
50
+ if (missing.length)
51
+ throw new CreationError(`Project created. Before starting it, install the prerequisites:\n${missing
52
+ .map((line) => ` ${line}`)
53
+ .join("\n")}\nThen run:\ncd ${quote(destination)}\nnpm run dev`);
49
54
  dependencies.log("Starting development. The first start sets up the model provider in the Runtime vault.");
50
55
  await stage("Development", [
51
56
  "run",
@@ -75,6 +80,20 @@ export async function createProject(options, compatibility, dependencies) {
75
80
  }
76
81
  }
77
82
  }
83
+ /** The Runtime needs node:sqlite and Node 24 APIs. */
84
+ const MIN_NODE_MAJOR = 24;
85
+ /**
86
+ * Prerequisites the developer installs before running the Runtime. The
87
+ * creator only reports them; it never downloads Node or the Runtime.
88
+ */
89
+ function missingPrerequisites(dependencies, runtimeVersion) {
90
+ const missing = [];
91
+ if (!(Number(dependencies.nodeVersion.split(".")[0]) >= MIN_NODE_MAJOR))
92
+ missing.push(`Node.js ${MIN_NODE_MAJOR} or newer (found ${dependencies.nodeVersion})`);
93
+ if (!dependencies.findOnPath("nylorun-runtime"))
94
+ missing.push(`npm install --global @nylorun/runtime@${runtimeVersion}`);
95
+ return missing;
96
+ }
78
97
  function packageName(directory) {
79
98
  const name = directory
80
99
  .toLowerCase()
package/dist/scaffold.js CHANGED
@@ -26,6 +26,7 @@ export async function starterFiles(compatibility, studio) {
26
26
  .replaceAll("{{CLI_VERSION}}", compatibility.cli)
27
27
  .replaceAll("{{HARNESS_VERSION}}", compatibility.harness)
28
28
  .replaceAll("{{AGENTS_VERSION}}", compatibility.agents)
29
+ .replaceAll("{{ADMIN_VERSION}}", compatibility.admin)
29
30
  .replaceAll("{{RUNTIME_VERSION}}", compatibility.runtime)
30
31
  .replaceAll("{{STUDIO_VERSION}}", compatibility.studio);
31
32
  }
@@ -36,7 +37,6 @@ export async function starterFiles(compatibility, studio) {
36
37
  if (!studio) {
37
38
  const manifest = JSON.parse(files["package.json"]);
38
39
  delete manifest.devDependencies["@nylorun/studio"];
39
- manifest.scripts.dev = "nylorun dev --no-studio";
40
40
  delete manifest.scripts.studio;
41
41
  files["package.json"] = JSON.stringify(manifest, null, 2) + "\n";
42
42
  }
@@ -1,5 +1,5 @@
1
1
  # Model provider credentials are stored in the Runtime vault (.nylorun/), not here.
2
- # The first nylorun dev / nylorun serve prompts for them, or seeds them once from:
2
+ # The first nylorun dev prompts for them, or seeds them once from:
3
3
  # MODEL_PROVIDER=...
4
4
  # MODEL=...
5
5
  # MODEL_PROVIDER_API_KEY=...
@@ -1,22 +1,75 @@
1
1
  # My Nylorun agent
2
2
 
3
- Requires Node 24 and npm 11. Agent and tool definitions live in `agents/`. A separate SQLite Runtime holds your sessions; this project attaches to it and connects your tools through the SDK's authenticated SSE executor.
3
+ Before you start, install the prerequisites once. Nothing downloads them for
4
+ you; `npx nylorun doctor runtime` checks both.
5
+
6
+ ```sh
7
+ node --version # 24 or newer
8
+ npm install --global @nylorun/runtime # the Runtime (nylorun-runtime)
9
+ ```
10
+
11
+ Agent and tool definitions live in `agents/`. A
12
+ **Runtime Host** holds your sessions in isolated **Tenants**; this project
13
+ attaches through a **Project link** and connects your tools through the SDK's
14
+ authenticated SSE executor. Production entry is `src/main.ts`, which calls
15
+ `connectAgents`.
4
16
 
5
17
  ```sh
6
18
  npm run dev
7
19
  ```
8
20
 
9
- The first run starts the Runtime for you and asks for a model provider, storing the credential in the Runtime vault. **The Runtime keeps running after you stop `dev`, so sessions survive a source change.** `npx nylorun down` stops it; `npx nylorun runtime status` shows where it is. Later runs reuse it. Open Studio and ask **Look up order demo-123**. The local tool returns `shipped`; Studio shows the tool call and assistant response. Model calls use the Runtime's saved provider and may incur its usual charges. Studio's Model provider screen can replace an API key. `npx nylorun configure` does the same from a terminal while the Runtime is running.
21
+ The first run starts (or attaches to) the Runtime Host, creates a Tenant,
22
+ writes `.nylorun/link.json` and `.nylorun/credentials.json`, and asks for a
23
+ model provider (stored in that Tenant's vault). **The Host keeps running after
24
+ you stop `dev`, so sessions survive a source change.** `npx nylorun runtime down`
25
+ stops it; `npx nylorun runtime status` shows Host and Tenants. Later runs reuse
26
+ the link. Open Studio and ask **Look up order demo-123**. The local tool returns
27
+ `shipped`; Studio shows the tool call and assistant response. Model calls use
28
+ the Tenant's saved provider and may incur its usual charges. Studio's Model
29
+ provider screen can replace an API key. `npx nylorun configure` does the same
30
+ from a terminal while the Host is running.
10
31
 
11
- `npm run dev -- --no-open` avoids opening a browser. `--no-studio` runs headless. `--no-autostart` fails instead of starting a Runtime, which is what CI wants. Use `npm run studio` to attach separately. Runtime defaults to `http://127.0.0.1:8787`; `--port` or `PORT` changes it. Studio chooses a free port starting at 4161.
32
+ `npm run dev -- --no-open` avoids opening a browser. `--no-autostart` fails
33
+ instead of starting a Host, which is what CI wants. `npm run dev -- --ephemeral`
34
+ uses a private temporary Host and one Tenant (removed on clean exit). Use
35
+ `npm run studio` (`nylorun-studio`) to attach separately — before or after
36
+ `dev`. Host defaults to loopback port `8787`; `--port` changes it when starting.
37
+ Studio chooses a free port starting at 4161.
12
38
 
13
39
  ```sh
14
40
  npm run build
15
41
  npm start
16
42
  ```
17
43
 
18
- `npm start` runs `nylorun serve`, which attaches the compiled build without Studio or watching, starting the Runtime first if none is up. Studio can attach in a separate terminal. `agents/index.ts` exports the registry; there is no Hono app to maintain. A source edit re-registers agents and reconnects executors; the Runtime process is untouched. Start a new session after changing definitions or implementations; active-session upgrades are not supported.
44
+ `npm start` runs `node dist/src/main.js` — the same `connectAgents` entry as
45
+ development. Set `NYLORUN_RUNTIME_URL`, `NYLORUN_TENANT`, and
46
+ `NYLORUN_SERVER_KEY` (for example `eval "$(npx nylorun runtime status --env)"`)
47
+ before starting, or keep the Project link beside this directory. Studio can
48
+ attach in a separate terminal. `agents/index.ts` exports the registry. A source
49
+ edit re-registers agents and reconnects executors; the Host process is
50
+ untouched. Start a new session after changing definitions or implementations;
51
+ active-session upgrades are not supported.
52
+
53
+ Export the linked Project environment:
54
+
55
+ ```sh
56
+ eval "$(npx nylorun runtime status --env)"
57
+ # → NYLORUN_RUNTIME_URL, NYLORUN_SERVER_KEY, NYLORUN_TENANT
58
+ ```
19
59
 
20
- Local Runtime credentials, the model provider vault, SQLite, and the Runtime log live in gitignored `.nylorun/` beside this project. Each project gets its own Runtime; `nylorun up --global` shares one in `~/.nylorun` instead. Keep this directory private. Server and executor credentials are generated automatically. The model provider key is encrypted in the vault and kept out of browser configuration and `.env`. Ordinary shutdown/restart preserves completed session history. `NYLORUN_IMPLEMENTATION_VERSION` defaults to `dev`; assign an explicit version when changing a versioned implementation.
60
+ Project link and credentials live in gitignored `.nylorun/` beside this project.
61
+ The Host root (`NYLORUN_HOME` or `~/.nylorun`) holds every Tenant. A fresh clone
62
+ or second worktree does not reuse this link until you create or choose one.
63
+ Keep `.nylorun/` private. Application credentials are generated automatically;
64
+ executor tokens are derived at start. The model provider key is encrypted in the
65
+ Tenant vault and kept out of browser configuration and `.env`. Ordinary
66
+ shutdown/restart preserves completed session history.
67
+ `NYLORUN_IMPLEMENTATION_VERSION` defaults to `dev`; assign an explicit version
68
+ when changing a versioned implementation.
21
69
 
22
- This beta supports local text and ordinary tools. Advanced waits, media, MCP, deployment, reconciliation and broad recovery guarantees are deferred. Subagents are supported in the SDK and examples (`agents used as tools`); the starter itself does not wire them. `NYLORUN_DEV_MODEL=fixture` is a credential-free release-check fixture for this starter; it is not a general model.
70
+ This beta supports local text and ordinary tools. Advanced waits, media, MCP,
71
+ deployment, reconciliation and broad recovery guarantees are deferred.
72
+ Subagents are supported in the SDK and examples (`agents used as tools`); the
73
+ starter itself does not wire them. `NYLORUN_DEV_MODEL=fixture` is a
74
+ credential-free release-check fixture for this starter; it is not a general
75
+ model.
@@ -8,17 +8,17 @@
8
8
  },
9
9
  "scripts": {
10
10
  "dev": "nylorun dev",
11
- "studio": "nylorun studio",
11
+ "studio": "nylorun-studio",
12
12
  "build": "node -e \"import('node:fs/promises').then(async ({rm,cp}) => { await rm('dist', { recursive: true, force: true }); await cp('agents', 'dist/agents', { recursive: true, filter: (source) => !source.endsWith('.ts') }); })\" && tsc -p tsconfig.json",
13
- "start": "nylorun serve",
13
+ "start": "node dist/src/main.js",
14
14
  "check": "tsc --noEmit"
15
15
  },
16
16
  "dependencies": {
17
17
  "zod": "^4.6.5",
18
- "@nylorun/agents": "{{AGENTS_VERSION}}",
19
- "@nylorun/cli": "{{CLI_VERSION}}"
18
+ "@nylorun/agents": "{{AGENTS_VERSION}}"
20
19
  },
21
20
  "devDependencies": {
21
+ "@nylorun/cli": "{{CLI_VERSION}}",
22
22
  "@nylorun/studio": "{{STUDIO_VERSION}}",
23
23
  "@types/node": "^22.18.0",
24
24
  "tsx": "^4.20.6",
@@ -0,0 +1,4 @@
1
+ import { connectAgents } from "@nylorun/agents";
2
+ import { agents } from "../agents/index.js";
3
+
4
+ await connectAgents({ agents }).ready;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylorun/create-agent",
3
- "version": "0.8.1-beta",
3
+ "version": "0.9.0-beta",
4
4
  "description": "Create a local Nylorun Harness agent project.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",