agentplane 0.3.13 → 0.3.14
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/assets/RUNNER.md +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -1
- package/assets/agents/SKILL_EXTRACTOR.json +31 -0
- package/assets/framework.manifest.json +7 -0
- package/assets/policy/incidents.md +5 -3
- package/assets/policy/workflow.branch_pr.md +10 -5
- package/dist/.build-manifest.json +278 -178
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +33 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +29 -87
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +16 -38
- package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +23 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +6 -18
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +1 -0
- package/dist/cli/run-cli.js +1 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -74
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +1 -769
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +5 -9
- package/dist/commands/branch/work-start.command.d.ts.map +1 -1
- package/dist/commands/branch/work-start.command.js +1 -0
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -0
- package/dist/commands/doctor/branch-pr.d.ts +1 -1
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
- package/dist/commands/doctor/branch-pr.js +5 -2
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -1
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -1
- package/dist/commands/guard/impl/env.d.ts +6 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +41 -0
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -1
- package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-branch.js +113 -0
- package/dist/commands/pr/internal/sync-github.d.ts +28 -0
- package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-github.js +178 -0
- package/dist/commands/pr/internal/sync-model.d.ts +36 -0
- package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-model.js +1 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-open-step.js +128 -0
- package/dist/commands/pr/internal/sync-support.d.ts +7 -0
- package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-support.js +29 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-update-step.js +68 -0
- package/dist/commands/pr/internal/sync.d.ts +2 -6
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +83 -529
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +25 -8
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +7 -2
- package/dist/commands/recipes/impl/apply.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +1 -2
- package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/active.js +6 -5
- package/dist/commands/recipes/impl/commands/add.d.ts +1 -0
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/add.js +32 -27
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/detach.js +35 -21
- package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/disable.js +5 -3
- package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/enable.js +5 -3
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +57 -47
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +25 -21
- package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +3 -13
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +7 -6
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +12 -7
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/update.js +38 -24
- package/dist/commands/recipes/impl/index.d.ts +1 -1
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
- package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
- package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts +19 -3
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -1
- package/dist/commands/recipes/impl/overlay-project.js +76 -38
- package/dist/commands/recipes/impl/paths.d.ts +0 -3
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +0 -3
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +4 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +6 -4
- package/dist/commands/recipes/impl/project-recipe-state.d.ts +1 -1
- package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.d.ts +5 -1
- package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.js +34 -14
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/types.d.ts +1 -1
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/impl/version.d.ts +5 -0
- package/dist/commands/recipes/impl/version.d.ts.map +1 -0
- package/dist/commands/recipes/impl/version.js +9 -0
- package/dist/commands/recipes.d.ts +5 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +3 -3
- package/dist/commands/release/apply.command.d.ts +1 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +15 -379
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +24 -1
- package/dist/commands/release/apply.pipeline.d.ts +22 -0
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline.js +371 -0
- package/dist/commands/release/apply.preflight.d.ts +2 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +13 -4
- package/dist/commands/release/apply.types.d.ts +27 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.d.ts +4 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.js +7 -0
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +2 -2
- package/dist/commands/shared/task-backend.d.ts +6 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -2
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +4 -4
- package/dist/commands/shared/task-store/intents.d.ts +34 -0
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
- package/dist/commands/shared/task-store/intents.js +265 -0
- package/dist/commands/shared/task-store/readme.d.ts +28 -0
- package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
- package/dist/commands/shared/task-store/readme.js +125 -0
- package/dist/commands/shared/task-store/store.d.ts +26 -0
- package/dist/commands/shared/task-store/store.d.ts.map +1 -0
- package/dist/commands/shared/task-store/store.js +105 -0
- package/dist/commands/shared/task-store/types.d.ts +94 -0
- package/dist/commands/shared/task-store/types.d.ts.map +1 -0
- package/dist/commands/shared/task-store/types.js +1 -0
- package/dist/commands/shared/task-store.d.ts +3 -109
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +2 -493
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +7 -2
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +7 -2
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +3 -3
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +102 -15
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +9 -4
- package/dist/commands/task/list.run.d.ts.map +1 -1
- package/dist/commands/task/list.run.js +14 -4
- package/dist/commands/task/new.command.d.ts.map +1 -1
- package/dist/commands/task/new.command.js +16 -2
- package/dist/commands/task/new.js +2 -2
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +3 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +11 -3
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +3 -33
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +3 -30
- package/dist/runner/adapters/runtime-shared.d.ts +14 -0
- package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
- package/dist/runner/adapters/runtime-shared.js +36 -0
- package/dist/runner/context/base-prompt-sources.d.ts +30 -0
- package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
- package/dist/runner/context/base-prompt-sources.js +144 -0
- package/dist/runner/context/base-prompts.d.ts +3 -22
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +6 -450
- package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
- package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/overlay-prompt-blocks.js +72 -0
- package/dist/runner/context/prompt-block-shared.d.ts +54 -0
- package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
- package/dist/runner/context/prompt-block-shared.js +106 -0
- package/dist/runner/context/recipe-context.d.ts +2 -1
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +2 -1
- package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
- package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/recipe-prompt-blocks.js +143 -0
- package/dist/runner/usecases/scenario-materialize-task.js +2 -2
- package/dist/runner/usecases/task-run-inspect.js +2 -2
- package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +4 -2
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
- package/dist/runtime/execution-context.d.ts +63 -0
- package/dist/runtime/execution-context.d.ts.map +1 -0
- package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
- package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
- package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/advice-strategy.js +54 -0
- package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
- package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/plan-strategy.js +205 -0
- package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
- package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/registry-strategy.js +280 -0
- package/dist/runtime/incidents/resolve.d.ts +3 -25
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +3 -683
- package/dist/runtime/incidents/shared.d.ts +34 -0
- package/dist/runtime/incidents/shared.d.ts.map +1 -0
- package/dist/runtime/incidents/shared.js +171 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
- package/dist/testing/cli-harness/recipe-archives.js +374 -0
- package/dist/testing/cli-harness/stdio.d.ts +26 -0
- package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
- package/dist/testing/cli-harness/stdio.js +84 -0
- package/dist/testing/cli-harness.d.ts +25 -0
- package/dist/testing/cli-harness.d.ts.map +1 -0
- package/dist/testing/cli-harness.js +313 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +7 -4
- package/dist/commands/recipes/impl/manifest.d.ts +0 -4
- package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
- package/dist/commands/recipes/impl/manifest.js +0 -7
- package/dist/commands/recipes/impl/normalize.d.ts +0 -8
- package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
- package/dist/commands/recipes/impl/normalize.js +0 -54
- package/dist/commands/recipes/impl/scenario.d.ts +0 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
- package/dist/commands/recipes/impl/scenario.js +0 -262
- package/dist/recipes/bundled-recipes.d.ts +0 -17
- package/dist/recipes/bundled-recipes.d.ts.map +0 -1
- package/dist/recipes/bundled-recipes.js +0 -15
- package/dist/usecases/context/resolve-context.d.ts +0 -68
- package/dist/usecases/context/resolve-context.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.d.ts +0 -9
- package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.js +0 -17
- package/dist/usecases/task/task-new-usecase.d.ts +0 -9
- package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-new-usecase.js +0 -17
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { expect } from "vitest";
|
|
2
|
+
import { runCli } from "../../cli/run-cli.js";
|
|
3
|
+
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
4
|
+
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|
|
5
|
+
let stdioSilenceDepth = 0;
|
|
6
|
+
export function captureStdIO() {
|
|
7
|
+
let stdout = "";
|
|
8
|
+
let stderr = "";
|
|
9
|
+
const origStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
10
|
+
const origStderrWrite = process.stderr.write.bind(process.stderr);
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
process.stdout.write = (chunk) => {
|
|
13
|
+
stdout += String(chunk);
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
process.stderr.write = (chunk) => {
|
|
18
|
+
stderr += String(chunk);
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
get stdout() {
|
|
23
|
+
return stdout;
|
|
24
|
+
},
|
|
25
|
+
get stderr() {
|
|
26
|
+
return stderr;
|
|
27
|
+
},
|
|
28
|
+
restore() {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
process.stdout.write = origStdoutWrite;
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
+
process.stderr.write = origStderrWrite;
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function splitOutputLines(text) {
|
|
37
|
+
return text
|
|
38
|
+
.trim()
|
|
39
|
+
.split(/\r?\n/)
|
|
40
|
+
.map((line) => line.trimEnd())
|
|
41
|
+
.filter(Boolean);
|
|
42
|
+
}
|
|
43
|
+
export function parseAgentJsonEnvelope(stdout) {
|
|
44
|
+
return JSON.parse(stdout);
|
|
45
|
+
}
|
|
46
|
+
export function expectAgentJsonEnvelope(payload, opts) {
|
|
47
|
+
expect(payload.schema_version).toBe(1);
|
|
48
|
+
expect(payload.mode).toBe("agent_json_v1");
|
|
49
|
+
expect(payload.command).toBe(opts.command);
|
|
50
|
+
expect(payload.ok).toBe(opts.ok);
|
|
51
|
+
expect(payload.exit_code).toBe(opts.exitCode);
|
|
52
|
+
expect(Object.keys(payload)).toEqual(opts.hasData
|
|
53
|
+
? ["schema_version", "mode", "command", "ok", "exit_code", "stdout", "stderr", "data"]
|
|
54
|
+
: ["schema_version", "mode", "command", "ok", "exit_code", "stdout", "stderr"]);
|
|
55
|
+
expect(Object.hasOwn(payload, "data")).toBe(opts.hasData ?? false);
|
|
56
|
+
}
|
|
57
|
+
export function silenceStdIO() {
|
|
58
|
+
if (stdioSilenceDepth === 0) {
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
+
process.stdout.write = () => true;
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
|
+
process.stderr.write = () => true;
|
|
63
|
+
}
|
|
64
|
+
stdioSilenceDepth += 1;
|
|
65
|
+
return () => {
|
|
66
|
+
stdioSilenceDepth -= 1;
|
|
67
|
+
if (stdioSilenceDepth <= 0) {
|
|
68
|
+
stdioSilenceDepth = 0;
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
+
process.stdout.write = originalStdoutWrite;
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
process.stderr.write = originalStderrWrite;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export async function runCliSilent(args) {
|
|
77
|
+
const io = captureStdIO();
|
|
78
|
+
try {
|
|
79
|
+
return await runCli(args);
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
io.restore();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defaultConfig } from "@agentplaneorg/core";
|
|
2
|
+
import type { TaskBackend } from "../backends/task-backend.js";
|
|
3
|
+
export * from "./cli-harness/recipe-archives.js";
|
|
4
|
+
export * from "./cli-harness/stdio.js";
|
|
5
|
+
export declare function registerAgentplaneHome(): void;
|
|
6
|
+
export declare function installRunCliIntegrationHarness(): void;
|
|
7
|
+
export declare function getAgentplaneHome(): string | null;
|
|
8
|
+
export declare function stubTaskBackend(overrides?: Partial<TaskBackend>): TaskBackend;
|
|
9
|
+
export declare function mkGitRepoRoot(): Promise<string>;
|
|
10
|
+
export declare function mkTempDir(): Promise<string>;
|
|
11
|
+
export declare function writeDefaultConfig(root: string): Promise<void>;
|
|
12
|
+
export declare function writeAndConfigureRoot(): Promise<string>;
|
|
13
|
+
export declare function approveTaskPlan(root: string, taskId: string): Promise<void>;
|
|
14
|
+
export declare function recordVerificationOk(root: string, taskId: string): Promise<void>;
|
|
15
|
+
export declare function writeConfig(root: string, config: ReturnType<typeof defaultConfig>): Promise<void>;
|
|
16
|
+
export declare function resetAgentplaneHomeRecipes(): Promise<void>;
|
|
17
|
+
export declare function mkGitRepoRootWithBranch(branch: string): Promise<string>;
|
|
18
|
+
export declare function configureGitUser(root: string): Promise<void>;
|
|
19
|
+
export declare function cleanGitEnv(): NodeJS.ProcessEnv;
|
|
20
|
+
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
21
|
+
export declare function gitBranchExists(root: string, branch: string): Promise<boolean>;
|
|
22
|
+
export declare function commitAll(root: string, message: string): Promise<void>;
|
|
23
|
+
export declare function commitPathsIfChanged(root: string, paths: string[], message: string): Promise<boolean>;
|
|
24
|
+
export declare function stageGitignoreIfPresent(root: string): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=cli-harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-harness.d.ts","sourceRoot":"","sources":["../../src/testing/cli-harness.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG/D,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AA8CvC,wBAAgB,sBAAsB,IAAI,IAAI,CAuD7C;AAED,wBAAgB,+BAA+B,IAAI,IAAI,CAYtD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAEjD;AAED,wBAAgB,eAAe,CAAC,SAAS,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAsBjF;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAMrD;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAIjD;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpE;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,CAI7D;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBjF;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBtF;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAKhE;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI7E;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASlE;AAED,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAgB/C;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYpF;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM5E;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzE"}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { access, cp, mkdir, mkdtemp, readdir, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
import { afterAll, afterEach, beforeAll, beforeEach, vi } from "vitest";
|
|
7
|
+
import { defaultConfig } from "@agentplaneorg/core";
|
|
8
|
+
import { runCliSilent, silenceStdIO } from "./cli-harness/stdio.js";
|
|
9
|
+
export * from "./cli-harness/recipe-archives.js";
|
|
10
|
+
export * from "./cli-harness/stdio.js";
|
|
11
|
+
const execFileAsync = promisify(execFile);
|
|
12
|
+
let agentplaneHome = null;
|
|
13
|
+
const testRoots = new Set();
|
|
14
|
+
const originalAgentplaneHome = process.env.AGENTPLANE_HOME;
|
|
15
|
+
const originalNoUpdateCheck = process.env.AGENTPLANE_NO_UPDATE_CHECK;
|
|
16
|
+
const originalGitAuthorName = process.env.GIT_AUTHOR_NAME;
|
|
17
|
+
const originalGitAuthorEmail = process.env.GIT_AUTHOR_EMAIL;
|
|
18
|
+
const originalGitCommitterName = process.env.GIT_COMMITTER_NAME;
|
|
19
|
+
const originalGitCommitterEmail = process.env.GIT_COMMITTER_EMAIL;
|
|
20
|
+
const originalHookRunner = process.env.AGENTPLANE_HOOK_RUNNER;
|
|
21
|
+
let gitTemplateRoot = null;
|
|
22
|
+
let gitTemplatePromise = null;
|
|
23
|
+
async function ensureGitTemplateRoot() {
|
|
24
|
+
if (gitTemplateRoot)
|
|
25
|
+
return gitTemplateRoot;
|
|
26
|
+
gitTemplatePromise ??= (async () => {
|
|
27
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "agentplane-git-template-"));
|
|
28
|
+
await execFileAsync("git", ["init", "-q"], { cwd: root, env: cleanGitEnv() });
|
|
29
|
+
// Tests must not rely on global git config. Configure author identity locally
|
|
30
|
+
// so any helper that creates commits works in CI.
|
|
31
|
+
await execFileAsync("git", ["config", "user.email", "agentplane-test@example.com"], {
|
|
32
|
+
cwd: root,
|
|
33
|
+
env: cleanGitEnv(),
|
|
34
|
+
});
|
|
35
|
+
await execFileAsync("git", ["config", "user.name", "agentplane-test"], {
|
|
36
|
+
cwd: root,
|
|
37
|
+
env: cleanGitEnv(),
|
|
38
|
+
});
|
|
39
|
+
return root;
|
|
40
|
+
})();
|
|
41
|
+
gitTemplateRoot = await gitTemplatePromise;
|
|
42
|
+
return gitTemplateRoot;
|
|
43
|
+
}
|
|
44
|
+
async function copyDirContents(src, dest) {
|
|
45
|
+
const entries = await readdir(src, { withFileTypes: true });
|
|
46
|
+
await Promise.all(entries.map((entry) => cp(path.join(src, entry.name), path.join(dest, entry.name), { recursive: true })));
|
|
47
|
+
}
|
|
48
|
+
export function registerAgentplaneHome() {
|
|
49
|
+
beforeAll(async () => {
|
|
50
|
+
agentplaneHome = await mkdtemp(path.join(os.tmpdir(), "agentplane-home-"));
|
|
51
|
+
process.env.AGENTPLANE_HOME = agentplaneHome;
|
|
52
|
+
process.env.AGENTPLANE_NO_UPDATE_CHECK = "1";
|
|
53
|
+
process.env.AGENTPLANE_HOOK_RUNNER ??= path.join(process.cwd(), "packages", "agentplane", "bin", "agentplane.js");
|
|
54
|
+
// Keep tests hermetic: never rely on global git config for commit authorship.
|
|
55
|
+
process.env.GIT_AUTHOR_NAME ??= "agentplane-test";
|
|
56
|
+
process.env.GIT_AUTHOR_EMAIL ??= "agentplane-test@example.com";
|
|
57
|
+
process.env.GIT_COMMITTER_NAME ??= "agentplane-test";
|
|
58
|
+
process.env.GIT_COMMITTER_EMAIL ??= "agentplane-test@example.com";
|
|
59
|
+
});
|
|
60
|
+
afterAll(async () => {
|
|
61
|
+
if (agentplaneHome) {
|
|
62
|
+
await rm(agentplaneHome, { recursive: true, force: true });
|
|
63
|
+
}
|
|
64
|
+
if (originalAgentplaneHome === undefined) {
|
|
65
|
+
delete process.env.AGENTPLANE_HOME;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
process.env.AGENTPLANE_HOME = originalAgentplaneHome;
|
|
69
|
+
}
|
|
70
|
+
if (originalNoUpdateCheck === undefined) {
|
|
71
|
+
delete process.env.AGENTPLANE_NO_UPDATE_CHECK;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
process.env.AGENTPLANE_NO_UPDATE_CHECK = originalNoUpdateCheck;
|
|
75
|
+
}
|
|
76
|
+
if (originalGitAuthorName === undefined)
|
|
77
|
+
delete process.env.GIT_AUTHOR_NAME;
|
|
78
|
+
else
|
|
79
|
+
process.env.GIT_AUTHOR_NAME = originalGitAuthorName;
|
|
80
|
+
if (originalGitAuthorEmail === undefined)
|
|
81
|
+
delete process.env.GIT_AUTHOR_EMAIL;
|
|
82
|
+
else
|
|
83
|
+
process.env.GIT_AUTHOR_EMAIL = originalGitAuthorEmail;
|
|
84
|
+
if (originalGitCommitterName === undefined)
|
|
85
|
+
delete process.env.GIT_COMMITTER_NAME;
|
|
86
|
+
else
|
|
87
|
+
process.env.GIT_COMMITTER_NAME = originalGitCommitterName;
|
|
88
|
+
if (originalGitCommitterEmail === undefined)
|
|
89
|
+
delete process.env.GIT_COMMITTER_EMAIL;
|
|
90
|
+
else
|
|
91
|
+
process.env.GIT_COMMITTER_EMAIL = originalGitCommitterEmail;
|
|
92
|
+
if (originalHookRunner === undefined)
|
|
93
|
+
delete process.env.AGENTPLANE_HOOK_RUNNER;
|
|
94
|
+
else
|
|
95
|
+
process.env.AGENTPLANE_HOOK_RUNNER = originalHookRunner;
|
|
96
|
+
});
|
|
97
|
+
afterEach(async () => {
|
|
98
|
+
const roots = [...testRoots];
|
|
99
|
+
testRoots.clear();
|
|
100
|
+
await Promise.all(roots.map(async (root) => {
|
|
101
|
+
await rm(path.join(root, ".agentplane", ".upgrade"), { recursive: true, force: true });
|
|
102
|
+
await rm(path.join(root, ".agentplane", ".release"), { recursive: true, force: true });
|
|
103
|
+
}));
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export function installRunCliIntegrationHarness() {
|
|
107
|
+
registerAgentplaneHome();
|
|
108
|
+
let restoreStdIO = null;
|
|
109
|
+
beforeEach(() => {
|
|
110
|
+
restoreStdIO = silenceStdIO();
|
|
111
|
+
});
|
|
112
|
+
afterEach(() => {
|
|
113
|
+
restoreStdIO?.();
|
|
114
|
+
restoreStdIO = null;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
export function getAgentplaneHome() {
|
|
118
|
+
return agentplaneHome;
|
|
119
|
+
}
|
|
120
|
+
export function stubTaskBackend(overrides = {}) {
|
|
121
|
+
return {
|
|
122
|
+
id: "local",
|
|
123
|
+
capabilities: {
|
|
124
|
+
canonical_source: "local",
|
|
125
|
+
projection: "canonical",
|
|
126
|
+
projection_read_mode: "fallback",
|
|
127
|
+
reads_from_projection_by_default: false,
|
|
128
|
+
writes_task_readmes: true,
|
|
129
|
+
supports_task_revisions: true,
|
|
130
|
+
supports_revision_guarded_writes: true,
|
|
131
|
+
may_access_network_on_read: false,
|
|
132
|
+
may_access_network_on_write: false,
|
|
133
|
+
supports_projection_refresh: false,
|
|
134
|
+
supports_push_sync: false,
|
|
135
|
+
supports_snapshot_export: false,
|
|
136
|
+
},
|
|
137
|
+
listTasks: vi.fn().mockResolvedValue([]),
|
|
138
|
+
getTask: vi.fn().mockResolvedValue(null),
|
|
139
|
+
writeTask: vi.fn().mockImplementation(() => Promise.resolve()),
|
|
140
|
+
...overrides,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
export async function mkGitRepoRoot() {
|
|
144
|
+
const template = await ensureGitTemplateRoot();
|
|
145
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "agentplane-cli-test-"));
|
|
146
|
+
await copyDirContents(template, root);
|
|
147
|
+
testRoots.add(root);
|
|
148
|
+
return root;
|
|
149
|
+
}
|
|
150
|
+
export async function mkTempDir() {
|
|
151
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "agentplane-cli-test-"));
|
|
152
|
+
testRoots.add(root);
|
|
153
|
+
return root;
|
|
154
|
+
}
|
|
155
|
+
export async function writeDefaultConfig(root) {
|
|
156
|
+
const agentplaneDir = path.join(root, ".agentplane");
|
|
157
|
+
await mkdir(agentplaneDir, { recursive: true });
|
|
158
|
+
const configPath = path.join(agentplaneDir, "config.json");
|
|
159
|
+
await writeFile(configPath, JSON.stringify(defaultConfig(), null, 2), "utf8");
|
|
160
|
+
}
|
|
161
|
+
export async function writeAndConfigureRoot() {
|
|
162
|
+
const root = await mkGitRepoRoot();
|
|
163
|
+
await writeDefaultConfig(root);
|
|
164
|
+
return root;
|
|
165
|
+
}
|
|
166
|
+
export async function approveTaskPlan(root, taskId) {
|
|
167
|
+
await runCliSilent([
|
|
168
|
+
"task",
|
|
169
|
+
"plan",
|
|
170
|
+
"set",
|
|
171
|
+
taskId,
|
|
172
|
+
"--text",
|
|
173
|
+
"1) Do the work\n2) Verify the work",
|
|
174
|
+
"--updated-by",
|
|
175
|
+
"ORCHESTRATOR",
|
|
176
|
+
"--root",
|
|
177
|
+
root,
|
|
178
|
+
]);
|
|
179
|
+
await runCliSilent([
|
|
180
|
+
"task",
|
|
181
|
+
"plan",
|
|
182
|
+
"approve",
|
|
183
|
+
taskId,
|
|
184
|
+
"--by",
|
|
185
|
+
"USER",
|
|
186
|
+
"--note",
|
|
187
|
+
"OK",
|
|
188
|
+
"--root",
|
|
189
|
+
root,
|
|
190
|
+
]);
|
|
191
|
+
}
|
|
192
|
+
export async function recordVerificationOk(root, taskId) {
|
|
193
|
+
await runCliSilent([
|
|
194
|
+
"task",
|
|
195
|
+
"doc",
|
|
196
|
+
"set",
|
|
197
|
+
taskId,
|
|
198
|
+
"--section",
|
|
199
|
+
"Verify Steps",
|
|
200
|
+
"--text",
|
|
201
|
+
"Run verify for this task. Expected: verification records successfully.",
|
|
202
|
+
"--root",
|
|
203
|
+
root,
|
|
204
|
+
]);
|
|
205
|
+
await runCliSilent([
|
|
206
|
+
"verify",
|
|
207
|
+
taskId,
|
|
208
|
+
"--ok",
|
|
209
|
+
"--by",
|
|
210
|
+
"REVIEWER",
|
|
211
|
+
"--note",
|
|
212
|
+
"Ok to integrate",
|
|
213
|
+
"--quiet",
|
|
214
|
+
"--root",
|
|
215
|
+
root,
|
|
216
|
+
]);
|
|
217
|
+
}
|
|
218
|
+
export async function writeConfig(root, config) {
|
|
219
|
+
const agentplaneDir = path.join(root, ".agentplane");
|
|
220
|
+
await mkdir(agentplaneDir, { recursive: true });
|
|
221
|
+
const configPath = path.join(agentplaneDir, "config.json");
|
|
222
|
+
await writeFile(configPath, JSON.stringify(config, null, 2), "utf8");
|
|
223
|
+
}
|
|
224
|
+
export async function resetAgentplaneHomeRecipes() {
|
|
225
|
+
if (!agentplaneHome)
|
|
226
|
+
return;
|
|
227
|
+
await rm(path.join(agentplaneHome, "recipes-store"), { recursive: true, force: true });
|
|
228
|
+
await rm(path.join(agentplaneHome, "recipes.json"), { force: true });
|
|
229
|
+
await rm(path.join(agentplaneHome, "recipes-index.json"), { force: true });
|
|
230
|
+
}
|
|
231
|
+
export async function mkGitRepoRootWithBranch(branch) {
|
|
232
|
+
const root = await mkGitRepoRoot();
|
|
233
|
+
await execFileAsync("git", ["checkout", "-b", branch], { cwd: root, env: cleanGitEnv() });
|
|
234
|
+
return root;
|
|
235
|
+
}
|
|
236
|
+
export async function configureGitUser(root) {
|
|
237
|
+
await execFileAsync("git", ["config", "user.email", "test@example.com"], {
|
|
238
|
+
cwd: root,
|
|
239
|
+
env: cleanGitEnv(),
|
|
240
|
+
});
|
|
241
|
+
await execFileAsync("git", ["config", "user.name", "Test User"], {
|
|
242
|
+
cwd: root,
|
|
243
|
+
env: cleanGitEnv(),
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
export function cleanGitEnv() {
|
|
247
|
+
const env = { ...process.env };
|
|
248
|
+
delete env.GIT_DIR;
|
|
249
|
+
delete env.GIT_WORK_TREE;
|
|
250
|
+
delete env.GIT_COMMON_DIR;
|
|
251
|
+
delete env.GIT_INDEX_FILE;
|
|
252
|
+
delete env.GIT_OBJECT_DIRECTORY;
|
|
253
|
+
delete env.GIT_ALTERNATE_OBJECT_DIRECTORIES;
|
|
254
|
+
env.GIT_CONFIG_GLOBAL = "/dev/null";
|
|
255
|
+
env.GIT_CONFIG_SYSTEM = "/dev/null";
|
|
256
|
+
env.GIT_TERMINAL_PROMPT = "0";
|
|
257
|
+
env.GIT_AUTHOR_NAME = env.GIT_AUTHOR_NAME ?? "Agentplane Test";
|
|
258
|
+
env.GIT_AUTHOR_EMAIL = env.GIT_AUTHOR_EMAIL ?? "agentplane-test@example.com";
|
|
259
|
+
env.GIT_COMMITTER_NAME = env.GIT_COMMITTER_NAME ?? "Agentplane Test";
|
|
260
|
+
env.GIT_COMMITTER_EMAIL = env.GIT_COMMITTER_EMAIL ?? "agentplane-test@example.com";
|
|
261
|
+
return env;
|
|
262
|
+
}
|
|
263
|
+
export async function pathExists(filePath) {
|
|
264
|
+
try {
|
|
265
|
+
await access(filePath);
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export async function gitBranchExists(root, branch) {
|
|
273
|
+
try {
|
|
274
|
+
await execFileAsync("git", ["show-ref", "--verify", "--quiet", `refs/heads/${branch}`], {
|
|
275
|
+
cwd: root,
|
|
276
|
+
env: cleanGitEnv(),
|
|
277
|
+
});
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
catch (err) {
|
|
281
|
+
const code = err?.code;
|
|
282
|
+
if (code === 1)
|
|
283
|
+
return false;
|
|
284
|
+
throw err;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
export async function commitAll(root, message) {
|
|
288
|
+
await execFileAsync("git", ["add", "."], { cwd: root, env: cleanGitEnv() });
|
|
289
|
+
await execFileAsync("git", ["commit", "--no-verify", "-m", message], {
|
|
290
|
+
cwd: root,
|
|
291
|
+
env: cleanGitEnv(),
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
export async function commitPathsIfChanged(root, paths, message) {
|
|
295
|
+
await execFileAsync("git", ["add", "--", ...paths], { cwd: root, env: cleanGitEnv() });
|
|
296
|
+
const { stdout } = await execFileAsync("git", ["diff", "--cached", "--name-only", "--", ...paths], {
|
|
297
|
+
cwd: root,
|
|
298
|
+
env: cleanGitEnv(),
|
|
299
|
+
});
|
|
300
|
+
if (!stdout.trim())
|
|
301
|
+
return false;
|
|
302
|
+
await execFileAsync("git", ["commit", "--no-verify", "-m", message], {
|
|
303
|
+
cwd: root,
|
|
304
|
+
env: cleanGitEnv(),
|
|
305
|
+
});
|
|
306
|
+
return true;
|
|
307
|
+
}
|
|
308
|
+
export async function stageGitignoreIfPresent(root) {
|
|
309
|
+
const gitignorePath = path.join(root, ".gitignore");
|
|
310
|
+
if (!(await pathExists(gitignorePath)))
|
|
311
|
+
return;
|
|
312
|
+
await execFileAsync("git", ["add", ".gitignore"], { cwd: root, env: cleanGitEnv() });
|
|
313
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cli-harness.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentplane",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Agent Plane CLI for task workflows, recipes, and project automation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentplane",
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"bin": {
|
|
36
36
|
"agentplane": "bin/agentplane.js"
|
|
37
37
|
},
|
|
38
|
+
"exports": {
|
|
39
|
+
"./internal/testing": "./dist/testing/index.js"
|
|
40
|
+
},
|
|
38
41
|
"files": [
|
|
39
42
|
"bin",
|
|
40
43
|
"dist",
|
|
@@ -48,15 +51,15 @@
|
|
|
48
51
|
},
|
|
49
52
|
"scripts": {
|
|
50
53
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true}); require('node:fs').rmSync('tsconfig.tsbuildinfo',{force:true});\"",
|
|
51
|
-
"build": "tsc -b && node ../../scripts/
|
|
54
|
+
"build": "tsc -b && node ../../scripts/manifest.mjs build .",
|
|
52
55
|
"typecheck": "tsc -b",
|
|
53
56
|
"prepare": "npm run build",
|
|
54
57
|
"prepack": "npm run clean && npm run build",
|
|
55
58
|
"prepublishOnly": "node ../../scripts/enforce-github-publish.mjs && npm run prepack"
|
|
56
59
|
},
|
|
57
60
|
"dependencies": {
|
|
58
|
-
"@agentplaneorg/core": "0.3.
|
|
59
|
-
"@agentplaneorg/recipes": "0.3.
|
|
61
|
+
"@agentplaneorg/core": "0.3.14",
|
|
62
|
+
"@agentplaneorg/recipes": "0.3.14",
|
|
60
63
|
"yauzl": "^2.10.0"
|
|
61
64
|
},
|
|
62
65
|
"devDependencies": {
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type RecipeManifest } from "@agentplaneorg/recipes";
|
|
2
|
-
export declare function readRecipeManifest(manifestPath: string): Promise<RecipeManifest>;
|
|
3
|
-
export declare function validateRecipeManifest(raw: unknown): RecipeManifest;
|
|
4
|
-
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAEhC,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAEtF;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAEnE"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { readRecipeManifest as readRecipeManifestBase, validateRecipeManifest as validateRecipeManifestBase, } from "@agentplaneorg/recipes";
|
|
2
|
-
export async function readRecipeManifest(manifestPath) {
|
|
3
|
-
return readRecipeManifestBase(manifestPath);
|
|
4
|
-
}
|
|
5
|
-
export function validateRecipeManifest(raw) {
|
|
6
|
-
return validateRecipeManifestBase(raw);
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function normalizeRecipeId(value: string): string;
|
|
2
|
-
export declare function normalizeAgentId(value: string): string;
|
|
3
|
-
export declare function normalizeSkillId(value: string): string;
|
|
4
|
-
export declare function normalizeToolId(value: string): string;
|
|
5
|
-
export declare function normalizeScenarioId(value: string): string;
|
|
6
|
-
export declare function normalizeRecipeTags(value: unknown): string[];
|
|
7
|
-
export declare function normalizeRecipeRelativePath(field: string, value: string): string;
|
|
8
|
-
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/normalize.ts"],"names":[],"mappings":"AAmBA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAQ5D;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAWhF"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { invalidPathMessage, requiredFieldMessage, invalidFieldMessage, } from "../../../cli/output.js";
|
|
2
|
-
import { dedupeStrings } from "../../../shared/strings.js";
|
|
3
|
-
function normalizeScopedId(field, value) {
|
|
4
|
-
const trimmed = value.trim();
|
|
5
|
-
if (!trimmed)
|
|
6
|
-
throw new Error(requiredFieldMessage(field));
|
|
7
|
-
if (trimmed.includes("/") || trimmed.includes("\\")) {
|
|
8
|
-
throw new Error(invalidPathMessage(field, "must not contain path separators"));
|
|
9
|
-
}
|
|
10
|
-
if (trimmed === "." || trimmed === "..") {
|
|
11
|
-
throw new Error(invalidPathMessage(field, "must not be '.' or '..'"));
|
|
12
|
-
}
|
|
13
|
-
return trimmed;
|
|
14
|
-
}
|
|
15
|
-
export function normalizeRecipeId(value) {
|
|
16
|
-
return normalizeScopedId("manifest.id", value);
|
|
17
|
-
}
|
|
18
|
-
export function normalizeAgentId(value) {
|
|
19
|
-
return normalizeScopedId("agent.id", value);
|
|
20
|
-
}
|
|
21
|
-
export function normalizeSkillId(value) {
|
|
22
|
-
return normalizeScopedId("skill.id", value);
|
|
23
|
-
}
|
|
24
|
-
export function normalizeToolId(value) {
|
|
25
|
-
return normalizeScopedId("tool.id", value);
|
|
26
|
-
}
|
|
27
|
-
export function normalizeScenarioId(value) {
|
|
28
|
-
return normalizeScopedId("scenario.id", value);
|
|
29
|
-
}
|
|
30
|
-
export function normalizeRecipeTags(value) {
|
|
31
|
-
if (value === undefined)
|
|
32
|
-
return [];
|
|
33
|
-
if (!Array.isArray(value))
|
|
34
|
-
throw new Error(invalidFieldMessage("manifest.tags", "string[]"));
|
|
35
|
-
const tags = value.map((tag) => {
|
|
36
|
-
if (typeof tag !== "string")
|
|
37
|
-
throw new Error(invalidFieldMessage("manifest.tags", "string[]"));
|
|
38
|
-
return tag.trim();
|
|
39
|
-
});
|
|
40
|
-
return dedupeStrings(tags);
|
|
41
|
-
}
|
|
42
|
-
export function normalizeRecipeRelativePath(field, value) {
|
|
43
|
-
const trimmed = value.trim().replaceAll("\\", "/");
|
|
44
|
-
if (!trimmed)
|
|
45
|
-
throw new Error(requiredFieldMessage(field));
|
|
46
|
-
if (trimmed.startsWith("/")) {
|
|
47
|
-
throw new Error(invalidPathMessage(field, "must be relative"));
|
|
48
|
-
}
|
|
49
|
-
const segments = trimmed.split("/");
|
|
50
|
-
if (segments.some((segment) => !segment || segment === "." || segment === "..")) {
|
|
51
|
-
throw new Error(invalidPathMessage(field, "must stay within the recipe root"));
|
|
52
|
-
}
|
|
53
|
-
return trimmed;
|
|
54
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { RecipeManifest, RecipeScenarioDetail, ScenarioDefinition } from "./types.js";
|
|
2
|
-
export declare function readScenarioDefinition(filePath: string): Promise<ScenarioDefinition>;
|
|
3
|
-
export declare function readScenarioIndex(filePath: string): Promise<{
|
|
4
|
-
schema_version: 1;
|
|
5
|
-
scenarios: {
|
|
6
|
-
id: string;
|
|
7
|
-
summary?: string;
|
|
8
|
-
}[];
|
|
9
|
-
}>;
|
|
10
|
-
export declare function collectRecipeScenarioDetails(recipeDir: string, manifest: RecipeManifest): Promise<RecipeScenarioDetail[]>;
|
|
11
|
-
export declare function normalizeScenarioToolStep(raw: unknown, sourcePath: string): {
|
|
12
|
-
tool: string;
|
|
13
|
-
args: string[];
|
|
14
|
-
env: Record<string, string>;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=scenario.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/scenario.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EAGpB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAqKpB,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAG1F;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACjE,cAAc,EAAE,CAAC,CAAC;IAClB,SAAS,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C,CAAC,CAeD;AAED,wBAAsB,4BAA4B,CAChD,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC,CA+EjC;AAED,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,MAAM,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAyB/D"}
|