@north-light/cli 0.3.722 → 0.3.723
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/dist/builtin-memory/internal/plugins.md +3 -3
- package/dist/clients/attach/viewer.js +281 -281
- package/dist/commands/pkg/browse/model.d.ts +1 -1
- package/dist/commands/profile/environment.js +2 -2
- package/dist/commands/sys/setup-core.d.ts +1 -1
- package/dist/commands/sys/setup-core.js +6 -6
- package/dist/commands/sys/setup.js +1 -1
- package/dist/core/environment-starter-script.d.ts +1 -0
- package/dist/core/environment-starter-script.js +58 -0
- package/dist/core/preview-registry.js +3 -3
- package/package.json +3 -3
- package/packages/crouter-api/dist/commands/pkg/browse/model.js +1 -1
- package/packages/crouter-api/dist/commands/profile/environment.js +23 -5
- package/packages/crouter-api/dist/commands/sys/setup-core.js +2 -10
- package/packages/crouter-api/dist/commands/sys/setup.js +1 -1
- package/packages/crouter-api/dist/core/environment-starter-script.js +61 -0
- package/packages/crouter-api/dist/core/preview-registry.js +1 -5
- 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
|
@@ -64,7 +64,7 @@ export interface CommandNode {
|
|
|
64
64
|
streaming: boolean;
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
/** `crtr
|
|
67
|
+
/** `crtr capture shot` — how a user types the command a node names. The one place
|
|
68
68
|
* a command path becomes a label, so no corner of the page invents its own. */
|
|
69
69
|
export declare function commandLabel(node: CommandNode): string;
|
|
70
70
|
/** Every node in a command forest, parents before their children. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var g=Object.defineProperty;var
|
|
2
|
-
`)}:{},...
|
|
1
|
+
var g=Object.defineProperty;var n=(e,r)=>g(e,"name",{value:r,configurable:!0});import{readFileSync as y}from"node:fs";import{resolve as w}from"node:path";import{defineLeaf as s,defineBranch as b}from"../../core/command.js";import{usage as c}from"../../core/errors.js";import{cliClient as m}from"../api-client.js";import{STARTER_SETUP_SCRIPT as v}from"../../core/environment-starter-script.js";import{resolveProfileViaDaemon as d}from"./daemon-profiles.js";const u={kind:"flag",name:"profile",type:"string",required:!0,constraint:"Profile id or manifest name; a close-enough name resolves to the nearest profile, reported on stderr."},h=[{name:"profile_id",type:"string",required:!0,constraint:"Stable profile id."},{name:"repositories",type:"string[]",required:!0,constraint:"`owner/name` in checkout order; the first is where nodes start (`/work/<name>`)."},{name:"setup_script",type:"string",required:!1,constraint:"The script the image build runs; null when none."},{name:"pi_packages",type:"string",required:!1,constraint:"pi package sources, one per line; null when none."},{name:"memory_mb",type:"number",required:!0,constraint:"Memory of new sandboxes: 2048, 4096 or 8192."},{name:"allow_pull_request_write",type:"boolean",required:!0,constraint:"Whether sandboxes may open and merge pull requests: their GitHub credential carries pull_requests write besides contents write. On by default."},{name:"recipe_revision",type:"number",required:!0,constraint:"Raised by one each time the recipe changes."},{name:"image_revision",type:"number",required:!1,constraint:"The recipe revision the current image was built from; the image is ready when it equals recipe_revision. Null before the first build."},{name:"image_error",type:"string",required:!1,constraint:"Why the last image build failed; null when it did not."}];function f(e){const{environment_id:r,...t}=e;return t}n(f,"output");const k=s({name:"show",description:"show a cloud profile's recipe, memory and image state",whenToUse:"checking what a dev profile builds and runs in, or whether the image for its latest recipe is ready (`image_revision` equals `recipe_revision`).",help:{name:"profile environment show",summary:"a cloud profile's environment: repositories, setup script, pi packages, memory and image build state",params:[u],output:[...h],outputKind:"object",effects:["Read-only. Refuses a profile that does not run in a cloud environment."]},run:n(async e=>{const{id:r}=await d(e.profile);return f(await m().getProfileEnvironment(r))},"run")}),q=s({name:"starter",description:"print a commented starter setup script to copy and fill in",whenToUse:"writing the first setup script for a cloud profile, or looking up what the image build already does and where secrets go.",help:{name:"profile environment starter",summary:"print a commented starter setup script with example sections",params:[],output:[],outputKind:"object",effects:["Prints the script as-is to stdout: redirect it to a file (`> setup.sh`), edit it, pass it to `profile environment set --setup-script-file`. Read-only; changes no profile and builds no image."]},run:n(async()=>{process.stdout.write(v)},"run")}),_=s({name:"set",description:"change a cloud profile's repositories, setup script, pi packages, memory or pull request merging",whenToUse:"a dev profile needs other repositories, a setup script for its image, pi packages, or more memory. A flag left out keeps its value. For a first setup script, start from `crtr profile environment starter`.",help:{name:"profile environment set",summary:"change a cloud profile's environment recipe or memory",params:[u,{kind:"flag",name:"repo",type:"string",required:!1,repeatable:!0,constraint:"GitHub repository `owner/name` (repeat per repository); replaces the whole list. The GitHub App must be installed on each."},{kind:"flag",name:"setup-script-file",type:"path",required:!1,constraint:"File holding the setup script. The image build runs it once as root in `/work` on Alpine (apk), after checking out the repositories into `/work/<name>` and downloading every pnpm-lock.yaml repository's packages into a shared pnpm store; output lands in `/work/.crtr/setup.log`, and a non-zero exit stops sandboxes from starting. `crtr profile environment starter` prints a commented template."},{kind:"flag",name:"pi-package",type:"string",required:!1,repeatable:!0,constraint:"pi package source (repeat per package); replaces the whole list."},{kind:"flag",name:"allow-pull-request-write",type:"bool",required:!1,constraint:"On by default: sandboxes may open and merge pull requests (their GitHub credential carries pull_requests write). `--no-allow-pull-request-write` drops to contents write only, so sandboxes can push branches but not open pull requests. Takes effect on the next credential a sandbox fetches; builds no image."},{kind:"flag",name:"memory",type:"int",required:!1,constraint:"Sandbox memory in GB: 2, 4 or 8. Reaches sandboxes created after the change; a running sandbox keeps its memory."}],output:[...h],outputKind:"object",effects:["A changed recipe raises `recipe_revision`, and the daemon builds a new image for it; check `profile environment show`. A recipe identical to the stored one changes nothing.","Secrets never go in the setup script, because it is baked into the image: store them with `crtr profile env set <profile> --name <NAME>` and every sandbox gets them as environment variables."]},run:n(async e=>{const{id:r}=await d(e.profile),t=e.repo,a=e.setupScriptFile,o=e.piPackage,i=e.memory,p=e.allowPullRequestWrite;if(i!==void 0&&![2,4,8].includes(i))throw c("`--memory` is 2, 4 or 8 (GB).");const l={...t!==void 0&&t.length>0?{repositories:t}:{},...a!==void 0?{setup_script:y(w(a),"utf8")}:{},...o!==void 0&&o.length>0?{pi_packages:o.join(`
|
|
2
|
+
`)}:{},...i!==void 0?{memory_mb:i*1024}:{},...p!==void 0?{allow_pull_request_write:p}:{}};if(Object.keys(l).length===0)throw c("pass at least one of `--repo`, `--setup-script-file`, `--pi-package`, `--memory`, `--allow-pull-request-write`.");return f(await m().setProfileEnvironment(r,l))},"run")}),U=b({name:"environment",description:"a cloud profile's recipe (repositories, setup script, pi packages) and sandbox memory",whenToUse:"viewing or changing what a cloud dev profile's sandboxes are built from and how much memory they get.",help:{name:"profile environment",summary:"a cloud profile's environment recipe and memory",model:"A cloud profile runs its nodes in Blaxel sandboxes. Its environment holds the recipe the sandbox image is built from: repositories, a setup script and pi packages. Changing the recipe makes the daemon build a new image, and new sandboxes use it. Memory applies to new sandboxes only. The build always checks out the repositories into `/work/<name>`, installs git, gh, Node and pnpm, and downloads each pnpm repository's packages into a shared store; the setup script adds the rest (`starter` prints a template). API keys and other secrets live in `crtr profile env`, never in the recipe."},children:[k,q,_]});export{U as environmentBranch};
|
|
@@ -4,7 +4,7 @@ import { type TerminalConfigEdit } from './terminal-option.js';
|
|
|
4
4
|
export declare const OFFICIAL_MARKETPLACE_NAME = "crouter-official-marketplace";
|
|
5
5
|
export declare const OFFICIAL_MARKETPLACE_URL = "https://github.com/crouton-labs/crouter-official-marketplace.git";
|
|
6
6
|
export declare const OFFICIAL_MARKETPLACE_REF = "main";
|
|
7
|
-
export type SetupPackageId = 'official-marketplace' | 'crtr-extensions' | 'oauth-adapter' | 'capture-plugin' | '
|
|
7
|
+
export type SetupPackageId = 'official-marketplace' | 'crtr-extensions' | 'oauth-adapter' | 'capture-plugin' | 'dev-plugin';
|
|
8
8
|
/** `nerd-font` is not a command on PATH like the other two — it is an installed
|
|
9
9
|
* font face, detected by fontconfig/font-directory scan. The viewer renders
|
|
10
10
|
* every tool and command icon with Nerd Font codepoints, so without it a fresh
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var re=Object.defineProperty;var a=(e,t)=>re(e,"name",{value:t,configurable:!0});import{spawn as ie,spawnSync as se}from"node:child_process";import{homedir as x,tmpdir as ae}from"node:os";import{mkdtempSync as oe,rmSync as ce}from"node:fs";import{piAgentDir as P}from"../../core/runtime/package-health.js";import{basename as le,dirname as _,join as m,relative as ue,resolve as de}from"node:path";import{isDeepStrictEqual as w}from"node:util";import{BINDING_CATALOG as pe,normalizeGesture as fe,splitGestureExpression as he,inboxShortcut as me,resolveKeybindings as S}from"../../core/keybindings/index.js";import{runtimeManifest as ge}from"./shared.js";import{atomicWriteJson as ke,readJsonIfExists as ve,readJsonOrNull as L}from"../../core/fs-utils.js";import{resolveBundledPiCliPath as we}from"../../core/runtime/pi-cli.js";import{crtrVersion as xe}from"../../shared/crtr-version.js";import{installTmuxBindings as be}from"../../core/runtime/tmux-chrome.js";import{normalizeTmuxPassthrough as ye}from"../../core/config.js";import{detectNerdFont as Ie,nerdFontInstallCommand as Pe,createCurlPercentReader as Se,NERD_FONT_MANUAL_LINUX_COMMAND as Ce,NERD_FONT_SELECT_HINT as Ee}from"../../core/runtime/nerd-font.js";import{startProgressBar as Ae}from"../../core/runtime/progress-bar.js";import{ensureRenderer as $e,isRendererReady as K}from"../../core/termrender/termrender.js";import{installFromMarketplace as Re,isMarketplaceRelativeSource as De}from"../pkg/plugin-manage.js";import{requiredPluginEnv as Me}from"../../core/plugin-env.js";import{readPluginManifest as Ne}from"../../core/manifest.js";import{addMarketplace as j}from"../pkg/market-manage.js";import{clone as Te}from"../../core/git.js";import{readMarketplaceManifest as Oe}from"../../core/manifest.js";import{findPluginByName as F,findMarketplaceByName as C}from"../../core/resolver.js";import{expandTilde as _e}from"../../core/fs-utils.js";import{applyTerminalEdit as Le}from"./terminal-option.js";const E="crouter-official-marketplace",A="https://github.com/crouton-labs/crouter-official-marketplace.git",$="main";function It(e){const t=[],n=new Set,r=new Map;try{for(const o of e){if(o.sourceKind!=="marketplace-plugin")continue;const[l,c]=o.installSource.split("/");if(!l||!c)continue;const u=F(c,"user")?.manifest;let d=C(l,"user");if(!d&&!u&&l===E)try{let i=r.get(l);i||(i=oe(m(ae(),"crtr-setup-market-")),r.set(l,i),Te(A,m(i,"checkout"),{ref:$,depth:1}));const p=m(i,"checkout"),v=Oe(p);v&&(d={root:p,manifest:v})}catch{}const h=d?.manifest.plugins.find(i=>i.name===c)?.source,f=h&&De(h)?Ne(m(d.root,h))??u:u;if(f)for(const i of Me(f.env))n.has(i)||(n.add(i),t.push({name:i,plugin:c,declaration:f.env[i]}))}}finally{for(const o of r.values())ce(o,{recursive:!0,force:!0})}return t}a(It,"setupPluginEnvFields");function G(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}a(G,"isKeybindingsObject");function g(e){return G(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Array.isArray(n)?[...n]:n])):{}}a(g,"cloneKeybindings");class Pt{static{a(this,"SetupKeybindingsDraft")}expected;baseline;current;baselineInvalidRoot;invalidRoot;resolutionCache;expectedPassthrough;baselinePassthrough;currentPassthrough;constructor(t,n=void 0){this.expected=t,this.baseline=g(t),this.current=g(t),this.baselineInvalidRoot=t!==void 0&&!G(t)?t:void 0,this.invalidRoot=this.baselineInvalidRoot,this.expectedPassthrough=n,this.baselinePassthrough=ye(n),this.currentPassthrough=[...this.baselinePassthrough]}get dirty(){return!w(this.current,this.baseline)||!w(this.invalidRoot,this.baselineInvalidRoot)||!w(this.currentPassthrough,this.baselinePassthrough)}overrides(){return g(this.current)}expectedKeybindings(){return this.expected}tmuxPassthrough(){return[...this.currentPassthrough]}expectedTmuxPassthrough(){return this.expectedPassthrough}usesTmuxPassthrough(t){return this.currentPassthrough.includes(t)}toggleTmuxPassthrough(t){this.currentPassthrough=this.currentPassthrough.includes(t)?this.currentPassthrough.filter(n=>n!==t):[...this.currentPassthrough,t]}resolution(){return this.resolutionCache===void 0&&(this.resolutionCache=S(this.invalidRoot===void 0?this.current:this.invalidRoot)),this.resolutionCache}hasInvalidRoot(){return this.invalidRoot!==void 0}expression(t){return this.resolution().gestures(t).join(", ")}edit(t,n){if(this.invalidRoot!==void 0)return{ok:!1,diagnostics:[{severity:"error",code:"invalid-keybindings",offendingValue:this.invalidRoot,message:"Reset all before editing: the saved keybindings root is invalid."}]};const r=pe.find(f=>f.id===t);let o;try{o=n.trim()===""?[]:he(n).map(f=>fe(f.trim(),r))}catch(f){return{ok:!1,diagnostics:[{severity:"error",code:"invalid-override",bindingId:t,offendingValue:n,message:f instanceof Error?f.message:String(f)}]}}const l=[...new Set(o)],c={...this.current};delete c[t];const u=[...S(c).gestures(t)],s=w(l,u)?c:{...this.current,[t]:l},d=S(s),h=d.diagnostics.filter(f=>f.bindingId===t||f.relatedBindingIds?.includes(t));return h.length>0?{ok:!1,diagnostics:h}:(this.current=s,this.resolutionCache=void 0,{ok:!0,diagnostics:d.diagnostics})}unbind(t){return this.edit(t,"")}resetRow(t){delete this.current[t],this.resolutionCache=void 0}resetAll(){this.current={},this.currentPassthrough=[],this.invalidRoot=void 0,this.resolutionCache=void 0}discard(){this.current=g(this.baseline),this.currentPassthrough=[...this.baselinePassthrough],this.invalidRoot=this.baselineInvalidRoot,this.resolutionCache=void 0}markSaved(t,n=[]){this.expected=Object.keys(t).length===0?void 0:g(t),this.baseline=g(t),this.current=g(t),this.expectedPassthrough=[...n],this.baselinePassthrough=[...n],this.currentPassthrough=[...n],this.baselineInvalidRoot=void 0,this.invalidRoot=void 0,this.resolutionCache=void 0}}const Ke={"official-marketplace":{name:E,shortDescription:"the official crtr plugin catalog \u2014 registered as a source so its plugins are installable by ref.",longDescription:"Shallow-clones github.com/crouton-labs/crouter-official-marketplace into the user scope and registers it, which is what makes `crtr pkg plugin install crouter-official-marketplace/<name>` resolve and what fills `crtr pkg market browse`. Registering the source installs no plugin by itself. Uncheck it on a machine that should reach no external catalog \u2014 a plugin selected below still registers the marketplace it comes from, because its ref cannot resolve otherwise."},"crtr-extensions":{name:"pi-crtr-extensions",shortDescription:"crtr companion extensions \u2014 command palette, help gating, subscription/OAuth rotation, nested context.",longDescription:"Bundles the extensions built for crtr: a crtr slash-command palette, crtr/crouter help gating, surfacing of Claude Code marketplace plugin commands, nested AGENTS.md/CLAUDE.md loading, OAuth login + rotation across multiple Claude subscriptions (provider-rotation), and system-prompt trimming. The OAuth/rotation piece is what lets crtr authenticate your Claude account."},"oauth-adapter":{name:"pi-claude-oauth-adapter",shortDescription:"Anthropic OAuth / Claude Code credential compatibility for pi.",longDescription:"Third-party adapter (minzique/dotfiles-agents) letting pi authenticate with Claude using Claude Code OAuth credentials. Installed from npm, pinned to 0.2.2."},"capture-plugin":{name:"capture",shortDescription:"crtr plugin mounting `crtr capture` \u2014 browser automation and UI measurement over CDP.",longDescription:"Installs the `capture` plugin from the official crtr marketplace. It mounts `crtr capture` as a transparent passthrough to the external Capture CLI (`npm install -g @crouton-kit/capture`) for CDP screenshots, rendered-geometry measurement, HAR, accessibility trees, and JS execution against a live page. Uncheck it on a machine where agents never drive a browser \u2014 the command then costs nothing in their root prompt."},"exa-search-plugin":{name:"exa-search",shortDescription:"crtr plugin mounting `crtr exa-search` \u2014 public-web discovery, grounded answers, and content extraction.",longDescription:"Installs the `exa-search` plugin from the official crtr marketplace. It mounts `crtr exa-search` and calls Exa directly with EXA_API_KEY, collected during install or set through `crtr sys env set --name EXA_API_KEY` in the app env store. Uncheck it on a machine whose agents get web search from somewhere else, such as a Northlight home where the platform serves `crtr search` from its own plugin."},"dev-plugin":{name:"dev",shortDescription:"crtr plugin mounting the development workflow \u2014 repository setup, worktrees, pull requests, and a dev track in the tutorial.",longDescription:"Installs the dev plugin from the official crtr marketplace. It adds the /dev: workflow commands (init, spec, design, plan, pr-loop), mounts crtr dev for a repository's own lifecycle commands and Grove instances, and contributes the crtr sys tutorial dev track. Uncheck it on a machine whose agents do not work in source repositories."}},R={"official-marketplace":{kind:"marketplace-source",source:A},"crtr-extensions":{kind:"local-path",source:U("pi-crtr-extensions")},"oauth-adapter":{kind:"npm",source:"npm:pi-claude-oauth-adapter@0.2.2"},"capture-plugin":{kind:"marketplace-plugin",source:"crouter-official-marketplace/capture"},"exa-search-plugin":{kind:"marketplace-plugin",source:"crouter-official-marketplace/exa-search"},"dev-plugin":{kind:"marketplace-plugin",source:"crouter-official-marketplace/dev"}},B=["extensions/*.ts","extensions/*/index.ts","!extensions/**/*.d.ts"],je={"official-marketplace":[],"crtr-extensions":["pi-crtr-extensions"],"oauth-adapter":[],"capture-plugin":[],"exa-search-plugin":[],"dev-plugin":[]};function U(e){return m(ge.runtimeHome(),"selected","dist","builtin-pi-packages",e)}a(U,"selectedPiPackageDir");function D(e=U){return["official-marketplace","crtr-extensions","oauth-adapter","capture-plugin","exa-search-plugin","dev-plugin"].map(t=>{const n=Ke[t],r=R[t].kind==="local-path"?e(n.name):R[t].source;return{id:t,name:n.name,sourceKind:R[t].kind,installSource:r,shortDescription:n.shortDescription,longDescription:n.longDescription}})}a(D,"buildSetupManifest");function St(e){switch(e.sourceKind){case"marketplace-source":return`clone + register ${e.installSource}`;case"marketplace-plugin":return`crtr pkg plugin install ${e.installSource}`;default:return`pi install ${e.installSource}`}}a(St,"packagePlanAction");function Fe(e){if(!e.startsWith("npm:"))return null;const t=e.slice(4),n=t.startsWith("@")?t.indexOf("@",1):t.lastIndexOf("@");return n>0?t.slice(0,n):t}a(Fe,"npmPackageName");function b(e,t,n){const r=Fe(e);if(r!==null)return`npm:${r}`;const o=_e(e,n);return de(t,o)}a(b,"normalizePackageIdentity");function y(e){return`package:${e}`}a(y,"packageNameIdentity");function Y(e){return e.startsWith("npm:")?[]:[y(le(e))]}a(Y,"localPackageNameIdentities");function Ge(e,t,n){const r=[b(e.installSource,t,n)];if(e.sourceKind==="local-path"){r.push(y(e.name));for(const o of je[e.id])r.push(y(o))}return r}a(Ge,"manifestIdentities");function z(e,t=D(),n=m(P(),"settings.json"),r=x()){const o=_(n),l=new Set,c=new Map;for(const s of t)for(const d of Ge(s,o,r))c.set(d,s.id);const u=e&&typeof e=="object"?e.packages:void 0;if(!Array.isArray(u))return l;for(const s of u){const d=typeof s=="string"?s:s&&typeof s=="object"&&typeof s.source=="string"?s.source:null;if(d===null)continue;const h=[b(d,o,r),...Y(d)];for(const f of h){const i=c.get(f);if(i==="crtr-extensions"){const p=t.find(v=>v.id===i);if(b(d,o,r)!==b(p.installSource,o,r)||!s||typeof s!="object"||!w(s.extensions,B))continue}i!==void 0&&l.add(i)}}return l}a(z,"detectInstalledSetupPackageIds");function k(e){return se("sh",["-lc",`command -v ${e} >/dev/null 2>&1`],{stdio:"ignore"}).status===0}a(k,"detectCommandOnPath");function Be(e=process.platform,t=k){switch(e){case"darwin":return t("brew")?"brew":"manual";case"linux":return t("apt-get")?"apt-get":t("dnf")?"dnf":t("pacman")?"pacman":"manual";default:return"manual"}}a(Be,"detectPackageManager");function Ue(e,t,n=k){if(e==="nerd-font"?Ie().installed:n(e))return{tool:e,installed:!0,command:null,hint:"already installed",autoInstall:!1};if(e==="nerd-font"){const l=Pe(t);return{tool:e,installed:!1,command:l.command,hint:`${l.hint} \u2014 ${Ee}`,autoInstall:l.autoInstall}}const o=e==="nvim"?"neovim":"tmux";switch(t){case"brew":return{tool:e,installed:!1,command:`brew install ${o}`,hint:"Homebrew install",autoInstall:!0};case"apt-get":return{tool:e,installed:!1,command:`sudo apt-get update && sudo apt-get install -y ${o}`,hint:"apt-get install",autoInstall:!0};case"dnf":return{tool:e,installed:!1,command:`sudo dnf install -y ${o}`,hint:"dnf install",autoInstall:!0};case"pacman":return{tool:e,installed:!1,command:`sudo pacman -S --noconfirm ${o}`,hint:"pacman install",autoInstall:!0};default:return{tool:e,installed:!1,command:null,hint:`manual install required for ${e}`,autoInstall:!1}}}a(Ue,"buildSystemInstallPlan");function M(e=x()){return m(e===x()?P():m(e,".pi","agent"),"settings.json")}a(M,"resolveSettingsPath");function Ct(e={}){const t=e.homeDir??x(),n=e.settingsPath??M(t),r=e.manifest??D(),o=ve(n),l=z(o,r,n,t);for(const d of V(r))l.add(d);const c=e.commandExists??k,u=e.packageManager??Be(process.platform,c),s=["tmux","nvim","nerd-font"].map(d=>Ue(d,u,c));return{manifest:r,installedPackageIds:l,systemPlans:s}}a(Ct,"buildSetupInitialState");function Et(e){const t=e.manifest.map(r=>{const o=e.installedPackageIds.has(r.id)?"installed":"not installed";return`- ${r.name} \u2014 ${r.shortDescription} (${o})`}),n=e.systemPlans.map(r=>r.installed?`- ${r.tool}: \u2713 installed`:r.command?`- ${r.tool}: ${r.command}`:`- ${r.tool}: ${r.hint}`);return["crtr sys setup (non-interactive)","","Provider login: open the wizard in a TTY and use the Providers tab (same flow as /login) to authenticate a model provider.","","Packages:",...t,"","System deps:",...n,"",`Inbox: the inbox-toggle key (${me()??"disabled"}) is a crouter keybinding \u2014 view or rebind it in \`crtr sys settings\`; it is installed on the same tmux server as every other crouter binding.`,"Run `crtr sys setup` in a TTY to open the wizard."].join(`
|
|
1
|
+
var re=Object.defineProperty;var a=(e,t)=>re(e,"name",{value:t,configurable:!0});import{spawn as ie,spawnSync as se}from"node:child_process";import{homedir as w,tmpdir as ae}from"node:os";import{mkdtempSync as oe,rmSync as ce}from"node:fs";import{piAgentDir as I}from"../../core/runtime/package-health.js";import{basename as ue,dirname as _,join as h,relative as le,resolve as de}from"node:path";import{isDeepStrictEqual as b}from"node:util";import{BINDING_CATALOG as pe,normalizeGesture as fe,splitGestureExpression as me,inboxShortcut as he,resolveKeybindings as S}from"../../core/keybindings/index.js";import{runtimeManifest as ge}from"./shared.js";import{atomicWriteJson as ke,readJsonIfExists as ve,readJsonOrNull as L}from"../../core/fs-utils.js";import{resolveBundledPiCliPath as be}from"../../core/runtime/pi-cli.js";import{crtrVersion as we}from"../../shared/crtr-version.js";import{installTmuxBindings as ye}from"../../core/runtime/tmux-chrome.js";import{normalizeTmuxPassthrough as xe}from"../../core/config.js";import{detectNerdFont as Pe,nerdFontInstallCommand as Ie,createCurlPercentReader as Se,NERD_FONT_MANUAL_LINUX_COMMAND as Ce,NERD_FONT_SELECT_HINT as Ee}from"../../core/runtime/nerd-font.js";import{startProgressBar as $e}from"../../core/runtime/progress-bar.js";import{ensureRenderer as Ae,isRendererReady as K}from"../../core/termrender/termrender.js";import{installFromMarketplace as Re,isMarketplaceRelativeSource as De}from"../pkg/plugin-manage.js";import{requiredPluginEnv as Me}from"../../core/plugin-env.js";import{readPluginManifest as Te}from"../../core/manifest.js";import{addMarketplace as j}from"../pkg/market-manage.js";import{clone as Ne}from"../../core/git.js";import{readMarketplaceManifest as Oe}from"../../core/manifest.js";import{findPluginByName as F,findMarketplaceByName as C}from"../../core/resolver.js";import{expandTilde as _e}from"../../core/fs-utils.js";import{applyTerminalEdit as Le}from"./terminal-option.js";const E="crouter-official-marketplace",$="https://github.com/crouton-labs/crouter-official-marketplace.git",A="main";function Pt(e){const t=[],n=new Set,r=new Map;try{for(const o of e){if(o.sourceKind!=="marketplace-plugin")continue;const[u,c]=o.installSource.split("/");if(!u||!c)continue;const l=F(c,"user")?.manifest;let d=C(u,"user");if(!d&&!l&&u===E)try{let i=r.get(u);i||(i=oe(h(ae(),"crtr-setup-market-")),r.set(u,i),Ne($,h(i,"checkout"),{ref:A,depth:1}));const p=h(i,"checkout"),v=Oe(p);v&&(d={root:p,manifest:v})}catch{}const m=d?.manifest.plugins.find(i=>i.name===c)?.source,f=m&&De(m)?Te(h(d.root,m))??l:l;if(f)for(const i of Me(f.env))n.has(i)||(n.add(i),t.push({name:i,plugin:c,declaration:f.env[i]}))}}finally{for(const o of r.values())ce(o,{recursive:!0,force:!0})}return t}a(Pt,"setupPluginEnvFields");function G(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}a(G,"isKeybindingsObject");function g(e){return G(e)?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Array.isArray(n)?[...n]:n])):{}}a(g,"cloneKeybindings");class It{static{a(this,"SetupKeybindingsDraft")}expected;baseline;current;baselineInvalidRoot;invalidRoot;resolutionCache;expectedPassthrough;baselinePassthrough;currentPassthrough;constructor(t,n=void 0){this.expected=t,this.baseline=g(t),this.current=g(t),this.baselineInvalidRoot=t!==void 0&&!G(t)?t:void 0,this.invalidRoot=this.baselineInvalidRoot,this.expectedPassthrough=n,this.baselinePassthrough=xe(n),this.currentPassthrough=[...this.baselinePassthrough]}get dirty(){return!b(this.current,this.baseline)||!b(this.invalidRoot,this.baselineInvalidRoot)||!b(this.currentPassthrough,this.baselinePassthrough)}overrides(){return g(this.current)}expectedKeybindings(){return this.expected}tmuxPassthrough(){return[...this.currentPassthrough]}expectedTmuxPassthrough(){return this.expectedPassthrough}usesTmuxPassthrough(t){return this.currentPassthrough.includes(t)}toggleTmuxPassthrough(t){this.currentPassthrough=this.currentPassthrough.includes(t)?this.currentPassthrough.filter(n=>n!==t):[...this.currentPassthrough,t]}resolution(){return this.resolutionCache===void 0&&(this.resolutionCache=S(this.invalidRoot===void 0?this.current:this.invalidRoot)),this.resolutionCache}hasInvalidRoot(){return this.invalidRoot!==void 0}expression(t){return this.resolution().gestures(t).join(", ")}edit(t,n){if(this.invalidRoot!==void 0)return{ok:!1,diagnostics:[{severity:"error",code:"invalid-keybindings",offendingValue:this.invalidRoot,message:"Reset all before editing: the saved keybindings root is invalid."}]};const r=pe.find(f=>f.id===t);let o;try{o=n.trim()===""?[]:me(n).map(f=>fe(f.trim(),r))}catch(f){return{ok:!1,diagnostics:[{severity:"error",code:"invalid-override",bindingId:t,offendingValue:n,message:f instanceof Error?f.message:String(f)}]}}const u=[...new Set(o)],c={...this.current};delete c[t];const l=[...S(c).gestures(t)],s=b(u,l)?c:{...this.current,[t]:u},d=S(s),m=d.diagnostics.filter(f=>f.bindingId===t||f.relatedBindingIds?.includes(t));return m.length>0?{ok:!1,diagnostics:m}:(this.current=s,this.resolutionCache=void 0,{ok:!0,diagnostics:d.diagnostics})}unbind(t){return this.edit(t,"")}resetRow(t){delete this.current[t],this.resolutionCache=void 0}resetAll(){this.current={},this.currentPassthrough=[],this.invalidRoot=void 0,this.resolutionCache=void 0}discard(){this.current=g(this.baseline),this.currentPassthrough=[...this.baselinePassthrough],this.invalidRoot=this.baselineInvalidRoot,this.resolutionCache=void 0}markSaved(t,n=[]){this.expected=Object.keys(t).length===0?void 0:g(t),this.baseline=g(t),this.current=g(t),this.expectedPassthrough=[...n],this.baselinePassthrough=[...n],this.currentPassthrough=[...n],this.baselineInvalidRoot=void 0,this.invalidRoot=void 0,this.resolutionCache=void 0}}const Ke={"official-marketplace":{name:E,shortDescription:"the official crtr plugin catalog \u2014 registered as a source so its plugins are installable by ref.",longDescription:"Shallow-clones github.com/crouton-labs/crouter-official-marketplace into the user scope and registers it, which is what makes `crtr pkg plugin install crouter-official-marketplace/<name>` resolve and what fills `crtr pkg market browse`. Registering the source installs no plugin by itself. Uncheck it on a machine that should reach no external catalog \u2014 a plugin selected below still registers the marketplace it comes from, because its ref cannot resolve otherwise."},"crtr-extensions":{name:"pi-crtr-extensions",shortDescription:"crtr companion extensions \u2014 command palette, help gating, subscription/OAuth rotation, nested context.",longDescription:"Bundles the extensions built for crtr: a crtr slash-command palette, crtr/crouter help gating, surfacing of Claude Code marketplace plugin commands, nested AGENTS.md/CLAUDE.md loading, OAuth login + rotation across multiple Claude subscriptions (provider-rotation), and system-prompt trimming. The OAuth/rotation piece is what lets crtr authenticate your Claude account."},"oauth-adapter":{name:"pi-claude-oauth-adapter",shortDescription:"Anthropic OAuth / Claude Code credential compatibility for pi.",longDescription:"Third-party adapter (minzique/dotfiles-agents) letting pi authenticate with Claude using Claude Code OAuth credentials. Installed from npm, pinned to 0.2.2."},"capture-plugin":{name:"capture",shortDescription:"crtr plugin mounting `crtr capture` \u2014 browser automation and UI measurement over CDP.",longDescription:"Installs the `capture` plugin from the official crtr marketplace. It mounts `crtr capture` as a transparent passthrough to the external Capture CLI (`npm install -g @crouton-kit/capture`) for CDP screenshots, rendered-geometry measurement, HAR, accessibility trees, and JS execution against a live page. Uncheck it on a machine where agents never drive a browser \u2014 the command then costs nothing in their root prompt."},"dev-plugin":{name:"dev",shortDescription:"crtr plugin mounting the development workflow \u2014 repository setup, worktrees, pull requests, and a dev track in the tutorial.",longDescription:"Installs the dev plugin from the official crtr marketplace. It adds the /dev: workflow commands (init, spec, design, plan, pr-loop), mounts crtr dev for a repository's own lifecycle commands and Grove instances, and contributes the crtr sys tutorial dev track. Uncheck it on a machine whose agents do not work in source repositories."}},R={"official-marketplace":{kind:"marketplace-source",source:$},"crtr-extensions":{kind:"local-path",source:U("pi-crtr-extensions")},"oauth-adapter":{kind:"npm",source:"npm:pi-claude-oauth-adapter@0.2.2"},"capture-plugin":{kind:"marketplace-plugin",source:"crouter-official-marketplace/capture"},"dev-plugin":{kind:"marketplace-plugin",source:"crouter-official-marketplace/dev"}},B=["extensions/*.ts","extensions/*/index.ts","!extensions/**/*.d.ts"],je={"official-marketplace":[],"crtr-extensions":["pi-crtr-extensions"],"oauth-adapter":[],"capture-plugin":[],"dev-plugin":[]};function U(e){return h(ge.runtimeHome(),"selected","dist","builtin-pi-packages",e)}a(U,"selectedPiPackageDir");function D(e=U){return["official-marketplace","crtr-extensions","oauth-adapter","capture-plugin","dev-plugin"].map(t=>{const n=Ke[t],r=R[t].kind==="local-path"?e(n.name):R[t].source;return{id:t,name:n.name,sourceKind:R[t].kind,installSource:r,shortDescription:n.shortDescription,longDescription:n.longDescription}})}a(D,"buildSetupManifest");function St(e){switch(e.sourceKind){case"marketplace-source":return`clone + register ${e.installSource}`;case"marketplace-plugin":return`crtr pkg plugin install ${e.installSource}`;default:return`pi install ${e.installSource}`}}a(St,"packagePlanAction");function Fe(e){if(!e.startsWith("npm:"))return null;const t=e.slice(4),n=t.startsWith("@")?t.indexOf("@",1):t.lastIndexOf("@");return n>0?t.slice(0,n):t}a(Fe,"npmPackageName");function y(e,t,n){const r=Fe(e);if(r!==null)return`npm:${r}`;const o=_e(e,n);return de(t,o)}a(y,"normalizePackageIdentity");function x(e){return`package:${e}`}a(x,"packageNameIdentity");function z(e){return e.startsWith("npm:")?[]:[x(ue(e))]}a(z,"localPackageNameIdentities");function Ge(e,t,n){const r=[y(e.installSource,t,n)];if(e.sourceKind==="local-path"){r.push(x(e.name));for(const o of je[e.id])r.push(x(o))}return r}a(Ge,"manifestIdentities");function Y(e,t=D(),n=h(I(),"settings.json"),r=w()){const o=_(n),u=new Set,c=new Map;for(const s of t)for(const d of Ge(s,o,r))c.set(d,s.id);const l=e&&typeof e=="object"?e.packages:void 0;if(!Array.isArray(l))return u;for(const s of l){const d=typeof s=="string"?s:s&&typeof s=="object"&&typeof s.source=="string"?s.source:null;if(d===null)continue;const m=[y(d,o,r),...z(d)];for(const f of m){const i=c.get(f);if(i==="crtr-extensions"){const p=t.find(v=>v.id===i);if(y(d,o,r)!==y(p.installSource,o,r)||!s||typeof s!="object"||!b(s.extensions,B))continue}i!==void 0&&u.add(i)}}return u}a(Y,"detectInstalledSetupPackageIds");function k(e){return se("sh",["-lc",`command -v ${e} >/dev/null 2>&1`],{stdio:"ignore"}).status===0}a(k,"detectCommandOnPath");function Be(e=process.platform,t=k){switch(e){case"darwin":return t("brew")?"brew":"manual";case"linux":return t("apt-get")?"apt-get":t("dnf")?"dnf":t("pacman")?"pacman":"manual";default:return"manual"}}a(Be,"detectPackageManager");function Ue(e,t,n=k){if(e==="nerd-font"?Pe().installed:n(e))return{tool:e,installed:!0,command:null,hint:"already installed",autoInstall:!1};if(e==="nerd-font"){const u=Ie(t);return{tool:e,installed:!1,command:u.command,hint:`${u.hint} \u2014 ${Ee}`,autoInstall:u.autoInstall}}const o=e==="nvim"?"neovim":"tmux";switch(t){case"brew":return{tool:e,installed:!1,command:`brew install ${o}`,hint:"Homebrew install",autoInstall:!0};case"apt-get":return{tool:e,installed:!1,command:`sudo apt-get update && sudo apt-get install -y ${o}`,hint:"apt-get install",autoInstall:!0};case"dnf":return{tool:e,installed:!1,command:`sudo dnf install -y ${o}`,hint:"dnf install",autoInstall:!0};case"pacman":return{tool:e,installed:!1,command:`sudo pacman -S --noconfirm ${o}`,hint:"pacman install",autoInstall:!0};default:return{tool:e,installed:!1,command:null,hint:`manual install required for ${e}`,autoInstall:!1}}}a(Ue,"buildSystemInstallPlan");function M(e=w()){return h(e===w()?I():h(e,".pi","agent"),"settings.json")}a(M,"resolveSettingsPath");function Ct(e={}){const t=e.homeDir??w(),n=e.settingsPath??M(t),r=e.manifest??D(),o=ve(n),u=Y(o,r,n,t);for(const d of X(r))u.add(d);const c=e.commandExists??k,l=e.packageManager??Be(process.platform,c),s=["tmux","nvim","nerd-font"].map(d=>Ue(d,l,c));return{manifest:r,installedPackageIds:u,systemPlans:s}}a(Ct,"buildSetupInitialState");function Et(e){const t=e.manifest.map(r=>{const o=e.installedPackageIds.has(r.id)?"installed":"not installed";return`- ${r.name} \u2014 ${r.shortDescription} (${o})`}),n=e.systemPlans.map(r=>r.installed?`- ${r.tool}: \u2713 installed`:r.command?`- ${r.tool}: ${r.command}`:`- ${r.tool}: ${r.hint}`);return["crtr sys setup (non-interactive)","","Provider login: open the wizard in a TTY and use the Providers tab (same flow as /login) to authenticate a model provider.","","Packages:",...t,"","System deps:",...n,"",`Inbox: the inbox-toggle key (${he()??"disabled"}) is a crouter keybinding \u2014 view or rebind it in \`crtr sys settings\`; it is installed on the same tmux server as every other crouter binding.`,"Run `crtr sys setup` in a TTY to open the wizard."].join(`
|
|
2
2
|
`)+`
|
|
3
|
-
`}a(Et,"renderSetupStaticInstructions");class
|
|
3
|
+
`}a(Et,"renderSetupStaticInstructions");class P extends Error{static{a(this,"SetupCommandError")}output;constructor(t,n){super(t),this.output=n}}function $t(e){return`${e.stdout?.toString()??""}${e.stderr?.toString()??""}`}a($t,"commandOutput");function q(e,t,n,r=process.env){return new Promise((o,u)=>{const c=ie(e,t,{stdio:["ignore","pipe","pipe"],env:r});let l="";c.stdout.setEncoding("utf8"),c.stderr.setEncoding("utf8"),c.stdout.on("data",s=>{l+=s}),c.stderr.on("data",s=>{l+=s,n?.(s)}),c.on("error",s=>u(new P(`${e} failed: ${s.message}`,l))),c.on("close",s=>{s===0?o():u(new P(`${e} failed with status ${s??"unknown"}`,l))})})}a(q,"runCapturedCommand");function T(e,t){return q("sh",["-lc",e],t)}a(T,"runShellCommand");function ze(e,t=be()){return q(process.execPath,[t,"install",e],void 0,{...process.env,PI_CODING_AGENT_DIR:I()})}a(ze,"installPiPackage");async function W(){k("capture")||await T("npm install -g @crouton-kit/capture")}a(W,"installCaptureCliIfMissing");function H(e){return e instanceof P?e.output:void 0}a(H,"capturedFailureOutput");function Ye(e){const n=H(e)?.split(/\r?\n/).find(r=>r.trim()!=="");return n!==void 0?n.trim():e instanceof Error?e.message:String(e)}a(Ye,"firstFailureLine");function qe(e){const t=H(e);t===void 0||t.length===0||process.stderr.write(t.endsWith(`
|
|
4
4
|
`)?t:`${t}
|
|
5
|
-
`)}a(qe,"printCapturedFailure");class We{static{a(this,"SetupProgress")}interactive;bar=null;constructor(t=!!process.stdout.isTTY){this.interactive=t}start(t){return this.interactive?(this.bar
|
|
6
|
-
`)}async fail(t,n){await this.clear(),this.interactive&&process.stdout.write(`\r\x1B[2K\u2717 ${t} \u2014 ${
|
|
7
|
-
`),qe(n)}async run(t,n){const r=this.start(t);try{const o=await n(r);return await this.succeed(t),o}catch(o){throw await this.fail(t,o),o}}}function
|
|
5
|
+
`)}a(qe,"printCapturedFailure");class We{static{a(this,"SetupProgress")}interactive;bar=null;constructor(t=!!process.stdout.isTTY){this.interactive=t}start(t){return this.interactive?(this.bar=$e(`Installing ${t}\u2026`),this.bar):null}async clear(){await this.bar?.stop(),this.bar=null}async succeed(t){await this.clear(),this.interactive&&process.stdout.write(`\r\x1B[2K\u2713 ${t}
|
|
6
|
+
`)}async fail(t,n){await this.clear(),this.interactive&&process.stdout.write(`\r\x1B[2K\u2717 ${t} \u2014 ${Ye(n)}
|
|
7
|
+
`),qe(n)}async run(t,n){const r=this.start(t);try{const o=await n(r);return await this.succeed(t),o}catch(o){throw await this.fail(t,o),o}}}function J(e,t){return K()?"current":(e?.(),Ae(t),K()?"provisioned":"unavailable")}a(J,"ensureManagedRenderer");async function He(){try{ye()}catch{}}a(He,"reconcileInboxFrontDoor");function V(e,t){return t.length===0?[`${e}: none`]:[`${e}:`,...t.map(n=>` - ${n}`)]}a(V,"summarySection");function At(e){return["crtr sys setup complete",...V("installed",e.installed),...V("skipped",e.skipped),"New to crouter? Ask for the tutorial in your first conversation, or run /tutorial any time."].join(`
|
|
8
8
|
`)+`
|
|
9
|
-
`}a(
|
|
9
|
+
`}a(At,"formatSetupExecutionSummary");function X(e,t){const n=[];for(const r of e)try{r.sourceKind==="marketplace-source"?C(r.name,t)!==null&&n.push(r.id):r.sourceKind==="marketplace-plugin"&&F(r.name,t)!==null&&n.push(r.id)}catch{}return n}a(X,"detectInstalledMarketplaceEntries");async function Je(e,t="user"){if(C(e,t)!==null)return null;if(e!==E)throw new Error(`marketplace not registered: ${e}`);return await j({url:$,ref:A,scope:t}),e}a(Je,"ensureMarketplaceRegistered");function Ve(e){const t=M(),n=L(t);if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`invalid pi settings: ${t}`);const r=n.packages;if(!Array.isArray(r))throw new Error(`invalid pi packages: ${t}`);const o=a(l=>{const s=typeof l=="string"?l:l&&typeof l=="object"?l.source:void 0;return typeof s=="string"&&z(s).includes(x("pi-crtr-extensions"))},"isCrtrExtensions"),u=r.findIndex(o),c=r.filter(l=>!o(l));c.splice(u<0?c.length:u,0,{source:le(_(t),e),extensions:B}),ke(t,{...n,packages:c})}a(Ve,"configureCrtrExtensions");const Q="git is not installed \u2014 install it (Debian/Ubuntu: apt-get install git), then run `crtr sys setup`";function Z(e){return e.sourceKind==="marketplace-source"||e.sourceKind==="marketplace-plugin"}a(Z,"isMarketplaceEntry");async function ee(e){if(e.sourceKind==="marketplace-source")return await j({url:e.installSource,ref:A,scope:"user"}),[e.name];if(e.sourceKind==="marketplace-plugin"){const[t,n]=e.installSource.split("/"),r=await Je(t);return await Re({marketplace:t,plugin:n},"user"),e.id==="capture-plugin"&&await W(),r===null?[e.name]:[r,e.name]}return await ze(e.installSource),e.id==="crtr-extensions"&&Ve(e.installSource),[e.name]}a(ee,"installSetupPackage");async function Rt(e,t=k){const n=D(),r=Y(L(M()),n);for(const s of X(n,"user"))r.add(s);const o=new Map(n.map(s=>[s.id,s])),u=process.stdin.isTTY&&process.stdout.isTTY?["crtr-extensions","official-marketplace","oauth-adapter","capture-plugin"]:["crtr-extensions","official-marketplace","capture-plugin"];let c,l=!1;for(const s of u){const d=o.get(s);if(!r.has(s)){if(Z(d)&&(c??=!t("git"),c)){l||e("marketplace packages",new Error(Q)),l=!0;continue}try{await ee(d)}catch(m){e(d.name,m)}}}try{J(void 0,()=>{})==="unavailable"&&e("termrender renderer",new Error("unavailable \u2014 install uv"))}catch(s){e("termrender renderer",s)}return we()}a(Rt,"reconcileFirstRun");async function Dt(e,t=k){const n=[],r=[],o=[],u=[],c=new We;let l,s=!1;for(const i of e.packages){if(e.installedPackageIds.has(i.id)){if(r.push(`${i.name} (already installed)`),i.id==="capture-plugin"&&!k("capture"))try{await c.run("Capture CLI",()=>W()),n.push("Capture CLI")}catch(p){r.push(`Capture CLI (${p instanceof Error?p.message:String(p)})`)}continue}if(Z(i)&&(l??=!t("git"),l)){s||r.push(`marketplace packages (${Q})`),s=!0;continue}try{n.push(...await c.run(i.name,()=>ee(i)))}catch(p){if(i.sourceKind!=="marketplace-source"&&i.sourceKind!=="marketplace-plugin")throw p;r.push(`${i.name} (${p instanceof Error?p.message:String(p)})`)}}for(const i of e.systemDeps){if(i.installed){u.push(`${i.tool} (already installed)`);continue}if(!i.autoInstall||!i.command){u.push(`${i.tool} (${i.hint})`);continue}const p=i.command,v=p===Ce;await c.run(i.tool,N=>{if(!v||N===null)return T(p);const te=Se();return T(p,ne=>{const O=te(ne);O!==null&&N.setFraction(O/100)})}),o.push(i.tool)}const d=[];let m=!1,f;try{f=J(()=>{m=!0,c.start("termrender renderer")},i=>d.push(i))}catch(i){throw m&&await c.fail("termrender renderer",i),i}switch(f){case"provisioned":m&&await c.succeed("termrender renderer"),n.push("termrender renderer");break;case"current":r.push("termrender renderer (current)");break;case"unavailable":{const i=new P("unavailable \u2014 install uv",d.join(""));m&&await c.fail("termrender renderer",i),r.push("termrender renderer (unavailable \u2014 install uv)");break}}if(e.terminalEdit!==void 0){const i=`Option as Alt (${e.terminalEdit.path})`,p=Le(e.terminalEdit);p.ok?n.push(`${i} \u2014 ${e.terminalEdit.reload}`):r.push(`${i} (${p.message})`)}return await He(),{installed:[...n,...o],skipped:[...r,...u]}}a(Dt,"executeSetupSubmission");export{E as OFFICIAL_MARKETPLACE_NAME,A as OFFICIAL_MARKETPLACE_REF,$ as OFFICIAL_MARKETPLACE_URL,It as SetupKeybindingsDraft,Ct as buildSetupInitialState,D as buildSetupManifest,Ue as buildSystemInstallPlan,k as detectCommandOnPath,Y as detectInstalledSetupPackageIds,Be as detectPackageManager,Dt as executeSetupSubmission,At as formatSetupExecutionSummary,y as normalizePackageIdentity,St as packagePlanAction,Rt as reconcileFirstRun,He as reconcileInboxFrontDoor,Et as renderSetupStaticInstructions,M as resolveSettingsPath,Pt as setupPluginEnvFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var s=Object.defineProperty;var t=(e,n)=>s(e,"name",{value:n,configurable:!0});import{defineLeaf as a}from"../../core/command.js";const o="Valid CRTR_WARN_LIVE_BROKERS and CRTR_MAX_LIVE_BROKERS environment overrides take precedence over their corresponding configured limits.",c=a({name:"setup",description:"bootstrap a fresh machine \u2014 provider login, companion packages, system dependencies",whenToUse:"you need to re-run the first-launch installer \u2014 sign in to another provider, add companion packages or system dependencies, or repair package paths. A person never needs it to get started: the first bare `crtr` in a terminal opens this installer itself. Use sys settings to change configuration on an installed machine, and sys config set for scriptable edits.",help:{name:"sys setup",summary:"reopen the installer bare `crtr` runs on first launch: provider login, companion packages, system dependencies",inputNote:"No input parameters.",output:[],outputKind:"object",effects:["Opens a three-step pi-tui installer. Step one logs in to a model provider (pi's real OAuth/API-key flow, same as in-app /login) so a fresh install has credentials before running any node.","The remaining steps collect companion package installs and system dependency installs, then confirm them all at once.","On macOS, a final step detects the terminal and explains how to make Option act as Alt (crouter's menu is Alt+C). Where the setting is safely scriptable (Ghostty, stock VS Code) it can write the one line for you, but only if you tick it and after showing exactly what will be written.","Runs the bundled pi CLI to install the selected companion packages and prints a summary.","The companion-package list includes the official crtr marketplace and the plugins installed from it (currently `capture`), all checked by default and registered or installed into the user scope when left checked. Nothing else registers a marketplace, so an install that never runs setup fetches no catalog. An unreachable marketplace is reported as skipped rather than failing setup. Vendor credentials belong to the plugin that needs them, never to setup.","In a terminal, records setup as done (the same record the first bare `crtr` writes), so the next bare `crtr` boots a conversation instead of reopening the installer, and offers the tutorial if no conversation has started since setup first ran.","On every invocation (best-effort, idempotent), refreshes crouter-owned tmux bindings and registers known nodes' interaction roots so resolved tickets can call back into the asking node. The inbox popup toggle is a crouter-owned keybinding, editable on the keybindings tab."]},run:t(async()=>{const e=await(await import("./setup-wizard.js")).runSetup();process.stdout.isTTY&&await(await import("../../core/runtime/setup-marker.js")).recordSetupCompleted(e)},"run"),render:t(()=>"","render")});export{o as BROKER_LIMIT_OVERRIDE_PRECEDENCE,c as sysSetupLeaf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const STARTER_SETUP_SCRIPT = "#!/usr/bin/env bash\n# Setup script for a crtr cloud environment.\n#\n# How it runs\n# - Once per image build, as root, in /work, on Alpine Linux (use apk, not apt). Every sandbox of the profile starts from the result.\n# - Your repositories are already checked out at /work/<repo name> before this runs.\n# - The sandbox user is \"crtr\" (home /home/crtr). Files you create for it must be chowned to it.\n# - Already done for you: git, gh, curl, ripgrep, Node 24, pnpm. For every repository with a pnpm-lock.yaml, its packages are already\n# downloaded into a shared pnpm store, so `pnpm install` in a sandbox links instead of downloading.\n# - Output goes to /work/.crtr/setup.log in the image. If this script exits non-zero, sandboxes refuse to start and point at that log.\n# - The image keeps /work, /home/crtr, /usr, /etc and /lib. Anything written to /root or /tmp is lost.\n#\n# Secrets (API keys, database URLs) do not belong here: anything written by this script is baked into the image. Store them on the profile\n# instead and every sandbox gets them as environment variables:\n# printf '%s' \"<value>\" | crtr profile env set <profile> --name OPENAI_API_KEY\n#\n# Apply this file with:\n# crtr profile environment set --profile <profile> --setup-script-file ./setup.sh\n# then watch the build with `crtr profile environment show --profile <profile>` (ready when image_revision equals recipe_revision).\n#\n# Uncomment the sections you need. Delete the rest.\n\nset -euo pipefail\n\n# \u2500\u2500 1. System packages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# Alpine package names: https://pkgs.alpinelinux.org/packages\n# apk add --no-cache build-base python3 # native npm modules (node-gyp)\n# apk add --no-cache jq sqlite # command-line tools your agents use\n# apk add --no-cache chromium # headless browser tests\n\n# \u2500\u2500 2. A local Postgres \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# Creates a database cluster owned by crtr. Section 5 starts it on the agent's first shell command.\n# apk add --no-cache postgresql postgresql-contrib\n# mkdir -p /run/postgresql && chown crtr /run/postgresql\n# su crtr -c 'initdb -D /home/crtr/pg -U postgres --auth=trust'\n\n# \u2500\u2500 3. App dependencies \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# pnpm repositories are already prepared (see above). For npm or yarn, or to install fully at build time:\n# (cd /work/<repo name> && npm ci)\n# (cd /work/<repo name> && pnpm install --frozen-lockfile)\n# Each full install can take 0.5-1.5 GB of the sandbox disk. Install only the repositories agents work in most.\n\n# \u2500\u2500 4. Global CLIs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# npm install -g typescript tsx\n# curl -fsSL https://example.com/install.sh | sh\n\n# \u2500\u2500 5. Start services on the agent's first command \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# The agent's shell is non-interactive bash, which runs the file named by $BASH_ENV before each command. Write a start script here, then\n# set BASH_ENV on the profile: printf '%s' /home/crtr/.services-up.sh | crtr profile env set <profile> --name BASH_ENV\n# cat > /home/crtr/.services-up.sh <<'UP'\n# pg_ctl -D /home/crtr/pg status >/dev/null 2>&1 || pg_ctl -D /home/crtr/pg -o \"-k /tmp -h localhost\" -l /tmp/pg.log -w start >/dev/null 2>&1 || true\n# UP\n# chown crtr /home/crtr/.services-up.sh\n\n# \u2500\u2500 6. Seed files and config \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n# cp /work/<repo name>/.env.example /work/<repo name>/.env # placeholders only; real values come from `crtr profile env`\n# chown -R crtr /work/<repo name>\n";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const e=`#!/usr/bin/env bash
|
|
2
|
+
# Setup script for a crtr cloud environment.
|
|
3
|
+
#
|
|
4
|
+
# How it runs
|
|
5
|
+
# - Once per image build, as root, in /work, on Alpine Linux (use apk, not apt). Every sandbox of the profile starts from the result.
|
|
6
|
+
# - Your repositories are already checked out at /work/<repo name> before this runs.
|
|
7
|
+
# - The sandbox user is "crtr" (home /home/crtr). Files you create for it must be chowned to it.
|
|
8
|
+
# - Already done for you: git, gh, curl, ripgrep, Node 24, pnpm. For every repository with a pnpm-lock.yaml, its packages are already
|
|
9
|
+
# downloaded into a shared pnpm store, so \`pnpm install\` in a sandbox links instead of downloading.
|
|
10
|
+
# - Output goes to /work/.crtr/setup.log in the image. If this script exits non-zero, sandboxes refuse to start and point at that log.
|
|
11
|
+
# - The image keeps /work, /home/crtr, /usr, /etc and /lib. Anything written to /root or /tmp is lost.
|
|
12
|
+
#
|
|
13
|
+
# Secrets (API keys, database URLs) do not belong here: anything written by this script is baked into the image. Store them on the profile
|
|
14
|
+
# instead and every sandbox gets them as environment variables:
|
|
15
|
+
# printf '%s' "<value>" | crtr profile env set <profile> --name OPENAI_API_KEY
|
|
16
|
+
#
|
|
17
|
+
# Apply this file with:
|
|
18
|
+
# crtr profile environment set --profile <profile> --setup-script-file ./setup.sh
|
|
19
|
+
# then watch the build with \`crtr profile environment show --profile <profile>\` (ready when image_revision equals recipe_revision).
|
|
20
|
+
#
|
|
21
|
+
# Uncomment the sections you need. Delete the rest.
|
|
22
|
+
|
|
23
|
+
set -euo pipefail
|
|
24
|
+
|
|
25
|
+
# \u2500\u2500 1. System packages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
26
|
+
# Alpine package names: https://pkgs.alpinelinux.org/packages
|
|
27
|
+
# apk add --no-cache build-base python3 # native npm modules (node-gyp)
|
|
28
|
+
# apk add --no-cache jq sqlite # command-line tools your agents use
|
|
29
|
+
# apk add --no-cache chromium # headless browser tests
|
|
30
|
+
|
|
31
|
+
# \u2500\u2500 2. A local Postgres \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
32
|
+
# Creates a database cluster owned by crtr. Section 5 starts it on the agent's first shell command.
|
|
33
|
+
# apk add --no-cache postgresql postgresql-contrib
|
|
34
|
+
# mkdir -p /run/postgresql && chown crtr /run/postgresql
|
|
35
|
+
# su crtr -c 'initdb -D /home/crtr/pg -U postgres --auth=trust'
|
|
36
|
+
|
|
37
|
+
# \u2500\u2500 3. App dependencies \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
38
|
+
# pnpm repositories are already prepared (see above). For npm or yarn, or to install fully at build time:
|
|
39
|
+
# (cd /work/<repo name> && npm ci)
|
|
40
|
+
# (cd /work/<repo name> && pnpm install --frozen-lockfile)
|
|
41
|
+
# Each full install can take 0.5-1.5 GB of the sandbox disk. Install only the repositories agents work in most.
|
|
42
|
+
|
|
43
|
+
# \u2500\u2500 4. Global CLIs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
44
|
+
# npm install -g typescript tsx
|
|
45
|
+
# curl -fsSL https://example.com/install.sh | sh
|
|
46
|
+
|
|
47
|
+
# \u2500\u2500 5. Start services on the agent's first command \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
48
|
+
# The agent's shell is non-interactive bash, which runs the file named by $BASH_ENV before each command. Write a start script here, then
|
|
49
|
+
# set BASH_ENV on the profile: printf '%s' /home/crtr/.services-up.sh | crtr profile env set <profile> --name BASH_ENV
|
|
50
|
+
# cat > /home/crtr/.services-up.sh <<'UP'
|
|
51
|
+
# pg_ctl -D /home/crtr/pg status >/dev/null 2>&1 || pg_ctl -D /home/crtr/pg -o "-k /tmp -h localhost" -l /tmp/pg.log -w start >/dev/null 2>&1 || true
|
|
52
|
+
# UP
|
|
53
|
+
# chown crtr /home/crtr/.services-up.sh
|
|
54
|
+
|
|
55
|
+
# \u2500\u2500 6. Seed files and config \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
56
|
+
# cp /work/<repo name>/.env.example /work/<repo name>/.env # placeholders only; real values come from \`crtr profile env\`
|
|
57
|
+
# chown -R crtr /work/<repo name>
|
|
58
|
+
`;export{e as STARTER_SETUP_SCRIPT};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var v=Object.defineProperty;var u=(n
|
|
2
|
-
`)[0]??"",tone:"warning"}];const r=
|
|
3
|
-
`).filter(o=>o.trim()!==""&&!o.startsWith("<auto-loaded-context")&&!o.startsWith("</auto-loaded-context"));return s.length===0?null:[{text:s[0]},...s.slice(1,P).map(o=>({text:o,tone:"muted"}))]}u(C,"summarizeCanvasRead");function _(n
|
|
1
|
+
var v=Object.defineProperty;var u=(e,n)=>v(e,"name",{value:n,configurable:!0});const g=new Set(["canvas roster","canvas snapshot","node inspect snapshot","node inspect show","sys context sysprompt"]);function N(e){return g.has(e)}u(N,"suppressOutputForLeaf");function M(e){for(const n of g){const t=n.split(" ");if(t.length<=e.length&&t.every((r,s)=>e[s]===r))return!0}return!1}u(M,"suppressOutputForPath");const b=61529,R=String.fromCodePoint(b),H={bash:String.fromCodePoint(61728),read:String.fromCodePoint(61788),write:String.fromCodePoint(61639),edit:String.fromCodePoint(61508)},w={canvas:61672,capture:61501,device:61705,doc:61485,human:61447,node:61842,pkg:61874,profile:62141,push:61678,surface:61704,sys:61459},k={"canvas dashboard":61668,"canvas snapshot":61488,"canvas browse":61774,"canvas attention count":62098,"canvas attention list":61498,"canvas attention map":62073,"canvas revive":61473,"node lifecycle revive":61473,"canvas list":61498,"canvas read":61485,"canvas search":61442,"canvas history search":61442,"canvas history grep":61616,"sys daemon start":61515,"sys daemon status":61713,"sys daemon stop":61517,"canvas chord":61441,"surface tmux-spread":61449,"canvas issue new":61832,"canvas prune":61636,"human send":61529,"human review":61508,"human show":61704,"human cancel":61453,"human list":61498,"human resolve":61452,"doc write":61504,"doc edit":61508,"doc history":61914,"doc lint":61770,"node new":61543,"node message send":61664,"node message request":61664,"cron add":61463,"node wait deadline":61463,"node subscription add":61683,"node subscription remove":61942,"node promote":61698,"node yield":62093,"surface node focus":61531,"surface node cycle":61473,"node inspect list":61498,"node inspect show":61550,"node inspect snapshot":61488,"node inspect context":61564,"node lifecycle recycle":61880,"node lifecycle close":61453,"node lifecycle demote":61699,"node config":61459,"cron list":61463,"cron cancel":61534,"pkg plugin install":61465,"pkg plugin remove":61460,"pkg plugin enable":61452,"pkg plugin disable":61534,"pkg plugin update":61473,"pkg plugin list":61498,"pkg plugin show":61550,"pkg market add":61543,"pkg market remove":61460,"pkg market update":61473,"pkg market list":61498,"pkg market browse":61774,"push update":61587,"push final":61726,"surface attach to":61926,"sys config get":61465,"sys config set":61504,"sys config path":61563,"sys settings":61459,"sys setup":61613,"sys doctor":61681,"sys context sysprompt":61788,"sys context prompt-review":61442,"sys feedback":61557,"sys update":61473,"sys version":61483,"sys sync":61561};function U(e){let n;for(const[r,s]of Object.entries(k)){const o=r.split(" ");o.length<=e.length&&o.every((i,f)=>e[f]===i)&&(n===void 0||o.length>n.words)&&(n={words:o.length,cp:s})}if(n!==void 0)return String.fromCodePoint(n.cp);const t=e.length>0?w[e[0]]:void 0;return t!==void 0?String.fromCodePoint(t):"\u25C6"}u(U,"iconForPath");function p(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}u(p,"plainObject");function T(e){const n=p(p(e)?.details);if(n===void 0)return[];const t=n.crtrPreviews;return(Array.isArray(t)?t:[n.crtrPreview]).flatMap(s=>{const o=p(s);if(o===void 0||typeof o.path!="string")return[];const i=o.jsonl;return[{path:o.path,result:p(o.result),jsonl:Array.isArray(i)?i.flatMap(f=>{const h=p(f);return h===void 0?[]:[h]}):void 0,error:p(o.error)}]})}u(T,"crtrPreviewRecords");const P=4;function c(e){return e.result}u(c,"record");function a(e,n){const t=e[n];return typeof t=="string"&&t!==""?t:void 0}u(a,"stringField");function x(e,n){return typeof e[n]=="boolean"?e[n]:void 0}u(x,"booleanField");function l(e,n){return typeof e[n]=="number"&&Number.isFinite(e[n])?e[n]:void 0}u(l,"numberField");function A(e,n){const t=e[n];return Array.isArray(t)&&t.every(r=>r!==null&&typeof r=="object"&&!Array.isArray(r))?t:void 0}u(A,"arrayField");function D(e){const n=e.replace(/[\\/]+$/,""),t=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));return t===-1?n:n.slice(t+1)}u(D,"basename");function S(e,n){return e.length>n?`${e.slice(0,n).trimEnd()}\u2026`:e}u(S,"truncateLine");function $(e,n,t=5){const r=e.map(i=>a(i,n));if(r.some(i=>i===void 0))return;const s=r.slice(0,t),o=r.length-s.length;return o>0?`${s.join(", ")}, \u2026 ${o} more`:s.join(", ")}u($,"topNames");function j(e){const n=e.error;if(n===void 0)return null;const t=a(n,"error"),r=a(n,"message");return t===void 0||r===void 0?null:[{text:t,tone:"error"},{text:S(r,160),tone:"muted"}]}u(j,"summarizeError");function C(e){const n=c(e);if(n===void 0)return null;const t=a(n,"deleted")??a(n,"remote");if(t!==void 0)return[{text:t.trim().split(`
|
|
2
|
+
`)[0]??"",tone:"warning"}];const r=a(n,"readMetadata")??a(n,"object");if(r===void 0)return null;const s=r.split(`
|
|
3
|
+
`).filter(o=>o.trim()!==""&&!o.startsWith("<auto-loaded-context")&&!o.startsWith("</auto-loaded-context"));return s.length===0?null:[{text:s[0]},...s.slice(1,P).map(o=>({text:o,tone:"muted"}))]}u(C,"summarizeCanvasRead");function _(e,n=!1){return t=>{const r=c(t),s=r===void 0?void 0:l(r,"count")??l(r,"total");return s===void 0?null:s===0&&n?[{text:`PASS \xB7 no ${e}`,tone:"success"}]:[{text:`${s} ${e}`,tone:s===0?"muted":"plain"}]}}u(_,"summarizeCount");function d(e,n="items"){return t=>{const r=c(t);if(r===void 0)return null;const s=A(r,n),o=l(r,"total")??s?.length;if(s===void 0||o===void 0)return null;const i=[{text:`${o} ${e}`,tone:o===0?"muted":"plain"}],f=$(s,"name");return f!==void 0&&f!==""&&i.push({text:f,tone:"muted"}),i}}u(d,"summarizeArray");function O(e){const t=c(e)?.counts;if(t===null||typeof t!="object"||Array.isArray(t))return null;const r=Object.entries(t);if(r.some(([,i])=>typeof i!="number"))return null;const s=r.reduce((i,[,f])=>i+f,0);if(s===0)return[{text:"PASS \xB7 no pending asks",tone:"success"}];const o=r.filter(([,i])=>i>0).sort((i,f)=>f[1]-i[1])[0];return o===void 0?null:[{text:`${s} asks`,tone:"warning"},{text:`hottest: ${o[0]} (${o[1]})`,tone:"muted"}]}u(O,"summarizeAttentionMap");function m(e,n,t){return r=>{const s=c(r);if(s===void 0)return null;const o=x(s,e);if(o===void 0)return null;const i=l(s,"pid")??l(s,"existing_pid");return[{text:o?`${n}${i===void 0?"":` \xB7 pid ${i}`}`:t,tone:o?"success":"muted"}]}}u(m,"summarizeDaemon");function z(e){const n=c(e);if(n===void 0||a(n,"page_id")===void 0)return null;const t=x(n,"reply");return t===void 0?null:[{text:t?"page sent \u2192 waiting on human":"announcement sent",tone:t?"accent":"success"}]}u(z,"summarizeHumanSend");function E(e){const n=c(e);if(n===void 0)return null;const t=x(n,"resolved"),r=a(n,"job_id");return t===void 0||r===void 0?null:[{text:`${t?"resolved":"not resolved"} ${r}`,tone:t?"success":"warning"}]}u(E,"summarizeHumanResolve");function y(e){const n=c(e);if(n===void 0)return null;const t=a(n,"status");return t===void 0?null:[{text:t,tone:["done","success","submitted","filed"].includes(t)?"success":t==="failed"?"error":"plain"}]}u(y,"summarizeStatus");function F(e){const n=e.jsonl;if(n===void 0)return null;const t=n.filter(r=>a(r,"name")!==void 0&&l(r,"projects_count")!==void 0);return t.length===0&&n.length>0?null:[{text:`${t.length} profile${t.length===1?"":"s"}`},...t.slice(0,5).map(r=>({text:`${a(r,"name")} \xB7 ${l(r,"projects_count")} projects`,tone:"muted"}))]}u(F,"summarizeProfileList");const I=[{path:"canvas read",run:C},{path:"canvas list",run:d("objects")},{path:"canvas search",run:d("hits")},{path:"canvas attention count",run:_("pending asks",!0)},{path:"canvas attention list",run:d("pending asks")},{path:"canvas attention map",run:O},{path:"human send",run:z},{path:"human list",run:d("pending")},{path:"human resolve",run:E},{path:"pkg plugin list",run:d("plugins")},{path:"pkg market list",run:d("marketplaces")},{path:"pkg market browse",run:d("plugins")},{path:"canvas dashboard",run:d("nodes","rows")},{path:"node inspect list",run:d("nodes","nodes")},{path:"sys daemon start",run:m("started","started","already running")},{path:"sys daemon status",run:m("running","running","not running")},{path:"sys daemon stop",run:m("stopped","stopped","was not running")},{path:"sys update",run:y},{path:"sys feedback",run:y},{path:"profile list",run:F}];function V(e,n=[]){const t=j(e);return t!==null?t:I.find(({path:s})=>s===e.path)?.run(e,n)??null}u(V,"summarizePath");export{R as HELP_ICON,k as LEAF_ICON_CP,I as SUMMARIZERS,g as SUPPRESS_OUTPUT_LEAVES,H as TOOL_ICON,T as crtrPreviewRecords,U as iconForPath,V as summarizePath,N as suppressOutputForLeaf,M as suppressOutputForPath};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.723",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
},
|
|
159
159
|
"license": "UNLICENSED",
|
|
160
160
|
"dependencies": {
|
|
161
|
-
"@north-light/identity": "0.3.
|
|
162
|
-
"@north-light/plugin": "0.3.
|
|
161
|
+
"@north-light/identity": "0.3.723",
|
|
162
|
+
"@north-light/plugin": "0.3.723",
|
|
163
163
|
"@earendil-works/chord": "1.5.2",
|
|
164
164
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
165
165
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -10,7 +10,7 @@ export const INSTALLED_SOURCE_ID = "installed";
|
|
|
10
10
|
export function marketplaceSourceId(name, scope) {
|
|
11
11
|
return `market:${scope}:${name}`;
|
|
12
12
|
}
|
|
13
|
-
/** `crtr
|
|
13
|
+
/** `crtr capture shot` — how a user types the command a node names. The one place
|
|
14
14
|
* a command path becomes a label, so no corner of the page invents its own. */
|
|
15
15
|
export function commandLabel(node) {
|
|
16
16
|
return `crtr ${node.path.join(" ")}`;
|
|
@@ -5,6 +5,7 @@ import { resolve } from 'node:path';
|
|
|
5
5
|
import { defineLeaf, defineBranch } from '../../core/command.js';
|
|
6
6
|
import { usage } from '../../core/errors.js';
|
|
7
7
|
import { cliClient } from '../api-client.js';
|
|
8
|
+
import { STARTER_SETUP_SCRIPT } from '../../core/environment-starter-script.js';
|
|
8
9
|
import { resolveProfileViaDaemon } from './daemon-profiles.js';
|
|
9
10
|
const PROFILE_FLAG = { kind: 'flag', name: 'profile', type: 'string', required: true, constraint: 'Profile id or manifest name; a close-enough name resolves to the nearest profile, reported on stderr.' };
|
|
10
11
|
const ENVIRONMENT_OUTPUT = [
|
|
@@ -39,24 +40,41 @@ const showLeaf = defineLeaf({
|
|
|
39
40
|
return output(await cliClient().getProfileEnvironment(id));
|
|
40
41
|
},
|
|
41
42
|
});
|
|
43
|
+
const starterLeaf = defineLeaf({
|
|
44
|
+
name: 'starter',
|
|
45
|
+
description: 'print a commented starter setup script to copy and fill in',
|
|
46
|
+
whenToUse: 'writing the first setup script for a cloud profile, or looking up what the image build already does and where secrets go.',
|
|
47
|
+
help: {
|
|
48
|
+
name: 'profile environment starter',
|
|
49
|
+
summary: 'print a commented starter setup script with example sections',
|
|
50
|
+
params: [],
|
|
51
|
+
output: [],
|
|
52
|
+
outputKind: 'object',
|
|
53
|
+
effects: ['Prints the script as-is to stdout: redirect it to a file (`> setup.sh`), edit it, pass it to `profile environment set --setup-script-file`. Read-only; changes no profile and builds no image.'],
|
|
54
|
+
},
|
|
55
|
+
run: async () => { process.stdout.write(STARTER_SETUP_SCRIPT); },
|
|
56
|
+
});
|
|
42
57
|
const setLeaf = defineLeaf({
|
|
43
58
|
name: 'set',
|
|
44
59
|
description: "change a cloud profile's repositories, setup script, pi packages, memory or pull request merging",
|
|
45
|
-
whenToUse: 'a dev profile needs other repositories, a setup script for its image
|
|
60
|
+
whenToUse: 'a dev profile needs other repositories, a setup script for its image, pi packages, or more memory. A flag left out keeps its value. For a first setup script, start from `crtr profile environment starter`.',
|
|
46
61
|
help: {
|
|
47
62
|
name: 'profile environment set',
|
|
48
63
|
summary: "change a cloud profile's environment recipe or memory",
|
|
49
64
|
params: [
|
|
50
65
|
PROFILE_FLAG,
|
|
51
66
|
{ kind: 'flag', name: 'repo', type: 'string', required: false, repeatable: true, constraint: 'GitHub repository `owner/name` (repeat per repository); replaces the whole list. The GitHub App must be installed on each.' },
|
|
52
|
-
{ kind: 'flag', name: 'setup-script-file', type: 'path', required: false, constraint: 'File holding the setup script
|
|
67
|
+
{ kind: 'flag', name: 'setup-script-file', type: 'path', required: false, constraint: 'File holding the setup script. The image build runs it once as root in `/work` on Alpine (apk), after checking out the repositories into `/work/<name>` and downloading every pnpm-lock.yaml repository\'s packages into a shared pnpm store; output lands in `/work/.crtr/setup.log`, and a non-zero exit stops sandboxes from starting. `crtr profile environment starter` prints a commented template.' },
|
|
53
68
|
{ kind: 'flag', name: 'pi-package', type: 'string', required: false, repeatable: true, constraint: 'pi package source (repeat per package); replaces the whole list.' },
|
|
54
69
|
{ kind: 'flag', name: 'allow-pull-request-write', type: 'bool', required: false, constraint: 'On by default: sandboxes may open and merge pull requests (their GitHub credential carries pull_requests write). `--no-allow-pull-request-write` drops to contents write only, so sandboxes can push branches but not open pull requests. Takes effect on the next credential a sandbox fetches; builds no image.' },
|
|
55
70
|
{ kind: 'flag', name: 'memory', type: 'int', required: false, constraint: 'Sandbox memory in GB: 2, 4 or 8. Reaches sandboxes created after the change; a running sandbox keeps its memory.' },
|
|
56
71
|
],
|
|
57
72
|
output: [...ENVIRONMENT_OUTPUT],
|
|
58
73
|
outputKind: 'object',
|
|
59
|
-
effects: [
|
|
74
|
+
effects: [
|
|
75
|
+
'A changed recipe raises `recipe_revision`, and the daemon builds a new image for it; check `profile environment show`. A recipe identical to the stored one changes nothing.',
|
|
76
|
+
'Secrets never go in the setup script, because it is baked into the image: store them with `crtr profile env set <profile> --name <NAME>` and every sandbox gets them as environment variables.',
|
|
77
|
+
],
|
|
60
78
|
},
|
|
61
79
|
run: async (input) => {
|
|
62
80
|
const { id } = await resolveProfileViaDaemon(input['profile']);
|
|
@@ -86,7 +104,7 @@ export const environmentBranch = defineBranch({
|
|
|
86
104
|
help: {
|
|
87
105
|
name: 'profile environment',
|
|
88
106
|
summary: "a cloud profile's environment recipe and memory",
|
|
89
|
-
model: 'A cloud profile runs its nodes in Blaxel sandboxes. Its environment holds the recipe the sandbox image is built from
|
|
107
|
+
model: 'A cloud profile runs its nodes in Blaxel sandboxes. Its environment holds the recipe the sandbox image is built from: repositories, a setup script and pi packages. Changing the recipe makes the daemon build a new image, and new sandboxes use it. Memory applies to new sandboxes only. The build always checks out the repositories into `/work/<name>`, installs git, gh, Node and pnpm, and downloads each pnpm repository\'s packages into a shared store; the setup script adds the rest (`starter` prints a template). API keys and other secrets live in `crtr profile env`, never in the recipe.',
|
|
90
108
|
},
|
|
91
|
-
children: [showLeaf, setLeaf],
|
|
109
|
+
children: [showLeaf, starterLeaf, setLeaf],
|
|
92
110
|
});
|
|
@@ -250,11 +250,6 @@ const PACKAGE_COPY = {
|
|
|
250
250
|
shortDescription: 'crtr plugin mounting `crtr capture` — browser automation and UI measurement over CDP.',
|
|
251
251
|
longDescription: 'Installs the `capture` plugin from the official crtr marketplace. It mounts `crtr capture` as a transparent passthrough to the external Capture CLI (`npm install -g @crouton-kit/capture`) for CDP screenshots, rendered-geometry measurement, HAR, accessibility trees, and JS execution against a live page. Uncheck it on a machine where agents never drive a browser — the command then costs nothing in their root prompt.',
|
|
252
252
|
},
|
|
253
|
-
'exa-search-plugin': {
|
|
254
|
-
name: 'exa-search',
|
|
255
|
-
shortDescription: 'crtr plugin mounting `crtr exa-search` — public-web discovery, grounded answers, and content extraction.',
|
|
256
|
-
longDescription: 'Installs the `exa-search` plugin from the official crtr marketplace. It mounts `crtr exa-search` and calls Exa directly with EXA_API_KEY, collected during install or set through `crtr sys env set --name EXA_API_KEY` in the app env store. Uncheck it on a machine whose agents get web search from somewhere else, such as a Northlight home where the platform serves `crtr search` from its own plugin.',
|
|
257
|
-
},
|
|
258
253
|
'dev-plugin': {
|
|
259
254
|
name: 'dev',
|
|
260
255
|
shortDescription: 'crtr plugin mounting the development workflow — repository setup, worktrees, pull requests, and a dev track in the tutorial.',
|
|
@@ -266,7 +261,6 @@ const PACKAGE_SOURCES = {
|
|
|
266
261
|
'crtr-extensions': { kind: 'local-path', source: selectedPiPackageDir('pi-crtr-extensions') },
|
|
267
262
|
'oauth-adapter': { kind: 'npm', source: 'npm:pi-claude-oauth-adapter@0.2.2' },
|
|
268
263
|
'capture-plugin': { kind: 'marketplace-plugin', source: 'crouter-official-marketplace/capture' },
|
|
269
|
-
'exa-search-plugin': { kind: 'marketplace-plugin', source: 'crouter-official-marketplace/exa-search' },
|
|
270
264
|
'dev-plugin': { kind: 'marketplace-plugin', source: 'crouter-official-marketplace/dev' },
|
|
271
265
|
};
|
|
272
266
|
const CRTR_EXTENSION_GLOBS = ['extensions/*.ts', 'extensions/*/index.ts', '!extensions/**/*.d.ts'];
|
|
@@ -275,7 +269,6 @@ const LOCAL_PACKAGE_NAME_ALIASES = {
|
|
|
275
269
|
'crtr-extensions': ['pi-crtr-extensions'],
|
|
276
270
|
'oauth-adapter': [],
|
|
277
271
|
'capture-plugin': [],
|
|
278
|
-
'exa-search-plugin': [],
|
|
279
272
|
'dev-plugin': [],
|
|
280
273
|
};
|
|
281
274
|
function selectedPiPackageDir(name) {
|
|
@@ -289,7 +282,6 @@ export function buildSetupManifest(resolveBuiltinPackageDir = selectedPiPackageD
|
|
|
289
282
|
'crtr-extensions',
|
|
290
283
|
'oauth-adapter',
|
|
291
284
|
'capture-plugin',
|
|
292
|
-
'exa-search-plugin',
|
|
293
285
|
'dev-plugin',
|
|
294
286
|
].map((id) => {
|
|
295
287
|
const copy = PACKAGE_COPY[id];
|
|
@@ -738,8 +730,8 @@ export async function reconcileFirstRun(onFailure, commandExists = detectCommand
|
|
|
738
730
|
installedPackageIds.add(id);
|
|
739
731
|
const byId = new Map(manifest.map((entry) => [entry.id, entry]));
|
|
740
732
|
const packageIds = process.stdin.isTTY && process.stdout.isTTY
|
|
741
|
-
? ['crtr-extensions', 'official-marketplace', 'oauth-adapter', 'capture-plugin'
|
|
742
|
-
: ['crtr-extensions', 'official-marketplace', 'capture-plugin'
|
|
733
|
+
? ['crtr-extensions', 'official-marketplace', 'oauth-adapter', 'capture-plugin']
|
|
734
|
+
: ['crtr-extensions', 'official-marketplace', 'capture-plugin'];
|
|
743
735
|
let gitMissing;
|
|
744
736
|
let gitReported = false;
|
|
745
737
|
for (const id of packageIds) {
|
|
@@ -24,7 +24,7 @@ export const sysSetupLeaf = defineLeaf({
|
|
|
24
24
|
'The remaining steps collect companion package installs and system dependency installs, then confirm them all at once.',
|
|
25
25
|
'On macOS, a final step detects the terminal and explains how to make Option act as Alt (crouter\'s menu is Alt+C). Where the setting is safely scriptable (Ghostty, stock VS Code) it can write the one line for you, but only if you tick it and after showing exactly what will be written.',
|
|
26
26
|
'Runs the bundled pi CLI to install the selected companion packages and prints a summary.',
|
|
27
|
-
'The companion-package list includes the official crtr marketplace and the plugins installed from it (currently `capture`
|
|
27
|
+
'The companion-package list includes the official crtr marketplace and the plugins installed from it (currently `capture`), all checked by default and registered or installed into the user scope when left checked. Nothing else registers a marketplace, so an install that never runs setup fetches no catalog. An unreachable marketplace is reported as skipped rather than failing setup. Vendor credentials belong to the plugin that needs them, never to setup.',
|
|
28
28
|
'In a terminal, records setup as done (the same record the first bare `crtr` writes), so the next bare `crtr` boots a conversation instead of reopening the installer, and offers the tutorial if no conversation has started since setup first ran.',
|
|
29
29
|
'On every invocation (best-effort, idempotent), refreshes crouter-owned tmux bindings and registers known nodes\' interaction roots so resolved tickets can call back into the asking node. The inbox popup toggle is a crouter-owned keybinding, editable on the keybindings tab.',
|
|
30
30
|
],
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// The starter setup script `crtr profile environment starter` prints: a commented template a developer copies, fills in and passes to
|
|
2
|
+
// `crtr profile environment set --setup-script-file`. It is printed, never stored: a stored script, even one of comments only, gives the
|
|
3
|
+
// environment a recipe and costs an image build before anyone has asked for one.
|
|
4
|
+
export const STARTER_SETUP_SCRIPT = `#!/usr/bin/env bash
|
|
5
|
+
# Setup script for a crtr cloud environment.
|
|
6
|
+
#
|
|
7
|
+
# How it runs
|
|
8
|
+
# - Once per image build, as root, in /work, on Alpine Linux (use apk, not apt). Every sandbox of the profile starts from the result.
|
|
9
|
+
# - Your repositories are already checked out at /work/<repo name> before this runs.
|
|
10
|
+
# - The sandbox user is "crtr" (home /home/crtr). Files you create for it must be chowned to it.
|
|
11
|
+
# - Already done for you: git, gh, curl, ripgrep, Node 24, pnpm. For every repository with a pnpm-lock.yaml, its packages are already
|
|
12
|
+
# downloaded into a shared pnpm store, so \`pnpm install\` in a sandbox links instead of downloading.
|
|
13
|
+
# - Output goes to /work/.crtr/setup.log in the image. If this script exits non-zero, sandboxes refuse to start and point at that log.
|
|
14
|
+
# - The image keeps /work, /home/crtr, /usr, /etc and /lib. Anything written to /root or /tmp is lost.
|
|
15
|
+
#
|
|
16
|
+
# Secrets (API keys, database URLs) do not belong here: anything written by this script is baked into the image. Store them on the profile
|
|
17
|
+
# instead and every sandbox gets them as environment variables:
|
|
18
|
+
# printf '%s' "<value>" | crtr profile env set <profile> --name OPENAI_API_KEY
|
|
19
|
+
#
|
|
20
|
+
# Apply this file with:
|
|
21
|
+
# crtr profile environment set --profile <profile> --setup-script-file ./setup.sh
|
|
22
|
+
# then watch the build with \`crtr profile environment show --profile <profile>\` (ready when image_revision equals recipe_revision).
|
|
23
|
+
#
|
|
24
|
+
# Uncomment the sections you need. Delete the rest.
|
|
25
|
+
|
|
26
|
+
set -euo pipefail
|
|
27
|
+
|
|
28
|
+
# ── 1. System packages ───────────────────────────────────────────────────────────────────────────────
|
|
29
|
+
# Alpine package names: https://pkgs.alpinelinux.org/packages
|
|
30
|
+
# apk add --no-cache build-base python3 # native npm modules (node-gyp)
|
|
31
|
+
# apk add --no-cache jq sqlite # command-line tools your agents use
|
|
32
|
+
# apk add --no-cache chromium # headless browser tests
|
|
33
|
+
|
|
34
|
+
# ── 2. A local Postgres ──────────────────────────────────────────────────────────────────────────────
|
|
35
|
+
# Creates a database cluster owned by crtr. Section 5 starts it on the agent's first shell command.
|
|
36
|
+
# apk add --no-cache postgresql postgresql-contrib
|
|
37
|
+
# mkdir -p /run/postgresql && chown crtr /run/postgresql
|
|
38
|
+
# su crtr -c 'initdb -D /home/crtr/pg -U postgres --auth=trust'
|
|
39
|
+
|
|
40
|
+
# ── 3. App dependencies ──────────────────────────────────────────────────────────────────────────────
|
|
41
|
+
# pnpm repositories are already prepared (see above). For npm or yarn, or to install fully at build time:
|
|
42
|
+
# (cd /work/<repo name> && npm ci)
|
|
43
|
+
# (cd /work/<repo name> && pnpm install --frozen-lockfile)
|
|
44
|
+
# Each full install can take 0.5-1.5 GB of the sandbox disk. Install only the repositories agents work in most.
|
|
45
|
+
|
|
46
|
+
# ── 4. Global CLIs ───────────────────────────────────────────────────────────────────────────────────
|
|
47
|
+
# npm install -g typescript tsx
|
|
48
|
+
# curl -fsSL https://example.com/install.sh | sh
|
|
49
|
+
|
|
50
|
+
# ── 5. Start services on the agent's first command ───────────────────────────────────────────────────
|
|
51
|
+
# The agent's shell is non-interactive bash, which runs the file named by $BASH_ENV before each command. Write a start script here, then
|
|
52
|
+
# set BASH_ENV on the profile: printf '%s' /home/crtr/.services-up.sh | crtr profile env set <profile> --name BASH_ENV
|
|
53
|
+
# cat > /home/crtr/.services-up.sh <<'UP'
|
|
54
|
+
# pg_ctl -D /home/crtr/pg status >/dev/null 2>&1 || pg_ctl -D /home/crtr/pg -o "-k /tmp -h localhost" -l /tmp/pg.log -w start >/dev/null 2>&1 || true
|
|
55
|
+
# UP
|
|
56
|
+
# chown crtr /home/crtr/.services-up.sh
|
|
57
|
+
|
|
58
|
+
# ── 6. Seed files and config ─────────────────────────────────────────────────────────────────────────
|
|
59
|
+
# cp /work/<repo name>/.env.example /work/<repo name>/.env # placeholders only; real values come from \`crtr profile env\`
|
|
60
|
+
# chown -R crtr /work/<repo name>
|
|
61
|
+
`;
|
|
@@ -59,7 +59,7 @@ export const TOOL_ICON = {
|
|
|
59
59
|
/** One glyph per root family (`crtr <family> ...`) — the fallback for any
|
|
60
60
|
* leaf not listed in LEAF_ICON_CP below. Codepoints are Nerd Font
|
|
61
61
|
* private-use-area icons chosen per family concept (see command-icons.md).
|
|
62
|
-
* Families a plugin mounts (capture, device
|
|
62
|
+
* Families a plugin mounts (capture, device) are listed here too: this
|
|
63
63
|
* registry is keyed by command path, not by who owns the command. */
|
|
64
64
|
const FAMILY_ICON_CP = {
|
|
65
65
|
canvas: 0xf0e8,
|
|
@@ -71,7 +71,6 @@ const FAMILY_ICON_CP = {
|
|
|
71
71
|
pkg: 0xf1b2,
|
|
72
72
|
profile: 0xf2bd,
|
|
73
73
|
push: 0xf0ee,
|
|
74
|
-
'exa-search': 0xf002,
|
|
75
74
|
surface: 0xf108,
|
|
76
75
|
sys: 0xf013,
|
|
77
76
|
};
|
|
@@ -143,9 +142,6 @@ export const LEAF_ICON_CP = {
|
|
|
143
142
|
'pkg market browse': 0xf14e,
|
|
144
143
|
'push update': 0xf093,
|
|
145
144
|
'push final': 0xf11e,
|
|
146
|
-
'exa-search web': 0xf0ac,
|
|
147
|
-
'exa-search answer': 0xf075,
|
|
148
|
-
'exa-search contents': 0xf0f6,
|
|
149
145
|
'surface attach to': 0xf1e6,
|
|
150
146
|
'sys config get': 0xf019,
|
|
151
147
|
'sys config set': 0xf040,
|