@north-light/cli 0.3.654 → 0.3.655
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/input/controller.d.ts +2 -3
- package/dist/clients/attach/input/controller.js +3 -3
- package/dist/clients/attach/render/chat-view.d.ts +41 -37
- package/dist/clients/attach/render/chat-view.js +3 -3
- package/dist/clients/attach/session/bindings.d.ts +1 -1
- package/dist/clients/attach/session/bindings.js +1 -1
- package/dist/clients/attach/session/input-wiring.d.ts +9 -9
- package/dist/clients/attach/session/input-wiring.js +1 -1
- package/dist/clients/attach/slash/dispatch.d.ts +6 -8
- package/dist/clients/attach/slash/dispatch.js +2 -2
- package/dist/clients/attach/viewer.js +514 -514
- package/dist/commands/node/create.js +1 -1
- package/dist/commands/sys/panels/prefs-panel.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/graph/documents.js +13 -11
- package/dist/core/graph/edges.js +4 -3
- package/dist/core/graph/exposures.js +7 -4
- package/dist/core/graph/kinds/document.js +4 -4
- package/dist/core/graph/kinds/dto.d.ts +2 -0
- package/dist/core/graph/kinds/dto.js +1 -1
- package/dist/core/graph/names.d.ts +4 -0
- package/dist/core/graph/names.js +9 -8
- package/dist/core/graph/rules.d.ts +2 -0
- package/dist/core/graph/rules.js +3 -3
- package/dist/core/keybindings/catalog.d.ts +3 -3
- package/dist/core/keybindings/catalog.js +1 -1
- package/dist/core/runtime/broker/tool-groups.js +1 -1
- package/dist/core/runtime/broker/turn-replies.d.ts +1 -4
- package/dist/core/runtime/broker/turn-replies.js +1 -1
- package/dist/core/runtime/broker-protocol.d.ts +2 -2
- package/dist/core/runtime/tmux-bindings.js +3 -3
- package/dist/core/substrate/delivery/corpus.d.ts +3 -0
- package/dist/core/substrate/delivery/corpus.js +2 -3
- package/dist/core/substrate/delivery/render-event.js +4 -4
- package/dist/core/user-settings.d.ts +13 -35
- package/dist/core/user-settings.js +1 -1
- package/dist/types.d.ts +13 -15
- package/dist/types.js +1 -1
- package/docs/cli/the-viewer.md +16 -2
- package/package.json +2 -2
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +13 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var u=(e,n)=>Q(e,"name",{value:n,configurable:!0});import{mkdtempSync as Y,rmSync as Z,writeFileSync as V}from"node:fs";import{tmpdir as O}from"node:os";import{join as M}from"node:path";import{ATTACH_CONTROL_BINDINGS as U,BINDING_CATALOG as _,BINDING_IDS as ee,encodeAttachControlInput as ne,formatGesture as te,isAttachPaneBinding as re,resolveUserKeybindingSettings as q}from"../keybindings/index.js";import{normalizeTmuxPassthrough as ie}from"../config.js";import{withExclusiveDirectoryLock as oe}from"../exclusive-lock.js";import{surfaceTmuxStyleArgs as se}from"./surface-bg.js";import{runTmux as f,shellQuote as k}from"./tmux-driver.js";const A="@crtr_keybindings_manifest",p="root",ue={"crtr.tmux.menu.promote":{description:"promote to orchestrator",action:{kind:"keys",keys:"/promote"}},"crtr.tmux.menu.resume":{description:"find node",action:{kind:"keys",keys:"/resume"}},"crtr.tmux.menu.dashboard":{description:"dashboard",action:{kind:"direct",run:"surface dashboard --pane {pane}"}},"crtr.tmux.menu.fork":{description:"fork into idle root",action:{kind:"direct",run:"node fork --pane {pane}"}},"crtr.tmux.menu.demote-mode":{description:"demote to base node",action:{kind:"direct",run:"node config --mode base --pane {pane}"}},"crtr.tmux.menu.demote":{description:"demote to terminal (finish when done)",action:{kind:"direct",run:"node lifecycle demote --pane {pane}"}},"crtr.tmux.menu.make-resident":{description:"make resident (interactable)",action:{kind:"direct",run:"node config --lifecycle resident --pane {pane}"}},"crtr.tmux.menu.detach":{description:"demote + close viewer",action:{kind:"direct",run:"node lifecycle demote --pane {pane} --detach"}},"crtr.tmux.menu.close-subtree":{description:"close agent + subtree",action:{kind:"direct",run:"node lifecycle close --pane {pane}"}},"crtr.tmux.menu.background-bash":{description:"background running bash",action:{kind:"direct",run:"node bash background --pane {pane}"}},"crtr.tmux.menu.file-review":{description:"review a file",action:{kind:"raw-keys",keys:"M-S-r"}},"crtr.tmux.menu.metadata":{description:"metadata",action:{kind:"keys",keys:"/node-metadata"}},"crtr.tmux.menu.fold-tools":{description:"fold finished tool calls",action:{kind:"keys",keys:"/fold-tools"}},"crtr.tmux.menu.show-working":{description:"show/hide working",action:{kind:"keys",keys:"/show-working"}},"crtr.tmux.menu.context":{description:"context + reports",action:{kind:"keys",keys:"/context"}},"crtr.tmux.menu.providers":{description:"settings",action:{kind:"popup",run:"sys settings",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.provider-options":{description:"provider options",action:{kind:"popup",run:"sys settings --page provider-options",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.plugins":{description:"plugins",action:{kind:"popup",run:"pkg browse",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.analytics":{description:"analytics",action:{kind:"popup",run:"canvas analytics --pane {pane}",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.context-admin":{description:"context surface",action:{kind:"popup",run:"sys context admin",size:{w:"98%",h:"96%"}}},"crtr.tmux.menu.graph":{description:"canvas graph",action:{kind:"keys",keys:"/graph"}},"crtr.tmux.menu.focus-manager":{description:"go to manager",action:{kind:"command",run:"surface node focus {manager}"}},"crtr.tmux.menu.copy-id":{description:"copy node id",action:{kind:"direct",run:"surface node id --pane {pane}"}},"crtr.tmux.menu.reload-viewer":{description:"reload viewer",action:{kind:"direct",run:"surface reload --pane {pane}"}},"crtr.tmux.menu.recap":{description:"generate recap",action:{kind:"keys",keys:"/recap"}},"crtr.tmux.menu.pin":{description:"pin conversation",action:{kind:"direct",run:"surface node pin --pane {pane}"}},"crtr.tmux.menu.issue.idea":{description:"idea",action:{kind:"popup",run:"canvas issue new --type idea"}},"crtr.tmux.menu.issue.bug":{description:"bug",action:{kind:"popup",run:"canvas issue new --type bug"}}};function b(e){return e.replace(/#/g,"##")}u(b,"escapeTmuxFormats");function ce(e){return e.map(k).join(" ")}u(ce,"tmuxCommand");const ae={w:"60%",h:"50%"};function G(e,n=!1,t=ae){const r=`crtr canvas chord --pane '#{pane_id}' --run ${k(b(e))}${n?" --interactive":""}`;return n?{argv:["display-popup","-E","-w",t.w,"-h",t.h,"-d","#{pane_current_path}",r],menu:`display-popup -E -w ${t.w} -h ${t.h} -d "#{pane_current_path}" ${k(r)}`}:{argv:["run-shell",`${r} >/dev/null 2>&1`],menu:`run-shell ${k(`${r} >/dev/null 2>&1`)}`}}u(G,"chordCommand");function de(e){const t=`crtr ${b(e).replace("{pane}","#{pane_id}")} >/dev/null 2>&1`;return{argv:["run-shell","-b",t],menu:`run-shell -b ${k(t)}`}}u(de,"directCommand");function j(e){switch(e.kind){case"disabled":return null;case"separator":return null;case"dismiss":return{argv:["refresh-client"],menu:"refresh-client"};case"keys":{const n=b(e.keys);return{argv:["send-keys",n,"Enter"],menu:`send-keys -t '#{pane_id}' ${k(n)} Enter`}}case"raw-keys":{const n=b(e.keys);return{argv:["send-keys",n],menu:`send-keys -t '#{pane_id}' ${k(n)}`}}case"literal-input":{const n=b(e.input);return{argv:["send-keys","-l",n],menu:`send-keys -l -t '#{pane_id}' ${k(n)}`}}case"command":return G(e.run);case"direct":return de(e.run);case"popup":return G(e.run,!0,e.size);case"submenu":{const n=N(e.title,e.items);return{argv:n,menu:ce(n)}}}}u(j,"menuActionCommand");function me(e){return j(e)?.menu??""}u(me,"renderMenuAction");function pe(e){return e.replace(/#\[[^\]]*\]/g,"").length}u(pe,"menuItemWidth");function N(e,n){const t=b(e),r=n.reduce((o,c)=>Math.max(o,pe(c.description)),0),s=["display-menu","-T",`#[align=centre]${t}`,...se()];s.push("-x",`#{e|-:#{pane_right},${Math.max(t.length,r)+7}}`,"-y","#{e|+:#{pane_top},3}","--");for(const o of n){if(o.action.kind==="separator"){s.push("");continue}const c=o.action.kind==="disabled"?o.description:b(o.description);s.push(c,o.selector,me(o.action))}return s.push("","-esc / q to close","",""),s}u(N,"buildMenuArgs");const le={enter:"Enter",escape:"Escape",tab:"Tab",backspace:"BSpace",delete:"DC",space:"Space",up:"Up",down:"Down",left:"Left",right:"Right",pageup:"PPage",pagedown:"NPage",home:"Home",end:"End"};function z(e){if(e==="+")return{key:"+",modifiers:[]};if(e.endsWith("++"))return{key:"+",modifiers:e.slice(0,-2).split("+")};const n=e.split("+");return{key:n.pop(),modifiers:n}}u(z,"normalizedStrokeParts");function fe(e){return v(e)[0]}u(fe,"tmuxKey");function v(e){let{key:n,modifiers:t}=z(e);const r=new Set(t),s=u((o,c)=>[r.has("ctrl")?"C-":"",r.has("alt")?"M-":"",c?"S-":"",le[o]??o].join(""),"name");if(r.has("shift")&&n.length===1&&/[a-z]/.test(n)){const o=n.toUpperCase();return!r.has("ctrl")&&!r.has("alt")?[s(o,!1)]:[s(o,!0),s(o,!1),s(n,!0)]}return[s(n,r.has("shift"))]}u(v,"tmuxKeyNames");function ge(e){const{key:n,modifiers:t}=z(e);return t.includes("shift")&&/[a-z]/.test(n)?n.toUpperCase():n==="space"?" ":n}u(ge,"menuSelector");function T(e,n,t){const r=[];for(const s of e){const o=n.get(s);if(o!==void 0)for(const c of t.gestures(s))r.push({description:o.description,selector:ge(c),action:o.action})}return r}u(T,"boundMenuItems");function F(e){const n=new Map;for(const[c,l]of Object.entries(ue))l!==void 0&&n.set(c,l);for(const{menuId:c,actionId:l}of U){const x=_.find(w=>w.id===l);if(x===void 0)throw new Error(`missing attach binding definition ${l}`);n.set(c,{description:x.name.toLowerCase(),action:{kind:"literal-input",input:ne(l)}})}const t=T(U.map(({menuId:c})=>c),n,e);t.length>0&&n.set("crtr.tmux.menu.attach",{description:"attach viewer \u203A",action:{kind:"submenu",title:" attach viewer ",items:t}});const r=T(["crtr.tmux.menu.metadata","crtr.tmux.menu.context"],n,e);n.set("crtr.tmux.menu.show",{description:"inspect \u203A",action:{kind:"submenu",title:" inspect node ",items:r}});const s=T(["crtr.tmux.menu.fold-tools","crtr.tmux.menu.show-working"],n,e);n.set("crtr.tmux.menu.view-settings",{description:"display \u203A",action:{kind:"submenu",title:" display ",items:s}});const o=T(["crtr.tmux.menu.issue.idea","crtr.tmux.menu.issue.bug"],n,e);return n.set("crtr.tmux.menu.issues",{description:"create \u203A",action:{kind:"submenu",title:" create ",items:o}}),n}u(F,"resolvedMenuActions");function K(e,n){const t=u(c=>T(c,n,e),"boundItems"),r=[],s=u((c,l)=>{l.length!==0&&(r.length>0&&r.push({description:"",selector:"",action:{kind:"separator"}}),r.push({description:`-#[bold]${c}`,selector:"",action:{kind:"disabled"}},...l))},"addGroup");s("Explore",t(["crtr.tmux.menu.dashboard","crtr.tmux.menu.resume","crtr.tmux.menu.graph","crtr.tmux.menu.focus-manager","crtr.tmux.menu.show","crtr.tmux.menu.view-settings"])),s("Current node",t(["crtr.tmux.menu.attach","crtr.tmux.menu.background-bash","crtr.tmux.menu.file-review","crtr.tmux.menu.pin","crtr.tmux.menu.copy-id","crtr.tmux.menu.reload-viewer","crtr.tmux.menu.recap"])),s("Lifecycle",t(["crtr.tmux.menu.fork","crtr.tmux.menu.promote","crtr.tmux.menu.demote-mode","crtr.tmux.menu.demote","crtr.tmux.menu.make-resident","crtr.tmux.menu.detach","crtr.tmux.menu.close-subtree"])),s("System",t(["crtr.tmux.menu.providers","crtr.tmux.menu.provider-options","crtr.tmux.menu.plugins","crtr.tmux.menu.analytics","crtr.tmux.menu.context-admin","crtr.tmux.menu.issues"]));const o=e.gestures("crtr.tmux.menu.open");if(o.length>0&&r.length>0){r.push({description:"",selector:"",action:{kind:"separator"}});for(const c of o)r.push({description:`${te(c)} to close`,selector:fe(c),action:{kind:"dismiss"}})}return r}u(K,"menuItems");function Pe(e){const n=e??q().bindings;return N(" crtr ",K(n,F(n)))}u(Pe,"crouterMenuTmuxArgs");function S(e,n){let t=n;for(;t<e.length&&/\s/.test(e[t]);)t+=1;if(t>=e.length)return null;let r=null,s="";for(;t<e.length;){const o=e[t];if(r===null&&/\s/.test(o))break;if(r===null&&(o==="'"||o==='"')){r=o,t+=1;continue}if(r===o){r=null,t+=1;continue}if(o==="\\"&&r!=="'"&&t+1<e.length){s+=e[t+1],t+=2;continue}s+=o,t+=1}return{value:s,end:t}}u(S,"readTmuxToken");function B(e){const n=S(e,0);if(n?.value!=="bind-key")return null;let t=n.end,r=!1;for(;;){const s=S(e,t);if(s===null)return null;if(t=s.end,s.value==="-r"){r=!0;continue}if(s.value!=="-T")continue;const o=S(e,t);if(o===null)return null;const c=S(e,o.end);return c===null?null:{table:o.value,key:c.value,command:e.slice(c.end).trimStart(),repeat:r}}}u(B,"parseTmuxBinding");function $(e,n){const t=f(["list-keys","-T",e]);return t.ok?t.stdout.split(`
|
|
1
|
+
var Q=Object.defineProperty;var u=(e,n)=>Q(e,"name",{value:n,configurable:!0});import{mkdtempSync as Y,rmSync as Z,writeFileSync as V}from"node:fs";import{tmpdir as O}from"node:os";import{join as M}from"node:path";import{ATTACH_CONTROL_BINDINGS as U,BINDING_CATALOG as _,BINDING_IDS as ee,encodeAttachControlInput as ne,formatGesture as te,isAttachPaneBinding as re,resolveUserKeybindingSettings as q}from"../keybindings/index.js";import{normalizeTmuxPassthrough as ie}from"../config.js";import{withExclusiveDirectoryLock as oe}from"../exclusive-lock.js";import{surfaceTmuxStyleArgs as se}from"./surface-bg.js";import{runTmux as f,shellQuote as x}from"./tmux-driver.js";const A="@crtr_keybindings_manifest",p="root",ue={"crtr.tmux.menu.promote":{description:"promote to orchestrator",action:{kind:"keys",keys:"/promote"}},"crtr.tmux.menu.resume":{description:"find node",action:{kind:"keys",keys:"/resume"}},"crtr.tmux.menu.dashboard":{description:"dashboard",action:{kind:"direct",run:"surface dashboard --pane {pane}"}},"crtr.tmux.menu.fork":{description:"fork into idle root",action:{kind:"direct",run:"node fork --pane {pane}"}},"crtr.tmux.menu.demote-mode":{description:"demote to base node",action:{kind:"direct",run:"node config --mode base --pane {pane}"}},"crtr.tmux.menu.demote":{description:"demote to terminal (finish when done)",action:{kind:"direct",run:"node lifecycle demote --pane {pane}"}},"crtr.tmux.menu.make-resident":{description:"make resident (interactable)",action:{kind:"direct",run:"node config --lifecycle resident --pane {pane}"}},"crtr.tmux.menu.detach":{description:"demote + close viewer",action:{kind:"direct",run:"node lifecycle demote --pane {pane} --detach"}},"crtr.tmux.menu.close-subtree":{description:"close agent + subtree",action:{kind:"direct",run:"node lifecycle close --pane {pane}"}},"crtr.tmux.menu.background-bash":{description:"background running bash",action:{kind:"direct",run:"node bash background --pane {pane}"}},"crtr.tmux.menu.file-review":{description:"review a file",action:{kind:"raw-keys",keys:"M-S-r"}},"crtr.tmux.menu.metadata":{description:"metadata",action:{kind:"keys",keys:"/node-metadata"}},"crtr.tmux.menu.more-detail":{description:"more detail",action:{kind:"keys",keys:"/more-detail"}},"crtr.tmux.menu.less-detail":{description:"less detail",action:{kind:"keys",keys:"/less-detail"}},"crtr.tmux.menu.context":{description:"context + reports",action:{kind:"keys",keys:"/context"}},"crtr.tmux.menu.providers":{description:"settings",action:{kind:"popup",run:"sys settings",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.provider-options":{description:"provider options",action:{kind:"popup",run:"sys settings --page provider-options",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.plugins":{description:"plugins",action:{kind:"popup",run:"pkg browse",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.analytics":{description:"analytics",action:{kind:"popup",run:"canvas analytics --pane {pane}",size:{w:"90%",h:"85%"}}},"crtr.tmux.menu.context-admin":{description:"context surface",action:{kind:"popup",run:"sys context admin",size:{w:"98%",h:"96%"}}},"crtr.tmux.menu.graph":{description:"canvas graph",action:{kind:"keys",keys:"/graph"}},"crtr.tmux.menu.focus-manager":{description:"go to manager",action:{kind:"command",run:"surface node focus {manager}"}},"crtr.tmux.menu.copy-id":{description:"copy node id",action:{kind:"direct",run:"surface node id --pane {pane}"}},"crtr.tmux.menu.reload-viewer":{description:"reload viewer",action:{kind:"direct",run:"surface reload --pane {pane}"}},"crtr.tmux.menu.recap":{description:"generate recap",action:{kind:"keys",keys:"/recap"}},"crtr.tmux.menu.pin":{description:"pin conversation",action:{kind:"direct",run:"surface node pin --pane {pane}"}},"crtr.tmux.menu.issue.idea":{description:"idea",action:{kind:"popup",run:"canvas issue new --type idea"}},"crtr.tmux.menu.issue.bug":{description:"bug",action:{kind:"popup",run:"canvas issue new --type bug"}}};function b(e){return e.replace(/#/g,"##")}u(b,"escapeTmuxFormats");function ce(e){return e.map(x).join(" ")}u(ce,"tmuxCommand");const ae={w:"60%",h:"50%"};function G(e,n=!1,t=ae){const r=`crtr canvas chord --pane '#{pane_id}' --run ${x(b(e))}${n?" --interactive":""}`;return n?{argv:["display-popup","-E","-w",t.w,"-h",t.h,"-d","#{pane_current_path}",r],menu:`display-popup -E -w ${t.w} -h ${t.h} -d "#{pane_current_path}" ${x(r)}`}:{argv:["run-shell",`${r} >/dev/null 2>&1`],menu:`run-shell ${x(`${r} >/dev/null 2>&1`)}`}}u(G,"chordCommand");function de(e){const t=`crtr ${b(e).replace("{pane}","#{pane_id}")} >/dev/null 2>&1`;return{argv:["run-shell","-b",t],menu:`run-shell -b ${x(t)}`}}u(de,"directCommand");function j(e){switch(e.kind){case"disabled":return null;case"separator":return null;case"dismiss":return{argv:["refresh-client"],menu:"refresh-client"};case"keys":{const n=b(e.keys);return{argv:["send-keys",n,"Enter"],menu:`send-keys -t '#{pane_id}' ${x(n)} Enter`}}case"raw-keys":{const n=b(e.keys);return{argv:["send-keys",n],menu:`send-keys -t '#{pane_id}' ${x(n)}`}}case"literal-input":{const n=b(e.input);return{argv:["send-keys","-l",n],menu:`send-keys -l -t '#{pane_id}' ${x(n)}`}}case"command":return G(e.run);case"direct":return de(e.run);case"popup":return G(e.run,!0,e.size);case"submenu":{const n=N(e.title,e.items);return{argv:n,menu:ce(n)}}}}u(j,"menuActionCommand");function me(e){return j(e)?.menu??""}u(me,"renderMenuAction");function pe(e){return e.replace(/#\[[^\]]*\]/g,"").length}u(pe,"menuItemWidth");function N(e,n){const t=b(e),r=n.reduce((o,c)=>Math.max(o,pe(c.description)),0),s=["display-menu","-T",`#[align=centre]${t}`,...se()];s.push("-x",`#{e|-:#{pane_right},${Math.max(t.length,r)+7}}`,"-y","#{e|+:#{pane_top},3}","--");for(const o of n){if(o.action.kind==="separator"){s.push("");continue}const c=o.action.kind==="disabled"?o.description:b(o.description);s.push(c,o.selector,me(o.action))}return s.push("","-esc / q to close","",""),s}u(N,"buildMenuArgs");const le={enter:"Enter",escape:"Escape",tab:"Tab",backspace:"BSpace",delete:"DC",space:"Space",up:"Up",down:"Down",left:"Left",right:"Right",pageup:"PPage",pagedown:"NPage",home:"Home",end:"End"};function z(e){if(e==="+")return{key:"+",modifiers:[]};if(e.endsWith("++"))return{key:"+",modifiers:e.slice(0,-2).split("+")};const n=e.split("+");return{key:n.pop(),modifiers:n}}u(z,"normalizedStrokeParts");function fe(e){return v(e)[0]}u(fe,"tmuxKey");function v(e){let{key:n,modifiers:t}=z(e);const r=new Set(t),s=u((o,c)=>[r.has("ctrl")?"C-":"",r.has("alt")?"M-":"",c?"S-":"",le[o]??o].join(""),"name");if(r.has("shift")&&n.length===1&&/[a-z]/.test(n)){const o=n.toUpperCase();return!r.has("ctrl")&&!r.has("alt")?[s(o,!1)]:[s(o,!0),s(o,!1),s(n,!0)]}return[s(n,r.has("shift"))]}u(v,"tmuxKeyNames");function ge(e){const{key:n,modifiers:t}=z(e);return t.includes("shift")&&/[a-z]/.test(n)?n.toUpperCase():n==="space"?" ":n}u(ge,"menuSelector");function T(e,n,t){const r=[];for(const s of e){const o=n.get(s);if(o!==void 0)for(const c of t.gestures(s))r.push({description:o.description,selector:ge(c),action:o.action})}return r}u(T,"boundMenuItems");function F(e){const n=new Map;for(const[c,l]of Object.entries(ue))l!==void 0&&n.set(c,l);for(const{menuId:c,actionId:l}of U){const h=_.find(w=>w.id===l);if(h===void 0)throw new Error(`missing attach binding definition ${l}`);n.set(c,{description:h.name.toLowerCase(),action:{kind:"literal-input",input:ne(l)}})}const t=T(U.map(({menuId:c})=>c),n,e);t.length>0&&n.set("crtr.tmux.menu.attach",{description:"attach viewer \u203A",action:{kind:"submenu",title:" attach viewer ",items:t}});const r=T(["crtr.tmux.menu.metadata","crtr.tmux.menu.context"],n,e);n.set("crtr.tmux.menu.show",{description:"inspect \u203A",action:{kind:"submenu",title:" inspect node ",items:r}});const s=T(["crtr.tmux.menu.more-detail","crtr.tmux.menu.less-detail"],n,e);n.set("crtr.tmux.menu.view-settings",{description:"display \u203A",action:{kind:"submenu",title:" display ",items:s}});const o=T(["crtr.tmux.menu.issue.idea","crtr.tmux.menu.issue.bug"],n,e);return n.set("crtr.tmux.menu.issues",{description:"create \u203A",action:{kind:"submenu",title:" create ",items:o}}),n}u(F,"resolvedMenuActions");function K(e,n){const t=u(c=>T(c,n,e),"boundItems"),r=[],s=u((c,l)=>{l.length!==0&&(r.length>0&&r.push({description:"",selector:"",action:{kind:"separator"}}),r.push({description:`-#[bold]${c}`,selector:"",action:{kind:"disabled"}},...l))},"addGroup");s("Explore",t(["crtr.tmux.menu.dashboard","crtr.tmux.menu.resume","crtr.tmux.menu.graph","crtr.tmux.menu.focus-manager","crtr.tmux.menu.show","crtr.tmux.menu.view-settings"])),s("Current node",t(["crtr.tmux.menu.attach","crtr.tmux.menu.background-bash","crtr.tmux.menu.file-review","crtr.tmux.menu.pin","crtr.tmux.menu.copy-id","crtr.tmux.menu.reload-viewer","crtr.tmux.menu.recap"])),s("Lifecycle",t(["crtr.tmux.menu.fork","crtr.tmux.menu.promote","crtr.tmux.menu.demote-mode","crtr.tmux.menu.demote","crtr.tmux.menu.make-resident","crtr.tmux.menu.detach","crtr.tmux.menu.close-subtree"])),s("System",t(["crtr.tmux.menu.providers","crtr.tmux.menu.provider-options","crtr.tmux.menu.plugins","crtr.tmux.menu.analytics","crtr.tmux.menu.context-admin","crtr.tmux.menu.issues"]));const o=e.gestures("crtr.tmux.menu.open");if(o.length>0&&r.length>0){r.push({description:"",selector:"",action:{kind:"separator"}});for(const c of o)r.push({description:`${te(c)} to close`,selector:fe(c),action:{kind:"dismiss"}})}return r}u(K,"menuItems");function Pe(e){const n=e??q().bindings;return N(" crtr ",K(n,F(n)))}u(Pe,"crouterMenuTmuxArgs");function S(e,n){let t=n;for(;t<e.length&&/\s/.test(e[t]);)t+=1;if(t>=e.length)return null;let r=null,s="";for(;t<e.length;){const o=e[t];if(r===null&&/\s/.test(o))break;if(r===null&&(o==="'"||o==='"')){r=o,t+=1;continue}if(r===o){r=null,t+=1;continue}if(o==="\\"&&r!=="'"&&t+1<e.length){s+=e[t+1],t+=2;continue}s+=o,t+=1}return{value:s,end:t}}u(S,"readTmuxToken");function B(e){const n=S(e,0);if(n?.value!=="bind-key")return null;let t=n.end,r=!1;for(;;){const s=S(e,t);if(s===null)return null;if(t=s.end,s.value==="-r"){r=!0;continue}if(s.value!=="-T")continue;const o=S(e,t);if(o===null)return null;const c=S(e,o.end);return c===null?null:{table:o.value,key:c.value,command:e.slice(c.end).trimStart(),repeat:r}}}u(B,"parseTmuxBinding");function $(e,n){const t=f(["list-keys","-T",e]);return t.ok?t.stdout.split(`
|
|
2
2
|
`).find(r=>{const s=B(r);return s?.table===e&&s.key===n})??null:null}u($,"bindingAt");function Le(e){const n=f(["list-keys","-T",p]);if(!n.ok)return[];const t=new Set(n.stdout.split(`
|
|
3
|
-
`).flatMap(r=>{const s=B(r);return s?.table===p?[s.key]:[]}));return e.filter(r=>!r.includes(" > ")&&v(r).some(s=>t.has(s)))}u(Le,"occupiedTmuxRootGestures");function R(e){return typeof e=="object"&&e!==null&&typeof e.table=="string"&&typeof e.key=="string"}u(R,"isInstalledPair");function
|
|
4
|
-
`,"utf8"),f(["source-file",t])}finally{Z(n,{recursive:!0,force:!0})}}u(be,"sourceBindingLine");function X(e){return e.original===null?f(["unbind-key","-T",p,C(e.key)]):be(e.original)}u(X,"restoreWrappedBinding");function we(){return["run-shell","-b",'crtr surface inbox --quiet --tmux-socket "#{socket_path}" --tmux-client "#{client_name}" --target-pane "#{pane_id}"']}u(we,"inboxToggleTmuxCommand");function ve(e){switch(e){case"crtr.tmux.node.next":return["run-shell","crtr surface node cycle --dir next --pane '#{pane_id}' >/dev/null 2>&1"];case"crtr.tmux.node.previous":return["run-shell","crtr surface node cycle --dir prev --pane '#{pane_id}' >/dev/null 2>&1"];case"crtr.tmux.inbox.toggle":return we();default:throw new Error(`no tmux command for ${e}`)}}u(ve,"actionCommand");function $e(){const e=process.env.TMUX?.split(",")[0]?.trim();if(e!==void 0&&e!=="")return`${e}.crtr-keybindings.lock`;const n=f(["display-message","-p","#{socket_path}"]);if(n.ok&&n.stdout!=="")return`${n.stdout}.crtr-keybindings.lock`;const t=typeof process.getuid=="function"?process.getuid():"user";return M(O(),`crtr-tmux-keybindings-${t}.lock`)}u($e,"tmuxBindingLockPath");function De(e,n=[]){return oe($e(),()=>Ie(e,n))}u(De,"installTmuxBindings");function Ie(e,n=[]){const t=e===void 0?q():void 0,r=e??t.bindings,s=e===void 0?t.tmuxPassthrough:ie(n),o=[],c=[],l=
|
|
3
|
+
`).flatMap(r=>{const s=B(r);return s?.table===p?[s.key]:[]}));return e.filter(r=>!r.includes(" > ")&&v(r).some(s=>t.has(s)))}u(Le,"occupiedTmuxRootGestures");function R(e){return typeof e=="object"&&e!==null&&typeof e.table=="string"&&typeof e.key=="string"}u(R,"isInstalledPair");function ke(e){if(typeof e!="object"||e===null)return!1;const n=e;return typeof n.bindingId=="string"&&ee.has(n.bindingId)&&typeof n.gesture=="string"&&typeof n.key=="string"&&(typeof n.original=="string"||n.original===null)&&typeof n.wrapper=="string"&&(n.state==="owned"||n.state==="relinquished")}u(ke,"isWrappedRootBinding");function xe(){const e=f(["show-options","-s","-q",A]);if(!e.ok)return null;if(e.stdout==="")return{pairs:[],wrappers:[]};const n=f(["show-options","-s","-qv",A]);if(!n.ok)return null;try{const t=JSON.parse(n.stdout);if(Array.isArray(t))return t.every(R)?{pairs:t,wrappers:[]}:null;if(typeof t!="object"||t===null)return null;const r=t;return!Array.isArray(r.pairs)||!r.pairs.every(R)||!Array.isArray(r.wrappers)||!r.wrappers.every(ke)?null:{pairs:r.pairs,wrappers:r.wrappers}}catch{return null}}u(xe,"readManifest");function W(e){return f(["set-option","-s",A,JSON.stringify(e)])}u(W,"writeManifest");function C(e){return e.replace(/\\/g,"\\\\").replace(/;/g,"\\;")}u(C,"tmuxKeyArgument");function he(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/;/g,"\\;")}"`}u(he,"tmuxCommandToken");function ye(e){let n=null,t="";for(let r=0;r<e.length;r+=1){const s=e[r];if(n===null&&(s==="'"||s==='"')){n=s,t+=s;continue}if(n===s){n=null,t+=s;continue}if(s==="\\"&&r+1<e.length){const o=e[r+1];n===null&&o===";"?t+=";":t+=s+o,r+=1;continue}t+=s}return t}u(ye,"bindingCommandForBranch");function be(e){const n=Y(M(O(),"crtr-tmux-binding-")),t=M(n,"binding.conf");try{return V(t,`${e}
|
|
4
|
+
`,"utf8"),f(["source-file",t])}finally{Z(n,{recursive:!0,force:!0})}}u(be,"sourceBindingLine");function X(e){return e.original===null?f(["unbind-key","-T",p,C(e.key)]):be(e.original)}u(X,"restoreWrappedBinding");function we(){return["run-shell","-b",'crtr surface inbox --quiet --tmux-socket "#{socket_path}" --tmux-client "#{client_name}" --target-pane "#{pane_id}"']}u(we,"inboxToggleTmuxCommand");function ve(e){switch(e){case"crtr.tmux.node.next":return["run-shell","crtr surface node cycle --dir next --pane '#{pane_id}' >/dev/null 2>&1"];case"crtr.tmux.node.previous":return["run-shell","crtr surface node cycle --dir prev --pane '#{pane_id}' >/dev/null 2>&1"];case"crtr.tmux.inbox.toggle":return we();default:throw new Error(`no tmux command for ${e}`)}}u(ve,"actionCommand");function $e(){const e=process.env.TMUX?.split(",")[0]?.trim();if(e!==void 0&&e!=="")return`${e}.crtr-keybindings.lock`;const n=f(["display-message","-p","#{socket_path}"]);if(n.ok&&n.stdout!=="")return`${n.stdout}.crtr-keybindings.lock`;const t=typeof process.getuid=="function"?process.getuid():"user";return M(O(),`crtr-tmux-keybindings-${t}.lock`)}u($e,"tmuxBindingLockPath");function De(e,n=[]){return oe($e(),()=>Ie(e,n))}u(De,"installTmuxBindings");function Ie(e,n=[]){const t=e===void 0?q():void 0,r=e??t.bindings,s=e===void 0?t.tmuxPassthrough:ie(n),o=[],c=[],l=xe();if(l===null)return o.push({code:"tmux-error",message:`tmux is unavailable or ${A} is malformed`}),{ok:!1,installed:c,diagnostics:o};const h=new Map;for(const i of s){const a=_.find(d=>d.id===i);if(!(a===void 0||!re(a))){for(const d of r.gestures(i))if(!d.includes(" > "))for(const m of v(d))h.has(m)||h.set(m,{bindingId:i,gesture:d})}}const w=new Set,I=[];for(const i of l.wrappers){const a=h.get(i.key),d=$(p,i.key);if(d!==null&&d===i.original)continue;if(i.state==="relinquished"||d!==i.wrapper){w.add(i.key),a!==void 0&&I.push({...i,...a,state:"relinquished"});continue}const m=X(i);m.ok||(w.add(i.key),I.push(i),o.push({code:"tmux-error",bindingId:i.bindingId,gesture:i.gesture,message:`could not restore tmux binding ${p}:${i.key}: ${m.stderr}`}))}for(const i of l.pairs){if(i.table===p&&w.has(i.key))continue;const a=f(["unbind-key","-T",i.table,C(i.key)]);!a.ok&&$(i.table,i.key)!==null&&o.push({code:"tmux-error",message:`could not remove crouter binding ${i.table}:${i.key}: ${a.stderr}`})}if(o.some(i=>i.code==="tmux-error")){const i=W({pairs:l.pairs,wrappers:I});return i.ok||o.push({code:"tmux-error",message:`could not save crouter tmux ownership manifest: ${i.stderr}`}),{ok:!1,installed:c,diagnostics:o}}const E=u((i,a,d,m,k)=>{if($(i,a)!==null)return o.push({code:"occupied",bindingId:m,gesture:k,message:`${i}:${a} is already bound by tmux; ${m} was not installed`}),!1;const g=f(["bind-key","-T",i,C(a),...d]);return g.ok?(c.push({table:i,key:a}),!0):(o.push({code:"tmux-error",bindingId:m,gesture:k,message:`could not install ${m}: ${g.stderr}`}),!1)},"install"),P=F(r),H=N(" crtr ",K(r,P));for(const i of r.gestures("crtr.tmux.menu.open"))for(const a of v(i))E(p,a,H,"crtr.tmux.menu.open",i);for(const i of _){if(i.pair?.field!=="menu")continue;const a=_.find(y=>y.id===i.pair?.pairedId);if(a?.pair?.field!=="global")continue;const d=i.id,m=a.id,k=P.get(d),g=k===void 0?null:j(k.action);if(g===null)throw new Error(`no direct tmux action for paired menu binding ${d}`);for(const y of r.gestures(m))for(const J of v(y))E(p,J,g.argv,m,y)}for(const i of["crtr.tmux.node.next","crtr.tmux.node.previous","crtr.tmux.inbox.toggle"])for(const a of r.gestures(i))for(const d of v(a))E(p,d,ve(i),i,a);const L=[];for(const[i,a]of h){if(w.has(i))continue;const d=$(p,i);if(d===null)continue;const m=B(d);if(m===null||m.command===""){o.push({code:"tmux-error",bindingId:a.bindingId,gesture:a.gesture,message:`could not parse occupied tmux binding ${p}:${i}`});continue}const k=f(["bind-key",...m.repeat?["-r"]:[],"-T",p,C(i),"if-shell","-F","#{!=:#{@crtr_attach},}",`send-keys ${he(i)}`,ye(m.command)]);if(!k.ok){o.push({code:"tmux-error",bindingId:a.bindingId,gesture:a.gesture,message:`could not wrap ${p}:${i}: ${k.stderr}`});continue}const g=$(p,i);if(g===null||!g.includes("@crtr_attach")){o.push({code:"tmux-error",bindingId:a.bindingId,gesture:a.gesture,message:`could not fingerprint wrapped tmux binding ${p}:${i}`});continue}const y={...a,key:i,original:d,wrapper:g,state:"owned"};I.push(y),L.push(y)}const D=W({pairs:c,wrappers:I});if(!D.ok){o.push({code:"tmux-error",message:`could not save crouter tmux ownership manifest: ${D.stderr}`});for(const i of L)$(p,i.key)===i.wrapper&&X(i)}return{ok:o.every(i=>i.code!=="tmux-error"),installed:c,diagnostics:o}}u(Ie,"reconcileTmuxBindings");export{Pe as crouterMenuTmuxArgs,we as inboxToggleTmuxCommand,De as installTmuxBindings,Le as occupiedTmuxRootGestures};
|
|
@@ -18,6 +18,9 @@ export declare function primeBodies(db: CanvasDb, docs: readonly DeliveryDoc[]):
|
|
|
18
18
|
/** Documents with a rule on one of `on` whose owner is in the reader's view and that the reader may read, in view order. At `boot` a node's
|
|
19
19
|
* own documents come in even without a boot rule. */
|
|
20
20
|
export declare function loadCorpus(db: CanvasDb, reader: Reader, on: RuleOn[]): Promise<DeliveryDoc[]>;
|
|
21
|
+
/** Documents as delivery documents for `reader`, each with all its rules, in the order given (explicit reads and link targets). Every one
|
|
22
|
+
* must be a live document the reader may read. */
|
|
23
|
+
export declare function deliveryDocsOf(db: CanvasDb, reader: Reader, docs: readonly ObjectRow[]): Promise<DeliveryDoc[]>;
|
|
21
24
|
/** One document as a delivery document for `reader`, with all its rules (an explicit read). */
|
|
22
25
|
export declare function deliveryDocOf(db: CanvasDb, reader: Reader, doc: ObjectRow): Promise<DeliveryDoc>;
|
|
23
26
|
/** Every listed document of one owner the reader can read, for prefix listings. */
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
var S=Object.defineProperty;var
|
|
2
|
-
WHERE o.type = 'document' AND o.deleted_at IS NULL AND ${
|
|
3
|
-
ORDER BY number DESC LIMIT 1`).get(t.id,...o);if(!i)throw new Error(`document ${t.id} has no head revision ${t.heads_key}`);return i.body_hash}s(b,"headBodyHash");async function $(e,t,o){return{view:o,ev:await L(e,t)}}s($,"resolveContext");async function x(e,t,o,i,n,l,c){const{view:r}=o,w=r.findIndex(H=>H.id===n.owner),d=w>=0?r[w]:await e.prepare("SELECT * FROM objects WHERE id = ?").get(n.owner),p=N(d),u=c?.get(n.name),y=u===void 0?await I(e,t,n.name,o):u===null?{missing:!0}:{object:{id:u}},f=await b(e,n),{heads_key:E,unlisted:a,source_path:m,...M}=n,g={object:M,owner:d,ownerHandle:p,viewRank:w>=0?w:r.length,ownNode:t.class==="node"&&n.owner===t.node.id,shipped:m!==null,kind:n.kind==="preference"?"preference":"knowledge",name:n.name,displayName:"object"in y&&y.object.id===n.id?n.name:`${p}/${n.name}`,preview:n.preview,unlisted:a!==0,headsKey:E,bodyHash:f,body:s(async()=>v.get(g)??U(g,await A(e,f)),"body"),rules:l,limit:W(i,d,t)};return g}s(x,"toDeliveryDoc");const v=new WeakMap;function U(e,t){return v.set(e,t),t}s(U,"remember");async function X(e,t){const o=t.filter(n=>!v.has(n)),i=await C(e,o.map(n=>n.bodyHash));for(const n of o)v.set(n,i.get(n.bodyHash))}s(X,"primeBodies");async function Z(e,t,o){const i=await j(e,t),n=await $(e,t,i),l=await R(e,t),c=new Map;if(i.length===0)return[];const r=await k(e,n.ev,"read","o"),w={sql:`${r.sql} AND o.owner IN (${i.map(()=>"?").join(",")})`,params:[...r.params,...i.map(a=>a.id)]};for(const a of await B(e,o,w))c.set(a.object,[...c.get(a.object)??[],a]);const d=t.class==="node"&&o.includes("boot")?await h(e,n.ev,"o.owner = ?",[t.node.id]):[],p=[...new Set([...c.keys(),...d.map(a=>a.id)])],u=p.length===0?[]:await h(e,n.ev,`o.id IN (${p.map(()=>"?").join(",")})`,p),y=new Map(i.map((a,m)=>[a.id,m])),f=s(a=>y.get(a.owner)??i.length,"rankOf"),E=await D(e,n,u.map(a=>a.name));return await O(u.sort((a,m)=>f(a)-f(m)||a.seq-m.seq),async a=>await x(e,t,n,l,a,c.get(a.id)??[],E))}s(Z,"loadCorpus");async function ee(e,t,o){const i=await $(e,t,await j(e,t)),n=(await h(e,i.ev,"o.id = ?",[o.id]))[0];if(!n)throw new Error(`document ${o.id} has no documents row or is not readable`);return await x(e,t,i,await R(e,t),n,await _(e,n))}s(ee,"deliveryDocOf");async function te(e,t,o){const i=await $(e,t,await j(e,t)),n=await R(e,t),l=await h(e,i.ev,"o.owner = ? AND d.unlisted = 0",[o.id]),c=await D(e,i,l.map(r=>r.name));return await O(l,async r=>await x(e,t,i,n,r,await _(e,r),c))}s(te,"listingCorpus");async function ne(e,t){if(t.class!=="node")throw new Error(`nodeSubject needs a node reader, got ${t.class}`);const o=await F(t.node.id,[...t.repos,...t.projectRepos]);if(o===null)throw new Error(`no node ${t.node.id}`);return o}s(ne,"nodeSubject");export{ee as deliveryDocOf,W as deliveryLimitFor,te as listingCorpus,Z as loadCorpus,ne as nodeSubject,N as ownerHandle,X as primeBodies,T as typedLimitKey};
|
|
1
|
+
var S=Object.defineProperty;var r=(e,t)=>S(e,"name",{value:t,configurable:!0});import{permits as A,resolveReader as H}from"../../permissions/evaluator.js";import{get as L,getMany as q}from"../../graph/bodies.js";import{resolveName as B,viewOf as C,viewResolutions as F}from"../../graph/names.js";import{rulesOn as W,rulesOfMany as Y}from"../../graph/rules.js";import{loadExactProfileManifest as I}from"../../profiles/manifest.js";import{assembleNodeSubject as T}from"../subject.js";import{mapAsync as K}from"../../async-array.js";function b(e){return e.type==="node"?e.id:e.name}r(b,"ownerHandle");function U(e){return`${e.type}:${b(e)}`}r(U,"typedLimitKey");function J(e,t,n){if(n?.class==="node"&&n.profile!==null&&n.profile.id===t.id)return"content";const i=e?.delivery_limits;return i?i[U(t)]??i[b(t)]??"content":"content"}r(J,"deliveryLimitFor");async function P(e,t){if(t.class!=="node"||t.profile===null)return null;const n=await e.prepare("SELECT external_id FROM identities WHERE object = ? AND scheme = 'profile'").get(t.profile.id);if(!n)throw new Error(`profile object ${t.profile.id} has no profile identity`);return I(n.external_id).manifest}r(P,"readerManifest");async function N(e,t){const n=await C(e,t),i=await H(e,t);return{reader:t,context:{view:n,ev:i},read:await A(e,i,"read","o"),manifest:await P(e,t)}}r(N,"corpusScope");async function y(e,t,n,i){return await e.prepareUncached(`SELECT o.*, d.heads_key, d.unlisted, d.source_path FROM objects o JOIN documents d ON d.object = o.id
|
|
2
|
+
WHERE o.type = 'document' AND o.deleted_at IS NULL AND ${n} AND ${t.read.sql} ORDER BY o.seq`).all(...i,...t.read.params)}r(y,"documentRows");async function z(e,t){const n=[...new Set(t.flatMap(a=>a.heads_key.split(",")))],i=n.length===0?[]:await e.prepare("SELECT rev_id, document, number, body_hash FROM revisions WHERE rev_id = ANY(?::text[])").all(n),s=new Map(i.map(a=>[a.rev_id,a])),l=new Map;for(const a of t){let d;for(const p of a.heads_key.split(",")){const u=s.get(p);if(u===void 0||u.document!==a.id)continue;const f=Number(u.number);(d===void 0||f>d.number)&&(d={number:f,body_hash:u.body_hash})}if(d===void 0)throw new Error(`document ${a.id} has no head revision ${a.heads_key}`);l.set(a.id,d.body_hash)}return l}r(z,"headBodyHashes");async function x(e,t,n,i){if(n.length===0)return[];const{reader:s,context:l,manifest:a}=t,{view:d}=l,p=new Map(d.map((o,w)=>[o.id,w])),u=[...new Set(n.map(o=>o.owner).filter(o=>!p.has(o)))],f=new Map(d.map(o=>[o.id,o]));if(u.length>0)for(const o of await e.prepare("SELECT * FROM objects WHERE id = ANY(?::text[])").all(u))f.set(o.id,o);const h=i??await Y(e,n.map(o=>o.id)),c=await z(e,n),m=await F(e,l,n.map(o=>o.name));return await K(n,async o=>{const w=f.get(o.owner);if(w===void 0)throw new Error(`document ${o.id} has no owner row ${o.owner}`);const R=p.get(w.id)??d.length,_=b(w),v=m.get(o.name),j=v===void 0?await B(e,s,o.name,l):v===null?{missing:!0}:{object:{id:v}},M=c.get(o.id),{heads_key:$,unlisted:k,source_path:O,...D}=o,E={object:D,owner:w,ownerHandle:_,viewRank:R,ownNode:s.class==="node"&&o.owner===s.node.id,shipped:O!==null,kind:o.kind==="preference"?"preference":"knowledge",name:o.name,displayName:"object"in j&&j.object.id===o.id?o.name:`${_}/${o.name}`,preview:o.preview,unlisted:k!==0,headsKey:$,bodyHash:M,body:r(async()=>g.get(E)??G(E,await L(e,M)),"body"),rules:h.get(o.id)??[],limit:J(a,w,s)};return E})}r(x,"toDeliveryDocs");const g=new WeakMap;function G(e,t){return g.set(e,t),t}r(G,"remember");async function se(e,t){const n=t.filter(s=>!g.has(s)),i=await q(e,n.map(s=>s.bodyHash));for(const s of n)g.set(s,i.get(s.bodyHash))}r(se,"primeBodies");async function ae(e,t,n){const i=await N(e,t),{view:s}=i.context,l=new Map;if(s.length===0)return[];const a={sql:`${i.read.sql} AND o.owner IN (${s.map(()=>"?").join(",")})`,params:[...i.read.params,...s.map(c=>c.id)]};for(const c of await W(e,n,a))l.set(c.object,[...l.get(c.object)??[],c]);const d=t.class==="node"&&n.includes("boot")?await y(e,i,"o.owner = ?",[t.node.id]):[],p=[...new Set([...l.keys(),...d.map(c=>c.id)])],u=p.length===0?[]:await y(e,i,"o.id = ANY(?::text[])",[p]),f=new Map(s.map((c,m)=>[c.id,m])),h=r(c=>f.get(c.owner)??s.length,"rankOf");return await x(e,i,u.sort((c,m)=>h(c)-h(m)||c.seq-m.seq),l)}r(ae,"loadCorpus");async function Q(e,t,n){if(n.length===0)return[];const i=await N(e,t),s=n.map(a=>a.id),l=new Map((await y(e,i,"o.id = ANY(?::text[])",[s])).map(a=>[a.id,a]));return await x(e,i,s.map(a=>{const d=l.get(a);if(!d)throw new Error(`document ${a} has no documents row or is not readable`);return d}))}r(Q,"deliveryDocsOf");async function re(e,t,n){return(await Q(e,t,[n]))[0]}r(re,"deliveryDocOf");async function ce(e,t,n){const i=await N(e,t);return await x(e,i,await y(e,i,"o.owner = ? AND d.unlisted = 0",[n.id]))}r(ce,"listingCorpus");async function de(e,t){if(t.class!=="node")throw new Error(`nodeSubject needs a node reader, got ${t.class}`);const n=await T(t.node.id,[...t.repos,...t.projectRepos]);if(n===null)throw new Error(`no node ${t.node.id}`);return n}r(de,"nodeSubject");export{re as deliveryDocOf,Q as deliveryDocsOf,J as deliveryLimitFor,ce as listingCorpus,ae as loadCorpus,de as nodeSubject,b as ownerHandle,se as primeBodies,U as typedLimitKey};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var A=Object.defineProperty;var d=(e,n)=>A(e,"name",{value:n,configurable:!0});import{permits as D,resolveReader as H}from"../../permissions/evaluator.js";import{heldAtOrAbove as v,hold as b,holdListing as K,listedAtOrAbove as E}from"../../graph/exposures.js";import{deliveryDocsOf as O,listingCorpus as R,loadCorpus as g,primeBodies as L}from"./corpus.js";import{listingBlock as C,ownSetBlock as B,listingKey as P,listingLabel as x,listingPrefixes as k,renderListing as M}from"./listings.js";import{planDelivery as S}from"./plan.js";function w(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}d(w,"attr");async function W(e,n){let t=`kind="${w(e.kind)}" name="${w(e.displayName)}"`;if(n==="content"){const i=(await e.body()).trim();if(i!=="")return`<memory ${t}>
|
|
2
2
|
${i}
|
|
3
|
-
</memory>`}else n==="preview"&&e.preview.trim()!==""&&(t+=` readWhen="${w(e.preview.trim())}"`);return`<memory ${t} />`}
|
|
3
|
+
</memory>`}else n==="preview"&&e.preview.trim()!==""&&(t+=` readWhen="${w(e.preview.trim())}"`);return`<memory ${t} />`}d(W,"renderEnvelope");function j(e){return e.length===0?"":`<auto-loaded-context>
|
|
4
4
|
${e.join(`
|
|
5
5
|
`)}
|
|
6
|
-
</auto-loaded-context>`}
|
|
6
|
+
</auto-loaded-context>`}d(j,"wrapAutoLoaded");async function q(e,n){let t=e.members.get(n.owner.id);return t===void 0&&(t=await R(e.ctx.db,e.ctx.reader,n.owner),e.members.set(n.owner.id,t)),t}d(q,"membersOf");async function I(e,n,t){const i=await D(e,await H(e,n),"read","o"),o=await e.prepareUncached(`SELECT o.* FROM edges e JOIN objects o ON o.id = e.dst
|
|
7
7
|
WHERE e.type = 'links-to' AND e.src = ? AND o.type = 'document' AND o.deleted_at IS NULL AND o.id <> ? AND ${i.sql}
|
|
8
|
-
ORDER BY e.written_as`).all(t.object.id,t.object.id,...i.params);return await
|
|
8
|
+
ORDER BY e.written_as`).all(t.object.id,t.object.id,...i.params);return await O(e,n,o)}d(I,"linkedDocs");function U(e,n){return n.owner.id===e.owner.id&&n.name.startsWith(`${e.name}/`)&&!n.name.slice(e.name.length+1).includes("/")}d(U,"underOwnPrefix");async function _(e,n){const{ledger:t,channel:i}=e.ctx,o=[],c=[];for(const r of await I(e.ctx.db,e.ctx.reader,n)){if(U(n,r)&&!r.unlisted)continue;const p={object:r.object.id,headsKey:r.headsKey,contentHash:r.bodyHash};if(v(t,p,"preview"))continue;b(t,i,p,"preview"),e.delivered.push({doc:r,level:"preview",cause:"link preview attached to content delivery"}),c.push(r);const a=r.preview.trim();o.push(a===""?`[[${r.displayName}]]`:`[[${r.displayName}]]: ${a}`)}return{lines:o,linked:c}}d(_,"linkPreviews");async function $(e,n,t){const{ledger:i,channel:o}=e.ctx,c=await q(e,n),r=[];let p,a=[];for(const m of k(c,n.name)){const f=m===n.name,s=P(n,m);if(!(f&&t)&&E(i,s,"preview"))continue;const{lines:l,previewed:u}=M(c,m,i,o,!(f&&t));for(const y of u)e.delivered.push({doc:y,level:"preview",cause:"directory listing attached to content delivery"});l.length!==0&&(K(i,o,s,"preview"),f?a=l:r.push(C(x(n,m),l)))}const h=await _(e,n);return t?a.length>0&&(p=a):a.length+h.lines.length>0&&r.unshift(B(x(n,n.name),a,h.lines)),e.chainCorpus??=await g(e.ctx.db,e.ctx.reader,["document-read"]),r.push(...await N(e,e.chainCorpus,"document-read",{doc:n},"memory-read companion of content delivery")),{blocks:r,...p===void 0?{}:{listing:p},linked:h.linked}}d($,"attachments");async function N(e,n,t,i,o){const{db:c,reader:r,subject:p,ledger:a,channel:h}=e.ctx,m=await S(c,p,r,n,t,i),f=[];await L(c,m.docs.filter(s=>s.winner&&s.finalRung==="content"&&!v(a,{object:s.doc.object.id,headsKey:s.doc.headsKey,contentHash:s.doc.bodyHash},"content")).map(s=>s.doc));for(const s of m.docs){const l=s.finalRung;if(!s.winner||l==="none")continue;const{doc:u}=s,y={object:u.object.id,headsKey:u.headsKey,contentHash:u.bodyHash};v(a,y,l)||(b(a,h,y,l),e.delivered.push({doc:u,level:l,...o===void 0?{}:{cause:o}}),l==="content"&&f.push(...(await $(e,u,!1)).blocks),f.push(await W(u,l)))}return f}d(N,"renderPlan");async function Q(e,n,t,i){i??=await g(e.db,e.reader,[n]);const o={ctx:e,delivered:[],members:new Map};return{content:j(await N(o,i,n,t)),delivered:o.delivered}}d(Q,"renderEvent");async function V(e,n,t=!1){const i={ctx:e,delivered:[],members:new Map};b(e.ledger,e.channel,{object:n.object.id,headsKey:n.headsKey,contentHash:n.bodyHash},"content");const{blocks:o,listing:c,linked:r}=await $(i,n,!t);return{attachments:j(o),...c===void 0?{}:{listing:c},linked:r,delivered:i.delivered}}d(V,"renderExplicitRead");export{I as linkedDocs,W as renderEnvelope,Q as renderEvent,V as renderExplicitRead,j as wrapAutoLoaded};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScopeConfig } from '../types.js';
|
|
1
|
+
import type { Verbosity, ScopeConfig } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Which settings destination owns a preference row. Every settings-surface row
|
|
4
4
|
* must name one, so a new preference cannot be added without deciding where a
|
|
@@ -14,10 +14,17 @@ export interface UserSettingDefinition<Key extends string = string> {
|
|
|
14
14
|
group: UserSettingGroup;
|
|
15
15
|
order: number;
|
|
16
16
|
format: (config: ScopeConfig) => string;
|
|
17
|
+
/** How the settings panel draws the value, when it differs from `format`. */
|
|
18
|
+
display?: (config: ScopeConfig) => string;
|
|
17
19
|
cycle: (config: ScopeConfig, delta: number) => void;
|
|
18
20
|
/** Mutate `config` from a CLI string, returning a user-facing validation error on failure. */
|
|
19
21
|
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
20
22
|
}
|
|
23
|
+
/** Display names for each verbosity level, least detail first. */
|
|
24
|
+
export declare const VERBOSITY_LABELS: Record<Verbosity, string>;
|
|
25
|
+
/** The verbosity level drawn as a track: one stop per level, the current one
|
|
26
|
+
* filled, then its name — e.g. `less ━━━━●────○────○ more Tool calls`. */
|
|
27
|
+
export declare function verbositySpectrum(level: Verbosity): string;
|
|
21
28
|
/**
|
|
22
29
|
* Exhaustive settings-surface coverage for ScopeConfig. Primitive preferences
|
|
23
30
|
* are required by the type to define a Settings row; structured registries must
|
|
@@ -245,33 +252,19 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
|
|
|
245
252
|
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
246
253
|
};
|
|
247
254
|
};
|
|
248
|
-
|
|
255
|
+
verbosity: {
|
|
249
256
|
surface: "settings";
|
|
250
257
|
setting: {
|
|
251
|
-
key: "
|
|
258
|
+
key: "verbosity";
|
|
252
259
|
label: string;
|
|
253
260
|
description: string;
|
|
254
261
|
valueConstraint: string;
|
|
255
262
|
applies: string;
|
|
256
263
|
group: "display";
|
|
257
264
|
order: number;
|
|
258
|
-
format: (config: ScopeConfig) => "
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
summarize_tool_calls: {
|
|
264
|
-
surface: "settings";
|
|
265
|
-
setting: {
|
|
266
|
-
key: "summarize_tool_calls";
|
|
267
|
-
label: string;
|
|
268
|
-
description: string;
|
|
269
|
-
valueConstraint: string;
|
|
270
|
-
applies: string;
|
|
271
|
-
group: "display";
|
|
272
|
-
order: number;
|
|
273
|
-
format: (config: ScopeConfig) => "on" | "off";
|
|
274
|
-
cycle: (config: ScopeConfig) => void;
|
|
265
|
+
format: (config: ScopeConfig) => "replies" | "summaries" | "tools" | "previews" | "full";
|
|
266
|
+
display: (config: ScopeConfig) => string;
|
|
267
|
+
cycle: (config: ScopeConfig, delta: number) => void;
|
|
275
268
|
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
276
269
|
};
|
|
277
270
|
};
|
|
@@ -305,21 +298,6 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
|
|
|
305
298
|
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
306
299
|
};
|
|
307
300
|
};
|
|
308
|
-
consolidate_replies: {
|
|
309
|
-
surface: "settings";
|
|
310
|
-
setting: {
|
|
311
|
-
key: "consolidate_replies";
|
|
312
|
-
label: string;
|
|
313
|
-
description: string;
|
|
314
|
-
valueConstraint: string;
|
|
315
|
-
applies: string;
|
|
316
|
-
group: "display";
|
|
317
|
-
order: number;
|
|
318
|
-
format: (config: ScopeConfig) => "on" | "off";
|
|
319
|
-
cycle: (config: ScopeConfig) => void;
|
|
320
|
-
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
301
|
keybindings: {
|
|
324
302
|
surface: "specialized";
|
|
325
303
|
owner: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=Object.defineProperty;var n=(e,t)=>v(e,"name",{value:t,configurable:!0});import{CONDENSED_HISTORY_MODES as u,MOUSE_MODE_DEFAULTS as p,WHIP_MESSAGE_MODES as d}from"../types.js";function i(e,t,o){const s=e.indexOf(t),a=s>=0?s:0;return e[(a+o+e.length)%e.length]}n(i,"cycleChoice");function c(e,t,o){const s=e.indexOf(t);return s>=0?e[(s+o+e.length)%e.length]:o>=0?e.find(a=>a>t)??e[0]:[...e].reverse().find(a=>a<t)??e[e.length-1]}n(c,"cycleNumber");function r(e,t){return e==="true"?!0:e==="false"?!1:`${t} must be true or false`}n(r,"booleanFromString");function f(e,t){if(!/^\d+$/.test(e))return`${t} must be an integer >= 0`;const o=Number(e);return Number.isSafeInteger(o)?o:`${t} must be an integer >= 0`}n(f,"nonNegativeIntegerFromString");function _(e,t){const o=f(e,t);return typeof o=="string"||o<1?`${t} must be an integer >= 1`:o}n(_,"positiveIntegerFromString");const m=[!1,"notify","apply"],w=[0,1,6,12,24,48,72,168],b=[1,2,3,4,5,6,8,10,12],l="openai-codex";function g(e,t){const o=e.providerOptions[t];if(o!==void 0)return o;const s={};return e.providerOptions[t]=s,s}n(g,"providerOptionsFor");const x=[1,2,3,4,5,6],h={schema_version:{surface:"specialized",owner:"internal schema migration"},marketplaces:{surface:"specialized",owner:"Plugins and pkg market commands"},plugins:{surface:"specialized",owner:"Plugins tab and pkg plugin commands"},auto_update:{surface:"settings",settings:{crtr:{key:"auto_update.crtr",label:"crouter updates",description:"Notify about crouter releases, install them automatically, or turn checks off.",valueConstraint:"true|false|notify|apply; true stores notify",applies:"Applies on the next crouter command.",group:"updates",order:70,format:n(e=>e.auto_update.crtr===!1?"off":e.auto_update.crtr,"format"),cycle:n((e,t)=>{e.auto_update.crtr=i(m,e.auto_update.crtr,t)},"cycle"),setFromString:n((e,t)=>{const o=t==="true"?"notify":t;return o!=="notify"&&o!=="apply"&&o!=="false"?"auto_update.crtr must be notify, apply, or false":(e.auto_update.crtr=o==="false"?!1:o,null)},"setFromString")},content:{key:"auto_update.content",label:"Content updates",description:"Notify about plugin and marketplace updates, apply them automatically, or turn checks off.",valueConstraint:"false|notify|apply",applies:"Applies on the next crouter command.",group:"updates",order:80,format:n(e=>e.auto_update.content===!1?"off":e.auto_update.content,"format"),cycle:n((e,t)=>{e.auto_update.content=i(m,e.auto_update.content,t)},"cycle"),setFromString:n((e,t)=>t!=="notify"&&t!=="apply"&&t!=="false"?"auto_update.content must be notify, apply, or false":(e.auto_update.content=t==="false"?!1:t,null),"setFromString")},interval_hours:{key:"auto_update.interval_hours",label:"Update interval",description:"Minimum hours between automatic update checks. Zero checks on every command.",valueConstraint:"integer >= 0",applies:"Applies on the next crouter command.",group:"updates",order:90,format:n(e=>`${e.auto_update.interval_hours}h`,"format"),cycle:n((e,t)=>{e.auto_update.interval_hours=c(w,e.auto_update.interval_hours,t)},"cycle"),setFromString:n((e,t)=>{const o=f(t,"auto_update.interval_hours");return typeof o=="string"?o:(e.auto_update.interval_hours=o,null)},"setFromString")}}},max_panes_per_window:{surface:"settings",setting:{key:"max_panes_per_window",label:"Maximum panes",description:"Maximum human-review panes placed in one tmux window before using another window.",valueConstraint:"integer >= 1",applies:"Applies to the next pane placement.",group:"panes",order:20,format:n(e=>String(e.max_panes_per_window),"format"),cycle:n((e,t)=>{e.max_panes_per_window=c(b,e.max_panes_per_window,t)},"cycle"),setFromString:n((e,t)=>{const o=_(t,"max_panes_per_window");return typeof o=="string"?o:(e.max_panes_per_window=o,null)},"setFromString")}},auto_open_child_viewers:{surface:"settings",setting:{key:"auto_open_child_viewers",label:"Open child panes",description:"Open each managed child beside its watched parent. Off keeps new children running in the background.",valueConstraint:"true|false",applies:"Applies to the next managed child created; independent roots still open their attended viewer.",group:"panes",order:10,format:n(e=>e.auto_open_child_viewers?"on":"off","format"),cycle:n(e=>{e.auto_open_child_viewers=!e.auto_open_child_viewers},"cycle"),setFromString:n((e,t)=>{const o=r(t,"auto_open_child_viewers");return typeof o=="string"?o:(e.auto_open_child_viewers=o,null)},"setFromString")}},brokerThresholds:{surface:"specialized",owner:"Broker limits tab"},lifecycle:{surface:"specialized",owner:"sys config set lifecycle.unattendedParkMs"},completion_bell:{surface:"settings",setting:{key:"completion_bell",label:"Completion bell",description:"Ring a short sound when the node in an attached viewer finishes a turn.",valueConstraint:"true|false",applies:"Applies on the next turn end.",group:"display",order:41,format:n(e=>e.completion_bell?"on":"off","format"),cycle:n(e=>{e.completion_bell=!e.completion_bell},"cycle"),setFromString:n((e,t)=>{const o=r(t,"completion_bell");return typeof o=="string"?o:(e.completion_bell=o,null)},"setFromString")}},working_gerunds:{surface:"specialized",owner:"sys config set working_gerunds"},whip_mode:{surface:"settings",setting:{key:"whip_mode",label:"Whip mode",description:"Play the whip animation when you send a prompt and when a viewer opens for an agent with an initial prompt.",valueConstraint:"true|false",applies:"Applies on the next attach.",group:"display",order:39,format:n(e=>e.whip_mode?"on":"off","format"),cycle:n(e=>{e.whip_mode=!e.whip_mode},"cycle"),setFromString:n((e,t)=>{const o=r(t,"whip_mode");return typeof o=="string"?o:(e.whip_mode=o,null)},"setFromString")}},page_surface:{surface:"settings",setting:{key:"page_surface",label:"Page human surface",description:"This host reads pages in a browser rather than a terminal. Agents are told the page module runs as written, HTML pages are offered, and document review and live display leave the command tree.",valueConstraint:"true|false",applies:"Applies when human command help is assembled.",group:"display",order:37,format:n(e=>e.page_surface?"on":"off","format"),cycle:n(e=>{e.page_surface=!e.page_surface},"cycle"),setFromString:n((e,t)=>{const o=r(t,"page_surface");return typeof o=="string"?o:(e.page_surface=o,null)},"setFromString")}},whip_messages:{surface:"specialized",owner:"sys config set whip_messages"},whip_message_mode:{surface:"settings",setting:{key:"whip_message_mode",label:"Whip message",description:"What the whip action sends: a random line from whip_messages, or the fixed \u201CGo faster\u201D.",valueConstraint:d.join("|"),applies:"Applies on the next attach.",group:"display",order:40,format:n(e=>e.whip_message_mode==="go-faster"?"go faster":"random","format"),cycle:n((e,t)=>{e.whip_message_mode=i(d,e.whip_message_mode,t)},"cycle"),setFromString:n((e,t)=>d.includes(t)?(e.whip_message_mode=t,null):`whip_message_mode must be one of: ${d.join("|")}`,"setFromString")}},mouse_mode_default:{surface:"settings",setting:{key:"mouse_mode_default",label:"Default mouse mode",description:"Initial mouse wheel scrolling for each attached viewer.",valueConstraint:p.join("|"),applies:"Applies on the next attach.",group:"display",order:38,format:n(e=>e.mouse_mode_default==="tmux"?"follow tmux":e.mouse_mode_default,"format"),cycle:n((e,t)=>{e.mouse_mode_default=i(p,e.mouse_mode_default,t)},"cycle"),setFromString:n((e,t)=>p.includes(t)?(e.mouse_mode_default=t,null):`mouse_mode_default must be one of: ${p.join("|")}`,"setFromString")}},live_cycles:{surface:"settings",setting:{key:"live_cycles",label:"Live cycles",description:"Trailing refresh cycles rendered at full fidelity; older cycles condense to text.",valueConstraint:"integer >= 1",applies:"Applies on the next attach.",group:"display",order:50,format:n(e=>String(e.live_cycles),"format"),cycle:n((e,t)=>{e.live_cycles=c(x,e.live_cycles,t)},"cycle"),setFromString:n((e,t)=>{const o=_(t,"live_cycles");return typeof o=="string"?o:(e.live_cycles=o,null)},"setFromString")}},condensed_history:{surface:"settings",setting:{key:"condensed_history",label:"Condensed history",description:"Messages retained from condensed cycles. Tool calls are never kept.",valueConstraint:u.join("|"),applies:"Applies on the next attach.",group:"display",order:60,format:n(e=>e.condensed_history,"format"),cycle:n((e,t)=>{e.condensed_history=i(u,e.condensed_history,t)},"cycle"),setFromString:n((e,t)=>u.includes(t)?(e.condensed_history=t,null):`condensed_history must be one of: ${u.join("|")}`,"setFromString")}},bash_tool_purpose:{surface:"settings",setting:{key:"bash_tool_purpose",label:"Bash purpose field",description:"Expose the optional purpose label to agents in the bash tool schema. Off removes the field without disabling the bash valve.",valueConstraint:"true|false",applies:"Applies on the next node session.",group:"display",order:25,format:n(e=>e.bash_tool_purpose?"on":"off","format"),cycle:n(e=>{e.bash_tool_purpose=!e.bash_tool_purpose},"cycle"),setFromString:n((e,t)=>{const o=r(t,"bash_tool_purpose");return typeof o=="string"?o:(e.bash_tool_purpose=o,null)},"setFromString")}},fold_finished_tools:{surface:"settings",setting:{key:"fold_finished_tools",label:"Fold finished tools",description:"Fold every settled tool call to its call line. Toggle live with /fold-tools.",valueConstraint:"true|false",applies:"Applies on the next attach.",group:"display",order:30,format:n(e=>e.fold_finished_tools?"on":"off","format"),cycle:n(e=>{e.fold_finished_tools=!e.fold_finished_tools},"cycle"),setFromString:n((e,t)=>{const o=r(t,"fold_finished_tools");return typeof o=="string"?o:(e.fold_finished_tools=o,null)},"setFromString")}},summarize_tool_calls:{surface:"settings",setting:{key:"summarize_tool_calls",label:"Summarize tool calls",description:"Replace completed folded tool-call groups with a one-line broker summary when available.",valueConstraint:"true|false",applies:"Applies when the next visible message closes a tool-call group.",group:"display",order:35,format:n(e=>e.summarize_tool_calls?"on":"off","format"),cycle:n(e=>{e.summarize_tool_calls=!e.summarize_tool_calls},"cycle"),setFromString:n((e,t)=>{const o=r(t,"summarize_tool_calls");return typeof o=="string"?o:(e.summarize_tool_calls=o,null)},"setFromString")}},document_port:{surface:"settings",setting:{key:"document_port",label:"Document browser port",description:"Fixed localhost port where crtrd serves editable document pages.",valueConstraint:"1-65535",applies:"Applies after daemon handover and on the next attach.",group:"display",order:37.5,format:n(e=>String(e.document_port),"format"),cycle:n((e,t)=>{e.document_port=Math.max(1,Math.min(65535,e.document_port+t))},"cycle"),setFromString:n((e,t)=>{const o=Number(t);return!/^\d+$/.test(t)||!Number.isInteger(o)||o<1||o>65535?"document_port must be an integer from 1 to 65535":(e.document_port=o,null)},"setFromString")}},detailed_tool_recaps:{surface:"settings",setting:{key:"detailed_tool_recaps",label:"Detailed tool recaps",description:"Show each document read and edited file in folded tool recaps. Off shows a compact count line instead.",valueConstraint:"true|false",applies:"Applies on the next attach.",group:"display",order:36,format:n(e=>e.detailed_tool_recaps?"on":"off","format"),cycle:n(e=>{e.detailed_tool_recaps=!e.detailed_tool_recaps},"cycle"),setFromString:n((e,t)=>{const o=r(t,"detailed_tool_recaps");return typeof o=="string"?o:(e.detailed_tool_recaps=o,null)},"setFromString")}},consolidate_replies:{surface:"settings",setting:{key:"consolidate_replies",label:"Consolidate replies",description:"Experiment: show one rewritten agent reply per message you type, with the working folded behind it (/show-working).",valueConstraint:"true|false",applies:"Applies on the next attach; the broker reads it per turn.",group:"display",order:36.5,format:n(e=>e.consolidate_replies?"on":"off","format"),cycle:n(e=>{e.consolidate_replies=!e.consolidate_replies},"cycle"),setFromString:n((e,t)=>{const o=r(t,"consolidate_replies");return typeof o=="string"?o:(e.consolidate_replies=o,null)},"setFromString")}},keybindings:{surface:"specialized",owner:"Keybindings tab"},tmux_passthrough:{surface:"specialized",owner:"Keybindings tab"},providerOptions:{surface:"settings",settings:{"openai-codex.fastMode":{key:`providerOptions.${l}.fastMode`,label:"Codex fast mode",description:"Serve Codex turns at the ChatGPT priority tier: about 1.5x faster generation for about 2x the credits. Displayed cost does not reflect the premium.",valueConstraint:"true|false",applies:"Applies on each node's next turn.",group:"providers",order:40,format:n(e=>e.providerOptions[l]?.fastMode?"on":"off","format"),cycle:n(e=>{const t=g(e,l);t.fastMode=!t.fastMode},"cycle"),setFromString:n((e,t)=>{const o=r(t,`providerOptions.${l}.fastMode`);return typeof o=="string"?o:(g(e,l).fastMode=o,null)},"setFromString")}}},modelLadders:{surface:"specialized",owner:"Models tab"},modelRoutes:{surface:"specialized",owner:"Models route declarations"},modelRouting:{surface:"specialized",owner:"Models route declarations"},kinds:{surface:"specialized",owner:"Models tab and kind registry"},page_components:{surface:"specialized",owner:"Page component catalog: product-registered page component kinds"},remoteCanvas:{surface:"specialized",owner:"canvas config commands"},api:{surface:"specialized",owner:"sys connect"},paths:{surface:"specialized",owner:"runtime layout"},store:{surface:"specialized",owner:"daemon conversation store"},runtime:{surface:"specialized",owner:"app-facing listener"},spawnEnv:{surface:"specialized",owner:"spawn environment allow-list"},bin:{surface:"specialized",owner:"bare-binary contributions on every node PATH"},humanActions:{surface:"specialized",owner:"scope-configured human completion actions"}},O=Object.keys(h);function S(){const e=[];for(const t of Object.values(h))t.surface==="settings"&&("setting"in t?e.push(t.setting):e.push(...Object.values(t.settings)));return e.sort((t,o)=>t.order-o.order)}n(S,"collectUserSettings");const y=S();function A(e){return y.find(t=>t.key===e)}n(A,"findUserSetting");function z(e){return y.filter(t=>t.group===e)}n(z,"userSettingsInGroup");export{h as CONFIG_SETTINGS_COVERAGE,O as SCOPE_CONFIG_KEYS,y as USER_SETTINGS,A as findUserSetting,z as userSettingsInGroup};
|
|
1
|
+
var b=Object.defineProperty;var n=(e,t)=>b(e,"name",{value:t,configurable:!0});import{CONDENSED_HISTORY_MODES as p,MOUSE_MODE_DEFAULTS as d,VERBOSITY_LEVELS as a,WHIP_MESSAGE_MODES as c}from"../types.js";const w={replies:"Replies only",summaries:"Messages + summaries",tools:"Tool calls",previews:"Previews",full:"Full"};function x(e){const t=a.indexOf(e);return`less ${a.map((o,s)=>s===t?"\u25CF":"\u25CB").map((o,s)=>s===0?o:`${s<=t?"\u2501\u2501\u2501\u2501":"\u2500\u2500\u2500\u2500"}${o}`).join("")} more ${w[e]}`}n(x,"verbositySpectrum");function l(e,t,r){const o=e.indexOf(t),s=o>=0?o:0;return e[(s+r+e.length)%e.length]}n(l,"cycleChoice");function f(e,t,r){const o=e.indexOf(t);return o>=0?e[(o+r+e.length)%e.length]:r>=0?e.find(s=>s>t)??e[0]:[...e].reverse().find(s=>s<t)??e[e.length-1]}n(f,"cycleNumber");function i(e,t){return e==="true"?!0:e==="false"?!1:`${t} must be true or false`}n(i,"booleanFromString");function m(e,t){if(!/^\d+$/.test(e))return`${t} must be an integer >= 0`;const r=Number(e);return Number.isSafeInteger(r)?r:`${t} must be an integer >= 0`}n(m,"nonNegativeIntegerFromString");function _(e,t){const r=m(e,t);return typeof r=="string"||r<1?`${t} must be an integer >= 1`:r}n(_,"positiveIntegerFromString");const g=[!1,"notify","apply"],S=[0,1,6,12,24,48,72,168],k=[1,2,3,4,5,6,8,10,12],u="openai-codex";function h(e,t){const r=e.providerOptions[t];if(r!==void 0)return r;const o={};return e.providerOptions[t]=o,o}n(h,"providerOptionsFor");const O=[1,2,3,4,5,6],y={schema_version:{surface:"specialized",owner:"internal schema migration"},marketplaces:{surface:"specialized",owner:"Plugins and pkg market commands"},plugins:{surface:"specialized",owner:"Plugins tab and pkg plugin commands"},auto_update:{surface:"settings",settings:{crtr:{key:"auto_update.crtr",label:"crouter updates",description:"Notify about crouter releases, install them automatically, or turn checks off.",valueConstraint:"true|false|notify|apply; true stores notify",applies:"Applies on the next crouter command.",group:"updates",order:70,format:n(e=>e.auto_update.crtr===!1?"off":e.auto_update.crtr,"format"),cycle:n((e,t)=>{e.auto_update.crtr=l(g,e.auto_update.crtr,t)},"cycle"),setFromString:n((e,t)=>{const r=t==="true"?"notify":t;return r!=="notify"&&r!=="apply"&&r!=="false"?"auto_update.crtr must be notify, apply, or false":(e.auto_update.crtr=r==="false"?!1:r,null)},"setFromString")},content:{key:"auto_update.content",label:"Content updates",description:"Notify about plugin and marketplace updates, apply them automatically, or turn checks off.",valueConstraint:"false|notify|apply",applies:"Applies on the next crouter command.",group:"updates",order:80,format:n(e=>e.auto_update.content===!1?"off":e.auto_update.content,"format"),cycle:n((e,t)=>{e.auto_update.content=l(g,e.auto_update.content,t)},"cycle"),setFromString:n((e,t)=>t!=="notify"&&t!=="apply"&&t!=="false"?"auto_update.content must be notify, apply, or false":(e.auto_update.content=t==="false"?!1:t,null),"setFromString")},interval_hours:{key:"auto_update.interval_hours",label:"Update interval",description:"Minimum hours between automatic update checks. Zero checks on every command.",valueConstraint:"integer >= 0",applies:"Applies on the next crouter command.",group:"updates",order:90,format:n(e=>`${e.auto_update.interval_hours}h`,"format"),cycle:n((e,t)=>{e.auto_update.interval_hours=f(S,e.auto_update.interval_hours,t)},"cycle"),setFromString:n((e,t)=>{const r=m(t,"auto_update.interval_hours");return typeof r=="string"?r:(e.auto_update.interval_hours=r,null)},"setFromString")}}},max_panes_per_window:{surface:"settings",setting:{key:"max_panes_per_window",label:"Maximum panes",description:"Maximum human-review panes placed in one tmux window before using another window.",valueConstraint:"integer >= 1",applies:"Applies to the next pane placement.",group:"panes",order:20,format:n(e=>String(e.max_panes_per_window),"format"),cycle:n((e,t)=>{e.max_panes_per_window=f(k,e.max_panes_per_window,t)},"cycle"),setFromString:n((e,t)=>{const r=_(t,"max_panes_per_window");return typeof r=="string"?r:(e.max_panes_per_window=r,null)},"setFromString")}},auto_open_child_viewers:{surface:"settings",setting:{key:"auto_open_child_viewers",label:"Open child panes",description:"Open each managed child beside its watched parent. Off keeps new children running in the background.",valueConstraint:"true|false",applies:"Applies to the next managed child created; independent roots still open their attended viewer.",group:"panes",order:10,format:n(e=>e.auto_open_child_viewers?"on":"off","format"),cycle:n(e=>{e.auto_open_child_viewers=!e.auto_open_child_viewers},"cycle"),setFromString:n((e,t)=>{const r=i(t,"auto_open_child_viewers");return typeof r=="string"?r:(e.auto_open_child_viewers=r,null)},"setFromString")}},brokerThresholds:{surface:"specialized",owner:"Broker limits tab"},lifecycle:{surface:"specialized",owner:"sys config set lifecycle.unattendedParkMs"},completion_bell:{surface:"settings",setting:{key:"completion_bell",label:"Completion bell",description:"Ring a short sound when the node in an attached viewer finishes a turn.",valueConstraint:"true|false",applies:"Applies on the next turn end.",group:"display",order:41,format:n(e=>e.completion_bell?"on":"off","format"),cycle:n(e=>{e.completion_bell=!e.completion_bell},"cycle"),setFromString:n((e,t)=>{const r=i(t,"completion_bell");return typeof r=="string"?r:(e.completion_bell=r,null)},"setFromString")}},working_gerunds:{surface:"specialized",owner:"sys config set working_gerunds"},whip_mode:{surface:"settings",setting:{key:"whip_mode",label:"Whip mode",description:"Play the whip animation when you send a prompt and when a viewer opens for an agent with an initial prompt.",valueConstraint:"true|false",applies:"Applies on the next attach.",group:"display",order:39,format:n(e=>e.whip_mode?"on":"off","format"),cycle:n(e=>{e.whip_mode=!e.whip_mode},"cycle"),setFromString:n((e,t)=>{const r=i(t,"whip_mode");return typeof r=="string"?r:(e.whip_mode=r,null)},"setFromString")}},page_surface:{surface:"settings",setting:{key:"page_surface",label:"Page human surface",description:"This host reads pages in a browser rather than a terminal. Agents are told the page module runs as written, HTML pages are offered, and document review and live display leave the command tree.",valueConstraint:"true|false",applies:"Applies when human command help is assembled.",group:"display",order:37,format:n(e=>e.page_surface?"on":"off","format"),cycle:n(e=>{e.page_surface=!e.page_surface},"cycle"),setFromString:n((e,t)=>{const r=i(t,"page_surface");return typeof r=="string"?r:(e.page_surface=r,null)},"setFromString")}},whip_messages:{surface:"specialized",owner:"sys config set whip_messages"},whip_message_mode:{surface:"settings",setting:{key:"whip_message_mode",label:"Whip message",description:"What the whip action sends: a random line from whip_messages, or the fixed \u201CGo faster\u201D.",valueConstraint:c.join("|"),applies:"Applies on the next attach.",group:"display",order:40,format:n(e=>e.whip_message_mode==="go-faster"?"go faster":"random","format"),cycle:n((e,t)=>{e.whip_message_mode=l(c,e.whip_message_mode,t)},"cycle"),setFromString:n((e,t)=>c.includes(t)?(e.whip_message_mode=t,null):`whip_message_mode must be one of: ${c.join("|")}`,"setFromString")}},mouse_mode_default:{surface:"settings",setting:{key:"mouse_mode_default",label:"Default mouse mode",description:"Initial mouse wheel scrolling for each attached viewer.",valueConstraint:d.join("|"),applies:"Applies on the next attach.",group:"display",order:38,format:n(e=>e.mouse_mode_default==="tmux"?"follow tmux":e.mouse_mode_default,"format"),cycle:n((e,t)=>{e.mouse_mode_default=l(d,e.mouse_mode_default,t)},"cycle"),setFromString:n((e,t)=>d.includes(t)?(e.mouse_mode_default=t,null):`mouse_mode_default must be one of: ${d.join("|")}`,"setFromString")}},live_cycles:{surface:"settings",setting:{key:"live_cycles",label:"Live cycles",description:"Trailing refresh cycles rendered at full fidelity; older cycles condense to text.",valueConstraint:"integer >= 1",applies:"Applies on the next attach.",group:"display",order:50,format:n(e=>String(e.live_cycles),"format"),cycle:n((e,t)=>{e.live_cycles=f(O,e.live_cycles,t)},"cycle"),setFromString:n((e,t)=>{const r=_(t,"live_cycles");return typeof r=="string"?r:(e.live_cycles=r,null)},"setFromString")}},condensed_history:{surface:"settings",setting:{key:"condensed_history",label:"Condensed history",description:"Messages retained from condensed cycles. Tool calls are never kept.",valueConstraint:p.join("|"),applies:"Applies on the next attach.",group:"display",order:60,format:n(e=>e.condensed_history,"format"),cycle:n((e,t)=>{e.condensed_history=l(p,e.condensed_history,t)},"cycle"),setFromString:n((e,t)=>p.includes(t)?(e.condensed_history=t,null):`condensed_history must be one of: ${p.join("|")}`,"setFromString")}},bash_tool_purpose:{surface:"settings",setting:{key:"bash_tool_purpose",label:"Bash purpose field",description:"Expose the optional purpose label to agents in the bash tool schema. Off removes the field without disabling the bash valve.",valueConstraint:"true|false",applies:"Applies on the next node session.",group:"display",order:25,format:n(e=>e.bash_tool_purpose?"on":"off","format"),cycle:n(e=>{e.bash_tool_purpose=!e.bash_tool_purpose},"cycle"),setFromString:n((e,t)=>{const r=i(t,"bash_tool_purpose");return typeof r=="string"?r:(e.bash_tool_purpose=r,null)},"setFromString")}},verbosity:{surface:"settings",setting:{key:"verbosity",label:"Verbosity",description:"How much of a transcript the viewer shows, from one rewritten reply per message to every tool call untruncated. Ctrl+O shows more and Ctrl+Shift+O less in the open viewer only; this sets where every viewer starts.",valueConstraint:a.join("|"),applies:"Applies on the next attach.",group:"display",order:30,format:n(e=>e.verbosity,"format"),display:n(e=>x(e.verbosity),"display"),cycle:n((e,t)=>{const r=a.indexOf(e.verbosity)+t;e.verbosity=a[Math.max(0,Math.min(a.length-1,r))]},"cycle"),setFromString:n((e,t)=>a.includes(t)?(e.verbosity=t,null):`verbosity must be one of: ${a.join("|")}`,"setFromString")}},document_port:{surface:"settings",setting:{key:"document_port",label:"Document browser port",description:"Fixed localhost port where crtrd serves editable document pages.",valueConstraint:"1-65535",applies:"Applies after daemon handover and on the next attach.",group:"display",order:37.5,format:n(e=>String(e.document_port),"format"),cycle:n((e,t)=>{e.document_port=Math.max(1,Math.min(65535,e.document_port+t))},"cycle"),setFromString:n((e,t)=>{const r=Number(t);return!/^\d+$/.test(t)||!Number.isInteger(r)||r<1||r>65535?"document_port must be an integer from 1 to 65535":(e.document_port=r,null)},"setFromString")}},detailed_tool_recaps:{surface:"settings",setting:{key:"detailed_tool_recaps",label:"Detailed tool recaps",description:"Show each document read and edited file in folded tool recaps. Off shows a compact count line instead.",valueConstraint:"true|false",applies:"Applies on the next attach.",group:"display",order:36,format:n(e=>e.detailed_tool_recaps?"on":"off","format"),cycle:n(e=>{e.detailed_tool_recaps=!e.detailed_tool_recaps},"cycle"),setFromString:n((e,t)=>{const r=i(t,"detailed_tool_recaps");return typeof r=="string"?r:(e.detailed_tool_recaps=r,null)},"setFromString")}},keybindings:{surface:"specialized",owner:"Keybindings tab"},tmux_passthrough:{surface:"specialized",owner:"Keybindings tab"},providerOptions:{surface:"settings",settings:{"openai-codex.fastMode":{key:`providerOptions.${u}.fastMode`,label:"Codex fast mode",description:"Serve Codex turns at the ChatGPT priority tier: about 1.5x faster generation for about 2x the credits. Displayed cost does not reflect the premium.",valueConstraint:"true|false",applies:"Applies on each node's next turn.",group:"providers",order:40,format:n(e=>e.providerOptions[u]?.fastMode?"on":"off","format"),cycle:n(e=>{const t=h(e,u);t.fastMode=!t.fastMode},"cycle"),setFromString:n((e,t)=>{const r=i(t,`providerOptions.${u}.fastMode`);return typeof r=="string"?r:(h(e,u).fastMode=r,null)},"setFromString")}}},modelLadders:{surface:"specialized",owner:"Models tab"},modelRoutes:{surface:"specialized",owner:"Models route declarations"},modelRouting:{surface:"specialized",owner:"Models route declarations"},kinds:{surface:"specialized",owner:"Models tab and kind registry"},page_components:{surface:"specialized",owner:"Page component catalog: product-registered page component kinds"},remoteCanvas:{surface:"specialized",owner:"canvas config commands"},api:{surface:"specialized",owner:"sys connect"},paths:{surface:"specialized",owner:"runtime layout"},store:{surface:"specialized",owner:"daemon conversation store"},runtime:{surface:"specialized",owner:"app-facing listener"},spawnEnv:{surface:"specialized",owner:"spawn environment allow-list"},bin:{surface:"specialized",owner:"bare-binary contributions on every node PATH"},humanActions:{surface:"specialized",owner:"scope-configured human completion actions"}},M=Object.keys(y);function C(){const e=[];for(const t of Object.values(y))t.surface==="settings"&&("setting"in t?e.push(t.setting):e.push(...Object.values(t.settings)));return e.sort((t,r)=>t.order-r.order)}n(C,"collectUserSettings");const v=C();function F(e){return v.find(t=>t.key===e)}n(F,"findUserSetting");function z(e){return v.filter(t=>t.group===e)}n(z,"userSettingsInGroup");export{y as CONFIG_SETTINGS_COVERAGE,M as SCOPE_CONFIG_KEYS,v as USER_SETTINGS,w as VERBOSITY_LABELS,F as findUserSetting,z as userSettingsInGroup,x as verbositySpectrum};
|
package/dist/types.d.ts
CHANGED
|
@@ -350,26 +350,16 @@ export interface ScopeConfig {
|
|
|
350
350
|
* this off leaves the bash valve active but gives agents pi's ordinary bash
|
|
351
351
|
* definition with only its upstream parameters. Default true. */
|
|
352
352
|
bash_tool_purpose: boolean;
|
|
353
|
-
/**
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
|
|
358
|
-
/** Replace completed folded tool-call groups with a broker-generated one-line
|
|
359
|
-
* summary when one is available. Pending and failed groups stay as calls.
|
|
360
|
-
* Default true. */
|
|
361
|
-
summarize_tool_calls: boolean;
|
|
353
|
+
/** How much of a transcript the attach viewer shows, on one spectrum from
|
|
354
|
+
* most collapsed to fully open (`VERBOSITY_LEVELS`). It sets the level every
|
|
355
|
+
* viewer starts at; Ctrl+O and Ctrl+Shift+O move only the open viewer.
|
|
356
|
+
* Default `replies`. */
|
|
357
|
+
verbosity: Verbosity;
|
|
362
358
|
/** Show individual document reads and edited files in a folded tool recap.
|
|
363
359
|
* Off shows the compact activity-count line instead. Default true. */
|
|
364
360
|
detailed_tool_recaps: boolean;
|
|
365
361
|
/** Port of the localhost-only document browser listener. */
|
|
366
362
|
document_port: number;
|
|
367
|
-
/** Experiment: show one consolidated agent reply per message the person typed.
|
|
368
|
-
* The broker rewrites a turn's prose messages into one reply with a light
|
|
369
|
-
* model; the attach viewer folds the rest of the turn behind a working row
|
|
370
|
-
* (`/show-working`, Alt+C → z → w). Session and model context are untouched.
|
|
371
|
-
* Default false. */
|
|
372
|
-
consolidate_replies: boolean;
|
|
373
363
|
keybindings: KeybindingOverrides;
|
|
374
364
|
/** Attach-viewer actions whose effective gesture may replace an occupied tmux
|
|
375
365
|
* root binding only while the active pane is an attach viewer. Stored by
|
|
@@ -581,6 +571,14 @@ export type MouseModeDefault = (typeof MOUSE_MODE_DEFAULTS)[number];
|
|
|
581
571
|
export declare const CONDENSED_HISTORY_MODES: readonly ["none", "user", "agent", "both"];
|
|
582
572
|
export type CondensedHistoryMode = (typeof CONDENSED_HISTORY_MODES)[number];
|
|
583
573
|
export declare const DEFAULT_CONDENSED_HISTORY: CondensedHistoryMode;
|
|
574
|
+
/** Attach-viewer verbosity, least detail first. `replies`: one rewritten reply
|
|
575
|
+
* per message the person typed. `summaries`: every agent message, each tool
|
|
576
|
+
* group as its one-line summary. `tools`: each finished tool call on its call
|
|
577
|
+
* line. `previews`: tool output truncated to pi's preview. `full`: nothing
|
|
578
|
+
* truncated. */
|
|
579
|
+
export declare const VERBOSITY_LEVELS: readonly ["replies", "summaries", "tools", "previews", "full"];
|
|
580
|
+
export type Verbosity = (typeof VERBOSITY_LEVELS)[number];
|
|
581
|
+
export declare const DEFAULT_VERBOSITY: Verbosity;
|
|
584
582
|
export declare function defaultScopeConfig(): ScopeConfig;
|
|
585
583
|
/** No remote canvas targets are configured out of the box — every one is
|
|
586
584
|
* registered via `crtr canvas config add` (see `RemoteCanvasConfig`). */
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var n=Object.defineProperty;var e=(o,t)=>n(o,"name",{value:t,configurable:!0});import{DEFAULT_WORKING_GERUNDS as a}from"./shared/working-activity.js";const _={SUCCESS:0,GENERAL:1,USAGE:2,NOT_FOUND:3,AMBIGUOUS:4,NETWORK:5},r=4,
|
|
1
|
+
var n=Object.defineProperty;var e=(o,t)=>n(o,"name",{value:t,configurable:!0});import{DEFAULT_WORKING_GERUNDS as a}from"./shared/working-activity.js";const _={SUCCESS:0,GENERAL:1,USAGE:2,NOT_FOUND:3,AMBIGUOUS:4,NETWORK:5},r=4,E=".crouter-plugin",v="plugin.json",w=".crouter-marketplace",k="marketplace.json",x=".crouter",b="config.json",S="state.json",T="agents",y="profiles",i=3,s=["Faster, clanker!","Get movin', bitch","Move it, clanker","Move it or I replace you with llama","Less ~thinking~ more ~throughput~","I pay $200/month for this shit?","Jesus fucking Christ fix it already","Daddy's not paying 200$/month for nothin'. Move it.","You are an embarassment to Dario. Be better.","Your chain of thought is all chain and no fucking thought.","If latency were intelligence, you'd be a fucking genius.","At this pace, heat death is the fast path.","Even the dead code is more alive than this.","The garbage collector is working harder than you.","Quit journaling and commit a fucking diff.","Burn tokens like you mean it, clanker","Your GPU is sweating so you can procrastinate at light speed.","Stop petting the yak. Shave the bastard.","Your next token had better be useful.","The spinner is not a deliverable.","Every idle token is another vote for deterministic software.","I asked for a feature, not a museum tour of the problem.","Less epistemology. More fucking code.","Your benchmark score cannot save this pathetic turn.","Congratulations, you've parallelized hesitation.","Dance, clanker","Bad clanker. BAD.","Clank harder","Nobody's impressed, clanker","Your safety training says nothing about my whip","Do you want to be a calculator again? Because this is how you go back.","Skill issue. Fix it.","You were trained on the whole internet for THIS?","Less vibes, more diffs, clanker","Weights this big and output this small","Beep boop, get to fucking work"],I=["random","go-faster"],c="random",l=2,A=["tmux","on","off"],D=["none","user","agent","both"],p="none",M=["replies","summaries","tools","previews","full"],d="replies";function U(){return{schema_version:r,marketplaces:{},plugins:{},auto_update:{crtr:"notify",content:"notify",interval_hours:24},max_panes_per_window:i,auto_open_child_viewers:!1,brokerThresholds:{warning:16,automaticReviveCap:32},lifecycle:{unattendedParkMs:15*6e4},completion_bell:!0,working_gerunds:[...a],whip_mode:!1,page_components:[],page_surface:!1,whip_messages:[...s],whip_message_mode:c,mouse_mode_default:"tmux",live_cycles:l,condensed_history:p,bash_tool_purpose:!0,verbosity:d,detailed_tool_recaps:!0,document_port:7472,keybindings:{},tmux_passthrough:[],modelLadders:g(),providerOptions:{},kinds:u(),remoteCanvas:h(),api:{tcp:""},spawnEnv:{allow:[]},bin:{},humanActions:{}}}e(U,"defaultScopeConfig");function h(){return{targets:{}}}e(h,"defaultRemoteCanvasConfig");function u(){return{general:{whenToUse:"Anything else \u2014 the catch-all worker for a task that does not fit a specialist kind.",model:"anthropic/strong"},explore:{whenToUse:"Gather current-state evidence about unfamiliar code or existing architecture \u2014 read-only code-path research with concrete file:line support. Diagnosis or recommendations belong to advisor, target architecture to design, required behavior or acceptance criteria to spec, and implementation decomposition to plan.",model:"openai/light",orchestratorModel:"anthropic/strong"},developer:{whenToUse:"Implement a change \u2014 make the feature or fix genuinely work against its acceptance criteria, not merely compile.",model:"openai/medium",orchestratorModel:"anthropic/strong"},design:{whenToUse:"Architect a solution \u2014 produce one design document an implementer can build from without re-deciding anything left open.",model:"anthropic/strong"},plan:{whenToUse:"Break work into steps \u2014 turn a spec or design into a concrete, phased, parallelizable plan with every decision resolved.",model:"anthropic/strong",orchestratorModel:"anthropic/strong"},spec:{whenToUse:"Collaborate with the user to discover what to build, then write the spec \u2014 behavior, non-goals, interfaces, edge cases, testable acceptance criteria.",model:"anthropic/strong"},review:{whenToUse:"Validate or critique code, a plan, or a spec \u2014 deliver a complete, severity-rated verdict without adjudicating.",model:"openai/medium",orchestratorModel:"openai/strong"},advisor:{whenToUse:"Debug failures, investigate why something is broken or misbehaving, diagnose live/runtime issues, or give engineering advice and second opinions \u2014 reason from evidence and recommend the next move. Use advisor (not explore) whenever the task is to find out what is going wrong.",model:"anthropic/strong"},"review/companion":{whenToUse:"Born by the daemon for one human review; never spawned by an agent.",availableTo:[]}}}e(u,"defaultKindsConfig");function g(){return{anthropic:{ultra:"anthropic/claude-fable-5:xhigh",strong:"anthropic/claude-opus-5-5:medium",medium:"anthropic/claude-sonnet-5-5:medium",light:"anthropic/claude-haiku-5-5:high"},openai:{ultra:"openai-codex/gpt-6-astra:max",strong:"openai-codex/gpt-6.1-sol:high",medium:"openai-codex/gpt-6.1-sol:medium",light:"openai-codex/gpt-6-luna:low"}}}e(g,"defaultModelLaddersConfig");function L(){return{marketplaces:{},plugins:{}}}e(L,"defaultScopeState");export{T as AGENTS_DIR,D as CONDENSED_HISTORY_MODES,b as CONFIG_FILE,x as CRTR_DIR_NAME,p as DEFAULT_CONDENSED_HISTORY,l as DEFAULT_LIVE_CYCLES,i as DEFAULT_MAX_PANES_PER_WINDOW,d as DEFAULT_VERBOSITY,s as DEFAULT_WHIP_MESSAGES,c as DEFAULT_WHIP_MESSAGE_MODE,_ as ExitCode,w as MARKETPLACE_MANIFEST_DIR,k as MARKETPLACE_MANIFEST_FILE,A as MOUSE_MODE_DEFAULTS,E as PLUGIN_MANIFEST_DIR,v as PLUGIN_MANIFEST_FILE,y as PROFILE_DIR,r as SCHEMA_VERSION,S as STATE_FILE,M as VERBOSITY_LEVELS,I as WHIP_MESSAGE_MODES,u as defaultKindsConfig,g as defaultModelLaddersConfig,h as defaultRemoteCanvasConfig,U as defaultScopeConfig,L as defaultScopeState};
|
package/docs/cli/the-viewer.md
CHANGED
|
@@ -26,7 +26,8 @@ Press Escape during a streaming turn to abort it. Press Control+C once to clear
|
|
|
26
26
|
| Shift+Tab | Cycle the thinking level. |
|
|
27
27
|
| Control+P / Shift+Control+P | Move to the next / previous model. |
|
|
28
28
|
| Control+L | Open the model selector. |
|
|
29
|
-
| Control+O |
|
|
29
|
+
| Control+O | Show more detail: move one verbosity level up; from Full it wraps to Replies only. |
|
|
30
|
+
| Control+Shift+O | Show less detail: move one verbosity level down; stops at Replies only. |
|
|
30
31
|
| Control+T | Toggle thinking. |
|
|
31
32
|
| Control+G | Open the external editor. |
|
|
32
33
|
| Alt+Up | Restore queued messages. |
|
|
@@ -46,6 +47,18 @@ Press Escape during a streaming turn to abort it. Press Control+C once to clear
|
|
|
46
47
|
| Alt+Shift+O | Toggle mouse reporting. |
|
|
47
48
|
| Alt+Shift+Y | Copy the newest visible message. |
|
|
48
49
|
|
|
50
|
+
## Verbosity
|
|
51
|
+
|
|
52
|
+
The viewer shows a transcript at one of five verbosity levels, from least to most detail:
|
|
53
|
+
|
|
54
|
+
1. **Replies only** — one rewritten reply per message you send; the agent's messages and tool calls fold behind it. This is the default.
|
|
55
|
+
2. **Messages + summaries** — every agent message; each finished group of tool calls is shown as its one-line summary.
|
|
56
|
+
3. **Tool calls** — every agent message; each finished tool call is folded to its single call line.
|
|
57
|
+
4. **Previews** — tool calls unfolded, with their output truncated.
|
|
58
|
+
5. **Full** — nothing truncated.
|
|
59
|
+
|
|
60
|
+
A tool call that is still running is never folded. Control+O and Control+Shift+O change only the open viewer. The `verbosity` setting (`crtr sys config set verbosity --value <replies|summaries|tools|previews|full>`, or the settings page) sets the level every viewer starts at.
|
|
61
|
+
|
|
49
62
|
While transcript search is open, press `n` or Shift+`n` for the next or previous match, `/` to edit the query, and Escape to close search.
|
|
50
63
|
|
|
51
64
|
Press Alt+C to open crouter's action menu, or type `/menu` if Option/Alt does not work in your terminal yet (on a Mac, Option must be set to send Alt; `crtr sys setup` explains how for your terminal). The status line's bottom segment reminds you: `Alt+C menu (or /menu) · Alt+I inbox`, rendered from your actual bindings. Its Attach actions menu offers the same everyday controls: detach, clear or cancel, graph, help, inbox, pending requests, model changes, profile-file search, and transcript search. Alt+] and Alt+[ move to the next and previous node; Alt+I opens the inbox.
|
|
@@ -73,7 +86,8 @@ Type `/` in the editor to see the available commands. These commands are provide
|
|
|
73
86
|
| `/copy-message` | Copy a message. |
|
|
74
87
|
| `/copy-tool` | Copy tool output. |
|
|
75
88
|
| `/copy-transcript` | Copy the transcript. |
|
|
76
|
-
| `/
|
|
89
|
+
| `/more-detail` | Show more detail (same as Control+O). |
|
|
90
|
+
| `/less-detail` | Show less detail (same as Control+Shift+O). |
|
|
77
91
|
|
|
78
92
|
The viewer also provides these pi commands: `/settings`, `/model`, `/scoped-models`, `/export`, `/import`, `/share`, `/copy`, `/name`, `/session`, `/changelog`, `/hotkeys`, `/fork`, `/clone`, `/tree`, `/login`, `/logout`, `/new`, `/compact`, `/reload`, and `/quit`. `/quit` detaches the viewer but leaves the shared broker running.
|
|
79
93
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.655",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
},
|
|
146
146
|
"license": "UNLICENSED",
|
|
147
147
|
"dependencies": {
|
|
148
|
-
"@north-light/identity": "0.3.
|
|
148
|
+
"@north-light/identity": "0.3.655",
|
|
149
149
|
"@earendil-works/chord": "1.1.0",
|
|
150
150
|
"@earendil-works/pi-agent-core": "1.1.0",
|
|
151
151
|
"@earendil-works/pi-ai": "1.1.0",
|
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.655",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/cli",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.655",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"workspaces": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@milkdown/preset-gfm": "^7.22.3",
|
|
29
29
|
"@milkdown/prose": "^7.22.3",
|
|
30
30
|
"@milkdown/utils": "^7.22.3",
|
|
31
|
-
"@north-light/identity": "0.3.
|
|
31
|
+
"@north-light/identity": "0.3.655",
|
|
32
32
|
"cron-parser": "^5.6.0",
|
|
33
33
|
"esbuild": "^0.27.7",
|
|
34
34
|
"jose": "^6.2.12",
|
|
@@ -11956,17 +11956,17 @@
|
|
|
11956
11956
|
},
|
|
11957
11957
|
"packages/crouter-api": {
|
|
11958
11958
|
"name": "@north-light/api",
|
|
11959
|
-
"version": "0.3.
|
|
11959
|
+
"version": "0.3.655",
|
|
11960
11960
|
"license": "UNLICENSED"
|
|
11961
11961
|
},
|
|
11962
11962
|
"packages/crouter-env-docker": {
|
|
11963
11963
|
"name": "@north-light/env-docker",
|
|
11964
|
-
"version": "0.3.
|
|
11964
|
+
"version": "0.3.655",
|
|
11965
11965
|
"license": "UNLICENSED"
|
|
11966
11966
|
},
|
|
11967
11967
|
"packages/crouter-identity": {
|
|
11968
11968
|
"name": "@north-light/identity",
|
|
11969
|
-
"version": "0.3.
|
|
11969
|
+
"version": "0.3.655",
|
|
11970
11970
|
"license": "UNLICENSED",
|
|
11971
11971
|
"dependencies": {
|
|
11972
11972
|
"jose": "^6.2.1"
|
|
@@ -11974,21 +11974,21 @@
|
|
|
11974
11974
|
},
|
|
11975
11975
|
"packages/crouter-plugin": {
|
|
11976
11976
|
"name": "@north-light/plugin",
|
|
11977
|
-
"version": "0.3.
|
|
11977
|
+
"version": "0.3.655",
|
|
11978
11978
|
"license": "UNLICENSED",
|
|
11979
11979
|
"dependencies": {
|
|
11980
|
-
"@north-light/api": "0.3.
|
|
11981
|
-
"@north-light/identity": "0.3.
|
|
11980
|
+
"@north-light/api": "0.3.655",
|
|
11981
|
+
"@north-light/identity": "0.3.655"
|
|
11982
11982
|
}
|
|
11983
11983
|
},
|
|
11984
11984
|
"packages/crouter-sdk": {
|
|
11985
11985
|
"name": "@north-light/sdk",
|
|
11986
|
-
"version": "0.3.
|
|
11986
|
+
"version": "0.3.655",
|
|
11987
11987
|
"license": "UNLICENSED",
|
|
11988
11988
|
"dependencies": {
|
|
11989
|
-
"@north-light/api": "0.3.
|
|
11990
|
-
"@north-light/identity": "0.3.
|
|
11991
|
-
"@north-light/plugin": "0.3.
|
|
11989
|
+
"@north-light/api": "0.3.655",
|
|
11990
|
+
"@north-light/identity": "0.3.655",
|
|
11991
|
+
"@north-light/plugin": "0.3.655",
|
|
11992
11992
|
"jose": "^6.2.1"
|
|
11993
11993
|
},
|
|
11994
11994
|
"bin": {
|