@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 +6 -6
- package/dist/builtin-memory/04-base-worker-exploring.md +2 -2
- package/dist/builtin-memory/crouter-concepts/why-a-daemon.md +1 -1
- package/dist/builtin-memory/crouter-sdk/README.md +1 -1
- package/dist/builtin-memory/crouter-sdk/client.md +2 -4
- package/dist/builtin-memory/crouter-sdk/getting-started.md +10 -10
- package/dist/clients/attach/viewer.js +118 -118
- package/dist/daemon/api/router.js +1 -1
- package/docs/cli/first-session.md +2 -2
- package/docs/concepts/why-a-daemon.md +1 -1
- package/docs/sdk/README.md +1 -1
- package/docs/sdk/client.md +2 -4
- package/docs/sdk/getting-started.md +10 -10
- package/package.json +3 -3
- package/packages/crouter-api/package.json +1 -1
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/package.json +3 -3
- package/runtime.lock.json +14 -14
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
|
|
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
|
|
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
|
|
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.
|
|
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:
|
|
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(); //
|
|
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.
|
|
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
|
|
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.
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
|
31
|
+
## 3. Node
|
|
31
32
|
|
|
32
|
-
Pass
|
|
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
|
|
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
|
|
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]]
|