@north-light/crouter 0.3.331 → 0.3.333
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 +2 -2
- package/dist/api/command-manifest/manifest.js +1 -1
- package/dist/build-root.js +1 -1
- package/dist/builtin-memory/crouter-concepts/INDEX.md +13 -0
- package/dist/builtin-memory/crouter-concepts/README.md +19 -0
- package/dist/builtin-memory/crouter-concepts/lifecycle-and-wakes.md +28 -0
- package/dist/builtin-memory/crouter-concepts/memory.md +36 -0
- package/dist/builtin-memory/crouter-concepts/nodes-and-the-canvas.md +30 -0
- package/dist/builtin-memory/crouter-concepts/profiles-kinds-and-modes.md +33 -0
- package/dist/builtin-memory/crouter-concepts/scopes-and-trust.md +34 -0
- package/dist/builtin-memory/crouter-concepts/why-a-daemon.md +31 -0
- package/dist/builtin-memory/crouter-plugin/README.md +10 -13
- package/dist/builtin-memory/crouter-plugin/bundles-and-memory.md +2 -4
- package/dist/builtin-memory/crouter-plugin/commands.md +4 -7
- package/dist/builtin-memory/crouter-plugin/deploying.md +4 -7
- package/dist/builtin-memory/crouter-plugin/errors.md +2 -5
- package/dist/builtin-memory/crouter-plugin/getting-started.md +3 -6
- package/dist/builtin-memory/crouter-plugin/output.md +1 -3
- package/dist/builtin-memory/crouter-plugin/parameters.md +3 -4
- package/dist/builtin-memory/crouter-sdk/README.md +3 -4
- package/dist/builtin-memory/crouter-sdk/bash.md +2 -3
- package/dist/builtin-memory/crouter-sdk/client.md +3 -4
- package/dist/builtin-memory/crouter-sdk/docker.md +2 -4
- package/dist/builtin-memory/crouter-sdk/errors.md +9 -4
- package/dist/builtin-memory/crouter-sdk/files.md +2 -3
- package/dist/builtin-memory/crouter-sdk/getting-started.md +19 -6
- package/dist/builtin-memory/crouter-sdk/memory.md +3 -4
- package/dist/builtin-memory/crouter-sdk/migration.md +2 -6
- package/dist/builtin-memory/crouter-sdk/nodes.md +3 -3
- package/dist/builtin-memory/crouter-sdk/resources.md +2 -4
- package/dist/builtin-memory/crouter-sdk/streaming.md +3 -4
- package/dist/clients/attach/input/capabilities.js +1 -1
- package/dist/clients/attach/overlays/help.js +1 -1
- package/dist/clients/attach/slash/dispatch.js +1 -1
- package/dist/clients/attach/viewer.js +762 -765
- package/dist/commands/sys/branch.js +1 -1
- package/dist/commands/sys/connect.js +3 -3
- package/dist/commands/sys/setup-core.d.ts +1 -1
- package/dist/commands/sys/setup-core.js +4 -4
- package/dist/commands/sys/tutorial/branch.d.ts +1 -0
- package/dist/commands/sys/tutorial/branch.js +1 -0
- package/dist/commands/sys/tutorial/lessons.d.ts +6 -0
- package/dist/commands/sys/tutorial/lessons.js +12 -0
- package/dist/commands/sys/tutorial/scenario.d.ts +1 -0
- package/dist/commands/sys/tutorial/scenario.js +2 -0
- package/dist/commands/sys/tutorial/tracks.d.ts +2 -0
- package/dist/commands/sys/tutorial/tracks.js +4 -0
- package/dist/commands/sys.js +1 -1
- package/dist/core/runtime/boot-root.d.ts +7 -0
- package/dist/core/runtime/boot-root.js +4 -4
- package/dist/core/runtime/first-run-offer.d.ts +11 -0
- package/dist/core/runtime/first-run-offer.js +5 -0
- package/dist/core/runtime/front-door.js +3 -3
- package/dist/core/runtime/spawn.d.ts +3 -1
- package/dist/core/runtime/spawn.js +2 -2
- package/dist/core/scopes.d.ts +4 -2
- package/dist/core/scopes.js +1 -1
- package/dist/core/secrets.d.ts +11 -0
- package/dist/core/secrets.js +2 -2
- package/dist/daemon/api/bridge.d.ts +4 -0
- package/dist/daemon/api/bridge.js +2 -2
- package/dist/daemon/api/handlers/attach.d.ts +1 -1
- package/dist/daemon/api/handlers/attach.js +1 -1
- package/dist/daemon/api/handlers/bash.js +1 -1
- package/dist/daemon/api/handlers/broker-ops.d.ts +1 -1
- package/dist/daemon/api/handlers/broker-ops.js +1 -1
- package/dist/daemon/api/handlers/broker-recovery.d.ts +1 -1
- package/dist/daemon/api/handlers/broker-recovery.js +1 -1
- package/dist/daemon/api/handlers/canvas.js +4 -4
- package/dist/daemon/api/handlers/crons.d.ts +1 -1
- package/dist/daemon/api/handlers/crons.js +1 -1
- package/dist/daemon/api/handlers/daemon.d.ts +1 -1
- package/dist/daemon/api/handlers/daemon.js +1 -1
- package/dist/daemon/api/handlers/files.js +1 -1
- package/dist/daemon/api/handlers/focus.d.ts +1 -1
- package/dist/daemon/api/handlers/focus.js +1 -1
- package/dist/daemon/api/handlers/human-requests.js +1 -1
- package/dist/daemon/api/handlers/memory.js +1 -1
- package/dist/daemon/api/handlers/messages.d.ts +1 -1
- package/dist/daemon/api/handlers/messages.js +2 -2
- package/dist/daemon/api/handlers/model-config.d.ts +1 -1
- package/dist/daemon/api/handlers/model-config.js +1 -1
- package/dist/daemon/api/handlers/modelauth.js +1 -1
- package/dist/daemon/api/handlers/nodes.js +1 -1
- package/dist/daemon/api/handlers/profiles.js +1 -1
- package/dist/daemon/api/handlers/reports.js +1 -1
- package/dist/daemon/api/handlers/reviews.js +1 -1
- package/dist/daemon/api/handlers/worktree.d.ts +1 -1
- package/dist/daemon/api/handlers/worktree.js +1 -1
- package/dist/daemon/api/router.d.ts +20 -1
- package/dist/daemon/api/router.js +1 -1
- package/dist/daemon/api/server.js +1 -11
- package/dist/types.js +1 -1
- package/docs/cli/README.md +16 -0
- package/docs/cli/canvas-and-dashboard.md +56 -0
- package/docs/cli/first-session.md +55 -0
- package/docs/cli/human-inbox.md +34 -0
- package/docs/cli/memory-and-preferences.md +50 -0
- package/docs/cli/the-viewer.md +79 -0
- package/docs/concepts/README.md +17 -0
- package/docs/concepts/lifecycle-and-wakes.md +26 -0
- package/docs/concepts/memory.md +34 -0
- package/docs/concepts/nodes-and-the-canvas.md +28 -0
- package/docs/concepts/profiles-kinds-and-modes.md +31 -0
- package/docs/concepts/scopes-and-trust.md +32 -0
- package/docs/concepts/why-a-daemon.md +29 -0
- package/docs/plugin/README.md +5 -0
- package/docs/plugin/bundles-and-memory.md +5 -0
- package/docs/plugin/commands.md +5 -0
- package/docs/plugin/deploying.md +5 -0
- package/docs/plugin/errors.md +5 -0
- package/docs/plugin/getting-started.md +5 -0
- package/docs/plugin/output.md +5 -0
- package/docs/plugin/parameters.md +5 -0
- package/docs/sdk/README.md +5 -0
- package/docs/sdk/bash.md +5 -0
- package/docs/sdk/client.md +6 -1
- package/docs/sdk/docker.md +5 -0
- package/docs/sdk/errors.md +12 -0
- package/docs/sdk/files.md +5 -0
- package/docs/sdk/getting-started.md +21 -1
- package/docs/sdk/memory.md +5 -0
- package/docs/sdk/migration.md +5 -0
- package/docs/sdk/nodes.md +6 -1
- package/docs/sdk/resources.md +5 -0
- package/docs/sdk/streaming.md +5 -0
- package/package.json +10 -9
- package/runtime.lock.json +6734 -670
package/docs/sdk/errors.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Errors
|
|
3
|
+
description: Handle API and connection errors separately from settled agent outcomes.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Errors
|
|
2
7
|
|
|
3
8
|
## What throws and what does not
|
|
@@ -50,6 +55,13 @@ The subclasses add **no fields**. `status` and `code` on the base class already
|
|
|
50
55
|
|
|
51
56
|
The SDK validates path-segment identifiers before it makes a request. Invalid node ids, cron ids, bash-job ids, human-request ids, inbox ticket ids, provider names, and profile names throw `TypeError` locally. Node ids apply to core node calls, lifecycle calls, and nested node resources. `nodes.events()` returns a `NodeStream` synchronously, so its invalid-id `TypeError` rejects `stream.node`, `stream.finalOutcome()`, and iteration instead. File paths are not identifiers; invalid or relative file paths reach the daemon and return its mapped API error. `nodes.outcome(id, { wait })` separately throws `RangeError` when `wait` is not an integer from 0 through 25.
|
|
52
57
|
|
|
58
|
+
## Scoped tokens
|
|
59
|
+
|
|
60
|
+
| Condition | Class, status, and code |
|
|
61
|
+
|---|---|
|
|
62
|
+
| The bearer token's ceiling lacks the scope a route needs, or `nodes.create` asks for `scopes` outside it (`details.scopes` lists them) | `PermissionDeniedError`, 403 `scope_denied` |
|
|
63
|
+
| A scoped token reaches an owner-only route (daemon restart, attach, broker internals, canvas prune, profile pause/resume/delete, model credential install) | `PermissionDeniedError`, 403 `owner_only` |
|
|
64
|
+
|
|
53
65
|
## Memory requests
|
|
54
66
|
|
|
55
67
|
| Condition | Class, status, and code |
|
package/docs/sdk/files.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Getting started
|
|
3
|
+
description: Connect to a local or remote daemon and run your first agent with the SDK.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Getting started
|
|
2
7
|
|
|
3
8
|
Phase 1.
|
|
@@ -44,7 +49,7 @@ if (outcome.kind === 'result') console.log(outcome.final_report_path);
|
|
|
44
49
|
|
|
45
50
|
## 4. A browser or a remote application
|
|
46
51
|
|
|
47
|
-
A process that is not on the daemon's machine — or a page in a browser, which has no unix sockets at all — reaches the daemon over TCP with a bearer token. The token is the owner credential: whoever holds it can drive the whole surface.
|
|
52
|
+
A process that is not on the daemon's machine — or a page in a browser, which has no unix sockets at all — reaches the daemon over TCP with a bearer token. There are two kinds. The **owner token** is the owner credential: whoever holds it can drive the whole surface. A **scoped token** (`crtr sys connect --scopes`) carries a list of scopes that caps what its holder and every run it creates may do.
|
|
48
53
|
|
|
49
54
|
### Turn the listener on, once
|
|
50
55
|
|
|
@@ -63,6 +68,20 @@ $ crtr --json sys connect
|
|
|
63
68
|
{"base_url":"http://127.0.0.1:8787","token":"<64-character bearer token>"}
|
|
64
69
|
```
|
|
65
70
|
|
|
71
|
+
### A token that holds less than the owner
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
crtr sys connect --scopes ask,memory:read
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This mints a new token whose scope list is a ceiling, appends it to the same secrets store, prints it in place of the owner token, and always hands the daemon over (it reads tokens once, at boot). The ceiling is checked on every request that carries the token:
|
|
78
|
+
|
|
79
|
+
- A scope-gated operation the ceiling lacks answers `403 scope_denied`. Creating, reviving, forking, messaging, or yielding a run needs `act`; creating a review or human request needs `ask`; arming or running a cron needs `schedule`; memory reads and writes need `memory:read` and `memory:write`. `bash` and `files` also need `act`: they run code and touch the host directly, which is more than any run does, and `files:<dir>` is recorded, not enforced, so it cannot narrow them.
|
|
80
|
+
- `nodes.create` with `scopes` outside the ceiling answers `403 scope_denied`; `details.scopes` lists the offending scopes. Omit `scopes` and the run gets the ceiling.
|
|
81
|
+
- Owner-only operations — daemon restart, the attach viewer, broker internals, canvas prune, profile pause/resume/delete, model credential install — answer `403 owner_only` to any scoped token.
|
|
82
|
+
|
|
83
|
+
What a scope does **not** do on a developer's machine: there is no OS sandbox. Scopes gate the daemon and the CLI; a run's own bash tool is ungated, and the daemon identifies a calling node by a field the caller declares, so a scope check bounds a well-behaved agent, not a hostile one. `llm`, `files:<dir>`, `net`, and provider scopes are recorded on the run but not enforced. There is no list or revoke verb yet; to retire a scoped token, remove it from the 0600 user secrets store and restart the daemon.
|
|
84
|
+
|
|
66
85
|
### Check setup before generating
|
|
67
86
|
|
|
68
87
|
Construct the client from the application's saved connection. On the first visit that value is absent, and `client.auth.status()` returns `'connect'` without a request. Once the user pastes the base URL and token printed by `crtr sys connect`, construct it again and call `status()` to check the selected provider.
|
|
@@ -153,6 +172,7 @@ An outcome is returned, never thrown — including a decline and a failure. Only
|
|
|
153
172
|
|
|
154
173
|
## Where to go next
|
|
155
174
|
|
|
175
|
+
- A complete local page that demonstrates streaming, structured output, and a plugin: [localhost SDK demo](../../examples/localhost-demo)
|
|
156
176
|
- Every constructor option and environment-variable fallback: [Client construction](./client.md)
|
|
157
177
|
- Checking the daemon connection and selected provider before a run: `client.auth.status()` above
|
|
158
178
|
- The full create-parameter table and the outcome union: [Nodes](./nodes.md)
|
package/docs/sdk/memory.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Memory
|
|
3
|
+
description: Read and write memory documents with an explicit target for every request.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# `client.memory`
|
|
2
7
|
|
|
3
8
|
Phase 3. `client.memory` reads and writes the memory documents that shape an agent run. Every call names its target; the daemon never uses its own working directory or environment to select memory.
|
package/docs/sdk/migration.md
CHANGED
package/docs/sdk/nodes.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Nodes
|
|
3
|
+
description: Create agent runs, wait for outcomes, and parse structured results.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# `client.nodes`
|
|
2
7
|
|
|
3
8
|
Shipped, except where a row says otherwise.
|
|
@@ -58,7 +63,7 @@ Wire fields are `snake_case`. Every `NodeCreateParams` property is optional; `pa
|
|
|
58
63
|
| `description` | `string` | Display description. |
|
|
59
64
|
| `parent` | node id | Graph placement. An external caller leaves this unset. |
|
|
60
65
|
| `creator` | node id | Graph placement. An external caller leaves this unset. |
|
|
61
|
-
| `scopes` | `string[]` | Per-run allow-list. Omit it to inherit every scope. In beta, `ask`, `act`, `schedule`, `memory:read`, and `memory:write` are enforced; `llm`, `files:<dir>`, `net`, provider groups, and peers are recorded because their performers are not available. |
|
|
66
|
+
| `scopes` | `string[]` | Per-run allow-list. Omit it to inherit every scope, or under a scoped token to receive that token's ceiling; a list outside the ceiling answers `403 scope_denied` with the offending scopes in `details.scopes`. In beta, `ask`, `act`, `schedule`, `memory:read`, and `memory:write` are enforced; `llm`, `files:<dir>`, `net`, provider groups, and peers are recorded because their performers are not available. See [scoped tokens](./getting-started.md#a-token-that-holds-less-than-the-owner). |
|
|
62
67
|
| `worktree` | `string \| boolean` | Create a managed git worktree for the run. |
|
|
63
68
|
| `fork_from` | `string` | Start from an existing conversation. |
|
|
64
69
|
| `no_kickoff` | `boolean` | Create the node without sending the first message. |
|
package/docs/sdk/resources.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Resource map
|
|
3
|
+
description: Find client namespaces, their daemon routes, and the raw request escape hatch.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Resource map
|
|
2
7
|
|
|
3
8
|
Every namespace exported by the client. Namespaces are camelCase. Verbs are `create`, `retrieve`, `list`, `update`, `delete`, and `cancel`, except where the product already has a literal name for the action (`fork`, `revive`, `promote`, `pause`, `poke`) — in which case the SDK uses that name.
|
package/docs/sdk/streaming.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Streaming
|
|
3
|
+
description: Follow assistant text, tool activity, reports, and outcomes as an agent runs.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Streaming
|
|
2
7
|
|
|
3
8
|
Watch a run as it works: assistant text as it is produced, tool calls as they start and finish, reports as they are pushed, and the settled outcome.
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.333",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"workspaces": [
|
|
9
|
-
"packages/*"
|
|
9
|
+
"packages/*",
|
|
10
|
+
"apps/*"
|
|
10
11
|
],
|
|
11
12
|
"bin": {
|
|
12
13
|
"crtr": "bin/crtr",
|
|
@@ -101,9 +102,9 @@
|
|
|
101
102
|
"test:all": "npm test && npm run test:integration && npm run test:seam"
|
|
102
103
|
},
|
|
103
104
|
"overrides": {
|
|
104
|
-
"@earendil-works/pi-ai": "0.87.
|
|
105
|
-
"@earendil-works/pi-agent-core": "0.87.
|
|
106
|
-
"@earendil-works/pi-tui": "0.87.
|
|
105
|
+
"@earendil-works/pi-ai": "0.87.1",
|
|
106
|
+
"@earendil-works/pi-agent-core": "0.87.1",
|
|
107
|
+
"@earendil-works/pi-tui": "0.87.1"
|
|
107
108
|
},
|
|
108
109
|
"repository": {
|
|
109
110
|
"type": "git",
|
|
@@ -114,10 +115,10 @@
|
|
|
114
115
|
},
|
|
115
116
|
"license": "GPL-3.0-only",
|
|
116
117
|
"dependencies": {
|
|
117
|
-
"@earendil-works/pi-agent-core": "0.87.
|
|
118
|
-
"@earendil-works/pi-ai": "0.87.
|
|
119
|
-
"@earendil-works/pi-coding-agent": "0.87.
|
|
120
|
-
"@earendil-works/pi-tui": "0.87.
|
|
118
|
+
"@earendil-works/pi-agent-core": "0.87.1",
|
|
119
|
+
"@earendil-works/pi-ai": "0.87.1",
|
|
120
|
+
"@earendil-works/pi-coding-agent": "0.87.1",
|
|
121
|
+
"@earendil-works/pi-tui": "0.87.1",
|
|
121
122
|
"cron-parser": "^5.6.0",
|
|
122
123
|
"esbuild": "^0.27.7",
|
|
123
124
|
"proper-lockfile": "4.1.2",
|