overlord-cli 0.2611160906.0 → 0.2611161653.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/connectors/adapters/antigravity/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/claude/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/codex/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/cursor/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/opencode/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/pi/conformance-manifest.yaml +1 -1
- package/dist/index.js +229 -61
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39976,13 +39976,12 @@ function isLoopbackHostname(hostname7) {
|
|
|
39976
39976
|
function latchHomeDirectory(env = process.env) {
|
|
39977
39977
|
return trimmed4(env.LATCH_HOME) ?? path23.join(os5.homedir(), ".latch");
|
|
39978
39978
|
}
|
|
39979
|
-
function
|
|
39980
|
-
const rawUrl = trimmed4(env.LATCH_GATEWAY_URL) ?? DEFAULT_LATCH_GATEWAY_URL;
|
|
39979
|
+
function loopbackOrigin(rawUrl, label) {
|
|
39981
39980
|
let parsed;
|
|
39982
39981
|
try {
|
|
39983
39982
|
parsed = new URL(rawUrl);
|
|
39984
39983
|
} catch {
|
|
39985
|
-
throw new LatchGatewayError(
|
|
39984
|
+
throw new LatchGatewayError(`${label} is not a URL: ${rawUrl}`);
|
|
39986
39985
|
}
|
|
39987
39986
|
if (parsed.protocol !== "http:") {
|
|
39988
39987
|
throw new LatchGatewayError("The Latch gateway must be reached over http on loopback.");
|
|
@@ -39990,22 +39989,69 @@ function resolveLatchGatewayConfig({ env = process.env, readFile = (filePath) =>
|
|
|
39990
39989
|
if (!isLoopbackHostname(parsed.hostname)) {
|
|
39991
39990
|
throw new LatchGatewayError(`Refusing to reach the Latch gateway at a non-loopback host (${parsed.hostname}).`);
|
|
39992
39991
|
}
|
|
39993
|
-
|
|
39994
|
-
|
|
39995
|
-
|
|
39996
|
-
|
|
39997
|
-
if (!fileExists(tokenFile)) {
|
|
39992
|
+
return parsed.origin;
|
|
39993
|
+
}
|
|
39994
|
+
function readGatewayToken(tokenFile, files) {
|
|
39995
|
+
if (!files.fileExists(tokenFile)) {
|
|
39998
39996
|
throw new LatchGatewayError(`Latch's gateway token is missing (${tokenFile}). Start it with \`latch serve\`.`);
|
|
39999
39997
|
}
|
|
40000
39998
|
let token = null;
|
|
40001
39999
|
try {
|
|
40002
|
-
token = trimmed4(readFile(tokenFile));
|
|
40000
|
+
token = trimmed4(files.readFile(tokenFile));
|
|
40003
40001
|
} catch {
|
|
40004
40002
|
throw new LatchGatewayError(`Latch's gateway token could not be read (${tokenFile}).`);
|
|
40005
40003
|
}
|
|
40006
40004
|
if (!token)
|
|
40007
40005
|
throw new LatchGatewayError(`Latch's gateway token is empty (${tokenFile}).`);
|
|
40008
|
-
return
|
|
40006
|
+
return token;
|
|
40007
|
+
}
|
|
40008
|
+
function remoteLinkGatewayConfig(env, files) {
|
|
40009
|
+
const runtime = path23.join(latchHomeDirectory(env), ...LATCH_REMOTE_LINK_RUNTIME_PATH);
|
|
40010
|
+
const readyFile = path23.join(runtime, LATCH_REMOTE_LINK_READY_FILENAME);
|
|
40011
|
+
const tokenFile = path23.join(runtime, LATCH_REMOTE_LINK_TOKEN_FILENAME);
|
|
40012
|
+
if (!files.fileExists(readyFile) || !files.fileExists(tokenFile))
|
|
40013
|
+
return null;
|
|
40014
|
+
try {
|
|
40015
|
+
const ready = JSON.parse(files.readFile(readyFile));
|
|
40016
|
+
if (!ready || typeof ready !== "object" || Array.isArray(ready))
|
|
40017
|
+
return null;
|
|
40018
|
+
const url2 = trimmed4(ready.url);
|
|
40019
|
+
if (!url2)
|
|
40020
|
+
return null;
|
|
40021
|
+
return {
|
|
40022
|
+
baseUrl: loopbackOrigin(url2, "Latch's Remote Link gateway address"),
|
|
40023
|
+
token: readGatewayToken(tokenFile, files)
|
|
40024
|
+
};
|
|
40025
|
+
} catch {
|
|
40026
|
+
return null;
|
|
40027
|
+
}
|
|
40028
|
+
}
|
|
40029
|
+
function resolveLatchGatewayCandidates({ env = process.env, readFile = (filePath) => readFileSync16(filePath, "utf8"), fileExists = existsSync21 } = {}) {
|
|
40030
|
+
const files = { readFile, fileExists };
|
|
40031
|
+
const explicitUrl = trimmed4(env.LATCH_GATEWAY_URL);
|
|
40032
|
+
const baseUrl = loopbackOrigin(explicitUrl ?? DEFAULT_LATCH_GATEWAY_URL, "LATCH_GATEWAY_URL");
|
|
40033
|
+
const inlineToken = trimmed4(env.LATCH_GATEWAY_TOKEN);
|
|
40034
|
+
if (inlineToken)
|
|
40035
|
+
return [{ baseUrl, token: inlineToken }];
|
|
40036
|
+
const explicitTokenFile = trimmed4(env.LATCH_SERVE_TOKEN_FILE);
|
|
40037
|
+
const tokenFile = explicitTokenFile ?? path23.join(latchHomeDirectory(env), LATCH_SERVE_TOKEN_FILENAME);
|
|
40038
|
+
if (explicitUrl || explicitTokenFile) {
|
|
40039
|
+
return [{ baseUrl, token: readGatewayToken(tokenFile, files) }];
|
|
40040
|
+
}
|
|
40041
|
+
const candidates = [];
|
|
40042
|
+
let standaloneError = null;
|
|
40043
|
+
try {
|
|
40044
|
+
candidates.push({ baseUrl, token: readGatewayToken(tokenFile, files) });
|
|
40045
|
+
} catch (error62) {
|
|
40046
|
+
standaloneError = error62 instanceof LatchGatewayError ? error62 : null;
|
|
40047
|
+
}
|
|
40048
|
+
const remoteLink = remoteLinkGatewayConfig(env, files);
|
|
40049
|
+
if (remoteLink)
|
|
40050
|
+
candidates.push(remoteLink);
|
|
40051
|
+
if (candidates.length === 0) {
|
|
40052
|
+
throw standaloneError ?? new LatchGatewayError("Latch's gateway is not running. Start it with `latch serve`.");
|
|
40053
|
+
}
|
|
40054
|
+
return candidates;
|
|
40009
40055
|
}
|
|
40010
40056
|
function parseEndpoints(value2) {
|
|
40011
40057
|
if (!value2 || typeof value2 !== "object" || Array.isArray(value2))
|
|
@@ -40069,19 +40115,27 @@ async function readLatchGatewayCapabilities({ gateway, fetchImpl = fetch, timeou
|
|
|
40069
40115
|
return parsed;
|
|
40070
40116
|
}
|
|
40071
40117
|
async function requireLatchConversationGateway({ gateway, env, fetchImpl, timeoutMs } = {}) {
|
|
40072
|
-
const
|
|
40073
|
-
|
|
40074
|
-
|
|
40075
|
-
|
|
40076
|
-
|
|
40077
|
-
|
|
40078
|
-
|
|
40079
|
-
|
|
40080
|
-
|
|
40081
|
-
|
|
40082
|
-
|
|
40118
|
+
const candidates = gateway ? [gateway] : resolveLatchGatewayCandidates({ env });
|
|
40119
|
+
let failure2 = null;
|
|
40120
|
+
for (const candidate of candidates) {
|
|
40121
|
+
try {
|
|
40122
|
+
const capabilities = await readLatchGatewayCapabilities({
|
|
40123
|
+
gateway: candidate,
|
|
40124
|
+
fetchImpl,
|
|
40125
|
+
timeoutMs
|
|
40126
|
+
});
|
|
40127
|
+
if (capabilities.protocolVersion !== SUPPORTED_LATCH_PROTOCOL_VERSION) {
|
|
40128
|
+
throw new LatchGatewayError(`Latch gateway protocolVersion ${capabilities.protocolVersion} is not supported (need ${SUPPORTED_LATCH_PROTOCOL_VERSION}).`);
|
|
40129
|
+
}
|
|
40130
|
+
if (!capabilities.endpoints.conversation) {
|
|
40131
|
+
throw new LatchGatewayError("This Latch gateway does not serve the conversation endpoint.");
|
|
40132
|
+
}
|
|
40133
|
+
return { gateway: candidate, capabilities };
|
|
40134
|
+
} catch (error62) {
|
|
40135
|
+
failure2 ??= error62 instanceof LatchGatewayError ? error62 : new LatchGatewayError("Latch's gateway could not be reached.");
|
|
40136
|
+
}
|
|
40083
40137
|
}
|
|
40084
|
-
|
|
40138
|
+
throw failure2 ?? new LatchGatewayError("Latch's gateway could not be reached.");
|
|
40085
40139
|
}
|
|
40086
40140
|
function latchConversationSocketUrl({ gateway, providerSessionId }) {
|
|
40087
40141
|
const base = new URL(gateway.baseUrl);
|
|
@@ -40092,7 +40146,7 @@ function latchConversationSocketUrl({ gateway, providerSessionId }) {
|
|
|
40092
40146
|
function latchConversationSubprotocol(gateway) {
|
|
40093
40147
|
return `${LATCH_GATEWAY_SUBPROTOCOL_PREFIX}${gateway.token}`;
|
|
40094
40148
|
}
|
|
40095
|
-
var DEFAULT_LATCH_GATEWAY_URL, LATCH_GATEWAY_SUBPROTOCOL_PREFIX, LATCH_SERVE_TOKEN_FILENAME, LATCH_GATEWAY_PROBE_TIMEOUT_MS, LatchGatewayError;
|
|
40149
|
+
var DEFAULT_LATCH_GATEWAY_URL, LATCH_GATEWAY_SUBPROTOCOL_PREFIX, LATCH_SERVE_TOKEN_FILENAME, LATCH_GATEWAY_PROBE_TIMEOUT_MS, LatchGatewayError, LATCH_REMOTE_LINK_RUNTIME_PATH, LATCH_REMOTE_LINK_READY_FILENAME, LATCH_REMOTE_LINK_TOKEN_FILENAME;
|
|
40096
40150
|
var init_latch_gateway = __esm({
|
|
40097
40151
|
"../packages/core/dist/service/latch-gateway.js"() {
|
|
40098
40152
|
"use strict";
|
|
@@ -40107,6 +40161,9 @@ var init_latch_gateway = __esm({
|
|
|
40107
40161
|
this.name = "LatchGatewayError";
|
|
40108
40162
|
}
|
|
40109
40163
|
};
|
|
40164
|
+
LATCH_REMOTE_LINK_RUNTIME_PATH = ["remote-access", "runtime"];
|
|
40165
|
+
LATCH_REMOTE_LINK_READY_FILENAME = "remote-link-gateway-ready.json";
|
|
40166
|
+
LATCH_REMOTE_LINK_TOKEN_FILENAME = "remote-link-gateway.token";
|
|
40110
40167
|
}
|
|
40111
40168
|
});
|
|
40112
40169
|
|
|
@@ -40370,6 +40427,7 @@ async function inspectLatchSession({ executable = "latch", providerSessionId })
|
|
|
40370
40427
|
name: trimmed6(report.name) ?? sessionId,
|
|
40371
40428
|
state,
|
|
40372
40429
|
exitCode: typeof exit?.code === "number" && Number.isFinite(exit.code) ? exit.code : null,
|
|
40430
|
+
endedAt: typeof exit?.exitedAt === "string" ? exit.exitedAt : typeof exit?.exited_at === "string" ? exit.exited_at : null,
|
|
40373
40431
|
inspectedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
40374
40432
|
};
|
|
40375
40433
|
}
|
|
@@ -40456,7 +40514,7 @@ function refusalReason(state) {
|
|
|
40456
40514
|
return "The Latch session is unavailable.";
|
|
40457
40515
|
return "Latch is not accepting messages for this session.";
|
|
40458
40516
|
}
|
|
40459
|
-
async function sendLatchMessage({ providerSessionId, operationId, text, waitForIdleMs = DEFAULT_LATCH_SEND_WAIT_MS, gateway = null, env, fetchImpl, connect = defaultLatchConversationConnect, now = () => /* @__PURE__ */ new Date() }) {
|
|
40517
|
+
async function sendLatchMessage({ providerSessionId, operationId, text, waitForIdleMs = DEFAULT_LATCH_SEND_WAIT_MS, previousOperationId = null, notAfter = null, gateway = null, env, fetchImpl, connect = defaultLatchConversationConnect, now = () => /* @__PURE__ */ new Date() }) {
|
|
40460
40518
|
const sessionId = trimmed6(providerSessionId);
|
|
40461
40519
|
if (!sessionId)
|
|
40462
40520
|
throw new LatchSessionCommandError("A Latch session id is required.");
|
|
@@ -40470,6 +40528,17 @@ async function sendLatchMessage({ providerSessionId, operationId, text, waitForI
|
|
|
40470
40528
|
throw new LatchSessionCommandError(`An answer may be at most ${LATCH_MESSAGE_MAX_LENGTH} characters.`);
|
|
40471
40529
|
}
|
|
40472
40530
|
const idleBudgetMs = typeof waitForIdleMs === "number" && Number.isFinite(waitForIdleMs) && waitForIdleMs >= 0 ? Math.trunc(waitForIdleMs) : DEFAULT_LATCH_SEND_WAIT_MS;
|
|
40531
|
+
const previousOpId = trimmed6(previousOperationId);
|
|
40532
|
+
const deadlineMs = trimmed6(notAfter) ? Date.parse(trimmed6(notAfter)) : Number.NaN;
|
|
40533
|
+
if (!Number.isNaN(deadlineMs) && now().getTime() > deadlineMs) {
|
|
40534
|
+
return {
|
|
40535
|
+
providerSessionId: sessionId,
|
|
40536
|
+
operationId: opId,
|
|
40537
|
+
status: "refused",
|
|
40538
|
+
reason: "The delivery deadline passed before the answer could be sent.",
|
|
40539
|
+
deliveredAt: now().toISOString()
|
|
40540
|
+
};
|
|
40541
|
+
}
|
|
40473
40542
|
let resolved;
|
|
40474
40543
|
try {
|
|
40475
40544
|
resolved = await requireLatchConversationGateway({ gateway, env, fetchImpl });
|
|
@@ -40483,20 +40552,24 @@ async function sendLatchMessage({ providerSessionId, operationId, text, waitForI
|
|
|
40483
40552
|
}),
|
|
40484
40553
|
operationId: opId,
|
|
40485
40554
|
text: body,
|
|
40486
|
-
idleBudgetMs
|
|
40555
|
+
idleBudgetMs,
|
|
40556
|
+
previousOperationId: previousOpId && previousOpId !== opId ? previousOpId : null
|
|
40487
40557
|
});
|
|
40488
40558
|
return {
|
|
40489
40559
|
providerSessionId: sessionId,
|
|
40490
40560
|
operationId: opId,
|
|
40491
40561
|
status: status.status,
|
|
40492
40562
|
reason: status.reason,
|
|
40493
|
-
deliveredAt: now().toISOString()
|
|
40563
|
+
deliveredAt: now().toISOString(),
|
|
40564
|
+
...status.reconciled ? { reconciled: true } : {}
|
|
40494
40565
|
};
|
|
40495
40566
|
}
|
|
40496
|
-
function runConversationOperation({ socket, operationId, text, idleBudgetMs }) {
|
|
40567
|
+
function runConversationOperation({ socket, operationId, text, idleBudgetMs, previousOperationId = null }) {
|
|
40497
40568
|
return new Promise((resolve, reject) => {
|
|
40498
40569
|
let settled = false;
|
|
40499
40570
|
let sent = false;
|
|
40571
|
+
let awaitingReceipt = previousOperationId !== null;
|
|
40572
|
+
let receiptTimer = null;
|
|
40500
40573
|
let epoch = null;
|
|
40501
40574
|
const timers = [];
|
|
40502
40575
|
let idleTimer = null;
|
|
@@ -40557,7 +40630,7 @@ function runConversationOperation({ socket, operationId, text, idleBudgetMs }) {
|
|
|
40557
40630
|
};
|
|
40558
40631
|
const applyState = (state) => {
|
|
40559
40632
|
lastState = state;
|
|
40560
|
-
if (sent || settled)
|
|
40633
|
+
if (sent || settled || awaitingReceipt)
|
|
40561
40634
|
return;
|
|
40562
40635
|
if (state.sendMessage.enabled) {
|
|
40563
40636
|
deliver();
|
|
@@ -40598,6 +40671,19 @@ function runConversationOperation({ socket, operationId, text, idleBudgetMs }) {
|
|
|
40598
40671
|
abort("Latch returned an unsupported conversation state.");
|
|
40599
40672
|
return;
|
|
40600
40673
|
}
|
|
40674
|
+
if (awaitingReceipt && receiptTimer === null) {
|
|
40675
|
+
lastState = state;
|
|
40676
|
+
try {
|
|
40677
|
+
socket.send(JSON.stringify({ type: "operation_status", operationId: previousOperationId }));
|
|
40678
|
+
} catch {
|
|
40679
|
+
abort("The earlier delivery could not be checked with Latch.");
|
|
40680
|
+
return;
|
|
40681
|
+
}
|
|
40682
|
+
receiptTimer = arm(() => {
|
|
40683
|
+
abort("Latch did not report on the earlier delivery in time.");
|
|
40684
|
+
}, LATCH_OPERATION_STATUS_TIMEOUT_MS);
|
|
40685
|
+
return;
|
|
40686
|
+
}
|
|
40601
40687
|
applyState(state);
|
|
40602
40688
|
return;
|
|
40603
40689
|
}
|
|
@@ -40608,9 +40694,36 @@ function runConversationOperation({ socket, operationId, text, idleBudgetMs }) {
|
|
|
40608
40694
|
return;
|
|
40609
40695
|
}
|
|
40610
40696
|
case "operation_result": {
|
|
40697
|
+
if (awaitingReceipt && trimmed6(message.operationId) === previousOperationId) {
|
|
40698
|
+
if (receiptTimer)
|
|
40699
|
+
clearTimeout(receiptTimer);
|
|
40700
|
+
const receipt = trimmed6(message.status);
|
|
40701
|
+
if (receipt === "accepted" || receipt === "queued") {
|
|
40702
|
+
finish({ status: "accepted", reason: null, reconciled: true });
|
|
40703
|
+
return;
|
|
40704
|
+
}
|
|
40705
|
+
if (receipt === "ambiguous") {
|
|
40706
|
+
finish({
|
|
40707
|
+
status: "ambiguous",
|
|
40708
|
+
reason: "Latch has not finished the earlier delivery; nothing was sent again."
|
|
40709
|
+
});
|
|
40710
|
+
return;
|
|
40711
|
+
}
|
|
40712
|
+
awaitingReceipt = false;
|
|
40713
|
+
if (lastState)
|
|
40714
|
+
applyState(lastState);
|
|
40715
|
+
return;
|
|
40716
|
+
}
|
|
40611
40717
|
if (trimmed6(message.operationId) !== operationId)
|
|
40612
40718
|
return;
|
|
40613
40719
|
const status = trimmed6(message.status);
|
|
40720
|
+
if (status === "queued") {
|
|
40721
|
+
finish({
|
|
40722
|
+
status: "accepted",
|
|
40723
|
+
reason: "Latch queued the answer behind the agent's current turn."
|
|
40724
|
+
});
|
|
40725
|
+
return;
|
|
40726
|
+
}
|
|
40614
40727
|
if (status !== "accepted" && status !== "refused" && status !== "ambiguous") {
|
|
40615
40728
|
finish({ status: "ambiguous", reason: "Latch reported an unknown operation status." });
|
|
40616
40729
|
return;
|
|
@@ -40644,7 +40757,7 @@ function runConversationOperation({ socket, operationId, text, idleBudgetMs }) {
|
|
|
40644
40757
|
socket.addEventListener("error", disconnected);
|
|
40645
40758
|
});
|
|
40646
40759
|
}
|
|
40647
|
-
var LatchSessionCommandError, LatchSessionAbsentError, DEFAULT_LATCH_SEND_WAIT_MS, LATCH_CONVERSATION_SNAPSHOT_TIMEOUT_MS, LATCH_OPERATION_RESULT_TIMEOUT_MS, LATCH_MESSAGE_MAX_LENGTH, CONVERSATION_PHASES;
|
|
40760
|
+
var LatchSessionCommandError, LatchSessionAbsentError, DEFAULT_LATCH_SEND_WAIT_MS, LATCH_CONVERSATION_SNAPSHOT_TIMEOUT_MS, LATCH_OPERATION_RESULT_TIMEOUT_MS, LATCH_MESSAGE_MAX_LENGTH, LATCH_OPERATION_STATUS_TIMEOUT_MS, CONVERSATION_PHASES;
|
|
40648
40761
|
var init_latch_session = __esm({
|
|
40649
40762
|
"../packages/core/dist/service/latch-session.js"() {
|
|
40650
40763
|
"use strict";
|
|
@@ -40671,6 +40784,7 @@ var init_latch_session = __esm({
|
|
|
40671
40784
|
LATCH_CONVERSATION_SNAPSHOT_TIMEOUT_MS = 1e4;
|
|
40672
40785
|
LATCH_OPERATION_RESULT_TIMEOUT_MS = 3e4;
|
|
40673
40786
|
LATCH_MESSAGE_MAX_LENGTH = 16384;
|
|
40787
|
+
LATCH_OPERATION_STATUS_TIMEOUT_MS = 1e4;
|
|
40674
40788
|
CONVERSATION_PHASES = [
|
|
40675
40789
|
"starting",
|
|
40676
40790
|
"idle",
|
|
@@ -42356,7 +42470,14 @@ var init_in_process_provider = __esm({
|
|
|
42356
42470
|
*/
|
|
42357
42471
|
async sendLatchMessage(input2) {
|
|
42358
42472
|
try {
|
|
42359
|
-
return ok(this.target, await sendLatchMessage(
|
|
42473
|
+
return ok(this.target, await sendLatchMessage({
|
|
42474
|
+
providerSessionId: input2.providerSessionId,
|
|
42475
|
+
operationId: input2.operationId,
|
|
42476
|
+
text: input2.text,
|
|
42477
|
+
waitForIdleMs: input2.waitForIdleMs,
|
|
42478
|
+
previousOperationId: input2.previousOperationId,
|
|
42479
|
+
notAfter: input2.notAfter
|
|
42480
|
+
}));
|
|
42360
42481
|
} catch (error62) {
|
|
42361
42482
|
return failLatchCommand({
|
|
42362
42483
|
target: this.target,
|
|
@@ -42550,6 +42671,19 @@ var init_requests = __esm({
|
|
|
42550
42671
|
}
|
|
42551
42672
|
});
|
|
42552
42673
|
|
|
42674
|
+
// ../packages/core/dist/service/agent-session/answer-delivery.js
|
|
42675
|
+
var ANSWER_DELIVERY_DEADLINE_MS;
|
|
42676
|
+
var init_answer_delivery = __esm({
|
|
42677
|
+
"../packages/core/dist/service/agent-session/answer-delivery.js"() {
|
|
42678
|
+
"use strict";
|
|
42679
|
+
init_change_feed();
|
|
42680
|
+
init_errors4();
|
|
42681
|
+
init_util3();
|
|
42682
|
+
init_requests();
|
|
42683
|
+
ANSWER_DELIVERY_DEADLINE_MS = 5 * 6e4;
|
|
42684
|
+
}
|
|
42685
|
+
});
|
|
42686
|
+
|
|
42553
42687
|
// ../packages/core/dist/service/context.js
|
|
42554
42688
|
var init_context = __esm({
|
|
42555
42689
|
"../packages/core/dist/service/context.js"() {
|
|
@@ -42597,7 +42731,7 @@ var LOCAL_TARGET_MUTATION_METADATA_KEY;
|
|
|
42597
42731
|
var init_local_target_mutations = __esm({
|
|
42598
42732
|
"../packages/core/dist/service/local-target-mutations.js"() {
|
|
42599
42733
|
"use strict";
|
|
42600
|
-
|
|
42734
|
+
init_answer_delivery();
|
|
42601
42735
|
init_result();
|
|
42602
42736
|
init_types2();
|
|
42603
42737
|
init_change_feed();
|
|
@@ -45060,7 +45194,7 @@ function printProtocolHelp({
|
|
|
45060
45194
|
subcommand
|
|
45061
45195
|
}) {
|
|
45062
45196
|
const subcommands = SUPPORTED_PROTOCOL_SUBCOMMANDS.join(", ");
|
|
45063
|
-
const fullHelp = `${primaryCommand} protocol [flags]
|
|
45197
|
+
const fullHelp = `${primaryCommand} protocol <subcommand> [flags]
|
|
45064
45198
|
|
|
45065
45199
|
Use this for mission lifecycle work from an agent runtime: create a standalone
|
|
45066
45200
|
draft with \`${primaryCommand} protocol create\`, create-and-attach with
|
|
@@ -45077,11 +45211,12 @@ Backend and auth:
|
|
|
45077
45211
|
${primaryCommand} doctor Validate backend reachability and connector installs
|
|
45078
45212
|
|
|
45079
45213
|
To check credentials machine-readably from a script, use
|
|
45080
|
-
\`${primaryCommand} protocol auth-status\` (returns
|
|
45214
|
+
\`${primaryCommand} protocol auth-status\` (returns readiness and workspace metadata).
|
|
45081
45215
|
|
|
45082
45216
|
Project discovery:
|
|
45083
|
-
|
|
45084
|
-
|
|
45217
|
+
create, prompt, and record-work require an explicit --project-id. Discover
|
|
45218
|
+
the intended project first, then pass its projectId to the creation command.
|
|
45219
|
+
Only create accepts --unassigned-to-project for deliberate inbox capture:
|
|
45085
45220
|
|
|
45086
45221
|
${primaryCommand} protocol discover-project
|
|
45087
45222
|
${primaryCommand} protocol discover-project --project-id <id-or-name>
|
|
@@ -45155,7 +45290,8 @@ Runner queue (management commands, not protocol):
|
|
|
45155
45290
|
${primaryCommand} launch <agent> --mission-id <missionId> [--branch <name>] [--no-worktree]
|
|
45156
45291
|
|
|
45157
45292
|
Environment fallback:
|
|
45158
|
-
--session-key <-
|
|
45293
|
+
--session-key <- local session cache for this working directory; or pass the
|
|
45294
|
+
SESSION_KEY printed on stderr after attach/connect/prompt/resume-follow-up
|
|
45159
45295
|
--mission-id <- mission display id (e.g. coo:8) or UUID
|
|
45160
45296
|
--objective-id <- OVERLORD_OBJECTIVE_ID (objective display id, e.g. coo:8.k7xm)
|
|
45161
45297
|
Read commands inherit it only with no explicit mission or a matching
|
|
@@ -45174,14 +45310,23 @@ Common flags:
|
|
|
45174
45310
|
once, and unpinned commands cannot tell them apart.
|
|
45175
45311
|
--session-key <key> Session key returned by attach/connect/prompt/resume-follow-up
|
|
45176
45312
|
--agent <identifier> Agent identifier sent to Overlord (default: unknown)
|
|
45177
|
-
--model <identifier>
|
|
45178
|
-
|
|
45313
|
+
--model <identifier> On attach/resume-follow-up: snapshot the session model;
|
|
45314
|
+
on launch-objective: choose the execution model
|
|
45315
|
+
|
|
45316
|
+
Help and file inputs:
|
|
45317
|
+
${primaryCommand} protocol help <subcommand>
|
|
45318
|
+
${primaryCommand} protocol <subcommand> --help (also -h)
|
|
45319
|
+
Protocol output is JSON by default; --json is unnecessary.
|
|
45320
|
+
Each --*-file reads its own file. At most one may use - for stdin per call.
|
|
45321
|
+
Inline --*-json values are limited to about 8 KB; use the paired file input
|
|
45322
|
+
for larger values. File/stdin content is not interpreted by the shell.
|
|
45179
45323
|
|
|
45180
45324
|
auth-status:
|
|
45181
45325
|
Purpose:
|
|
45182
|
-
|
|
45326
|
+
Read the authenticated backend workspace readiness and actor metadata.
|
|
45183
45327
|
Returns:
|
|
45184
|
-
JSON with
|
|
45328
|
+
JSON with ready, workspaceId, workspaceName, authMode, and actorWorkspaceUserId.
|
|
45329
|
+
Authentication or transport failures exit non-zero. Does not print secrets.
|
|
45185
45330
|
|
|
45186
45331
|
discover-project:
|
|
45187
45332
|
Purpose:
|
|
@@ -45233,9 +45378,12 @@ attach:
|
|
|
45233
45378
|
--agent <identifier>
|
|
45234
45379
|
--model <identifier>
|
|
45235
45380
|
--execution-request-id <id> Link this attach to a runner execution request
|
|
45381
|
+
--execution-target-id <id> Resolve project resource paths for this target
|
|
45382
|
+
--session-channel-id <id> Bind the channel prepared by the launcher
|
|
45236
45383
|
--objective-id <id> Pin attach to this objective (UUID or coo:756.k7xm)
|
|
45237
45384
|
--external-session-id <id> Native agent thread/session id for resume
|
|
45238
45385
|
Notes:
|
|
45386
|
+
--capture-binding is transport metadata computed by the CLI, not a user override.
|
|
45239
45387
|
The CLI records the session's capture binding: bound when OVERLORD_OBJECTIVE_ID
|
|
45240
45388
|
names the attached objective, unbound otherwise. Bound is configuration evidence
|
|
45241
45389
|
only; it never claims the capture hook is installed or has run.
|
|
@@ -45271,6 +45419,7 @@ load-context:
|
|
|
45271
45419
|
Required:
|
|
45272
45420
|
--mission-id <id> Or --objective-id with a display id
|
|
45273
45421
|
Optional:
|
|
45422
|
+
--execution-target-id <id> Resolve project resource paths for this target
|
|
45274
45423
|
--objective-id <id> Return this objective as the current one instead of
|
|
45275
45424
|
rediscovering the mission's active objective. Required
|
|
45276
45425
|
on a mission running objectives in parallel.
|
|
@@ -45328,7 +45477,7 @@ reorder-objectives:
|
|
|
45328
45477
|
objectives. Launching, active, and complete objectives keep their positions.
|
|
45329
45478
|
Required:
|
|
45330
45479
|
--mission-id <uuid>
|
|
45331
|
-
--ordered-objective-ids-json <json>
|
|
45480
|
+
--ordered-objective-ids-json <json> or --ordered-objective-ids-file <path|->
|
|
45332
45481
|
Returns:
|
|
45333
45482
|
The mission's full ObjectiveDto[] list in its new order.
|
|
45334
45483
|
Rules:
|
|
@@ -45356,10 +45505,9 @@ reorder-run-queue:
|
|
|
45356
45505
|
execution target.
|
|
45357
45506
|
Required:
|
|
45358
45507
|
--queue <id|name> Queue UUID or unambiguous name
|
|
45359
|
-
--ordered-entries-json <json>
|
|
45508
|
+
--ordered-entries-json <json> or --ordered-entries-file <path|->
|
|
45509
|
+
Complete top-to-bottom entry order
|
|
45360
45510
|
Optional:
|
|
45361
|
-
--ordered-entries-file <path|->
|
|
45362
|
-
Read the JSON order from a file or stdin
|
|
45363
45511
|
--project-id <id|slug|name> Project UUID, slug, or name
|
|
45364
45512
|
--objective-id <id> Derive the project from this objective
|
|
45365
45513
|
--mission-id <id> Derive the project from this mission
|
|
@@ -45375,7 +45523,7 @@ create-run-queue:
|
|
|
45375
45523
|
Purpose:
|
|
45376
45524
|
Create an additional Run Queue alongside the project's default queue.
|
|
45377
45525
|
Required:
|
|
45378
|
-
--project-id <id|slug|name> Project UUID, slug, or name
|
|
45526
|
+
--project-id <id|slug|name> Project UUID, slug, or name; or derive via --objective-id/--mission-id
|
|
45379
45527
|
--name <text> Name for the new queue
|
|
45380
45528
|
Optional:
|
|
45381
45529
|
--objective-id <id> Derive the project from this objective
|
|
@@ -45431,11 +45579,10 @@ reorder-project-run-queues:
|
|
|
45431
45579
|
Reorder the project's Run Queue definitions without touching entry
|
|
45432
45580
|
membership or entry order.
|
|
45433
45581
|
Required:
|
|
45434
|
-
--project-id <id|slug|name> Project UUID, slug, or name
|
|
45435
|
-
--ordered-queues-json <json>
|
|
45582
|
+
--project-id <id|slug|name> Project UUID, slug, or name; or derive via --objective-id/--mission-id
|
|
45583
|
+
--ordered-queues-json <json> or --ordered-queues-file <path|->
|
|
45584
|
+
Complete top-to-bottom queue order
|
|
45436
45585
|
Optional:
|
|
45437
|
-
--ordered-queues-file <path|->
|
|
45438
|
-
Read the JSON order from a file or stdin
|
|
45439
45586
|
--objective-id <id> Derive the project from this objective
|
|
45440
45587
|
--mission-id <id> Derive the project from this mission
|
|
45441
45588
|
Returns:
|
|
@@ -45457,9 +45604,10 @@ queue-objective:
|
|
|
45457
45604
|
--front Place first in the selected/default queue
|
|
45458
45605
|
--position <n> One-based insertion rank
|
|
45459
45606
|
Rules:
|
|
45460
|
-
Choose at most one of --after, --front, and --position.
|
|
45461
|
-
--
|
|
45462
|
-
|
|
45607
|
+
Choose at most one of --after, --front, and --position. Queue selection prefers
|
|
45608
|
+
--queue, then the predecessor's queue, then the objective's current queue.
|
|
45609
|
+
Otherwise use the mission queue, falling back to the project default; if neither
|
|
45610
|
+
exists, create the mission queue. Re-running without placement is idempotent.
|
|
45463
45611
|
Queueing an objective also queues every not-yet-started objective after it
|
|
45464
45612
|
in the mission, directly behind it. Queue order and mission objective order
|
|
45465
45613
|
are one sequence: reordering either reorders the other.
|
|
@@ -45547,7 +45695,7 @@ statuses:
|
|
|
45547
45695
|
|
|
45548
45696
|
discuss-objective:
|
|
45549
45697
|
Purpose:
|
|
45550
|
-
Mark the
|
|
45698
|
+
Mark the selected draft objective (or first draft by position) as submitted. Does not start execution \u2014 use attach.
|
|
45551
45699
|
Required:
|
|
45552
45700
|
--mission-id <id>
|
|
45553
45701
|
Optional:
|
|
@@ -45659,6 +45807,8 @@ create:
|
|
|
45659
45807
|
--objective "<text>" or --objectives-json / --objectives-file <path|->
|
|
45660
45808
|
Optional:
|
|
45661
45809
|
--title <text>
|
|
45810
|
+
--resource <key> Resource key for the single --objective form;
|
|
45811
|
+
use resourceKey on each --objectives-json item
|
|
45662
45812
|
--project-id <id> Required for a project mission; never inferred
|
|
45663
45813
|
--unassigned-to-project Intentionally create an account-owned inbox item
|
|
45664
45814
|
--assigned-to <id> Workspace member to own the mission (meaningless on the inbox fallback)
|
|
@@ -45691,8 +45841,9 @@ prompt:
|
|
|
45691
45841
|
--project-id <id>
|
|
45692
45842
|
Optional:
|
|
45693
45843
|
--title <text>
|
|
45844
|
+
--resource <key> Resource key for the single --objective form;
|
|
45845
|
+
use resourceKey on each --objectives-json item
|
|
45694
45846
|
--agent <identifier>
|
|
45695
|
-
--model <identifier>
|
|
45696
45847
|
--external-session-id <id>
|
|
45697
45848
|
--assigned-to <id> Workspace member to own the mission
|
|
45698
45849
|
--auto-advance / --no-auto-advance
|
|
@@ -45721,7 +45872,7 @@ record-work:
|
|
|
45721
45872
|
Optional:
|
|
45722
45873
|
--title <text>
|
|
45723
45874
|
--assigned-to <id> Workspace member to own the mission
|
|
45724
|
-
--artifacts
|
|
45875
|
+
--artifacts <json> / --artifacts-file <path|->
|
|
45725
45876
|
--declared-paths-json / --declared-paths-file <path|->
|
|
45726
45877
|
JSON array of repository-relative paths the work changed
|
|
45727
45878
|
--payload-json / --payload-file <path|-> (single envelope; see Notes)
|
|
@@ -45743,6 +45894,8 @@ update:
|
|
|
45743
45894
|
--mission-id <id>
|
|
45744
45895
|
--summary or --summary-file <path|->
|
|
45745
45896
|
Optional:
|
|
45897
|
+
--declared-paths-json <json> / --declared-paths-file <path|->
|
|
45898
|
+
Repository-relative paths as a JSON string array
|
|
45746
45899
|
--phase draft | execute | review | deliver | complete | blocked | cancelled
|
|
45747
45900
|
--event-type update | user_follow_up | alert | discussion_summary | decision
|
|
45748
45901
|
--begin-follow-up-work Reopen a delivered/review mission for execution
|
|
@@ -45752,6 +45905,8 @@ update:
|
|
|
45752
45905
|
--external-session-id <id|null>
|
|
45753
45906
|
--paths <a,b,c> / --paths-file <path|-> Declare shell/script outputs (see deliver)
|
|
45754
45907
|
Notes:
|
|
45908
|
+
--options-json, --options-file, and --no-free-text are reserved contract flags
|
|
45909
|
+
with no effect on update; use ask for structured choices.
|
|
45755
45910
|
Pass --summary-file - to read the summary from stdin and avoid shell quoting issues.
|
|
45756
45911
|
Inline --*-json values larger than ~8 KB are rejected; use the paired --*-file - flag.
|
|
45757
45912
|
After delivery, pass --begin-follow-up-work before posting execution updates.
|
|
@@ -45765,6 +45920,9 @@ heartbeat:
|
|
|
45765
45920
|
Optional:
|
|
45766
45921
|
--phase <phase>
|
|
45767
45922
|
--note <text>
|
|
45923
|
+
Notes:
|
|
45924
|
+
--percent is reserved in the contract but is not consumed by the handler.
|
|
45925
|
+
Use --note for progress detail.
|
|
45768
45926
|
|
|
45769
45927
|
ask:
|
|
45770
45928
|
Purpose:
|
|
@@ -45785,7 +45943,7 @@ deliver:
|
|
|
45785
45943
|
--session-key <key>
|
|
45786
45944
|
--mission-id <id>
|
|
45787
45945
|
--summary or --summary-file <path|->
|
|
45788
|
-
or: --payload-json / --payload-file <path|-> with { summary, artifacts }
|
|
45946
|
+
or: --payload-json / --payload-file <path|-> with { summary, artifacts? }
|
|
45789
45947
|
The payload may also include deliveryReport: { schemaVersion: 1, agentReport: {
|
|
45790
45948
|
humanActions, tradeoffsMade, knownRisks, deferredWork, assumptions } }. Use empty arrays
|
|
45791
45949
|
when none apply. Human actions exclude Git operations and routine review/testing.
|
|
@@ -45812,7 +45970,9 @@ deliver:
|
|
|
45812
45970
|
migrations, .env.example edits, dependency manifests, and CI workflow files on its own;
|
|
45813
45971
|
report those yourself when you can supply the real command and verify step.
|
|
45814
45972
|
Optional:
|
|
45815
|
-
--
|
|
45973
|
+
--declared-paths-json <json> / --declared-paths-file <path|->
|
|
45974
|
+
Repository-relative paths as a JSON string array
|
|
45975
|
+
--artifacts <json> / --artifacts-file <path|->
|
|
45816
45976
|
--paths <a,b,c> Declare paths native capture missed (comma-separated)
|
|
45817
45977
|
--paths-file <path|-> Same, as a JSON array of path strings (commas allowed)
|
|
45818
45978
|
--verification-summary <text>
|
|
@@ -45858,7 +46018,7 @@ deliver:
|
|
|
45858
46018
|
copy: repeat those declarations on update/deliver. objective-changes reads the
|
|
45859
46019
|
synchronized server evidence; changes reads only this checkout's ledgers.
|
|
45860
46020
|
Inline --*-json values larger than ~8 KB are rejected; use --payload-file - and
|
|
45861
|
-
stream JSON on stdin
|
|
46021
|
+
stream JSON on stdin; the envelope may carry summary too.
|
|
45862
46022
|
|
|
45863
46023
|
capture-change:
|
|
45864
46024
|
Purpose:
|
|
@@ -45909,6 +46069,9 @@ sync-changes:
|
|
|
45909
46069
|
--objective-id <id> Objective UUID or display id
|
|
45910
46070
|
--changes-json <json> or --changes-file <path|->
|
|
45911
46071
|
Explicit evidence batch; normally omitted so the CLI drains its ledger
|
|
46072
|
+
--capture-json <json> or --capture-file <path|->
|
|
46073
|
+
Capture diagnostics: bindingState, callbackObservedAt,
|
|
46074
|
+
and health entries { code, at }; metadata only
|
|
45912
46075
|
Returns:
|
|
45913
46076
|
Per-item accepted, ignored, or warning results. Synchronization failures are
|
|
45914
46077
|
advisory and never block update or delivery.
|
|
@@ -45919,6 +46082,7 @@ resume-follow-up:
|
|
|
45919
46082
|
Required:
|
|
45920
46083
|
--mission-id <id>
|
|
45921
46084
|
Optional:
|
|
46085
|
+
--execution-target-id <id> Resolve project resource paths for this target
|
|
45922
46086
|
--objective-id <id>
|
|
45923
46087
|
--agent <identifier>
|
|
45924
46088
|
--model <identifier>
|
|
@@ -46039,11 +46203,16 @@ ${subcommand}:
|
|
|
46039
46203
|
const nextSection = remaining.slice(marker.length - 1).search(/\n[a-z][a-z-]+:\n/);
|
|
46040
46204
|
const sectionEnd = nextSection === -1 ? remaining.indexOf("\nSupported subcommands:") : marker.length - 1 + nextSection;
|
|
46041
46205
|
const section = (sectionEnd === -1 ? remaining : remaining.slice(0, sectionEnd)).trimEnd();
|
|
46206
|
+
const commonStart = fullHelp.indexOf("\nEnvironment fallback:");
|
|
46207
|
+
const commonEnd = fullHelp.indexOf("\nauth-status:\n", commonStart);
|
|
46208
|
+
const commonHelp = fullHelp.slice(commonStart, commonEnd).trim();
|
|
46042
46209
|
console.log(`${primaryCommand} protocol ${subcommand}
|
|
46043
46210
|
|
|
46044
|
-
${section}
|
|
46211
|
+
${section}
|
|
46212
|
+
|
|
46213
|
+
${commonHelp}`);
|
|
46045
46214
|
}
|
|
46046
|
-
var SUPPORTED_PROTOCOL_SUBCOMMANDS
|
|
46215
|
+
var SUPPORTED_PROTOCOL_SUBCOMMANDS;
|
|
46047
46216
|
var init_protocol_help = __esm({
|
|
46048
46217
|
"src/protocol-help.ts"() {
|
|
46049
46218
|
"use strict";
|
|
@@ -46094,7 +46263,6 @@ var init_protocol_help = __esm({
|
|
|
46094
46263
|
"update-run-queue",
|
|
46095
46264
|
"write-context"
|
|
46096
46265
|
];
|
|
46097
|
-
DEFAULT_TIMEOUT_MS2 = 3e4;
|
|
46098
46266
|
}
|
|
46099
46267
|
});
|
|
46100
46268
|
|