@north-light/cli 0.3.702 → 0.3.704
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/clients/attach/config.js +1 -1
- package/dist/clients/attach/session/bindings.d.ts +1 -1
- package/dist/clients/attach/viewer.d.ts +1 -1
- package/dist/clients/attach/viewer.js +366 -366
- package/dist/commands/sys/setup-core.js +1 -1
- package/dist/core/config.d.ts +4 -1
- package/dist/core/config.js +1 -1
- package/dist/core/keybindings/catalog.js +1 -1
- package/dist/core/keybindings/persistence.js +1 -1
- package/package.json +3 -3
- package/packages/crouter-api/dist/clients/attach/config.js +6 -2
- package/packages/crouter-api/dist/clients/attach/session/bindings.js +1 -1
- package/packages/crouter-api/dist/clients/attach/viewer.js +2 -2
- package/packages/crouter-api/dist/commands/sys/setup-core.js +1 -1
- package/packages/crouter-api/dist/core/config.js +8 -1
- package/packages/crouter-api/dist/core/keybindings/catalog.js +6 -6
- package/packages/crouter-api/dist/core/keybindings/persistence.js +2 -4
- 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
|
@@ -1,4 +1,4 @@
|
|
|
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.length===0?void 0:[...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 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(`
|
|
2
2
|
`)+`
|
|
3
3
|
`}a(Et,"renderSetupStaticInstructions");class I extends Error{static{a(this,"SetupCommandError")}output;constructor(t,n){super(t),this.output=n}}function At(e){return`${e.stdout?.toString()??""}${e.stderr?.toString()??""}`}a(At,"commandOutput");function q(e,t,n,r=process.env){return new Promise((o,l)=>{const c=ie(e,t,{stdio:["ignore","pipe","pipe"],env:r});let u="";c.stdout.setEncoding("utf8"),c.stderr.setEncoding("utf8"),c.stdout.on("data",s=>{u+=s}),c.stderr.on("data",s=>{u+=s,n?.(s)}),c.on("error",s=>l(new I(`${e} failed: ${s.message}`,u))),c.on("close",s=>{s===0?o():l(new I(`${e} failed with status ${s??"unknown"}`,u))})})}a(q,"runCapturedCommand");function N(e,t){return q("sh",["-lc",e],t)}a(N,"runShellCommand");function Ye(e,t=we()){return q(process.execPath,[t,"install",e],void 0,{...process.env,PI_CODING_AGENT_DIR:P()})}a(Ye,"installPiPackage");async function W(){k("capture")||await N("npm install -g @crouton-kit/capture")}a(W,"installCaptureCliIfMissing");function H(e){return e instanceof I?e.output:void 0}a(H,"capturedFailureOutput");function ze(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(ze,"firstFailureLine");function qe(e){const t=H(e);t===void 0||t.length===0||process.stderr.write(t.endsWith(`
|
|
4
4
|
`)?t:`${t}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -37,8 +37,11 @@ export declare function writeRawConfig(scope: Scope, config: Partial<ScopeConfig
|
|
|
37
37
|
export declare function writeState(scope: Scope, state: ScopeState): Promise<void>;
|
|
38
38
|
/** A project scope is a directory holding `config.json`; the user and profile scopes are the person's rows and need no directory setup. */
|
|
39
39
|
export declare function ensureScopeInitialized(scope: Scope, root: string): Promise<void>;
|
|
40
|
+
/** Attach scroll keys tmux wraps by default, so the Ctrl scroll keys keep each user's own tmux binding in every non-viewer pane. An explicit list, including an empty one, replaces this. */
|
|
41
|
+
export declare const DEFAULT_TMUX_PASSTHROUGH: readonly BindingId[];
|
|
40
42
|
/** Normalize the user-owned list of attach actions allowed to bridge through an
|
|
41
|
-
* occupied tmux root binding. Unknown and non-attach ids have no effect.
|
|
43
|
+
* occupied tmux root binding. Unknown and non-attach ids have no effect.
|
|
44
|
+
* `undefined` (no saved setting) yields the default list; any other non-array yields an empty list. */
|
|
42
45
|
export declare function normalizeTmuxPassthrough(raw: unknown): BindingId[];
|
|
43
46
|
type LegacyModelRouteConfig = Omit<ModelRouteConfig, 'models'> & {
|
|
44
47
|
models: Partial<Record<ModelStrength, string>>;
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Ye=Object.defineProperty;var s=(e,n)=>Ye(e,"name",{value:n,configurable:!0});import{envProfileId as Ze}from"../shared/env.js";import{basename as oe,join as re}from"node:path";import{existsSync as Xe,mkdirSync as Qe,statSync as en}from"node:fs";import{isDeepStrictEqual as nn}from"node:util";import{CONFIG_FILE as tn,STATE_FILE as on,CONDENSED_HISTORY_MODES as rn,VERBOSITY_LEVELS as sn,MOUSE_MODE_DEFAULTS as cn,WHIP_MESSAGE_MODES as un,DEFAULT_WHIP_MESSAGES as ie,defaultScopeConfig as w,defaultScopeState as se,defaultModelLaddersConfig as dn,defaultKindsConfig as an,defaultRemoteCanvasConfig as fn}from"../types.js";import{BINDING_CATALOG as ln,BINDING_IDS as pn,isAttachPaneBinding as mn}from"./keybindings/catalog.js";import{notFound as gn}from"./errors.js";import{emitEvent as ce}from"./events/emit.js";import{LEDGER_ENV as yn}from"./ledger/rates.js";import{atomicWriteJson as q,readJsonIfExists as O,ensureDir as hn}from"./fs-utils.js";import{scopeRoot as g,requireScopeRoot as k,findProjectScopeRoots as bn,userScopeRoot as ue}from"./scope.js";import{listInstalledPluginsInRoot as de}from"./installed-plugins.js";import{profileDir as ae,listProfiles as fe}from"./profiles/manifest.js";import{canonicalRoot as A}from"./scoped-state/paths.js";import{currentSnapshot as vn,readCachedSettings as B,readCachedState as _n,revisionOf as I,SettingsRevisionConflictError as le,writeSettings as W}from"./scoped-state/person-store.js";import{importedIntoNorthlight as pe,splitUserSettingsWrite as wn,withAppInstalls as me}from"./scoped-state/imported-mac-installs.js";import{withExclusiveDirectoryLock as kn}from"./exclusive-lock.js";import{SCOPE_CONFIG_KEYS as An}from"./user-settings.js";import{normalizeWorkingGerunds as Sn}from"../shared/working-activity.js";import{mergePageComponentLayers as jn,normalizePageComponents as ge}from"./human/page-catalog.js";function h(e){return re(e,tn)}s(h,"configPathFor");function H(e,n){return kn(`${e}.lock`,()=>n(e),{timeoutError:s(()=>new Error(`timed out waiting for config lock: ${e}`),"timeoutError")})}s(H,"withConfigPathLock");function J(e){return re(e,on)}s(J,"statePathFor");function At(e){const n=g(e);return n?h(n):null}s(At,"configPath");function St(e){const n=g(e);return n?J(n):null}s(St,"statePath");function S(e){const n=A(e),o=A(ue());if(n===o)return{key:"user",kind:"user",root:o};if(oe(n)===".crouter")return{key:"project",kind:"project",root:n};for(const t of fe()){const r=A(ae(t.profileId));if(n===r)return{key:`profile:${t.profileId}`,kind:"profile",root:r,profileId:t.profileId}}throw new Error(`settings root is not a recognized owner: ${e}`)}s(S,"settingsOwnerForRoot");function P(e){if(oe(e)===".crouter"){let t;try{t=A(e)}catch(r){if(r.code==="ENOENT")return null;throw r}if(t!==A(ue()))return O(h(e))}const n=S(e).key,o=B(n).settings;return n==="user"&&pe()?me(vn(),o):o}s(P,"readRawAtRoot");async function ye(e,n){let o;return await W(t=>{const r=t.settings[e],i=e==="user"&&pe(),c=n(structuredClone((i?me(t,r??null):r)??{}));return o=c.value,i?wn(t,c.next,I(r)):[{op:"settings.replace",owner:e,raw:c.next,ifRevision:I(r)}]}),o}s(ye,"mutatePersonSettings");async function V(e,n){const o=S(e);if(o.kind==="project"){H(h(o.root),t=>q(t,n,{createParent:!1}));return}await ye(o.key,()=>({value:void 0,next:n}))}s(V,"writeRawAtRoot");async function j(e,n){const o=S(e);return o.kind==="project"?H(h(o.root),t=>{const r=n(O(t)??{});return q(t,r.next,{createParent:!1}),r.value}):await ye(o.key,n)}s(j,"mutateRawAtRoot");const C=globalThis,T=Symbol.for("crtr.broker.config-snapshot");function jt(e){C[T]=e}s(jt,"installBrokerConfigSnapshot");function xt(){return C[T]}s(xt,"brokerConfigSnapshot");function xn(e){const n=C[T];if(n){if(e!=="user")throw new Error(`broker config snapshot has no ${e} scope`);return n.user}const o=g(e);return o?Rn(o):w()}s(xn,"readConfig");function Rn(e){const n=P(e);return n?z(n):w()}s(Rn,"readConfigAtRoot");function En(e){const n=O(J(e));return{marketplaces:n?.marketplaces??{},plugins:n?.plugins??{},activeCanvas:n?.activeCanvas??null,...n?.last_self_check===void 0?{}:{last_self_check:n.last_self_check}}}s(En,"readProjectState");function On(e){const n=g(e);return n?e==="project"?Xe(n)?En(n):se():_n(S(n).key):se()}s(On,"readState");class In extends Error{static{s(this,"InvalidRawSettingsError")}constructor(n){super(`settings cannot be merged: ${n instanceof Error?n.message:String(n)}`),this.name="InvalidRawSettingsError"}}function he(e){if(e.scope==="user")return"user";if(!fe().some(n=>n.profileId===e.profileId))throw gn(`profile not found: ${e.profileId}`,{received:e.profileId,next:"Run `crtr profile list` to see available profiles."});return`profile:${e.profileId}`}s(he,"rawSettingsKeyForTarget");function Rt(e){return B(he(e))}s(Rt,"readRawSettingsForTarget");async function Et(e,n,o){const t=he(e);try{z(n)}catch(u){throw new In(u)}if(B(t).revision!==o)throw new le;const i=await W(u=>I(u.settings[t])===o?[{op:"settings.replace",owner:t,raw:n,ifRevision:o}]:(()=>{throw new le})()),c=I(i.settings[t]);return{revision:c,changed:c!==o}}s(Et,"replaceRawSettingsForTarget");async function Ot(e,n){const o=k(e);return await j(o,t=>{const r=n(t);return{value:r,next:r}})}s(Ot,"updateRawConfigAtomically");async function It(e,n){await V(k(e),n)}s(It,"writeConfig");async function Pt(e,n){await V(k(e),n)}s(Pt,"writeRawConfig");function Pn(e,n){H(J(e),o=>q(o,n,{createParent:!1}))}s(Pn,"writeProjectState");async function Cn(e,n){const o=k(e);if(e==="project"){Pn(o,n);return}const t=S(o).key;await W(()=>[{op:"state.write",owner:t,state:n}])}s(Cn,"writeState");async function Ct(e,n){if(e!=="project"){hn(n);return}try{Qe(n)}catch(o){if(o.code!=="EEXIST"||!en(n).isDirectory())throw o}O(h(n))===null&&await V(n,{schema_version:w().schema_version})}s(Ct,"ensureScopeInitialized");function Tn(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[o,t]of Object.entries(e))Array.isArray(t)&&t.every(r=>typeof r=="string")&&(n[o]=[...t]);return n}s(Tn,"normalizeKeybindings");const $n=new Set(ln.filter(mn).map(e=>e.id));function Mn(e){return Array.isArray(e)?[...new Set(e.filter(n=>typeof n=="string"&&pn.has(n)&&$n.has(n)))]:[]}s(Mn,"normalizeTmuxPassthrough");function $(e,n=dn()){const o=n;if(e===null||typeof e!="object")return o;const t=e,r={anthropic:{...o.anthropic},openai:{...o.openai},...o.defaultProvider!==void 0?{defaultProvider:o.defaultProvider}:{}};(t.defaultProvider==="anthropic"||t.defaultProvider==="openai")&&(r.defaultProvider=t.defaultProvider);for(const i of["anthropic","openai"]){const c=t[i];if(!(c===null||typeof c!="object"))for(const[u,d]of Object.entries(c))(u==="ultra"||u==="strong"||u==="medium"||u==="light")&&typeof d=="string"&&(r[i][u]=d)}return r}s($,"mergeModelLadders");function be(e){return e==="ultra"||e==="strong"||e==="medium"||e==="light"}s(be,"validStrength");const Y=["ultra","strong","medium","light"];function Z(){return Object.create(null)}s(Z,"routeRecord");function x(e,n,o){Object.defineProperty(e,n,{value:o,writable:!0,enumerable:!0,configurable:!0})}s(x,"setRouteRecord");function ve(e){const n=Z();for(const[o,t]of Object.entries(e??{}))x(n,o,t);return n}s(ve,"copyRouteRecord");function R(e,n){ce({level:"warn",event:"config.model_routes.invalid",fields:{route_id:e,rule:n}})}s(R,"routeInvalid");function M(e,n={}){const o=ve(n);if(e===null||typeof e!="object"||Array.isArray(e))return o;for(const[t,r]of Object.entries(e)){if(t.trim()===""){R(t,"route id must be a non-empty string");continue}if(r===null||typeof r!="object"||Array.isArray(r)){R(t,"route must be an object");continue}const i=r,c=o[t],u={...c};let d;for(const f of["family","credentialSource","providerId"]){const a=i[f];if(a!==void 0){if(typeof a!="string"||a.trim()===""){d=`${f} must be a non-empty string`;break}u[f]=a}}if(d===void 0&&i.models!==void 0)if(i.models===null||typeof i.models!="object"||Array.isArray(i.models))d="models must be an object";else{const f={...c?.models};for(const[a,l]of Object.entries(i.models)){if(!be(a)){d=`models.${a} is not a model strength`;break}if(typeof l!="string"||l.trim()===""){d=`models.${a} must be a non-empty provider/id ref`;break}const p=l.indexOf("/");if(p<=0||p===l.length-1){d=`models.${a} must be provider/id`;break}f[a]=l}u.models=f}if(d===void 0&&u.models!==void 0&&u.providerId!==void 0){for(const[f,a]of Object.entries(u.models))if(a.slice(0,a.indexOf("/"))!==u.providerId){d=`models.${f} provider prefix must equal providerId`;break}}if(d!==void 0){R(t,d);continue}x(o,t,u)}return o}s(M,"mergeModelRoutePatches");function _e(e){const n=Z(),o=Z();for(const[t,r]of Object.entries(e)){if(r.family===void 0||r.credentialSource===void 0||r.providerId===void 0||r.models===void 0){R(t,"route must include family, credentialSource, providerId, and models");continue}const i=Y.filter(c=>r.models[c]===void 0);if(i.length>0){R(t,`incomplete route; missing strengths: ${i.join(", ")}`),x(o,t,{family:r.family,credentialSource:r.credentialSource,providerId:r.providerId,models:r.models});continue}x(n,t,{family:r.family,credentialSource:r.credentialSource,providerId:r.providerId,models:r.models})}return{complete:n,legacy:o}}s(_e,"resolveModelRoutes");function Nn(e,n){if(e.trim()==="")throw new Error("model route id must be a non-empty string");for(const t of["family","credentialSource","providerId"])if(typeof n[t]!="string"||n[t].trim()==="")throw new Error(`model route "${e}" ${t} must be a non-empty string`);const o=Y.filter(t=>n.models?.[t]===void 0);if(o.length>0)throw new Error(`model route "${e}" is incomplete; missing strengths: ${o.join(", ")}`);for(const t of Y){const r=n.models[t];if(typeof r!="string"||r.trim()==="")throw new Error(`model route "${e}" models.${t} must be a non-empty provider/id ref`);const i=r.indexOf("/");if(i<=0||i===r.length-1)throw new Error(`model route "${e}" models.${t} must be provider/id`);if(r.slice(0,i)!==n.providerId)throw new Error(`model route "${e}" models.${t} provider prefix must equal providerId`)}}s(Nn,"assertCompleteModelRoute");function N(e,n){if(e===void 0||e===null||typeof e!="object"||Array.isArray(e))return n;const o=e,t=s(i=>Array.isArray(i)&&i.every(c=>typeof c=="string"&&c.trim()!=="")?[...i]:void 0,"strings"),r=Array.isArray(o.strengthFallback)&&o.strengthFallback.every(i=>be(i))?[...o.strengthFallback]:void 0;return{...t(o.credentialSourceOrder)!==void 0?{credentialSourceOrder:t(o.credentialSourceOrder)}:{},...t(o.familyOrder)!==void 0?{familyOrder:t(o.familyOrder)}:{},...r!==void 0?{strengthFallback:r}:{}}}s(N,"mergeModelRouting");function Ln(e){return e!==""&&e.replace(/\*/g,"")===""}s(Ln,"isInheritAllGlob");function L(e,n=[]){const o=e,t=Array.isArray(o?.allow)?o.allow.filter(r=>typeof r=="string"):[];for(const r of t)if(Ln(r))throw new Error(`spawnEnv.allow: "${r}" matches every env var name (inherit-all) \u2014 this is exactly the leak the spawn-env boundary closes. Name the specific vars/prefixes you actually need instead (e.g. "AWS_*", "GIT_ASKPASS").`);return{allow:[...new Set([...n,...t])]}}s(L,"mergeSpawnEnv");function F(e,n={}){const o={};for(const[t,r]of Object.entries(n))o[t]={...r};if(e!==null&&typeof e=="object")for(const[t,r]of Object.entries(e)){if(r===null||typeof r!="object")continue;const i={...o[t]},c=r.fastMode;typeof c=="boolean"&&(i.fastMode=c),o[t]=i}return o}s(F,"mergeProviderOptions");const we=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Fn=new Set(["crtr","crtrd"]);function D(e,n){if(n==="bin"&&Fn.has(e))return`${n}.${e} is reserved by crouter \u2014 pick another bare command name`;if(!we.test(e))return`${n}.${e} is not a safe bare command name (expected ${we.source})`}s(D,"bareCommandNameIssue");function Dn(e){if(e===null||typeof e!="object"||Array.isArray(e))return[{name:"bin",message:"bin must be a JSON object mapping bare command name to a relative path"}];const n=[];for(const[o,t]of Object.entries(e)){const r=D(o,"bin");r!==void 0&&n.push({name:o,message:r}),(typeof t!="string"||t.trim()==="")&&n.push({name:o,message:`bin.${o} must be a non-empty relative path to an executable inside the contributor root`})}return n}s(Dn,"binDeclarationIssues");function Kn(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[o,t]of Object.entries(e))D(o,"bin")===void 0&&(typeof t!="string"||t.trim()===""||(n[o]=t));return n}s(Kn,"normalizeBin");const ke=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;function zn(e){if(e===null||typeof e!="object"||Array.isArray(e))return[{name:"humanActions",reason:"humanActions must be a JSON object mapping action names to {argv, cwd}",block:!0}];const n=[];for(const[o,t]of Object.entries(e)){const r=[];if(ke.test(o)||r.push(`action name must match ${ke.source}`),t===null||typeof t!="object"||Array.isArray(t))r.push("action must be an object with argv and cwd");else{const i=t,c=Object.keys(i).filter(u=>u!=="argv"&&u!=="cwd");c.length>0&&r.push(`action has unsupported field${c.length===1?"":"s"}: ${c.join(", ")}`),(!Array.isArray(i.argv)||i.argv.length===0||!i.argv.every(u=>typeof u=="string"&&u.length>0))&&r.push("argv must be a non-empty array of non-empty strings"),(typeof i.cwd!="string"||i.cwd.length===0)&&r.push("cwd is required and must be a non-empty string")}r.length>0&&n.push({name:o,reason:r.join("; ")})}return n}s(zn,"humanActionDeclarationIssues");function Un(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n=new Set(zn(e).map(t=>t.name)),o={};for(const[t,r]of Object.entries(e)){if(n.has(t))continue;const i=r;o[t]={argv:[...i.argv],cwd:i.cwd}}return o}s(Un,"normalizeHumanActions");function Tt(e){return Dn(e).map(n=>n.message)}s(Tt,"invalidPluginBinReasons");function $t(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[o,t]of Object.entries(e))D(o,"requires")===void 0&&(typeof t!="string"||t.trim()===""||/[\r\n]/.test(t)||(n[o]=t));return n}s($t,"normalizeRequires");function Mt(e){if(e===null||typeof e!="object"||Array.isArray(e))return["requires must be a JSON object mapping a bare executable name to a one-line install hint"];const n=[];for(const[o,t]of Object.entries(e)){const r=D(o,"requires");r!==void 0&&n.push(r),typeof t!="string"||t.trim()===""?n.push(`requires.${o} must be a non-empty one-line install hint`):/[\r\n]/.test(t)&&n.push(`requires.${o} must be a one-line install hint`)}return n}s(Mt,"invalidPluginRequiresReasons");function Ae(e){if(e===null||typeof e!="object")return null;const n=e,o={};typeof n.whenToUse=="string"&&n.whenToUse.trim()!==""&&(o.whenToUse=n.whenToUse),typeof n.model=="string"&&n.model.trim()!==""&&(o.model=n.model),typeof n.orchestratorModel=="string"&&n.orchestratorModel.trim()!==""&&(o.orchestratorModel=n.orchestratorModel);const t=s(r=>Array.isArray(r)&&r.every(i=>typeof i=="string"),"isStringArray");return t(n.tools)&&(o.tools=n.tools),t(n.extensions)&&(o.extensions=n.extensions),t(n.availableTo)&&(o.availableTo=n.availableTo),Object.keys(o).length>0?o:null}s(Ae,"normalizeKindFields");function b(e,n=an()){const o={...n};if(e!==null&&typeof e=="object")for(const[t,r]of Object.entries(e)){const i=Ae(r);if(i===null)continue;const c=o[t];c!==void 0?o[t]={...c,...i}:i.whenToUse!==void 0&&(o[t]=i)}return o}s(b,"mergeKinds");let K;function Nt(e){K=e}s(Nt,"setAppPluginKinds");function Se(e,n,o){if(e==="user"&&K!==void 0){let i=o;for(const c of Object.keys(K).sort((u,d)=>u.localeCompare(d)))i=b(K[c],i);return i}if(n===null)return o;const t=de(e,n).filter(i=>i.enabled&&i.manifest.kinds!==void 0).sort((i,c)=>i.name.localeCompare(c.name));let r=o;for(const i of t)r=b(i.manifest.kinds,r);return r}s(Se,"layerPluginKinds");function Lt(){const e=[{origin:"config.json",components:xn("user").page_components}],n=g("user");if(n!==null){const o=de("user",n).filter(t=>t.enabled&&t.manifest.page_components!==void 0).sort((t,r)=>t.name.localeCompare(r.name));for(const t of o){const r=`plugin "${t.name}" page_components`;e.push({origin:`plugin "${t.name}"`,components:ge(t.manifest.page_components,r)})}}return jn(e)}s(Lt,"resolvePageComponents");const X=new Set(["whenToUse","model","orchestratorModel","tools","extensions","availableTo"]);function Ft(e){if(e===null||typeof e!="object"||Array.isArray(e))return["kinds must be a JSON object keyed by kind name"];const n=[],o=s(t=>Array.isArray(t)&&t.every(r=>typeof r=="string"),"isStringArray");for(const[t,r]of Object.entries(e)){if(t.trim()===""){n.push("kinds contains an empty kind name");continue}if(r===null||typeof r!="object"||Array.isArray(r)){n.push(`kinds.${t} must be a JSON object`);continue}const i=r;for(const c of Object.keys(i))X.has(c)||n.push(`kinds.${t}.${c} is not a KindConfig field (expected one of: ${[...X].join(", ")})`);i.whenToUse!==void 0&&(typeof i.whenToUse!="string"||i.whenToUse.trim()==="")&&n.push(`kinds.${t}.whenToUse must be a non-empty string`);for(const c of["model","orchestratorModel"])i[c]!==void 0&&(typeof i[c]!="string"||i[c].trim()==="")&&n.push(`kinds.${t}.${c} must be a non-empty string`);for(const c of["tools","extensions","availableTo"])i[c]!==void 0&&!o(i[c])&&n.push(`kinds.${t}.${c} must be an array of strings`);Ae(r)===null&&n.push(`kinds.${t} has no valid KindConfig field \u2014 an entry must set at least one of: ${[...X].join(", ")} (whenToUse is required when the kind exists in no lower layer)`)}return n}s(Ft,"invalidPluginKindsReasons");function Gn(e){if(e===null||typeof e!="object")return null;const n=e;if(typeof n.previewEndpoint!="string"||n.previewEndpoint.trim()===""||typeof n.relayTokenRef!="string"||n.relayTokenRef.trim()==="")return null;const o={previewEndpoint:n.previewEndpoint,relayTokenRef:n.relayTokenRef};return typeof n.cpOrigin=="string"&&n.cpOrigin.trim()!==""&&(o.cpOrigin=n.cpOrigin),o}s(Gn,"normalizeRemoteCanvasTarget");function qn(e,n=fn()){const o={...n.targets};if(e!==null&&typeof e=="object"){const t=e;if(t.targets!==null&&typeof t.targets=="object")for(const[r,i]of Object.entries(t.targets)){const c=Gn(i);c!==null&&(o[r]=c)}}return{targets:o}}s(qn,"mergeRemoteCanvas");function je(e,n){return e===!0?"notify":e===!1?!1:e==="notify"||e==="apply"?e:n}s(je,"normalizeMode");function E(e,n){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=1?e:n}s(E,"normalizePositiveInteger");function Bn(e,n){const o=e!==null&&typeof e=="object"?e:{},t=E(o.warning,n.warning),r=E(o.automaticReviveCap,n.automaticReviveCap);return t<=r?{warning:t,automaticReviveCap:r}:{...n}}s(Bn,"mergeBrokerThresholds");function Wn(e,n){return{unattendedParkMs:E((e!==null&&typeof e=="object"?e:{}).unattendedParkMs,n.unattendedParkMs)}}s(Wn,"mergeLifecycle");function Hn(e){if(!Array.isArray(e))return[...ie];const n=e.filter(o=>typeof o=="string"&&o.trim()!=="").map(o=>o.trim());return n.length>0?n:[...ie]}s(Hn,"normalizeWhipMessages");function Jn(e,n){if(e===null||typeof e!="object")return{...n};const o=e.tcp;return{tcp:typeof o=="string"?o:n.tcp}}s(Jn,"mergeApi");let xe=!1;function z(e){!xe&&e.ledger!==void 0&&(xe=!0,ce({level:"warn",event:"config.ledger.ignored",fields:{variables:Object.values(yn)}}));const n=w(),o=n.schema_version,t=e.marketplaces===void 0?{}:e.marketplaces,r=e.plugins===void 0?{}:e.plugins,i=e.auto_update,c=i&&typeof i.interval_hours=="number"?i.interval_hours:void 0,u=c!==void 0&&Number.isFinite(c)&&c>=0?c:n.auto_update.interval_hours,d={crtr:je(i?.crtr,n.auto_update.crtr),content:je(i?.content,n.auto_update.content),interval_hours:u},f=e.max_panes_per_window,a=E(f,n.max_panes_per_window),l=typeof e.auto_open_child_viewers=="boolean"?e.auto_open_child_viewers:n.auto_open_child_viewers,p=Bn(e.brokerThresholds,n.brokerThresholds),y=Wn(e.lifecycle,n.lifecycle),U=typeof e.completion_bell=="boolean"?e.completion_bell:n.completion_bell,m=e.working_gerunds===void 0?[...n.working_gerunds]:Sn(e.working_gerunds),Ee=typeof e.whip_mode=="boolean"?e.whip_mode:n.whip_mode,Oe=ge(e.page_components),Ie=typeof e.page_surface=="boolean"?e.page_surface:n.page_surface,Pe=Hn(e.whip_messages),Ce=un.includes(e.whip_message_mode)?e.whip_message_mode:n.whip_message_mode,Te=cn.includes(e.mouse_mode_default)?e.mouse_mode_default:n.mouse_mode_default,$e=E(e.live_cycles,n.live_cycles),Me=rn.includes(e.condensed_history)?e.condensed_history:n.condensed_history,Ne=typeof e.bash_tool_purpose=="boolean"?e.bash_tool_purpose:n.bash_tool_purpose,Le=sn.includes(e.verbosity)?e.verbosity:n.verbosity,Fe=typeof e.detailed_tool_recaps=="boolean"?e.detailed_tool_recaps:n.detailed_tool_recaps,De=Number.isInteger(e.document_port)&&e.document_port>=1&&e.document_port<=65535?e.document_port:n.document_port,Ke=Tn(e.keybindings),ze=Mn(e.tmux_passthrough),Ue=$(e.modelLadders),Ge=F(e.providerOptions,n.providerOptions),G=_e(M(e.modelRoutes)),Q=G.complete,ee=N(e.modelRouting,void 0),qe=b(e.kinds),Be=qn(e.remoteCanvas),We=Jn(e.api,n.api),v=e.paths;if(v?.user_files!==void 0&&(typeof v.user_files!="string"||!v.user_files.startsWith("/")))throw new Error("paths.user_files must be an absolute path");const ne=e.store,_=e.runtime;if(_?.person_uids!==void 0&&(!Array.isArray(_.person_uids)||!_.person_uids.every(te=>Number.isSafeInteger(te)&&te>=0)))throw new Error("runtime.person_uids must be an array of nonnegative integer uids");const He=L(e.spawnEnv,n.spawnEnv?.allow),Je=Kn(e.bin),Ve=Un(e.humanActions);return{bin:Je,humanActions:Ve,schema_version:o,marketplaces:t,plugins:r,auto_update:d,max_panes_per_window:a,auto_open_child_viewers:l,brokerThresholds:p,lifecycle:y,completion_bell:U,working_gerunds:m,whip_mode:Ee,page_components:Oe,page_surface:Ie,whip_messages:Pe,whip_message_mode:Ce,mouse_mode_default:Te,live_cycles:$e,condensed_history:Me,bash_tool_purpose:Ne,verbosity:Le,detailed_tool_recaps:Fe,document_port:De,keybindings:Ke,tmux_passthrough:ze,modelLadders:Ue,providerOptions:Ge,...Object.keys(Q).length>0?{modelRoutes:Q}:{},...Object.keys(G.legacy).length>0?{legacyModelRoutes:G.legacy}:{},...ee!==void 0?{modelRouting:ee}:{},kinds:qe,remoteCanvas:Be,api:We,...v?{paths:v}:{},...ne?{store:ne}:{},..._?{runtime:_}:{},spawnEnv:He}}s(z,"mergeConfig");function Vn(e){return P(e)}s(Vn,"readRawConfigAtRoot");function Yn(e){const n=g(e);return n?Vn(n):null}s(Yn,"readRawScopeConfig");function Zn(e){if(e===null||e==="")return null;try{return P(ae(e))}catch{return null}}s(Zn,"readRawProfileConfig");function Xn(e,n){return[...bn(e,n)].reverse().map(r=>({root:r,raw:P(r)}))}s(Xn,"readRawProjectScopeConfigs");function Re(e=process.cwd(),n=Ze()||null){const o=C[T];if(o)return o.launch;const t=w(),r=Yn("user"),i=Zn(n),c=Xn(e,n);let u=b(r?.kinds,Se("user",g("user"),t.kinds)),d=$(r?.modelLadders,t.modelLadders),f=F(r?.providerOptions,t.providerOptions),a=M(r?.modelRoutes),l=N(r?.modelRouting,void 0),p=L(r?.spawnEnv,t.spawnEnv?.allow);i!==null&&(u=b(i.kinds,u),d=$(i.modelLadders,d),f=F(i.providerOptions,f),a=M(i.modelRoutes,a),l=N(i.modelRouting,l),p=L(i.spawnEnv,p.allow));for(const{root:U,raw:m}of c)u=b(m?.kinds,Se("project",U,u)),m!==null&&(d=$(m.modelLadders,d),f=F(m.providerOptions,f),a=M(m.modelRoutes,a),l=N(m.modelRouting,l),p=L(m.spawnEnv,p.allow));const y=_e(a);return{kinds:u,modelLadders:d,providerOptions:f,...Object.keys(y.complete).length>0?{modelRoutes:y.complete}:{},...Object.keys(y.legacy).length>0?{legacyModelRoutes:y.legacy}:{},...l!==void 0?{modelRouting:l}:{},spawnEnv:p}}s(Re,"readMergedLaunchConfig");function Dt(e){return Re().kinds[e]}s(Dt,"resolveKindConfig");function Kt(e){const n=Re().kinds,o=[];for(const[t,r]of Object.entries(n)){const i=t.indexOf("/");if(i===-1)continue;const c=t.slice(0,i),u=r.availableTo??[c];(u.includes("*")||u.includes(e))&&o.push({kind:t,whenToUse:r.whenToUse})}return o.sort((t,r)=>t.kind.localeCompare(r.kind))}s(Kt,"subKindsAvailableTo");function Qn(e,n,o){const t={...e??{}};t.anthropic!==void 0&&(t.anthropic={...t.anthropic}),t.openai!==void 0&&(t.openai={...t.openai}),o.defaultProvider!==n.defaultProvider&&o.defaultProvider!==void 0&&(t.defaultProvider=o.defaultProvider);for(const i of["anthropic","openai"])for(const c of["ultra","strong","medium","light"])o[i][c]!==n[i][c]&&(t[i]={...t[i]??{},[c]:o[i][c]});return t.defaultProvider!==void 0||t.anthropic!==void 0||t.openai!==void 0?t:void 0}s(Qn,"sparseModelLaddersToPersist");async function et(e,n){return await j(e,o=>{const t=z(o),r=z(o);n(r);const i={...o};for(const u of An)u!=="modelLadders"&&!nn(r[u],t[u])&&(i[u]=r[u]);const c=Qn(o.modelLadders,t.modelLadders,r.modelLadders);return c!==void 0?i.modelLadders=c:delete i.modelLadders,{value:r,next:i}})}s(et,"mutateConfigAtRoot");async function zt(e,n){await j(e,o=>{const t=o.modelLadders??{},r={...t};n.defaultProvider!==void 0&&(r.defaultProvider=n.defaultProvider);for(const i of["anthropic","openai"])n[i]!==void 0&&(r[i]={...t[i]??{},...n[i]});return{value:void 0,next:{...o,modelLadders:r}}})}s(zt,"persistModelLadders");async function Ut(e,n,o){if(o!==void 0)Nn(n,o);else if(n.trim()==="")throw new Error("model route id must be a non-empty string");await j(e,t=>{const r=ve(t.modelRoutes??{});o===void 0?delete r[n]:x(r,n,{...o,models:{...o.models}});const i={...t};return Object.keys(r).length===0?delete i.modelRoutes:i.modelRoutes=r,{value:void 0,next:i}})}s(Ut,"persistModelRoute");async function nt(e,n){return await et(e,n)}s(nt,"updateConfigAtRoot");async function Gt(e,n){return await nt(k(e),n)}s(Gt,"updateConfig");async function qt(e){const n=e.orchestrator===!0?"orchestratorModel":"model";return await j(e.root,o=>{const t={...o.kinds??{},[e.kind]:{...(o.kinds??{})[e.kind],[n]:e.model}};return{value:void 0,next:{...o,kinds:t}}}),{path:h(e.root),field:n}}s(qt,"persistDefaultKindModel");async function Bt(e,n){const o=On(e);return n(o),await Cn(e,o),o}s(Bt,"updateState");export{In as InvalidRawSettingsError,Dn as binDeclarationIssues,xt as brokerConfigSnapshot,At as configPath,Ct as ensureScopeInitialized,zn as humanActionDeclarationIssues,jt as installBrokerConfigSnapshot,Tt as invalidPluginBinReasons,Ft as invalidPluginKindsReasons,Mt as invalidPluginRequiresReasons,Kn as normalizeBin,Un as normalizeHumanActions,$t as normalizeRequires,Mn as normalizeTmuxPassthrough,qt as persistDefaultKindModel,zt as persistModelLadders,Ut as persistModelRoute,xn as readConfig,Rn as readConfigAtRoot,Re as readMergedLaunchConfig,Vn as readRawConfigAtRoot,Yn as readRawScopeConfig,Rt as readRawSettingsForTarget,On as readState,Et as replaceRawSettingsForTarget,Dt as resolveKindConfig,Lt as resolvePageComponents,Nt as setAppPluginKinds,St as statePath,Kt as subKindsAvailableTo,Gt as updateConfig,nt as updateConfigAtRoot,Ot as updateRawConfigAtomically,Bt as updateState,It as writeConfig,Pt as writeRawConfig,Cn as writeState};
|
|
1
|
+
var Ye=Object.defineProperty;var s=(e,n)=>Ye(e,"name",{value:n,configurable:!0});import{envProfileId as Ze}from"../shared/env.js";import{basename as oe,join as re}from"node:path";import{existsSync as Xe,mkdirSync as Qe,statSync as en}from"node:fs";import{isDeepStrictEqual as nn}from"node:util";import{CONFIG_FILE as tn,STATE_FILE as on,CONDENSED_HISTORY_MODES as rn,VERBOSITY_LEVELS as sn,MOUSE_MODE_DEFAULTS as cn,WHIP_MESSAGE_MODES as un,DEFAULT_WHIP_MESSAGES as ie,defaultScopeConfig as w,defaultScopeState as se,defaultModelLaddersConfig as dn,defaultKindsConfig as an,defaultRemoteCanvasConfig as fn}from"../types.js";import{BINDING_CATALOG as ln,BINDING_IDS as pn,isAttachPaneBinding as mn}from"./keybindings/catalog.js";import{notFound as gn}from"./errors.js";import{emitEvent as ce}from"./events/emit.js";import{LEDGER_ENV as yn}from"./ledger/rates.js";import{atomicWriteJson as q,readJsonIfExists as E,ensureDir as hn}from"./fs-utils.js";import{scopeRoot as g,requireScopeRoot as k,findProjectScopeRoots as bn,userScopeRoot as ue}from"./scope.js";import{listInstalledPluginsInRoot as de}from"./installed-plugins.js";import{profileDir as ae,listProfiles as fe}from"./profiles/manifest.js";import{canonicalRoot as A}from"./scoped-state/paths.js";import{currentSnapshot as vn,readCachedSettings as B,readCachedState as _n,revisionOf as I,SettingsRevisionConflictError as le,writeSettings as H}from"./scoped-state/person-store.js";import{importedIntoNorthlight as pe,splitUserSettingsWrite as wn,withAppInstalls as me}from"./scoped-state/imported-mac-installs.js";import{withExclusiveDirectoryLock as kn}from"./exclusive-lock.js";import{SCOPE_CONFIG_KEYS as An}from"./user-settings.js";import{normalizeWorkingGerunds as Sn}from"../shared/working-activity.js";import{mergePageComponentLayers as jn,normalizePageComponents as ge}from"./human/page-catalog.js";function h(e){return re(e,tn)}s(h,"configPathFor");function W(e,n){return kn(`${e}.lock`,()=>n(e),{timeoutError:s(()=>new Error(`timed out waiting for config lock: ${e}`),"timeoutError")})}s(W,"withConfigPathLock");function J(e){return re(e,on)}s(J,"statePathFor");function St(e){const n=g(e);return n?h(n):null}s(St,"configPath");function jt(e){const n=g(e);return n?J(n):null}s(jt,"statePath");function S(e){const n=A(e),o=A(ue());if(n===o)return{key:"user",kind:"user",root:o};if(oe(n)===".crouter")return{key:"project",kind:"project",root:n};for(const t of fe()){const r=A(ae(t.profileId));if(n===r)return{key:`profile:${t.profileId}`,kind:"profile",root:r,profileId:t.profileId}}throw new Error(`settings root is not a recognized owner: ${e}`)}s(S,"settingsOwnerForRoot");function P(e){if(oe(e)===".crouter"){let t;try{t=A(e)}catch(r){if(r.code==="ENOENT")return null;throw r}if(t!==A(ue()))return E(h(e))}const n=S(e).key,o=B(n).settings;return n==="user"&&pe()?me(vn(),o):o}s(P,"readRawAtRoot");async function ye(e,n){let o;return await H(t=>{const r=t.settings[e],i=e==="user"&&pe(),c=n(structuredClone((i?me(t,r??null):r)??{}));return o=c.value,i?wn(t,c.next,I(r)):[{op:"settings.replace",owner:e,raw:c.next,ifRevision:I(r)}]}),o}s(ye,"mutatePersonSettings");async function V(e,n){const o=S(e);if(o.kind==="project"){W(h(o.root),t=>q(t,n,{createParent:!1}));return}await ye(o.key,()=>({value:void 0,next:n}))}s(V,"writeRawAtRoot");async function j(e,n){const o=S(e);return o.kind==="project"?W(h(o.root),t=>{const r=n(E(t)??{});return q(t,r.next,{createParent:!1}),r.value}):await ye(o.key,n)}s(j,"mutateRawAtRoot");const T=globalThis,C=Symbol.for("crtr.broker.config-snapshot");function xt(e){T[C]=e}s(xt,"installBrokerConfigSnapshot");function Rt(){return T[C]}s(Rt,"brokerConfigSnapshot");function xn(e){const n=T[C];if(n){if(e!=="user")throw new Error(`broker config snapshot has no ${e} scope`);return n.user}const o=g(e);return o?Rn(o):w()}s(xn,"readConfig");function Rn(e){const n=P(e);return n?z(n):w()}s(Rn,"readConfigAtRoot");function On(e){const n=E(J(e));return{marketplaces:n?.marketplaces??{},plugins:n?.plugins??{},activeCanvas:n?.activeCanvas??null,...n?.last_self_check===void 0?{}:{last_self_check:n.last_self_check}}}s(On,"readProjectState");function En(e){const n=g(e);return n?e==="project"?Xe(n)?On(n):se():_n(S(n).key):se()}s(En,"readState");class In extends Error{static{s(this,"InvalidRawSettingsError")}constructor(n){super(`settings cannot be merged: ${n instanceof Error?n.message:String(n)}`),this.name="InvalidRawSettingsError"}}function he(e){if(e.scope==="user")return"user";if(!fe().some(n=>n.profileId===e.profileId))throw gn(`profile not found: ${e.profileId}`,{received:e.profileId,next:"Run `crtr profile list` to see available profiles."});return`profile:${e.profileId}`}s(he,"rawSettingsKeyForTarget");function Ot(e){return B(he(e))}s(Ot,"readRawSettingsForTarget");async function Et(e,n,o){const t=he(e);try{z(n)}catch(u){throw new In(u)}if(B(t).revision!==o)throw new le;const i=await H(u=>I(u.settings[t])===o?[{op:"settings.replace",owner:t,raw:n,ifRevision:o}]:(()=>{throw new le})()),c=I(i.settings[t]);return{revision:c,changed:c!==o}}s(Et,"replaceRawSettingsForTarget");async function It(e,n){const o=k(e);return await j(o,t=>{const r=n(t);return{value:r,next:r}})}s(It,"updateRawConfigAtomically");async function Pt(e,n){await V(k(e),n)}s(Pt,"writeConfig");async function Tt(e,n){await V(k(e),n)}s(Tt,"writeRawConfig");function Pn(e,n){W(J(e),o=>q(o,n,{createParent:!1}))}s(Pn,"writeProjectState");async function Tn(e,n){const o=k(e);if(e==="project"){Pn(o,n);return}const t=S(o).key;await H(()=>[{op:"state.write",owner:t,state:n}])}s(Tn,"writeState");async function Ct(e,n){if(e!=="project"){hn(n);return}try{Qe(n)}catch(o){if(o.code!=="EEXIST"||!en(n).isDirectory())throw o}E(h(n))===null&&await V(n,{schema_version:w().schema_version})}s(Ct,"ensureScopeInitialized");function Cn(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[o,t]of Object.entries(e))Array.isArray(t)&&t.every(r=>typeof r=="string")&&(n[o]=[...t]);return n}s(Cn,"normalizeKeybindings");const $n=new Set(ln.filter(mn).map(e=>e.id)),Mn=Object.freeze(["crtr.attach.scroll.up","crtr.attach.scroll.down","crtr.attach.scroll.page-up","crtr.attach.scroll.page-down","crtr.attach.scroll.live"]);function Nn(e){return e===void 0?[...Mn]:Array.isArray(e)?[...new Set(e.filter(n=>typeof n=="string"&&pn.has(n)&&$n.has(n)))]:[]}s(Nn,"normalizeTmuxPassthrough");function $(e,n=dn()){const o=n;if(e===null||typeof e!="object")return o;const t=e,r={anthropic:{...o.anthropic},openai:{...o.openai},...o.defaultProvider!==void 0?{defaultProvider:o.defaultProvider}:{}};(t.defaultProvider==="anthropic"||t.defaultProvider==="openai")&&(r.defaultProvider=t.defaultProvider);for(const i of["anthropic","openai"]){const c=t[i];if(!(c===null||typeof c!="object"))for(const[u,d]of Object.entries(c))(u==="ultra"||u==="strong"||u==="medium"||u==="light")&&typeof d=="string"&&(r[i][u]=d)}return r}s($,"mergeModelLadders");function be(e){return e==="ultra"||e==="strong"||e==="medium"||e==="light"}s(be,"validStrength");const Y=["ultra","strong","medium","light"];function Z(){return Object.create(null)}s(Z,"routeRecord");function x(e,n,o){Object.defineProperty(e,n,{value:o,writable:!0,enumerable:!0,configurable:!0})}s(x,"setRouteRecord");function ve(e){const n=Z();for(const[o,t]of Object.entries(e??{}))x(n,o,t);return n}s(ve,"copyRouteRecord");function R(e,n){ce({level:"warn",event:"config.model_routes.invalid",fields:{route_id:e,rule:n}})}s(R,"routeInvalid");function M(e,n={}){const o=ve(n);if(e===null||typeof e!="object"||Array.isArray(e))return o;for(const[t,r]of Object.entries(e)){if(t.trim()===""){R(t,"route id must be a non-empty string");continue}if(r===null||typeof r!="object"||Array.isArray(r)){R(t,"route must be an object");continue}const i=r,c=o[t],u={...c};let d;for(const f of["family","credentialSource","providerId"]){const a=i[f];if(a!==void 0){if(typeof a!="string"||a.trim()===""){d=`${f} must be a non-empty string`;break}u[f]=a}}if(d===void 0&&i.models!==void 0)if(i.models===null||typeof i.models!="object"||Array.isArray(i.models))d="models must be an object";else{const f={...c?.models};for(const[a,l]of Object.entries(i.models)){if(!be(a)){d=`models.${a} is not a model strength`;break}if(typeof l!="string"||l.trim()===""){d=`models.${a} must be a non-empty provider/id ref`;break}const p=l.indexOf("/");if(p<=0||p===l.length-1){d=`models.${a} must be provider/id`;break}f[a]=l}u.models=f}if(d===void 0&&u.models!==void 0&&u.providerId!==void 0){for(const[f,a]of Object.entries(u.models))if(a.slice(0,a.indexOf("/"))!==u.providerId){d=`models.${f} provider prefix must equal providerId`;break}}if(d!==void 0){R(t,d);continue}x(o,t,u)}return o}s(M,"mergeModelRoutePatches");function _e(e){const n=Z(),o=Z();for(const[t,r]of Object.entries(e)){if(r.family===void 0||r.credentialSource===void 0||r.providerId===void 0||r.models===void 0){R(t,"route must include family, credentialSource, providerId, and models");continue}const i=Y.filter(c=>r.models[c]===void 0);if(i.length>0){R(t,`incomplete route; missing strengths: ${i.join(", ")}`),x(o,t,{family:r.family,credentialSource:r.credentialSource,providerId:r.providerId,models:r.models});continue}x(n,t,{family:r.family,credentialSource:r.credentialSource,providerId:r.providerId,models:r.models})}return{complete:n,legacy:o}}s(_e,"resolveModelRoutes");function Ln(e,n){if(e.trim()==="")throw new Error("model route id must be a non-empty string");for(const t of["family","credentialSource","providerId"])if(typeof n[t]!="string"||n[t].trim()==="")throw new Error(`model route "${e}" ${t} must be a non-empty string`);const o=Y.filter(t=>n.models?.[t]===void 0);if(o.length>0)throw new Error(`model route "${e}" is incomplete; missing strengths: ${o.join(", ")}`);for(const t of Y){const r=n.models[t];if(typeof r!="string"||r.trim()==="")throw new Error(`model route "${e}" models.${t} must be a non-empty provider/id ref`);const i=r.indexOf("/");if(i<=0||i===r.length-1)throw new Error(`model route "${e}" models.${t} must be provider/id`);if(r.slice(0,i)!==n.providerId)throw new Error(`model route "${e}" models.${t} provider prefix must equal providerId`)}}s(Ln,"assertCompleteModelRoute");function N(e,n){if(e===void 0||e===null||typeof e!="object"||Array.isArray(e))return n;const o=e,t=s(i=>Array.isArray(i)&&i.every(c=>typeof c=="string"&&c.trim()!=="")?[...i]:void 0,"strings"),r=Array.isArray(o.strengthFallback)&&o.strengthFallback.every(i=>be(i))?[...o.strengthFallback]:void 0;return{...t(o.credentialSourceOrder)!==void 0?{credentialSourceOrder:t(o.credentialSourceOrder)}:{},...t(o.familyOrder)!==void 0?{familyOrder:t(o.familyOrder)}:{},...r!==void 0?{strengthFallback:r}:{}}}s(N,"mergeModelRouting");function Fn(e){return e!==""&&e.replace(/\*/g,"")===""}s(Fn,"isInheritAllGlob");function L(e,n=[]){const o=e,t=Array.isArray(o?.allow)?o.allow.filter(r=>typeof r=="string"):[];for(const r of t)if(Fn(r))throw new Error(`spawnEnv.allow: "${r}" matches every env var name (inherit-all) \u2014 this is exactly the leak the spawn-env boundary closes. Name the specific vars/prefixes you actually need instead (e.g. "AWS_*", "GIT_ASKPASS").`);return{allow:[...new Set([...n,...t])]}}s(L,"mergeSpawnEnv");function F(e,n={}){const o={};for(const[t,r]of Object.entries(n))o[t]={...r};if(e!==null&&typeof e=="object")for(const[t,r]of Object.entries(e)){if(r===null||typeof r!="object")continue;const i={...o[t]},c=r.fastMode;typeof c=="boolean"&&(i.fastMode=c),o[t]=i}return o}s(F,"mergeProviderOptions");const we=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Dn=new Set(["crtr","crtrd"]);function D(e,n){if(n==="bin"&&Dn.has(e))return`${n}.${e} is reserved by crouter \u2014 pick another bare command name`;if(!we.test(e))return`${n}.${e} is not a safe bare command name (expected ${we.source})`}s(D,"bareCommandNameIssue");function Un(e){if(e===null||typeof e!="object"||Array.isArray(e))return[{name:"bin",message:"bin must be a JSON object mapping bare command name to a relative path"}];const n=[];for(const[o,t]of Object.entries(e)){const r=D(o,"bin");r!==void 0&&n.push({name:o,message:r}),(typeof t!="string"||t.trim()==="")&&n.push({name:o,message:`bin.${o} must be a non-empty relative path to an executable inside the contributor root`})}return n}s(Un,"binDeclarationIssues");function zn(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[o,t]of Object.entries(e))D(o,"bin")===void 0&&(typeof t!="string"||t.trim()===""||(n[o]=t));return n}s(zn,"normalizeBin");const ke=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;function Kn(e){if(e===null||typeof e!="object"||Array.isArray(e))return[{name:"humanActions",reason:"humanActions must be a JSON object mapping action names to {argv, cwd}",block:!0}];const n=[];for(const[o,t]of Object.entries(e)){const r=[];if(ke.test(o)||r.push(`action name must match ${ke.source}`),t===null||typeof t!="object"||Array.isArray(t))r.push("action must be an object with argv and cwd");else{const i=t,c=Object.keys(i).filter(u=>u!=="argv"&&u!=="cwd");c.length>0&&r.push(`action has unsupported field${c.length===1?"":"s"}: ${c.join(", ")}`),(!Array.isArray(i.argv)||i.argv.length===0||!i.argv.every(u=>typeof u=="string"&&u.length>0))&&r.push("argv must be a non-empty array of non-empty strings"),(typeof i.cwd!="string"||i.cwd.length===0)&&r.push("cwd is required and must be a non-empty string")}r.length>0&&n.push({name:o,reason:r.join("; ")})}return n}s(Kn,"humanActionDeclarationIssues");function Gn(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n=new Set(Kn(e).map(t=>t.name)),o={};for(const[t,r]of Object.entries(e)){if(n.has(t))continue;const i=r;o[t]={argv:[...i.argv],cwd:i.cwd}}return o}s(Gn,"normalizeHumanActions");function $t(e){return Un(e).map(n=>n.message)}s($t,"invalidPluginBinReasons");function Mt(e){if(e===null||typeof e!="object"||Array.isArray(e))return{};const n={};for(const[o,t]of Object.entries(e))D(o,"requires")===void 0&&(typeof t!="string"||t.trim()===""||/[\r\n]/.test(t)||(n[o]=t));return n}s(Mt,"normalizeRequires");function Nt(e){if(e===null||typeof e!="object"||Array.isArray(e))return["requires must be a JSON object mapping a bare executable name to a one-line install hint"];const n=[];for(const[o,t]of Object.entries(e)){const r=D(o,"requires");r!==void 0&&n.push(r),typeof t!="string"||t.trim()===""?n.push(`requires.${o} must be a non-empty one-line install hint`):/[\r\n]/.test(t)&&n.push(`requires.${o} must be a one-line install hint`)}return n}s(Nt,"invalidPluginRequiresReasons");function Ae(e){if(e===null||typeof e!="object")return null;const n=e,o={};typeof n.whenToUse=="string"&&n.whenToUse.trim()!==""&&(o.whenToUse=n.whenToUse),typeof n.model=="string"&&n.model.trim()!==""&&(o.model=n.model),typeof n.orchestratorModel=="string"&&n.orchestratorModel.trim()!==""&&(o.orchestratorModel=n.orchestratorModel);const t=s(r=>Array.isArray(r)&&r.every(i=>typeof i=="string"),"isStringArray");return t(n.tools)&&(o.tools=n.tools),t(n.extensions)&&(o.extensions=n.extensions),t(n.availableTo)&&(o.availableTo=n.availableTo),Object.keys(o).length>0?o:null}s(Ae,"normalizeKindFields");function b(e,n=an()){const o={...n};if(e!==null&&typeof e=="object")for(const[t,r]of Object.entries(e)){const i=Ae(r);if(i===null)continue;const c=o[t];c!==void 0?o[t]={...c,...i}:i.whenToUse!==void 0&&(o[t]=i)}return o}s(b,"mergeKinds");let U;function Lt(e){U=e}s(Lt,"setAppPluginKinds");function Se(e,n,o){if(e==="user"&&U!==void 0){let i=o;for(const c of Object.keys(U).sort((u,d)=>u.localeCompare(d)))i=b(U[c],i);return i}if(n===null)return o;const t=de(e,n).filter(i=>i.enabled&&i.manifest.kinds!==void 0).sort((i,c)=>i.name.localeCompare(c.name));let r=o;for(const i of t)r=b(i.manifest.kinds,r);return r}s(Se,"layerPluginKinds");function Ft(){const e=[{origin:"config.json",components:xn("user").page_components}],n=g("user");if(n!==null){const o=de("user",n).filter(t=>t.enabled&&t.manifest.page_components!==void 0).sort((t,r)=>t.name.localeCompare(r.name));for(const t of o){const r=`plugin "${t.name}" page_components`;e.push({origin:`plugin "${t.name}"`,components:ge(t.manifest.page_components,r)})}}return jn(e)}s(Ft,"resolvePageComponents");const X=new Set(["whenToUse","model","orchestratorModel","tools","extensions","availableTo"]);function Dt(e){if(e===null||typeof e!="object"||Array.isArray(e))return["kinds must be a JSON object keyed by kind name"];const n=[],o=s(t=>Array.isArray(t)&&t.every(r=>typeof r=="string"),"isStringArray");for(const[t,r]of Object.entries(e)){if(t.trim()===""){n.push("kinds contains an empty kind name");continue}if(r===null||typeof r!="object"||Array.isArray(r)){n.push(`kinds.${t} must be a JSON object`);continue}const i=r;for(const c of Object.keys(i))X.has(c)||n.push(`kinds.${t}.${c} is not a KindConfig field (expected one of: ${[...X].join(", ")})`);i.whenToUse!==void 0&&(typeof i.whenToUse!="string"||i.whenToUse.trim()==="")&&n.push(`kinds.${t}.whenToUse must be a non-empty string`);for(const c of["model","orchestratorModel"])i[c]!==void 0&&(typeof i[c]!="string"||i[c].trim()==="")&&n.push(`kinds.${t}.${c} must be a non-empty string`);for(const c of["tools","extensions","availableTo"])i[c]!==void 0&&!o(i[c])&&n.push(`kinds.${t}.${c} must be an array of strings`);Ae(r)===null&&n.push(`kinds.${t} has no valid KindConfig field \u2014 an entry must set at least one of: ${[...X].join(", ")} (whenToUse is required when the kind exists in no lower layer)`)}return n}s(Dt,"invalidPluginKindsReasons");function qn(e){if(e===null||typeof e!="object")return null;const n=e;if(typeof n.previewEndpoint!="string"||n.previewEndpoint.trim()===""||typeof n.relayTokenRef!="string"||n.relayTokenRef.trim()==="")return null;const o={previewEndpoint:n.previewEndpoint,relayTokenRef:n.relayTokenRef};return typeof n.cpOrigin=="string"&&n.cpOrigin.trim()!==""&&(o.cpOrigin=n.cpOrigin),o}s(qn,"normalizeRemoteCanvasTarget");function Bn(e,n=fn()){const o={...n.targets};if(e!==null&&typeof e=="object"){const t=e;if(t.targets!==null&&typeof t.targets=="object")for(const[r,i]of Object.entries(t.targets)){const c=qn(i);c!==null&&(o[r]=c)}}return{targets:o}}s(Bn,"mergeRemoteCanvas");function je(e,n){return e===!0?"notify":e===!1?!1:e==="notify"||e==="apply"?e:n}s(je,"normalizeMode");function O(e,n){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=1?e:n}s(O,"normalizePositiveInteger");function Hn(e,n){const o=e!==null&&typeof e=="object"?e:{},t=O(o.warning,n.warning),r=O(o.automaticReviveCap,n.automaticReviveCap);return t<=r?{warning:t,automaticReviveCap:r}:{...n}}s(Hn,"mergeBrokerThresholds");function Wn(e,n){return{unattendedParkMs:O((e!==null&&typeof e=="object"?e:{}).unattendedParkMs,n.unattendedParkMs)}}s(Wn,"mergeLifecycle");function Jn(e){if(!Array.isArray(e))return[...ie];const n=e.filter(o=>typeof o=="string"&&o.trim()!=="").map(o=>o.trim());return n.length>0?n:[...ie]}s(Jn,"normalizeWhipMessages");function Vn(e,n){if(e===null||typeof e!="object")return{...n};const o=e.tcp;return{tcp:typeof o=="string"?o:n.tcp}}s(Vn,"mergeApi");let xe=!1;function z(e){!xe&&e.ledger!==void 0&&(xe=!0,ce({level:"warn",event:"config.ledger.ignored",fields:{variables:Object.values(yn)}}));const n=w(),o=n.schema_version,t=e.marketplaces===void 0?{}:e.marketplaces,r=e.plugins===void 0?{}:e.plugins,i=e.auto_update,c=i&&typeof i.interval_hours=="number"?i.interval_hours:void 0,u=c!==void 0&&Number.isFinite(c)&&c>=0?c:n.auto_update.interval_hours,d={crtr:je(i?.crtr,n.auto_update.crtr),content:je(i?.content,n.auto_update.content),interval_hours:u},f=e.max_panes_per_window,a=O(f,n.max_panes_per_window),l=typeof e.auto_open_child_viewers=="boolean"?e.auto_open_child_viewers:n.auto_open_child_viewers,p=Hn(e.brokerThresholds,n.brokerThresholds),y=Wn(e.lifecycle,n.lifecycle),K=typeof e.completion_bell=="boolean"?e.completion_bell:n.completion_bell,m=e.working_gerunds===void 0?[...n.working_gerunds]:Sn(e.working_gerunds),Oe=typeof e.whip_mode=="boolean"?e.whip_mode:n.whip_mode,Ee=ge(e.page_components),Ie=typeof e.page_surface=="boolean"?e.page_surface:n.page_surface,Pe=Jn(e.whip_messages),Te=un.includes(e.whip_message_mode)?e.whip_message_mode:n.whip_message_mode,Ce=cn.includes(e.mouse_mode_default)?e.mouse_mode_default:n.mouse_mode_default,$e=O(e.live_cycles,n.live_cycles),Me=rn.includes(e.condensed_history)?e.condensed_history:n.condensed_history,Ne=typeof e.bash_tool_purpose=="boolean"?e.bash_tool_purpose:n.bash_tool_purpose,Le=sn.includes(e.verbosity)?e.verbosity:n.verbosity,Fe=typeof e.detailed_tool_recaps=="boolean"?e.detailed_tool_recaps:n.detailed_tool_recaps,De=Number.isInteger(e.document_port)&&e.document_port>=1&&e.document_port<=65535?e.document_port:n.document_port,Ue=Cn(e.keybindings),ze=Nn(e.tmux_passthrough),Ke=$(e.modelLadders),Ge=F(e.providerOptions,n.providerOptions),G=_e(M(e.modelRoutes)),Q=G.complete,ee=N(e.modelRouting,void 0),qe=b(e.kinds),Be=Bn(e.remoteCanvas),He=Vn(e.api,n.api),v=e.paths;if(v?.user_files!==void 0&&(typeof v.user_files!="string"||!v.user_files.startsWith("/")))throw new Error("paths.user_files must be an absolute path");const ne=e.store,_=e.runtime;if(_?.person_uids!==void 0&&(!Array.isArray(_.person_uids)||!_.person_uids.every(te=>Number.isSafeInteger(te)&&te>=0)))throw new Error("runtime.person_uids must be an array of nonnegative integer uids");const We=L(e.spawnEnv,n.spawnEnv?.allow),Je=zn(e.bin),Ve=Gn(e.humanActions);return{bin:Je,humanActions:Ve,schema_version:o,marketplaces:t,plugins:r,auto_update:d,max_panes_per_window:a,auto_open_child_viewers:l,brokerThresholds:p,lifecycle:y,completion_bell:K,working_gerunds:m,whip_mode:Oe,page_components:Ee,page_surface:Ie,whip_messages:Pe,whip_message_mode:Te,mouse_mode_default:Ce,live_cycles:$e,condensed_history:Me,bash_tool_purpose:Ne,verbosity:Le,detailed_tool_recaps:Fe,document_port:De,keybindings:Ue,tmux_passthrough:ze,modelLadders:Ke,providerOptions:Ge,...Object.keys(Q).length>0?{modelRoutes:Q}:{},...Object.keys(G.legacy).length>0?{legacyModelRoutes:G.legacy}:{},...ee!==void 0?{modelRouting:ee}:{},kinds:qe,remoteCanvas:Be,api:He,...v?{paths:v}:{},...ne?{store:ne}:{},..._?{runtime:_}:{},spawnEnv:We}}s(z,"mergeConfig");function Yn(e){return P(e)}s(Yn,"readRawConfigAtRoot");function Zn(e){const n=g(e);return n?Yn(n):null}s(Zn,"readRawScopeConfig");function Xn(e){if(e===null||e==="")return null;try{return P(ae(e))}catch{return null}}s(Xn,"readRawProfileConfig");function Qn(e,n){return[...bn(e,n)].reverse().map(r=>({root:r,raw:P(r)}))}s(Qn,"readRawProjectScopeConfigs");function Re(e=process.cwd(),n=Ze()||null){const o=T[C];if(o)return o.launch;const t=w(),r=Zn("user"),i=Xn(n),c=Qn(e,n);let u=b(r?.kinds,Se("user",g("user"),t.kinds)),d=$(r?.modelLadders,t.modelLadders),f=F(r?.providerOptions,t.providerOptions),a=M(r?.modelRoutes),l=N(r?.modelRouting,void 0),p=L(r?.spawnEnv,t.spawnEnv?.allow);i!==null&&(u=b(i.kinds,u),d=$(i.modelLadders,d),f=F(i.providerOptions,f),a=M(i.modelRoutes,a),l=N(i.modelRouting,l),p=L(i.spawnEnv,p.allow));for(const{root:K,raw:m}of c)u=b(m?.kinds,Se("project",K,u)),m!==null&&(d=$(m.modelLadders,d),f=F(m.providerOptions,f),a=M(m.modelRoutes,a),l=N(m.modelRouting,l),p=L(m.spawnEnv,p.allow));const y=_e(a);return{kinds:u,modelLadders:d,providerOptions:f,...Object.keys(y.complete).length>0?{modelRoutes:y.complete}:{},...Object.keys(y.legacy).length>0?{legacyModelRoutes:y.legacy}:{},...l!==void 0?{modelRouting:l}:{},spawnEnv:p}}s(Re,"readMergedLaunchConfig");function Ut(e){return Re().kinds[e]}s(Ut,"resolveKindConfig");function zt(e){const n=Re().kinds,o=[];for(const[t,r]of Object.entries(n)){const i=t.indexOf("/");if(i===-1)continue;const c=t.slice(0,i),u=r.availableTo??[c];(u.includes("*")||u.includes(e))&&o.push({kind:t,whenToUse:r.whenToUse})}return o.sort((t,r)=>t.kind.localeCompare(r.kind))}s(zt,"subKindsAvailableTo");function et(e,n,o){const t={...e??{}};t.anthropic!==void 0&&(t.anthropic={...t.anthropic}),t.openai!==void 0&&(t.openai={...t.openai}),o.defaultProvider!==n.defaultProvider&&o.defaultProvider!==void 0&&(t.defaultProvider=o.defaultProvider);for(const i of["anthropic","openai"])for(const c of["ultra","strong","medium","light"])o[i][c]!==n[i][c]&&(t[i]={...t[i]??{},[c]:o[i][c]});return t.defaultProvider!==void 0||t.anthropic!==void 0||t.openai!==void 0?t:void 0}s(et,"sparseModelLaddersToPersist");async function nt(e,n){return await j(e,o=>{const t=z(o),r=z(o);n(r);const i={...o};for(const u of An)u!=="modelLadders"&&!nn(r[u],t[u])&&(i[u]=r[u]);const c=et(o.modelLadders,t.modelLadders,r.modelLadders);return c!==void 0?i.modelLadders=c:delete i.modelLadders,{value:r,next:i}})}s(nt,"mutateConfigAtRoot");async function Kt(e,n){await j(e,o=>{const t=o.modelLadders??{},r={...t};n.defaultProvider!==void 0&&(r.defaultProvider=n.defaultProvider);for(const i of["anthropic","openai"])n[i]!==void 0&&(r[i]={...t[i]??{},...n[i]});return{value:void 0,next:{...o,modelLadders:r}}})}s(Kt,"persistModelLadders");async function Gt(e,n,o){if(o!==void 0)Ln(n,o);else if(n.trim()==="")throw new Error("model route id must be a non-empty string");await j(e,t=>{const r=ve(t.modelRoutes??{});o===void 0?delete r[n]:x(r,n,{...o,models:{...o.models}});const i={...t};return Object.keys(r).length===0?delete i.modelRoutes:i.modelRoutes=r,{value:void 0,next:i}})}s(Gt,"persistModelRoute");async function tt(e,n){return await nt(e,n)}s(tt,"updateConfigAtRoot");async function qt(e,n){return await tt(k(e),n)}s(qt,"updateConfig");async function Bt(e){const n=e.orchestrator===!0?"orchestratorModel":"model";return await j(e.root,o=>{const t={...o.kinds??{},[e.kind]:{...(o.kinds??{})[e.kind],[n]:e.model}};return{value:void 0,next:{...o,kinds:t}}}),{path:h(e.root),field:n}}s(Bt,"persistDefaultKindModel");async function Ht(e,n){const o=En(e);return n(o),await Tn(e,o),o}s(Ht,"updateState");export{Mn as DEFAULT_TMUX_PASSTHROUGH,In as InvalidRawSettingsError,Un as binDeclarationIssues,Rt as brokerConfigSnapshot,St as configPath,Ct as ensureScopeInitialized,Kn as humanActionDeclarationIssues,xt as installBrokerConfigSnapshot,$t as invalidPluginBinReasons,Dt as invalidPluginKindsReasons,Nt as invalidPluginRequiresReasons,zn as normalizeBin,Gn as normalizeHumanActions,Mt as normalizeRequires,Nn as normalizeTmuxPassthrough,Bt as persistDefaultKindModel,Kt as persistModelLadders,Gt as persistModelRoute,xn as readConfig,Rn as readConfigAtRoot,Re as readMergedLaunchConfig,Yn as readRawConfigAtRoot,Zn as readRawScopeConfig,Ot as readRawSettingsForTarget,En as readState,Et as replaceRawSettingsForTarget,Ut as resolveKindConfig,Ft as resolvePageComponents,Lt as setAppPluginKinds,jt as statePath,zt as subKindsAvailableTo,qt as updateConfig,tt as updateConfigAtRoot,It as updateRawConfigAtomically,Ht as updateState,Pt as writeConfig,Tt as writeRawConfig,Tn as writeState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var a=(t,n)=>g(t,"name",{value:n,configurable:!0});function b(t,n,s,o,l,p,u,d,m){return Object.freeze({id:t,group:n,name:s,description:o,defaults:Object.freeze([...l]),inputKind:p,contexts:Object.freeze([...u]),...d===void 0?{}:{safety:d},...m===void 0?{}:{pair:Object.freeze({...m})}})}a(b,"binding");const e=b;function r(t,n,s,o,l,p=[]){const u=`crtr.tmux.menu.${t}`,d=`crtr.tmux.menu-global.${t}`;return[e(u,"Global tmux",n,s,o,"tmux-menu-selector",l,void 0,{field:"menu",pairedId:d}),e(d,"Global tmux",n,s,p,"tmux-global-action",["tmux.root"],void 0,{field:"global",pairedId:u})]}a(r,"menuEntry");function i(t,n,s,o,l,p){return[e(t,"Attach",s,o,l,"tmux-menu-selector",["tmux.menu.attach"],void 0,{field:"menu",pairedId:n}),e(n,"Attach",s,o,p,"host-global",c,void 0,{field:"direct",pairedId:t})]}a(i,"attachEntry");const c=["attach","graph","graph.confirm"],f=["setup.login","setup.list","setup.input","setup.keybindings","setup.keybindings.edit","setup.keybindings.filter","setup.models"],h=["setup.login","setup.list","setup.keybindings","setup.models"],w=Object.freeze([e("crtr.tmux.menu.open","Global tmux","Open crouter menu","Open the crouter action menu.",["alt+c"],"host-global",["tmux.root"]),e("crtr.tmux.menu.attach","Global tmux","Attach actions","Open the attach-viewer action submenu.",["a"],"tmux-menu-selector",["tmux.menu"]),...r("dashboard","Dashboard","Show the live root conversations in this pane: which need you, which are running, which are idle.",["w"],["tmux.menu"],["alt+shift+d"]),...r("promote","Promote to orchestrator","Promote the focused node to orchestrator \u2014 it holds a roadmap and delegates.",["o"],["tmux.menu"]),...r("demote-mode","Demote to base node","Demote the focused orchestrator back to a base node \u2014 hands-on again in its own window, no roadmap to drive.",["shift+o"],["tmux.menu"]),...r("resume","Find node","Open the canvas navigator and go to the chosen node.",["/"],["tmux.menu"]),...r("fork","Fork node","Fork the focused node into an independent idle root.",["f"],["tmux.menu"]),...r("demote","Demote to terminal","Demote the focused node to terminal \u2014 it keeps running, owes a final up the spine, and reaps when done.",["d"],["tmux.menu"]),...r("make-resident","Make resident","Flip the focused node to resident \u2014 interactable, never forced to submit a final, and wakeable while attached or awaiting something live.",["shift+r"],["tmux.menu"]),...r("detach","Demote and close viewer","Demote the focused node and close its viewer; its broker keeps running off-screen.",["shift+d"],["tmux.menu"]),...r("close-subtree","Close subtree","Close the focused node and its subtree.",["x"],["tmux.menu"]),...r("background-bash","Background running bash","Hand the focused node\u2019s running bash command to its background job system.",["b"],["tmux.menu"]),...r("file-review","Review a file","Open a line-anchored review of a file named in the transcript.",["v"],["tmux.menu"]),...r("pin","Pin conversation","Pin or unpin this conversation in the canvas navigator.",["p"],["tmux.menu"]),...r("show","Inspect node","Open the focused node\u2019s inspection menu.",["i"],["tmux.menu"]),...r("view-settings","Display settings","Open the viewer display-settings menu.",["z"],["tmux.menu"]),...r("more-detail","More detail","Show the transcript one verbosity level more open, in this viewer only (same as Ctrl+O).",["m"],["tmux.menu.view-settings"]),...r("less-detail","Less detail","Show the transcript one verbosity level more collapsed, in this viewer only.",["l"],["tmux.menu.view-settings"]),...r("metadata","Show metadata","Show the focused node\u2019s metadata dossier.",["m"],["tmux.menu.show"]),...r("context","Browse context","Browse the focused node context.",["c"],["tmux.menu.show"]),...r("providers","Open settings","Open the crouter settings panel.",[","],["tmux.menu"]),...r("provider-options","Provider options","Open provider options \u2014 how an authenticated provider serves your turns, including Codex fast mode.",["."],["tmux.menu"]),...r("plugins","Browse plugins","Open the crouter plugin browser.",["l"],["tmux.menu"]),...r("analytics","Analytics","Open the Analytics page: how agents worked in the last 24 hours or 7 days.",["shift+a"],["tmux.menu"]),...r("context-admin","Context surface","Open the context surface: which documents each event delivers, and the surfaces, gates, and caps that decide it.",["shift+c"],["tmux.menu"]),...r("graph","Canvas graph","Open the canvas graph.",["g"],["tmux.menu"]),...r("focus-manager","Go to manager","Focus this node\u2019s manager.",["h"],["tmux.menu"]),...r("copy-id","Copy node id","Copy the focused node id to the system clipboard.",["y"],["tmux.menu"]),...r("reload-viewer","Reload viewer","Restart this pane\u2019s viewer in place on the installed release, keeping its flags and unsent draft.",["r"],["tmux.menu"]),...r("recap","Generate recap","Generate the focused node\u2019s Goal and State recap and refresh its generated title.",["s"],["tmux.menu"]),...r("issues","Open create menu","Open the create submenu.",["c"],["tmux.menu"]),...r("issue.idea","Create idea","Create an idea issue.",["i"],["tmux.menu.issue"]),...r("issue.bug","Create bug","Create a bug issue.",["b"],["tmux.menu.issue"]),e("crtr.tmux.node.next","Global tmux","Next node","Focus the next canvas node.",["alt+]"],"host-global",["tmux.root"]),e("crtr.tmux.node.previous","Global tmux","Previous node","Focus the previous canvas node.",["alt+["],"host-global",["tmux.root"]),e("crtr.tmux.inbox.toggle","Global tmux","Toggle inbox","Open or close the human inbox in the focused viewer.",["alt+i"],"host-global",["tmux.root"]),...i("crtr.tmux.menu.attach.detach","crtr.attach.detach","Detach","Detach from the node.",["d"],["ctrl+d"]),...i("crtr.tmux.menu.attach.clear-or-detach","crtr.attach.clear-or-detach","Clear input (cancel agent on repeat)","Clear the input; press again within a second to cancel the running agent turn. Detach lives on its own binding.",["c"],["ctrl+c"]),...i("crtr.tmux.menu.attach.graph.toggle","crtr.attach.graph.toggle","Toggle graph","Open or close the graph overlay.",["g"],["alt+g"]),...i("crtr.tmux.menu.attach.help.toggle","crtr.attach.help.toggle","Help","Open the attach help overlay.",["?"],["alt+shift+k"]),...i("crtr.tmux.menu.attach.inbox.toggle","crtr.attach.inbox.toggle","Toggle inbox","Open or close the human inbox surface in this viewer.",["i"],[]),...i("crtr.tmux.menu.attach.inbox-strip","crtr.attach.inbox-strip","Pending requests","Jump to the pending human-request strip at the top of the pane.",["u"],["alt+u"]),...i("crtr.tmux.menu.attach.model-ladder.next","crtr.attach.model-ladder.next","Next model","Move to the next model ladder rung.",["]"],["alt+m"]),...i("crtr.tmux.menu.attach.model-ladder.previous","crtr.attach.model-ladder.previous","Previous model","Move to the previous model ladder rung.",["["],["alt+shift+m"]),...i("crtr.tmux.menu.attach.command.inspect","crtr.attach.command.inspect","Inspect loaded command","Open the loaded slash command\u2019s expanded prompt.",["h"],["alt+shift+h"]),...i("crtr.tmux.menu.attach.file-review","crtr.attach.file-review","Review a file","Open a line-anchored review of a file named in the transcript.",[],["alt+shift+r"]),...i("crtr.tmux.menu.attach.profile-files","crtr.attach.profile-files","Search profile files","Fuzzy-match path segments across the node family\u2019s working directories, their context directories (files), profile projects and the profile\u2019s own directory; Ctrl+Y copies a selected path.",["f"],["ctrl+f"]),...i("crtr.tmux.menu.attach.search","crtr.attach.search","Search transcript","Search the transcript as it is currently displayed \u2014 folded tool output is not searched until it is unfolded.",["/"],["alt+/"]),...i("crtr.tmux.menu.attach.reload-viewer","crtr.attach.reload-viewer","Reload viewer","Restart this viewer in place on the installed release.",[],[]),...i("crtr.tmux.menu.attach.whip","crtr.attach.whip","Whip agent","Interrupt the agent and send a playful command.",["w"],[]),e("crtr.attach.scroll.up","Attach","Scroll up","Scroll the transcript one line up.",["shift+up"],"terminal",c),e("crtr.attach.scroll.down","Attach","Scroll down","Scroll the transcript one line down.",["shift+down"],"terminal",c),e("crtr.attach.scroll.page-up","Attach","Scroll page up","Scroll the transcript one page up.",["pageup"],"terminal",c),e("crtr.attach.scroll.page-down","Attach","Scroll page down","Scroll the transcript one page down.",["pagedown"],"terminal",c),e("crtr.attach.scroll.live","Attach","Return to live","Return the transcript to the live bottom.",["shift+end"],"terminal",c),e("crtr.attach.mouse.toggle","Attach","Toggle mouse wheel scrolling","Toggle mouse wheel scrolling on or off.",["alt+shift+o"],"terminal",c),e("crtr.attach.copy.message","Attach","Copy visible message","Copy the newest message visible in the transcript viewport.",["alt+shift+y"],"terminal",c),e("crtr.attach.verbosity.less","Attach","Less detail","Show the transcript one verbosity level more collapsed, in this viewer only; Ctrl+O shows more.",["ctrl+shift+o"],"terminal",c),e("crtr.attach.search.next","Attach","Next match","Move to the next transcript search match.",["n"],"terminal",["attach.search"]),e("crtr.attach.search.previous","Attach","Previous match","Move to the previous transcript search match.",["shift+n"],"terminal",["attach.search"]),e("crtr.attach.search.edit","Attach","Edit query","Return to editing the transcript search query.",["/"],"terminal",["attach.search"]),e("crtr.attach.search.close","Attach","Close search","Leave transcript search and clear its highlights.",["escape"],"terminal",["attach.search"],"dismiss-modal"),e("crtr.graph.down","GRAPH","Move down","Move to the next graph row.",["j","down"],"terminal",["graph"]),e("crtr.graph.up","GRAPH","Move up","Move to the previous graph row.",["k","up"],"terminal",["graph"]),e("crtr.graph.first","GRAPH","First row","Move to the first graph row.",["g"],"terminal",["graph"]),e("crtr.graph.last","GRAPH","Last row","Move to the last graph row.",["shift+g"],"terminal",["graph"]),e("crtr.graph.collapse-or-manager","GRAPH","Collapse or manager","Collapse a node or move to its manager.",["h","left"],"terminal",["graph"]),e("crtr.graph.expand-or-child","GRAPH","Expand or child","Expand a node or move to its child.",["l","right"],"terminal",["graph"]),e("crtr.graph.focus","GRAPH","Focus node","Focus the selected node.",["enter"],"terminal",["graph"]),e("crtr.graph.revive","GRAPH","Revive node","Revive and open the selected dormant node.",["r"],"terminal",["graph"]),e("crtr.graph.focus-manager","GRAPH","Focus manager","Focus the selected node manager.",["m"],"terminal",["graph"]),e("crtr.graph.close-subtree","GRAPH","Close subtree","Ask to close the selected subtree.",["x"],"terminal",["graph"]),e("crtr.graph.dismiss","GRAPH","Dismiss graph","Close the graph overlay.",["escape"],"terminal",["graph"],"dismiss-modal"),e("crtr.graph.confirm.accept","GRAPH","Confirm close","Confirm closing the selected subtree.",["y"],"terminal",["graph.confirm"]),e("crtr.graph.confirm.cancel","GRAPH","Cancel close","Cancel closing the selected subtree.",["n","escape"],"terminal",["graph.confirm"],"dismiss-modal"),e("crtr.inspector.force-quit","Inspector","Force quit Inspector","Immediately leave the Inspector.",["ctrl+c"],"host-global",["inspector"],"leave-screen"),e("crtr.inspector.down","Inspector","Move down","Move the Inspector selection or scroll cursor down.",["j","down"],"terminal",["inspector"]),e("crtr.inspector.up","Inspector","Move up","Move the Inspector selection or scroll cursor up.",["k","up"],"terminal",["inspector"]),e("crtr.inspector.section-next","Inspector","Next section","Move to the next Inspector section.",["tab"],"terminal",["inspector"]),e("crtr.inspector.section-prev","Inspector","Previous section","Move to the previous Inspector section.",["shift+tab"],"terminal",["inspector"]),e("crtr.inspector.page-down","Inspector","Page down","Scroll the Inspector detail body down.",["ctrl+d","pagedown"],"terminal",["inspector"]),e("crtr.inspector.page-up","Inspector","Page up","Scroll the Inspector detail body up.",["ctrl+u","pageup"],"terminal",["inspector"]),e("crtr.inspector.toggle-detail","Inspector","Toggle item detail","Expand or collapse the selected cron or background job.",["enter"],"terminal",["inspector"]),e("crtr.inspector.cancel-item","Inspector","Cancel selected item","Arm cancellation for the selected cron, or stopping for the selected background job.",["x"],"terminal",["inspector"]),e("crtr.inspector.open-log","Inspector","Open job log","Follow the selected background job\u2019s log in a new tmux window.",["o"],"terminal",["inspector"]),e("crtr.inspector.confirm","Inspector","Confirm action","Confirm the armed Inspector action.",["y"],"terminal",["inspector"]),e("crtr.inspector.dismiss","Inspector","Dismiss action","Dismiss an Inspector confirmation or banner.",["escape"],"terminal",["inspector"],"dismiss-modal"),e("crtr.inspector.retarget","Inspector","Retarget","Inspect the selected cron anchor or creator node.",["t"],"terminal",["inspector"]),e("crtr.inspector.refresh","Inspector","Refresh","Refresh the Inspector now.",["g","r"],"terminal",["inspector"]),e("crtr.inspector.quit","Inspector","Quit","Leave the Inspector.",["q"],"terminal",["inspector"],"leave-screen"),...v(),...x(),...k(),...y()]);function v(){const t="browse";return[e("crtr.browse.quit","Browse and pickers","Quit browse","Leave canvas browse.",["q","escape","ctrl+c"],"terminal",[t],"leave-screen"),e("crtr.browse.down","Browse and pickers","Move down","Move to the next row.",["j","down"],"terminal",[t]),e("crtr.browse.up","Browse and pickers","Move up","Move to the previous row.",["k","up"],"terminal",[t]),e("crtr.browse.first","Browse and pickers","First row","Move to the first row.",["g"],"terminal",[t]),e("crtr.browse.last","Browse and pickers","Last row","Move to the last row.",["shift+g"],"terminal",[t]),e("crtr.browse.expand-or-child","Browse and pickers","Expand or child","Expand a row or move to its child.",["l","right"],"terminal",[t]),e("crtr.browse.collapse-or-parent","Browse and pickers","Collapse or parent","Collapse a row or move to its parent.",["h","left"],"terminal",[t]),e("crtr.browse.toggle-fold","Browse and pickers","Toggle fold","Toggle the selected fold.",["space"],"terminal",[t]),e("crtr.browse.tab-next","Browse and pickers","Next tab","Select the next browse tab.",["tab","]"],"terminal",[t]),e("crtr.browse.tab-previous","Browse and pickers","Previous tab","Select the previous browse tab.",["shift+tab","["],"terminal",[t]),...[1,2,3,4,5].map(n=>e(`crtr.browse.tab.${n}`,"Browse and pickers",`Tab ${n}`,`Select browse tab ${n}.`,[`${n}`],"terminal",[t])),e("crtr.browse.close-subtree","Browse and pickers","Close subtree","Ask to close the selected subtree.",["x"],"terminal",[t]),e("crtr.browse.confirm-close","Browse and pickers","Confirm close","Confirm closing the selected subtree.",["y"],"terminal",["browse.confirm"]),e("crtr.browse.sort","Browse and pickers","Change sort","Change the browse sort.",["s"],"terminal",[t]),e("crtr.browse.scope","Browse and pickers","Change scope","Toggle the browse cwd scope.",["c"],"terminal",[t]),e("crtr.browse.profile","Browse and pickers","Toggle profile","Toggle the browse profile scope.",["shift+p"],"terminal",[t]),e("crtr.browse.residents","Browse and pickers","Toggle residents","Toggle resident display.",["r"],"terminal",[t]),e("crtr.browse.preview","Browse and pickers","Toggle preview","Toggle the preview panel.",["v"],"terminal",[t]),e("crtr.browse.report","Browse and pickers","Toggle report","Swap the preview panel between the conversation and the node's newest report.",["shift+v"],"terminal",[t]),e("crtr.browse.pin","Browse and pickers","Pin node","Star or unstar the selected node.",["p"],"terminal",[t]),e("crtr.browse.search","Browse and pickers","Search","Open browse search.",["/"],"terminal",[t]),e("crtr.browse.revive-now","Browse and pickers","Revive now","Revive the selected node now.",["shift+k"],"terminal",[t]),e("crtr.browse.focus","Browse and pickers","Focus node","Focus the selected node.",["enter","o"],"terminal",[t]),e("crtr.browse.focus-background","Browse and pickers","Focus node (keep browsing)","Focus the selected node without leaving the navigator.",["shift+o"],"terminal",[t]),e("crtr.browse.yank-id","Browse and pickers","Yank node id","Copy the selected node id to the system clipboard.",["y"],"terminal",[t]),e("crtr.browse.search.cancel","Browse and pickers","Cancel search","Cancel browse search.",["escape"],"terminal",["browse.search"],"dismiss-modal"),e("crtr.browse.search.commit","Browse and pickers","Commit search","Apply browse search.",["enter"],"terminal",["browse.search"]),e("crtr.browse.search.delete","Browse and pickers","Delete search text","Delete the previous search character.",["backspace"],"terminal",["browse.search"]),e("crtr.browse.search.quit","Browse and pickers","Quit browse","Leave canvas browse from search.",["ctrl+c"],"terminal",["browse.search"],"leave-screen")]}a(v,"browseBindings");function x(){const t="dashboard",n="dashboard.confirm",s="dashboard.input",o="Dashboard";return[e("crtr.dashboard.down",o,"Move down","Move to the next row.",["j","down"],"terminal",[t]),e("crtr.dashboard.up",o,"Move up","Move to the previous row.",["k","up"],"terminal",[t]),e("crtr.dashboard.first",o,"First row","Move to the first row.",["g"],"terminal",[t]),e("crtr.dashboard.last",o,"Last row","Move to the last row.",["shift+g"],"terminal",[t]),e("crtr.dashboard.expand",o,"Expand","Show the selected conversation\u2019s children.",["l","right"],"terminal",[t]),e("crtr.dashboard.collapse",o,"Collapse","Hide the selected conversation\u2019s children.",["h","left"],"terminal",[t]),e("crtr.dashboard.open",o,"Open","Open the selected conversation in this pane.",["enter"],"terminal",[t]),e("crtr.dashboard.pin",o,"Pin","Star or unstar the selected conversation.",["p"],"terminal",[t]),e("crtr.dashboard.rename",o,"Rename","Rename the selected conversation.",["shift+r"],"terminal",[t]),e("crtr.dashboard.close",o,"Close","Finish the selected conversation and remove its row.",["x"],"terminal",[t]),e("crtr.dashboard.confirm-close",o,"Confirm close","Close a conversation that is running.",["y"],"terminal",[n]),e("crtr.dashboard.cancel-close",o,"Cancel close","Keep the running conversation.",["n","escape"],"terminal",[n]),e("crtr.dashboard.profile",o,"Toggle profile","Switch between this profile and all profiles.",["shift+p"],"terminal",[t]),e("crtr.dashboard.input",o,"New conversation","Focus the new-conversation input.",["n"],"terminal",[t]),e("crtr.dashboard.input-cancel",o,"Leave input","Leave the input without clearing it.",["escape"],"terminal",[s]),e("crtr.dashboard.input-submit",o,"Start conversation","Start a root conversation from the input text.",["enter"],"terminal",[s]),e("crtr.dashboard.directory-next",o,"Next directory","Select the next directory for the new conversation.",["tab"],"terminal",[s]),e("crtr.dashboard.directory-previous",o,"Previous directory","Select the previous directory for the new conversation.",["shift+tab"],"terminal",[s]),e("crtr.dashboard.help",o,"Help","Show the dashboard keys.",["?"],"terminal",[t])]}a(x,"dashboardBindings");function k(){const t="profile.menu",n="profile.search";return[e("crtr.profile.menu.up","Profiles","Move up","Move to the previous profile.",["k","up"],"terminal",[t]),e("crtr.profile.menu.down","Profiles","Move down","Move to the next profile.",["j","down"],"terminal",[t]),e("crtr.profile.menu.select","Profiles","Select profile","Select the highlighted profile.",["enter"],"terminal",[t]),e("crtr.profile.menu.accept-default","Profiles","Accept default","Accept the default profile.",["escape"],"terminal",[t],"leave-screen"),e("crtr.profile.menu.abort","Profiles","Abort","Leave profile selection.",["ctrl+c"],"terminal",[t],"leave-screen"),...[1,2,3,4,5,6,7,8,9].map(s=>e(`crtr.profile.menu.slot.${s}`,"Profiles",`Profile slot ${s}`,`Select profile slot ${s}.`,[`${s}`],"terminal",[t])),e("crtr.profile.menu.create","Profiles","Create profile","Create a profile.",["c"],"terminal",[t]),e("crtr.profile.menu.search-existing","Profiles","Search profiles","Search existing profiles.",["s"],"terminal",[t]),e("crtr.profile.menu.use-root","Profiles","Use root profile","Use the root profile.",["r"],"terminal",[t]),e("crtr.profile.menu.set-default","Profiles","Set default","Set the selected profile as default.",["d"],"terminal",[t]),e("crtr.profile.menu.add-directory","Profiles","Add directory","Add a directory to the profile.",["a"],"terminal",[t]),e("crtr.profile.menu.unpin","Profiles","Unpin directory","Unpin the selected directory.",["u"],"terminal",[t]),e("crtr.profile.menu.manage","Profiles","Manage profiles","Open the profiles settings page in a popup.",["v"],"terminal",[t]),e("crtr.profile.search.up","Profiles","Move up","Move to the previous search result.",["up","ctrl+p"],"terminal",[n]),e("crtr.profile.search.down","Profiles","Move down","Move to the next search result.",["down","ctrl+n"],"terminal",[n]),e("crtr.profile.search.pick","Profiles","Pick profile","Pick the highlighted profile.",["enter"],"terminal",[n]),e("crtr.profile.search.back","Profiles","Back","Return to profile selection.",["escape"],"terminal",[n],"leave-screen"),e("crtr.profile.search.delete","Profiles","Delete filter text","Delete the previous filter character.",["backspace"],"terminal",[n]),e("crtr.profile.search.abort","Profiles","Abort","Leave profile search.",["ctrl+c"],"terminal",[n],"leave-screen")]}a(k,"profileBindings");function y(){return[e("crtr.setup.cancel","Setup","Cancel setup","Leave the setup wizard.",["q","ctrl+c","ctrl+d"],"terminal",f,"leave-screen"),e("crtr.setup.tab-next","Setup","Next tab","Select the next setup tab.",["tab","right"],"terminal",h),e("crtr.setup.tab-previous","Setup","Previous tab","Select the previous setup tab.",["shift+tab","left"],"terminal",h),e("crtr.setup.open","Setup","Open","Open the selected setup item.",["enter"],"terminal",["setup.login"]),e("crtr.setup.list-down","Setup","Move down","Move to the next setup item.",["j","down"],"terminal",["setup.list","setup.models","setup.models.dimension-picker","setup.models.route-form"]),e("crtr.setup.list-up","Setup","Move up","Move to the previous setup item.",["k","up"],"terminal",["setup.list","setup.models","setup.models.dimension-picker","setup.models.route-form"]),e("crtr.setup.toggle","Setup","Toggle","Toggle the selected setup item.",["space"],"terminal",["setup.list","setup.keybindings"]),e("crtr.setup.details","Setup","Show details","Show details for the selected item.",["?"],"terminal",["setup.list"]),e("crtr.setup.advance","Setup","Advance","Advance the setup flow.",["enter"],"terminal",["setup.list"]),e("crtr.setup.confirm.accept","Setup","Confirm","Accept the setup confirmation.",["y","enter"],"terminal",["setup.confirm","setup.models.confirm"]),e("crtr.setup.confirm.back","Setup","Go back","Cancel the setup confirmation.",["n","escape","q"],"terminal",["setup.confirm","setup.models.confirm"],"dismiss-modal"),e("crtr.setup.keybindings.edit","Setup","Edit binding","Edit the selected binding.",["enter"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.commit-edit","Setup","Commit edit","Commit the active binding edit.",["enter"],"terminal",["setup.keybindings.edit"]),e("crtr.setup.keybindings.cancel-edit","Setup","Cancel edit","Cancel the active binding edit.",["escape"],"terminal",["setup.keybindings.edit"],"dismiss-modal"),e("crtr.setup.keybindings.unbind","Setup","Unbind","Disable the selected binding.",["delete"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.reset-row","Setup","Reset binding","Reset the selected binding.",["r"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.reset-all","Setup","Reset all bindings","Reset all bindings to defaults.",["shift+r"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.save","Setup","Save bindings","Save keybinding changes.",["s"],"terminal",["setup.keybindings"],"save-keybindings"),e("crtr.setup.keybindings.discard","Setup","Discard changes","Discard keybinding changes.",["escape"],"terminal",["setup.keybindings"],"leave-screen"),e("crtr.setup.keybindings.page-up","Setup","Page up","Move up one keybinding page.",["pageup"],"terminal",["setup.keybindings","setup.keybindings.edit"]),e("crtr.setup.keybindings.page-down","Setup","Page down","Move down one keybinding page.",["pagedown"],"terminal",["setup.keybindings","setup.keybindings.edit"]),e("crtr.setup.keybindings.filter","Setup","Filter bindings","Open the keybinding filter.",["/"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.filter-delete","Setup","Delete filter text","Delete the previous filter character.",["backspace"],"terminal",["setup.keybindings.filter"]),e("crtr.setup.keybindings.filter-clear","Setup","Clear filter","Clear the keybinding filter.",["escape"],"terminal",["setup.keybindings.filter"],"dismiss-modal"),e("crtr.setup.cell-previous","Setup","Previous field","Select the previous field or setup table cell.",["h"],"terminal",["setup.models","setup.keybindings"]),e("crtr.setup.cell-next","Setup","Next field","Select the next field or setup table cell.",["l"],"terminal",["setup.models","setup.keybindings"]),e("crtr.setup.models.open","Setup","Edit model","Edit the selected model cell or route field.",["enter"],"terminal",["setup.models","setup.models.route-form"]),e("crtr.setup.models.scope-next","Setup","Next model config scope","Edit the next applicable user, profile, or project config.",["s"],"terminal",["setup.models"]),e("crtr.setup.models.commit","Setup","Commit pick","Commit the provider, strength, model, or thinking-level pick.",["enter"],"terminal",["setup.models.picker","setup.models.dimension-picker"]),e("crtr.setup.models.cancel","Setup","Cancel pick","Cancel the model picker or route form.",["escape"],"terminal",["setup.models.picker","setup.models.dimension-picker","setup.models.route-form"],"dismiss-modal")]}a(y,"setupBindings");const C=new Set(w.map(t=>t.id));function P(t){return t.contexts.includes("attach")&&(t.inputKind==="terminal"||t.inputKind==="host-global")}a(P,"isAttachPaneBinding");const A=Object.freeze([{context:"graph",capability:"dismiss-modal"},{context:"graph.confirm",capability:"dismiss-modal"},{context:"inspector",capability:"leave-screen"},{context:"inspector",capability:"dismiss-modal"},{context:"attach.search",capability:"dismiss-modal"},{context:"browse",capability:"leave-screen"},{context:"browse.search",capability:"dismiss-modal"},{context:"profile.menu",capability:"leave-screen"},{context:"profile.search",capability:"leave-screen"},{context:"setup.login",capability:"leave-screen"},{context:"setup.list",capability:"leave-screen"},{context:"setup.input",capability:"leave-screen"},{context:"setup.confirm",capability:"dismiss-modal"},{context:"setup.keybindings",capability:"leave-screen"},{context:"setup.keybindings",capability:"save-keybindings"},{context:"setup.keybindings.edit",capability:"dismiss-modal"},{context:"setup.keybindings.filter",capability:"dismiss-modal"},{context:"setup.models",capability:"leave-screen"},{context:"setup.models.picker",capability:"dismiss-modal"},{context:"setup.models.dimension-picker",capability:"dismiss-modal"},{context:"setup.models.route-form",capability:"dismiss-modal"},{context:"setup.models.confirm",capability:"dismiss-modal"}]);export{w as BINDING_CATALOG,C as BINDING_IDS,A as SAFETY_REQUIREMENTS,P as isAttachPaneBinding};
|
|
1
|
+
var g=Object.defineProperty;var a=(t,n)=>g(t,"name",{value:n,configurable:!0});function b(t,n,s,o,l,p,u,d,m){return Object.freeze({id:t,group:n,name:s,description:o,defaults:Object.freeze([...l]),inputKind:p,contexts:Object.freeze([...u]),...d===void 0?{}:{safety:d},...m===void 0?{}:{pair:Object.freeze({...m})}})}a(b,"binding");const e=b;function r(t,n,s,o,l,p=[]){const u=`crtr.tmux.menu.${t}`,d=`crtr.tmux.menu-global.${t}`;return[e(u,"Global tmux",n,s,o,"tmux-menu-selector",l,void 0,{field:"menu",pairedId:d}),e(d,"Global tmux",n,s,p,"tmux-global-action",["tmux.root"],void 0,{field:"global",pairedId:u})]}a(r,"menuEntry");function i(t,n,s,o,l,p){return[e(t,"Attach",s,o,l,"tmux-menu-selector",["tmux.menu.attach"],void 0,{field:"menu",pairedId:n}),e(n,"Attach",s,o,p,"host-global",c,void 0,{field:"direct",pairedId:t})]}a(i,"attachEntry");const c=["attach","graph","graph.confirm"],f=["setup.login","setup.list","setup.input","setup.keybindings","setup.keybindings.edit","setup.keybindings.filter","setup.models"],h=["setup.login","setup.list","setup.keybindings","setup.models"],w=Object.freeze([e("crtr.tmux.menu.open","Global tmux","Open crouter menu","Open the crouter action menu.",["alt+c"],"host-global",["tmux.root"]),e("crtr.tmux.menu.attach","Global tmux","Attach actions","Open the attach-viewer action submenu.",["a"],"tmux-menu-selector",["tmux.menu"]),...r("dashboard","Dashboard","Show the live root conversations in this pane: which need you, which are running, which are idle.",["w"],["tmux.menu"],["alt+shift+d"]),...r("promote","Promote to orchestrator","Promote the focused node to orchestrator \u2014 it holds a roadmap and delegates.",["o"],["tmux.menu"]),...r("demote-mode","Demote to base node","Demote the focused orchestrator back to a base node \u2014 hands-on again in its own window, no roadmap to drive.",["shift+o"],["tmux.menu"]),...r("resume","Find node","Open the canvas navigator and go to the chosen node.",["/"],["tmux.menu"]),...r("fork","Fork node","Fork the focused node into an independent idle root.",["f"],["tmux.menu"]),...r("demote","Demote to terminal","Demote the focused node to terminal \u2014 it keeps running, owes a final up the spine, and reaps when done.",["d"],["tmux.menu"]),...r("make-resident","Make resident","Flip the focused node to resident \u2014 interactable, never forced to submit a final, and wakeable while attached or awaiting something live.",["shift+r"],["tmux.menu"]),...r("detach","Demote and close viewer","Demote the focused node and close its viewer; its broker keeps running off-screen.",["shift+d"],["tmux.menu"]),...r("close-subtree","Close subtree","Close the focused node and its subtree.",["x"],["tmux.menu"]),...r("background-bash","Background running bash","Hand the focused node\u2019s running bash command to its background job system.",["b"],["tmux.menu"]),...r("file-review","Review a file","Open a line-anchored review of a file named in the transcript.",["v"],["tmux.menu"]),...r("pin","Pin conversation","Pin or unpin this conversation in the canvas navigator.",["p"],["tmux.menu"]),...r("show","Inspect node","Open the focused node\u2019s inspection menu.",["i"],["tmux.menu"]),...r("view-settings","Display settings","Open the viewer display-settings menu.",["z"],["tmux.menu"]),...r("more-detail","More detail","Show the transcript one verbosity level more open, in this viewer only (same as Ctrl+O).",["m"],["tmux.menu.view-settings"]),...r("less-detail","Less detail","Show the transcript one verbosity level more collapsed, in this viewer only.",["l"],["tmux.menu.view-settings"]),...r("metadata","Show metadata","Show the focused node\u2019s metadata dossier.",["m"],["tmux.menu.show"]),...r("context","Browse context","Browse the focused node context.",["c"],["tmux.menu.show"]),...r("providers","Open settings","Open the crouter settings panel.",[","],["tmux.menu"]),...r("provider-options","Provider options","Open provider options \u2014 how an authenticated provider serves your turns, including Codex fast mode.",["."],["tmux.menu"]),...r("plugins","Browse plugins","Open the crouter plugin browser.",["l"],["tmux.menu"]),...r("analytics","Analytics","Open the Analytics page: how agents worked in the last 24 hours or 7 days.",["shift+a"],["tmux.menu"]),...r("context-admin","Context surface","Open the context surface: which documents each event delivers, and the surfaces, gates, and caps that decide it.",["shift+c"],["tmux.menu"]),...r("graph","Canvas graph","Open the canvas graph.",["g"],["tmux.menu"]),...r("focus-manager","Go to manager","Focus this node\u2019s manager.",["h"],["tmux.menu"]),...r("copy-id","Copy node id","Copy the focused node id to the system clipboard.",["y"],["tmux.menu"]),...r("reload-viewer","Reload viewer","Restart this pane\u2019s viewer in place on the installed release, keeping its flags and unsent draft.",["r"],["tmux.menu"]),...r("recap","Generate recap","Generate the focused node\u2019s Goal and State recap and refresh its generated title.",["s"],["tmux.menu"]),...r("issues","Open create menu","Open the create submenu.",["c"],["tmux.menu"]),...r("issue.idea","Create idea","Create an idea issue.",["i"],["tmux.menu.issue"]),...r("issue.bug","Create bug","Create a bug issue.",["b"],["tmux.menu.issue"]),e("crtr.tmux.node.next","Global tmux","Next node","Focus the next canvas node.",["alt+]"],"host-global",["tmux.root"]),e("crtr.tmux.node.previous","Global tmux","Previous node","Focus the previous canvas node.",["alt+["],"host-global",["tmux.root"]),e("crtr.tmux.inbox.toggle","Global tmux","Toggle inbox","Open or close the human inbox in the focused viewer.",["alt+i"],"host-global",["tmux.root"]),...i("crtr.tmux.menu.attach.detach","crtr.attach.detach","Detach","Detach from the node.",["d"],[]),...i("crtr.tmux.menu.attach.clear-or-detach","crtr.attach.clear-or-detach","Clear input (cancel agent on repeat)","Clear the input; press again within a second to cancel the running agent turn. Detach lives on its own binding.",["c"],["ctrl+c"]),...i("crtr.tmux.menu.attach.graph.toggle","crtr.attach.graph.toggle","Toggle graph","Open or close the graph overlay.",["g"],["alt+g"]),...i("crtr.tmux.menu.attach.help.toggle","crtr.attach.help.toggle","Help","Open the attach help overlay.",["?"],["alt+shift+k"]),...i("crtr.tmux.menu.attach.inbox.toggle","crtr.attach.inbox.toggle","Toggle inbox","Open or close the human inbox surface in this viewer.",["i"],[]),...i("crtr.tmux.menu.attach.inbox-strip","crtr.attach.inbox-strip","Pending requests","Jump to the pending human-request strip at the top of the pane.",["u"],["alt+u"]),...i("crtr.tmux.menu.attach.model-ladder.next","crtr.attach.model-ladder.next","Next model","Move to the next model ladder rung.",["]"],["alt+m"]),...i("crtr.tmux.menu.attach.model-ladder.previous","crtr.attach.model-ladder.previous","Previous model","Move to the previous model ladder rung.",["["],["alt+shift+m"]),...i("crtr.tmux.menu.attach.command.inspect","crtr.attach.command.inspect","Inspect loaded command","Open the loaded slash command\u2019s expanded prompt.",["h"],["alt+shift+h"]),...i("crtr.tmux.menu.attach.file-review","crtr.attach.file-review","Review a file","Open a line-anchored review of a file named in the transcript.",[],["alt+shift+r"]),...i("crtr.tmux.menu.attach.profile-files","crtr.attach.profile-files","Search profile files","Fuzzy-match path segments across the node family\u2019s working directories, their context directories (files), profile projects and the profile\u2019s own directory; Ctrl+Y copies a selected path.",["f"],["ctrl+f"]),...i("crtr.tmux.menu.attach.search","crtr.attach.search","Search transcript","Search the transcript as it is currently displayed \u2014 folded tool output is not searched until it is unfolded.",["/"],["alt+/"]),...i("crtr.tmux.menu.attach.reload-viewer","crtr.attach.reload-viewer","Reload viewer","Restart this viewer in place on the installed release.",[],[]),...i("crtr.tmux.menu.attach.whip","crtr.attach.whip","Whip agent","Interrupt the agent and send a playful command.",["w"],[]),e("crtr.attach.scroll.up","Attach","Scroll up","Scroll the transcript one line up.",["shift+up","ctrl+k"],"terminal",c),e("crtr.attach.scroll.down","Attach","Scroll down","Scroll the transcript one line down.",["shift+down","ctrl+j"],"terminal",c),e("crtr.attach.scroll.page-up","Attach","Scroll page up","Scroll the transcript one page up.",["pageup","ctrl+u"],"terminal",c),e("crtr.attach.scroll.page-down","Attach","Scroll page down","Scroll the transcript one page down.",["pagedown","ctrl+d"],"terminal",c),e("crtr.attach.scroll.live","Attach","Return to live","Return the transcript to the live bottom.",["shift+end","ctrl+g"],"terminal",c),e("crtr.attach.mouse.toggle","Attach","Toggle mouse wheel scrolling","Toggle mouse wheel scrolling on or off.",["alt+shift+o"],"terminal",c),e("crtr.attach.copy.message","Attach","Copy visible message","Copy the newest message visible in the transcript viewport.",["alt+shift+y"],"terminal",c),e("crtr.attach.verbosity.less","Attach","Less detail","Show the transcript one verbosity level more collapsed, in this viewer only; Ctrl+O shows more.",["ctrl+shift+o"],"terminal",c),e("crtr.attach.search.next","Attach","Next match","Move to the next transcript search match.",["n"],"terminal",["attach.search"]),e("crtr.attach.search.previous","Attach","Previous match","Move to the previous transcript search match.",["shift+n"],"terminal",["attach.search"]),e("crtr.attach.search.edit","Attach","Edit query","Return to editing the transcript search query.",["/"],"terminal",["attach.search"]),e("crtr.attach.search.close","Attach","Close search","Leave transcript search and clear its highlights.",["escape"],"terminal",["attach.search"],"dismiss-modal"),e("crtr.graph.down","GRAPH","Move down","Move to the next graph row.",["j","down"],"terminal",["graph"]),e("crtr.graph.up","GRAPH","Move up","Move to the previous graph row.",["k","up"],"terminal",["graph"]),e("crtr.graph.first","GRAPH","First row","Move to the first graph row.",["g"],"terminal",["graph"]),e("crtr.graph.last","GRAPH","Last row","Move to the last graph row.",["shift+g"],"terminal",["graph"]),e("crtr.graph.collapse-or-manager","GRAPH","Collapse or manager","Collapse a node or move to its manager.",["h","left"],"terminal",["graph"]),e("crtr.graph.expand-or-child","GRAPH","Expand or child","Expand a node or move to its child.",["l","right"],"terminal",["graph"]),e("crtr.graph.focus","GRAPH","Focus node","Focus the selected node.",["enter"],"terminal",["graph"]),e("crtr.graph.revive","GRAPH","Revive node","Revive and open the selected dormant node.",["r"],"terminal",["graph"]),e("crtr.graph.focus-manager","GRAPH","Focus manager","Focus the selected node manager.",["m"],"terminal",["graph"]),e("crtr.graph.close-subtree","GRAPH","Close subtree","Ask to close the selected subtree.",["x"],"terminal",["graph"]),e("crtr.graph.dismiss","GRAPH","Dismiss graph","Close the graph overlay.",["escape"],"terminal",["graph"],"dismiss-modal"),e("crtr.graph.confirm.accept","GRAPH","Confirm close","Confirm closing the selected subtree.",["y"],"terminal",["graph.confirm"]),e("crtr.graph.confirm.cancel","GRAPH","Cancel close","Cancel closing the selected subtree.",["n","escape"],"terminal",["graph.confirm"],"dismiss-modal"),e("crtr.inspector.force-quit","Inspector","Force quit Inspector","Immediately leave the Inspector.",["ctrl+c"],"host-global",["inspector"],"leave-screen"),e("crtr.inspector.down","Inspector","Move down","Move the Inspector selection or scroll cursor down.",["j","down"],"terminal",["inspector"]),e("crtr.inspector.up","Inspector","Move up","Move the Inspector selection or scroll cursor up.",["k","up"],"terminal",["inspector"]),e("crtr.inspector.section-next","Inspector","Next section","Move to the next Inspector section.",["tab"],"terminal",["inspector"]),e("crtr.inspector.section-prev","Inspector","Previous section","Move to the previous Inspector section.",["shift+tab"],"terminal",["inspector"]),e("crtr.inspector.page-down","Inspector","Page down","Scroll the Inspector detail body down.",["ctrl+d","pagedown"],"terminal",["inspector"]),e("crtr.inspector.page-up","Inspector","Page up","Scroll the Inspector detail body up.",["ctrl+u","pageup"],"terminal",["inspector"]),e("crtr.inspector.toggle-detail","Inspector","Toggle item detail","Expand or collapse the selected cron or background job.",["enter"],"terminal",["inspector"]),e("crtr.inspector.cancel-item","Inspector","Cancel selected item","Arm cancellation for the selected cron, or stopping for the selected background job.",["x"],"terminal",["inspector"]),e("crtr.inspector.open-log","Inspector","Open job log","Follow the selected background job\u2019s log in a new tmux window.",["o"],"terminal",["inspector"]),e("crtr.inspector.confirm","Inspector","Confirm action","Confirm the armed Inspector action.",["y"],"terminal",["inspector"]),e("crtr.inspector.dismiss","Inspector","Dismiss action","Dismiss an Inspector confirmation or banner.",["escape"],"terminal",["inspector"],"dismiss-modal"),e("crtr.inspector.retarget","Inspector","Retarget","Inspect the selected cron anchor or creator node.",["t"],"terminal",["inspector"]),e("crtr.inspector.refresh","Inspector","Refresh","Refresh the Inspector now.",["g","r"],"terminal",["inspector"]),e("crtr.inspector.quit","Inspector","Quit","Leave the Inspector.",["q"],"terminal",["inspector"],"leave-screen"),...v(),...x(),...k(),...y()]);function v(){const t="browse";return[e("crtr.browse.quit","Browse and pickers","Quit browse","Leave canvas browse.",["q","escape","ctrl+c"],"terminal",[t],"leave-screen"),e("crtr.browse.down","Browse and pickers","Move down","Move to the next row.",["j","down"],"terminal",[t]),e("crtr.browse.up","Browse and pickers","Move up","Move to the previous row.",["k","up"],"terminal",[t]),e("crtr.browse.first","Browse and pickers","First row","Move to the first row.",["g"],"terminal",[t]),e("crtr.browse.last","Browse and pickers","Last row","Move to the last row.",["shift+g"],"terminal",[t]),e("crtr.browse.expand-or-child","Browse and pickers","Expand or child","Expand a row or move to its child.",["l","right"],"terminal",[t]),e("crtr.browse.collapse-or-parent","Browse and pickers","Collapse or parent","Collapse a row or move to its parent.",["h","left"],"terminal",[t]),e("crtr.browse.toggle-fold","Browse and pickers","Toggle fold","Toggle the selected fold.",["space"],"terminal",[t]),e("crtr.browse.tab-next","Browse and pickers","Next tab","Select the next browse tab.",["tab","]"],"terminal",[t]),e("crtr.browse.tab-previous","Browse and pickers","Previous tab","Select the previous browse tab.",["shift+tab","["],"terminal",[t]),...[1,2,3,4,5].map(n=>e(`crtr.browse.tab.${n}`,"Browse and pickers",`Tab ${n}`,`Select browse tab ${n}.`,[`${n}`],"terminal",[t])),e("crtr.browse.close-subtree","Browse and pickers","Close subtree","Ask to close the selected subtree.",["x"],"terminal",[t]),e("crtr.browse.confirm-close","Browse and pickers","Confirm close","Confirm closing the selected subtree.",["y"],"terminal",["browse.confirm"]),e("crtr.browse.sort","Browse and pickers","Change sort","Change the browse sort.",["s"],"terminal",[t]),e("crtr.browse.scope","Browse and pickers","Change scope","Toggle the browse cwd scope.",["c"],"terminal",[t]),e("crtr.browse.profile","Browse and pickers","Toggle profile","Toggle the browse profile scope.",["shift+p"],"terminal",[t]),e("crtr.browse.residents","Browse and pickers","Toggle residents","Toggle resident display.",["r"],"terminal",[t]),e("crtr.browse.preview","Browse and pickers","Toggle preview","Toggle the preview panel.",["v"],"terminal",[t]),e("crtr.browse.report","Browse and pickers","Toggle report","Swap the preview panel between the conversation and the node's newest report.",["shift+v"],"terminal",[t]),e("crtr.browse.pin","Browse and pickers","Pin node","Star or unstar the selected node.",["p"],"terminal",[t]),e("crtr.browse.search","Browse and pickers","Search","Open browse search.",["/"],"terminal",[t]),e("crtr.browse.revive-now","Browse and pickers","Revive now","Revive the selected node now.",["shift+k"],"terminal",[t]),e("crtr.browse.focus","Browse and pickers","Focus node","Focus the selected node.",["enter","o"],"terminal",[t]),e("crtr.browse.focus-background","Browse and pickers","Focus node (keep browsing)","Focus the selected node without leaving the navigator.",["shift+o"],"terminal",[t]),e("crtr.browse.yank-id","Browse and pickers","Yank node id","Copy the selected node id to the system clipboard.",["y"],"terminal",[t]),e("crtr.browse.search.cancel","Browse and pickers","Cancel search","Cancel browse search.",["escape"],"terminal",["browse.search"],"dismiss-modal"),e("crtr.browse.search.commit","Browse and pickers","Commit search","Apply browse search.",["enter"],"terminal",["browse.search"]),e("crtr.browse.search.delete","Browse and pickers","Delete search text","Delete the previous search character.",["backspace"],"terminal",["browse.search"]),e("crtr.browse.search.quit","Browse and pickers","Quit browse","Leave canvas browse from search.",["ctrl+c"],"terminal",["browse.search"],"leave-screen")]}a(v,"browseBindings");function x(){const t="dashboard",n="dashboard.confirm",s="dashboard.input",o="Dashboard";return[e("crtr.dashboard.down",o,"Move down","Move to the next row.",["j","down"],"terminal",[t]),e("crtr.dashboard.up",o,"Move up","Move to the previous row.",["k","up"],"terminal",[t]),e("crtr.dashboard.first",o,"First row","Move to the first row.",["g"],"terminal",[t]),e("crtr.dashboard.last",o,"Last row","Move to the last row.",["shift+g"],"terminal",[t]),e("crtr.dashboard.expand",o,"Expand","Show the selected conversation\u2019s children.",["l","right"],"terminal",[t]),e("crtr.dashboard.collapse",o,"Collapse","Hide the selected conversation\u2019s children.",["h","left"],"terminal",[t]),e("crtr.dashboard.open",o,"Open","Open the selected conversation in this pane.",["enter"],"terminal",[t]),e("crtr.dashboard.pin",o,"Pin","Star or unstar the selected conversation.",["p"],"terminal",[t]),e("crtr.dashboard.rename",o,"Rename","Rename the selected conversation.",["shift+r"],"terminal",[t]),e("crtr.dashboard.close",o,"Close","Finish the selected conversation and remove its row.",["x"],"terminal",[t]),e("crtr.dashboard.confirm-close",o,"Confirm close","Close a conversation that is running.",["y"],"terminal",[n]),e("crtr.dashboard.cancel-close",o,"Cancel close","Keep the running conversation.",["n","escape"],"terminal",[n]),e("crtr.dashboard.profile",o,"Toggle profile","Switch between this profile and all profiles.",["shift+p"],"terminal",[t]),e("crtr.dashboard.input",o,"New conversation","Focus the new-conversation input.",["n"],"terminal",[t]),e("crtr.dashboard.input-cancel",o,"Leave input","Leave the input without clearing it.",["escape"],"terminal",[s]),e("crtr.dashboard.input-submit",o,"Start conversation","Start a root conversation from the input text.",["enter"],"terminal",[s]),e("crtr.dashboard.directory-next",o,"Next directory","Select the next directory for the new conversation.",["tab"],"terminal",[s]),e("crtr.dashboard.directory-previous",o,"Previous directory","Select the previous directory for the new conversation.",["shift+tab"],"terminal",[s]),e("crtr.dashboard.help",o,"Help","Show the dashboard keys.",["?"],"terminal",[t])]}a(x,"dashboardBindings");function k(){const t="profile.menu",n="profile.search";return[e("crtr.profile.menu.up","Profiles","Move up","Move to the previous profile.",["k","up"],"terminal",[t]),e("crtr.profile.menu.down","Profiles","Move down","Move to the next profile.",["j","down"],"terminal",[t]),e("crtr.profile.menu.select","Profiles","Select profile","Select the highlighted profile.",["enter"],"terminal",[t]),e("crtr.profile.menu.accept-default","Profiles","Accept default","Accept the default profile.",["escape"],"terminal",[t],"leave-screen"),e("crtr.profile.menu.abort","Profiles","Abort","Leave profile selection.",["ctrl+c"],"terminal",[t],"leave-screen"),...[1,2,3,4,5,6,7,8,9].map(s=>e(`crtr.profile.menu.slot.${s}`,"Profiles",`Profile slot ${s}`,`Select profile slot ${s}.`,[`${s}`],"terminal",[t])),e("crtr.profile.menu.create","Profiles","Create profile","Create a profile.",["c"],"terminal",[t]),e("crtr.profile.menu.search-existing","Profiles","Search profiles","Search existing profiles.",["s"],"terminal",[t]),e("crtr.profile.menu.use-root","Profiles","Use root profile","Use the root profile.",["r"],"terminal",[t]),e("crtr.profile.menu.set-default","Profiles","Set default","Set the selected profile as default.",["d"],"terminal",[t]),e("crtr.profile.menu.add-directory","Profiles","Add directory","Add a directory to the profile.",["a"],"terminal",[t]),e("crtr.profile.menu.unpin","Profiles","Unpin directory","Unpin the selected directory.",["u"],"terminal",[t]),e("crtr.profile.menu.manage","Profiles","Manage profiles","Open the profiles settings page in a popup.",["v"],"terminal",[t]),e("crtr.profile.search.up","Profiles","Move up","Move to the previous search result.",["up","ctrl+p"],"terminal",[n]),e("crtr.profile.search.down","Profiles","Move down","Move to the next search result.",["down","ctrl+n"],"terminal",[n]),e("crtr.profile.search.pick","Profiles","Pick profile","Pick the highlighted profile.",["enter"],"terminal",[n]),e("crtr.profile.search.back","Profiles","Back","Return to profile selection.",["escape"],"terminal",[n],"leave-screen"),e("crtr.profile.search.delete","Profiles","Delete filter text","Delete the previous filter character.",["backspace"],"terminal",[n]),e("crtr.profile.search.abort","Profiles","Abort","Leave profile search.",["ctrl+c"],"terminal",[n],"leave-screen")]}a(k,"profileBindings");function y(){return[e("crtr.setup.cancel","Setup","Cancel setup","Leave the setup wizard.",["q","ctrl+c","ctrl+d"],"terminal",f,"leave-screen"),e("crtr.setup.tab-next","Setup","Next tab","Select the next setup tab.",["tab","right"],"terminal",h),e("crtr.setup.tab-previous","Setup","Previous tab","Select the previous setup tab.",["shift+tab","left"],"terminal",h),e("crtr.setup.open","Setup","Open","Open the selected setup item.",["enter"],"terminal",["setup.login"]),e("crtr.setup.list-down","Setup","Move down","Move to the next setup item.",["j","down"],"terminal",["setup.list","setup.models","setup.models.dimension-picker","setup.models.route-form"]),e("crtr.setup.list-up","Setup","Move up","Move to the previous setup item.",["k","up"],"terminal",["setup.list","setup.models","setup.models.dimension-picker","setup.models.route-form"]),e("crtr.setup.toggle","Setup","Toggle","Toggle the selected setup item.",["space"],"terminal",["setup.list","setup.keybindings"]),e("crtr.setup.details","Setup","Show details","Show details for the selected item.",["?"],"terminal",["setup.list"]),e("crtr.setup.advance","Setup","Advance","Advance the setup flow.",["enter"],"terminal",["setup.list"]),e("crtr.setup.confirm.accept","Setup","Confirm","Accept the setup confirmation.",["y","enter"],"terminal",["setup.confirm","setup.models.confirm"]),e("crtr.setup.confirm.back","Setup","Go back","Cancel the setup confirmation.",["n","escape","q"],"terminal",["setup.confirm","setup.models.confirm"],"dismiss-modal"),e("crtr.setup.keybindings.edit","Setup","Edit binding","Edit the selected binding.",["enter"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.commit-edit","Setup","Commit edit","Commit the active binding edit.",["enter"],"terminal",["setup.keybindings.edit"]),e("crtr.setup.keybindings.cancel-edit","Setup","Cancel edit","Cancel the active binding edit.",["escape"],"terminal",["setup.keybindings.edit"],"dismiss-modal"),e("crtr.setup.keybindings.unbind","Setup","Unbind","Disable the selected binding.",["delete"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.reset-row","Setup","Reset binding","Reset the selected binding.",["r"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.reset-all","Setup","Reset all bindings","Reset all bindings to defaults.",["shift+r"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.save","Setup","Save bindings","Save keybinding changes.",["s"],"terminal",["setup.keybindings"],"save-keybindings"),e("crtr.setup.keybindings.discard","Setup","Discard changes","Discard keybinding changes.",["escape"],"terminal",["setup.keybindings"],"leave-screen"),e("crtr.setup.keybindings.page-up","Setup","Page up","Move up one keybinding page.",["pageup"],"terminal",["setup.keybindings","setup.keybindings.edit"]),e("crtr.setup.keybindings.page-down","Setup","Page down","Move down one keybinding page.",["pagedown"],"terminal",["setup.keybindings","setup.keybindings.edit"]),e("crtr.setup.keybindings.filter","Setup","Filter bindings","Open the keybinding filter.",["/"],"terminal",["setup.keybindings"]),e("crtr.setup.keybindings.filter-delete","Setup","Delete filter text","Delete the previous filter character.",["backspace"],"terminal",["setup.keybindings.filter"]),e("crtr.setup.keybindings.filter-clear","Setup","Clear filter","Clear the keybinding filter.",["escape"],"terminal",["setup.keybindings.filter"],"dismiss-modal"),e("crtr.setup.cell-previous","Setup","Previous field","Select the previous field or setup table cell.",["h"],"terminal",["setup.models","setup.keybindings"]),e("crtr.setup.cell-next","Setup","Next field","Select the next field or setup table cell.",["l"],"terminal",["setup.models","setup.keybindings"]),e("crtr.setup.models.open","Setup","Edit model","Edit the selected model cell or route field.",["enter"],"terminal",["setup.models","setup.models.route-form"]),e("crtr.setup.models.scope-next","Setup","Next model config scope","Edit the next applicable user, profile, or project config.",["s"],"terminal",["setup.models"]),e("crtr.setup.models.commit","Setup","Commit pick","Commit the provider, strength, model, or thinking-level pick.",["enter"],"terminal",["setup.models.picker","setup.models.dimension-picker"]),e("crtr.setup.models.cancel","Setup","Cancel pick","Cancel the model picker or route form.",["escape"],"terminal",["setup.models.picker","setup.models.dimension-picker","setup.models.route-form"],"dismiss-modal")]}a(y,"setupBindings");const C=new Set(w.map(t=>t.id));function P(t){return t.contexts.includes("attach")&&(t.inputKind==="terminal"||t.inputKind==="host-global")}a(P,"isAttachPaneBinding");const A=Object.freeze([{context:"graph",capability:"dismiss-modal"},{context:"graph.confirm",capability:"dismiss-modal"},{context:"inspector",capability:"leave-screen"},{context:"inspector",capability:"dismiss-modal"},{context:"attach.search",capability:"dismiss-modal"},{context:"browse",capability:"leave-screen"},{context:"browse.search",capability:"dismiss-modal"},{context:"profile.menu",capability:"leave-screen"},{context:"profile.search",capability:"leave-screen"},{context:"setup.login",capability:"leave-screen"},{context:"setup.list",capability:"leave-screen"},{context:"setup.input",capability:"leave-screen"},{context:"setup.confirm",capability:"dismiss-modal"},{context:"setup.keybindings",capability:"leave-screen"},{context:"setup.keybindings",capability:"save-keybindings"},{context:"setup.keybindings.edit",capability:"dismiss-modal"},{context:"setup.keybindings.filter",capability:"dismiss-modal"},{context:"setup.models",capability:"leave-screen"},{context:"setup.models.picker",capability:"dismiss-modal"},{context:"setup.models.dimension-picker",capability:"dismiss-modal"},{context:"setup.models.route-form",capability:"dismiss-modal"},{context:"setup.models.confirm",capability:"dismiss-modal"}]);export{w as BINDING_CATALOG,C as BINDING_IDS,A as SAFETY_REQUIREMENTS,P as isAttachPaneBinding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var i=(n,e)=>c(n,"name",{value:e,configurable:!0});import{isDeepStrictEqual as
|
|
1
|
+
var c=Object.defineProperty;var i=(n,e)=>c(n,"name",{value:e,configurable:!0});import{isDeepStrictEqual as a}from"node:util";import{configPath as m,normalizeTmuxPassthrough as o,updateRawConfigAtomically as x}from"../config.js";import{normalizeSparseOverrides as b}from"./resolve.js";class l extends Error{static{i(this,"KeybindingConcurrentEditError")}latestKeybindings;latestTmuxPassthrough;constructor(e,r){super("keybindings changed on disk; reload before saving"),this.name="KeybindingConcurrentEditError",this.latestKeybindings=e,this.latestTmuxPassthrough=r}}async function O(n,e={}){const r=b(n),g=Object.hasOwn(e,"tmuxPassthrough"),d=o(e.tmuxPassthrough);let u=[];const h=m("user");if(h===null)throw new Error("user config path is unavailable");return await x("user",t=>{if(Object.hasOwn(e,"expectedKeybindings")&&!a(t.keybindings,e.expectedKeybindings)||Object.hasOwn(e,"expectedTmuxPassthrough")&&!a(t.tmux_passthrough,e.expectedTmuxPassthrough))throw new l(t.keybindings,t.tmux_passthrough);const s={...t};return delete s.canvasNav,Object.keys(r).length===0?delete s.keybindings:s.keybindings=r,g&&(s.tmux_passthrough=d),u=o(s.tmux_passthrough),s}),Object.freeze({path:h,overrides:Object.freeze({...r}),tmuxPassthrough:Object.freeze([...u])})}i(O,"persistUserKeybindings");export{l as KeybindingConcurrentEditError,O as persistUserKeybindings};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.704",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -156,8 +156,8 @@
|
|
|
156
156
|
},
|
|
157
157
|
"license": "UNLICENSED",
|
|
158
158
|
"dependencies": {
|
|
159
|
-
"@north-light/identity": "0.3.
|
|
160
|
-
"@north-light/plugin": "0.3.
|
|
159
|
+
"@north-light/identity": "0.3.704",
|
|
160
|
+
"@north-light/plugin": "0.3.704",
|
|
161
161
|
"@earendil-works/chord": "1.5.2",
|
|
162
162
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
163
163
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -39,7 +39,7 @@ export function defaultAgentDir() {
|
|
|
39
39
|
const APP_KEYBINDINGS = {
|
|
40
40
|
'app.interrupt': { defaultKeys: 'escape', description: 'Cancel or abort' },
|
|
41
41
|
'app.clear': { defaultKeys: 'ctrl+c', description: 'Clear editor' },
|
|
42
|
-
'app.exit': { defaultKeys:
|
|
42
|
+
'app.exit': { defaultKeys: [], description: 'Exit when editor is empty' },
|
|
43
43
|
'app.suspend': { defaultKeys: 'ctrl+z', description: 'Suspend to background' },
|
|
44
44
|
'app.thinking.cycle': { defaultKeys: 'shift+tab', description: 'Cycle thinking level' },
|
|
45
45
|
'app.model.cycleForward': { defaultKeys: 'ctrl+p', description: 'Cycle to next model' },
|
|
@@ -47,7 +47,7 @@ const APP_KEYBINDINGS = {
|
|
|
47
47
|
'app.model.select': { defaultKeys: 'ctrl+l', description: 'Open model selector' },
|
|
48
48
|
'app.tools.expand': { defaultKeys: 'ctrl+o', description: 'Show more detail (verbosity level)' },
|
|
49
49
|
'app.thinking.toggle': { defaultKeys: 'ctrl+t', description: 'Toggle thinking blocks' },
|
|
50
|
-
'app.editor.external': { defaultKeys: 'ctrl+g', description: 'Open external editor' },
|
|
50
|
+
'app.editor.external': { defaultKeys: 'ctrl+alt+g', description: 'Open external editor' },
|
|
51
51
|
// Alt+Enter inserts a newline in the attach editor (shift+enter is unreliable
|
|
52
52
|
// across terminals), so the follow-up-queue action drops its alt+enter default
|
|
53
53
|
// to free the chord — see ATTACH_KEYBINDING_OVERRIDES below.
|
|
@@ -94,6 +94,10 @@ export function loadUserKeybindings(agentDir = defaultAgentDir()) {
|
|
|
94
94
|
*/
|
|
95
95
|
const ATTACH_KEYBINDING_OVERRIDES = {
|
|
96
96
|
'tui.input.newLine': { defaultKeys: ['shift+enter', 'alt+enter'], description: 'Insert new line' },
|
|
97
|
+
// Ctrl+K/U/D/J/G scroll the transcript (crtr.attach.scroll.*), so the editor gives them up.
|
|
98
|
+
'tui.editor.deleteToLineStart': { defaultKeys: [], description: 'Delete to line start' },
|
|
99
|
+
'tui.editor.deleteToLineEnd': { defaultKeys: [], description: 'Delete to line end' },
|
|
100
|
+
'tui.editor.deleteCharForward': { defaultKeys: ['delete'], description: 'Delete character forward' },
|
|
97
101
|
};
|
|
98
102
|
export function createKeybindingsManager(agentDir = defaultAgentDir()) {
|
|
99
103
|
const definitions = {
|
|
@@ -49,7 +49,7 @@ export function detachHint(bindings) {
|
|
|
49
49
|
}
|
|
50
50
|
return undefined;
|
|
51
51
|
}
|
|
52
|
-
/** The dedicated detach binding's spelling (
|
|
52
|
+
/** The dedicated detach binding's spelling (unbound by default), for pointing the user at
|
|
53
53
|
* detach now that a second ctrl+c cancels the running turn instead. */
|
|
54
54
|
export function detachBindingHint(bindings) {
|
|
55
55
|
return bindings.gestures('crtr.attach.detach').length > 0
|
|
@@ -77,7 +77,7 @@ function quoteIfNeeded(word) {
|
|
|
77
77
|
return /^[A-Za-z0-9._:@/-]+$/.test(word) ? word : shellQuote(word);
|
|
78
78
|
}
|
|
79
79
|
/** Run the interactive attach session against `nodeId`. Resolves when the
|
|
80
|
-
* viewer detaches
|
|
80
|
+
* viewer detaches, the broker goes away, or a signal lands —
|
|
81
81
|
* always restoring the terminal first. `canvasName`, when set, attaches over
|
|
82
82
|
* a relayed WebSocket to that `remoteCanvas.targets.<name>` instead of the
|
|
83
83
|
* local unix socket — see the `--canvas` flag on `attachToLeaf`. */
|
|
@@ -844,7 +844,7 @@ onConnected) {
|
|
|
844
844
|
if (input.abortTurn())
|
|
845
845
|
setNotice('Canceling the agent…');
|
|
846
846
|
else
|
|
847
|
-
setNotice(`Nothing running to cancel — press ${detachBindingHint(crouterBindings) ?? '
|
|
847
|
+
setNotice(`Nothing running to cancel — press ${detachBindingHint(crouterBindings) ?? 'the crouter menu, then d,'} to detach`);
|
|
848
848
|
},
|
|
849
849
|
toggleGraph: () => graphOverlay.toggle(),
|
|
850
850
|
toggleHelp: () => helpOverlay.toggle(),
|
|
@@ -221,7 +221,7 @@ export class SetupKeybindingsDraft {
|
|
|
221
221
|
this.expected = Object.keys(overrides).length === 0 ? undefined : cloneKeybindings(overrides);
|
|
222
222
|
this.baseline = cloneKeybindings(overrides);
|
|
223
223
|
this.current = cloneKeybindings(overrides);
|
|
224
|
-
this.expectedPassthrough =
|
|
224
|
+
this.expectedPassthrough = [...tmuxPassthrough];
|
|
225
225
|
this.baselinePassthrough = [...tmuxPassthrough];
|
|
226
226
|
this.currentPassthrough = [...tmuxPassthrough];
|
|
227
227
|
this.baselineInvalidRoot = undefined;
|
|
@@ -207,9 +207,16 @@ function normalizeKeybindings(raw) {
|
|
|
207
207
|
return out;
|
|
208
208
|
}
|
|
209
209
|
const ATTACH_PANE_BINDING_IDS = new Set(BINDING_CATALOG.filter(isAttachPaneBinding).map((definition) => definition.id));
|
|
210
|
+
/** Attach scroll keys tmux wraps by default, so the Ctrl scroll keys keep each user's own tmux binding in every non-viewer pane. An explicit list, including an empty one, replaces this. */
|
|
211
|
+
export const DEFAULT_TMUX_PASSTHROUGH = Object.freeze([
|
|
212
|
+
'crtr.attach.scroll.up', 'crtr.attach.scroll.down', 'crtr.attach.scroll.page-up', 'crtr.attach.scroll.page-down', 'crtr.attach.scroll.live',
|
|
213
|
+
]);
|
|
210
214
|
/** Normalize the user-owned list of attach actions allowed to bridge through an
|
|
211
|
-
* occupied tmux root binding. Unknown and non-attach ids have no effect.
|
|
215
|
+
* occupied tmux root binding. Unknown and non-attach ids have no effect.
|
|
216
|
+
* `undefined` (no saved setting) yields the default list; any other non-array yields an empty list. */
|
|
212
217
|
export function normalizeTmuxPassthrough(raw) {
|
|
218
|
+
if (raw === undefined)
|
|
219
|
+
return [...DEFAULT_TMUX_PASSTHROUGH];
|
|
213
220
|
if (!Array.isArray(raw))
|
|
214
221
|
return [];
|
|
215
222
|
return [...new Set(raw.filter((id) => typeof id === 'string' && BINDING_IDS.has(id) && ATTACH_PANE_BINDING_IDS.has(id)))];
|
|
@@ -77,7 +77,7 @@ export const BINDING_CATALOG = Object.freeze([
|
|
|
77
77
|
b('crtr.tmux.node.next', 'Global tmux', 'Next node', 'Focus the next canvas node.', ['alt+]'], 'host-global', ['tmux.root']),
|
|
78
78
|
b('crtr.tmux.node.previous', 'Global tmux', 'Previous node', 'Focus the previous canvas node.', ['alt+['], 'host-global', ['tmux.root']),
|
|
79
79
|
b('crtr.tmux.inbox.toggle', 'Global tmux', 'Toggle inbox', 'Open or close the human inbox in the focused viewer.', ['alt+i'], 'host-global', ['tmux.root']),
|
|
80
|
-
...attachEntry('crtr.tmux.menu.attach.detach', 'crtr.attach.detach', 'Detach', 'Detach from the node.', ['d'], [
|
|
80
|
+
...attachEntry('crtr.tmux.menu.attach.detach', 'crtr.attach.detach', 'Detach', 'Detach from the node.', ['d'], []),
|
|
81
81
|
...attachEntry('crtr.tmux.menu.attach.clear-or-detach', 'crtr.attach.clear-or-detach', 'Clear input (cancel agent on repeat)', 'Clear the input; press again within a second to cancel the running agent turn. Detach lives on its own binding.', ['c'], ['ctrl+c']),
|
|
82
82
|
...attachEntry('crtr.tmux.menu.attach.graph.toggle', 'crtr.attach.graph.toggle', 'Toggle graph', 'Open or close the graph overlay.', ['g'], ['alt+g']),
|
|
83
83
|
...attachEntry('crtr.tmux.menu.attach.help.toggle', 'crtr.attach.help.toggle', 'Help', 'Open the attach help overlay.', ['?'], ['alt+shift+k']),
|
|
@@ -91,11 +91,11 @@ export const BINDING_CATALOG = Object.freeze([
|
|
|
91
91
|
...attachEntry('crtr.tmux.menu.attach.search', 'crtr.attach.search', 'Search transcript', 'Search the transcript as it is currently displayed — folded tool output is not searched until it is unfolded.', ['/'], ['alt+/']),
|
|
92
92
|
...attachEntry('crtr.tmux.menu.attach.reload-viewer', 'crtr.attach.reload-viewer', 'Reload viewer', 'Restart this viewer in place on the installed release.', [], []),
|
|
93
93
|
...attachEntry('crtr.tmux.menu.attach.whip', 'crtr.attach.whip', 'Whip agent', 'Interrupt the agent and send a playful command.', ['w'], []),
|
|
94
|
-
b('crtr.attach.scroll.up', 'Attach', 'Scroll up', 'Scroll the transcript one line up.', ['shift+up'], 'terminal', ATTACH_CONTEXTS),
|
|
95
|
-
b('crtr.attach.scroll.down', 'Attach', 'Scroll down', 'Scroll the transcript one line down.', ['shift+down'], 'terminal', ATTACH_CONTEXTS),
|
|
96
|
-
b('crtr.attach.scroll.page-up', 'Attach', 'Scroll page up', 'Scroll the transcript one page up.', ['pageup'], 'terminal', ATTACH_CONTEXTS),
|
|
97
|
-
b('crtr.attach.scroll.page-down', 'Attach', 'Scroll page down', 'Scroll the transcript one page down.', ['pagedown'], 'terminal', ATTACH_CONTEXTS),
|
|
98
|
-
b('crtr.attach.scroll.live', 'Attach', 'Return to live', 'Return the transcript to the live bottom.', ['shift+end'], 'terminal', ATTACH_CONTEXTS),
|
|
94
|
+
b('crtr.attach.scroll.up', 'Attach', 'Scroll up', 'Scroll the transcript one line up.', ['shift+up', 'ctrl+k'], 'terminal', ATTACH_CONTEXTS),
|
|
95
|
+
b('crtr.attach.scroll.down', 'Attach', 'Scroll down', 'Scroll the transcript one line down.', ['shift+down', 'ctrl+j'], 'terminal', ATTACH_CONTEXTS),
|
|
96
|
+
b('crtr.attach.scroll.page-up', 'Attach', 'Scroll page up', 'Scroll the transcript one page up.', ['pageup', 'ctrl+u'], 'terminal', ATTACH_CONTEXTS),
|
|
97
|
+
b('crtr.attach.scroll.page-down', 'Attach', 'Scroll page down', 'Scroll the transcript one page down.', ['pagedown', 'ctrl+d'], 'terminal', ATTACH_CONTEXTS),
|
|
98
|
+
b('crtr.attach.scroll.live', 'Attach', 'Return to live', 'Return the transcript to the live bottom.', ['shift+end', 'ctrl+g'], 'terminal', ATTACH_CONTEXTS),
|
|
99
99
|
b('crtr.attach.mouse.toggle', 'Attach', 'Toggle mouse wheel scrolling', 'Toggle mouse wheel scrolling on or off.', ['alt+shift+o'], 'terminal', ATTACH_CONTEXTS),
|
|
100
100
|
b('crtr.attach.copy.message', 'Attach', 'Copy visible message', 'Copy the newest message visible in the transcript viewport.', ['alt+shift+y'], 'terminal', ATTACH_CONTEXTS),
|
|
101
101
|
b('crtr.attach.verbosity.less', 'Attach', 'Less detail', 'Show the transcript one verbosity level more collapsed, in this viewer only; Ctrl+O shows more.', ['ctrl+shift+o'], 'terminal', ATTACH_CONTEXTS),
|