@north-light/cli 0.3.782 → 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.
Files changed (45) hide show
  1. package/dist/api/contract.d.ts +1 -1
  2. package/dist/api/contract.js +1 -1
  3. package/dist/api/dto/charges.d.ts +3 -3
  4. package/dist/api/dto/charges.js +1 -1
  5. package/dist/builtin-memory/crouter-sdk/release-notes.md +6 -0
  6. package/dist/builtin-memory/internal/marketplaces.md +1 -1
  7. package/dist/builtin-memory/internal/storage-tiers.md +1 -1
  8. package/dist/cli.js +2 -8
  9. package/dist/clients/attach/viewer.js +526 -526
  10. package/dist/commands/pkg/account-installs.d.ts +9 -0
  11. package/dist/commands/pkg/account-installs.js +1 -0
  12. package/dist/commands/sys/setup-core.d.ts +1 -52
  13. package/dist/commands/sys/setup-core.js +6 -6
  14. package/dist/commands/sys/setup-wizard.d.ts +4 -9
  15. package/dist/commands/sys/setup-wizard.js +2 -1
  16. package/dist/commands/sys/setup.js +1 -1
  17. package/dist/commands/sys/signin.js +6 -3
  18. package/dist/core/grants/sync.js +1 -1
  19. package/dist/core/ledger/check.d.ts +6 -2
  20. package/dist/core/ledger/check.js +1 -1
  21. package/dist/core/llm/run.js +2 -2
  22. package/dist/core/runtime/first-run-offer.d.ts +2 -6
  23. package/dist/core/runtime/first-run-offer.js +2 -10
  24. package/dist/core/runtime/front-door.js +8 -9
  25. package/dist/core/runtime/start-refusal-notice.d.ts +5 -0
  26. package/dist/core/runtime/start-refusal-notice.js +1 -0
  27. package/dist/core/scoped-state/seed-terminal-defaults.d.ts +2 -0
  28. package/dist/core/scoped-state/seed-terminal-defaults.js +1 -0
  29. package/dist/daemon/cron-run.js +2 -2
  30. package/dist/daemon/fleet.js +5 -5
  31. package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +1 -1
  32. package/docs/sdk/release-notes.md +6 -0
  33. package/package.json +3 -3
  34. package/packages/crouter-api/dist/api/contract.js +1 -1
  35. package/packages/crouter-api/dist/api/dto/charges.js +1 -1
  36. package/packages/crouter-api/package.json +1 -1
  37. package/packages/crouter-identity/package.json +1 -1
  38. package/packages/crouter-plugin/package.json +3 -3
  39. package/runtime.lock.json +14 -14
  40. package/dist/commands/sys/panels/plugin-env-panel.d.ts +0 -19
  41. package/dist/commands/sys/panels/plugin-env-panel.js +0 -2
  42. package/dist/commands/sys/panels/plugins-panel.d.ts +0 -16
  43. package/dist/commands/sys/panels/plugins-panel.js +0 -1
  44. package/dist/core/runtime/front-door-login.d.ts +0 -2
  45. package/dist/core/runtime/front-door-login.js +0 -1
@@ -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,2 +0,0 @@
1
- /** Open pi's provider picker and LoginDialogComponent before a root broker starts. */
2
- export declare function runFrontDoorLogin(): Promise<boolean>;
@@ -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};