overlord-cli 0.2607191710.0 → 0.2607201427.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/index.js +169 -20
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13538,6 +13538,151 @@ var init_discover_project_local = __esm({
|
|
|
13538
13538
|
}
|
|
13539
13539
|
});
|
|
13540
13540
|
|
|
13541
|
+
// ../packages/contract/dist/launch-variables.js
|
|
13542
|
+
var LAUNCH_VARIABLES, LAUNCH_VARIABLE_NAMES;
|
|
13543
|
+
var init_launch_variables = __esm({
|
|
13544
|
+
"../packages/contract/dist/launch-variables.js"() {
|
|
13545
|
+
"use strict";
|
|
13546
|
+
LAUNCH_VARIABLES = [
|
|
13547
|
+
{
|
|
13548
|
+
name: "MISSION_ID",
|
|
13549
|
+
description: "Mission display id for the launch (e.g. coo:359).",
|
|
13550
|
+
example: "coo:359",
|
|
13551
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13552
|
+
},
|
|
13553
|
+
{
|
|
13554
|
+
name: "OVERLORD_MISSION_ID",
|
|
13555
|
+
description: "Same value as MISSION_ID \u2014 preferred Overlord-prefixed form.",
|
|
13556
|
+
example: "coo:359",
|
|
13557
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13558
|
+
},
|
|
13559
|
+
{
|
|
13560
|
+
name: "OVERLORD_BACKEND_URL",
|
|
13561
|
+
description: "Backend URL the agent CLI/MCP should call for this launch.",
|
|
13562
|
+
example: "http://127.0.0.1:4310",
|
|
13563
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13564
|
+
},
|
|
13565
|
+
{
|
|
13566
|
+
name: "OVERLORD_EXECUTION_REQUEST_ID",
|
|
13567
|
+
description: "Execution-request id when the launch is runner-driven. Empty/absent for a bare `ovld launch`.",
|
|
13568
|
+
example: "380e8a6a-ccf0-49f4-9761-f1c0ba02c39c",
|
|
13569
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13570
|
+
},
|
|
13571
|
+
{
|
|
13572
|
+
name: "OVERLORD_WORKING_DIRECTORY",
|
|
13573
|
+
description: "Absolute path the agent terminal cds into \u2014 the resolved execution-target checkout (or worktree).",
|
|
13574
|
+
example: "/Users/you/src/overlord",
|
|
13575
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13576
|
+
},
|
|
13577
|
+
{
|
|
13578
|
+
name: "OVERLORD_CONTEXT_FILE",
|
|
13579
|
+
description: "Absolute path to the markdown briefing written for this launch under `.overlord/tmp/`.",
|
|
13580
|
+
example: "/Users/you/src/overlord/.overlord/tmp/mission-coo-359.md",
|
|
13581
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13582
|
+
},
|
|
13583
|
+
{
|
|
13584
|
+
name: "OVERLORD_TMPDIR",
|
|
13585
|
+
description: "Project-scoped scratch directory (`.overlord/tmp/`). Also mirrored as TMPDIR/TMP/TEMP.",
|
|
13586
|
+
example: "/Users/you/src/overlord/.overlord/tmp",
|
|
13587
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13588
|
+
},
|
|
13589
|
+
{
|
|
13590
|
+
name: "TMPDIR",
|
|
13591
|
+
description: "Same path as OVERLORD_TMPDIR \u2014 standard temp-dir env name.",
|
|
13592
|
+
example: "/Users/you/src/overlord/.overlord/tmp",
|
|
13593
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13594
|
+
},
|
|
13595
|
+
{
|
|
13596
|
+
name: "TMP",
|
|
13597
|
+
description: "Same path as OVERLORD_TMPDIR \u2014 Windows-style temp-dir alias.",
|
|
13598
|
+
example: "/Users/you/src/overlord/.overlord/tmp",
|
|
13599
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13600
|
+
},
|
|
13601
|
+
{
|
|
13602
|
+
name: "TEMP",
|
|
13603
|
+
description: "Same path as OVERLORD_TMPDIR \u2014 Windows-style temp-dir alias.",
|
|
13604
|
+
example: "/Users/you/src/overlord/.overlord/tmp",
|
|
13605
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13606
|
+
},
|
|
13607
|
+
{
|
|
13608
|
+
name: "OVERLORD_PROJECT_RESOURCES",
|
|
13609
|
+
description: "JSON array of every project resource for this execution target (resourceKey, path, state, flags, accessMode). Set only when the project has resources.",
|
|
13610
|
+
example: '[{"resourceKey":"primary","path":"/repo/a","state":"ready","isPrimary":true,"accessMode":"read_write"}]',
|
|
13611
|
+
availableAt: ["plan_build", "terminal_env"],
|
|
13612
|
+
format: "JSON array"
|
|
13613
|
+
},
|
|
13614
|
+
{
|
|
13615
|
+
name: "OVERLORD_PROJECT_RESOURCES_PATHS",
|
|
13616
|
+
description: "Comma-separated absolute paths of connected project resources with explicit `:rw` or `:ro` permission suffixes (entries without a local path are omitted). `read_write` resources emit `:rw`; reference (`read`) resources emit `:ro`.",
|
|
13617
|
+
example: "/repo/a:rw,/repo/b:ro",
|
|
13618
|
+
availableAt: ["plan_build", "terminal_env"],
|
|
13619
|
+
format: "comma-separated paths with :rw/:ro suffix"
|
|
13620
|
+
},
|
|
13621
|
+
{
|
|
13622
|
+
name: "OVERLORD_PROJECT_RESOURCES_PATHS_CSV",
|
|
13623
|
+
description: "Alias of OVERLORD_PROJECT_RESOURCES_PATHS, kept for backward compatibility. Same comma-separated `:rw`/`:ro`-suffixed paths. Useful for env vars that expect a CSV list (e.g. AGENT_POD_EXTRA_ALLOWED_PATHS).",
|
|
13624
|
+
example: "/repo/a:rw,/repo/b:ro",
|
|
13625
|
+
availableAt: ["plan_build", "terminal_env"],
|
|
13626
|
+
format: "comma-separated paths with :rw/:ro suffix"
|
|
13627
|
+
},
|
|
13628
|
+
{
|
|
13629
|
+
name: "OVERLORD_PRIMARY_RESOURCE_PATH",
|
|
13630
|
+
description: "Absolute path of the primary (or else current) project resource when connected locally; empty string otherwise.",
|
|
13631
|
+
example: "/repo/a",
|
|
13632
|
+
availableAt: ["plan_build", "terminal_env"]
|
|
13633
|
+
}
|
|
13634
|
+
];
|
|
13635
|
+
LAUNCH_VARIABLE_NAMES = LAUNCH_VARIABLES.filter((variable) => variable.availableAt.includes("plan_build")).map((variable) => variable.name);
|
|
13636
|
+
}
|
|
13637
|
+
});
|
|
13638
|
+
|
|
13639
|
+
// ../packages/contract/dist/resource-paths.js
|
|
13640
|
+
function accessModeToResourcePathPermission({ accessMode, isPrimary = false }) {
|
|
13641
|
+
if (isPrimary)
|
|
13642
|
+
return "rw";
|
|
13643
|
+
return accessMode === "read" ? "ro" : "rw";
|
|
13644
|
+
}
|
|
13645
|
+
function formatResourcePathWithPermission({ path: path27, accessMode, isPrimary = false }) {
|
|
13646
|
+
const trimmed = path27.trim();
|
|
13647
|
+
if (!trimmed)
|
|
13648
|
+
return "";
|
|
13649
|
+
const permission = accessModeToResourcePathPermission({ accessMode, isPrimary });
|
|
13650
|
+
return `${trimmed}:${permission}`;
|
|
13651
|
+
}
|
|
13652
|
+
function formatProjectResourcePathsFromManifest(projectResources) {
|
|
13653
|
+
if (!Array.isArray(projectResources))
|
|
13654
|
+
return "";
|
|
13655
|
+
const paths = [];
|
|
13656
|
+
for (const entry of projectResources) {
|
|
13657
|
+
if (!entry || typeof entry !== "object")
|
|
13658
|
+
continue;
|
|
13659
|
+
const record = entry;
|
|
13660
|
+
const path27 = typeof record.path === "string" ? record.path.trim() : "";
|
|
13661
|
+
if (!path27)
|
|
13662
|
+
continue;
|
|
13663
|
+
paths.push(formatResourcePathWithPermission({
|
|
13664
|
+
path: path27,
|
|
13665
|
+
accessMode: typeof record.accessMode === "string" ? record.accessMode : null,
|
|
13666
|
+
isPrimary: record.isPrimary === true
|
|
13667
|
+
}));
|
|
13668
|
+
}
|
|
13669
|
+
return paths.join(",");
|
|
13670
|
+
}
|
|
13671
|
+
var init_resource_paths = __esm({
|
|
13672
|
+
"../packages/contract/dist/resource-paths.js"() {
|
|
13673
|
+
"use strict";
|
|
13674
|
+
}
|
|
13675
|
+
});
|
|
13676
|
+
|
|
13677
|
+
// ../packages/contract/dist/index.js
|
|
13678
|
+
var init_dist2 = __esm({
|
|
13679
|
+
"../packages/contract/dist/index.js"() {
|
|
13680
|
+
"use strict";
|
|
13681
|
+
init_launch_variables();
|
|
13682
|
+
init_resource_paths();
|
|
13683
|
+
}
|
|
13684
|
+
});
|
|
13685
|
+
|
|
13541
13686
|
// src/pre-launch.ts
|
|
13542
13687
|
function substitutePreLaunchVariables(commands, variables) {
|
|
13543
13688
|
return commands.map(
|
|
@@ -13559,17 +13704,6 @@ function substituteLaunchEnvVars(envVars, variables) {
|
|
|
13559
13704
|
}
|
|
13560
13705
|
return resolved;
|
|
13561
13706
|
}
|
|
13562
|
-
function resourcePaths(projectResources) {
|
|
13563
|
-
if (!Array.isArray(projectResources)) return [];
|
|
13564
|
-
const paths = [];
|
|
13565
|
-
for (const entry of projectResources) {
|
|
13566
|
-
if (entry && typeof entry === "object") {
|
|
13567
|
-
const path27 = entry.path;
|
|
13568
|
-
if (typeof path27 === "string" && path27.trim()) paths.push(path27.trim());
|
|
13569
|
-
}
|
|
13570
|
-
}
|
|
13571
|
-
return paths;
|
|
13572
|
-
}
|
|
13573
13707
|
function primaryResourcePath(projectResources) {
|
|
13574
13708
|
if (!Array.isArray(projectResources)) return "";
|
|
13575
13709
|
let currentPath = "";
|
|
@@ -13590,7 +13724,7 @@ function buildPreLaunchVariables({
|
|
|
13590
13724
|
contextFile,
|
|
13591
13725
|
tmpDir
|
|
13592
13726
|
}) {
|
|
13593
|
-
const
|
|
13727
|
+
const resourcePathsValue = formatProjectResourcePathsFromManifest(projectResources);
|
|
13594
13728
|
const scratch = typeof tmpDir === "string" ? tmpDir.trim() : "";
|
|
13595
13729
|
const cwd = typeof workingDirectory === "string" ? workingDirectory.trim() : "";
|
|
13596
13730
|
const contextPath = typeof contextFile === "string" ? contextFile.trim() : "";
|
|
@@ -13600,8 +13734,8 @@ function buildPreLaunchVariables({
|
|
|
13600
13734
|
OVERLORD_EXECUTION_REQUEST_ID: "",
|
|
13601
13735
|
OVERLORD_PROJECT_RESOURCES: "",
|
|
13602
13736
|
...launchEnv,
|
|
13603
|
-
OVERLORD_PROJECT_RESOURCES_PATHS:
|
|
13604
|
-
OVERLORD_PROJECT_RESOURCES_PATHS_CSV:
|
|
13737
|
+
OVERLORD_PROJECT_RESOURCES_PATHS: resourcePathsValue,
|
|
13738
|
+
OVERLORD_PROJECT_RESOURCES_PATHS_CSV: resourcePathsValue,
|
|
13605
13739
|
OVERLORD_PRIMARY_RESOURCE_PATH: primaryResourcePath(projectResources),
|
|
13606
13740
|
OVERLORD_WORKING_DIRECTORY: cwd,
|
|
13607
13741
|
OVERLORD_CONTEXT_FILE: contextPath,
|
|
@@ -13615,6 +13749,7 @@ var PLACEHOLDER_PATTERN;
|
|
|
13615
13749
|
var init_pre_launch = __esm({
|
|
13616
13750
|
"src/pre-launch.ts"() {
|
|
13617
13751
|
"use strict";
|
|
13752
|
+
init_dist2();
|
|
13618
13753
|
PLACEHOLDER_PATTERN = /\{([A-Z0-9_]+)\}/g;
|
|
13619
13754
|
}
|
|
13620
13755
|
});
|
|
@@ -16227,6 +16362,17 @@ __export(commands_exports, {
|
|
|
16227
16362
|
import { existsSync as existsSync22, readFileSync as readFileSync17 } from "node:fs";
|
|
16228
16363
|
import os5 from "node:os";
|
|
16229
16364
|
import path26 from "node:path";
|
|
16365
|
+
function resourceAccessModeBody(value) {
|
|
16366
|
+
if (typeof value !== "string") return {};
|
|
16367
|
+
const normalized = value.trim().toLowerCase();
|
|
16368
|
+
if (normalized === "read" || normalized === "ro") return { accessMode: "read" };
|
|
16369
|
+
if (normalized === "read_write" || normalized === "read-write" || normalized === "rw") {
|
|
16370
|
+
return { accessMode: "read_write" };
|
|
16371
|
+
}
|
|
16372
|
+
throw new CliError({
|
|
16373
|
+
message: `Invalid --access "${value}". Use "read" or "read_write".`
|
|
16374
|
+
});
|
|
16375
|
+
}
|
|
16230
16376
|
function writeProjectJsonFromResource({
|
|
16231
16377
|
directory,
|
|
16232
16378
|
projectId,
|
|
@@ -16234,6 +16380,7 @@ function writeProjectJsonFromResource({
|
|
|
16234
16380
|
}) {
|
|
16235
16381
|
const record = asRecord2(resource);
|
|
16236
16382
|
if (typeof record.id !== "string") return;
|
|
16383
|
+
if (record.accessMode === "read") return;
|
|
16237
16384
|
writeProjectJson({
|
|
16238
16385
|
directoryPath: directory,
|
|
16239
16386
|
projectId,
|
|
@@ -16937,7 +17084,8 @@ async function runManagementCommand({
|
|
|
16937
17084
|
body: {
|
|
16938
17085
|
directoryPath: directory,
|
|
16939
17086
|
...resourceKey ? { resourceKey } : {},
|
|
16940
|
-
isPrimary: flagValue(parsed.flags, "--primary") !== "false"
|
|
17087
|
+
isPrimary: flagValue(parsed.flags, "--primary") !== "false",
|
|
17088
|
+
...resourceAccessModeBody(flagValue(parsed.flags, "--access"))
|
|
16941
17089
|
}
|
|
16942
17090
|
});
|
|
16943
17091
|
writeProjectJsonFromResource({ directory, projectId, resource });
|
|
@@ -16955,7 +17103,8 @@ async function runManagementCommand({
|
|
|
16955
17103
|
body: {
|
|
16956
17104
|
sourceUrl,
|
|
16957
17105
|
resourceKey: flagValue(parsed.flags, "--key"),
|
|
16958
|
-
isPrimary: flagValue(parsed.flags, "--primary") !== "false"
|
|
17106
|
+
isPrimary: flagValue(parsed.flags, "--primary") !== "false",
|
|
17107
|
+
...resourceAccessModeBody(flagValue(parsed.flags, "--access"))
|
|
16959
17108
|
}
|
|
16960
17109
|
});
|
|
16961
17110
|
if (json) printJson({ resource });
|
|
@@ -17596,8 +17745,8 @@ var COMMAND_FLAGS = {
|
|
|
17596
17745
|
"--no-input",
|
|
17597
17746
|
"--if-needed"
|
|
17598
17747
|
],
|
|
17599
|
-
"add-cwd": ["--directory", "--key", "--project-id", "--primary"],
|
|
17600
|
-
"add-url": ["--url", "--project-id", "--key", "--primary"],
|
|
17748
|
+
"add-cwd": ["--directory", "--key", "--project-id", "--primary", "--access"],
|
|
17749
|
+
"add-url": ["--url", "--project-id", "--key", "--primary", "--access"],
|
|
17601
17750
|
create: ["--objectives-json", "--objective", "--prompt", "--project-id", "--title", "--resource"],
|
|
17602
17751
|
prompt: [
|
|
17603
17752
|
"--objectives-json",
|
|
@@ -17726,9 +17875,9 @@ Organizations:
|
|
|
17726
17875
|
|
|
17727
17876
|
Projects:
|
|
17728
17877
|
${primaryCommand} create-project --name "<name>" [--directory <path>|--no-directory]
|
|
17729
|
-
${primaryCommand} add-cwd [--directory <path>] [--project-id <id>] [--key <resourceKey>] [--primary true|false]
|
|
17878
|
+
${primaryCommand} add-cwd [--directory <path>] [--project-id <id>] [--key <resourceKey>] [--primary true|false] [--access read|read_write]
|
|
17730
17879
|
(prompts to pick a project when --project-id is omitted)
|
|
17731
|
-
${primaryCommand} add-url --url <git-url> --project-id <id> [--key <resourceKey>] [--primary true|false]
|
|
17880
|
+
${primaryCommand} add-url --url <git-url> --project-id <id> [--key <resourceKey>] [--primary true|false] [--access read|read_write]
|
|
17732
17881
|
|
|
17733
17882
|
Missions:
|
|
17734
17883
|
${primaryCommand} create "<objective>" [--objectives-json '[...]'] [--json]
|