borgmcp 1.1.3 → 1.1.5
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/opencode-drone.d.ts +4 -5
- package/dist/opencode-drone.js +13 -1
- package/package.json +1 -1
package/dist/opencode-drone.d.ts
CHANGED
|
@@ -10,11 +10,10 @@ interface ConnectDeps {
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function connectOpenCodeDrone(deps: ConnectDeps): Promise<void>;
|
|
12
12
|
/**
|
|
13
|
-
* Inject the initial kickoff prompt into the TUI's session.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* task. Best-effort — never throws.
|
|
13
|
+
* Inject the initial kickoff prompt into the TUI's session. Fills the
|
|
14
|
+
* TUI input with the kickoff text and submits it, triggering the agent
|
|
15
|
+
* to process it as its first task. Polls until the TUI server and a
|
|
16
|
+
* session are available. Best-effort — never throws.
|
|
18
17
|
*/
|
|
19
18
|
export declare function injectInitialKickoff(text: string): Promise<boolean>;
|
|
20
19
|
/**
|
package/dist/opencode-drone.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
import{createOpencodeClient as
|
|
1
|
+
import{createOpencodeClient as d}from"@opencode-ai/sdk";let e=null;async function f(t){try{e={client:d({baseUrl:t.serverUrl}),serverUrl:t.serverUrl,sessionId:null,directory:t.directory,connected:!0,totalEntriesInjected:0},process.stderr.write(`[borg] opencode drone connected to ${t.serverUrl} for dir ${t.directory}
|
|
2
|
+
`)}catch(r){process.stderr.write(`[borg] opencode drone connect failed: ${r}
|
|
3
|
+
`),e=null}}async function l(t=15,r=1e3){if(!e?.connected)return!1;for(let n=0;n<t;n++){try{if((await e.client.session.list()).response.status===200)return!0}catch(s){process.stderr.write(`[borg] waitForServer attempt ${n+1}: ${s}
|
|
4
|
+
`)}await new Promise(s=>setTimeout(s,r))}return process.stderr.write(`[borg] server not ready after ${t} retries
|
|
5
|
+
`),!1}async function c(){if(!e?.connected)return null;try{const r=(await e.client.session.list()).data??[],n=e.directory,s=n?r.filter(i=>i.directory===n):r;if(s.length===0)return null;const o=s.reduce((i,a)=>i.time.created>a.time.created?i:a);return process.stderr.write(`[borg] found session ${o.id.slice(0,8)}\u2026
|
|
6
|
+
`),e.sessionId=o.id,o.id}catch{return null}}async function p(t){if(!e?.connected)return process.stderr.write(`[borg] injectInitialKickoff: not connected
|
|
7
|
+
`),!1;try{if(!await l())return process.stderr.write(`[borg] injectInitialKickoff: server not ready
|
|
8
|
+
`),!1;process.stderr.write(`[borg] appendPrompt text.length=${t.length}\u2026
|
|
9
|
+
`),await e.client.tui.appendPrompt({body:{text:t}}),process.stderr.write(`[borg] submitPrompt\u2026
|
|
10
|
+
`),await e.client.tui.submitPrompt({query:{directory:e.directory}});const n=await c();return n?(process.stderr.write(`[borg] kickoff injected, session ${n.slice(0,8)}\u2026
|
|
11
|
+
`),e.totalEntriesInjected++,!0):(process.stderr.write(`[borg] injectInitialKickoff: session not created after submit
|
|
12
|
+
`),!0)}catch(r){return process.stderr.write(`[borg] injectInitialKickoff error: ${r}
|
|
13
|
+
`),!1}}async function y(t){if(!e?.connected)return!1;try{const r=e.sessionId??await c();return r?(await e.client.session.prompt({path:{id:r},body:{noReply:!0,parts:[{type:"text",text:t}]}}),e.totalEntriesInjected++,!0):!1}catch{return e.sessionId=null,!1}}async function w(){if(!e?.connected)return null;try{const t=e.sessionId??await c();return t?(await e.client.session.get({path:{id:t}})).response.status===200:!1}catch{return!1}}function b(){e=null}function I(){return{connected:e?.connected??!1,sessionId:e?.sessionId??null,totalEntriesInjected:e?.totalEntriesInjected??0}}function g(t,r=14096){let n=0;for(let s=0;s<t.length;s++){const o=t.charCodeAt(s);n=(n<<5)-n+o,n|=0}return r+Math.abs(n)%1024}export{g as computeOpenCodePort,f as connectOpenCodeDrone,b as disconnectOpenCodeDrone,I as getOpenCodeConnectionState,p as injectInitialKickoff,y as injectOpenCodeEntry,w as probeOpenCodeDroneArmed};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "borgmcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
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",
|