@north-light/cli 0.3.781 → 0.3.783
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 +3 -3
- 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 +25 -3
- package/dist/builtin-memory/crouter-sdk/sourcing.md +94 -0
- package/dist/builtin-memory/insights/capture.md +2 -2
- package/dist/builtin-memory/internal/marketplaces.md +1 -1
- package/dist/builtin-memory/internal/storage-tiers.md +1 -1
- 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 -8
- package/dist/clients/attach/command.js +1 -1
- package/dist/clients/attach/input/capabilities.js +1 -1
- package/dist/clients/attach/viewer.js +524 -524
- 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/pkg/account-installs.d.ts +9 -0
- package/dist/commands/pkg/account-installs.js +1 -0
- package/dist/commands/profile/default.js +1 -1
- package/dist/commands/sys/setup-core.d.ts +1 -52
- package/dist/commands/sys/setup-core.js +6 -6
- package/dist/commands/sys/setup-wizard.d.ts +4 -9
- package/dist/commands/sys/setup-wizard.js +2 -1
- package/dist/commands/sys/setup.js +1 -1
- package/dist/commands/sys/signin.d.ts +1 -1
- package/dist/commands/sys/signin.js +6 -3
- package/dist/core/command.d.ts +1 -2
- package/dist/core/command.js +6 -6
- package/dist/core/grants/sync.js +1 -1
- package/dist/core/human/requests.d.ts +2 -0
- package/dist/core/human/requests.js +18 -18
- package/dist/core/ledger/check.d.ts +6 -2
- package/dist/core/ledger/check.js +1 -1
- package/dist/core/llm/run.js +2 -2
- 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/core/runtime/first-run-offer.d.ts +2 -6
- package/dist/core/runtime/first-run-offer.js +2 -10
- package/dist/core/runtime/front-door.js +8 -9
- package/dist/core/runtime/start-refusal-notice.d.ts +5 -0
- package/dist/core/runtime/start-refusal-notice.js +1 -0
- package/dist/core/scoped-state/seed-terminal-defaults.d.ts +2 -0
- package/dist/core/scoped-state/seed-terminal-defaults.js +1 -0
- package/dist/daemon/api/handlers/inbox.js +1 -1
- package/dist/daemon/api/router.js +1 -1
- package/dist/daemon/cron-run.js +2 -2
- package/dist/daemon/fleet.js +5 -5
- 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/daemon/reconcilers/node-lifecycle/freeze-lane.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 +25 -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/commands/sys/panels/plugin-env-panel.d.ts +0 -19
- package/dist/commands/sys/panels/plugin-env-panel.js +0 -2
- package/dist/commands/sys/panels/plugins-panel.d.ts +0 -16
- package/dist/commands/sys/panels/plugins-panel.js +0 -1
- package/dist/core/northlight/previews.d.ts +0 -22
- package/dist/core/northlight/previews.js +0 -1
- package/dist/core/runtime/front-door-login.d.ts +0 -2
- package/dist/core/runtime/front-door-login.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.783",
|
|
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.783",
|
|
31
|
+
"@north-light/identity": "0.3.783"
|
|
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.783",
|
|
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.783",
|
|
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.783",
|
|
32
|
+
"@north-light/plugin": "0.3.783",
|
|
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.783",
|
|
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.783",
|
|
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.783",
|
|
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.783",
|
|
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.783",
|
|
11927
|
+
"@north-light/identity": "0.3.783"
|
|
11928
11928
|
}
|
|
11929
11929
|
},
|
|
11930
11930
|
"packages/crouter-sdk": {
|
|
11931
11931
|
"name": "@north-light/sdk",
|
|
11932
|
-
"version": "0.3.
|
|
11932
|
+
"version": "0.3.783",
|
|
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.783",
|
|
11936
|
+
"@north-light/identity": "0.3.783",
|
|
11937
|
+
"@north-light/plugin": "0.3.783",
|
|
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,19 +0,0 @@
|
|
|
1
|
-
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
2
|
-
import type { SetupPluginEnvField } from '../setup-core.js';
|
|
3
|
-
/** Transient wizard input; only masked glyphs are rendered, and values go to the
|
|
4
|
-
* daemon app store after the wizard closes, before package installation. */
|
|
5
|
-
export declare class PluginEnvPanel implements SetupPanel {
|
|
6
|
-
private readonly existing;
|
|
7
|
-
private readonly onChange;
|
|
8
|
-
private fields;
|
|
9
|
-
private index;
|
|
10
|
-
private buffer;
|
|
11
|
-
private readonly entered;
|
|
12
|
-
constructor(existing: Set<string>, onChange: () => void);
|
|
13
|
-
setFields(fields: SetupPluginEnvField[]): void;
|
|
14
|
-
get values(): ReadonlyMap<string, string>;
|
|
15
|
-
badge(): string;
|
|
16
|
-
get complete(): boolean;
|
|
17
|
-
handleInput(data: string): boolean;
|
|
18
|
-
render(width: number): string[];
|
|
19
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var d=Object.defineProperty;var f=(h,e)=>d(h,"name",{value:e,configurable:!0});import{truncateToWidth as r}from"@earendil-works/pi-tui";import{theme as l,wrapText as a}from"../../../core/tui/panel.js";class x{static{f(this,"PluginEnvPanel")}existing;onChange;fields=[];index=0;buffer="";entered=new Map;constructor(e,t){this.existing=e,this.onChange=t}setFields(e){const t=e.filter(({name:s})=>!this.existing.has(s));if(!(this.fields.length===t.length&&this.fields.every((s,i)=>s.name===t[i]?.name))){const s=new Set(t.map(({name:i})=>i));for(const i of this.entered.keys())s.has(i)||this.entered.delete(i);this.index=0,this.buffer=""}this.fields=t,this.onChange()}get values(){return this.entered}badge(){return`${this.fields.length} keys`}get complete(){return this.index>=this.fields.length}handleInput(e){if(!this.fields.length||this.complete)return!1;if(e==="\r"||e===`
|
|
2
|
-
`)this.buffer&&this.entered.set(this.fields[this.index].name,this.buffer),this.buffer="",this.index=Math.min(this.index+1,this.fields.length);else if(e==="\x7F"||e==="\b")this.buffer=this.buffer.slice(0,-1);else{if(e===""||e==="\x1B")return!1;if(e.length>0&&!/[\x00-\x1f]/.test(e))this.buffer+=e;else return!1}return this.onChange(),!0}render(e){const t=[r(l.fg("accent",l.bold("Plugin credentials")),e)];if(!this.fields.length)return[...t,"No selected plugins need a new key."];t.push("Enter to save or skip each key. Values are never displayed.");for(const[n,s]of this.fields.entries()){const i=n===this.index?"\u25B6":" ",u=this.entered.has(s.name)?"\u2713 saved on finish":n<this.index?"skipped":"";if(t.push(r(`${i} ${s.name} (${s.plugin}) ${u}`,e)),n===this.index){for(const o of a(`${s.declaration.description}${s.declaration.url?` ${s.declaration.url}`:""}`,Math.max(1,e-4)))t.push(r(` ${o}`,e));t.push(r(s.declaration.secret===!1?` ${this.buffer}`:` ${"\u2022".repeat([...this.buffer].length)}`,e))}}return t}}export{x as PluginEnvPanel};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SetupPackageId, SetupPackageManifestEntry } from '../setup-core.js';
|
|
2
|
-
import { type SetupPanel } from '../../../core/tui/panel.js';
|
|
3
|
-
export declare class PluginsPanel implements SetupPanel {
|
|
4
|
-
private readonly manifest;
|
|
5
|
-
private readonly installedPackageIds;
|
|
6
|
-
private readonly onChange;
|
|
7
|
-
private readonly selectedPackageIds;
|
|
8
|
-
private index;
|
|
9
|
-
private expandedId;
|
|
10
|
-
constructor(manifest: SetupPackageManifestEntry[], installedPackageIds: Set<SetupPackageId>, onChange: () => void);
|
|
11
|
-
badge(): string;
|
|
12
|
-
get selected(): readonly SetupPackageManifestEntry[];
|
|
13
|
-
private current;
|
|
14
|
-
handleInput(data: string, matches?: (id: string, input: string) => boolean): boolean;
|
|
15
|
-
render(width: number): string[];
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var p=Object.defineProperty;var c=(a,e)=>p(a,"name",{value:e,configurable:!0});import{truncateToWidth as d}from"@earendil-works/pi-tui";import{theme as t,wrapText as I}from"../../../core/tui/panel.js";const l="crtr-extensions";class ${static{c(this,"PluginsPanel")}manifest;installedPackageIds;onChange;selectedPackageIds=new Set;index=0;expandedId=null;constructor(e,s,n){this.manifest=e,this.installedPackageIds=s,this.onChange=n;for(const i of e)this.selectedPackageIds.add(i.id)}badge(){const e=this.manifest.filter(s=>!this.installedPackageIds.has(s.id)).length;return e===0?`${this.manifest.length} \u2713`:`${e} pending`}get selected(){return this.manifest.filter(e=>this.selectedPackageIds.has(e.id))}current(){return this.manifest[this.index]}handleInput(e,s){if(s===void 0)return!1;if(s("crtr.setup.list-down",e))this.index=this.manifest.length===0?0:(this.index+1)%this.manifest.length;else if(s("crtr.setup.list-up",e))this.index=this.manifest.length===0?0:(this.index-1+this.manifest.length)%this.manifest.length;else if(s("crtr.setup.toggle",e)){const n=this.current();n&&n.id!==l&&(this.selectedPackageIds.has(n.id)?this.selectedPackageIds.delete(n.id):this.selectedPackageIds.add(n.id))}else if(s("crtr.setup.details",e)){const n=this.current();n&&(this.expandedId=this.expandedId===n.id?null:n.id)}else return!1;return this.onChange(),!0}render(e){const s=[d(t.fg("accent",t.bold("Plugins")),e),d(t.fg("muted","Everything is checked by default. Leave it all on unless you have a specific reason not to."),e)];for(const[n,i]of this.manifest.entries()){const r=n===this.index,h=this.selectedPackageIds.has(i.id)?t.fg("success","[x]"):t.fg("dim","[ ]"),f=r?t.fg("accent","\u25B6"):t.fg("dim"," "),o=r?t.fg("accent",i.name):i.name,g=i.id===l?` ${t.fg("dim","required")}`:"",u=this.installedPackageIds.has(i.id)?t.fg("success","\u2713 installed"):t.fg("warning","not installed");if(s.push(d(`${f} ${h} ${o}${g} ${t.fg("dim","\u2014")} ${t.fg("muted",i.shortDescription)} ${u}`,e)),this.expandedId===i.id)for(const m of I(i.longDescription,Math.max(1,e-4)))s.push(d(t.fg("dim",` ${m}`),e))}return s}}export{$ as PluginsPanel};
|
|
@@ -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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var u=Object.defineProperty;var r=(a,t)=>u(a,"name",{value:t,configurable:!0});import{CredentialSynchronizationError as l,LoginDialogComponent as d,OAuthSelectorComponent as p}from"@earendil-works/pi-coding-agent";import{execFile as f}from"node:child_process";import{dialogAuthInteraction as g}from"../auth-interaction.js";import{isManagedProvider as w}from"../managed-providers.js";import{daemonManagedLogin as y}from"../model-auth/daemon-login.js";import{cliClient as h}from"../../commands/api-client.js";import{runSetupSettingsProcess as C}from"../../commands/sys/setup-settings-runner.js";import{buildProviderCatalog as b}from"../../commands/sys/panels/provider-panel.js";function I(a){const t=process.platform==="darwin"?"open":process.platform==="win32"?"cmd":"xdg-open",e=process.platform==="win32"?["/c","start","",a]:[a];f(t,e,{timeout:5e3},()=>{})}r(I,"openBrowser");class L{static{r(this,"FrontDoorLogin")}tui;runtime;agentDir;finish;component;dialog;settled=!1;constructor(t,e,s,o,n){this.tui=t,this.runtime=e,this.agentDir=s,this.finish=n,this.component=new p("login",o,i=>this.startLogin(o.find(c=>c.id===i)),()=>this.complete(!1))}get focused(){return this.component.focused}set focused(t){this.component.focused=t}handleInput(t){this.component.handleInput?.(t)}invalidate(){this.tui.requestRender()}render(t){return this.component.render(t)}dispose(){this.settled||this.dialog?.handleInput("\x1B")}complete(t){this.settled||(this.settled=!0,this.finish(t))}startLogin(t){if(!t){this.complete(!1);return}const e=new d(this.tui,t.id,i=>this.complete(i),t.name);this.dialog=e,this.component=e,this.tui.setFocus(this),this.tui.requestRender();const s=g(e,{openBrowser:I,onChange:r(()=>this.tui.requestRender(),"onChange"),isActive:r(()=>!this.settled&&!e.signal.aborted,"isActive")}),o=r(()=>{e.signal.aborted||this.complete(!1)},"fail");if(t.authType==="api_key"){e.showPrompt(`Enter API key for ${t.name}:`,"sk-...").then(async i=>{if(!i.trim()||this.settled){this.complete(!1);return}await h().installCredential(t.id,{kind:"api_key",api_key:i.trim()}),this.complete(!0)}).catch(o);return}const n=t.id;if(w(n)){y(h(),n,s).then(()=>{this.settled||e.signal.aborted||this.complete(!0)}).catch(o);return}if(!this.runtime.getProvider(n)?.auth.oauth){this.complete(!1);return}this.runtime.login(n,"oauth",s).then(()=>this.complete(!0)).catch(i=>{if(i instanceof l){this.complete(!0);return}o()})}}async function R(){return await C(({tui:t,agentDir:e,runtime:s,registry:o},n)=>new L(t,s,e,b(s,o).map(({providerId:i,name:c,authType:m})=>({id:i,name:c,authType:m})),n.submit))===!0}r(R,"runFrontDoorLogin");export{R as runFrontDoorLogin};
|