@north-light/cli 0.3.703 → 0.3.705
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/render/chat-view.d.ts +7 -60
- package/dist/clients/attach/render/chat-view.js +2 -4
- package/dist/clients/attach/session/bindings.d.ts +1 -1
- package/dist/clients/attach/viewer.d.ts +1 -1
- package/dist/clients/attach/viewer.js +537 -539
- package/dist/commands/sys/setup-core.js +1 -1
- package/dist/core/canvas/schema-pg/024-conversation-cycle-offset.sql +4 -0
- package/dist/core/canvas/schema-version.d.ts +1 -1
- package/dist/core/canvas/schema-version.js +1 -1
- package/dist/core/config.d.ts +4 -1
- package/dist/core/config.js +1 -1
- package/dist/core/conversation-store/client.js +2 -2
- package/dist/core/conversation-store/index.d.ts +3 -3
- package/dist/core/conversation-store/patch.js +1 -1
- package/dist/core/conversation-store/row-store.js +13 -13
- package/dist/core/import/load/prepare.js +4 -4
- package/dist/core/keybindings/catalog.js +1 -1
- package/dist/core/keybindings/persistence.js +1 -1
- package/dist/core/runs/operations.js +6 -6
- package/dist/core/runtime/broker/tool-groups.js +1 -1
- package/dist/core/runtime/broker.js +1 -1
- package/dist/core/runtime/node-read.js +3 -3
- package/dist/core/runtime/session-cycles.d.ts +5 -22
- package/dist/core/runtime/session-cycles.js +1 -1
- package/dist/core/user-settings.d.ts +0 -30
- package/dist/core/user-settings.js +1 -1
- package/dist/daemon/api/handlers/conversations.js +3 -3
- package/dist/types.d.ts +0 -23
- package/dist/types.js +1 -1
- package/package.json +3 -3
- package/packages/crouter-api/dist/clients/attach/config.js +6 -2
- package/packages/crouter-api/dist/clients/attach/render/chat-view.js +22 -261
- package/packages/crouter-api/dist/clients/attach/session/bindings.js +1 -1
- package/packages/crouter-api/dist/clients/attach/viewer.js +8 -7
- package/packages/crouter-api/dist/commands/sys/setup-core.js +1 -1
- package/packages/crouter-api/dist/core/canvas/schema-version.js +1 -1
- package/packages/crouter-api/dist/core/config.js +10 -7
- package/packages/crouter-api/dist/core/conversation-store/client.js +1 -1
- package/packages/crouter-api/dist/core/conversation-store/patch.js +8 -3
- package/packages/crouter-api/dist/core/conversation-store/row-store.js +46 -19
- package/packages/crouter-api/dist/core/import/load/prepare.js +1 -1
- package/packages/crouter-api/dist/core/keybindings/catalog.js +6 -6
- package/packages/crouter-api/dist/core/keybindings/persistence.js +2 -4
- package/packages/crouter-api/dist/core/runs/operations.js +2 -2
- package/packages/crouter-api/dist/core/runtime/session-cycles.js +27 -75
- package/packages/crouter-api/dist/core/user-settings.js +1 -43
- package/packages/crouter-api/dist/types.js +0 -7
- package/packages/crouter-api/package.json +1 -1
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/package.json +3 -3
- package/runtime.lock.json +14 -14
- package/dist/clients/attach/render/condensed-history.d.ts +0 -21
- package/dist/clients/attach/render/condensed-history.js +0 -1
- package/packages/crouter-api/dist/clients/attach/render/condensed-history.js +0 -60
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
`).join("")})(),systemPrompt:await P(e)}}
|
|
3
|
-
`)}
|
|
1
|
+
var v=Object.defineProperty;var a=(e,t)=>v(e,"name",{value:t,configurable:!0});import{openDb as x}from"../canvas/db.js";import{latestExecutionForNode as _}from"../canvas/executions.js";import{InputError as c}from"../io.js";import{conversationIdFromPath as g,conversationStore as h,ConversationNotFoundError as M}from"../conversation-store/index.js";import{fullName as C,getNode as p}from"../canvas/index.js";import{hydratePersistedAdvertisedCommandMessages as N}from"./advertised-command-invocation.js";import{SessionManager as R}from"./broker-sdk.js";import{openModelRegistry as $}from"./model-registry.js";import{BUILTIN_SLASH_COMMANDS as A}from"./pi-vendored.js";import{transcriptMessages as j}from"./session-cycles.js";import{projectTranscript as F}from"./session-visibility.js";import{normalizeToolGroupSummaryRecord as L}from"../../shared/tool-groups.js";import{normalizeTurnReplyRecord as T}from"../../shared/turn-replies.js";async function k(e){if(e!==null)try{return(await $()).find(e.provider,e.modelId)}catch{return}}a(k,"resolveRecordedModel");async function w(e,t){return await a(async s=>{const r=s?g(s):null;if(r===null)return null;try{return(await h().header(r)).path}catch(i){if(i instanceof M)return null;throw i}},"resolvePath")(t)}a(w,"resolveSessionFile");async function E(e){const t=await p(e);if(t===null)throw new c({error:"not_found",message:`no node: ${e}`,field:"id",next:"List nodes with `crtr node inspect list`."});return await w(e,t.pi_session_file)}a(E,"readableSessionFile");function O(e,t){return{sessionFile:t,sessionId:e,userMessages:0,assistantMessages:0,toolCalls:0,toolResults:0,totalMessages:0,tokens:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},cost:0}}a(O,"emptyStats");function J(e,t,n){const s=O(t,n);s.totalMessages=e.length;for(const r of e)if(r.role==="user")s.userMessages++;else if(r.role==="assistant"){s.assistantMessages++;const i=Array.isArray(r.content)?r.content:[];s.toolCalls+=i.filter(l=>l!==null&&typeof l=="object"&&l.type==="toolCall").length;const o=r.usage;o!==void 0&&(s.tokens.input+=o.input??0,s.tokens.output+=o.output??0,s.tokens.cacheRead+=o.cacheRead??0,s.tokens.cacheWrite+=o.cacheWrite??0,s.cost+=o.cost?.total??0)}else r.role==="toolResult"&&s.toolResults++;return s.tokens.total=s.tokens.input+s.tokens.output+s.tokens.cacheRead+s.tokens.cacheWrite,s}a(J,"statsFromMessages");async function ae(e){const t=await p(e);if(t===null)throw new c({error:"not_found",message:`no node: ${e}`,field:"id",next:"List nodes with `crtr node inspect list`."});const n=await w(e,t.pi_session_file);if(n===null)throw new c({error:"no_session",message:`node has no readable session file: ${e}`,field:"id",next:"Choose a node with captured conversation history."});return{nodeId:e,sessionFile:n,sessionJsonl:await(async()=>{const{header:s,entries:r}=await h().read(g(n));return[s,...r].map(i=>`${JSON.stringify(i)}
|
|
2
|
+
`).join("")})(),systemPrompt:await P(e)}}a(ae,"readNodeSession");async function P(e){const t=(await _(e))?.launchJson??null;if(t===null)return null;const n=JSON.parse(t).argv;if(!Array.isArray(n))return null;const s=n.indexOf("--append-system-prompt");return s===-1||typeof n[s+1]!="string"?null:n[s+1]}a(P,"launchSystemPrompt");async function y(e,t){const n=await(await x()).prepare(`SELECT ${t} AS raw FROM nodes WHERE node_id = ?`).get(e);try{return n?.raw==null?null:JSON.parse(n.raw)}catch{return null}}a(y,"readSummaryColumn");async function W(e){return L(await y(e,"tool_summaries_json"))}a(W,"readToolGroupSummaries");async function B(e){return T(await y(e,"turn_replies_json"))}a(B,"readTurnReplies");async function S(e){const t=await p(e);if(t===null)throw new c({error:"not_found",message:`no node: ${e}`,field:"id",next:"List nodes with `crtr node inspect list`."});const n=await w(e,t.pi_session_file);if(n===null)throw new c({error:"no_session",message:`node has no readable session file: ${e}`,field:"id",next:"Choose a node with captured conversation history."});const{header:s,entries:r}=await h().read(g(n)),i=R.inMemory(s.cwd,void 0,[s,...r]),o=i.buildSessionContext(),l=j(i.getEntries(),i.getLeafId());N(l.map(({message:f})=>f));const u=F(l,{boundaryReviewId:t.review_binding?.review_id,sessionEntries:i.getEntries()}),m=u.map(({message:f})=>f);return{sessionFile:n,messages:m,identified:u,model:o.model,thinkingLevel:o.thinkingLevel,sessionId:i.getSessionId(),sessionName:i.getSessionName()}}a(S,"reconstructTranscript");function d(){throw new c({error:"invalid_cursor",message:"cursor must be a base64url-encoded messages cursor.",field:"cursor",next:"Omit cursor to start from the newest messages."})}a(d,"invalidCursor");function U(e,t){/^[A-Za-z0-9_-]+$/u.test(e)||d();let n;try{const r=Buffer.from(e,"base64url").toString("utf8");Buffer.from(r,"utf8").toString("base64url")!==e&&d(),n=JSON.parse(r)}catch{d()}(typeof n!="object"||n===null||n.v!==1||!Number.isSafeInteger(n.before))&&d();const s=n.before;return(s<0||s>t)&&d(),s}a(U,"decodeMessagesCursor");function V(e){return Buffer.from(JSON.stringify({v:1,before:e}),"utf8").toString("base64url")}a(V,"encodeMessagesCursor");async function z(e){const t=await S(e),n={messages:t.messages,...t.identified===void 0?{}:{messageIds:t.identified.map(({id:s})=>s)},messageVisibility:t.identified?.map(({visibility:s})=>s)??t.messages.map(()=>"visible"),turnVisibility:"visible",stats:J(t.messages,t.sessionId,t.sessionFile),state:{model:await k(t.model),thinkingLevel:t.thinkingLevel,isStreaming:!1,isCompacting:!1,steeringMode:"one-at-a-time",followUpMode:"one-at-a-time",sessionFile:t.sessionFile,sessionId:t.sessionId,sessionName:t.sessionName,autoCompactionEnabled:!0,messageCount:t.messages.length,pendingMessageCount:0},display:{statuses:{},widgets:{},title:void 0},queued:{steering:[],followUp:[]},toolGroupSummaries:await W(e),turnReplies:await B(e)};return{nodeId:e,snapshot:n,commands:A.map(s=>({...s,source:"builtin"}))}}a(z,"readNodeSnapshot");async function le(e,{cursor:t,limit:n=200}){if(!Number.isSafeInteger(n)||n<1||n>500)throw new c({error:"invalid_limit",message:"limit must be an integer from 1 through 500.",field:"limit",next:"Use a limit from 1 through 500."});if(await E(e)===null)return{messages:[],messageIds:[],messageVisibility:[],nextCursor:null};const{messages:s,identified:r}=await S(e),i=t===void 0?s.length:U(t,s.length);let o=Math.max(0,i-n);for(;o>0&&typeof s[o]=="object"&&s[o]!==null&&s[o].role==="toolResult";)o--;const l=r?.slice(o,i);return{messages:l?.map(({message:u})=>u)??s.slice(o,i),...l===void 0?{}:{messageIds:l.map(({id:u})=>u)},messageVisibility:l?.map(({visibility:u})=>u)??s.slice(o,i).map(()=>"visible"),nextCursor:o===0?null:V(o)}}a(le,"readNodeMessagesPage");function G(e){return typeof e=="string"?e:Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null).filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text).join(""):""}a(G,"textFromContent");function D(e){switch(e.role){case"user":return"You";case"assistant":return"Agent";case"toolResult":return"Tool result";default:return typeof e.role=="string"?e.role:"Message"}}a(D,"roleLabel");function H(e){return Array.isArray(e.content)?e.content.filter(t=>typeof t=="object"&&t!==null&&t.type==="toolCall").map(t=>`Tool: ${typeof t.name=="string"?t.name:"call"}`):[]}a(H,"toolSummaries");async function ue(e){const t=await p(e);if(t===null)throw new c({error:"not_found",message:`no node: ${e}`,field:"node-id",next:"List nodes with `crtr node inspect list`."});const{snapshot:n}=await z(e),r=[`# ${C(t)}`,"",`Saved transcript \xB7 ${t.status} \xB7 ${t.lifecycle}`,""];for(const i of n.messages){if(typeof i!="object"||i===null)continue;const o=i;if(o.role==="custom"&&o.display===!1)continue;const l=G(o.content),u=typeof o.text=="string"?o.text:"",m=l.trim()?l:u.trim()?u:"",f=H(o);if(!(!m&&f.length===0)){r.push(`## ${D(o)}`,""),m&&r.push(m,"");for(const b of f)r.push(`- ${b}`);f.length&&r.push("")}}return r.length===5&&r.push("_No saved messages._",""),r.join(`
|
|
3
|
+
`)}a(ue,"transcriptMarkdown");export{le as readNodeMessagesPage,ae as readNodeSession,z as readNodeSnapshot,ue as transcriptMarkdown};
|
|
@@ -4,27 +4,12 @@ import type { BrokerSnapshot } from './broker-protocol.js';
|
|
|
4
4
|
* Data payload: `{ cycle, fromLeaf }` — `cycle` is the node's cycle counter at
|
|
5
5
|
* relaunch, `fromLeaf` the previous cycle's leaf entry id. */
|
|
6
6
|
export declare const CRTR_CYCLE_CUSTOM_TYPE = "crtr-cycle";
|
|
7
|
-
/** customType of the SYNTHETIC divider message spliced between cycles in
|
|
8
|
-
* snapshot rendering. Never persisted to the session file. */
|
|
9
|
-
export declare const CRTR_CYCLE_DIVIDER_CUSTOM_TYPE = "crtr-cycle-divider";
|
|
10
7
|
type SnapshotMessage = BrokerSnapshot['messages'][number];
|
|
11
8
|
/** One reconstructed message and the durable session entry that produced it. */
|
|
12
9
|
export type IdentifiedMessage = {
|
|
13
10
|
id: string;
|
|
14
11
|
message: SnapshotMessage;
|
|
15
12
|
};
|
|
16
|
-
/** The structural slice of pi's SessionManager cycle rendering needs. The
|
|
17
|
-
* broker's fake-engine test fixture implements only `buildSessionContext`, so
|
|
18
|
-
* the tree accessors are optional — absent ⇒ single-cycle behavior. */
|
|
19
|
-
export interface CycleSessionManagerLike {
|
|
20
|
-
buildSessionContext(): {
|
|
21
|
-
messages: SnapshotMessage[];
|
|
22
|
-
};
|
|
23
|
-
getEntries?(): SessionEntry[];
|
|
24
|
-
/** Walk from `fromId` (default: the current leaf) to its root; returns the
|
|
25
|
-
* path root-first. */
|
|
26
|
-
getBranch?(fromId?: string): SessionEntry[];
|
|
27
|
-
}
|
|
28
13
|
/** True when an assistant turn ended because its own abort fired — an ESC, a
|
|
29
14
|
* critical-tier interrupt, or the self-abort a refresh-yield performs. */
|
|
30
15
|
export declare function endedByAbort(message: {
|
|
@@ -35,11 +20,9 @@ export declare function endedByAbort(message: {
|
|
|
35
20
|
* rooted. Preserve that assistant message (including tool calls and prose), but
|
|
36
21
|
* omit the failure annotation: the cycle divider is the truthful visible seam. */
|
|
37
22
|
export declare function withoutYieldAbort(message: SnapshotMessage): SnapshotMessage;
|
|
38
|
-
/** The
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
* then apply unchanged). */
|
|
44
|
-
export declare function cycleAwareMessages(sm: CycleSessionManagerLike): IdentifiedMessage[] | undefined;
|
|
23
|
+
/** The context messages on the branch ending at `leafId`, each with its entry id. */
|
|
24
|
+
export declare function identifiedMessages(entries: SessionEntry[], leafId: string | null | undefined): IdentifiedMessage[];
|
|
25
|
+
/** A whole conversation for display: each earlier cycle as user and assistant
|
|
26
|
+
* text only, one line where each cycle starts, then the current cycle in full. */
|
|
27
|
+
export declare function transcriptMessages(entries: SessionEntry[], leafId: string | null): IdentifiedMessage[];
|
|
45
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d=Object.defineProperty;var i=(t,o)=>d(t,"name",{value:o,configurable:!0});import{buildContextEntries as m,sessionEntryToContextMessages as l}from"@earendil-works/pi-coding-agent";const p="crtr-cycle",b=/\b(?:request|operation) was aborted\b|\bthe user aborted\b/i;function y(t){return t.stopReason==="aborted"?!0:t.stopReason==="error"&&b.test(t.errorMessage??"")}i(y,"endedByAbort");function R(t){if(t.role!=="assistant"||!y(t))return t;const{stopReason:o,errorMessage:r,...e}=t;return e}i(R,"withoutYieldAbort");function u(t,o){const r=new Map(t.map(e=>[e.id,e]));return m(t,o,r).flatMap(e=>l(e).map(n=>({id:e.id,message:n})))}i(u,"identifiedMessages");function x(t,o){const r=[];for(const e of t){if(e.type!=="custom"||e.customType!==p)continue;const n=e.data;for(const a of n?.fromLeaf?u(t,n.fromLeaf):[]){const s=a.message;if(s.role!=="user"&&s.role!=="assistant")continue;const c=typeof s.content=="string"?s.content:s.content.filter(f=>f.type==="text");c.length>0&&r.push({...a,message:{...R(s),content:c}})}r.push({id:e.id,message:{role:"custom",customType:p,content:`cycle ${n?.cycle??""} begins with a fresh context window`,display:!0,timestamp:new Date(e.timestamp).getTime()}})}return[...r,...u(t,o)]}i(x,"transcriptMessages");export{p as CRTR_CYCLE_CUSTOM_TYPE,y as endedByAbort,u as identifiedMessages,x as transcriptMessages,R as withoutYieldAbort};
|
|
@@ -207,36 +207,6 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
|
|
|
207
207
|
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
|
-
live_cycles: {
|
|
211
|
-
surface: "settings";
|
|
212
|
-
setting: {
|
|
213
|
-
key: "live_cycles";
|
|
214
|
-
label: string;
|
|
215
|
-
description: string;
|
|
216
|
-
valueConstraint: string;
|
|
217
|
-
applies: string;
|
|
218
|
-
group: "display";
|
|
219
|
-
order: number;
|
|
220
|
-
format: (config: ScopeConfig) => string;
|
|
221
|
-
cycle: (config: ScopeConfig, delta: number) => void;
|
|
222
|
-
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
condensed_history: {
|
|
226
|
-
surface: "settings";
|
|
227
|
-
setting: {
|
|
228
|
-
key: "condensed_history";
|
|
229
|
-
label: string;
|
|
230
|
-
description: string;
|
|
231
|
-
valueConstraint: string;
|
|
232
|
-
applies: string;
|
|
233
|
-
group: "display";
|
|
234
|
-
order: number;
|
|
235
|
-
format: (config: ScopeConfig) => "user" | "none" | "agent" | "both";
|
|
236
|
-
cycle: (config: ScopeConfig, delta: number) => void;
|
|
237
|
-
setFromString: (config: ScopeConfig, raw: string) => string | null;
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
210
|
bash_tool_purpose: {
|
|
241
211
|
surface: "settings";
|
|
242
212
|
setting: {
|
|
@@ -1 +1 @@
|
|
|
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};
|
|
1
|
+
var y=Object.defineProperty;var r=(e,t)=>y(e,"name",{value:t,configurable:!0});import{MOUSE_MODE_DEFAULTS as u,VERBOSITY_LEVELS as a,WHIP_MESSAGE_MODES as p}from"../types.js";const w={replies:"Replies only",summaries:"Messages + summaries",tools:"Tool calls",previews:"Previews",full:"Full"};function v(e){const t=a.indexOf(e);return`less ${a.map((n,s)=>s===t?"\u25CF":"\u25CB").map((n,s)=>s===0?n:`${s<=t?"\u2501\u2501\u2501\u2501":"\u2500\u2500\u2500\u2500"}${n}`).join("")} more ${w[e]}`}r(v,"verbositySpectrum");function d(e,t,o){const n=e.indexOf(t),s=n>=0?n:0;return e[(s+o+e.length)%e.length]}r(d,"cycleChoice");function c(e,t,o){const n=e.indexOf(t);return n>=0?e[(n+o+e.length)%e.length]:o>=0?e.find(s=>s>t)??e[0]:[...e].reverse().find(s=>s<t)??e[e.length-1]}r(c,"cycleNumber");function i(e,t){return e==="true"?!0:e==="false"?!1:`${t} must be true or false`}r(i,"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`}r(f,"nonNegativeIntegerFromString");function b(e,t){const o=f(e,t);return typeof o=="string"||o<1?`${t} must be an integer >= 1`:o}r(b,"positiveIntegerFromString");const m=[!1,"notify","apply"],x=[0,1,6,12,24,48,72,168],S=[1,2,3,4,5,6,8,10,12],l="openai-codex";function _(e,t){const o=e.providerOptions[t];if(o!==void 0)return o;const n={};return e.providerOptions[t]=n,n}r(_,"providerOptionsFor");const g={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:r(e=>e.auto_update.crtr===!1?"off":e.auto_update.crtr,"format"),cycle:r((e,t)=>{e.auto_update.crtr=d(m,e.auto_update.crtr,t)},"cycle"),setFromString:r((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:r(e=>e.auto_update.content===!1?"off":e.auto_update.content,"format"),cycle:r((e,t)=>{e.auto_update.content=d(m,e.auto_update.content,t)},"cycle"),setFromString:r((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:r(e=>`${e.auto_update.interval_hours}h`,"format"),cycle:r((e,t)=>{e.auto_update.interval_hours=c(x,e.auto_update.interval_hours,t)},"cycle"),setFromString:r((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:r(e=>String(e.max_panes_per_window),"format"),cycle:r((e,t)=>{e.max_panes_per_window=c(S,e.max_panes_per_window,t)},"cycle"),setFromString:r((e,t)=>{const o=b(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:r(e=>e.auto_open_child_viewers?"on":"off","format"),cycle:r(e=>{e.auto_open_child_viewers=!e.auto_open_child_viewers},"cycle"),setFromString:r((e,t)=>{const o=i(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:r(e=>e.completion_bell?"on":"off","format"),cycle:r(e=>{e.completion_bell=!e.completion_bell},"cycle"),setFromString:r((e,t)=>{const o=i(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:r(e=>e.whip_mode?"on":"off","format"),cycle:r(e=>{e.whip_mode=!e.whip_mode},"cycle"),setFromString:r((e,t)=>{const o=i(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:r(e=>e.page_surface?"on":"off","format"),cycle:r(e=>{e.page_surface=!e.page_surface},"cycle"),setFromString:r((e,t)=>{const o=i(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:p.join("|"),applies:"Applies on the next attach.",group:"display",order:40,format:r(e=>e.whip_message_mode==="go-faster"?"go faster":"random","format"),cycle:r((e,t)=>{e.whip_message_mode=d(p,e.whip_message_mode,t)},"cycle"),setFromString:r((e,t)=>p.includes(t)?(e.whip_message_mode=t,null):`whip_message_mode must be one of: ${p.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:u.join("|"),applies:"Applies on the next attach.",group:"display",order:38,format:r(e=>e.mouse_mode_default==="tmux"?"follow tmux":e.mouse_mode_default,"format"),cycle:r((e,t)=>{e.mouse_mode_default=d(u,e.mouse_mode_default,t)},"cycle"),setFromString:r((e,t)=>u.includes(t)?(e.mouse_mode_default=t,null):`mouse_mode_default 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:r(e=>e.bash_tool_purpose?"on":"off","format"),cycle:r(e=>{e.bash_tool_purpose=!e.bash_tool_purpose},"cycle"),setFromString:r((e,t)=>{const o=i(t,"bash_tool_purpose");return typeof o=="string"?o:(e.bash_tool_purpose=o,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:r(e=>e.verbosity,"format"),display:r(e=>v(e.verbosity),"display"),cycle:r((e,t)=>{const o=a.indexOf(e.verbosity)+t;e.verbosity=a[Math.max(0,Math.min(a.length-1,o))]},"cycle"),setFromString:r((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:r(e=>String(e.document_port),"format"),cycle:r((e,t)=>{e.document_port=Math.max(1,Math.min(65535,e.document_port+t))},"cycle"),setFromString:r((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:r(e=>e.detailed_tool_recaps?"on":"off","format"),cycle:r(e=>{e.detailed_tool_recaps=!e.detailed_tool_recaps},"cycle"),setFromString:r((e,t)=>{const o=i(t,"detailed_tool_recaps");return typeof o=="string"?o:(e.detailed_tool_recaps=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:r(e=>e.providerOptions[l]?.fastMode?"on":"off","format"),cycle:r(e=>{const t=_(e,l);t.fastMode=!t.fastMode},"cycle"),setFromString:r((e,t)=>{const o=i(t,`providerOptions.${l}.fastMode`);return typeof o=="string"?o:(_(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"}},C=Object.keys(g);function k(){const e=[];for(const t of Object.values(g))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)}r(k,"collectUserSettings");const h=k();function E(e){return h.find(t=>t.key===e)}r(E,"findUserSetting");function M(e){return h.filter(t=>t.group===e)}r(M,"userSettingsInGroup");export{g as CONFIG_SETTINGS_COVERAGE,C as SCOPE_CONFIG_KEYS,h as USER_SETTINGS,w as VERBOSITY_LABELS,E as findUserSetting,M as userSettingsInGroup,v as verbositySpectrum};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
`).join("")),{status:200}}const
|
|
3
|
-
`,u.length>=256*1024&&await
|
|
1
|
+
var b=Object.defineProperty;var a=(e,r)=>b(e,"name",{value:r,configurable:!0});import{conversationStore as T}from"../../../core/conversation-store/index.js";import{createRowStore as g}from"../../../core/conversation-store/row-store.js";import{conversationOwner as N}from"../../../core/canvas/sessions.js";import{mayOnNode as y}from"../router.js";import{markAt as q,withLoggedStepTimings as O}from"../../../core/logged-step-timings.js";import{ApiError as l}from"../../../api/errors.js";const c=128*1024*1024,i=a(()=>T(),"store"),o=a(e=>e.body,"input");function d(){throw new l(404,"not_found","conversation not found")}a(d,"notFound");async function p(e,r,n=!1){const t=await N(r);if(!t)return d();if(e.principal.class==="broker"){if(t!==e.principal.node)return d()}else if(n||e.principal.class!=="person"||!await y(e.principal,"read",t))return d();return t}a(p,"authorize");const R=a(async(e,r)=>{await p(e,r);const n=e.query.get("head"),t=e.query.get("tail"),m=e.query.get("from")==="cycle";if(n!==null||t!==null||m){if(!m&&(n===null||t===null||!/^\d+$/.test(n)||!/^\d+$/.test(t)||Number(n)>c||Number(t)>c))throw new l(400,"invalid_request","head and tail must be byte counts");const s=await i().read(r,m?"cycle":{head:Number(n),tail:Number(t)});return e.res.writeHead(200,{"content-type":"application/x-ndjson","x-conversation-path":s.path,...s.tail?{"x-conversation-tail":String(s.entries.length+1)}:{}}),e.res.end([s.header,...s.entries,...s.tail??[]].map(h=>JSON.stringify(h)+`
|
|
2
|
+
`).join("")),{status:200}}const f=await i().readLines?.(r);if(!f)throw new Error("conversation store does not support streaming reads");e.res.writeHead(200,{"content-type":"application/x-ndjson","x-conversation-path":f.path});let u="";const w=a(()=>{const s=u;return u="",new Promise((h,_)=>e.res.write(s,v=>v?_(v):h()))},"flush");for await(const s of f.lines)u+=s+`
|
|
3
|
+
`,u.length>=256*1024&&await w();return u&&await w(),e.res.end(),{status:200}},"readResult"),F=[{method:"POST",pattern:"/v1/conversations",maxBodyBytes:c,handler:a(async e=>{if(e.principal.class!=="broker"||o(e).node_id!==e.principal.node)return d();const r=e.principal.node;return await O("conversation_create",{node:r,body_bytes:Number(e.req.headers["content-length"]??0)},e.req,async()=>{const n=await i().create(r,o(e).header,o(e).entries);return q("response_ready"),{status:201,body:n}})},"handler")},{method:"GET",pattern:"/v1/conversations",handler:a(async e=>{if(e.principal.class==="broker"){const n=e.query.get("node_id");return n&&n!==e.principal.node?d():{status:200,body:{conversations:await i().list(e.principal.node)}}}if(e.principal.class!=="person")return d();const r=e.query.get("node_id");if(!r)throw new l(400,"invalid_request","node_id is required");return await y(e.principal,"read",r)?{status:200,body:{conversations:await i().list(r)}}:d()},"handler")},{method:"POST",pattern:"/v1/conversations/:id/entries",maxBodyBytes:c,handler:a(async e=>{await p(e,e.params.id,!0);const r=process.env.CRTR_FAULT_CONVERSATION??"";if(r.startsWith("append_refuse:")){const n=Number(r.slice(14));throw process.env.CRTR_FAULT_CONVERSATION=n>1?`append_refuse:${n-1}`:"",new l(503,"unavailable","conversation append refused (fault)")}return await i().append(e.params.id,o(e).entries),r==="append_drop_after_store"?(e.res.destroy(),{status:204}):{status:204}},"handler")},{method:"POST",pattern:"/v1/conversations/:id/commit",handler:a(async e=>{if(await p(e,e.params.id,!0),process.env.CRTR_FAULT_CONVERSATION==="commit_put_fail")throw new l(503,"unavailable","conversation commit refused (fault)");return{status:200,body:{seq:await g().commit(e.params.id)}}},"handler")},{method:"GET",pattern:"/v1/conversations/:id",handler:a(async e=>await R(e,e.params.id),"handler")},{method:"GET",pattern:"/v1/conversations/:id/header",handler:a(async e=>(await p(e,e.params.id),{status:200,body:await i().header(e.params.id)}),"handler")},{method:"PUT",pattern:"/v1/conversations/:id",maxBodyBytes:c,handler:a(async e=>(await p(e,e.params.id,!0),await i().replace(e.params.id,o(e).header,o(e).entries),{status:204}),"handler")},{method:"POST",pattern:"/v1/conversations/:id/fork",handler:a(async e=>{const r=await p(e,e.params.id,!0);return o(e).node_id!==r?d():{status:201,body:{conversation_id:await i().fork(e.params.id,r,o(e).leaf_id,o(e).cwd)}}},"handler")},{method:"DELETE",pattern:"/v1/conversations/:id",handler:a(async e=>(await p(e,e.params.id,!0),await i().delete(e.params.id),{status:204}),"handler")}];export{F as conversationRoutes};
|
package/dist/types.d.ts
CHANGED
|
@@ -329,23 +329,6 @@ export interface ScopeConfig {
|
|
|
329
329
|
/** Initial mouse wheel scrolling mode for each attach viewer. `tmux` follows
|
|
330
330
|
* tmux's current mouse option; `on` and `off` are explicit. Default `tmux`. */
|
|
331
331
|
mouse_mode_default: MouseModeDefault;
|
|
332
|
-
/** How many trailing refresh-yield CYCLES the attach viewer renders at full
|
|
333
|
-
* fidelity. Older cycles are condensed to cycle dividers plus whatever
|
|
334
|
-
* `condensed_history` admits. No tool components are built for them, while
|
|
335
|
-
* retained prose re-wraps when the pane width changes. Tool calls and results
|
|
336
|
-
* measure ~63% of a transcript's rendered lines and ~69% of its build time,
|
|
337
|
-
* so excluding them is the dominant attach-time saving for a long multi-cycle
|
|
338
|
-
* node. Full detail for every cycle stays in the session file. Minimum 1 (the
|
|
339
|
-
* live cycle is never condensed). Default 2. */
|
|
340
|
-
live_cycles: number;
|
|
341
|
-
/** What survives from a CONDENSED cycle (one older than the trailing
|
|
342
|
-
* `live_cycles`). The cycle dividers always remain as seams so you can see
|
|
343
|
-
* that older cycles exist; this chooses which of their messages are kept:
|
|
344
|
-
* `none` (default) drops every message, `user` keeps only your prompts,
|
|
345
|
-
* `agent` keeps only the assistant's prose plus compaction/branch summaries,
|
|
346
|
-
* `both` keeps both. Tool calls and results are never kept. Full detail for
|
|
347
|
-
* every cycle stays in the session file. */
|
|
348
|
-
condensed_history: CondensedHistoryMode;
|
|
349
332
|
/** Expose crouter's optional `purpose` label in the bash tool schema. Turning
|
|
350
333
|
* this off leaves the bash valve active but gives agents pi's ordinary bash
|
|
351
334
|
* definition with only its upstream parameters. Default true. */
|
|
@@ -558,19 +541,13 @@ export declare const STATE_FILE = "state.json";
|
|
|
558
541
|
export declare const AGENTS_DIR = "agents";
|
|
559
542
|
export declare const PROFILE_DIR = "profiles";
|
|
560
543
|
export declare const DEFAULT_MAX_PANES_PER_WINDOW = 3;
|
|
561
|
-
/** Trailing cycles the attach viewer keeps at full fidelity (see `live_cycles`). */
|
|
562
544
|
export declare const DEFAULT_WHIP_MESSAGES: readonly ["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 embarrassment 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"];
|
|
563
545
|
/** What the whip action sends (see `whip_message_mode`). */
|
|
564
546
|
export declare const WHIP_MESSAGE_MODES: readonly ["random", "go-faster"];
|
|
565
547
|
export type WhipMessageMode = (typeof WHIP_MESSAGE_MODES)[number];
|
|
566
548
|
export declare const DEFAULT_WHIP_MESSAGE_MODE: WhipMessageMode;
|
|
567
|
-
export declare const DEFAULT_LIVE_CYCLES = 2;
|
|
568
549
|
export declare const MOUSE_MODE_DEFAULTS: readonly ["tmux", "on", "off"];
|
|
569
550
|
export type MouseModeDefault = (typeof MOUSE_MODE_DEFAULTS)[number];
|
|
570
|
-
/** Messages kept from a condensed cycle (see `condensed_history`). */
|
|
571
|
-
export declare const CONDENSED_HISTORY_MODES: readonly ["none", "user", "agent", "both"];
|
|
572
|
-
export type CondensedHistoryMode = (typeof CONDENSED_HISTORY_MODES)[number];
|
|
573
|
-
export declare const DEFAULT_CONDENSED_HISTORY: CondensedHistoryMode;
|
|
574
551
|
/** Attach-viewer verbosity, least detail first. `replies`: one rewritten reply
|
|
575
552
|
* per message the person typed. `summaries`: every agent message, each tool
|
|
576
553
|
* group as its one-line summary. `tools`: each finished tool call on its call
|
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
|
|
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 m={SUCCESS:0,GENERAL:1,USAGE:2,NOT_FOUND:3,AMBIGUOUS:4,NETWORK:5},r=4,f=".crouter-plugin",_="plugin.json",v=".crouter-marketplace",w="marketplace.json",E=".crouter",k="config.json",x="state.json",b="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 embarrassment 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"],S=["random","go-faster"],c="random",T=["tmux","on","off"],I=["replies","summaries","tools","previews","full"],l="replies";function A(){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",bash_tool_purpose:!0,verbosity:l,detailed_tool_recaps:!0,document_port:7472,keybindings:{},tmux_passthrough:[],modelLadders:h(),providerOptions:{},kinds:d(),remoteCanvas:p(),api:{tcp:""},spawnEnv:{allow:[]},bin:{},humanActions:{}}}e(A,"defaultScopeConfig");function p(){return{targets:{}}}e(p,"defaultRemoteCanvasConfig");function d(){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(d,"defaultKindsConfig");function h(){return{anthropic:{ultra:"anthropic/claude-fable-5-2: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(h,"defaultModelLaddersConfig");function M(){return{marketplaces:{},plugins:{}}}e(M,"defaultScopeState");export{b as AGENTS_DIR,k as CONFIG_FILE,E as CRTR_DIR_NAME,i as DEFAULT_MAX_PANES_PER_WINDOW,l as DEFAULT_VERBOSITY,s as DEFAULT_WHIP_MESSAGES,c as DEFAULT_WHIP_MESSAGE_MODE,m as ExitCode,v as MARKETPLACE_MANIFEST_DIR,w as MARKETPLACE_MANIFEST_FILE,T as MOUSE_MODE_DEFAULTS,f as PLUGIN_MANIFEST_DIR,_ as PLUGIN_MANIFEST_FILE,y as PROFILE_DIR,r as SCHEMA_VERSION,x as STATE_FILE,I as VERBOSITY_LEVELS,S as WHIP_MESSAGE_MODES,d as defaultKindsConfig,h as defaultModelLaddersConfig,p as defaultRemoteCanvasConfig,A as defaultScopeConfig,M as defaultScopeState};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.705",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -156,8 +156,8 @@
|
|
|
156
156
|
},
|
|
157
157
|
"license": "UNLICENSED",
|
|
158
158
|
"dependencies": {
|
|
159
|
-
"@north-light/identity": "0.3.
|
|
160
|
-
"@north-light/plugin": "0.3.
|
|
159
|
+
"@north-light/identity": "0.3.705",
|
|
160
|
+
"@north-light/plugin": "0.3.705",
|
|
161
161
|
"@earendil-works/chord": "1.5.2",
|
|
162
162
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
163
163
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -39,7 +39,7 @@ export function defaultAgentDir() {
|
|
|
39
39
|
const APP_KEYBINDINGS = {
|
|
40
40
|
'app.interrupt': { defaultKeys: 'escape', description: 'Cancel or abort' },
|
|
41
41
|
'app.clear': { defaultKeys: 'ctrl+c', description: 'Clear editor' },
|
|
42
|
-
'app.exit': { defaultKeys:
|
|
42
|
+
'app.exit': { defaultKeys: [], description: 'Exit when editor is empty' },
|
|
43
43
|
'app.suspend': { defaultKeys: 'ctrl+z', description: 'Suspend to background' },
|
|
44
44
|
'app.thinking.cycle': { defaultKeys: 'shift+tab', description: 'Cycle thinking level' },
|
|
45
45
|
'app.model.cycleForward': { defaultKeys: 'ctrl+p', description: 'Cycle to next model' },
|
|
@@ -47,7 +47,7 @@ const APP_KEYBINDINGS = {
|
|
|
47
47
|
'app.model.select': { defaultKeys: 'ctrl+l', description: 'Open model selector' },
|
|
48
48
|
'app.tools.expand': { defaultKeys: 'ctrl+o', description: 'Show more detail (verbosity level)' },
|
|
49
49
|
'app.thinking.toggle': { defaultKeys: 'ctrl+t', description: 'Toggle thinking blocks' },
|
|
50
|
-
'app.editor.external': { defaultKeys: 'ctrl+g', description: 'Open external editor' },
|
|
50
|
+
'app.editor.external': { defaultKeys: 'ctrl+alt+g', description: 'Open external editor' },
|
|
51
51
|
// Alt+Enter inserts a newline in the attach editor (shift+enter is unreliable
|
|
52
52
|
// across terminals), so the follow-up-queue action drops its alt+enter default
|
|
53
53
|
// to free the chord — see ATTACH_KEYBINDING_OVERRIDES below.
|
|
@@ -94,6 +94,10 @@ export function loadUserKeybindings(agentDir = defaultAgentDir()) {
|
|
|
94
94
|
*/
|
|
95
95
|
const ATTACH_KEYBINDING_OVERRIDES = {
|
|
96
96
|
'tui.input.newLine': { defaultKeys: ['shift+enter', 'alt+enter'], description: 'Insert new line' },
|
|
97
|
+
// Ctrl+K/U/D/J/G scroll the transcript (crtr.attach.scroll.*), so the editor gives them up.
|
|
98
|
+
'tui.editor.deleteToLineStart': { defaultKeys: [], description: 'Delete to line start' },
|
|
99
|
+
'tui.editor.deleteToLineEnd': { defaultKeys: [], description: 'Delete to line end' },
|
|
100
|
+
'tui.editor.deleteCharForward': { defaultKeys: ['delete'], description: 'Delete character forward' },
|
|
97
101
|
};
|
|
98
102
|
export function createKeybindingsManager(agentDir = defaultAgentDir()) {
|
|
99
103
|
const definitions = {
|