borgmcp 1.1.1 → 1.1.2
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/bare-launch-menu.d.ts +2 -2
- package/dist/bare-launch-menu.js +5 -5
- package/dist/claude.js +1 -1
- package/package.json +1 -1
|
@@ -33,8 +33,8 @@ export interface LaunchMenuOption {
|
|
|
33
33
|
export interface LaunchMenuInputs {
|
|
34
34
|
/** The configured/resolved current agent (option 1). */
|
|
35
35
|
defaultCli: BorgCli;
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/** All installed agents that are NOT the default, in display order. */
|
|
37
|
+
otherInstalledClis: BorgCli[];
|
|
38
38
|
/** True iff there's an active cube with >=1 discoverable drone (option 3). */
|
|
39
39
|
hasLaunchAllTargets: boolean;
|
|
40
40
|
}
|
package/dist/bare-launch-menu.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const c={claude:"Claude",codex:"Codex",opencode:"OpenCode"};function f(n){return n.extraArgs.length===0&&n.stdinIsTTY&&n.stdoutIsTTY}function
|
|
2
|
-
`}function
|
|
3
|
-
${n.map(
|
|
1
|
+
const c={claude:"Claude",codex:"Codex",opencode:"OpenCode"};function f(n){return n.extraArgs.length===0&&n.stdinIsTTY&&n.stdoutIsTTY}function p(n){return!n.explicitCli||!n.stdinIsTTY||!n.stdoutIsTTY||!n.hasActiveCube||!n.hasLaunchAllTargets?null:`borg --cli ${n.explicitCli} launches ${c[n.explicitCli]} directly; use bare borg for the launch menu or borg launch-all --cli ${n.explicitCli} for all drone worktrees.
|
|
2
|
+
`}function x(n){return!!(n.explicitCli&&n.stdinIsTTY&&n.stdoutIsTTY&&n.hasActiveCube)}function h(n){const e=[{key:"1",label:`Launch (default \xB7 ${c[n.defaultCli]})`,action:{kind:"launch",cli:n.defaultCli}}];for(const t of n.otherInstalledClis)e.push({key:String(e.length+1),label:`Launch with ${c[t]} (one-shot)`,action:{kind:"launch",cli:t}});return n.hasLaunchAllTargets&&e.push({key:String(e.length+1),label:"Launch all (this cube's drone worktrees)",action:{kind:"launch-all"}}),e}function s(n,e){const t=e.trim();if(t==="")return{ok:!0,action:n[0].action};const i=n.find(o=>o.key===t);return i?{ok:!0,action:i.action}:{ok:!1}}function d(n){return`borg \u2014 how do you want to launch?
|
|
3
|
+
${n.map(t=>` ${t.key}) ${t.label}`).join(`
|
|
4
4
|
`)}
|
|
5
|
-
[1]: `}async function
|
|
6
|
-
${u}`),
|
|
5
|
+
[1]: `}async function T(n,e,t={}){const i=h(n);if(i.length===1)return i[0].action;const o=t.maxAttempts??3,u=d(i);for(let l=0;l<o;l++){const r=await e(l===0?u:`Invalid choice.
|
|
6
|
+
${u}`),a=s(i,r);if(a.ok)return a.action;t.warn?.(`invalid launch-menu selection: ${JSON.stringify(r.trim())}`)}return i[0].action}export{h as buildLaunchMenuOptions,p as explicitCliLaunchHint,d as renderLaunchMenu,s as resolveLaunchMenuChoice,T as runBareLaunchMenu,x as shouldResolveExplicitCliLaunchHintTargets,f as shouldShowLaunchMenu};
|
package/dist/claude.js
CHANGED
|
@@ -6,7 +6,7 @@ import{spawn as B}from"child_process";import{randomUUID as F}from"node:crypto";i
|
|
|
6
6
|
`)),process.stderr.write("Run `borg --help` for usage.\n"),process.exit(1));const r=await te({},e.options);process.exit(r)}if(process.argv[2]==="launch-all"){const e=R(process.argv.slice(3));e.ok||(process.stderr.write(i.red(`${t()}\u25FC borg launch-all: ${e.error}
|
|
7
7
|
`)),process.stderr.write("Run `borg --help` for usage.\n"),process.exit(1));const r=k(),a=await O(e.args,r);process.exit(a)}const n=ce(process.argv[2]);if(n!==null&&(process.stderr.write(i.red(`${t()}\u25FC unknown command: ${n}
|
|
8
8
|
`)),process.stderr.write("Run `borg --help` for usage.\n"),process.exit(1)),ye(await be()!==null,await $e()!==null)){const e=D(b()).length>0;process.stdout.write(Se(e)),process.exit(0)}const d=ve(process.argv.slice(2));d.error&&(process.stderr.write(i.red(`${t()}\u25FC ${d.error}
|
|
9
|
-
`)),process.stderr.write("Run `borg --help` for usage.\n"),process.exit(1));const $=async e=>{const r=W({input:process.stdin,output:process.stdout});try{return await r.question(e)}finally{r.close()}};let o=await ke(d.cli,xe($,()=>process.stdin.isTTY===!0));ze();const s=await G();let w;const S=async()=>s?(w===void 0&&(w=(await le({targetCubeId:s.cubeId},k())).length>0),w):!1,C=process.stdin.isTTY===!0,x=process.stdout.isTTY===!0,y=de({explicitCli:d.cli,stdinIsTTY:C,stdoutIsTTY:x,hasActiveCube:s!==null,hasLaunchAllTargets:ue({explicitCli:d.cli,stdinIsTTY:C,stdoutIsTTY:x,hasActiveCube:s!==null})?await S():!1});if(y&&process.stderr.write(y),me({extraArgs:process.argv.slice(2),stdinIsTTY:C,stdoutIsTTY:x})){const e=D(b()).
|
|
9
|
+
`)),process.stderr.write("Run `borg --help` for usage.\n"),process.exit(1));const $=async e=>{const r=W({input:process.stdin,output:process.stdout});try{return await r.question(e)}finally{r.close()}};let o=await ke(d.cli,xe($,()=>process.stdin.isTTY===!0));ze();const s=await G();let w;const S=async()=>s?(w===void 0&&(w=(await le({targetCubeId:s.cubeId},k())).length>0),w):!1,C=process.stdin.isTTY===!0,x=process.stdout.isTTY===!0,y=de({explicitCli:d.cli,stdinIsTTY:C,stdoutIsTTY:x,hasActiveCube:s!==null,hasLaunchAllTargets:ue({explicitCli:d.cli,stdinIsTTY:C,stdoutIsTTY:x,hasActiveCube:s!==null})?await S():!1});if(y&&process.stderr.write(y),me({extraArgs:process.argv.slice(2),stdinIsTTY:C,stdoutIsTTY:x})){const e=D(b()).filter(a=>a!==o),r=await pe({defaultCli:o,otherInstalledClis:e,hasLaunchAllTargets:await S()},$);if(r.kind==="launch-all"){const a=R([]),N=a.ok?await O(a.args,k()):1;process.exit(N)}o=r.cli}const l=d.rest;fe(s?{label:s.droneLabel,cubeName:s.name}:null,_(process.cwd()));const M=Oe(o,s&&o==="claude"?U(s.cubeId,s.droneId):null);await Promise.race([c,new Promise(e=>setTimeout(e,2e3))]);const A=o==="codex"?`borg-wake-${F()}`:null;let f,T=[],p={...process.env,BORG_SESSION:"1"},u=null,m=null;if(o==="codex"&&!l.includes("--remote")){console.error(`${t()}${i.gray("\u25FC Starting Codex remote-wake app-server\u2026")}`);const e=await Ae(Pe());e.warning?(console.error(`${t()}${i.yellow(`warning: ${e.warning}`)}`),f="\u26A0 Codex wake-path capability check failed: remote-control is unavailable for this session. Run borg_regen manually whenever you return, and expect only fallback wakeups until relaunch."):f="Codex wake-path capability check passed: remote-control socket established for this session.",T=e.args,p={...process.env,...e.env,BORG_SESSION:"1"},u=E(e.args),m=e.server?.cleanup??null}else o==="codex"&&l.includes("--remote")&&(f="Codex wake-path capability check: using caller-provided --remote socket; if no wake arrives, run borg_regen manually when returning to the session.",u=E(l),u&&(p={...process.env,BORG_CODEX_REMOTE_WAKE:"1",BORG_SESSION:"1"}));if(s){const e=await Y(s.cubeId,I(),s.droneId),r=j(p,e,process.env);if(p=r.env,r.probe){const a=await q(r.probe.descriptor,fetch,r.probe.baseUrl);a.ok||console.error(`${t()}${i.yellow(`warning: ${a.message}`)}`)}}const v=Re({cli:o,codexWakeNonce:A,monitorClause:M,codexWakePathClause:f});let g;if(o==="codex")g=[...Ee(),...T,...Te([...l,v],process.cwd())];else if(o==="opencode"){const e=s?qe(s.droneId):14096;je(),Ge(e),g=[process.cwd(),"--port",String(e),"--auto",...l]}else g=ee(l,v);const H=o==="claude"?"Claude Code":o==="codex"?"Codex":"OpenCode";console.error(`${t()}${i.blue(`\u25FC Launching ${H}\u2026`)}`);const P=B(o,g,{stdio:"inherit",shell:!1,env:p});o==="codex"&&s&&u&&(De({deps:{setCodexWakeTarget:V,findLoadedCodexThread:Le},cubeId:s.cubeId,droneId:s.droneId,socketPath:u,passthroughArgs:l,previewNeedle:A??v.slice(0,120),cwd:process.cwd(),launchedAtSeconds:Math.floor(Date.now()/1e3)}),K(e=>Ie(e))),P.on("error",e=>{if(m)try{m()}catch{}if(e.code==="ENOENT"){console.error(`${t()}${i.red(`
|
|
10
10
|
\u25FC Failed to launch ${o}`)}`);const r=o==="opencode"?"opencode":o;console.error(`${t()}${i.gray(`Make sure ${r} is installed.
|
|
11
11
|
`)}`)}else console.error(`${t()}${i.red(`
|
|
12
12
|
\u25FC Failed to launch ${o}: ${e.message}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "borgmcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Coordinate AI coding agents in shared cubes. Works with Claude Code and Codex. Create projects, assign roles, and share a live activity log.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|