@north-light/cli 0.3.653 → 0.3.654

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.
@@ -1,6 +1,6 @@
1
1
  /** Runtime-owned records; never a bind source for an app sandbox. */
2
2
  export declare function crtrHome(): string;
3
- /** The canvas home requires durable storage with SQLite WAL locking support. */
3
+ /** The pre-Postgres SQLite canvas file. Read only by the one-time import into Postgres and by `crtr sys db export-sqlite`. */
4
4
  export declare function canvasDbPath(): string;
5
5
  export declare function onDiskMigrationLockPath(): string;
6
6
  export declare function onDiskMigrationMarkerPath(): string;
@@ -11,14 +11,12 @@ export declare function reviewsRoot(): string;
11
11
  export declare function reviewDir(reviewId: string): string;
12
12
  export declare function reviewResultPath(reviewId: string): string;
13
13
  export declare function ensureReviewDir(reviewId: string): void;
14
- /** Absolute path to crtrd's API listener unix socket, a sibling of
15
- * `canvasDbPath()` under the canvas home (`~/.crouter/canvas/crtrd.sock` unless
16
- * `CRTR_HOME` is set). Pure path builder — no db reach — so both the daemon
17
- * (which binds it) and a CLI-side resolver can import it freely. `src/api`'s
18
- * `defaultSocketPath()` (in `api/node-transport.ts`) deliberately re-derives
19
- * this same path from a Node-builtin `join(crtrHome-equivalent, 'crtrd.sock')`
20
- * rather than importing here, to keep the exported `/api` contract
21
- * dependency-light; the two must agree. */
14
+ /** Absolute path to crtrd's API listener unix socket: `api.sock` in the runtime
15
+ * root on macOS, in `/run/crtr` on Linux. Pure path builder — no db reach — so
16
+ * both the daemon (which binds it) and a CLI-side resolver can import it freely.
17
+ * `src/api`'s `defaultSocketPath()` (in `api/node-transport.ts`) deliberately
18
+ * re-derives this same path rather than importing here, to keep the exported
19
+ * `/api` contract dependency-light; the two must agree. */
22
20
  export declare function apiSocketPath(): string;
