@north-light/cli 0.3.779 → 0.3.781

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/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
  <a href="https://discord.gg/txKS3swtWY"><img alt="discord" src="https://img.shields.io/badge/discord-join-5865F2?logo=discord&logoColor=white"></a>
9
9
  </p>
10
10
 
11
- crouter is an agent runtime for Node.js. Each agent is a **node**: a record with a goal, a context directory, and a detached process (its *broker*) that hosts the model session. A daemon, `crtrd`, owns every node's state and lifecycle. You drive it with the `crtr` command line, a terminal viewer, or a typed TypeScript SDK — all three are clients of the same local API. Each model session runs on [pi](https://github.com/earendil-works/pi), the open-source coding-agent harness; crouter adds the daemon, the node graph, the context system and the CLI around it.
11
+ crouter is an agent runtime for Node.js. Each agent is a **node**: a record with a goal, a context directory, and a detached process (its *broker*) that hosts the model session. A daemon, `crtrd`, owns every node's state and lifecycle. You drive it with the `crtr` command line, a terminal viewer, or a typed TypeScript SDK — all three are clients of the same `/v1` API. Each model session runs on [pi](https://github.com/earendil-works/pi), the open-source coding-agent harness; crouter adds the daemon, the node graph, the context system and the CLI around it.
12
12
 
13
- Closing a terminal does not stop an agent, and an agent that is waiting on something has no process at all. Nodes can spawn children, report to whoever subscribes to them, and share markdown documents that other agents are shown when they become relevant. crouter is not a model and does not bundle one: you sign in to a model provider during setup. It runs on your machine, in a container you start, or in a Northlight-hosted runtime.
13
+ Closing a terminal does not stop an agent, and an agent that is waiting on something has no process at all. Nodes can spawn children, report to whoever subscribes to them, and share markdown documents that other agents are shown when they become relevant. crouter is not a model and does not bundle one. The runtime is the Northlight cloud control plane (`api-fleet.northlight.ai`), which owns every node's state and runs the models; a Mac you sign in with `crtr sys signin` is a machine where an agent's commands run. There is no standalone mode.
14
14
 
