@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
|
@@ -36,7 +36,7 @@ Write the proposal as a small document with `crtr doc write` and submit it with
|
|
|
36
36
|
- <Another plausible formulation only when the deeper principle is uncertain.>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
`destination` and `visibility` are proposals to approve, never questions to ask: decide both and state the reason. Quote only enough of the user's words in `source` for them to judge the inference. Candidate bullets are hypotheses, not polished prose: several alternatives are allowed when the deeper principle is uncertain; do not pad, explain every bullet, or hide uncertainty in a long essay.
|
|
39
|
+
`destination` and `visibility` are proposals to approve, never questions to ask: decide both and state the reason. Quote only enough of the user's words in `source` for them to judge the inference; quotes belong there and nowhere else. Write each candidate bullet as a general truth with no literal examples — no quotes of the user, no specific UI strings or names, no episode details — because a principle must apply broadly, and a later agent cannot make sense of an example from an episode it never saw. Candidate bullets are hypotheses, not polished prose: several alternatives are allowed when the deeper principle is uncertain; do not pad, explain every bullet, or hide uncertainty in a long essay.
|
|
40
40
|
|
|
41
41
|
The review is asynchronous. Continue unrelated work or wait dormant, but do not finish while this review is outstanding. An approval settles only this candidate; do not recapture it as a new insight unless the user introduces a genuinely separate principle.
|
|
42
42
|
|
|
@@ -44,6 +44,6 @@ The review is asynchronous. Continue unrelated work or wait dormant, but do not
|
|
|
44
44
|
|
|
45
45
|
Apply direct line edits and explicit comments. If feedback requires a materially new formulation, update the open review document or submit a replacement review; review the revised formulation before writing it. If no candidate survives, save nothing.
|
|
46
46
|
|
|
47
|
-
Run `crtr doc write -h` for the writing contract, then reach only the approved destination — `crtr doc write --owner <owner>` to create it, `crtr doc edit` to revise one that exists. A new principle is normally knowledge, and a preference only when its use is behavioral; give it no delivery rule unless review approves a boot rule. Keep its body to the approved truth, any material boundary, and the concise why. Update the selected active listener or organizing router with the canonical link without duplicating the principle.
|
|
47
|
+
Run `crtr doc write -h` for the writing contract, then reach only the approved destination — `crtr doc write --owner <owner>` to create it, `crtr doc edit` to revise one that exists. A new principle is normally knowledge, and a preference only when its use is behavioral; give it no delivery rule unless review approves a boot rule. Keep its body to the approved truth, any material boundary, and the concise why, with no literal examples from the episode. Update the selected active listener or organizing router with the canonical link without duplicating the principle.
|
|
48
48
|
|
|
49
49
|
Source context and agent reasoning stay only in the review document. Do not copy them into the principle's body or fields. Run `crtr doc lint` after every create or rewrite and fix every finding.
|
|
@@ -23,7 +23,7 @@ With no dependencies installed, `npx` downloads the newest published release of
|
|
|
23
23
|
| `npx @north-light/sdk register [--name <text>] [--scope <scope>]... [--logo <url>] [--justification <text>] [--redirect-uri <uri>]... [--issuer <url>]` | Run in a project made by `init`, after `login`: registers the app with the public key from `local/app-key.json`, adds each `--scope` beyond `crtr:llm crtr:act`, and writes `CROUTER_CLIENT_ID` and `CROUTER_ISSUER` to `local/app.env`. | No |
|
|
24
24
|
| `npx @north-light/sdk apps <leaf> [--app <client id>] [--issuer <url>] [leaf flags] [--json]` | Call one app-management leaf with the login and print its answer as JSON. Leaves: `mine`, `get`, `update`, `set-logo --file <path>`, `set-brand-color --color <#rrggbb|none>`, `set-redirect-uris`, `asks`, `set-scopes`, `set-requires`, `set-run-notice-url`, `keys list\|add\|retire\|delete\|set-jwks-uri\|remove-jwks-uri`, `testers list\|add\|remove`. `--app` defaults to `CROUTER_CLIENT_ID` in `local/app.env`; `keys add` takes `--key-file <path>` and sends only the public half. Deleting an app, its marketplace listing, monthly spend cap, sharing and provider role are console-only: those leaves exit 1 and name the console page, with no request. | No |
|
|
25
25
|
|
|
26
|
-
`keygen` and `env` are the only commands that can call `crtr`, and only with `--app`. The rest of this site never uses `--app`, so crtr is optional
|
|
26
|
+
`keygen` and `env` are the only commands that can call `crtr`, and only with `--app`. The rest of this site never uses `--app`, so crtr is optional. `login`, `logout`, `whoami`, `register` and `apps` call only the Northlight directory.
|
|
27
27
|
|
|
28
28
|
## Details
|
|
29
29
|
|
|
@@ -8,7 +8,7 @@ when-and-why-to-read: When you need Use your coding agent, this knowledge should
|
|
|
8
8
|
|
|
9
9
|
# Use your coding agent
|
|
10
10
|
|
|
11
|
-
The `northlight` skill teaches a coding agent the whole path in the [[northlight-apps/quickstart]]: the commands, the code patterns and the rules. With it, your agent signs you up, logs in, registers the app and runs it, and you choose **Allow** twice in your browser: once on the login page, once on the app's consent page. `npx @north-light/sdk init` installs it into your project. The skill needs no account to install, and works
|
|
11
|
+
The `northlight` skill teaches a coding agent the whole path in the [[northlight-apps/quickstart]]: the commands, the code patterns and the rules. With it, your agent signs you up, logs in, registers the app and runs it, and you choose **Allow** twice in your browser: once on the login page, once on the app's consent page. `npx @north-light/sdk init` installs it into your project. The skill needs no account to install, and works on any machine.
|
|
12
12
|
|
|
13
13
|
## Install it
|
|
14
14
|
|
|
@@ -45,7 +45,7 @@ Then pick what your app does from the sections in the sidebar: [[northlight-apps
|
|
|
45
45
|
|
|
46
46
|
## Run `crtr cloud apps` yourself
|
|
47
47
|
|
|
48
|
-
Everything on this site works with the SDK's own commands and the web console.
|
|
48
|
+
Everything on this site works with the SDK's own commands and the web console. You can also sign your Mac in to your Northlight account with the `crtr` CLI and manage your apps with `crtr cloud apps`. The agents that run commands there run on Northlight; your Mac is a machine they can use.
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
51
|
npm i -g @north-light/cli@latest
|
|
@@ -53,4 +53,4 @@ crtr sys signin
|
|
|
53
53
|
crtr cloud apps mine
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
`crtr sys signin` asks you to approve once in your browser. The
|
|
56
|
+
`crtr sys signin` asks you to approve once in your browser. The CLI is [`@north-light/cli`](https://www.npmjs.com/package/@north-light/cli) on npm.
|
|
@@ -10,7 +10,7 @@ when-and-why-to-read: When you need Watchable objects, this knowledge should be
|
|
|
10
10
|
|
|
11
11
|
`PostgresObjectStore` from `@north-light/sdk/stores/postgres` keeps one canvas object per person for each thing in your app (a problem, a ticket, a workspace), links the person's nodes to it, and delivers events to it from a database outbox. An agent that runs `crtr <your-plugin> thing watch T-12` then receives the events you publish for T-12.
|
|
12
12
|
|
|
13
|
-
Your app declares the object kinds and their events in its plugin with `definePlugin({objectKinds})
|
|
13
|
+
Your app declares the object kinds and their events in its plugin with `definePlugin({objectKinds})`. The store registers objects of those kinds. Install `pg` in your app.
|
|
14
14
|
|
|
15
15
|
## Create the tables
|
|
16
16
|
|
|
@@ -44,6 +44,6 @@ The person's AI subscription pays for model calls, and what your app may do on t
|
|
|
44
44
|
|
|
45
45
|
## What you operate
|
|
46
46
|
|
|
47
|
-
You operate your server, its sessions, its database and its `ConnectionStore`. You register the app in the console and keep its key pair. Northlight operates the directory and the runtimes; you do not run either, and there is no local Northlight to start.
|
|
47
|
+
You operate your server, its sessions, its database and its `ConnectionStore`. You register the app in the console and keep its key pair. Northlight operates the directory and the runtimes; you do not run either, and there is no local Northlight to start.
|
|
48
48
|
|
|
49
49
|
The directory's discovery document at `https://account.northlight.ai/.well-known/openid-configuration` lists the endpoints, the `S256` PKCE method and `private_key_jwt` as the only token authentication method.
|
|
@@ -57,11 +57,8 @@ A group's `who` says who may be granted it: `own` (only your own app), `user` (t
|
|
|
57
57
|
|
|
58
58
|
## Guides
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
The plugin kit `@north-light/plugin` adds commands to the Northlight runtime.
|
|
61
61
|
|
|
62
62
|
| Page | What it covers |
|
|
63
63
|
|---|---|
|
|
64
|
-
| [Plugin docs](https://crouter.docs.northlight.ai/docs/plugin) | What `@north-light/plugin` does and how a plugin is installed |
|
|
65
|
-
| [Commands](https://crouter.docs.northlight.ai/docs/plugin/commands) | Branches, leaves, parameters, outputs, groups and `who` |
|
|
66
|
-
| [Deploying](https://crouter.docs.northlight.ai/docs/plugin/deploying) | `auth: {issuer, audience, providerId}`, `ctx.caller`, versions and breaking changes |
|
|
67
64
|
| [[northlight-apps/guides/manage-your-app]] | The console's **Provider** tab beside the others |
|
|
@@ -11,7 +11,7 @@ when-and-why-to-read: When you need Quick setup, this knowledge should be read
|
|
|
11
11
|
npx @north-light/sdk@latest init my-app
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
This command creates a small Node server, a signing key and an env file. About ten minutes later you have an app on your laptop that signs you in with Northlight, starts an agent run on your own Northlight runtime, and texts your phone. The app runs on your machine and talks to Northlight's production directory at `https://account.northlight.ai`. There is no local Northlight stack to run.
|
|
14
|
+
This command creates a small Node server, a signing key and an env file. About ten minutes later you have an app on your laptop that signs you in with Northlight, starts an agent run on your own Northlight runtime, and texts your phone. The app runs on your machine and talks to Northlight's production directory at `https://account.northlight.ai`. There is no local Northlight stack to run.
|
|
15
15
|
|
|
16
16
|
You need Node.js 20.6 or later (the start command uses `--env-file`) and a phone that can receive iMessage. The server was run on Node 20.6, 20.20, 22.14, 22.22 and 26.12.
|
|
17
17
|
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var R=Object.defineProperty;var n=(r,o)=>R(r,"name",{value:o,configurable:!0});import"./suppress-experimental-warnings.js";import{mkdirSync as _,openSync as
|
|
2
|
+
var R=Object.defineProperty;var n=(r,o)=>R(r,"name",{value:o,configurable:!0});import"./suppress-experimental-warnings.js";import{mkdirSync as _,openSync as I,readFileSync as b,renameSync as E,rmSync as C,statSync as u,writeFileSync as k}from"node:fs";import{dirname as g,join as s}from"node:path";import{enableCompileCache as O}from"node:module";import{fileURLToPath as h}from"node:url";import{isDaemonControlInvocation as m,isJoinInvocation as A,isPkgInstallInvocation as $,isSignInInvocation as N,personOnlyInvocation as P,resolveDaemonControlRoot as x,resolveRoot as T}from"./build-root.js";import{maybeBootRoot as F}from"./core/runtime/front-door.js";import{maybeAutoUpdate as D}from"./core/auto-update.js";import{ensureProjectScope as j}from"./core/bootstrap.js";import{provisionExports as U,pruneLegacyExports as B}from"./core/host-exports/export.js";import{revalidateBundlePlugins as L}from"./core/command-plugins/revalidate.js";import{runCli as M}from"./core/command.js";import{dispatchWithStaleRecovery as J}from"./core/manifest-recovery.js";import{installStdoutErrorPolicy as K}from"./core/stdout-errors.js";import{handle as V}from"./core/io.js";import{CrtrError as w,ownerOnly as G}from"./core/errors.js";import{runtimeRoot as W}from"./core/layout.js";import{ApiError as v}from"./api/index.js";import{mark as i}from"./core/timing.js";import{launchSnapshotFile as q,providerProjectionOverBrokerRelay as y,sandboxCliNodeId as z}from"./shared/env.js";import{nodeRunDir as f}from"./core/canvas/paths.js";import{installBrokerConfigSnapshot as H}from"./core/config.js";I(h(import.meta.url),"r"),K(),i("cli.entry",{cmd:process.argv[2]??"(bare)"});try{O()}catch{}i("cli.compile_cache");const Q=s(g(h(import.meta.url)),".."),l=s(W(),"first-run.json");function a(r){return(r instanceof Error?r.message:String(r)).split(/\r?\n/,1)[0]??""}n(a,"errorMessage");function X(r){const o=g(l);_(o,{recursive:!0});const t=`${l}.${process.pid}.${Date.now()}.tmp`;try{k(t,JSON.stringify({packageVersion:r,completedAt:new Date().toISOString()})+`
|
|
3
3
|
`,"utf8"),E(t,l)}finally{C(t,{force:!0})}}n(X,"writeFirstRunMarker");async function Y(){if(process.env.CRTR_NO_AUTO_INIT==="1")return;try{if(u(l,{throwIfNoEntry:!1})!==void 0)return}catch(o){process.stderr.write(`crtr: first-run reconcile marker check failed: ${a(o)}
|
|
4
4
|
`);return}try{if(u(s(Q,".git"),{throwIfNoEntry:!1})!==void 0)return}catch(o){process.stderr.write(`crtr: first-run reconcile source check failed: ${a(o)}
|
|
5
5
|
`);return}let r;try{const{reconcileFirstRun:o}=await import("./commands/sys/setup-core.js");r=await o((t,c)=>{process.stderr.write(`crtr: first-run reconcile ${t} failed: ${a(c)}
|
|
6
6
|
`)})}catch(o){process.stderr.write(`crtr: first-run reconcile failed: ${a(o)}
|
|
7
7
|
`)}finally{if(r!==void 0)try{X(r)}catch(o){process.stderr.write(`crtr: first-run reconcile marker failed: ${a(o)}
|
|
8
|
-
`)}}}n(Y,"maybeReconcileFirstRun");async function Z(){const r=z(),o=r!==void 0;if(r!==void 0){process.env.CRTR_API_SOCKET=s(f(r),"cli.sock");const e=
|
|
8
|
+
`)}}}n(Y,"maybeReconcileFirstRun");async function Z(){const r=z(),o=r!==void 0;if(r!==void 0){process.env.CRTR_API_SOCKET=s(f(r),"cli.sock");const e=P(process.argv);if(e!==null)throw G(`crtr ${e} is not available to an app's node`,"Run this command from the person's terminal.");const p=JSON.parse(b(q(f(r))??s(f(r),"broker-launch.json"),"utf8"));if(!p.configSnapshot)throw new Error("node launch is missing its config snapshot");H(p.configSnapshot)}const t=n(async()=>(await import("./core/scoped-state/person-store.js")).installPreludeSnapshot({profiles:[],defaults:{},settings:{},state:{},apps:{}}),"installEmptySettings");if(!o&&(await import("./commands/api-client.js")).usesRunToken())await t();else if(!o&&!y()&&(await import("./daemon/machine-link/config.js")).computerIsNotSignedIn()&&!m(process.argv))await t();else if((!o||$(process.argv))&&!m(process.argv)&&!A(process.argv)&&!N(process.argv)){try{o||await(await import("./commands/daemon-generation.js")).assertLocalDaemonMatchesCli(),await(await import("./commands/person-settings.js")).loadPersonSettingsViaApi(),o||await(await import("./core/scoped-state/imported-mac-installs.js")).migrateLegacyInstallsOnce()}catch(e){const p=process.argv.slice(2).some(d=>d==="-h"||d==="--help"),S=e instanceof v&&(e.code==="daemon_unavailable"||e.code==="northlight_unreachable")||e instanceof w&&(e.code==="daemon_generation_mismatch"||e.code==="not_signed_in"||e.code==="northlight_unreachable");if(!(p&&S))throw e;await t()}i("cli.settings_loaded")}if(o||(B(process.argv),y()||await Y()),await F(process.argv),i("cli.front_door_passed"),m(process.argv)){await M(await x(),process.argv);return}o||await L(process.argv),i("cli.plugins_revalidated");const c=await T(process.argv[2]);i("cli.root_resolved"),o||(U(c,process.argv),await j(process.argv),await D(process.argv)),i("cli.dispatch_start"),await J(c,process.argv),i("cli.dispatch_done")}n(Z,"main"),Z().catch(r=>{(r instanceof Error&&r.name==="AbortError"||r instanceof Error&&/operation was aborted/i.test(r.message))&&(process.stderr.write(`crtr: Interrupted
|
|
9
9
|
`),process.exit(130)),(r instanceof v||r instanceof w)&&(V(r),process.exit(typeof process.exitCode=="number"?process.exitCode:1));const t=r instanceof Error?r.message:String(r);process.stderr.write(`crtr: ${t}
|
|
10
10
|
`),process.exit(1)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var n=(t,e)=>c(t,"name",{value:e,configurable:!0});import{defineBranch as h,defineLeaf as l}from"../../core/command.js";import{mark as
|
|
1
|
+
var c=Object.defineProperty;var n=(t,e)=>c(t,"name",{value:e,configurable:!0});import{defineBranch as h,defineLeaf as l}from"../../core/command.js";import{mark as o}from"../../core/timing.js";function v(t){return l({name:"to",description:"attach an interactive terminal viewer to a node (reviving it if dormant)",whenToUse:"you want to WATCH or DRIVE a headless node live in this pane \u2014 it connects over the node's unix socket to the broker hosting the engine and renders the same chat stream. Attaches are writable by default, remote ones included (a remote canvas admits a writer only with message permission on the node); use --observer for read-only. A DORMANT node is revived first: crtrd runs reviveNode server-side, then the viewer streams over the broker's socket. The configured detach shortcuts leave the engine running",help:{name:`${t} attach to`,summary:"attach a terminal viewer to a headless node's running broker (writable by default, --observer for read-only); configured detach shortcuts leave the engine running",params:[{kind:"positional",name:"node",required:!0,constraint:"Node id to attach to. A dormant node is revived (server-side) before the viewer connects."},{kind:"flag",name:"observer",type:"bool",required:!1,default:!1,constraint:"Attach READ-ONLY: request the observer role (needs only read permission). Default attaches, local or --canvas, request the writable controller role."},{kind:"flag",name:"canvas",type:"string",required:!1,constraint:"Attach against a remote canvas target configured via `crtr canvas config add` instead of the default account canvas \u2014 connects over a relayed WebSocket to the target's preview endpoint using the relay token from the 0600 secrets store. A remote attach is writable by default and needs message permission on the node; with read permission only, the attach is refused and --observer is required. Omit for the default: connects to the node's local unix socket on THIS computer, for a node whose broker runs here. Does NOT honor `crtr canvas use` \u2014 this flag is the only way to attach remotely."}],output:[{name:"note",type:"string",required:!1,constraint:"Only set on the non-TTY/piped path (a static notice); the interactive path returns nothing."}],outputKind:"object",effects:["Takes over the current pane in raw mode and renders the node's live engine stream until you use a configured detach shortcut or the broker exits.","As a writable controller: sends prompts/steers/dialog answers to the engine over the socket. As observer: read-only. Multiple writable viewers may drive the same broker.","A dormant node is revived server-side (crtrd runs reviveNode) before the viewer connects; this LOCAL process NEVER spawns pi and NEVER writes the session \u2014 it holds only a socket to the broker.","Outside a TTY (piped): prints a short notice and exits 0 \u2014 attach is an interactive program, not a pipe stage."]},run:n(async e=>{const r=e.node,a=e.observer??!1,s=e.canvas,i=process.env.CRTR_ATTACH_WAKE_PARKED!=="0";if(delete process.env.CRTR_ATTACH_WAKE_PARKED,!process.stdout.isTTY)return{note:`crtr surface attach is an interactive terminal viewer \u2014 run it in a tmux pane (a TTY), not a pipe. Node: ${r}`};o("viewer.bundle_import_start");const{runAttach:d}=await import("./viewer.js");o("viewer.bundle_loaded"),await d(r,a,s,i),process.exit(process.exitCode??0)},"run"),render:n(e=>e.note!==void 0?String(e.note):"","render")})}n(v,"attachToLeaf");function w(t,e){return h({name:"attach",description:"a terminal viewer for a headless node \u2014 connect over its socket and drive (or watch) the live engine",whenToUse:"you want to open a headless node live in this pane \u2014 watch its engine stream and drive it by typing, without the node ever running pi in your window. A dormant node is revived server-side (crtrd runs reviveNode) before the viewer connects over a unix socket; this local process never starts the engine itself. Configured detach shortcuts leave the engine running.",tier:e,rootEntry:{concept:"a terminal viewer for a headless node \u2014 connect over its socket and drive (or watch) the live engine",desc:"attach a terminal viewer to a headless node",useWhen:"you want to open a headless node live in this pane \u2014 watch its engine stream and drive it by typing, without the node ever running pi in your window. A dormant node is revived server-side (crtrd runs reviveNode) before the viewer connects over a unix socket; this local process never starts the engine itself. Configured detach shortcuts leave the engine running."},help:{name:`${t} attach`,summary:"attach a terminal viewer to a headless node's running broker",model:`The branch opens a viewer in the current pane. A TTY is required; piped invocation prints a notice and exits. Attaches request the writable controller role, local or --canvas; --observer is read-only. Multiple writable viewers may watch and drive one broker. Configured detach shortcuts detach cleanly and the engine runs on. A dormant node is revived server-side (crtrd runs reviveNode) before the viewer connects. If the broker exits, the viewer holds the pane and auto-reconnects \u2014 through a yield/refresh relaunch, and across dormancy until the node wakes again \u2014 reporting "broker gone" and exiting only when the node is terminal (done/dead/canceled) or deleted. This local process NEVER spawns pi or writes the session \u2014 it holds only a socket to the broker. --canvas <name> is the escape hatch for a node hosted on a different machine's canvas \u2014 see the leaf's own -h.`},children:[v(t)]})}n(w,"registerAttach");export{w as registerAttach};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=Object.defineProperty;var n=(e,s)=>o(e,"name",{value:s,configurable:!0});function
|
|
1
|
+
var o=Object.defineProperty;var n=(e,s)=>o(e,"name",{value:s,configurable:!0});function u(e){const s=e.remote,t=e.role,a=new Set;return s||(a.add("local-canvas-inspect"),a.add("canvas-inbox")),t==="controller"&&(a.add("engine-drive"),a.add("dequeue")),t==="controller"&&!s&&(a.add("wake-dormant"),a.add("auth"),a.add("canvas-resume"),a.add("local-host")),{role:t,remote:s,get nodeId(){return e.nodeId},profileId:e.profileId,permittedOperations:a,permits:n(r=>a.has(r),"permits"),refusal:n((r,i)=>{const c=i===void 0?"":`/${i} `;if(e.isBrokerOffline?.()===!0&&(r==="engine-drive"||r==="dequeue"||r==="auth"))return`${c}needs a live broker; this node is parked \u2014 submit a message to wake it`;if(!a.has(r))return s&&(r==="canvas-resume"||r==="local-canvas-inspect"||r==="canvas-inbox")?`${c}Not available with --canvas because it acts on this computer`:s&&t==="controller"?`${c}Not available with --canvas because it acts on this machine, not the remote node`:`${c}is not available to a read-only observer attach (--observer) \u2014 it would drive this node`},"refusal")}}n(u,"createViewerCapabilities");function l(e){switch(e.type){case"prompt":case"steer":case"follow_up":case"abort":case"bash":case"set_model":case"cycle_model":case"cycle_ladder":case"cycle_thinking":case"set_thinking_level":case"set_auto_retry":case"set_auto_compaction":case"compact":case"new_session":case"switch_session":case"fork":case"set_session_name":case"navigate_tree":case"reload":case"export":case"clone":case"share":case"reload_auth":return"engine-drive";default:return}}n(l,"viewerOperationForFrame");function f(e,s,t){if(t)switch(e){case"resume":return"canvas-resume";case"context":case"node-metadata":return"local-canvas-inspect";case"plugins":return;case"inbox":return"canvas-inbox";case"clear":case"resume-session":case"tutorial":return"engine-drive";case"recover":case"promote":case"rename":case"mcp":return"local-host";default:return}if(s)switch(e){case"copy":case"session":case"changelog":case"hotkeys":case"quit":return;case"login":case"logout":return"auth";default:return"engine-drive"}}n(f,"viewerOperationForSlash");export{u as createViewerCapabilities,l as viewerOperationForFrame,f as viewerOperationForSlash};
|