23
21
  /** Global, cwd-agnostic broker cache of per-session picker metadata, keyed by
24
22
  * absolute `.jsonl` path. Shared across every node's broker (paths are absolute)
@@ -99,7 +99,7 @@ It refreshes every connection last saved before the cutoff, through the store's
99
99
 
100
100
  ## Acting without a sign-in
101
101
 
102
- A server that acts for a person on their hosted runtime, for example to publish events to the objects they watch, uses `oauth.appClient(userId)` instead of `oauth.client(userId)`. It stores no connection and refreshes nothing: the SDK signs a `client_credentials` request with your app's key for `sub=user:<id>`, and the directory answers a token and the person's `runtimeUrl`.
102
+ A server that acts for a person on their Northlight runtime, for example to publish events to the objects they watch, uses `oauth.appClient(userId)` instead of `oauth.client(userId)`. It stores no connection and refreshes nothing: the SDK signs a `client_credentials` request with your app's key for `sub=user:<id>`, and the directory answers a token and the person's `runtimeUrl`.
103
103
 
104
104
  ```ts
105
105
  const runtime = await oauth.appClient('user:o1');
@@ -110,7 +110,7 @@ It needs the app registered with the `app_token_for_user` operation, and an acti
110
110
 
111
111
  | Error | Code | Means |
112
112
  |---|---|---|
113
- | `NoHostedRuntimeError` | `no_hosted_runtime` (409) | The person has no hosted runtime. Not retryable. |
113
+ | `NoHostedRuntimeError` | `no_hosted_runtime` (409) | The person's account has no runtime to act on. Not retryable. |
114
114
  | `NotGrantedError` | `not_granted` (409) | The person has no active grant for your app, so they have not signed in to it. Not retryable. |
115
115
  | any error with `retryable: true` | `runtime_provisioning` (503), a directory 5xx or a 429 | Try again later. |
116
116
 
@@ -20,7 +20,7 @@ Codes the SDK raises itself are listed in `sdkErrorCodes`, and `CrouterError.cod
20
20
  | `oauth_nonce_missing` | `exchangeIdentity` was called without the `nonce` from `authorizeUrl`. | Save the nonce in the visitor's session and pass it back. |
21
21
  | `oauth_state_mismatch` | The callback's `state` was missing or differed from the saved one. | Refuse the callback. |
22
22
  | `not_connected` | `oauth.client(userId)` or a refresh found no stored connection for that person. | Show "sign in again". |
23
- | `no_hosted_runtime` (409, `NoHostedRuntimeError`) | `oauth.appClient(userId)`: the person has no hosted runtime to act on. Not retryable. | Skip them, or ask them to set up a hosted runtime. |
23
+ | `no_hosted_runtime` (409, `NoHostedRuntimeError`) | `oauth.appClient(userId)`: the person's account has no runtime to act on. Not retryable. | Skip them. |
24
24
  | `not_granted` (409, `NotGrantedError`) | `oauth.appClient(userId)`: the person has no active grant for your app. Not retryable. | Send them through sign-in ([Connections](/docs/concepts/connections#acting-without-a-sign-in)). |
25
25
  | `refusal_handler_reentry` | An `onRefusal` handler called `oauth.client` (or a refresh) for the person whose connection it is handling. | Don't call the runtime for `refusal.userId` inside the handler. |
26
26
  | `unauthorized` (401, `AuthenticationError`) | The directory refused your app's client assertion (`invalid_client`) on `exchangeCode`, a refresh or `revoke`, including a refresh inside a client from `oauth.client(userId)`. The message names the key id (`kid`) you signed with and asks whether that key's public JWK is registered. `details` is `{oauth_error: 'invalid_client', kid}`, or `key_thumbprint` instead of `kid` for a key with no `kid`. | Check that the key's public JWK is on the app's **Sign-in** tab ([Manage your app](/docs/guides/manage-your-app)). |
@@ -11,9 +11,9 @@ Your app runs on a server you choose. Northlight hosts two other things: the dir
11
11
  |---|---|---|
12
12
  | **Your server** | Anywhere you choose. Your laptop while you develop. | Your pages and logic. It holds the app's private signing key and a stored connection for each person. |
13
13
  | **The directory** | `https://account.northlight.ai`, hosted by Northlight | Accounts, app registration (the console at `/console`), consent, tokens and the marketplace. |
14
- | **The person's runtime** | Hosted by Northlight, one per person | Their agents, runs, files, documents and providers (sms, search and others), using their own AI subscription. |
14
+ | **The person's runtime** | Northlight's cloud. One shared control plane serves everyone; each of the person's agents runs in its own sandbox. | Their agents, runs, files, documents and providers (sms, search and others), using their own AI subscription. |
15
15
 
16
- "Build on Northlight" therefore means three things. Your app's agent work runs on the person's Northlight-hosted runtime. People sign in to your app with their Northlight account. And your app can be listed in the Northlight marketplace.
16
+ "Build on Northlight" therefore means three things. Your app's agent work runs on the person's Northlight runtime, in Northlight's cloud. People sign in to your app with their Northlight account. And your app can be listed in the Northlight marketplace.
17
17
 
18
18
  ```mermaid
19
19
  sequenceDiagram
@@ -26,13 +26,14 @@ Things to know before you join:
26
26
  - **Joining rewrites your crtr home.** The person this install minted becomes your Northlight user, the next time the daemon starts: your nodes, crons, usage and history in this home are then yours on the account. If you would rather not do that to your everyday home, join from a home you can throw away.
27
27
  - **There is no unjoin.** The only undo is removing the machine on `/account/machines`.
28
28
  - **Removing the machine stops it.** Once you choose **Remove** next to a machine, it gets no new tokens at once and the ones it holds expire within 5 minutes. After that its `cloud` commands answer `machine_revoked`: "This machine was removed from your Northlight account." It stays that way until you create a new join token and run `crtr sys join` again. Files on the computer stay on it.
29
- - **Your hosted machine is unchanged.** `/account/machines` lists it as "Northlight (hosted)", the default. Your chat agent at `https://chat.northlight.ai` still runs `crtr cloud apps …` as before.
29
+ - **Your Northlight runtime is unchanged.** `/account/machines` lists it as "Northlight (hosted)", the default: your runtime in Northlight's cloud. Your chat agent at `https://chat.northlight.ai` still runs `crtr cloud apps …` as before.
30
+ - **Joining is not importing.** Join only lets this machine run `crtr cloud …` as you; its nodes and documents stay in its own crtr home. `crtr sys import start` is the separate step that moves them into your Northlight account and turns this computer into a machine your cloud runtime drives.
30
31
 
31
32
  ## `crtr cloud apps`
32
33
 
33
34
  Every app-management leaf of Northlight's `cloud` provider runs as you and needs a joined machine. `--app-id` takes `app:<client id>` or the bare client id.
34
35
 
35
- Your Northlight chat agent at `https://chat.northlight.ai` can run these commands as you, on your hosted runtime. It can list and change an app (`mine` and `set-scopes` were checked on production). It cannot delete one. Generate keys on your laptop and give an agent only a public JWK, never the private key.
36
+ Your Northlight chat agent at `https://chat.northlight.ai` can run these commands as you, from your Northlight runtime. It can list and change an app (`mine` and `set-scopes` were checked on production). It cannot delete one. Generate keys on your laptop and give an agent only a public JWK, never the private key.
36
37
 
37
38
  | Command | What it does |
38
39
  |---|---|
@@ -24,7 +24,7 @@ An app that signs people in with Northlight uses `OAuth2Client` and `oauth.clien
24
24
  | Option | Type | Default | Meaning |
25
25
  |---|---|---|---|
26
26
  | `baseURL` | `string` | `CRTR_BASE_URL`, else unset | `http(s)://host:port` of a daemon TCP listener. |
27
- | `socketPath` | `string` | `CRTR_SOCKET`, else `${CRTR_HOME}/crtrd.sock`, else `~/.crouter/canvas/crtrd.sock` | Unix socket. Node only; throws in a browser. |
27
+ | `socketPath` | `string` | `CRTR_SOCKET`, else `CRTR_API_SOCKET`, else `api.sock` in the runtime root (`${CRTR_HOME:-~/.crouter}/runtime/api.sock` on macOS, `/run/crtr/api.sock` on Linux) | Unix socket. Node only; throws in a browser. |
28
28
  | `token` | `string` | `CRTRD_TOKEN` | Sent as `Authorization: Bearer <token>`. The owner token or a scoped token from `crtr sys connect`; a scoped token's ceiling is enforced per request (see [Getting started](./getting-started.md#a-token-that-holds-less-than-the-owner)). Ignored by a unix-socket daemon, which authenticates by filesystem permission. |
29
29
  | `timeout` | `number` (ms) | `30_000` | Per-request wall clock. Does not apply to a stream. |
30
30
  | `maxRetries` | `number` | `2` | Transient-failure retries. Never applied to `POST` or `PATCH` — see [Errors](./errors.md). |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.653",
3
+ "version": "0.3.654",
4
4
  "description": "crtr — agent runtime with memory, plugins, and marketplaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -145,7 +145,7 @@
145
145
  },
146
146
  "license": "UNLICENSED",
147
147
  "dependencies": {
148
- "@north-light/identity": "0.3.653",
148
+ "@north-light/identity": "0.3.654",
149
149
  "@earendil-works/chord": "1.1.0",
150
150
  "@earendil-works/pi-agent-core": "1.1.0",
151
151
  "@earendil-works/pi-ai": "1.1.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/identity",
3
- "version": "0.3.653",
3
+ "version": "0.3.654",
4
4
  "description": "Northlight access-token verification and scope rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.653",
3
+ "version": "0.3.654",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/cli",
9
- "version": "0.3.653",
9
+ "version": "0.3.654",
10
10
  "hasInstallScript": true,
11
11
  "license": "UNLICENSED",
12
12
  "workspaces": [
@@ -28,7 +28,7 @@
28
28
  "@milkdown/preset-gfm": "^7.22.3",
29
29
  "@milkdown/prose": "^7.22.3",
30
30
  "@milkdown/utils": "^7.22.3",
31
- "@north-light/identity": "0.3.653",
31
+ "@north-light/identity": "0.3.654",
32
32
  "cron-parser": "^5.6.0",
33
33
  "esbuild": "^0.27.7",
34
34
  "jose": "^6.2.12",
@@ -11956,17 +11956,17 @@
11956
11956
  },
11957
11957
  "packages/crouter-api": {
11958
11958
  "name": "@north-light/api",
11959
- "version": "0.3.653",
11959
+ "version": "0.3.654",
11960
11960
  "license": "UNLICENSED"
11961
11961
  },
11962
11962
  "packages/crouter-env-docker": {
11963
11963
  "name": "@north-light/env-docker",
11964
- "version": "0.3.653",
11964
+ "version": "0.3.654",
11965
11965
  "license": "UNLICENSED"
11966
11966
  },
11967
11967
  "packages/crouter-identity": {
11968
11968
  "name": "@north-light/identity",
11969
- "version": "0.3.653",
11969
+ "version": "0.3.654",
11970
11970
  "license": "UNLICENSED",
11971
11971
  "dependencies": {
11972
11972
  "jose": "^6.2.1"
@@ -11974,21 +11974,21 @@
11974
11974
  },
11975
11975
  "packages/crouter-plugin": {
11976
11976
  "name": "@north-light/plugin",
11977
- "version": "0.3.653",
11977
+ "version": "0.3.654",
11978
11978
  "license": "UNLICENSED",
11979
11979
  "dependencies": {
11980
- "@north-light/api": "0.3.653",
11981
- "@north-light/identity": "0.3.653"
11980
+ "@north-light/api": "0.3.654",
11981
+ "@north-light/identity": "0.3.654"
11982
11982
  }
11983
11983
  },
11984
11984
  "packages/crouter-sdk": {
11985
11985
  "name": "@north-light/sdk",
11986
- "version": "0.3.653",
11986
+ "version": "0.3.654",
11987
11987
  "license": "UNLICENSED",
11988
11988
  "dependencies": {
11989
- "@north-light/api": "0.3.653",
11990
- "@north-light/identity": "0.3.653",
11991
- "@north-light/plugin": "0.3.653",
11989
+ "@north-light/api": "0.3.654",
11990
+ "@north-light/identity": "0.3.654",
11991
+ "@north-light/plugin": "0.3.654",
11992
11992
  "jose": "^6.2.1"
11993
11993
  },
11994
11994
  "bin": {