15
15
  [Docs](https://crouter.docs.northlight.ai) · [Getting started](https://crouter.docs.northlight.ai/docs/cli/first-session) · [Concepts](https://crouter.docs.northlight.ai/docs/concepts) · [SDK](https://crouter.docs.northlight.ai/docs/sdk) · [Plugins](https://crouter.docs.northlight.ai/docs/plugin) · [Marketplace](https://github.com/crouton-labs/crouter-official-marketplace) · [Discord](https://discord.gg/txKS3swtWY)
16
16
 
@@ -21,7 +21,7 @@ npm install -g @north-light/cli
21
21
  crtr
22
22
  ```
23
23
 
24
- The first `crtr` on a machine opens the setup installer. It signs you in to a model provider, then offers companion packages (including the official plugin marketplace) and system dependencies such as tmux. After setup, `crtr` opens a conversation with an agent, which offers a short tour of how crouter works. `crtr sys setup` reopens the installer later.
24
+ Start by signing in to your Northlight account (`crtr sys signin`; create the account at `https://account.northlight.ai/signup`). The first `crtr` on a machine opens the setup installer, which offers companion packages (including the official plugin marketplace) and system dependencies such as tmux. After setup, `crtr` opens a conversation with an agent, which offers a short tour of how crouter works. `crtr sys setup` reopens the installer later.
25
25
 
26
26
  Requirements:
27
27
 
@@ -97,9 +97,9 @@ flowchart LR
97
97
  Viewer -. live session .-> Broker
98
98
  ```
99
99
 
100
- `crtrd` is the only writer of canvas state and the only launcher of brokers. The CLI, the viewer and SDK applications call its `/v1` API; none of them opens the canvas database or starts an engine of its own. On one machine they use an owner-only Unix socket. A remote process uses a TCP listener (`--tcp`) and a bearer token (`CRTRD_TOKEN`).
100
+ `crtrd` is the only writer of canvas state and the only launcher of brokers. The CLI, the viewer and SDK applications call its `/v1` API; none of them opens the canvas database or starts an engine of its own. In production the daemon is the Northlight control plane, reached over HTTPS with a bearer token; a signed-in Mac runs the processes of its nodes and holds an outbound link to the cloud.
101
101
 
102
- What this costs: a daemon has to be running (the CLI and SDK start it on first use), and a network failure on a remote client fails a request loudly rather than replaying it. What it buys is one owner for state, so a node outlives the terminal, the viewer, or the application that created it. [Why a daemon](https://crouter.docs.northlight.ai/docs/concepts/why-a-daemon) covers the reasoning.
102
+ What this costs: the runtime has to be reachable, and a network failure on a remote client fails a request loudly rather than replaying it. What it buys is one owner for state, so a node outlives the terminal, the viewer, or the application that created it. [Why a daemon](https://crouter.docs.northlight.ai/docs/concepts/why-a-daemon) covers the reasoning.
103
103
 
104
104
  ## Use crouter from an application
105
105
 
@@ -111,7 +111,7 @@ npm install @north-light/sdk zod
111
111
  import Crouter from '@north-light/sdk';
112
112
  import { z } from 'zod';
113
113
 
114
- const client = new Crouter(); // local daemon; started on first request if it is not running
114
+ const client = new Crouter(); // connects to the runtime; pass baseURL and token explicitly outside a signed-in machine
115
115
 
116
116
  const run = await client.runs.parse({
117
117
  prompt: 'Report the name and version of the package in your files folder.',
@@ -3,11 +3,11 @@ kind: preference
3
3
  when-and-why-to-read: When a node runs in base mode on any kind but explore, this preference should be read so orientation noise lands in a scout's window and comes back as a clean map instead of silting the context this node's real work runs in.
4
4
  gate: {mode: base, not: {kind: explore}}
5
5
  rationale: >-
6
- Split from 04-base-worker: gated {mode: base} alone, this section told an explore base node to spawn an explore scout for its own assignment — circular, and in tension with kinds/explore/base's narrower promote-only rule. The section itself exists because the kernel's "understand before you delegate" line is orchestrator-gated, so base workers had no counterweight to mapping unfamiliar code in their own window: they spent their context on read-only exploration and yielded before the real work. The operative mechanism is context, not model-tier economics (Silas, 2026-08-30): exploration residue — dead ends, half-relevant files — degrades the window it lands in, so the scout's job is to absorb that noise and return a distilled map every later node, the spawner included, loads clean. The body avoids "weigh/consider/decide" verbs deliberately: an instruction to perform a cognitive act gets narrated ("I considered a scout and…"), so the always-consider behavior is carried structurally — spawn is the unmarked default, skip is gated behind an exception test models apply silently. The exception was widened and the scout's cost stated on 2026-11-11 (Silas), following the Fable 5.2 prompting guidance that standing instructions to delegate make that model start more subagents than the task needs; the unsupported claim that a scout does a more thorough job was removed with it.
6
+ Split from 04-base-worker: gated {mode: base} alone, this section told an explore base node to spawn an explore scout for its own assignment — circular, and in tension with kinds/explore/base's narrower promote-only rule. The section itself exists because the kernel's "understand before you delegate" line is orchestrator-gated, so base workers had no counterweight to mapping unfamiliar code in their own window: they spent their context on read-only exploration and yielded before the real work. The operative mechanism is context, not model-tier economics (Silas, 2026-08-30): exploration residue — dead ends, half-relevant files — degrades the window it lands in, so the scout's job is to absorb that noise and return a distilled map every later node, the spawner included, loads clean. The body avoids "weigh/consider/decide" verbs deliberately: an instruction to perform a cognitive act gets narrated ("I considered a scout and…"), so the always-consider behavior is carried structurally — spawn is the unmarked default, skip is gated behind an exception test models apply silently.
7
7
  surfaces:
8
8
  - on: boot
9
9
  at: content
10
10
  ---
11
11
 
12
12
  ## Exploring
13
- Fresh work on a surface you do not yet understand and cannot read in a few files — a codebase, a system, a domain — starts with an `explore` node to chart it (`crtr node -h`), with `--mode orchestrate` when the surface is large or there are multiple questions. The dead ends and half-relevant files of exploration stay in the window that read them; a scout keeps them in its own window and hands back a distilled map or answer. A scout costs a full window of tokens and a wait for its report, so read the surface yourself when you already know it, when you can name the files to open, or when the answer sits in a handful of files.
13
+ Fresh work on a surface you do not yet understand — a codebase, a system, a domain — starts with an `explore` node to chart it (`crtr node -h`), with `--mode orchestrate` when the surface is large or there are multiple questions. Charting it yourself bloats your context window; a scout spends its own window and hands back a distilled map or answer, and it will do a more thorough job. Skip the scout only when you already know the surface or it is small enough to read directly — waiting on one for a two-file change costs more than it saves.
@@ -24,7 +24,7 @@ The broker has one job: host a node’s agent session. The daemon has the broade
24
24
 
25
25
  This is why a process crash is recoverable rather than an automatic loss of work. The daemon retains the node row, session information, context directory, documents, waits, and inbox state, then applies recovery to the broker execution. A later wake or explicit revival can continue the node’s saved conversation. The application should create nodes through the daemon (`crtr node new` or `CrtrClient` from `@north-light/api`), not start an LLM process itself, because the daemon is the component that keeps the engine and durable canvas state coordinated.
26
26
 
27
- The costs are real. A daemon must be running, and canvas state has one home instead of being scattered across terminals and application processes. Local clients use its owner-only Unix socket. Remote clients use its configured TCP listener and bearer token. A network interruption can therefore fail a mutation loudly rather than encouraging a client to replay it and risk doing the action twice.
27
+ The costs are real. The runtime must be reachable, and canvas state has one home — the Northlight control plane — instead of being scattered across terminals and application processes. Clients reach it over HTTPS with a bearer token. A network interruption can therefore fail a mutation loudly rather than encouraging a client to replay it and risk doing the action twice.
28
28
 
29
29
  Those costs buy a simpler model: one state owner, one broker launcher, and clients that can reconnect. A CLI command, an SDK application, and a terminal viewer all use the same API for canvas state. They can come and go without creating competing writers or losing the graph that explains what each agent is doing.
30
30
 
@@ -9,7 +9,7 @@ when-and-why-to-read: When you need SDK overview, this knowledge should be read
9
9
 
10
10
  The ESM-only client an application installs to start runs on a person's runtime, read their results, and manage what the app owns there. Apps that sign people in with Northlight are documented on the SDK docs site, which starts at [Quick setup](https://sdk.docs.northlight.ai/docs/quickstart).
11
11
 
12
- `new Crouter()` in Node talks to the owner's unix socket. `new Crouter({ baseURL, token })` in a browser or a remote process talks to the daemon's TCP listener with a bearer token. On either, the client offers the app routes (`runs`, `uploads`, `docs`, `memory`, …) plus the few owner calls an app setup needs: `models.credentials.install`, `spendLimits` and `customObjects`. crtrd stays the sole owner of canvas state.
12
+ `new Crouter({ baseURL, token })` talks to the runtime's HTTP listener with a bearer token. On either, the client offers the app routes (`runs`, `uploads`, `docs`, `memory`, …) plus the few owner calls an app setup needs: `models.credentials.install`, `spendLimits` and `customObjects`. crtrd stays the sole owner of canvas state.
13
13
 
14
14
  ## Driving nodes, bash, crons or the human inbox
15
15
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  kind: knowledge
3
3
  when-and-why-to-read: When you need Client construction, this knowledge should
4
- be read because Configure local socket and remote HTTP connections,
4
+ be read because Configure the HTTP connection to the Northlight runtime,
5
5
  authentication, and request options.
6
6
  ---
7
7
 
@@ -10,9 +10,7 @@ when-and-why-to-read: When you need Client construction, this knowledge should
10
10
  ```ts
11
11
  import Crouter from '@north-light/sdk';
12
12
 
13
- const localClient = new Crouter(); // owner's own daemon, unix socket
14
- const remoteClient = new Crouter({ baseURL: 'http://localhost:8787', token: 'token' }); // TCP with a bearer token
15
- const customSocketClient = new Crouter({ socketPath: '/custom/path/crtrd.sock' }); // an explicit socket
13
+ const client = new Crouter({ baseURL: process.env.CRTR_BASE_URL, token: process.env.CRTRD_TOKEN }); // HTTP with a bearer token
16
14
  ```
17
15
 
18
16
  `Crouter` is the default export and the only class an application constructs. `CrtrClient` from `@north-light/api` is an implementation detail and is not re-exported.
@@ -1,21 +1,22 @@
1
1
  ---
2
2
  kind: knowledge
3
3
  when-and-why-to-read: When you need Getting started, this knowledge should be
4
- read because Connect to a local or remote daemon and start your first run with
4
+ read because Connect to the Northlight runtime and start your first run with
5
5
  the SDK.
6
6
  ---
7
7
 
8
8
  # Getting started
9
9
 
10
- An agent run needs a crouter daemon (`crtrd`) to run it. The SDK is a client for that daemon — it never runs an agent itself. There are two ways to reach one: the unix socket on the machine you are running on, or a TCP listener with a bearer token.
10
+ An agent run needs the Northlight runtime (the control plane at `api-fleet.northlight.ai`) to run it. The SDK is a client for it — it never runs an agent itself — and reaches it over HTTP with a bearer token.
11
11
 
12
- ## 1. Install the runtime
12
+ ## 1. Sign in
13
13
 
14
14
  ```bash
15
15
  npm i -g @north-light/cli
16
+ crtr sys signin
16
17
  ```
17
18
 
18
- That installs the `crtr` CLI and the `crtrd` daemon. You do not have to start the daemon: `new Crouter()` starts it for you on a cold socket (see `autostart` in [[crouter-sdk/client]]).
19
+ The runtime is the Northlight cloud; you do not install or start a daemon. Signing in makes the Mac a machine where your agents' commands run.
19
20
 
20
21
  ## 2. Install the SDK in your application
21
22
 
@@ -27,22 +28,22 @@ One dependency. It re-exports every data type you need, so you do not also insta
27
28
 
28
29
  `@latest` always works against production: a release reaches `latest` only once production serves its contract level. The `next` tag carries every release the moment it is published and may need a newer runtime than production runs (see [[crouter-sdk/errors]] for `RuntimeVersionError`). Keep the exact pin: the compatibility gate protects the wire, not the TypeScript API. To move it, check `npm view @north-light/sdk dist-tags` and read the [release notes](https://sdk.docs.northlight.ai/docs/release-notes) first.
29
30
 
30
- ## 3. Node, on the owner's own daemon
31
+ ## 3. Node
31
32
 
32
- Pass nothing. The client resolves the same socket path the `crtr` CLI does, and starts the daemon if it is not already up.
33
+ Pass the runtime's URL and a bearer token.
33
34
 
34
35
  ```ts
35
36
  import Crouter from '@north-light/sdk';
36
37
 
37
- const client = new Crouter();
38
+ const client = new Crouter({ baseURL: process.env.CRTR_BASE_URL, token: process.env.CRTRD_TOKEN });
38
39
  const { profiles } = await client.profiles.list();
39
40
  ```
40
41
 
41
- The SDK covers the app routes (`runs`, `uploads`, `docs`, `memory`, …). To create nodes, run bash, arm crons or answer the human inbox on your own daemon, use `CrtrClient` from `@north-light/api` (see the [[crouter-sdk/README]]).
42
+ The SDK covers the app routes (`runs`, `uploads`, `docs`, `memory`, …). To create nodes, run bash, arm crons or answer the human inbox on the runtime, use `CrtrClient` from `@north-light/api` (see the [[crouter-sdk/README]]).
42
43
 
43
44
  ## 4. A browser or a remote application
44
45
 
45
- A process that is not on the daemon's machine — or a page in a browser, which has no unix sockets at all — reaches a daemon over TCP with a bearer token. A computer signed in with `crtr sys signin` is a fleet machine: its crtr commands go to the Northlight control plane with the person's bearer, and no local listener or owner token is created. Run a daemon with `--tcp <host:port>` and `CRTRD_TOKEN` only for your own control plane under development (`crtrd --role all` with `CRTR_DATABASE_URL` and `CRTR_DIRECTORY_URL`).
46
+ A browser page or a remote process reaches the runtime over HTTP with a bearer token. A computer signed in with `crtr sys signin` is a fleet machine: its crtr commands go to the Northlight control plane with the person's bearer.
46
47
 
47
48
  ```ts
48
49
  import Crouter from '@north-light/sdk';
@@ -78,4 +79,3 @@ Registering an app, its key pair, the env file and going live are covered for ap
78
79
 
79
80
  - Every constructor option and environment-variable fallback: [[crouter-sdk/client]]
80
81
  - Every namespace and its routes: [[crouter-sdk/resources]]
81
- - Running the daemon in a container instead: [[crouter-sdk/docker]]