@north-light/cli 0.3.781 → 0.3.782
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 +9 -19
- package/dist/api/client.d.ts +3 -1
- package/dist/api/client.js +1 -1
- package/dist/api/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/dto/charges.d.ts +1 -1
- package/dist/api/dto/charges.js +1 -1
- package/dist/api/dto/inbox.d.ts +2 -0
- package/dist/build-root.js +1 -1
- package/dist/builtin-memory/crouter-concepts/why-a-daemon.md +1 -1
- package/dist/builtin-memory/crouter-sdk/README.md +3 -2
- package/dist/builtin-memory/crouter-sdk/client.md +3 -3
- package/dist/builtin-memory/crouter-sdk/docker.md +6 -10
- package/dist/builtin-memory/crouter-sdk/release-notes.md +19 -3
- package/dist/builtin-memory/crouter-sdk/sourcing.md +94 -0
- package/dist/builtin-memory/insights/capture.md +2 -2
- package/dist/builtin-memory/northlight-apps/cli.md +1 -1
- package/dist/builtin-memory/northlight-apps/coding-agents.md +1 -1
- package/dist/builtin-memory/northlight-apps/get-started.md +2 -2
- package/dist/builtin-memory/northlight-apps/guides/watchable-objects.md +1 -1
- package/dist/builtin-memory/northlight-apps/how-it-fits.md +1 -1
- package/dist/builtin-memory/northlight-apps/let-their-ai-use-your-app.md +1 -4
- package/dist/builtin-memory/northlight-apps/quickstart.md +1 -1
- package/dist/cli.js +2 -2
- package/dist/clients/attach/command.js +1 -1
- package/dist/clients/attach/input/capabilities.js +1 -1
- package/dist/clients/attach/viewer.js +459 -459
- package/dist/clients/inbox/controller.d.ts +34 -11
- package/dist/clients/inbox/controller.js +1 -1
- package/dist/clients/inbox/dto-adapt.d.ts +1 -0
- package/dist/clients/inbox/dto-adapt.js +1 -1
- package/dist/clients/inbox/surface.js +1 -1
- package/dist/commands/canvas-config.js +2 -2
- package/dist/commands/canvas-use.js +1 -1
- package/dist/commands/node/inspect.js +6 -6
- package/dist/commands/profile/default.js +1 -1
- package/dist/commands/sys/signin.d.ts +1 -1
- package/dist/commands/sys/signin.js +3 -3
- package/dist/core/command.d.ts +1 -2
- package/dist/core/command.js +6 -6
- package/dist/core/human/requests.d.ts +2 -0
- package/dist/core/human/requests.js +18 -18
- package/dist/core/providers/call.js +1 -1
- package/dist/core/runtime/broker/cli-relay.d.ts +0 -2
- package/dist/core/runtime/broker/cli-relay.js +1 -1
- package/dist/core/runtime/broker/run-turn-queue.js +1 -1
- package/dist/core/runtime/broker/turn-cause.d.ts +2 -0
- package/dist/core/runtime/broker/turn-cause.js +1 -1
- package/dist/daemon/api/handlers/inbox.js +1 -1
- package/dist/daemon/api/router.js +1 -1
- package/dist/daemon/machine-link/config.d.ts +2 -4
- package/dist/daemon/machine-link/config.js +4 -4
- package/dist/daemon/manage.js +2 -2
- package/dist/daemon/postgres/cluster.d.ts +3 -3
- package/dist/daemon/postgres/cluster.js +5 -5
- package/dist/daemon/postgres/supervisor.js +1 -1
- package/dist/pi-extensions/canvas-inbox-watcher.js +2 -2
- package/docs/apps/cli.md +1 -1
- package/docs/apps/coding-agents.md +1 -1
- package/docs/apps/get-started.md +2 -2
- package/docs/apps/guides/watchable-objects.md +1 -1
- package/docs/apps/how-it-fits.md +1 -1
- package/docs/apps/let-their-ai-use-your-app.md +1 -4
- package/docs/apps/quickstart.md +1 -1
- package/docs/concepts/why-a-daemon.md +1 -1
- package/docs/sdk/README.md +3 -2
- package/docs/sdk/client.md +3 -3
- package/docs/sdk/docker.md +5 -9
- package/docs/sdk/release-notes.md +19 -3
- package/docs/sdk/sourcing.md +91 -0
- package/package.json +3 -3
- package/packages/crouter-api/dist/api/client.js +2 -2
- package/packages/crouter-api/dist/api/contract.js +1 -1
- package/packages/crouter-api/dist/api/dto/charges.js +1 -1
- package/packages/crouter-api/dist/daemon/machine-link/config.js +3 -5
- package/packages/crouter-api/dist/daemon/manage.js +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/scripts/install-runtime.mjs +1 -1
- package/dist/core/northlight/previews.d.ts +0 -22
- package/dist/core/northlight/previews.js +0 -1
|
@@ -7,6 +7,22 @@ description: Behavior changes in @north-light/sdk that an app must act on, newes
|
|
|
7
7
|
|
|
8
8
|
Changes to `@north-light/sdk` that can change what an existing app sees. Newest first.
|
|
9
9
|
|
|
10
|
+
## 0.3.781
|
|
11
|
+
|
|
12
|
+
`sourcing.read` and `SOURCING_RUN_RULE`. Additive: no request or response an existing app sends or reads changes.
|
|
13
|
+
|
|
14
|
+
- `sourcing.read(client, request, options?)` reads from the person's Mac (or their GitHub account) first and Northlight's hosted `search` second, and resolves `{served_by, data, cost_usd?, fallback_reason?}`. LinkedIn reads have no hosted path. See [sourcing](/docs/reference/sourcing).
|
|
15
|
+
- `SourcingUnavailableError` (`code: 'sourcing_unavailable'`, status 503, with `attempts`, `retryAt`, `budget`) is raised when no path can serve the read now.
|
|
16
|
+
- `SOURCING_RUN_RULE` is the same rule as text for run prompts that hold `device:browser`.
|
|
17
|
+
|
|
18
|
+
### `payment.reason` can be `account_held`
|
|
19
|
+
|
|
20
|
+
`PaymentRefusalDTO.reason` now lists `account_held`, which the directory already sent while a new account waits for approval. Treat it like any refusal the person cannot fix by paying: show `message`, no link.
|
|
21
|
+
|
|
22
|
+
`GET /v1/human/inbox?include=page`. Additive: without the query the response is unchanged.
|
|
23
|
+
|
|
24
|
+
- With `include=page`, each page ticket carries an optional `page` field holding the same body `GET /v1/human/inbox/:ticket_id` returns, so a client can open every listed page without a read per page. A page that cannot be read is listed without `page`.
|
|
25
|
+
|
|
10
26
|
## 0.3.759
|
|
11
27
|
|
|
12
28
|
### A grant can hold a whole provider as `<provider>:*`
|
|
@@ -331,7 +347,7 @@ Every other `canvas` method and `customObjects.receive`/`ack` remain absent from
|
|
|
331
347
|
- `definePlugin({objectKinds})` declares canvas object kinds by name relative to the plugin (`repo`), each `{ description, events: { <name>: { level: 1-10, supersedes? } }, read?: { command: [...] } }`. The bundle the kit serves carries them in `bundle.json` `object_kinds`, keyed `<providerId>.<name>`: `providerId` is the `auth.providerId` the handler was given, else the plugin name. `definePlugin` throws `PluginDefinitionError` for a relative name that is not lowercase letters, digits and `-`, a blank description, more than 64 events, a level outside 1-10, and a `read.command` that is not a non-streaming leaf of the plugin. Building the bundle throws if the prefixed kind is not one crouter accepts (a provider id with capitals or `_`, or one of crouter's reserved roots such as `repo` or `report`).
|
|
332
348
|
- `ctx.caller.crtr` carries the calling node: `{ node?, machine?, profile?, run? }`, parsed by the exported `parseCrtrCaller(header)` from the request's `Crtr-Caller`. It is absent when the header names no field. The runtime asserts that header and the bearer token does not cover it, so use it to tell which of the verified `sub`'s nodes called, never to authorize; authorize on `sub`.
|
|
333
349
|
|
|
334
|
-
See
|
|
350
|
+
See Local plugins and Object kinds and the calling node.
|
|
335
351
|
|
|
336
352
|
### `nodes.revive` reports `ready` (additive)
|
|
337
353
|
|
|
@@ -375,7 +391,7 @@ Plugins can now declare canvas object kinds and act on the canvas, and an app to
|
|
|
375
391
|
|
|
376
392
|
### Plugin manifests declare `object_kinds` and `scopes` (additive)
|
|
377
393
|
|
|
378
|
-
`plugin.json` and `bundle.json` take two optional top-level blocks. `object_kinds` maps a kind name (`<plugin>.<name>`, so the first segment is the plugin's own name) to `{ description, events, read? }`: `events` holds up to 64 entries `{ level: 1-10, supersedes?: boolean }`, and `read.command` is a leaf path below the plugin's root command. That leaf must answer once: a leaf declared `rest.streaming: true` is refused as a `read.command`. `scopes` lists the canvas scopes the plugin asks for. A provider bundle may not declare `scopes`: a cloud app's scopes come from directory consent. Install, update and enable refuse an invalid block and keep the installed version; a kind another owner already holds is reported as `kind_owned` and the plugin's other kinds still apply. `crtr pkg plugin install|update|enable` print these as `warnings`, plus `appScopes` (the scopes the plugin's token now carries). Plugin authors: see
|
|
394
|
+
`plugin.json` and `bundle.json` take two optional top-level blocks. `object_kinds` maps a kind name (`<plugin>.<name>`, so the first segment is the plugin's own name) to `{ description, events, read? }`: `events` holds up to 64 entries `{ level: 1-10, supersedes?: boolean }`, and `read.command` is a leaf path below the plugin's root command. That leaf must answer once: a leaf declared `rest.streaming: true` is refused as a `read.command`. `scopes` lists the canvas scopes the plugin asks for. A provider bundle may not declare `scopes`: a cloud app's scopes come from directory consent. Install, update and enable refuse an invalid block and keep the installed version; a kind another owner already holds is reported as `kind_owned` and the plugin's other kinds still apply. `crtr pkg plugin install|update|enable` print these as `warnings`, plus `appScopes` (the scopes the plugin's token now carries). Plugin authors: see Local plugins.
|
|
379
395
|
|
|
380
396
|
`ReconcilePackagesDTO` (the answer of `POST /v1/documents/reconcile-packages`) gains two optional fields: `kinds` (`applied` with `outcome` of `inserted`, `updated` or `unchanged`; `refused` with code `kind_owned`; `invalid` plugins with the reason) and `tokens` (`granted` plugins with their scopes, and `revoked` plugin names).
|
|
381
397
|
|
|
@@ -400,7 +416,7 @@ Each enabled local plugin that declares `object_kinds` or `scopes`, or serves ov
|
|
|
400
416
|
|
|
401
417
|
### `Crtr-Caller` and `Crtr-Signature` on local HTTP calls (additive)
|
|
402
418
|
|
|
403
|
-
Every HTTP call to a plugin carries `Crtr-Caller: node=<id>; machine=<id>; profile=<id>; run=<id>` (fields in that order, empty ones left out, header omitted when none). Calls to a local plugin's endpoint origin also carry `Crtr-Signature: v1,t=<unix seconds>,h=<signed header names>,sig=<base64url HMAC-SHA256 keyed by the plugin's token>` plus a fresh `Crtr-Request-Id`. A manifest cannot set these three header names. Provider calls carry `Crtr-Caller` too. Plugin authors: the canonical string and a reference verifier are in
|
|
419
|
+
Every HTTP call to a plugin carries `Crtr-Caller: node=<id>; machine=<id>; profile=<id>; run=<id>` (fields in that order, empty ones left out, header omitted when none). Calls to a local plugin's endpoint origin also carry `Crtr-Signature: v1,t=<unix seconds>,h=<signed header names>,sig=<base64url HMAC-SHA256 keyed by the plugin's token>` plus a fresh `Crtr-Request-Id`. A manifest cannot set these three header names. Provider calls carry `Crtr-Caller` too. Plugin authors: the canonical string and a reference verifier are in Local plugins.
|
|
404
420
|
|
|
405
421
|
crtrd signs the call; the CLI never holds the token. `POST /v1/plugins/:name/call-headers` (new operation `plugins.call-headers`, person and broker callers) takes only digests, `{ method, url, body_sha256, header_names, headers_sha256 }`, and answers `{ headers }` (`Crtr-Caller`, and `Crtr-Signature` when the URL is on the installed endpoint's origin and that endpoint is loopback). Any other URL gets `Crtr-Caller` only. An unknown or disabled plugin and a provider plugin answer `404 not_found`; malformed digests answer `400 invalid_request`. SDK: `CrtrClient.plugins.callHeaders(name, request)`, `PluginCallHeadersRequestDTO`, `PluginCallHeadersDTO`, `routes.pluginCallHeaders(name)`.
|
|
406
422
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Sourcing reads
|
|
3
|
+
description: Read a person, company or page from the person's own Mac first, then from Northlight's hosted search, with one result shape and one "not now" error.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sourcing reads
|
|
7
|
+
|
|
8
|
+
`sourcing.read(client, request, options?)` reads one thing about a person, company or page. It tries the person's own Mac (or their linked GitHub account) first. When that path cannot be used now, it tries Northlight's hosted `search` provider, which Northlight pays for up to the app's caps. It never writes, never sleeps and never retries.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { sourcing, SourcingUnavailableError } from '@north-light/sdk';
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const r = await sourcing.read(runtime, { read: 'github.user', login: 'octocat' }, { scopes: grantedScopes });
|
|
15
|
+
// r.served_by: 'device' | 'integrations' | 'hosted'
|
|
16
|
+
// r.data, r.cost_usd? (hosted only), r.fallback_reason? (hosted only: why path 1 did not serve it)
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (error instanceof SourcingUnavailableError) {
|
|
19
|
+
// error.attempts, error.retryAt (ISO or null), error.budget, error.retryable
|
|
20
|
+
} else throw error;
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`client` is anything with `providers.call`: a `Crouter` or the client from `oauth.appClient(userId)`. The app's grant needs `device:browser` for Mac reads, `integrations:github_read` for GitHub, and the `search` scopes for hosted reads (`search:search`, `search:contents`, `search:answer`, `search:people`).
|
|
25
|
+
|
|
26
|
+
## Route table
|
|
27
|
+
|
|
28
|
+
| `read` | Path 1 | Path 2 (hosted `search`) |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `linkedin.profile`, `linkedin.search`, `linkedin.company` | Mac, `@northlight/linkedin` `getProfile`, `searchPeople`, `getCompany` | **none** |
|
|
31
|
+
| `x.profile` | Mac, `@northlight/x` `getProfile` | `people x-profile` |
|
|
32
|
+
| `x.search` | Mac, `@northlight/x` `searchUsers` | none |
|
|
33
|
+
| `x.posts` | Mac, `@northlight/x` `searchPosts` | `search` with `include-domains x.com` |
|
|
34
|
+
| `github.user` | `integrations` `github read` (the person's own GitHub account) | `people github-user` |
|
|
35
|
+
| `github.repos` | `integrations` `github read` | none (a profile is not a repo list) |
|
|
36
|
+
| `web.search`, `web.contents`, `web.answer` | none | `search`, `contents`, `answer` |
|
|
37
|
+
| `email.work` | none | `people work-email` |
|
|
38
|
+
|
|
39
|
+
There is no hosted LinkedIn path. A LinkedIn read the Mac cannot serve ends in `sourcing_unavailable`; retry at `retryAt` once the Mac is back or the limit window passes.
|
|
40
|
+
|
|
41
|
+
## The rule
|
|
42
|
+
|
|
43
|
+
Path 1 is skipped, with no call, when `options.scopes` is given and lacks the scope for that path, or when `options.browser === false` (the app's last device probe found no Chrome). The attempt is recorded as `skipped:no_scope` or `skipped:no_browser`.
|
|
44
|
+
|
|
45
|
+
| Path 1 returns | Result |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `device_offline`, `device_timeout`, `provider_not_connected`, `machine_required`, `helper_not_installed`, `browser_profile_not_open` | Fall through (the Mac cannot be used now) |
|
|
48
|
+
| `site_signed_out`, `wrong_site` | Fall through (not signed in to the site) |
|
|
49
|
+
| `rate_limited` | Fall through; `retry_after_s` is carried to `retryAt` |
|
|
50
|
+
| `lib_broken` | Fall through |
|
|
51
|
+
| `account_not_linked`, `account_reconnect_required` (GitHub) | Fall through |
|
|
52
|
+
| `js_exception`, `outcome_unknown` | Fall through. Reads never return `outcome_unknown`; it is treated as `js_exception`. A `js_exception` whose message names the site function's `NotFound`, `Validation` or `PermissionDenied` is the answer instead |
|
|
53
|
+
| `not_found`, `invalid_argument`, `permission_error`, `scope_missing`, and any code not listed | **Thrown as is.** The person does not exist, the input is bad, or the grant is wrong |
|
|
54
|
+
|
|
55
|
+
| Hosted returns | Result |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `limit_reached`, `payment_required`, `cap_exhausted` (HTTP 402) | Stop: `SourcingUnavailableError` with `budget: true`; `retryAt` is the refusal's `reset_at` |
|
|
58
|
+
| `provider_rate_limited`, `provider_capacity`, `vendor_unavailable` | `SourcingUnavailableError`, retryable, `retryAt` from `retry_after_s` |
|
|
59
|
+
| `price_over_maximum` | Stop: thrown as is |
|
|
60
|
+
| anything else | Thrown as is |
|
|
61
|
+
|
|
62
|
+
## `SourcingUnavailableError`
|
|
63
|
+
|
|
64
|
+
`code: 'sourcing_unavailable'`, `status: 503`. Retryable when any attempt was transient.
|
|
65
|
+
|
|
66
|
+
| Field | Meaning |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `attempts` | One entry per path tried or skipped: `{path, code, retry_after_s?, reset_at?}` |
|
|
69
|
+
| `retryAt` | ISO time of the earliest `retry_after_s` or `reset_at` across the attempts, or `null` |
|
|
70
|
+
| `budget` | `true` when the hosted refusal was a 402 |
|
|
71
|
+
|
|
72
|
+
The app decides what to do: leave the work queued, show "Mac offline and hosted budget used up", and try again after `retryAt`.
|
|
73
|
+
|
|
74
|
+
## Options
|
|
75
|
+
|
|
76
|
+
| Option | Use |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `scopes` | The scopes the grant holds, so a path without its scope is skipped without a call |
|
|
79
|
+
| `browser` | `false` skips the Mac path (the app's last probe found no Chrome) |
|
|
80
|
+
| `machine` | Which Mac takes the device calls, when the person has more than one |
|
|
81
|
+
| `githubAccount` | The linked GitHub account label, when the person has several |
|
|
82
|
+
| `execTimeoutMs` | The Mac script budget (default 30000) |
|
|
83
|
+
| `signal` | Aborts the read |
|
|
84
|
+
|
|
85
|
+
## Cost and logging
|
|
86
|
+
|
|
87
|
+
Device and integrations reads cost Northlight nothing and are not metered. `served_by` says which path answered; for `hosted`, `cost_usd` is the top-level `cost_usd` of the hosted answer (dollars), when the leaf returns one. Add it to your own per-pass cost.
|
|
88
|
+
|
|
89
|
+
## Rule text for agent runs
|
|
90
|
+
|
|
91
|
+
`SOURCING_RUN_RULE` is the same rule written for an agent. Append it to the prompt of any run that holds `device:browser`, so a run that reads LinkedIn with `crtr device browser` follows the same fall-through, no-hosted-LinkedIn and stop rules.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.782",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
},
|
|
158
158
|
"license": "UNLICENSED",
|
|
159
159
|
"dependencies": {
|
|
160
|
-
"@north-light/identity": "0.3.
|
|
161
|
-
"@north-light/plugin": "0.3.
|
|
160
|
+
"@north-light/identity": "0.3.782",
|
|
161
|
+
"@north-light/plugin": "0.3.782",
|
|
162
162
|
"@earendil-works/chord": "1.5.2",
|
|
163
163
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
164
164
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -819,8 +819,8 @@ export class CrtrClient {
|
|
|
819
819
|
// ---- Humanloop inbox (Northlight crouter-inbox v1, inbox-contract.md §A) --
|
|
820
820
|
/** Pending page/review tickets across every available crouter-owned
|
|
821
821
|
* humanloop root. */
|
|
822
|
-
listHumanInbox() {
|
|
823
|
-
return this.request('GET', routes.humanInbox());
|
|
822
|
+
listHumanInbox(opts = {}) {
|
|
823
|
+
return this.request('GET', opts.includePages === true ? withQuery(routes.humanInbox(), { include: 'page' }) : routes.humanInbox());
|
|
824
824
|
}
|
|
825
825
|
/** Read one page ticket by its opaque ticket id (pending, resolved, or canceled). */
|
|
826
826
|
getHumanInboxPage(ticketId) {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
//
|
|
13
13
|
// PURITY (spec §3.1): Node built-ins + `src/api/*` only.
|
|
14
14
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
15
|
-
export const CONTRACT_LEVEL = '1.
|
|
15
|
+
export const CONTRACT_LEVEL = '1.85';
|
|
16
16
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
17
17
|
export const REQUIRED_CONTRACT_HEADER = 'Crouter-Required-Contract';
|
|
18
18
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// The money ledger's read and limit surfaces: `charges.list`, `spend_limits.list`, `spend_limits.set`, `spend_limits.remove`.
|
|
2
2
|
// (`limits.*` and `/v1/limits` are the per-app memory and disk caps; these are dollar limits.)
|
|
3
3
|
/** Why a call was refused for payment. `reason` is what an app branches on; never the message text. */
|
|
4
|
-
export const PAYMENT_REFUSAL_REASONS = ['trial_ended', 'card_required', 'card_limit', 'nothing_left', 'app_limit', 'team_limit', 'app_unpaid'];
|
|
4
|
+
export const PAYMENT_REFUSAL_REASONS = ['trial_ended', 'card_required', 'card_limit', 'nothing_left', 'app_limit', 'team_limit', 'app_unpaid', 'account_held'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/daemon/machine-link/config.ts — what a Mac knows about its own machine environment after import (design-import I13):
|
|
2
2
|
// `runtime/machine.json` ({apiUrl, environmentId, runId, directoryUrl, account}, written by the exporter's finish step) and the machine credential at
|
|
3
|
-
// `runtime/secrets/machine-credential` (mode 0600). A
|
|
3
|
+
// `runtime/secrets/machine-credential` (mode 0600). A computer with no `machine.json` is not signed in to Northlight and has no machine environment.
|
|
4
4
|
// Also the move record `runtime/import/move.json` (0600): where a move to Northlight that `crtr sys signin` started stands, from before the drain until the
|
|
5
5
|
// computer has switched over (design-crtr-northlight-signin component 4).
|
|
6
6
|
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
@@ -48,7 +48,5 @@ export function readOrCreateInstallId() {
|
|
|
48
48
|
writeFileSync(path, `${id}\n`);
|
|
49
49
|
return id;
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
52
|
-
export const
|
|
53
|
-
/** A computer with no `machine.json`, no local records and no join registration has not been set up: it has no control plane to reach until `crtr sys signin`. */
|
|
54
|
-
export const computerIsUnset = () => readMachineConfig() === undefined && !hasLocalCanvas() && joinedIssuer() === null;
|
|
51
|
+
/** A computer with no `machine.json` and no join registration is not signed in to Northlight: it has no control plane to reach until `crtr sys signin`. */
|
|
52
|
+
export const computerIsNotSignedIn = () => readMachineConfig() === undefined && joinedIssuer() === null;
|
|
@@ -16,7 +16,7 @@ import { hostExecPath } from '../core/runtime/branded-host.js';
|
|
|
16
16
|
// reaches openDb) so the CLI daemon front door stays canvas.db-free (plan B-0).
|
|
17
17
|
import { isDaemonRunning, readPidfile, isPidAlive } from './pidfile.js';
|
|
18
18
|
import { DAEMON_STARTUP_WINDOW_MS } from './startup-policy.js';
|
|
19
|
-
import {
|
|
19
|
+
import { computerIsNotSignedIn, readMachineConfig } from './machine-link/config.js';
|
|
20
20
|
import { exclusiveLockOwnerPid } from '../core/exclusive-lock.js';
|
|
21
21
|
import { onDiskMigrationLockPath } from '../core/canvas/paths.js';
|
|
22
22
|
import { envNoDaemonAutostart } from '../shared/env.js';
|
|
@@ -690,8 +690,8 @@ export function ensureDaemon(deps = {}) {
|
|
|
690
690
|
const now = deps.now ?? Date.now;
|
|
691
691
|
if (autostartDisabled())
|
|
692
692
|
return;
|
|
693
|
-
// A computer
|
|
694
|
-
if (!deps.spawnDaemon &&
|
|
693
|
+
// A computer that is not signed in to Northlight has no control plane to start a daemon for (`crtr sys signin` comes first).
|
|
694
|
+
if (!deps.spawnDaemon && computerIsNotSignedIn())
|
|
695
695
|
return;
|
|
696
696
|
if (autostartInFlight)
|
|
697
697
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.782",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.782",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"postpack": "node ../../scripts/pack-minify.mjs postpack packages/crouter-plugin"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@north-light/api": "0.3.
|
|
31
|
-
"@north-light/identity": "0.3.
|
|
30
|
+
"@north-light/api": "0.3.782",
|
|
31
|
+
"@north-light/identity": "0.3.782"
|
|
32
32
|
},
|
|
33
33
|
"license": "UNLICENSED",
|
|
34
34
|
"publishConfig": {
|
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.782",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/cli",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.782",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"workspaces": [
|
|
@@ -28,8 +28,8 @@
|
|
|
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.
|
|
32
|
-
"@north-light/plugin": "0.3.
|
|
31
|
+
"@north-light/identity": "0.3.782",
|
|
32
|
+
"@north-light/plugin": "0.3.782",
|
|
33
33
|
"cron-parser": "^5.6.0",
|
|
34
34
|
"esbuild": "0.28.2",
|
|
35
35
|
"jose": "^6.2.12",
|
|
@@ -11902,17 +11902,17 @@
|
|
|
11902
11902
|
},
|
|
11903
11903
|
"packages/crouter-api": {
|
|
11904
11904
|
"name": "@north-light/api",
|
|
11905
|
-
"version": "0.3.
|
|
11905
|
+
"version": "0.3.782",
|
|
11906
11906
|
"license": "UNLICENSED"
|
|
11907
11907
|
},
|
|
11908
11908
|
"packages/crouter-env-docker": {
|
|
11909
11909
|
"name": "@north-light/env-docker",
|
|
11910
|
-
"version": "0.3.
|
|
11910
|
+
"version": "0.3.782",
|
|
11911
11911
|
"license": "UNLICENSED"
|
|
11912
11912
|
},
|
|
11913
11913
|
"packages/crouter-identity": {
|
|
11914
11914
|
"name": "@north-light/identity",
|
|
11915
|
-
"version": "0.3.
|
|
11915
|
+
"version": "0.3.782",
|
|
11916
11916
|
"license": "UNLICENSED",
|
|
11917
11917
|
"dependencies": {
|
|
11918
11918
|
"jose": "^6.2.1"
|
|
@@ -11920,21 +11920,21 @@
|
|
|
11920
11920
|
},
|
|
11921
11921
|
"packages/crouter-plugin": {
|
|
11922
11922
|
"name": "@north-light/plugin",
|
|
11923
|
-
"version": "0.3.
|
|
11923
|
+
"version": "0.3.782",
|
|
11924
11924
|
"license": "UNLICENSED",
|
|
11925
11925
|
"dependencies": {
|
|
11926
|
-
"@north-light/api": "0.3.
|
|
11927
|
-
"@north-light/identity": "0.3.
|
|
11926
|
+
"@north-light/api": "0.3.782",
|
|
11927
|
+
"@north-light/identity": "0.3.782"
|
|
11928
11928
|
}
|
|
11929
11929
|
},
|
|
11930
11930
|
"packages/crouter-sdk": {
|
|
11931
11931
|
"name": "@north-light/sdk",
|
|
11932
|
-
"version": "0.3.
|
|
11932
|
+
"version": "0.3.782",
|
|
11933
11933
|
"license": "UNLICENSED",
|
|
11934
11934
|
"dependencies": {
|
|
11935
|
-
"@north-light/api": "0.3.
|
|
11936
|
-
"@north-light/identity": "0.3.
|
|
11937
|
-
"@north-light/plugin": "0.3.
|
|
11935
|
+
"@north-light/api": "0.3.782",
|
|
11936
|
+
"@north-light/identity": "0.3.782",
|
|
11937
|
+
"@north-light/plugin": "0.3.782",
|
|
11938
11938
|
"jose": "^6.2.1"
|
|
11939
11939
|
},
|
|
11940
11940
|
"bin": {
|
|
@@ -29,7 +29,7 @@ const PACKAGE_ROOT = positional[0] ? resolve(positional[0]) : resolve(dirname(fi
|
|
|
29
29
|
const RUNTIME_HOME = runtimeHome();
|
|
30
30
|
const GENERATIONS = join(RUNTIME_HOME, 'generations');
|
|
31
31
|
const LOCK = join(RUNTIME_HOME, 'install.lock');
|
|
32
|
-
// --shared-node-modules=<dir>, image builds only
|
|
32
|
+
// --shared-node-modules=<dir>, image builds only: the generation installs no
|
|
33
33
|
// node_modules of its own and resolves its dependencies from this directory,
|
|
34
34
|
// installed once in the shared base image (docker/base.Dockerfile). Node finds
|
|
35
35
|
// it by walking up from the generation, so it must sit in an ancestor of the
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { BranchDef, BranchRefusal } from '../command.js';
|
|
2
|
-
export interface NorthlightPreview {
|
|
3
|
-
/** The command name, and the root name the account's real command replaces it under. */
|
|
4
|
-
name: string;
|
|
5
|
-
concept: string;
|
|
6
|
-
/** One line, in the root listing and the help page's description. */
|
|
7
|
-
description: string;
|
|
8
|
-
useWhen: string;
|
|
9
|
-
/** What it does once signed in, 2–3 sentences, filling "Once signed in, …". */
|
|
10
|
-
doesOnceSignedIn: string;
|
|
11
|
-
/** `process.platform` values it is listed on; absent means every platform. */
|
|
12
|
-
platforms?: readonly NodeJS.Platform[];
|
|
13
|
-
}
|
|
14
|
-
export declare const NORTHLIGHT_PREVIEWS: readonly NorthlightPreview[];
|
|
15
|
-
/** The one rendering of a preview's text: its help page (`crtr <name> -h`) and its refusal (any other invocation). */
|
|
16
|
-
export declare function renderPreview(row: NorthlightPreview): {
|
|
17
|
-
summary: string;
|
|
18
|
-
model: string;
|
|
19
|
-
refusal: BranchRefusal;
|
|
20
|
-
};
|
|
21
|
-
/** One refusing branch per row listed on `platform`, skipping any name in `taken` (an installed bundle already provides it). */
|
|
22
|
-
export declare function previewBranches(platform: NodeJS.Platform, taken: ReadonlySet<string>): BranchDef[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=Object.defineProperty;var s=(e,t)=>c(e,"name",{value:t,configurable:!0});import{defineBranch as h}from"../command.js";import{ExitCode as d}from"../../types.js";const l=[{name:"integrations",concept:"The person's own accounts at other services (Gmail, Slack, Calendar, GitHub and more)",description:"Read and act in the person's own accounts at other services",useWhen:"the task needs data from or an action in one of the person's own accounts at another service, such as their email, calendar, chat or code host",doesOnceSignedIn:"it lists the person's connected accounts, searches the services available to connect, and reads or acts in an account on their behalf, such as reading mail, posting a message or creating an event. Accounts the person has not connected yet are connected from their Northlight account."},{name:"search",concept:"Web information and data",description:"Search the web and fetch data from the open internet",useWhen:"the task needs current information from the web or a data endpoint",doesOnceSignedIn:"it searches the web, reads pages and calls data endpoints and returns the results. A free allowance of $1 a month is included with a Northlight account."},{name:"device",concept:"The person's own Mac",description:"Use the person's own signed-in browser, files and shell on their Mac",useWhen:"a task needs the person's own signed-in browser (their logged-in sites), their Messages, or their files and shell on their Mac",doesOnceSignedIn:"it runs on the person's Mac through the Northlight app: their own signed-in browser with ready-made functions for sites such as LinkedIn, Gmail and X, their Messages, and their files and shell. If the Northlight app is not on the Mac yet, the command that needs it says how to install it.",platforms:["darwin"]},{name:"sms",concept:"Text messages to the verified phone",description:"Text the person's verified phone",useWhen:"the person should receive a text message, such as a finished result or an alert",doesOnceSignedIn:"it sends a text message to the phone number the person verified with their Northlight account, and lists the texts sent."},{name:"phone",concept:"Phone calls placed by Northlight's AI voice",description:"Place a phone call with an AI voice and read what was said",useWhen:"the person wants a phone call placed for them, or the result of one",doesOnceSignedIn:"it places a phone call to a number the person gives, with an AI voice that follows their instructions, and returns the transcript and outcome of the call."},{name:"meetings",concept:"Meeting notes and transcripts",description:"Search and read the notes and transcripts of recorded meetings",useWhen:"a task depends on what was said or decided in a meeting the person recorded",doesOnceSignedIn:"it lists and searches the person's recorded meetings and returns their notes and transcripts."}];function a(e){return`If the task in hand needs \`crtr ${e}\`, tell the person in one or two sentences what it would do for that task, that signing in creates or uses a Northlight account, and that crtr's records will then be stored with Northlight. Ask once whether to sign in; on yes run \`crtr sys signin\` yourself. If they already said no to \`${e}\` in this conversation, do not ask again: say it needs an account and carry on without it. A no covers \`${e}\` only: when the person later needs a different Northlight command (\`integrations\`, \`search\`, \`device\`, \`sms\`, \`phone\`, \`meetings\`), run it or its \`-h\` and ask once for that one.`}s(a,"askOnce");function p(e){return{code:"needs_northlight_account",exit:d.USAGE,message:`\`crtr ${e.name}\` needs a Northlight account. Once signed in, ${e.doesOnceSignedIn} Sign in with \`crtr sys signin\`: it opens a Northlight page in the browser where the person creates an account or signs in and clicks Allow, then moves crtr's records (agents, documents, history) to that account.`,next:a(e.name)}}s(p,"refusalFor");function u(e){const t=p(e);return{summary:e.description,model:`Needs a Northlight account. Once signed in, ${e.doesOnceSignedIn} Without an account every \`crtr ${e.name}\` command only answers that it needs one; sign in with \`crtr sys signin\`. ${a(e.name)}`,refusal:t}}s(u,"renderPreview");function w(e,t){return l.filter(n=>(n.platforms===void 0||n.platforms.includes(e))&&!t.has(n.name)).map(n=>{const{summary:o,model:r,refusal:i}=u(n);return h({name:n.name,rootEntry:{concept:n.concept,desc:n.description,useWhen:n.useWhen},help:{name:n.name,summary:o,model:r},refusal:i,children:[]})})}s(w,"previewBranches");export{l as NORTHLIGHT_PREVIEWS,w as previewBranches,u as renderPreview};
|