agentplane 0.2.5 → 0.2.12
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/README.md +11 -0
- package/assets/AGENTS.md +72 -40
- package/assets/agents/CODER.json +0 -1
- package/assets/agents/INTEGRATOR.json +0 -1
- package/assets/agents/ORCHESTRATOR.json +1 -2
- package/assets/agents/PLANNER.json +1 -3
- package/assets/agents/TESTER.json +0 -1
- package/assets/agents/UPGRADER.json +17 -15
- package/bin/agentplane.js +109 -1
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +61 -36
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +4 -2
- package/dist/cli/critical/cli-runner.d.ts +2 -0
- package/dist/cli/critical/cli-runner.d.ts.map +1 -0
- package/dist/cli/critical/cli-runner.js +11 -0
- package/dist/cli/critical/harness.d.ts +22 -0
- package/dist/cli/critical/harness.d.ts.map +1 -0
- package/dist/cli/critical/harness.js +164 -0
- package/dist/cli/run-cli/command-catalog.d.ts +4 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +40 -22
- package/dist/cli/run-cli/commands/config.d.ts +5 -4
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.js +39 -29
- package/dist/cli/run-cli/commands/core.d.ts +2 -1
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +174 -67
- package/dist/cli/run-cli/commands/ide.d.ts +3 -1
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/ide.js +7 -6
- package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/git.js +9 -7
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/ide-sync.js +10 -1
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-agents.js +4 -24
- package/dist/cli/run-cli/commands/init/write-gitignore.d.ts +4 -0
- package/dist/cli/run-cli/commands/init/write-gitignore.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-gitignore.js +35 -0
- package/dist/cli/run-cli/commands/init.d.ts +1 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +32 -13
- package/dist/cli/run-cli/registry.run.d.ts +6 -2
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -1
- package/dist/cli/run-cli/registry.run.js +7 -2
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +98 -76
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +99 -3
- package/dist/cli/spec/parse-utils.d.ts +11 -0
- package/dist/cli/spec/parse-utils.d.ts.map +1 -0
- package/dist/cli/spec/parse-utils.js +28 -0
- package/dist/commands/block.command.d.ts +3 -18
- package/dist/commands/block.command.d.ts.map +1 -1
- package/dist/commands/block.command.js +2 -143
- package/dist/commands/block.run.d.ts +5 -0
- package/dist/commands/block.run.d.ts.map +1 -0
- package/dist/commands/block.run.js +22 -0
- package/dist/commands/block.spec.d.ts +17 -0
- package/dist/commands/block.spec.d.ts.map +1 -0
- package/dist/commands/block.spec.js +115 -0
- package/dist/commands/finish.command.d.ts +3 -27
- package/dist/commands/finish.command.d.ts.map +1 -1
- package/dist/commands/finish.command.js +2 -237
- package/dist/commands/finish.run.d.ts +5 -0
- package/dist/commands/finish.run.d.ts.map +1 -0
- package/dist/commands/finish.run.js +40 -0
- package/dist/commands/finish.spec.d.ts +26 -0
- package/dist/commands/finish.spec.d.ts.map +1 -0
- package/dist/commands/finish.spec.js +193 -0
- package/dist/commands/guard/impl/comment-commit.d.ts +1 -0
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +5 -1
- package/dist/commands/guard/impl/env.d.ts +2 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +2 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +42 -6
- package/dist/commands/recipes/impl/project.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project.js +5 -3
- package/dist/commands/release/apply.command.d.ts +11 -0
- package/dist/commands/release/apply.command.d.ts.map +1 -0
- package/dist/commands/release/apply.command.js +343 -0
- package/dist/commands/release/plan.command.d.ts +12 -0
- package/dist/commands/release/plan.command.d.ts.map +1 -0
- package/dist/commands/release/plan.command.js +206 -0
- package/dist/commands/release/release.command.d.ts +5 -0
- package/dist/commands/release/release.command.d.ts.map +1 -0
- package/dist/commands/release/release.command.js +18 -0
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +7 -2
- package/dist/commands/shared/task-backend.d.ts +1 -0
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/start.command.d.ts +3 -18
- package/dist/commands/start.command.d.ts.map +1 -1
- package/dist/commands/start.command.js +2 -143
- package/dist/commands/start.run.d.ts +5 -0
- package/dist/commands/start.run.d.ts.map +1 -0
- package/dist/commands/start.run.js +22 -0
- package/dist/commands/start.spec.d.ts +17 -0
- package/dist/commands/start.spec.d.ts.map +1 -0
- package/dist/commands/start.spec.js +115 -0
- package/dist/commands/task/add.command.d.ts.map +1 -1
- package/dist/commands/task/add.command.js +1 -7
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +21 -3
- package/dist/commands/task/derive.command.d.ts.map +1 -1
- package/dist/commands/task/derive.command.js +1 -7
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +29 -1
- package/dist/commands/task/list.command.d.ts +3 -8
- package/dist/commands/task/list.command.d.ts.map +1 -1
- package/dist/commands/task/list.command.js +2 -67
- package/dist/commands/task/list.run.d.ts +5 -0
- package/dist/commands/task/list.run.d.ts.map +1 -0
- package/dist/commands/task/list.run.js +10 -0
- package/dist/commands/task/list.spec.d.ts +7 -0
- package/dist/commands/task/list.spec.d.ts.map +1 -0
- package/dist/commands/task/list.spec.js +51 -0
- package/dist/commands/task/next.command.d.ts +3 -8
- package/dist/commands/task/next.command.d.ts.map +1 -1
- package/dist/commands/task/next.command.js +2 -89
- package/dist/commands/task/next.run.d.ts +5 -0
- package/dist/commands/task/next.run.d.ts.map +1 -0
- package/dist/commands/task/next.run.js +11 -0
- package/dist/commands/task/next.spec.d.ts +7 -0
- package/dist/commands/task/next.spec.d.ts.map +1 -0
- package/dist/commands/task/next.spec.js +69 -0
- package/dist/commands/task/search.command.d.ts +3 -10
- package/dist/commands/task/search.command.d.ts.map +1 -1
- package/dist/commands/task/search.command.js +2 -101
- package/dist/commands/task/search.run.d.ts +5 -0
- package/dist/commands/task/search.run.d.ts.map +1 -0
- package/dist/commands/task/search.run.js +13 -0
- package/dist/commands/task/search.spec.d.ts +9 -0
- package/dist/commands/task/search.spec.d.ts.map +1 -0
- package/dist/commands/task/search.spec.js +79 -0
- package/dist/commands/task/set-status.command.d.ts.map +1 -1
- package/dist/commands/task/set-status.command.js +1 -7
- package/dist/commands/task/shared.d.ts +1 -0
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +20 -8
- package/dist/commands/task/show.command.d.ts +3 -7
- package/dist/commands/task/show.command.d.ts.map +1 -1
- package/dist/commands/task/show.command.js +2 -19
- package/dist/commands/task/show.run.d.ts +5 -0
- package/dist/commands/task/show.run.d.ts.map +1 -0
- package/dist/commands/task/show.run.js +11 -0
- package/dist/commands/task/show.spec.d.ts +6 -0
- package/dist/commands/task/show.spec.d.ts.map +1 -0
- package/dist/commands/task/show.spec.js +8 -0
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +21 -3
- package/dist/commands/task/update.command.d.ts.map +1 -1
- package/dist/commands/task/update.command.js +1 -7
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +149 -31
- package/dist/commands/verify.command.d.ts +3 -15
- package/dist/commands/verify.command.d.ts.map +1 -1
- package/dist/commands/verify.command.js +2 -113
- package/dist/commands/verify.run.d.ts +5 -0
- package/dist/commands/verify.run.d.ts.map +1 -0
- package/dist/commands/verify.run.js +17 -0
- package/dist/commands/verify.spec.d.ts +14 -0
- package/dist/commands/verify.spec.d.ts.map +1 -0
- package/dist/commands/verify.spec.js +96 -0
- package/dist/policy/rules/commit-subject.d.ts.map +1 -1
- package/dist/policy/rules/commit-subject.js +1 -13
- package/dist/shared/agent-emoji.d.ts +5 -0
- package/dist/shared/agent-emoji.d.ts.map +1 -0
- package/dist/shared/agent-emoji.js +50 -0
- package/dist/shared/direct-work-lock.d.ts +10 -0
- package/dist/shared/direct-work-lock.d.ts.map +1 -0
- package/dist/shared/direct-work-lock.js +24 -0
- package/package.json +2 -2
|
@@ -69,7 +69,7 @@ const ROLE_GUIDES = [
|
|
|
69
69
|
role: "ORCHESTRATOR",
|
|
70
70
|
lines: [
|
|
71
71
|
"- Plan intake: `agentplane task list` / `agentplane task show <task-id>`",
|
|
72
|
-
'- After plan approval (unless the user opts out): `agentplane task new --title "..." --description "..." --priority med --owner ORCHESTRATOR --depends-on "[]" --tag <tag>`',
|
|
72
|
+
'- After plan approval (unless the user opts out): create exactly one tracking task: `agentplane task new --title "..." --description "..." --priority med --owner ORCHESTRATOR --depends-on "[]" --tag <tag>`',
|
|
73
73
|
"- Optional scaffold: `agentplane task scaffold <task-id>`",
|
|
74
74
|
"- Two-stage verification: `## Verify Steps` is the ex-ante contract; `agentplane verify ...` appends an ex-post entry into `## Verification`.",
|
|
75
75
|
],
|
|
@@ -187,9 +187,11 @@ export function renderQuickstart() {
|
|
|
187
187
|
return [
|
|
188
188
|
"# agentplane quickstart",
|
|
189
189
|
"",
|
|
190
|
-
"
|
|
190
|
+
"AGENTS.md is the source of truth for the workflow/process policy; quickstart and role output are the source of truth for CLI syntax and artifacts.",
|
|
191
191
|
"Do not edit `.agentplane/tasks.json` by hand.",
|
|
192
192
|
"",
|
|
193
|
+
"- See AGENTS.md for the canonical workflow policy and approval gates.",
|
|
194
|
+
"",
|
|
193
195
|
"## Project setup",
|
|
194
196
|
"",
|
|
195
197
|
"- `agentplane init` (bootstrap `.agentplane/`)",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-runner.d.ts","sourceRoot":"","sources":["../../../src/cli/critical/cli-runner.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { runCli } from "../run-cli.js";
|
|
2
|
+
async function main() {
|
|
3
|
+
const argv = process.argv.slice(2);
|
|
4
|
+
const code = await runCli(argv);
|
|
5
|
+
process.exitCode = code;
|
|
6
|
+
}
|
|
7
|
+
main().catch((err) => {
|
|
8
|
+
// Last-resort fallback. The contract for tests is "exit non-zero and surface the error".
|
|
9
|
+
console.error(err);
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type RunCliResult = {
|
|
2
|
+
code: number;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function makeTempDir(prefix?: string): Promise<string>;
|
|
7
|
+
export declare function ensureDir(dir: string): Promise<void>;
|
|
8
|
+
export declare function writeText(filePath: string, content: string): Promise<void>;
|
|
9
|
+
export declare function readText(filePath: string): Promise<string>;
|
|
10
|
+
export declare function real(p: string): Promise<string>;
|
|
11
|
+
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
12
|
+
export declare function listDirRecursive(root: string): Promise<string[]>;
|
|
13
|
+
export declare function gitInit(repoRoot: string, branch?: string): Promise<void>;
|
|
14
|
+
export declare function gitCommitAll(repoRoot: string, message: string): Promise<void>;
|
|
15
|
+
export declare function gitHead(repoRoot: string): Promise<string>;
|
|
16
|
+
export declare function runCli(args: string[], opts: {
|
|
17
|
+
cwd: string;
|
|
18
|
+
extraEnv?: Record<string, string>;
|
|
19
|
+
}): Promise<RunCliResult>;
|
|
20
|
+
export declare function expectCliError(result: RunCliResult, code: number, errCode: string): void;
|
|
21
|
+
export declare function cleanGitEnv(): NodeJS.ProcessEnv;
|
|
22
|
+
//# sourceMappingURL=harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../../src/cli/critical/harness.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgBF,wBAAsB,WAAW,CAAC,MAAM,SAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAElF;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhF;AAED,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEhE;AAED,wBAAsB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAErD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAatE;AAED,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB9E;AAED,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGnF;AAED,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAM/D;AAED,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACvD,OAAO,CAAC,YAAY,CAAC,CA8CvB;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAexF;AAED,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAqB/C"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { mkdir, mkdtemp, readFile, readdir, realpath, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
function renderExecField(v) {
|
|
8
|
+
if (v == null)
|
|
9
|
+
return "";
|
|
10
|
+
if (typeof v === "string")
|
|
11
|
+
return v;
|
|
12
|
+
if (Buffer.isBuffer(v))
|
|
13
|
+
return v.toString("utf8");
|
|
14
|
+
try {
|
|
15
|
+
return JSON.stringify(v);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return "[unserializable]";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export async function makeTempDir(prefix = "agentplane-critical-") {
|
|
22
|
+
return await mkdtemp(path.join(os.tmpdir(), prefix));
|
|
23
|
+
}
|
|
24
|
+
export async function ensureDir(dir) {
|
|
25
|
+
await mkdir(dir, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
export async function writeText(filePath, content) {
|
|
28
|
+
await ensureDir(path.dirname(filePath));
|
|
29
|
+
await writeFile(filePath, content, "utf8");
|
|
30
|
+
}
|
|
31
|
+
export async function readText(filePath) {
|
|
32
|
+
return await readFile(filePath, "utf8");
|
|
33
|
+
}
|
|
34
|
+
export async function real(p) {
|
|
35
|
+
return await realpath(p);
|
|
36
|
+
}
|
|
37
|
+
export async function pathExists(filePath) {
|
|
38
|
+
try {
|
|
39
|
+
await stat(filePath);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export async function listDirRecursive(root) {
|
|
47
|
+
const out = [];
|
|
48
|
+
async function walk(dir) {
|
|
49
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
const abs = path.join(dir, entry.name);
|
|
52
|
+
const rel = path.relative(root, abs);
|
|
53
|
+
out.push(rel);
|
|
54
|
+
if (entry.isDirectory())
|
|
55
|
+
await walk(abs);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (await pathExists(root))
|
|
59
|
+
await walk(root);
|
|
60
|
+
return out.toSorted((a, b) => a.localeCompare(b));
|
|
61
|
+
}
|
|
62
|
+
export async function gitInit(repoRoot, branch = "main") {
|
|
63
|
+
await ensureDir(repoRoot);
|
|
64
|
+
// Use real git, but avoid reading developer global/system configs.
|
|
65
|
+
await execFileAsync("git", ["init", "-q", "-b", branch], {
|
|
66
|
+
cwd: repoRoot,
|
|
67
|
+
env: cleanGitEnv(),
|
|
68
|
+
}).catch(async () => {
|
|
69
|
+
// Older git: init without -b, then create branch.
|
|
70
|
+
await execFileAsync("git", ["init", "-q"], { cwd: repoRoot, env: cleanGitEnv() });
|
|
71
|
+
await execFileAsync("git", ["checkout", "-q", "-b", branch], {
|
|
72
|
+
cwd: repoRoot,
|
|
73
|
+
env: cleanGitEnv(),
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
// Repo-local identity to avoid relying on global git config.
|
|
77
|
+
await execFileAsync("git", ["config", "user.email", "agentplane-test@example.com"], {
|
|
78
|
+
cwd: repoRoot,
|
|
79
|
+
env: cleanGitEnv(),
|
|
80
|
+
});
|
|
81
|
+
await execFileAsync("git", ["config", "user.name", "Agentplane Test"], {
|
|
82
|
+
cwd: repoRoot,
|
|
83
|
+
env: cleanGitEnv(),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
export async function gitCommitAll(repoRoot, message) {
|
|
87
|
+
await execFileAsync("git", ["add", "-A"], { cwd: repoRoot, env: cleanGitEnv() });
|
|
88
|
+
await execFileAsync("git", ["commit", "-m", message], { cwd: repoRoot, env: cleanGitEnv() });
|
|
89
|
+
}
|
|
90
|
+
export async function gitHead(repoRoot) {
|
|
91
|
+
const { stdout } = await execFileAsync("git", ["rev-parse", "HEAD"], {
|
|
92
|
+
cwd: repoRoot,
|
|
93
|
+
env: cleanGitEnv(),
|
|
94
|
+
});
|
|
95
|
+
return String(stdout).trim();
|
|
96
|
+
}
|
|
97
|
+
export async function runCli(args, opts) {
|
|
98
|
+
// Run as a separate process using bun to execute the TS runner.
|
|
99
|
+
const runnerPath = path.join(process.cwd(), "packages", "agentplane", "src", "cli", "critical", "cli-runner.ts");
|
|
100
|
+
const isolatedHome = await makeTempDir("agentplane-critical-home-");
|
|
101
|
+
const isolatedAgentplaneHome = await makeTempDir("agentplane-critical-ap-home-");
|
|
102
|
+
const env = {
|
|
103
|
+
...process.env,
|
|
104
|
+
...cleanGitEnv(),
|
|
105
|
+
HOME: isolatedHome,
|
|
106
|
+
XDG_CONFIG_HOME: path.join(isolatedHome, ".config"),
|
|
107
|
+
AGENTPLANE_HOME: isolatedAgentplaneHome,
|
|
108
|
+
AGENTPLANE_NO_UPDATE_CHECK: "1",
|
|
109
|
+
...opts.extraEnv,
|
|
110
|
+
};
|
|
111
|
+
// execFileAsync throws on non-zero exit. Normalize into a stable `{code,stdout,stderr}` shape.
|
|
112
|
+
let code = 0;
|
|
113
|
+
let stdout = "";
|
|
114
|
+
let stderr = "";
|
|
115
|
+
try {
|
|
116
|
+
const ok = (await execFileAsync("bun", [runnerPath, ...args], {
|
|
117
|
+
cwd: opts.cwd,
|
|
118
|
+
env,
|
|
119
|
+
encoding: "utf8",
|
|
120
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
121
|
+
}));
|
|
122
|
+
stdout = String(ok.stdout ?? "");
|
|
123
|
+
stderr = String(ok.stderr ?? "");
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
const e = err;
|
|
127
|
+
stdout = renderExecField(e.stdout);
|
|
128
|
+
stderr = renderExecField(e.stderr);
|
|
129
|
+
code = typeof e.code === "number" ? e.code : 1;
|
|
130
|
+
}
|
|
131
|
+
return { code, stdout, stderr };
|
|
132
|
+
}
|
|
133
|
+
export function expectCliError(result, code, errCode) {
|
|
134
|
+
if (result.code !== code) {
|
|
135
|
+
throw new Error(`Expected exit code ${code} but got ${result.code}\n` +
|
|
136
|
+
`stdout:\n${result.stdout}\n` +
|
|
137
|
+
`stderr:\n${result.stderr}\n`);
|
|
138
|
+
}
|
|
139
|
+
if (!result.stderr.includes(`error [${errCode}]`)) {
|
|
140
|
+
throw new Error(`Expected stderr to include error [${errCode}]\n` +
|
|
141
|
+
`stdout:\n${result.stdout}\n` +
|
|
142
|
+
`stderr:\n${result.stderr}\n`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export function cleanGitEnv() {
|
|
146
|
+
const env = { ...process.env };
|
|
147
|
+
// Prevent git from inheriting caller-specific repository bindings.
|
|
148
|
+
delete env.GIT_DIR;
|
|
149
|
+
delete env.GIT_WORK_TREE;
|
|
150
|
+
delete env.GIT_COMMON_DIR;
|
|
151
|
+
delete env.GIT_INDEX_FILE;
|
|
152
|
+
delete env.GIT_OBJECT_DIRECTORY;
|
|
153
|
+
delete env.GIT_ALTERNATE_OBJECT_DIRECTORIES;
|
|
154
|
+
// Disable global/system configs to avoid developer machine drift.
|
|
155
|
+
env.GIT_CONFIG_GLOBAL = "/dev/null";
|
|
156
|
+
env.GIT_CONFIG_SYSTEM = "/dev/null";
|
|
157
|
+
env.GIT_TERMINAL_PROMPT = "0";
|
|
158
|
+
// Provide identity for commits when commands rely on it.
|
|
159
|
+
env.GIT_AUTHOR_NAME = env.GIT_AUTHOR_NAME ?? "Agentplane Test";
|
|
160
|
+
env.GIT_AUTHOR_EMAIL = env.GIT_AUTHOR_EMAIL ?? "agentplane-test@example.com";
|
|
161
|
+
env.GIT_COMMITTER_NAME = env.GIT_COMMITTER_NAME ?? "Agentplane Test";
|
|
162
|
+
env.GIT_COMMITTER_EMAIL = env.GIT_COMMITTER_EMAIL ?? "agentplane-test@example.com";
|
|
163
|
+
return env;
|
|
164
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../spec/spec.js";
|
|
2
2
|
import type { HelpJson } from "../spec/help-render.js";
|
|
3
3
|
import type { CommandContext } from "../../commands/shared/task-backend.js";
|
|
4
|
+
import type { LoadedConfig, ResolvedProject } from "@agentplaneorg/core";
|
|
4
5
|
export type RunDeps = {
|
|
5
6
|
getCtx: (commandForErrorContext: string) => Promise<CommandContext>;
|
|
7
|
+
getResolvedProject: (commandForErrorContext: string) => Promise<ResolvedProject>;
|
|
8
|
+
getLoadedConfig: (commandForErrorContext: string) => Promise<LoadedConfig>;
|
|
6
9
|
getHelpJsonForDocs: () => readonly HelpJson[];
|
|
7
10
|
};
|
|
8
11
|
export type CommandEntry = {
|
|
@@ -12,5 +15,5 @@ export type CommandEntry = {
|
|
|
12
15
|
needsConfig: boolean;
|
|
13
16
|
needsTaskContext: boolean;
|
|
14
17
|
};
|
|
15
|
-
export declare const COMMANDS: readonly [CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry];
|
|
18
|
+
export declare const COMMANDS: readonly [CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry];
|
|
16
19
|
//# sourceMappingURL=command-catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/command-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"command-catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/command-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAiGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEzE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACpE,kBAAkB,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACjF,eAAe,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3E,kBAAkB,EAAE,MAAM,SAAS,QAAQ,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgBF,eAAO,MAAM,QAAQ,yuCAuYuB,CAAC"}
|
|
@@ -3,10 +3,10 @@ import { agentsSpec, quickstartSpec, roleSpec } from "./commands/core.js";
|
|
|
3
3
|
import { configSetSpec, configShowSpec, modeGetSpec, modeSetSpec } from "./commands/config.js";
|
|
4
4
|
import { ideSyncSpec } from "./commands/ide.js";
|
|
5
5
|
import { taskNewSpec } from "../../commands/task/new.spec.js";
|
|
6
|
-
import { taskListSpec } from "../../commands/task/list.
|
|
7
|
-
import { taskNextSpec } from "../../commands/task/next.
|
|
8
|
-
import { taskSearchSpec } from "../../commands/task/search.
|
|
9
|
-
import { taskShowSpec } from "../../commands/task/show.
|
|
6
|
+
import { taskListSpec } from "../../commands/task/list.spec.js";
|
|
7
|
+
import { taskNextSpec } from "../../commands/task/next.spec.js";
|
|
8
|
+
import { taskSearchSpec } from "../../commands/task/search.spec.js";
|
|
9
|
+
import { taskShowSpec } from "../../commands/task/show.spec.js";
|
|
10
10
|
import { taskAddSpec } from "../../commands/task/add.command.js";
|
|
11
11
|
import { taskUpdateSpec } from "../../commands/task/update.command.js";
|
|
12
12
|
import { taskCommentSpec } from "../../commands/task/comment.command.js";
|
|
@@ -53,10 +53,10 @@ import { scenarioSpec } from "../../commands/scenario/scenario.command.js";
|
|
|
53
53
|
import { prCheckSpec, prNoteSpec, prOpenSpec, prSpec, prUpdateSpec, } from "../../commands/pr/pr.command.js";
|
|
54
54
|
import { integrateSpec } from "../../commands/integrate.command.js";
|
|
55
55
|
import { commitSpec } from "../../commands/commit.spec.js";
|
|
56
|
-
import { startSpec } from "../../commands/start.
|
|
57
|
-
import { blockSpec } from "../../commands/block.
|
|
58
|
-
import { verifySpec } from "../../commands/verify.
|
|
59
|
-
import { finishSpec } from "../../commands/finish.
|
|
56
|
+
import { startSpec } from "../../commands/start.spec.js";
|
|
57
|
+
import { blockSpec } from "../../commands/block.spec.js";
|
|
58
|
+
import { verifySpec } from "../../commands/verify.spec.js";
|
|
59
|
+
import { finishSpec } from "../../commands/finish.spec.js";
|
|
60
60
|
import { readySpec } from "../../commands/ready.command.js";
|
|
61
61
|
import { doctorSpec } from "../../commands/doctor.command.js";
|
|
62
62
|
import { docsCliSpec } from "../../commands/docs/cli.command.js";
|
|
@@ -69,6 +69,9 @@ import { guardSpec } from "../../commands/guard/guard.command.js";
|
|
|
69
69
|
import { guardCleanSpec } from "../../commands/guard/clean.command.js";
|
|
70
70
|
import { guardSuggestAllowSpec } from "../../commands/guard/suggest-allow.command.js";
|
|
71
71
|
import { guardCommitSpec } from "../../commands/guard/commit.command.js";
|
|
72
|
+
import { releaseSpec } from "../../commands/release/release.command.js";
|
|
73
|
+
import { releasePlanSpec } from "../../commands/release/plan.command.js";
|
|
74
|
+
import { releaseApplySpec } from "../../commands/release/apply.command.js";
|
|
72
75
|
function entry(spec, load, meta) {
|
|
73
76
|
return {
|
|
74
77
|
spec: spec,
|
|
@@ -89,6 +92,21 @@ export const COMMANDS = [
|
|
|
89
92
|
needsConfig: false,
|
|
90
93
|
needsTaskContext: false,
|
|
91
94
|
}),
|
|
95
|
+
entry(releaseSpec, () => import("../../commands/release/release.command.js").then((m) => m.runRelease), {
|
|
96
|
+
needsProject: false,
|
|
97
|
+
needsConfig: false,
|
|
98
|
+
needsTaskContext: false,
|
|
99
|
+
}),
|
|
100
|
+
entry(releasePlanSpec, () => import("../../commands/release/plan.command.js").then((m) => m.runReleasePlan), {
|
|
101
|
+
needsProject: true,
|
|
102
|
+
needsConfig: false,
|
|
103
|
+
needsTaskContext: false,
|
|
104
|
+
}),
|
|
105
|
+
entry(releaseApplySpec, () => import("../../commands/release/apply.command.js").then((m) => m.runReleaseApply), {
|
|
106
|
+
needsProject: true,
|
|
107
|
+
needsConfig: false,
|
|
108
|
+
needsTaskContext: false,
|
|
109
|
+
}),
|
|
92
110
|
entry(quickstartSpec, () => import("./commands/core.js").then((m) => m.runQuickstart), {
|
|
93
111
|
needsProject: false,
|
|
94
112
|
needsConfig: false,
|
|
@@ -99,32 +117,32 @@ export const COMMANDS = [
|
|
|
99
117
|
needsConfig: false,
|
|
100
118
|
needsTaskContext: false,
|
|
101
119
|
}),
|
|
102
|
-
entry(agentsSpec, () => import("./commands/core.js").then((m) => m.
|
|
120
|
+
entry(agentsSpec, (deps) => import("./commands/core.js").then((m) => m.makeRunAgentsHandler(deps)), {
|
|
103
121
|
needsProject: true,
|
|
104
122
|
needsConfig: false,
|
|
105
123
|
needsTaskContext: false,
|
|
106
124
|
}),
|
|
107
|
-
entry(configShowSpec, () => import("./commands/config.js").then((m) => m.
|
|
125
|
+
entry(configShowSpec, (deps) => import("./commands/config.js").then((m) => m.makeRunConfigShowHandler(deps)), {
|
|
108
126
|
needsProject: true,
|
|
109
127
|
needsConfig: true,
|
|
110
128
|
needsTaskContext: false,
|
|
111
129
|
}),
|
|
112
|
-
entry(configSetSpec, () => import("./commands/config.js").then((m) => m.
|
|
130
|
+
entry(configSetSpec, (deps) => import("./commands/config.js").then((m) => m.makeRunConfigSetHandler(deps)), {
|
|
113
131
|
needsProject: true,
|
|
114
132
|
needsConfig: true,
|
|
115
133
|
needsTaskContext: false,
|
|
116
134
|
}),
|
|
117
|
-
entry(modeGetSpec, () => import("./commands/config.js").then((m) => m.
|
|
135
|
+
entry(modeGetSpec, (deps) => import("./commands/config.js").then((m) => m.makeRunModeGetHandler(deps)), {
|
|
118
136
|
needsProject: true,
|
|
119
137
|
needsConfig: true,
|
|
120
138
|
needsTaskContext: false,
|
|
121
139
|
}),
|
|
122
|
-
entry(modeSetSpec, () => import("./commands/config.js").then((m) => m.
|
|
140
|
+
entry(modeSetSpec, (deps) => import("./commands/config.js").then((m) => m.makeRunModeSetHandler(deps)), {
|
|
123
141
|
needsProject: true,
|
|
124
142
|
needsConfig: true,
|
|
125
143
|
needsTaskContext: false,
|
|
126
144
|
}),
|
|
127
|
-
entry(ideSyncSpec, () => import("./commands/ide.js").then((m) => m.
|
|
145
|
+
entry(ideSyncSpec, (deps) => import("./commands/ide.js").then((m) => m.makeRunIdeSyncHandler(deps)), {
|
|
128
146
|
needsProject: true,
|
|
129
147
|
needsConfig: true,
|
|
130
148
|
needsTaskContext: false,
|
|
@@ -134,10 +152,10 @@ export const COMMANDS = [
|
|
|
134
152
|
needsConfig: false,
|
|
135
153
|
needsTaskContext: false,
|
|
136
154
|
}),
|
|
137
|
-
entry(taskListSpec, (deps) => import("../../commands/task/list.
|
|
138
|
-
entry(taskNextSpec, (deps) => import("../../commands/task/next.
|
|
139
|
-
entry(taskSearchSpec, (deps) => import("../../commands/task/search.
|
|
140
|
-
entry(taskShowSpec, (deps) => import("../../commands/task/show.
|
|
155
|
+
entry(taskListSpec, (deps) => import("../../commands/task/list.run.js").then((m) => m.makeRunTaskListHandler(deps.getCtx))),
|
|
156
|
+
entry(taskNextSpec, (deps) => import("../../commands/task/next.run.js").then((m) => m.makeRunTaskNextHandler(deps.getCtx))),
|
|
157
|
+
entry(taskSearchSpec, (deps) => import("../../commands/task/search.run.js").then((m) => m.makeRunTaskSearchHandler(deps.getCtx))),
|
|
158
|
+
entry(taskShowSpec, (deps) => import("../../commands/task/show.run.js").then((m) => m.makeRunTaskShowHandler(deps.getCtx))),
|
|
141
159
|
entry(taskNewSpec, (deps) => import("../../commands/task/new.command.js").then((m) => m.makeRunTaskNewHandler(deps.getCtx))),
|
|
142
160
|
entry(taskDeriveSpec, (deps) => import("../../commands/task/derive.command.js").then((m) => m.makeRunTaskDeriveHandler(deps.getCtx))),
|
|
143
161
|
entry(taskAddSpec, (deps) => import("../../commands/task/add.command.js").then((m) => m.makeRunTaskAddHandler(deps.getCtx))),
|
|
@@ -193,10 +211,10 @@ export const COMMANDS = [
|
|
|
193
211
|
entry(prNoteSpec, (deps) => import("../../commands/pr/pr.command.js").then((m) => m.makeRunPrNoteHandler(deps.getCtx))),
|
|
194
212
|
entry(integrateSpec, (deps) => import("../../commands/integrate.command.js").then((m) => m.makeRunIntegrateHandler(deps.getCtx))),
|
|
195
213
|
entry(commitSpec, (deps) => import("../../commands/commit.command.js").then((m) => m.makeRunCommitHandler(deps.getCtx))),
|
|
196
|
-
entry(startSpec, (deps) => import("../../commands/start.
|
|
197
|
-
entry(blockSpec, (deps) => import("../../commands/block.
|
|
198
|
-
entry(verifySpec, (deps) => import("../../commands/verify.
|
|
199
|
-
entry(finishSpec, (deps) => import("../../commands/finish.
|
|
214
|
+
entry(startSpec, (deps) => import("../../commands/start.run.js").then((m) => m.makeRunStartHandler(deps.getCtx))),
|
|
215
|
+
entry(blockSpec, (deps) => import("../../commands/block.run.js").then((m) => m.makeRunBlockHandler(deps.getCtx))),
|
|
216
|
+
entry(verifySpec, (deps) => import("../../commands/verify.run.js").then((m) => m.makeRunVerifyHandler(deps.getCtx))),
|
|
217
|
+
entry(finishSpec, (deps) => import("../../commands/finish.run.js").then((m) => m.makeRunFinishHandler(deps.getCtx))),
|
|
200
218
|
entry(readySpec, (deps) => import("../../commands/ready.command.js").then((m) => m.makeRunReadyHandler(deps.getCtx))),
|
|
201
219
|
entry(docsCliSpec, (deps) => import("../../commands/docs/cli.command.js").then((m) => m.makeRunDocsCliHandler(deps.getHelpJsonForDocs))),
|
|
202
220
|
entry(hooksSpec, () => import("../../commands/hooks/hooks.command.js").then((m) => m.runHooks)),
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../../spec/spec.js";
|
|
2
|
+
import type { RunDeps } from "../command-catalog.js";
|
|
2
3
|
type ConfigShowParsed = Record<string, never>;
|
|
3
4
|
export declare const configShowSpec: CommandSpec<ConfigShowParsed>;
|
|
4
|
-
export declare
|
|
5
|
+
export declare function makeRunConfigShowHandler(deps: RunDeps): CommandHandler<ConfigShowParsed>;
|
|
5
6
|
type ConfigSetParsed = {
|
|
6
7
|
key: string;
|
|
7
8
|
value: string;
|
|
8
9
|
};
|
|
9
10
|
export declare const configSetSpec: CommandSpec<ConfigSetParsed>;
|
|
10
|
-
export declare
|
|
11
|
+
export declare function makeRunConfigSetHandler(deps: RunDeps): CommandHandler<ConfigSetParsed>;
|
|
11
12
|
type ModeGetParsed = Record<string, never>;
|
|
12
13
|
export declare const modeGetSpec: CommandSpec<ModeGetParsed>;
|
|
13
|
-
export declare
|
|
14
|
+
export declare function makeRunModeGetHandler(deps: RunDeps): CommandHandler<ModeGetParsed>;
|
|
14
15
|
type ModeSetParsed = {
|
|
15
16
|
mode: string;
|
|
16
17
|
};
|
|
17
18
|
export declare const modeSetSpec: CommandSpec<ModeSetParsed>;
|
|
18
|
-
export declare
|
|
19
|
+
export declare function makeRunModeSetHandler(deps: RunDeps): CommandHandler<ModeSetParsed>;
|
|
19
20
|
export {};
|
|
20
21
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAMxD,CAAC;AAiBF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAExF;AAED,KAAK,eAAe,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,eAAe,CAgBtD,CAAC;AA6BF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,eAAe,CAAC,CAStF;AAED,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE3C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAMlD,CAAC;AAiBF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAElF;AAED,KAAK,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAgBlD,CAAC;AA0BF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,CAQlF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { saveConfig, setByDottedKey } from "@agentplaneorg/core";
|
|
3
3
|
import { mapCoreError } from "../../error-map.js";
|
|
4
4
|
import { usageError } from "../../spec/errors.js";
|
|
5
|
+
import { CliError } from "../../../shared/errors.js";
|
|
5
6
|
export const configShowSpec = {
|
|
6
7
|
id: ["config", "show"],
|
|
7
8
|
group: "Config",
|
|
@@ -11,19 +12,19 @@ export const configShowSpec = {
|
|
|
11
12
|
};
|
|
12
13
|
async function cmdConfigShow(opts) {
|
|
13
14
|
try {
|
|
14
|
-
const
|
|
15
|
-
cwd: opts.cwd,
|
|
16
|
-
rootOverride: opts.rootOverride ?? null,
|
|
17
|
-
});
|
|
18
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
15
|
+
const loaded = await opts.deps.getLoadedConfig("config show");
|
|
19
16
|
process.stdout.write(`${JSON.stringify(loaded.raw, null, 2)}\n`);
|
|
20
17
|
return 0;
|
|
21
18
|
}
|
|
22
19
|
catch (err) {
|
|
20
|
+
if (err instanceof CliError)
|
|
21
|
+
throw err;
|
|
23
22
|
throw mapCoreError(err, { command: "config show", root: opts.rootOverride ?? null });
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
export
|
|
25
|
+
export function makeRunConfigShowHandler(deps) {
|
|
26
|
+
return (ctx) => cmdConfigShow({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, deps });
|
|
27
|
+
}
|
|
27
28
|
export const configSetSpec = {
|
|
28
29
|
id: ["config", "set"],
|
|
29
30
|
group: "Config",
|
|
@@ -43,11 +44,8 @@ export const configSetSpec = {
|
|
|
43
44
|
};
|
|
44
45
|
async function cmdConfigSet(opts) {
|
|
45
46
|
try {
|
|
46
|
-
const resolved = await
|
|
47
|
-
|
|
48
|
-
rootOverride: opts.rootOverride ?? null,
|
|
49
|
-
});
|
|
50
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
47
|
+
const resolved = await opts.deps.getResolvedProject("config set");
|
|
48
|
+
const loaded = await opts.deps.getLoadedConfig("config set");
|
|
51
49
|
const raw = { ...loaded.raw };
|
|
52
50
|
setByDottedKey(raw, opts.key, opts.value);
|
|
53
51
|
await saveConfig(resolved.agentplaneDir, raw);
|
|
@@ -55,6 +53,8 @@ async function cmdConfigSet(opts) {
|
|
|
55
53
|
return 0;
|
|
56
54
|
}
|
|
57
55
|
catch (err) {
|
|
56
|
+
if (err instanceof CliError)
|
|
57
|
+
throw err;
|
|
58
58
|
throw mapCoreError(err, {
|
|
59
59
|
command: "config set",
|
|
60
60
|
key: opts.key,
|
|
@@ -62,7 +62,15 @@ async function cmdConfigSet(opts) {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
export
|
|
65
|
+
export function makeRunConfigSetHandler(deps) {
|
|
66
|
+
return (ctx, p) => cmdConfigSet({
|
|
67
|
+
cwd: ctx.cwd,
|
|
68
|
+
rootOverride: ctx.rootOverride,
|
|
69
|
+
key: p.key,
|
|
70
|
+
value: p.value,
|
|
71
|
+
deps,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
66
74
|
export const modeGetSpec = {
|
|
67
75
|
id: ["mode", "get"],
|
|
68
76
|
group: "Config",
|
|
@@ -72,19 +80,19 @@ export const modeGetSpec = {
|
|
|
72
80
|
};
|
|
73
81
|
async function cmdModeGet(opts) {
|
|
74
82
|
try {
|
|
75
|
-
const
|
|
76
|
-
cwd: opts.cwd,
|
|
77
|
-
rootOverride: opts.rootOverride ?? null,
|
|
78
|
-
});
|
|
79
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
83
|
+
const loaded = await opts.deps.getLoadedConfig("mode get");
|
|
80
84
|
process.stdout.write(`${loaded.config.workflow_mode}\n`);
|
|
81
85
|
return 0;
|
|
82
86
|
}
|
|
83
87
|
catch (err) {
|
|
88
|
+
if (err instanceof CliError)
|
|
89
|
+
throw err;
|
|
84
90
|
throw mapCoreError(err, { command: "mode get", root: opts.rootOverride ?? null });
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
|
-
export
|
|
93
|
+
export function makeRunModeGetHandler(deps) {
|
|
94
|
+
return (ctx) => cmdModeGet({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, deps });
|
|
95
|
+
}
|
|
88
96
|
export const modeSetSpec = {
|
|
89
97
|
id: ["mode", "set"],
|
|
90
98
|
group: "Config",
|
|
@@ -104,11 +112,8 @@ export const modeSetSpec = {
|
|
|
104
112
|
};
|
|
105
113
|
async function cmdModeSet(opts) {
|
|
106
114
|
try {
|
|
107
|
-
const resolved = await
|
|
108
|
-
|
|
109
|
-
rootOverride: opts.rootOverride ?? null,
|
|
110
|
-
});
|
|
111
|
-
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
115
|
+
const resolved = await opts.deps.getResolvedProject("mode set");
|
|
116
|
+
const loaded = await opts.deps.getLoadedConfig("mode set");
|
|
112
117
|
const raw = { ...loaded.raw };
|
|
113
118
|
setByDottedKey(raw, "workflow_mode", opts.mode);
|
|
114
119
|
await saveConfig(resolved.agentplaneDir, raw);
|
|
@@ -116,6 +121,8 @@ async function cmdModeSet(opts) {
|
|
|
116
121
|
return 0;
|
|
117
122
|
}
|
|
118
123
|
catch (err) {
|
|
124
|
+
if (err instanceof CliError)
|
|
125
|
+
throw err;
|
|
119
126
|
throw mapCoreError(err, {
|
|
120
127
|
command: "mode set",
|
|
121
128
|
root: opts.rootOverride ?? null,
|
|
@@ -123,8 +130,11 @@ async function cmdModeSet(opts) {
|
|
|
123
130
|
});
|
|
124
131
|
}
|
|
125
132
|
}
|
|
126
|
-
export
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
export function makeRunModeSetHandler(deps) {
|
|
134
|
+
return (ctx, p) => cmdModeSet({
|
|
135
|
+
cwd: ctx.cwd,
|
|
136
|
+
rootOverride: ctx.rootOverride,
|
|
137
|
+
mode: p.mode,
|
|
138
|
+
deps,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../../spec/spec.js";
|
|
2
|
+
import type { RunDeps } from "../command-catalog.js";
|
|
2
3
|
type QuickstartParsed = Record<string, never>;
|
|
3
4
|
export declare const quickstartSpec: CommandSpec<QuickstartParsed>;
|
|
4
5
|
export declare const runQuickstart: CommandHandler<QuickstartParsed>;
|
|
@@ -9,6 +10,6 @@ export declare const roleSpec: CommandSpec<RoleParsed>;
|
|
|
9
10
|
export declare const runRole: CommandHandler<RoleParsed>;
|
|
10
11
|
type AgentsParsed = Record<string, never>;
|
|
11
12
|
export declare const agentsSpec: CommandSpec<AgentsParsed>;
|
|
12
|
-
export declare
|
|
13
|
+
export declare function makeRunAgentsHandler(deps: RunDeps): CommandHandler<AgentsParsed>;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/core.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/core.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAOxD,CAAC;AAYF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAG1D,CAAC;AAEF,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,UAAU,CAO5C,CAAC;AAgLF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,UAAU,CAE9C,CAAC;AAEF,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAMhD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,YAAY,CAAC,CA+DhF"}
|