overlord-cli 0.2611181900.0 → 0.2611201138.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/VERSION +1 -1
- package/dist/connectors/adapters/antigravity/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/antigravity/plugin.json +1 -1
- package/dist/connectors/adapters/claude/.claude-plugin/plugin.json +1 -1
- package/dist/connectors/adapters/claude/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/codex/.codex-plugin/plugin.json +1 -1
- package/dist/connectors/adapters/codex/conformance-manifest.yaml +1 -1
- package/dist/connectors/adapters/cursor/.cursor-plugin/plugin.json +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/connectors/core/overlord-mission/SKILL.md +24 -20
- package/dist/connectors/core/overlord-mission/reference/cli.md +11 -12
- package/dist/connectors/core/overlord-mission/reference/mcp.md +1 -1
- package/dist/connectors/core/scripts/overlord-mcp.mjs +31 -29
- package/dist/index.js +500 -380
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -136,17 +136,16 @@ function isExecutionRequestAlreadyLinkedError(error62) {
|
|
|
136
136
|
function formatExecutionRequestAlreadyLinkedDiagnostic() {
|
|
137
137
|
return [
|
|
138
138
|
"Attach was rejected because this execution request is already linked to another mission session (`execution_request_already_linked`).",
|
|
139
|
-
"
|
|
140
|
-
"Recovery: retry `ovld protocol attach` without `--execution-request-id` (unset OVERLORD_EXECUTION_REQUEST_ID). The existing session remains bound to the request; a new attach can continue the objective without relinking it."
|
|
139
|
+
"Use the existing key if that protocol session is still active. For a completed objective, wait for an explicit follow-up request, then run `ovld protocol resume-follow-up --mission-id <mission-id> --objective-id <objective-id>`."
|
|
141
140
|
].join("\n");
|
|
142
141
|
}
|
|
143
142
|
function formatCliError(error62) {
|
|
144
|
-
if (isExecutionRequestAlreadyLinkedError(error62)) {
|
|
145
|
-
return redactSecrets(formatExecutionRequestAlreadyLinkedDiagnostic());
|
|
146
|
-
}
|
|
147
143
|
if (error62 instanceof CliError) {
|
|
148
144
|
return redactSecrets(error62.message);
|
|
149
145
|
}
|
|
146
|
+
if (isExecutionRequestAlreadyLinkedError(error62)) {
|
|
147
|
+
return redactSecrets(formatExecutionRequestAlreadyLinkedDiagnostic());
|
|
148
|
+
}
|
|
150
149
|
if (error62 instanceof Error) {
|
|
151
150
|
return redactSecrets(error62.message);
|
|
152
151
|
}
|
|
@@ -24589,10 +24588,8 @@ Start the Desktop/local backend or run \`ovld config set cloud <url>\`.
|
|
|
24589
24588
|
}
|
|
24590
24589
|
const payload = response.ok && responseType === "bytes" ? Buffer.from(await response.arrayBuffer()) : await readResponseJson2(response);
|
|
24591
24590
|
if (!response.ok) {
|
|
24592
|
-
|
|
24593
|
-
|
|
24594
|
-
}
|
|
24595
|
-
if (response.status === 401 && auth.headers.Authorization) {
|
|
24591
|
+
const invalidProtocolSession = path41.startsWith("/api/protocol/") && payload !== null && typeof payload === "object" && "code" in payload && payload.code === "invalid_session";
|
|
24592
|
+
if (response.status === 401 && auth.headers.Authorization && !invalidProtocolSession && !isExecutionRequestAlreadyLinkedPayload(payload)) {
|
|
24596
24593
|
const detail = errorMessageFromJson2(payload) ?? `Backend request failed: ${method} ${path41} (${response.status})`;
|
|
24597
24594
|
throw new CliError({
|
|
24598
24595
|
status: response.status,
|
|
@@ -25668,297 +25665,23 @@ var init_user_token = __esm({
|
|
|
25668
25665
|
}
|
|
25669
25666
|
});
|
|
25670
25667
|
|
|
25671
|
-
// src/project-tmp.ts
|
|
25672
|
-
var project_tmp_exports = {};
|
|
25673
|
-
__export(project_tmp_exports, {
|
|
25674
|
-
PROJECT_TMP_RETENTION_MS: () => PROJECT_TMP_RETENTION_MS,
|
|
25675
|
-
PROJECT_TMP_SESSIONS_DIRNAME: () => PROJECT_TMP_SESSIONS_DIRNAME,
|
|
25676
|
-
PROJECT_TMP_SESSION_RETENTION_MS: () => PROJECT_TMP_SESSION_RETENTION_MS,
|
|
25677
|
-
ensureProjectTmpDir: () => ensureProjectTmpDir,
|
|
25678
|
-
isSessionScratchDir: () => isSessionScratchDir,
|
|
25679
|
-
projectTmpDir: () => projectTmpDir,
|
|
25680
|
-
projectTmpSessionsDir: () => projectTmpSessionsDir,
|
|
25681
|
-
pruneProjectTmpContents: () => pruneProjectTmpContents,
|
|
25682
|
-
pruneStaleProjectTmp: () => pruneStaleProjectTmp,
|
|
25683
|
-
removeSessionScratch: () => removeSessionScratch,
|
|
25684
|
-
safeTmpNamePart: () => safeTmpNamePart,
|
|
25685
|
-
sessionScratchName: () => sessionScratchName
|
|
25686
|
-
});
|
|
25687
|
-
import {
|
|
25688
|
-
existsSync as existsSync8,
|
|
25689
|
-
lstatSync as lstatSync2,
|
|
25690
|
-
mkdirSync as mkdirSync4,
|
|
25691
|
-
readdirSync as readdirSync2,
|
|
25692
|
-
rmSync as rmSync2,
|
|
25693
|
-
unlinkSync as unlinkSync2
|
|
25694
|
-
} from "node:fs";
|
|
25695
|
-
import path8 from "node:path";
|
|
25696
|
-
function projectTmpDir(workingDirectory) {
|
|
25697
|
-
return path8.join(workingDirectory, ".overlord", "tmp");
|
|
25698
|
-
}
|
|
25699
|
-
function projectTmpSessionsDir(workingDirectory) {
|
|
25700
|
-
return path8.join(projectTmpDir(workingDirectory), PROJECT_TMP_SESSIONS_DIRNAME);
|
|
25701
|
-
}
|
|
25702
|
-
function safeTmpNamePart(value2) {
|
|
25703
|
-
return value2.replace(/[^a-zA-Z0-9_-]/g, "-").replace(/^-+|-+$/g, "");
|
|
25704
|
-
}
|
|
25705
|
-
function sessionScratchName({
|
|
25706
|
-
missionDisplayId: missionDisplayId2,
|
|
25707
|
-
objectiveDisplayId,
|
|
25708
|
-
executionRequestId
|
|
25709
|
-
}) {
|
|
25710
|
-
const identity = objectiveDisplayId?.trim() ? `objective-${safeTmpNamePart(objectiveDisplayId)}` : `mission-${safeTmpNamePart(missionDisplayId2)}`;
|
|
25711
|
-
const request = executionRequestId?.trim() ? safeTmpNamePart(executionRequestId) : `${process.pid}`;
|
|
25712
|
-
return `${identity || "launch"}-${request || "launch"}`;
|
|
25713
|
-
}
|
|
25714
|
-
function isSessionScratchDir(workingDirectory, candidate) {
|
|
25715
|
-
const sessionsDir = path8.resolve(projectTmpSessionsDir(workingDirectory));
|
|
25716
|
-
const resolved = path8.resolve(candidate);
|
|
25717
|
-
return path8.dirname(resolved) === sessionsDir && path8.basename(resolved).length > 0;
|
|
25718
|
-
}
|
|
25719
|
-
function removeSessionScratch({
|
|
25720
|
-
workingDirectory,
|
|
25721
|
-
scratchDir,
|
|
25722
|
-
contextFile
|
|
25723
|
-
}) {
|
|
25724
|
-
const removed = [];
|
|
25725
|
-
if (scratchDir?.trim() && isSessionScratchDir(workingDirectory, scratchDir)) {
|
|
25726
|
-
try {
|
|
25727
|
-
if (existsSync8(scratchDir)) {
|
|
25728
|
-
rmSync2(scratchDir, { recursive: true, force: true });
|
|
25729
|
-
removed.push(scratchDir);
|
|
25730
|
-
}
|
|
25731
|
-
} catch {
|
|
25732
|
-
}
|
|
25733
|
-
}
|
|
25734
|
-
if (contextFile?.trim()) {
|
|
25735
|
-
const tmpDir = path8.resolve(projectTmpDir(workingDirectory));
|
|
25736
|
-
const resolved = path8.resolve(contextFile);
|
|
25737
|
-
if (path8.dirname(resolved) === tmpDir && resolved.endsWith(".md")) {
|
|
25738
|
-
try {
|
|
25739
|
-
if (existsSync8(resolved)) {
|
|
25740
|
-
unlinkSync2(resolved);
|
|
25741
|
-
removed.push(resolved);
|
|
25742
|
-
}
|
|
25743
|
-
} catch {
|
|
25744
|
-
}
|
|
25745
|
-
}
|
|
25746
|
-
}
|
|
25747
|
-
return { removed };
|
|
25748
|
-
}
|
|
25749
|
-
function ensureProjectTmpDir(workingDirectory) {
|
|
25750
|
-
const tmpDir = projectTmpDir(workingDirectory);
|
|
25751
|
-
mkdirSync4(tmpDir, { recursive: true });
|
|
25752
|
-
return tmpDir;
|
|
25753
|
-
}
|
|
25754
|
-
function pruneStaleProjectTmp({
|
|
25755
|
-
workingDirectory,
|
|
25756
|
-
create = false,
|
|
25757
|
-
now = Date.now(),
|
|
25758
|
-
retentionMs = PROJECT_TMP_RETENTION_MS,
|
|
25759
|
-
sessionRetentionMs = PROJECT_TMP_SESSION_RETENTION_MS,
|
|
25760
|
-
isSessionLive = () => false
|
|
25761
|
-
}) {
|
|
25762
|
-
const tmpDir = projectTmpDir(workingDirectory);
|
|
25763
|
-
if (!create && !existsSync8(tmpDir)) return;
|
|
25764
|
-
if (create) ensureProjectTmpDir(workingDirectory);
|
|
25765
|
-
const cutoff = now - retentionMs;
|
|
25766
|
-
pruneChildren(tmpDir, cutoff, {
|
|
25767
|
-
sessionsDir: projectTmpSessionsDir(workingDirectory),
|
|
25768
|
-
sessionCutoff: now - sessionRetentionMs,
|
|
25769
|
-
isSessionLive
|
|
25770
|
-
});
|
|
25771
|
-
}
|
|
25772
|
-
function pruneProjectTmpContents(workingDirectory, {
|
|
25773
|
-
isSessionLive = () => false,
|
|
25774
|
-
force = false
|
|
25775
|
-
} = {}) {
|
|
25776
|
-
const overlordDir = path8.join(workingDirectory, ".overlord");
|
|
25777
|
-
if (!existsSync8(overlordDir)) {
|
|
25778
|
-
return { warned: true, removedCount: 0, skippedCount: 0 };
|
|
25779
|
-
}
|
|
25780
|
-
const tmpDir = projectTmpDir(workingDirectory);
|
|
25781
|
-
if (!existsSync8(tmpDir)) {
|
|
25782
|
-
return { warned: false, removedCount: 0, skippedCount: 0 };
|
|
25783
|
-
}
|
|
25784
|
-
let removedCount = 0;
|
|
25785
|
-
let skippedCount = 0;
|
|
25786
|
-
const entries = readdirSync2(tmpDir, { withFileTypes: true, encoding: "utf8" });
|
|
25787
|
-
for (const entry of entries) {
|
|
25788
|
-
const target = path8.join(tmpDir, entry.name);
|
|
25789
|
-
if (entry.name === PROJECT_TMP_SESSIONS_DIRNAME && entry.isDirectory() && !force) {
|
|
25790
|
-
for (const session of readdirSync2(target, { withFileTypes: true, encoding: "utf8" })) {
|
|
25791
|
-
if (session.isDirectory() && isSessionLive(session.name)) {
|
|
25792
|
-
skippedCount += 1;
|
|
25793
|
-
continue;
|
|
25794
|
-
}
|
|
25795
|
-
removeEntry(path8.join(target, session.name), session.isSymbolicLink());
|
|
25796
|
-
removedCount += 1;
|
|
25797
|
-
}
|
|
25798
|
-
continue;
|
|
25799
|
-
}
|
|
25800
|
-
removeEntry(target, entry.isSymbolicLink());
|
|
25801
|
-
removedCount += 1;
|
|
25802
|
-
}
|
|
25803
|
-
return { warned: false, removedCount, skippedCount };
|
|
25804
|
-
}
|
|
25805
|
-
function removeEntry(target, isSymbolicLink) {
|
|
25806
|
-
if (isSymbolicLink) {
|
|
25807
|
-
unlinkSync2(target);
|
|
25808
|
-
return;
|
|
25809
|
-
}
|
|
25810
|
-
rmSync2(target, { recursive: true, force: true });
|
|
25811
|
-
}
|
|
25812
|
-
function pruneSessionDirs(sessionsDir, options) {
|
|
25813
|
-
let entries;
|
|
25814
|
-
try {
|
|
25815
|
-
entries = readdirSync2(sessionsDir, { withFileTypes: true, encoding: "utf8" });
|
|
25816
|
-
} catch {
|
|
25817
|
-
return;
|
|
25818
|
-
}
|
|
25819
|
-
for (const entry of entries) {
|
|
25820
|
-
const target = path8.join(sessionsDir, entry.name);
|
|
25821
|
-
if (entry.isDirectory() && options.isSessionLive(entry.name)) continue;
|
|
25822
|
-
try {
|
|
25823
|
-
const stats = lstatSync2(target);
|
|
25824
|
-
if (stats.mtimeMs > options.sessionCutoff) continue;
|
|
25825
|
-
removeEntry(target, stats.isSymbolicLink());
|
|
25826
|
-
} catch {
|
|
25827
|
-
}
|
|
25828
|
-
}
|
|
25829
|
-
}
|
|
25830
|
-
function pruneChildren(directory, cutoff, sessions) {
|
|
25831
|
-
let entries;
|
|
25832
|
-
try {
|
|
25833
|
-
entries = readdirSync2(directory, { withFileTypes: true, encoding: "utf8" });
|
|
25834
|
-
} catch {
|
|
25835
|
-
return;
|
|
25836
|
-
}
|
|
25837
|
-
for (const entry of entries) {
|
|
25838
|
-
const target = path8.join(directory, entry.name);
|
|
25839
|
-
if (sessions && entry.isDirectory() && target === sessions.sessionsDir) {
|
|
25840
|
-
pruneSessionDirs(target, sessions);
|
|
25841
|
-
continue;
|
|
25842
|
-
}
|
|
25843
|
-
if (entry.isDirectory()) {
|
|
25844
|
-
pruneDirectory(target, cutoff);
|
|
25845
|
-
continue;
|
|
25846
|
-
}
|
|
25847
|
-
pruneLeaf(target, cutoff);
|
|
25848
|
-
}
|
|
25849
|
-
}
|
|
25850
|
-
function pruneDirectory(directory, cutoff) {
|
|
25851
|
-
pruneChildren(directory, cutoff);
|
|
25852
|
-
try {
|
|
25853
|
-
const stats = lstatSync2(directory);
|
|
25854
|
-
if (stats.mtimeMs > cutoff) return;
|
|
25855
|
-
} catch {
|
|
25856
|
-
return;
|
|
25857
|
-
}
|
|
25858
|
-
try {
|
|
25859
|
-
if (readdirSync2(directory).length === 0) {
|
|
25860
|
-
rmSync2(directory, { recursive: true, force: true });
|
|
25861
|
-
}
|
|
25862
|
-
} catch {
|
|
25863
|
-
}
|
|
25864
|
-
}
|
|
25865
|
-
function pruneLeaf(target, cutoff) {
|
|
25866
|
-
try {
|
|
25867
|
-
const stats = lstatSync2(target);
|
|
25868
|
-
if (stats.mtimeMs > cutoff) return;
|
|
25869
|
-
if (stats.isSymbolicLink()) {
|
|
25870
|
-
unlinkSync2(target);
|
|
25871
|
-
return;
|
|
25872
|
-
}
|
|
25873
|
-
rmSync2(target, { recursive: true, force: true });
|
|
25874
|
-
} catch {
|
|
25875
|
-
}
|
|
25876
|
-
}
|
|
25877
|
-
var PROJECT_TMP_RETENTION_MS, PROJECT_TMP_SESSION_RETENTION_MS, PROJECT_TMP_SESSIONS_DIRNAME;
|
|
25878
|
-
var init_project_tmp = __esm({
|
|
25879
|
-
"src/project-tmp.ts"() {
|
|
25880
|
-
"use strict";
|
|
25881
|
-
PROJECT_TMP_RETENTION_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
25882
|
-
PROJECT_TMP_SESSION_RETENTION_MS = 24 * 60 * 60 * 1e3;
|
|
25883
|
-
PROJECT_TMP_SESSIONS_DIRNAME = "sessions";
|
|
25884
|
-
}
|
|
25885
|
-
});
|
|
25886
|
-
|
|
25887
|
-
// ../packages/core/dist/service/agent-session/pure/evidence-path.js
|
|
25888
|
-
import path9 from "node:path";
|
|
25889
|
-
function hasControlCharacters(value2) {
|
|
25890
|
-
for (let index = 0; index < value2.length; index += 1) {
|
|
25891
|
-
const code = value2.charCodeAt(index);
|
|
25892
|
-
if (code <= 31 || code === 127)
|
|
25893
|
-
return true;
|
|
25894
|
-
}
|
|
25895
|
-
return false;
|
|
25896
|
-
}
|
|
25897
|
-
function hasUnsafePathCharacters(value2) {
|
|
25898
|
-
return hasControlCharacters(value2) || value2.includes("\\");
|
|
25899
|
-
}
|
|
25900
|
-
function isOverlordManagedEvidencePath(filePath) {
|
|
25901
|
-
return filePath === ".overlord" || filePath.startsWith(".overlord/");
|
|
25902
|
-
}
|
|
25903
|
-
function isExactEvidencePath(value2) {
|
|
25904
|
-
if (typeof value2 !== "string")
|
|
25905
|
-
return false;
|
|
25906
|
-
if (value2.length === 0 || value2.length > MAX_EVIDENCE_PATH_LENGTH || value2 !== value2.trim() || hasUnsafePathCharacters(value2)) {
|
|
25907
|
-
return false;
|
|
25908
|
-
}
|
|
25909
|
-
const slashPath = path9.sep === "\\" ? value2.replace(/\\/g, "/") : value2;
|
|
25910
|
-
if (path9.posix.isAbsolute(slashPath) || /^[a-z]:/i.test(slashPath))
|
|
25911
|
-
return false;
|
|
25912
|
-
if (slashPath === "." || slashPath === ".." || slashPath.startsWith("../"))
|
|
25913
|
-
return false;
|
|
25914
|
-
return path9.posix.normalize(slashPath) === slashPath;
|
|
25915
|
-
}
|
|
25916
|
-
function reduceEvidencePath(rawPath, projectRoot) {
|
|
25917
|
-
if (typeof rawPath !== "string" || rawPath.length === 0 || rawPath.length > MAX_EVIDENCE_INPUT_LENGTH || rawPath !== rawPath.trim() || hasControlCharacters(rawPath) || path9.sep === "/" && rawPath.includes("\\")) {
|
|
25918
|
-
return null;
|
|
25919
|
-
}
|
|
25920
|
-
const absolute = path9.isAbsolute(rawPath);
|
|
25921
|
-
if (!absolute && (/^[a-z]:[\\/]/i.test(rawPath) || rawPath.startsWith("\\\\")))
|
|
25922
|
-
return null;
|
|
25923
|
-
let relative = rawPath;
|
|
25924
|
-
if (absolute) {
|
|
25925
|
-
if (!projectRoot || !path9.isAbsolute(projectRoot) || hasControlCharacters(projectRoot)) {
|
|
25926
|
-
return null;
|
|
25927
|
-
}
|
|
25928
|
-
if (path9.normalize(rawPath) !== rawPath)
|
|
25929
|
-
return null;
|
|
25930
|
-
relative = path9.relative(path9.normalize(projectRoot), rawPath);
|
|
25931
|
-
}
|
|
25932
|
-
if (path9.sep === "\\")
|
|
25933
|
-
relative = relative.replace(/\\/g, "/");
|
|
25934
|
-
return isExactEvidencePath(relative) ? relative : null;
|
|
25935
|
-
}
|
|
25936
|
-
var MAX_EVIDENCE_PATH_LENGTH, MAX_EVIDENCE_INPUT_LENGTH;
|
|
25937
|
-
var init_evidence_path = __esm({
|
|
25938
|
-
"../packages/core/dist/service/agent-session/pure/evidence-path.js"() {
|
|
25939
|
-
"use strict";
|
|
25940
|
-
MAX_EVIDENCE_PATH_LENGTH = 2e3;
|
|
25941
|
-
MAX_EVIDENCE_INPUT_LENGTH = 4096;
|
|
25942
|
-
}
|
|
25943
|
-
});
|
|
25944
|
-
|
|
25945
25668
|
// src/local-file-storage.ts
|
|
25946
25669
|
import { randomUUID } from "node:crypto";
|
|
25947
25670
|
import {
|
|
25948
25671
|
chmodSync as chmodSync3,
|
|
25949
25672
|
closeSync,
|
|
25950
|
-
existsSync as
|
|
25951
|
-
mkdirSync as
|
|
25673
|
+
existsSync as existsSync8,
|
|
25674
|
+
mkdirSync as mkdirSync4,
|
|
25952
25675
|
openSync,
|
|
25953
25676
|
readFileSync as readFileSync8,
|
|
25954
25677
|
readSync,
|
|
25955
25678
|
realpathSync as realpathSync2,
|
|
25956
25679
|
renameSync,
|
|
25957
25680
|
statSync as statSync2,
|
|
25958
|
-
unlinkSync as
|
|
25681
|
+
unlinkSync as unlinkSync2,
|
|
25959
25682
|
writeFileSync as writeFileSync4
|
|
25960
25683
|
} from "node:fs";
|
|
25961
|
-
import
|
|
25684
|
+
import path8 from "node:path";
|
|
25962
25685
|
function sleepSync(milliseconds) {
|
|
25963
25686
|
Atomics.wait(sleepArray, 0, 0, milliseconds);
|
|
25964
25687
|
}
|
|
@@ -25997,7 +25720,7 @@ function readBoundedUtf8File(filePath, maxBytes) {
|
|
|
25997
25720
|
}
|
|
25998
25721
|
}
|
|
25999
25722
|
function canonicalDirectory(directory) {
|
|
26000
|
-
const resolved =
|
|
25723
|
+
const resolved = path8.resolve(directory);
|
|
26001
25724
|
try {
|
|
26002
25725
|
return realpathSync2(resolved);
|
|
26003
25726
|
} catch {
|
|
@@ -26005,11 +25728,11 @@ function canonicalDirectory(directory) {
|
|
|
26005
25728
|
}
|
|
26006
25729
|
}
|
|
26007
25730
|
function ensureOwnerOnlyDirectory(directory) {
|
|
26008
|
-
|
|
25731
|
+
mkdirSync4(directory, { recursive: true, mode: 448 });
|
|
26009
25732
|
chmodSync3(directory, 448);
|
|
26010
25733
|
}
|
|
26011
25734
|
function writeOwnerOnlyFileAtomically(target, contents) {
|
|
26012
|
-
ensureOwnerOnlyDirectory(
|
|
25735
|
+
ensureOwnerOnlyDirectory(path8.dirname(target));
|
|
26013
25736
|
const temporary = `${target}.${randomUUID()}.tmp`;
|
|
26014
25737
|
try {
|
|
26015
25738
|
writeFileSync4(temporary, contents, { mode: 384 });
|
|
@@ -26018,7 +25741,7 @@ function writeOwnerOnlyFileAtomically(target, contents) {
|
|
|
26018
25741
|
chmodSync3(target, 384);
|
|
26019
25742
|
} finally {
|
|
26020
25743
|
try {
|
|
26021
|
-
if (
|
|
25744
|
+
if (existsSync8(temporary)) unlinkSync2(temporary);
|
|
26022
25745
|
} catch {
|
|
26023
25746
|
}
|
|
26024
25747
|
}
|
|
@@ -26051,7 +25774,7 @@ function shouldRecoverLock(lockPath, staleAfterMs) {
|
|
|
26051
25774
|
function removeOwnedLock(lockPath, token) {
|
|
26052
25775
|
try {
|
|
26053
25776
|
const parsed = JSON.parse(readFileSync8(lockPath, "utf8"));
|
|
26054
|
-
if (parsed.token === token)
|
|
25777
|
+
if (parsed.token === token) unlinkSync2(lockPath);
|
|
26055
25778
|
} catch (error62) {
|
|
26056
25779
|
if (error62.code !== "ENOENT") throw error62;
|
|
26057
25780
|
}
|
|
@@ -26083,14 +25806,14 @@ function recoverStaleLock(lockPath, staleAfterMs) {
|
|
|
26083
25806
|
}
|
|
26084
25807
|
if (createdRecovery) {
|
|
26085
25808
|
try {
|
|
26086
|
-
|
|
25809
|
+
unlinkSync2(recoveryPath);
|
|
26087
25810
|
} catch {
|
|
26088
25811
|
}
|
|
26089
25812
|
}
|
|
26090
25813
|
if (error62.code === "EEXIST") {
|
|
26091
25814
|
if (shouldRecoverLock(recoveryPath, staleAfterMs)) {
|
|
26092
25815
|
try {
|
|
26093
|
-
|
|
25816
|
+
unlinkSync2(recoveryPath);
|
|
26094
25817
|
} catch {
|
|
26095
25818
|
}
|
|
26096
25819
|
}
|
|
@@ -26101,7 +25824,7 @@ function recoverStaleLock(lockPath, staleAfterMs) {
|
|
|
26101
25824
|
try {
|
|
26102
25825
|
if (shouldRecoverLock(lockPath, staleAfterMs)) {
|
|
26103
25826
|
try {
|
|
26104
|
-
|
|
25827
|
+
unlinkSync2(lockPath);
|
|
26105
25828
|
} catch (error62) {
|
|
26106
25829
|
if (error62.code !== "ENOENT") throw error62;
|
|
26107
25830
|
}
|
|
@@ -26111,7 +25834,7 @@ function recoverStaleLock(lockPath, staleAfterMs) {
|
|
|
26111
25834
|
}
|
|
26112
25835
|
}
|
|
26113
25836
|
function withLocalFileLock(target, action, options = {}) {
|
|
26114
|
-
ensureOwnerOnlyDirectory(
|
|
25837
|
+
ensureOwnerOnlyDirectory(path8.dirname(target));
|
|
26115
25838
|
const lockPath = `${target}.lock`;
|
|
26116
25839
|
const deadline = Date.now() + (options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS);
|
|
26117
25840
|
const staleAfterMs = options.staleAfterMs ?? DEFAULT_STALE_LOCK_MS;
|
|
@@ -26145,7 +25868,7 @@ function withLocalFileLock(target, action, options = {}) {
|
|
|
26145
25868
|
}
|
|
26146
25869
|
if (createdLock) {
|
|
26147
25870
|
try {
|
|
26148
|
-
|
|
25871
|
+
unlinkSync2(lockPath);
|
|
26149
25872
|
} catch {
|
|
26150
25873
|
}
|
|
26151
25874
|
}
|
|
@@ -26180,6 +25903,280 @@ var init_local_file_storage = __esm({
|
|
|
26180
25903
|
}
|
|
26181
25904
|
});
|
|
26182
25905
|
|
|
25906
|
+
// src/project-tmp.ts
|
|
25907
|
+
var project_tmp_exports = {};
|
|
25908
|
+
__export(project_tmp_exports, {
|
|
25909
|
+
PROJECT_TMP_RETENTION_MS: () => PROJECT_TMP_RETENTION_MS,
|
|
25910
|
+
PROJECT_TMP_SESSIONS_DIRNAME: () => PROJECT_TMP_SESSIONS_DIRNAME,
|
|
25911
|
+
PROJECT_TMP_SESSION_RETENTION_MS: () => PROJECT_TMP_SESSION_RETENTION_MS,
|
|
25912
|
+
ensureHarnessScratchDir: () => ensureHarnessScratchDir,
|
|
25913
|
+
ensureProjectTmpDir: () => ensureProjectTmpDir,
|
|
25914
|
+
isSessionScratchDir: () => isSessionScratchDir,
|
|
25915
|
+
projectTmpDir: () => projectTmpDir,
|
|
25916
|
+
projectTmpSessionsDir: () => projectTmpSessionsDir,
|
|
25917
|
+
pruneProjectTmpContents: () => pruneProjectTmpContents,
|
|
25918
|
+
pruneStaleProjectTmp: () => pruneStaleProjectTmp,
|
|
25919
|
+
removeLaunchBriefing: () => removeLaunchBriefing,
|
|
25920
|
+
safeTmpNamePart: () => safeTmpNamePart,
|
|
25921
|
+
sessionScratchName: () => sessionScratchName
|
|
25922
|
+
});
|
|
25923
|
+
import {
|
|
25924
|
+
existsSync as existsSync9,
|
|
25925
|
+
lstatSync as lstatSync2,
|
|
25926
|
+
mkdirSync as mkdirSync5,
|
|
25927
|
+
readdirSync as readdirSync2,
|
|
25928
|
+
rmSync as rmSync2,
|
|
25929
|
+
unlinkSync as unlinkSync3,
|
|
25930
|
+
writeFileSync as writeFileSync5
|
|
25931
|
+
} from "node:fs";
|
|
25932
|
+
import path9 from "node:path";
|
|
25933
|
+
function projectTmpDir(workingDirectory) {
|
|
25934
|
+
return path9.join(workingDirectory, ".overlord", "tmp");
|
|
25935
|
+
}
|
|
25936
|
+
function projectTmpSessionsDir(workingDirectory) {
|
|
25937
|
+
return path9.join(projectTmpDir(workingDirectory), PROJECT_TMP_SESSIONS_DIRNAME);
|
|
25938
|
+
}
|
|
25939
|
+
function safeTmpNamePart(value2) {
|
|
25940
|
+
return value2.replace(/[^a-zA-Z0-9_-]/g, "-").replace(/^-+|-+$/g, "");
|
|
25941
|
+
}
|
|
25942
|
+
function sessionScratchName({
|
|
25943
|
+
missionDisplayId: missionDisplayId2,
|
|
25944
|
+
objectiveDisplayId,
|
|
25945
|
+
executionRequestId
|
|
25946
|
+
}) {
|
|
25947
|
+
const identity = objectiveDisplayId?.trim() ? `objective-${safeTmpNamePart(objectiveDisplayId)}` : `mission-${safeTmpNamePart(missionDisplayId2)}`;
|
|
25948
|
+
const request = executionRequestId?.trim() ? safeTmpNamePart(executionRequestId) : `${process.pid}`;
|
|
25949
|
+
return `${identity || "launch"}-${request || "launch"}`;
|
|
25950
|
+
}
|
|
25951
|
+
function isSessionScratchDir(workingDirectory, candidate) {
|
|
25952
|
+
const resolved = path9.resolve(candidate);
|
|
25953
|
+
const candidateCheckout = path9.resolve(resolved, "../../../..");
|
|
25954
|
+
return path9.dirname(resolved) === projectTmpSessionsDir(candidateCheckout) && canonicalDirectory(candidateCheckout) === canonicalDirectory(workingDirectory);
|
|
25955
|
+
}
|
|
25956
|
+
function ensureHarnessScratchDir(workingDirectory, scratchDir) {
|
|
25957
|
+
if (!isSessionScratchDir(workingDirectory, scratchDir)) return;
|
|
25958
|
+
mkdirSync5(scratchDir, { recursive: true, mode: 448 });
|
|
25959
|
+
if (!lstatSync2(scratchDir).isDirectory()) return;
|
|
25960
|
+
try {
|
|
25961
|
+
writeFileSync5(path9.join(scratchDir, HARNESS_SCRATCH_MARKER), "", { flag: "wx", mode: 384 });
|
|
25962
|
+
} catch (error62) {
|
|
25963
|
+
if (error62.code !== "EEXIST") throw error62;
|
|
25964
|
+
}
|
|
25965
|
+
}
|
|
25966
|
+
function removeLaunchBriefing(workingDirectory, contextFile) {
|
|
25967
|
+
if (!contextFile) return;
|
|
25968
|
+
const resolved = path9.resolve(contextFile);
|
|
25969
|
+
if (path9.dirname(resolved) !== path9.resolve(projectTmpDir(workingDirectory))) return;
|
|
25970
|
+
if (!resolved.endsWith(".md")) return;
|
|
25971
|
+
try {
|
|
25972
|
+
unlinkSync3(resolved);
|
|
25973
|
+
} catch {
|
|
25974
|
+
}
|
|
25975
|
+
}
|
|
25976
|
+
function ensureProjectTmpDir(workingDirectory) {
|
|
25977
|
+
const tmpDir = projectTmpDir(workingDirectory);
|
|
25978
|
+
mkdirSync5(tmpDir, { recursive: true });
|
|
25979
|
+
return tmpDir;
|
|
25980
|
+
}
|
|
25981
|
+
function pruneStaleProjectTmp({
|
|
25982
|
+
workingDirectory,
|
|
25983
|
+
create = false,
|
|
25984
|
+
now = Date.now(),
|
|
25985
|
+
retentionMs = PROJECT_TMP_RETENTION_MS,
|
|
25986
|
+
sessionRetentionMs = PROJECT_TMP_SESSION_RETENTION_MS,
|
|
25987
|
+
isSessionLive = () => false
|
|
25988
|
+
}) {
|
|
25989
|
+
const tmpDir = projectTmpDir(workingDirectory);
|
|
25990
|
+
if (!create && !existsSync9(tmpDir)) return;
|
|
25991
|
+
if (create) ensureProjectTmpDir(workingDirectory);
|
|
25992
|
+
const cutoff = now - retentionMs;
|
|
25993
|
+
pruneChildren(tmpDir, cutoff, {
|
|
25994
|
+
sessionsDir: projectTmpSessionsDir(workingDirectory),
|
|
25995
|
+
sessionCutoff: now - sessionRetentionMs,
|
|
25996
|
+
fileCutoff: cutoff,
|
|
25997
|
+
isSessionLive
|
|
25998
|
+
});
|
|
25999
|
+
}
|
|
26000
|
+
function pruneProjectTmpContents(workingDirectory, {
|
|
26001
|
+
isSessionLive = () => false,
|
|
26002
|
+
force = false
|
|
26003
|
+
} = {}) {
|
|
26004
|
+
const overlordDir = path9.join(workingDirectory, ".overlord");
|
|
26005
|
+
if (!existsSync9(overlordDir)) {
|
|
26006
|
+
return { warned: true, removedCount: 0, skippedCount: 0 };
|
|
26007
|
+
}
|
|
26008
|
+
const tmpDir = projectTmpDir(workingDirectory);
|
|
26009
|
+
if (!existsSync9(tmpDir)) {
|
|
26010
|
+
return { warned: false, removedCount: 0, skippedCount: 0 };
|
|
26011
|
+
}
|
|
26012
|
+
let removedCount = 0;
|
|
26013
|
+
let skippedCount = 0;
|
|
26014
|
+
const entries = readdirSync2(tmpDir, { withFileTypes: true, encoding: "utf8" });
|
|
26015
|
+
for (const entry of entries) {
|
|
26016
|
+
const target = path9.join(tmpDir, entry.name);
|
|
26017
|
+
if (entry.name === PROJECT_TMP_SESSIONS_DIRNAME && entry.isDirectory() && !force) {
|
|
26018
|
+
for (const session of readdirSync2(target, { withFileTypes: true, encoding: "utf8" })) {
|
|
26019
|
+
if (session.isDirectory() && isSessionLive(session.name)) {
|
|
26020
|
+
skippedCount += 1;
|
|
26021
|
+
continue;
|
|
26022
|
+
}
|
|
26023
|
+
removeEntry(path9.join(target, session.name), session.isSymbolicLink());
|
|
26024
|
+
removedCount += 1;
|
|
26025
|
+
}
|
|
26026
|
+
continue;
|
|
26027
|
+
}
|
|
26028
|
+
removeEntry(target, entry.isSymbolicLink());
|
|
26029
|
+
removedCount += 1;
|
|
26030
|
+
}
|
|
26031
|
+
return { warned: false, removedCount, skippedCount };
|
|
26032
|
+
}
|
|
26033
|
+
function removeEntry(target, isSymbolicLink) {
|
|
26034
|
+
if (isSymbolicLink) {
|
|
26035
|
+
unlinkSync3(target);
|
|
26036
|
+
return;
|
|
26037
|
+
}
|
|
26038
|
+
rmSync2(target, { recursive: true, force: true });
|
|
26039
|
+
}
|
|
26040
|
+
function pruneSessionDirs(sessionsDir, options) {
|
|
26041
|
+
let entries;
|
|
26042
|
+
try {
|
|
26043
|
+
entries = readdirSync2(sessionsDir, { withFileTypes: true, encoding: "utf8" });
|
|
26044
|
+
} catch {
|
|
26045
|
+
return;
|
|
26046
|
+
}
|
|
26047
|
+
for (const entry of entries) {
|
|
26048
|
+
const target = path9.join(sessionsDir, entry.name);
|
|
26049
|
+
if (entry.isDirectory() && options.isSessionLive(entry.name)) continue;
|
|
26050
|
+
try {
|
|
26051
|
+
if (entry.isDirectory() && existsSync9(path9.join(target, HARNESS_SCRATCH_MARKER))) {
|
|
26052
|
+
pruneChildren(target, options.fileCutoff, void 0, HARNESS_SCRATCH_MARKER);
|
|
26053
|
+
continue;
|
|
26054
|
+
}
|
|
26055
|
+
const stats = lstatSync2(target);
|
|
26056
|
+
if (stats.mtimeMs > options.sessionCutoff) continue;
|
|
26057
|
+
removeEntry(target, stats.isSymbolicLink());
|
|
26058
|
+
} catch {
|
|
26059
|
+
}
|
|
26060
|
+
}
|
|
26061
|
+
}
|
|
26062
|
+
function pruneChildren(directory, cutoff, sessions, preservedEntry) {
|
|
26063
|
+
let entries;
|
|
26064
|
+
try {
|
|
26065
|
+
entries = readdirSync2(directory, { withFileTypes: true, encoding: "utf8" });
|
|
26066
|
+
} catch {
|
|
26067
|
+
return;
|
|
26068
|
+
}
|
|
26069
|
+
for (const entry of entries) {
|
|
26070
|
+
if (entry.name === preservedEntry) continue;
|
|
26071
|
+
const target = path9.join(directory, entry.name);
|
|
26072
|
+
if (sessions && entry.isDirectory() && target === sessions.sessionsDir) {
|
|
26073
|
+
pruneSessionDirs(target, sessions);
|
|
26074
|
+
continue;
|
|
26075
|
+
}
|
|
26076
|
+
if (entry.isDirectory()) {
|
|
26077
|
+
pruneDirectory(target, cutoff);
|
|
26078
|
+
continue;
|
|
26079
|
+
}
|
|
26080
|
+
pruneLeaf(target, cutoff);
|
|
26081
|
+
}
|
|
26082
|
+
}
|
|
26083
|
+
function pruneDirectory(directory, cutoff) {
|
|
26084
|
+
pruneChildren(directory, cutoff);
|
|
26085
|
+
try {
|
|
26086
|
+
const stats = lstatSync2(directory);
|
|
26087
|
+
if (stats.mtimeMs > cutoff) return;
|
|
26088
|
+
} catch {
|
|
26089
|
+
return;
|
|
26090
|
+
}
|
|
26091
|
+
try {
|
|
26092
|
+
if (readdirSync2(directory).length === 0) {
|
|
26093
|
+
rmSync2(directory, { recursive: true, force: true });
|
|
26094
|
+
}
|
|
26095
|
+
} catch {
|
|
26096
|
+
}
|
|
26097
|
+
}
|
|
26098
|
+
function pruneLeaf(target, cutoff) {
|
|
26099
|
+
try {
|
|
26100
|
+
const stats = lstatSync2(target);
|
|
26101
|
+
if (stats.mtimeMs > cutoff) return;
|
|
26102
|
+
if (stats.isSymbolicLink()) {
|
|
26103
|
+
unlinkSync3(target);
|
|
26104
|
+
return;
|
|
26105
|
+
}
|
|
26106
|
+
rmSync2(target, { recursive: true, force: true });
|
|
26107
|
+
} catch {
|
|
26108
|
+
}
|
|
26109
|
+
}
|
|
26110
|
+
var PROJECT_TMP_RETENTION_MS, PROJECT_TMP_SESSION_RETENTION_MS, PROJECT_TMP_SESSIONS_DIRNAME, HARNESS_SCRATCH_MARKER;
|
|
26111
|
+
var init_project_tmp = __esm({
|
|
26112
|
+
"src/project-tmp.ts"() {
|
|
26113
|
+
"use strict";
|
|
26114
|
+
init_local_file_storage();
|
|
26115
|
+
PROJECT_TMP_RETENTION_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
26116
|
+
PROJECT_TMP_SESSION_RETENTION_MS = 24 * 60 * 60 * 1e3;
|
|
26117
|
+
PROJECT_TMP_SESSIONS_DIRNAME = "sessions";
|
|
26118
|
+
HARNESS_SCRATCH_MARKER = ".overlord-harness-scratch";
|
|
26119
|
+
}
|
|
26120
|
+
});
|
|
26121
|
+
|
|
26122
|
+
// ../packages/core/dist/service/agent-session/pure/evidence-path.js
|
|
26123
|
+
import path10 from "node:path";
|
|
26124
|
+
function hasControlCharacters(value2) {
|
|
26125
|
+
for (let index = 0; index < value2.length; index += 1) {
|
|
26126
|
+
const code = value2.charCodeAt(index);
|
|
26127
|
+
if (code <= 31 || code === 127)
|
|
26128
|
+
return true;
|
|
26129
|
+
}
|
|
26130
|
+
return false;
|
|
26131
|
+
}
|
|
26132
|
+
function hasUnsafePathCharacters(value2) {
|
|
26133
|
+
return hasControlCharacters(value2) || value2.includes("\\");
|
|
26134
|
+
}
|
|
26135
|
+
function isOverlordManagedEvidencePath(filePath) {
|
|
26136
|
+
return filePath === ".overlord" || filePath.startsWith(".overlord/");
|
|
26137
|
+
}
|
|
26138
|
+
function isExactEvidencePath(value2) {
|
|
26139
|
+
if (typeof value2 !== "string")
|
|
26140
|
+
return false;
|
|
26141
|
+
if (value2.length === 0 || value2.length > MAX_EVIDENCE_PATH_LENGTH || value2 !== value2.trim() || hasUnsafePathCharacters(value2)) {
|
|
26142
|
+
return false;
|
|
26143
|
+
}
|
|
26144
|
+
const slashPath = path10.sep === "\\" ? value2.replace(/\\/g, "/") : value2;
|
|
26145
|
+
if (path10.posix.isAbsolute(slashPath) || /^[a-z]:/i.test(slashPath))
|
|
26146
|
+
return false;
|
|
26147
|
+
if (slashPath === "." || slashPath === ".." || slashPath.startsWith("../"))
|
|
26148
|
+
return false;
|
|
26149
|
+
return path10.posix.normalize(slashPath) === slashPath;
|
|
26150
|
+
}
|
|
26151
|
+
function reduceEvidencePath(rawPath, projectRoot) {
|
|
26152
|
+
if (typeof rawPath !== "string" || rawPath.length === 0 || rawPath.length > MAX_EVIDENCE_INPUT_LENGTH || rawPath !== rawPath.trim() || hasControlCharacters(rawPath) || path10.sep === "/" && rawPath.includes("\\")) {
|
|
26153
|
+
return null;
|
|
26154
|
+
}
|
|
26155
|
+
const absolute = path10.isAbsolute(rawPath);
|
|
26156
|
+
if (!absolute && (/^[a-z]:[\\/]/i.test(rawPath) || rawPath.startsWith("\\\\")))
|
|
26157
|
+
return null;
|
|
26158
|
+
let relative = rawPath;
|
|
26159
|
+
if (absolute) {
|
|
26160
|
+
if (!projectRoot || !path10.isAbsolute(projectRoot) || hasControlCharacters(projectRoot)) {
|
|
26161
|
+
return null;
|
|
26162
|
+
}
|
|
26163
|
+
if (path10.normalize(rawPath) !== rawPath)
|
|
26164
|
+
return null;
|
|
26165
|
+
relative = path10.relative(path10.normalize(projectRoot), rawPath);
|
|
26166
|
+
}
|
|
26167
|
+
if (path10.sep === "\\")
|
|
26168
|
+
relative = relative.replace(/\\/g, "/");
|
|
26169
|
+
return isExactEvidencePath(relative) ? relative : null;
|
|
26170
|
+
}
|
|
26171
|
+
var MAX_EVIDENCE_PATH_LENGTH, MAX_EVIDENCE_INPUT_LENGTH;
|
|
26172
|
+
var init_evidence_path = __esm({
|
|
26173
|
+
"../packages/core/dist/service/agent-session/pure/evidence-path.js"() {
|
|
26174
|
+
"use strict";
|
|
26175
|
+
MAX_EVIDENCE_PATH_LENGTH = 2e3;
|
|
26176
|
+
MAX_EVIDENCE_INPUT_LENGTH = 4096;
|
|
26177
|
+
}
|
|
26178
|
+
});
|
|
26179
|
+
|
|
26183
26180
|
// src/change-ledger.ts
|
|
26184
26181
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
|
|
26185
26182
|
import { existsSync as existsSync10, realpathSync as realpathSync3, unlinkSync as unlinkSync4 } from "node:fs";
|
|
@@ -28345,7 +28342,7 @@ var init_descriptor = __esm({
|
|
|
28345
28342
|
|
|
28346
28343
|
// src/active-mission.ts
|
|
28347
28344
|
import { createHash as createHash6 } from "node:crypto";
|
|
28348
|
-
import { existsSync as existsSync13, mkdirSync as mkdirSync6, readFileSync as readFileSync10, rmSync as rmSync3, writeFileSync as
|
|
28345
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync6, readFileSync as readFileSync10, rmSync as rmSync3, writeFileSync as writeFileSync6 } from "node:fs";
|
|
28349
28346
|
import path14 from "node:path";
|
|
28350
28347
|
function pointerPath(workingDirectory) {
|
|
28351
28348
|
const key = createHash6("sha256").update(path14.resolve(workingDirectory)).digest("hex");
|
|
@@ -28369,7 +28366,7 @@ function writeActiveMissionPointer({
|
|
|
28369
28366
|
title: (title ?? "").trim(),
|
|
28370
28367
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
28371
28368
|
};
|
|
28372
|
-
|
|
28369
|
+
writeFileSync6(filePath, JSON.stringify(payload), { mode: 384 });
|
|
28373
28370
|
} catch {
|
|
28374
28371
|
}
|
|
28375
28372
|
}
|
|
@@ -28407,7 +28404,7 @@ var init_active_mission = __esm({
|
|
|
28407
28404
|
|
|
28408
28405
|
// src/native-session.ts
|
|
28409
28406
|
import { createHash as createHash7 } from "node:crypto";
|
|
28410
|
-
import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync4, readFileSync as readFileSync11, statSync as statSync3, writeFileSync as
|
|
28407
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync4, readFileSync as readFileSync11, statSync as statSync3, writeFileSync as writeFileSync7 } from "node:fs";
|
|
28411
28408
|
import { homedir } from "node:os";
|
|
28412
28409
|
import path15 from "node:path";
|
|
28413
28410
|
function sessionCachePath({
|
|
@@ -28459,7 +28456,7 @@ function writeNativeSessionId({
|
|
|
28459
28456
|
});
|
|
28460
28457
|
const write = (filePath) => {
|
|
28461
28458
|
mkdirSync7(path15.dirname(filePath), { recursive: true });
|
|
28462
|
-
|
|
28459
|
+
writeFileSync7(filePath, payload, "utf8");
|
|
28463
28460
|
};
|
|
28464
28461
|
write(
|
|
28465
28462
|
sessionCachePath({
|
|
@@ -28630,7 +28627,7 @@ import {
|
|
|
28630
28627
|
readFileSync as readFileSync12,
|
|
28631
28628
|
renameSync as renameSync2,
|
|
28632
28629
|
rmSync as rmSync4,
|
|
28633
|
-
writeFileSync as
|
|
28630
|
+
writeFileSync as writeFileSync8
|
|
28634
28631
|
} from "node:fs";
|
|
28635
28632
|
import path16 from "node:path";
|
|
28636
28633
|
function credentialDir() {
|
|
@@ -28653,7 +28650,7 @@ function writeChannelCredential({
|
|
|
28653
28650
|
}
|
|
28654
28651
|
const filePath = credentialPath(channelId);
|
|
28655
28652
|
const tempPath = `${filePath}.${process.pid}.tmp`;
|
|
28656
|
-
|
|
28653
|
+
writeFileSync8(tempPath, JSON.stringify({ channelId, token, expiresAt }), { mode: 384 });
|
|
28657
28654
|
renameSync2(tempPath, filePath);
|
|
28658
28655
|
}
|
|
28659
28656
|
function readChannelCredential(channelId) {
|
|
@@ -39397,11 +39394,11 @@ var init_util3 = __esm({
|
|
|
39397
39394
|
|
|
39398
39395
|
// ../packages/core/dist/service/local-target/project-metadata.js
|
|
39399
39396
|
import { execFileSync } from "node:child_process";
|
|
39400
|
-
import { existsSync as existsSync18, mkdirSync as mkdirSync9, readFileSync as readFileSync14, writeFileSync as
|
|
39397
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync9, readFileSync as readFileSync14, writeFileSync as writeFileSync9 } from "node:fs";
|
|
39401
39398
|
import path20 from "node:path";
|
|
39402
39399
|
function writeIfChanged(filePath, content) {
|
|
39403
39400
|
if (!existsSync18(filePath) || readFileSync14(filePath, "utf8") !== content) {
|
|
39404
|
-
|
|
39401
|
+
writeFileSync9(filePath, content);
|
|
39405
39402
|
}
|
|
39406
39403
|
}
|
|
39407
39404
|
function replaceManagedBlock(content, block) {
|
|
@@ -39425,7 +39422,7 @@ function ensureGitignore(checkoutPath) {
|
|
|
39425
39422
|
if (additions.length === 0)
|
|
39426
39423
|
return;
|
|
39427
39424
|
const separator = existing.length === 0 || existing.endsWith("\n") ? "" : "\n";
|
|
39428
|
-
|
|
39425
|
+
writeFileSync9(gitignorePath, `${existing}${separator}${additions.join("\n")}
|
|
39429
39426
|
`);
|
|
39430
39427
|
}
|
|
39431
39428
|
function resolveGitRoot(directoryPath) {
|
|
@@ -39588,7 +39585,7 @@ function writeProjectJson({ directoryPath, projectId, projectName, resourceId, r
|
|
|
39588
39585
|
];
|
|
39589
39586
|
const primary = selectPrimaryProjectEntry(projects) ?? nextEntry;
|
|
39590
39587
|
const primaryResourceIds = primary.resourceIdsByExecutionTarget ?? {};
|
|
39591
|
-
|
|
39588
|
+
writeFileSync9(projectJsonPath, `${JSON.stringify({
|
|
39592
39589
|
_warning: PROJECT_JSON_WARNING,
|
|
39593
39590
|
version: PROJECT_JSON_VERSION,
|
|
39594
39591
|
projectId: primary.projectId,
|
|
@@ -39741,7 +39738,7 @@ var init_latch_environment = __esm({
|
|
|
39741
39738
|
|
|
39742
39739
|
// ../packages/core/dist/service/latch-discovery.js
|
|
39743
39740
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
39744
|
-
import { existsSync as existsSync19, mkdirSync as mkdirSync10, readFileSync as readFileSync15, statSync as statSync4, writeFileSync as
|
|
39741
|
+
import { existsSync as existsSync19, mkdirSync as mkdirSync10, readFileSync as readFileSync15, statSync as statSync4, writeFileSync as writeFileSync10 } from "node:fs";
|
|
39745
39742
|
import os4 from "node:os";
|
|
39746
39743
|
import path22 from "node:path";
|
|
39747
39744
|
function defaultLatchDiscoveryCachePath() {
|
|
@@ -39946,7 +39943,7 @@ function readLatchDiscoveryCacheFile(filePath) {
|
|
|
39946
39943
|
}
|
|
39947
39944
|
function writeLatchDiscoveryCacheFile({ filePath, cache: cache2 }) {
|
|
39948
39945
|
mkdirSync10(path22.dirname(filePath), { recursive: true });
|
|
39949
|
-
|
|
39946
|
+
writeFileSync10(filePath, `${JSON.stringify(cache2, null, 2)}
|
|
39950
39947
|
`, { mode: 384 });
|
|
39951
39948
|
}
|
|
39952
39949
|
function discoverLatchForExecutionTarget({ executionTargetId, executable = DEFAULT_LATCH_EXECUTABLE, cacheFilePath, force = false, resolvePath = resolveLatchExecutablePath, runCommand: runCommand2 = defaultCommandRunner, now = () => (/* @__PURE__ */ new Date()).toISOString() }) {
|
|
@@ -42894,6 +42891,63 @@ var init_local_target_mutation_runner = __esm({
|
|
|
42894
42891
|
}
|
|
42895
42892
|
});
|
|
42896
42893
|
|
|
42894
|
+
// ../packages/core/dist/service/objective-summary-placement.js
|
|
42895
|
+
function summaryInstructionStructure(text) {
|
|
42896
|
+
const found = [];
|
|
42897
|
+
if (MARKDOWN_HEADING.test(text))
|
|
42898
|
+
found.push("Markdown headings");
|
|
42899
|
+
if ((text.match(NUMBERED_STEP) ?? []).length >= 2)
|
|
42900
|
+
found.push("numbered steps");
|
|
42901
|
+
if (DONE_WHEN_LABEL.test(text))
|
|
42902
|
+
found.push('a "Done when:" label');
|
|
42903
|
+
return found;
|
|
42904
|
+
}
|
|
42905
|
+
function assessObjectiveSummaryPlacement({ instructions, summary }) {
|
|
42906
|
+
const instructionChars = instructions.trim().length;
|
|
42907
|
+
const summaryChars = summary.trim().length;
|
|
42908
|
+
if (summaryChars === 0)
|
|
42909
|
+
return { verdict: "ok" };
|
|
42910
|
+
const ratio = summaryChars / Math.max(1, instructionChars);
|
|
42911
|
+
const sizes = `The summary is ${summaryChars} characters; the instructions are ${instructionChars}.`;
|
|
42912
|
+
const fix = "Both texts were stored as written. If they are swapped, move the full brief into the instructions and a short overview into the summary (update-objective --instruction-text-file and --summary).";
|
|
42913
|
+
if (ratio >= OBJECTIVE_SWAP_LIKELY_RATIO && summaryChars >= OBJECTIVE_SWAP_LIKELY_MIN_SUMMARY_CHARS) {
|
|
42914
|
+
return {
|
|
42915
|
+
verdict: "warn",
|
|
42916
|
+
severity: "likely",
|
|
42917
|
+
message: `The objective instructions and summary look swapped: the summary is ${ratio.toFixed(1)} times longer than the instructions. ${sizes} ${FIELD_ROLES} ${fix}`
|
|
42918
|
+
};
|
|
42919
|
+
}
|
|
42920
|
+
const structure = summaryInstructionStructure(summary);
|
|
42921
|
+
const structured = structure.length > 0 && instructionChars < OBJECTIVE_SWAP_STRUCTURE_MAX_INSTRUCTION_CHARS;
|
|
42922
|
+
const longer = ratio > OBJECTIVE_SWAP_WARN_RATIO && summaryChars >= OBJECTIVE_SWAP_WARN_MIN_SUMMARY_CHARS;
|
|
42923
|
+
if (!structured && !longer)
|
|
42924
|
+
return { verdict: "ok" };
|
|
42925
|
+
const reasons = [
|
|
42926
|
+
...longer ? [`the summary is ${ratio.toFixed(1)} times longer than the instructions`] : [],
|
|
42927
|
+
...structured ? [`the summary contains ${structure.join(", ")}`] : []
|
|
42928
|
+
];
|
|
42929
|
+
return {
|
|
42930
|
+
verdict: "warn",
|
|
42931
|
+
severity: "possible",
|
|
42932
|
+
message: `The objective instructions and summary may be swapped: ${reasons.join(" and ")}. ${sizes} ${FIELD_ROLES} ${fix}`
|
|
42933
|
+
};
|
|
42934
|
+
}
|
|
42935
|
+
var OBJECTIVE_SWAP_WARN_RATIO, OBJECTIVE_SWAP_WARN_MIN_SUMMARY_CHARS, OBJECTIVE_SWAP_LIKELY_RATIO, OBJECTIVE_SWAP_LIKELY_MIN_SUMMARY_CHARS, OBJECTIVE_SWAP_STRUCTURE_MAX_INSTRUCTION_CHARS, MARKDOWN_HEADING, NUMBERED_STEP, DONE_WHEN_LABEL, FIELD_ROLES;
|
|
42936
|
+
var init_objective_summary_placement = __esm({
|
|
42937
|
+
"../packages/core/dist/service/objective-summary-placement.js"() {
|
|
42938
|
+
"use strict";
|
|
42939
|
+
OBJECTIVE_SWAP_WARN_RATIO = 1.5;
|
|
42940
|
+
OBJECTIVE_SWAP_WARN_MIN_SUMMARY_CHARS = 240;
|
|
42941
|
+
OBJECTIVE_SWAP_LIKELY_RATIO = 3;
|
|
42942
|
+
OBJECTIVE_SWAP_LIKELY_MIN_SUMMARY_CHARS = 400;
|
|
42943
|
+
OBJECTIVE_SWAP_STRUCTURE_MAX_INSTRUCTION_CHARS = 400;
|
|
42944
|
+
MARKDOWN_HEADING = /^\s{0,3}#{1,6}\s+\S/m;
|
|
42945
|
+
NUMBERED_STEP = /^\s{0,3}\d{1,3}[.)]\s+\S/gm;
|
|
42946
|
+
DONE_WHEN_LABEL = /^\s{0,3}(?:#{1,6}\s*)?(?:\*\*|__)?done when(?:\*\*|__)?\s*:/im;
|
|
42947
|
+
FIELD_ROLES = 'The instructions (--objective-instructions, or "instructions" in JSON) are the complete brief the executing agent receives. The summary (--objective-summary, or "summary" in JSON) is a short overview for people, one to three paragraphs, and is never sent to the agent.';
|
|
42948
|
+
}
|
|
42949
|
+
});
|
|
42950
|
+
|
|
42897
42951
|
// ../packages/core/dist/service/project-resource-key.js
|
|
42898
42952
|
import path27 from "node:path";
|
|
42899
42953
|
function deriveProjectResourceKey({ resourceKey, label, directoryPath }) {
|
|
@@ -44430,7 +44484,7 @@ var init_terminal_launcher = __esm({
|
|
|
44430
44484
|
|
|
44431
44485
|
// src/launch.ts
|
|
44432
44486
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
44433
|
-
import { chmodSync as chmodSync5,
|
|
44487
|
+
import { chmodSync as chmodSync5, writeFileSync as writeFileSync11 } from "node:fs";
|
|
44434
44488
|
import path33 from "node:path";
|
|
44435
44489
|
function interactiveLoginShellInvocation(command, configuredShell = process.env.SHELL) {
|
|
44436
44490
|
const shell = configuredShell?.trim() || "/bin/bash";
|
|
@@ -44659,9 +44713,9 @@ async function buildLaunchPlan({
|
|
|
44659
44713
|
executionRequestId: options.executionRequestId
|
|
44660
44714
|
})
|
|
44661
44715
|
);
|
|
44662
|
-
|
|
44716
|
+
ensureHarnessScratchDir(options.workingDirectory, sessionScratchDir);
|
|
44663
44717
|
const launchContext = context.launchContext;
|
|
44664
|
-
|
|
44718
|
+
writeFileSync11(contextFile, `${launchContext}
|
|
44665
44719
|
`);
|
|
44666
44720
|
const projectResources = await loadProjectResourcesForLaunch({
|
|
44667
44721
|
runtime,
|
|
@@ -44722,7 +44776,7 @@ async function buildLaunchPlan({
|
|
|
44722
44776
|
executionRequestId: options.executionRequestId
|
|
44723
44777
|
}) : null;
|
|
44724
44778
|
if (terminalScriptPath) {
|
|
44725
|
-
|
|
44779
|
+
writeFileSync11(
|
|
44726
44780
|
terminalScriptPath,
|
|
44727
44781
|
terminalLaunchScriptContent({
|
|
44728
44782
|
command: command.command,
|
|
@@ -45112,13 +45166,13 @@ import { createHash as createHash10, randomUUID as randomUUID3 } from "node:cryp
|
|
|
45112
45166
|
import {
|
|
45113
45167
|
chmodSync as chmodSync6,
|
|
45114
45168
|
existsSync as existsSync27,
|
|
45115
|
-
mkdirSync as
|
|
45169
|
+
mkdirSync as mkdirSync12,
|
|
45116
45170
|
readdirSync as readdirSync6,
|
|
45117
45171
|
readFileSync as readFileSync18,
|
|
45118
45172
|
renameSync as renameSync3,
|
|
45119
45173
|
rmSync as rmSync5,
|
|
45120
45174
|
statSync as statSync8,
|
|
45121
|
-
writeFileSync as
|
|
45175
|
+
writeFileSync as writeFileSync12
|
|
45122
45176
|
} from "node:fs";
|
|
45123
45177
|
import path35 from "node:path";
|
|
45124
45178
|
function attemptKindFor(subcommand) {
|
|
@@ -45177,7 +45231,7 @@ function recordPath(operationId) {
|
|
|
45177
45231
|
}
|
|
45178
45232
|
function ensureDirectory() {
|
|
45179
45233
|
const dir = attemptsDirectory();
|
|
45180
|
-
|
|
45234
|
+
mkdirSync12(dir, { recursive: true, mode: 448 });
|
|
45181
45235
|
chmodSync6(dir, 448);
|
|
45182
45236
|
}
|
|
45183
45237
|
function readAttempt(operationId) {
|
|
@@ -45192,7 +45246,7 @@ function writeAttempt(record2) {
|
|
|
45192
45246
|
ensureDirectory();
|
|
45193
45247
|
const target = recordPath(record2.operationId);
|
|
45194
45248
|
const temp = `${target}.${process.pid}.tmp`;
|
|
45195
|
-
|
|
45249
|
+
writeFileSync12(temp, `${JSON.stringify(record2, null, 2)}
|
|
45196
45250
|
`, { mode: 384 });
|
|
45197
45251
|
chmodSync6(temp, 384);
|
|
45198
45252
|
renameSync3(temp, target);
|
|
@@ -45582,7 +45636,7 @@ Subcommands:
|
|
|
45582
45636
|
statuses List one project's ordered board columns
|
|
45583
45637
|
discuss-objective Mark a draft objective as submitted (does not start execution)
|
|
45584
45638
|
add-objectives Append ordered objectives to an existing mission
|
|
45585
|
-
update-objective Set title,
|
|
45639
|
+
update-objective Set title, summary, auto-advance, instruction text, and/or agent on an objective
|
|
45586
45640
|
delete-missions Confirmed bulk soft-delete of missions
|
|
45587
45641
|
delete-objectives Confirmed bulk soft-delete of objectives
|
|
45588
45642
|
create Create a draft mission without attaching
|
|
@@ -46187,29 +46241,41 @@ add-objectives:
|
|
|
46187
46241
|
--objective-agent <id> / --objective-model <id>
|
|
46188
46242
|
Default launch selection for items that name no "agent" of their own.
|
|
46189
46243
|
--objective-model requires --objective-agent.
|
|
46244
|
+
Item fields:
|
|
46245
|
+
"instructions" (required) The complete brief the executing agent receives:
|
|
46246
|
+
context, steps and done-when. Usually the LONG text.
|
|
46247
|
+
"summary" (optional) Short overview for people, 1-3 paragraphs, about
|
|
46248
|
+
120 words. Never sent to the agent. Usually the SHORT text.
|
|
46249
|
+
"title", "agent", "model", "autoAdvance", "resourceKey"
|
|
46190
46250
|
Notes:
|
|
46191
|
-
Each item is { "
|
|
46251
|
+
Each item is { "instructions": "...", "summary": "...", "title": "...",
|
|
46192
46252
|
"agent": "codex", "model": "gpt-6.1-terra", "autoAdvance": true|false,
|
|
46193
46253
|
"resourceKey": "..." }.
|
|
46194
46254
|
model requires agent. Per-item autoAdvance and agent win over the flags.
|
|
46195
|
-
|
|
46196
|
-
|
|
46255
|
+
A summary that looks swapped with its instructions (3x longer and 400+
|
|
46256
|
+
characters, or 1.5x longer, or headings or numbered steps over short
|
|
46257
|
+
instructions) returns an objective_fields_swapped warning; it is never
|
|
46258
|
+
refused. Style issues come back as "warnings" on the matching created
|
|
46259
|
+
objective.
|
|
46197
46260
|
Use agent "manual" (alias "human") to assign an objective to a person; it
|
|
46198
46261
|
takes no model and is never launched.
|
|
46199
46262
|
|
|
46200
46263
|
update-objective:
|
|
46201
46264
|
Purpose:
|
|
46202
|
-
Rewrite an objective title or
|
|
46265
|
+
Rewrite an objective title or summary, queue or dequeue compatibility
|
|
46203
46266
|
auto-advance, edit instruction text, request a generated summary, and/or
|
|
46204
46267
|
reassign the agent on an existing objective.
|
|
46205
46268
|
Required:
|
|
46206
46269
|
--objective-id <id>
|
|
46207
46270
|
At least one of:
|
|
46208
46271
|
--title <text>
|
|
46209
|
-
--
|
|
46210
|
-
|
|
46272
|
+
--summary <text> or --summary-file <path|->
|
|
46273
|
+
Short overview for people (1-3 paragraphs); never sent
|
|
46274
|
+
to the agent. Empty removes it.
|
|
46275
|
+
--summary-request summarize | regenerate | retry
|
|
46211
46276
|
--auto-advance or --no-auto-advance
|
|
46212
46277
|
--instruction-text <text> or --instruction-text-file <path|->
|
|
46278
|
+
The complete brief the executing agent receives.
|
|
46213
46279
|
--objective-agent <id>
|
|
46214
46280
|
Optional:
|
|
46215
46281
|
--objective-model <id> / --objective-reasoning-effort <value>
|
|
@@ -46224,21 +46290,23 @@ update-objective:
|
|
|
46224
46290
|
custom title and restores instruction-derived presentation.
|
|
46225
46291
|
Instruction text may be edited only when the objective is in draft state.
|
|
46226
46292
|
Blank instruction text is allowed in that state.
|
|
46227
|
-
The
|
|
46228
|
-
only in draft state; people edit
|
|
46229
|
-
|
|
46293
|
+
The summary (and --summary-request) may be changed by an agent
|
|
46294
|
+
only in draft state; people edit summaries in any state in the app.
|
|
46295
|
+
A --summary that looks swapped with the instructions returns an
|
|
46296
|
+
objective_fields_swapped warning; it is stored as written.
|
|
46297
|
+
An empty --summary removes the summary: Overlord then writes none,
|
|
46230
46298
|
even after instruction edits, until a person selects Summarize. While a
|
|
46231
46299
|
person's removal is in force, agent text is not stored (warning
|
|
46232
|
-
|
|
46233
|
-
--
|
|
46300
|
+
summary_suppressed) and summary requests are refused (409).
|
|
46301
|
+
--summary-request summarize|regenerate asks Overlord to write the
|
|
46234
46302
|
summary; retry re-requests a failed one. Instructions shorter than 280
|
|
46235
46303
|
characters are shown in full and are not summarized (409
|
|
46236
|
-
|
|
46304
|
+
summary_not_eligible).
|
|
46237
46305
|
Returns:
|
|
46238
46306
|
The updated objective JSON, including assignedAgent, model, reasoningEffort,
|
|
46239
|
-
resourceKey,
|
|
46240
|
-
|
|
46241
|
-
|
|
46307
|
+
resourceKey, summary and its state (summarySource, summaryStatus,
|
|
46308
|
+
summarySuppressed), plus "warnings": advisory summary_style issues,
|
|
46309
|
+
summary_suppressed and objective_fields_swapped. autoAdvance is
|
|
46242
46310
|
deprecated and derived from live queueEntry membership.
|
|
46243
46311
|
|
|
46244
46312
|
delete-missions:
|
|
@@ -46274,12 +46342,20 @@ create:
|
|
|
46274
46342
|
Create a draft mission without attaching. A project must be named
|
|
46275
46343
|
explicitly; use --unassigned-to-project only for deliberate account-owned
|
|
46276
46344
|
inbox capture.
|
|
46277
|
-
Required:
|
|
46278
|
-
--objective "<text>" or --
|
|
46345
|
+
Required (one of):
|
|
46346
|
+
--objective-instructions "<text>" or --objective-instructions-file <path|->
|
|
46347
|
+
INSTRUCTIONS: the complete brief the executing agent receives (context,
|
|
46348
|
+
steps, done-when). Usually the LONG text. Positional text also works.
|
|
46349
|
+
--objectives-json / --objectives-file <path|->
|
|
46350
|
+
Items { "instructions": "...", "summary": "...", "title": "...", ... }.
|
|
46279
46351
|
Optional:
|
|
46352
|
+
--objective-summary "<text>" or --objective-summary-file <path|->
|
|
46353
|
+
SUMMARY: a short overview for people, 1-3 paragraphs (about 120 words).
|
|
46354
|
+
Never sent to the agent. Usually the SHORT text. With --objectives-json,
|
|
46355
|
+
set "summary" on each item instead.
|
|
46280
46356
|
--title <text>
|
|
46281
|
-
--resource <key> Resource key for the single --objective
|
|
46282
|
-
use resourceKey on each --objectives-json item
|
|
46357
|
+
--resource <key> Resource key for the single --objective-instructions
|
|
46358
|
+
form; use resourceKey on each --objectives-json item
|
|
46283
46359
|
--project-id <id> Required for a project mission; never inferred
|
|
46284
46360
|
--unassigned-to-project Intentionally create an account-owned inbox item
|
|
46285
46361
|
--assigned-to <id> Workspace member to own the mission (meaningless on the inbox fallback)
|
|
@@ -46292,28 +46368,35 @@ create:
|
|
|
46292
46368
|
objective just to name an agent. This is not --agent, which records
|
|
46293
46369
|
creation provenance. Seeds only items with no "agent" of their own;
|
|
46294
46370
|
--objective-model requires --objective-agent.
|
|
46295
|
-
--objective-description <text> or --objective-description-file <path|->
|
|
46296
|
-
Human-facing summary of the single --objective (see Notes). With
|
|
46297
|
-
--objectives-json, set "description" on each item instead.
|
|
46298
46371
|
Notes:
|
|
46299
|
-
|
|
46300
|
-
|
|
46301
|
-
|
|
46302
|
-
|
|
46303
|
-
|
|
46304
|
-
|
|
46305
|
-
|
|
46372
|
+
Do not swap the two texts. The agent receives ONLY the instructions; the
|
|
46373
|
+
summary is for the people who decide whether to launch it: one to three
|
|
46374
|
+
prose paragraphs in Simplified Technical English style that open with the
|
|
46375
|
+
goal and close with the done-when sentence. Omit it and Overlord writes one
|
|
46376
|
+
for long agent-written objectives.
|
|
46377
|
+
If the texts look swapped (a summary 3x longer than its instructions and
|
|
46378
|
+
400+ characters), or may be swapped (1.5x longer, or Markdown headings,
|
|
46379
|
+
numbered steps or a "Done when:" label over short instructions), the
|
|
46380
|
+
created objective carries an objective_fields_swapped warning naming both
|
|
46381
|
+
flags. Nothing is refused. Style issues come back as "warnings" on the
|
|
46382
|
+
created objective; the text is stored as written.
|
|
46306
46383
|
|
|
46307
46384
|
prompt:
|
|
46308
46385
|
Purpose:
|
|
46309
46386
|
Create a mission and attach to it in one call.
|
|
46310
46387
|
Required:
|
|
46311
|
-
--objective "<text>" or --
|
|
46388
|
+
--objective-instructions "<text>" or --objective-instructions-file <path|->
|
|
46389
|
+
INSTRUCTIONS: the complete brief the executing agent receives. Usually
|
|
46390
|
+
the LONG text. Or --objectives-json / --objectives-file <path|->.
|
|
46312
46391
|
--project-id <id>
|
|
46313
46392
|
Optional:
|
|
46393
|
+
--objective-summary "<text>" or --objective-summary-file <path|->
|
|
46394
|
+
SUMMARY: a short overview for people, 1-3 paragraphs. Never sent to the
|
|
46395
|
+
agent. Usually the SHORT text. With --objectives-json, set "summary" on
|
|
46396
|
+
each item instead. Same swap guard as create.
|
|
46314
46397
|
--title <text>
|
|
46315
|
-
--resource <key> Resource key for the single --objective
|
|
46316
|
-
use resourceKey on each --objectives-json item
|
|
46398
|
+
--resource <key> Resource key for the single --objective-instructions
|
|
46399
|
+
form; use resourceKey on each --objectives-json item
|
|
46317
46400
|
--agent <identifier>
|
|
46318
46401
|
--external-session-id <id>
|
|
46319
46402
|
--assigned-to <id> Workspace member to own the mission
|
|
@@ -46323,9 +46406,6 @@ prompt:
|
|
|
46323
46406
|
--objective-agent <id> / --objective-model <id>
|
|
46324
46407
|
Assign a launch agent (and its model) to the objectives created here.
|
|
46325
46408
|
Distinct from --agent, which names the attaching agent for the session.
|
|
46326
|
-
--objective-description <text> or --objective-description-file <path|->
|
|
46327
|
-
Human-facing summary of the single --objective (see Notes). With
|
|
46328
|
-
--objectives-json, set "description" on each item instead.
|
|
46329
46409
|
Returns:
|
|
46330
46410
|
New mission/session JSON plus SESSION_KEY on stderr when available.
|
|
46331
46411
|
|
|
@@ -46877,7 +46957,7 @@ var init_resource_observations = __esm({
|
|
|
46877
46957
|
|
|
46878
46958
|
// src/runner-identity.ts
|
|
46879
46959
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
46880
|
-
import { existsSync as existsSync28, mkdirSync as
|
|
46960
|
+
import { existsSync as existsSync28, mkdirSync as mkdirSync13, readFileSync as readFileSync20, writeFileSync as writeFileSync13 } from "node:fs";
|
|
46881
46961
|
import { hostname as hostname6 } from "node:os";
|
|
46882
46962
|
import path37 from "node:path";
|
|
46883
46963
|
function envValue(name) {
|
|
@@ -46902,8 +46982,8 @@ function resolveRunnerInstanceId(dataDir = resolveGlobalDataDir()) {
|
|
|
46902
46982
|
}
|
|
46903
46983
|
const runnerInstanceId = randomUUID4();
|
|
46904
46984
|
try {
|
|
46905
|
-
|
|
46906
|
-
|
|
46985
|
+
mkdirSync13(path37.dirname(statePath), { recursive: true });
|
|
46986
|
+
writeFileSync13(statePath, `${JSON.stringify({ runnerInstanceId }, null, 2)}
|
|
46907
46987
|
`, { mode: 384 });
|
|
46908
46988
|
} catch {
|
|
46909
46989
|
}
|
|
@@ -46948,17 +47028,17 @@ import { execFile as execFile2 } from "node:child_process";
|
|
|
46948
47028
|
import {
|
|
46949
47029
|
chmodSync as chmodSync7,
|
|
46950
47030
|
existsSync as existsSync29,
|
|
46951
|
-
mkdirSync as
|
|
47031
|
+
mkdirSync as mkdirSync14,
|
|
46952
47032
|
readFileSync as readFileSync21,
|
|
46953
47033
|
rmSync as rmSync6,
|
|
46954
47034
|
statSync as statSync9,
|
|
46955
|
-
writeFileSync as
|
|
47035
|
+
writeFileSync as writeFileSync14
|
|
46956
47036
|
} from "node:fs";
|
|
46957
47037
|
import os7 from "node:os";
|
|
46958
47038
|
import path38 from "node:path";
|
|
46959
47039
|
import { promisify } from "node:util";
|
|
46960
47040
|
function writeServiceFile(filePath, contents) {
|
|
46961
|
-
|
|
47041
|
+
writeFileSync14(filePath, contents, { mode: 384 });
|
|
46962
47042
|
chmodSync7(filePath, 384);
|
|
46963
47043
|
}
|
|
46964
47044
|
function resolveRunnerEntryScript(argv = process.argv) {
|
|
@@ -47022,8 +47102,8 @@ function readRunnerServiceState(dataDir = resolveGlobalDataDir()) {
|
|
|
47022
47102
|
}
|
|
47023
47103
|
}
|
|
47024
47104
|
function writeRunnerServiceState(state, dataDir = resolveGlobalDataDir()) {
|
|
47025
|
-
|
|
47026
|
-
|
|
47105
|
+
mkdirSync14(dataDir, { recursive: true });
|
|
47106
|
+
writeFileSync14(runnerServiceStatePath(dataDir), `${JSON.stringify(state, null, 2)}
|
|
47027
47107
|
`, "utf8");
|
|
47028
47108
|
}
|
|
47029
47109
|
function patchRunnerServiceState(patch, dataDir = resolveGlobalDataDir()) {
|
|
@@ -47294,8 +47374,8 @@ var init_runner_service = __esm({
|
|
|
47294
47374
|
});
|
|
47295
47375
|
}
|
|
47296
47376
|
async install(opts) {
|
|
47297
|
-
|
|
47298
|
-
|
|
47377
|
+
mkdirSync14(launchAgentsDir(), { recursive: true });
|
|
47378
|
+
mkdirSync14(path38.join(resolveGlobalDataDir(), "logs"), { recursive: true });
|
|
47299
47379
|
await this.runSteps(planLaunchdUnloadCommands({ uid: this.uid() }));
|
|
47300
47380
|
writeServiceFile(this.unitPath(), this.render(opts));
|
|
47301
47381
|
if (opts.autoStart) await this.start();
|
|
@@ -47342,7 +47422,7 @@ var init_runner_service = __esm({
|
|
|
47342
47422
|
return renderSystemdUnit(opts);
|
|
47343
47423
|
}
|
|
47344
47424
|
async install(opts) {
|
|
47345
|
-
|
|
47425
|
+
mkdirSync14(systemdUserDir(), { recursive: true });
|
|
47346
47426
|
writeServiceFile(this.unitPath(), this.render(opts));
|
|
47347
47427
|
await runCommand("systemctl", ["--user", "daemon-reload"]);
|
|
47348
47428
|
await runCommand("systemctl", ["--user", "enable", this.identifier]);
|
|
@@ -47567,7 +47647,7 @@ __export(commands_exports, {
|
|
|
47567
47647
|
sanitizeRunnerFailureMessage: () => sanitizeRunnerFailureMessage,
|
|
47568
47648
|
shouldRefuseInlineRunnerLaunch: () => shouldRefuseInlineRunnerLaunch
|
|
47569
47649
|
});
|
|
47570
|
-
import { readFileSync as readFileSync22, writeFileSync as
|
|
47650
|
+
import { readFileSync as readFileSync22, writeFileSync as writeFileSync15 } from "node:fs";
|
|
47571
47651
|
import path40 from "node:path";
|
|
47572
47652
|
function resourceAccessModeBody(value2) {
|
|
47573
47653
|
if (typeof value2 !== "string") return {};
|
|
@@ -48290,9 +48370,15 @@ Run \`${primaryCommand} protocol help\` for usage.`
|
|
|
48290
48370
|
batchEvidence: suppliedEvidence
|
|
48291
48371
|
};
|
|
48292
48372
|
}
|
|
48373
|
+
const scratchDir = process.env.OVERLORD_TMPDIR?.trim();
|
|
48374
|
+
const inheritedScratchName = scratchDir && isSessionScratchDir(workingDirectory, scratchDir) ? path40.basename(scratchDir) : void 0;
|
|
48375
|
+
if (scratchDir && inheritedScratchName && subcommand === "resume-follow-up") {
|
|
48376
|
+
ensureHarnessScratchDir(workingDirectory, scratchDir);
|
|
48377
|
+
}
|
|
48378
|
+
const isActiveSessionScratch = sessionLivenessCheck(readActiveSessions(workingDirectory));
|
|
48293
48379
|
pruneStaleProjectTmp({
|
|
48294
48380
|
workingDirectory,
|
|
48295
|
-
isSessionLive:
|
|
48381
|
+
isSessionLive: (name) => name === inheritedScratchName || isActiveSessionScratch(name)
|
|
48296
48382
|
});
|
|
48297
48383
|
const attemptKind = attemptKindFor(subcommand);
|
|
48298
48384
|
const attempt = attemptKind ? prepareOperationAttempt({
|
|
@@ -48374,8 +48460,6 @@ Run \`${primaryCommand} protocol help\` for usage.`
|
|
|
48374
48460
|
path: protocolPath,
|
|
48375
48461
|
body: { ...protocolBody, flags }
|
|
48376
48462
|
});
|
|
48377
|
-
} else if (isExecutionRequestAlreadyLinkedError(error62)) {
|
|
48378
|
-
throw new CliError({ message: formatExecutionRequestAlreadyLinkedDiagnostic() });
|
|
48379
48463
|
} else {
|
|
48380
48464
|
const conflict = missionSummaryConflictOutput(error62);
|
|
48381
48465
|
if (conflict) printJson(conflict);
|
|
@@ -48493,15 +48577,14 @@ Run \`${primaryCommand} protocol help\` for usage.`
|
|
|
48493
48577
|
objectiveId: objectiveRef,
|
|
48494
48578
|
sessionKey: deliveredSessionKey ?? null
|
|
48495
48579
|
});
|
|
48496
|
-
|
|
48580
|
+
removeLaunchBriefing(
|
|
48497
48581
|
workingDirectory,
|
|
48498
|
-
|
|
48499
|
-
contextFile: deliveredBriefingPath({
|
|
48582
|
+
deliveredBriefingPath({
|
|
48500
48583
|
workingDirectory,
|
|
48501
48584
|
objectiveAliases: deliveredEntry?.objectiveAliases ?? [],
|
|
48502
48585
|
missionId
|
|
48503
48586
|
})
|
|
48504
|
-
|
|
48587
|
+
);
|
|
48505
48588
|
if (readActiveSessions(workingDirectory).length === 0) {
|
|
48506
48589
|
clearActiveMissionPointer(workingDirectory);
|
|
48507
48590
|
}
|
|
@@ -48523,7 +48606,7 @@ Run \`${primaryCommand} protocol help\` for usage.`
|
|
|
48523
48606
|
}
|
|
48524
48607
|
const bytes = await runtime.backend.getBytes(relUrl);
|
|
48525
48608
|
try {
|
|
48526
|
-
|
|
48609
|
+
writeFileSync15(output2, bytes, { flag: "wx", mode: 384 });
|
|
48527
48610
|
} catch (error62) {
|
|
48528
48611
|
throw new CliError({
|
|
48529
48612
|
message: `Could not create attachment file ${output2}: ${String(error62)}`
|
|
@@ -48696,7 +48779,17 @@ async function runManagementCommand({
|
|
|
48696
48779
|
case "create":
|
|
48697
48780
|
case "prompt": {
|
|
48698
48781
|
const objectivesJson = flagValue(parsed.flags, "--objectives-json");
|
|
48699
|
-
|
|
48782
|
+
for (const [retired, replacement] of [
|
|
48783
|
+
["--objective", "--objective-instructions"],
|
|
48784
|
+
["--objective-description", "--objective-summary"]
|
|
48785
|
+
]) {
|
|
48786
|
+
if (flagValue(parsed.flags, retired) !== void 0) {
|
|
48787
|
+
throw new CliError({
|
|
48788
|
+
message: `${retired} is now ${replacement}. --objective-instructions is the complete brief for the executing agent; --objective-summary is a short overview for people.`
|
|
48789
|
+
});
|
|
48790
|
+
}
|
|
48791
|
+
}
|
|
48792
|
+
const objective = parsed.positional.join(" ") || flagValue(parsed.flags, "--objective-instructions") || flagValue(parsed.flags, "--prompt");
|
|
48700
48793
|
const projectId = await discoverProjectId(runtime, flagValue(parsed.flags, "--project-id"));
|
|
48701
48794
|
const autoAdvance = flagOptionalBoolean({
|
|
48702
48795
|
flags: parsed.flags,
|
|
@@ -48717,9 +48810,9 @@ async function runManagementCommand({
|
|
|
48717
48810
|
})
|
|
48718
48811
|
) : objective ? [
|
|
48719
48812
|
withAgentSelection({
|
|
48720
|
-
objective,
|
|
48813
|
+
instructions: objective,
|
|
48721
48814
|
title: flagValue(parsed.flags, "--title") ?? null,
|
|
48722
|
-
...flagValue(parsed.flags, "--objective-
|
|
48815
|
+
...flagValue(parsed.flags, "--objective-summary") !== void 0 ? { summary: flagValue(parsed.flags, "--objective-summary") } : {},
|
|
48723
48816
|
...autoAdvance !== void 0 ? { autoAdvance } : {},
|
|
48724
48817
|
...flagValue(parsed.flags, "--resource") ? { resourceKey: flagValue(parsed.flags, "--resource") } : {}
|
|
48725
48818
|
})
|
|
@@ -48730,7 +48823,18 @@ async function runManagementCommand({
|
|
|
48730
48823
|
message: objectivesJson ? "objectives-json must contain at least one objective" : "Missing objective prompt text"
|
|
48731
48824
|
});
|
|
48732
48825
|
}
|
|
48733
|
-
const
|
|
48826
|
+
for (const [index, item] of objectives.entries()) {
|
|
48827
|
+
if (typeof item.summary !== "string" || typeof item.instructions !== "string") continue;
|
|
48828
|
+
const placement = assessObjectiveSummaryPlacement({
|
|
48829
|
+
instructions: item.instructions,
|
|
48830
|
+
summary: item.summary
|
|
48831
|
+
});
|
|
48832
|
+
if (placement.verdict === "warn") {
|
|
48833
|
+
const label = objectives.length > 1 ? `objectives[${index}]` : "objective";
|
|
48834
|
+
console.error(`Warning (objective_fields_swapped, ${label}): ${placement.message}`);
|
|
48835
|
+
}
|
|
48836
|
+
}
|
|
48837
|
+
const title = flagValue(parsed.flags, "--title") ?? first.title ?? first.instructions;
|
|
48734
48838
|
const mission = await runtime.backend.post({
|
|
48735
48839
|
path: "/api/missions",
|
|
48736
48840
|
body: {
|
|
@@ -49563,6 +49667,7 @@ var init_commands = __esm({
|
|
|
49563
49667
|
init_dist();
|
|
49564
49668
|
init_project_metadata();
|
|
49565
49669
|
init_local_target_mutation_runner();
|
|
49670
|
+
init_objective_summary_placement();
|
|
49566
49671
|
init_terminal_profile_types();
|
|
49567
49672
|
init_event();
|
|
49568
49673
|
init_active_mission();
|
|
@@ -49622,8 +49727,8 @@ var init_commands = __esm({
|
|
|
49622
49727
|
"--mission-ids-file",
|
|
49623
49728
|
"--objective-ids-file",
|
|
49624
49729
|
"--instruction-text-file",
|
|
49625
|
-
"--
|
|
49626
|
-
"--objective-
|
|
49730
|
+
"--objective-instructions-file",
|
|
49731
|
+
"--objective-summary-file"
|
|
49627
49732
|
];
|
|
49628
49733
|
SESSION_KEY_SUBCOMMANDS = /* @__PURE__ */ new Set([
|
|
49629
49734
|
"project-items",
|
|
@@ -49750,7 +49855,11 @@ var COMMAND_FLAGS = {
|
|
|
49750
49855
|
"add-et": ["--name", "--workspace-id"],
|
|
49751
49856
|
create: [
|
|
49752
49857
|
"--objectives-json",
|
|
49858
|
+
"--objective-instructions",
|
|
49859
|
+
"--objective-summary",
|
|
49860
|
+
// Retired names, accepted here only so the command can name the replacement.
|
|
49753
49861
|
"--objective",
|
|
49862
|
+
"--objective-description",
|
|
49754
49863
|
"--prompt",
|
|
49755
49864
|
"--project-id",
|
|
49756
49865
|
"--title",
|
|
@@ -49762,7 +49871,11 @@ var COMMAND_FLAGS = {
|
|
|
49762
49871
|
],
|
|
49763
49872
|
prompt: [
|
|
49764
49873
|
"--objectives-json",
|
|
49874
|
+
"--objective-instructions",
|
|
49875
|
+
"--objective-summary",
|
|
49876
|
+
// Retired names, accepted here only so the command can name the replacement.
|
|
49765
49877
|
"--objective",
|
|
49878
|
+
"--objective-description",
|
|
49766
49879
|
"--prompt",
|
|
49767
49880
|
"--project-id",
|
|
49768
49881
|
"--title",
|
|
@@ -50114,7 +50227,14 @@ async function dispatchCommand({
|
|
|
50114
50227
|
await runProtocolCommand2({
|
|
50115
50228
|
runtime,
|
|
50116
50229
|
subcommand: "create",
|
|
50117
|
-
|
|
50230
|
+
// An inbox capture has one text and no summary; `--objective` stays
|
|
50231
|
+
// its flag and maps onto the protocol's instructions flag (ADR 0083).
|
|
50232
|
+
args: [
|
|
50233
|
+
"--unassigned-to-project",
|
|
50234
|
+
...rest.map(
|
|
50235
|
+
(arg) => arg === "--objective" ? "--objective-instructions" : arg.startsWith("--objective=") ? `--objective-instructions=${arg.slice("--objective=".length)}` : arg
|
|
50236
|
+
)
|
|
50237
|
+
],
|
|
50118
50238
|
stdin,
|
|
50119
50239
|
primaryCommand
|
|
50120
50240
|
});
|