borgmcp 4.3.0 → 4.4.0
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/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +5 -2
- package/dist/cli-help.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/opencode-drone.d.ts +17 -0
- package/dist/opencode-drone.d.ts.map +1 -1
- package/dist/opencode-drone.js +306 -66
- package/dist/opencode-drone.js.map +1 -1
- package/dist/opencode-seat-identity.d.ts +1 -1
- package/dist/opencode-seat-identity.d.ts.map +1 -1
- package/dist/opencode-seat-identity.js.map +1 -1
- package/dist/roster-render.d.ts.map +1 -1
- package/dist/roster-render.js +2 -3
- package/dist/roster-render.js.map +1 -1
- package/dist/server-errors.d.ts +22 -0
- package/dist/server-errors.d.ts.map +1 -1
- package/dist/server-errors.js +32 -0
- package/dist/server-errors.js.map +1 -1
- package/dist/stream-status.d.ts.map +1 -1
- package/dist/stream-status.js +7 -2
- package/dist/stream-status.js.map +1 -1
- package/dist/update-cmd.d.ts +2 -1
- package/dist/update-cmd.d.ts.map +1 -1
- package/dist/update-cmd.js +110 -41
- package/dist/update-cmd.js.map +1 -1
- package/docs/LOCAL_SERVER.md +14 -5
- package/package.json +1 -1
- package/src/cli-help.ts +5 -2
- package/src/index.ts +23 -3
- package/src/opencode-drone.ts +363 -72
- package/src/opencode-seat-identity.ts +1 -0
- package/src/roster-render.ts +2 -3
- package/src/server-errors.ts +50 -0
- package/src/stream-status.ts +7 -2
- package/src/update-cmd.ts +118 -41
package/src/index.ts
CHANGED
|
@@ -172,6 +172,9 @@ import {
|
|
|
172
172
|
runEvictDroneTool,
|
|
173
173
|
runReassignDroneTool,
|
|
174
174
|
} from './drone-management.js';
|
|
175
|
+
|
|
176
|
+
const OPEN_CODE_IDENTITY_HANDSHAKE_TIMEOUT_MS = 5_000;
|
|
177
|
+
|
|
175
178
|
/**
|
|
176
179
|
* Apply a template's roles + message_taxonomy to a cube.
|
|
177
180
|
*
|
|
@@ -392,8 +395,25 @@ export async function main() {
|
|
|
392
395
|
|
|
393
396
|
let openCodeIdentityFailure: OpenCodeSeatIdentityError | null = null;
|
|
394
397
|
let finishOpenCodeIdentity: (() => void) | null = null;
|
|
398
|
+
let openCodeIdentityTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
399
|
+
const settleOpenCodeIdentity = () => {
|
|
400
|
+
if (openCodeIdentityTimeout) clearTimeout(openCodeIdentityTimeout);
|
|
401
|
+
openCodeIdentityTimeout = null;
|
|
402
|
+
const finish = finishOpenCodeIdentity;
|
|
403
|
+
finishOpenCodeIdentity = null;
|
|
404
|
+
finish?.();
|
|
405
|
+
};
|
|
395
406
|
const openCodeIdentityReady = openCodeRuntime && !readinessProbe
|
|
396
|
-
? new Promise<void>((resolveIdentity) => {
|
|
407
|
+
? new Promise<void>((resolveIdentity) => {
|
|
408
|
+
finishOpenCodeIdentity = resolveIdentity;
|
|
409
|
+
openCodeIdentityTimeout = setTimeout(() => {
|
|
410
|
+
openCodeIdentityFailure = new OpenCodeSeatIdentityError(
|
|
411
|
+
'IDENTITY_HANDSHAKE_TIMEOUT',
|
|
412
|
+
'OpenCode identity handshake did not complete within 5 seconds.',
|
|
413
|
+
);
|
|
414
|
+
settleOpenCodeIdentity();
|
|
415
|
+
}, OPEN_CODE_IDENTITY_HANDSHAKE_TIMEOUT_MS);
|
|
416
|
+
})
|
|
397
417
|
: null;
|
|
398
418
|
const waitForOpenCodeIdentity = async (): Promise<OpenCodeSeatIdentityError | null> => {
|
|
399
419
|
if (openCodeIdentityReady) await openCodeIdentityReady;
|
|
@@ -1663,7 +1683,7 @@ export async function main() {
|
|
|
1663
1683
|
? error
|
|
1664
1684
|
: new OpenCodeSeatIdentityError('ROOTS_UNAVAILABLE', String(error));
|
|
1665
1685
|
}).finally(() => {
|
|
1666
|
-
|
|
1686
|
+
settleOpenCodeIdentity();
|
|
1667
1687
|
});
|
|
1668
1688
|
};
|
|
1669
1689
|
}
|
|
@@ -1674,7 +1694,7 @@ export async function main() {
|
|
|
1674
1694
|
if (openCodeIdentityReady) {
|
|
1675
1695
|
await openCodeIdentityReady;
|
|
1676
1696
|
if (openCodeIdentityFailure) {
|
|
1677
|
-
|
|
1697
|
+
throw new Error(formatOpenCodeSeatIdentityError(openCodeIdentityFailure, process.cwd()));
|
|
1678
1698
|
} else {
|
|
1679
1699
|
await runMcpStartupServices(false, startupServices, { openCodeFirst: true });
|
|
1680
1700
|
}
|