agentplane 0.3.2 → 0.3.4
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/AGENTS.md +4 -4
- package/assets/agents/CODER.json +14 -10
- package/assets/agents/CREATOR.json +8 -6
- package/assets/agents/DOCS.json +9 -6
- package/assets/agents/INTEGRATOR.json +9 -6
- package/assets/agents/ORCHESTRATOR.json +8 -6
- package/assets/agents/PLANNER.json +8 -5
- package/assets/agents/REDMINE.json +6 -3
- package/assets/agents/REVIEWER.json +8 -6
- package/assets/agents/TESTER.json +8 -4
- package/assets/agents/UPDATER.json +6 -4
- package/assets/agents/UPGRADER.json +7 -6
- package/assets/policy/dod.code.md +2 -2
- package/assets/policy/dod.core.md +16 -2
- package/assets/policy/dod.docs.md +2 -2
- package/assets/policy/incidents.md +44 -1
- package/assets/policy/workflow.direct.md +8 -4
- package/bin/agentplane.js +59 -9
- package/bin/dist-guard.js +78 -10
- package/bin/runtime-context.d.ts +3 -0
- package/bin/runtime-context.js +13 -0
- package/bin/runtime-watch.d.ts +26 -0
- package/bin/runtime-watch.js +116 -0
- package/bin/stale-dist-policy.d.ts +6 -0
- package/bin/stale-dist-policy.js +44 -0
- package/dist/.build-manifest.json +2485 -5
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +9 -12
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +23 -18
- package/dist/backends/task-backend/shared/constants.d.ts +1 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -0
- package/dist/backends/task-backend/shared/doc.d.ts +1 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/doc.js +4 -1
- package/dist/backends/task-backend/shared/export.js +3 -3
- package/dist/cli/bootstrap-guide.d.ts +2 -3
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +16 -35
- package/dist/cli/command-guide.d.ts +14 -1
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +71 -47
- package/dist/cli/run-cli/catalog.d.ts +7 -0
- package/dist/cli/run-cli/catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/catalog.js +22 -0
- 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/command-catalog.js +11 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +37 -29
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +2 -0
- package/dist/cli/run-cli/commands/init/write-workflow.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-workflow.js +6 -55
- package/dist/cli/run-cli/commands/init.js +5 -14
- package/dist/cli/run-cli/error-guidance.d.ts +9 -0
- package/dist/cli/run-cli/error-guidance.d.ts.map +1 -0
- package/dist/cli/run-cli/error-guidance.js +180 -0
- package/dist/cli/run-cli/globals.d.ts +22 -0
- package/dist/cli/run-cli/globals.d.ts.map +1 -0
- package/dist/cli/run-cli/globals.js +197 -0
- package/dist/cli/run-cli/update-warning.d.ts +6 -0
- package/dist/cli/run-cli/update-warning.d.ts.map +1 -0
- package/dist/cli/run-cli/update-warning.js +64 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +5 -476
- package/dist/cli/spec/docs-render.d.ts.map +1 -1
- package/dist/cli/spec/docs-render.js +14 -1
- package/dist/commands/doctor/archive.d.ts +4 -0
- package/dist/commands/doctor/archive.d.ts.map +1 -0
- package/dist/commands/doctor/archive.js +211 -0
- package/dist/commands/doctor/fixes.d.ts +9 -0
- package/dist/commands/doctor/fixes.d.ts.map +1 -0
- package/dist/commands/doctor/fixes.js +40 -0
- package/dist/commands/doctor/layering.d.ts +2 -0
- package/dist/commands/doctor/layering.d.ts.map +1 -0
- package/dist/commands/doctor/layering.js +87 -0
- package/dist/commands/doctor/runtime.d.ts +4 -0
- package/dist/commands/doctor/runtime.d.ts.map +1 -0
- package/dist/commands/doctor/runtime.js +56 -0
- package/dist/commands/doctor/workflow.d.ts +6 -0
- package/dist/commands/doctor/workflow.d.ts.map +1 -0
- package/dist/commands/doctor/workflow.js +62 -0
- package/dist/commands/doctor/workspace.d.ts +2 -0
- package/dist/commands/doctor/workspace.d.ts.map +1 -0
- package/dist/commands/doctor/workspace.js +165 -0
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +16 -342
- package/dist/commands/doctor.spec.d.ts +1 -0
- package/dist/commands/doctor.spec.d.ts.map +1 -1
- package/dist/commands/doctor.spec.js +15 -1
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +19 -0
- package/dist/commands/release/apply.command.d.ts +2 -8
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +158 -387
- package/dist/commands/release/apply.mutation.d.ts +7 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -0
- package/dist/commands/release/apply.mutation.js +107 -0
- package/dist/commands/release/apply.preflight.d.ts +25 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -0
- package/dist/commands/release/apply.preflight.js +338 -0
- package/dist/commands/release/apply.reporting.d.ts +4 -0
- package/dist/commands/release/apply.reporting.d.ts.map +1 -0
- package/dist/commands/release/apply.reporting.js +24 -0
- package/dist/commands/release/apply.types.d.ts +46 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -0
- package/dist/commands/release/apply.types.js +1 -0
- package/dist/commands/runtime.command.d.ts +28 -0
- package/dist/commands/runtime.command.d.ts.map +1 -0
- package/dist/commands/runtime.command.js +169 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +7 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +3 -33
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +2 -2
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +2 -2
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +2 -2
- package/dist/commands/task/comment.js +2 -2
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +3 -3
- package/dist/commands/task/doc-template.d.ts +10 -0
- package/dist/commands/task/doc-template.d.ts.map +1 -0
- package/dist/commands/task/doc-template.js +104 -0
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +36 -1
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +7 -4
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.command.js +5 -1
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +136 -2
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +4 -110
- package/dist/commands/task/new.spec.js +3 -3
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +5 -4
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +7 -52
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +2 -2
- package/dist/commands/task/shared/dependencies.d.ts +15 -0
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -0
- package/dist/commands/task/shared/dependencies.js +143 -0
- package/dist/commands/task/shared/docs.d.ts +21 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -0
- package/dist/commands/task/shared/docs.js +121 -0
- package/dist/commands/task/shared/listing.d.ts +20 -0
- package/dist/commands/task/shared/listing.d.ts.map +1 -0
- package/dist/commands/task/shared/listing.js +127 -0
- package/dist/commands/task/shared/tags.d.ts +24 -0
- package/dist/commands/task/shared/tags.d.ts.map +1 -0
- package/dist/commands/task/shared/tags.js +177 -0
- package/dist/commands/task/shared/transitions.d.ts +42 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -0
- package/dist/commands/task/shared/transitions.js +175 -0
- package/dist/commands/task/shared.d.ts +5 -106
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +5 -681
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +7 -5
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +9 -25
- package/dist/commands/task/verify-show.command.d.ts.map +1 -1
- package/dist/commands/task/verify-show.command.js +5 -1
- package/dist/commands/upgrade/apply.d.ts +44 -0
- package/dist/commands/upgrade/apply.d.ts.map +1 -0
- package/dist/commands/upgrade/apply.js +180 -0
- package/dist/commands/upgrade/report.d.ts +21 -0
- package/dist/commands/upgrade/report.d.ts.map +1 -0
- package/dist/commands/upgrade/report.js +81 -0
- package/dist/commands/upgrade/source.d.ts +35 -0
- package/dist/commands/upgrade/source.d.ts.map +1 -0
- package/dist/commands/upgrade/source.js +109 -0
- package/dist/commands/upgrade/types.d.ts +31 -0
- package/dist/commands/upgrade/types.d.ts.map +1 -0
- package/dist/commands/upgrade/types.js +1 -0
- package/dist/commands/upgrade.d.ts +1 -35
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +68 -332
- package/dist/commands/workflow-build.command.d.ts.map +1 -1
- package/dist/commands/workflow-build.command.js +9 -15
- package/dist/shared/diagnostics.d.ts +23 -0
- package/dist/shared/diagnostics.d.ts.map +1 -0
- package/dist/shared/diagnostics.js +57 -0
- package/dist/shared/errors.d.ts +2 -0
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +2 -0
- package/dist/shared/repo-cli-version.d.ts +13 -0
- package/dist/shared/repo-cli-version.d.ts.map +1 -0
- package/dist/shared/repo-cli-version.js +63 -0
- package/dist/shared/runtime-source.d.ts +33 -0
- package/dist/shared/runtime-source.d.ts.map +1 -0
- package/dist/shared/runtime-source.js +156 -0
- package/dist/shared/version-compare.d.ts +7 -0
- package/dist/shared/version-compare.d.ts.map +1 -0
- package/dist/shared/version-compare.js +30 -0
- package/dist/shared/workflow-artifacts.d.ts +37 -0
- package/dist/shared/workflow-artifacts.d.ts.map +1 -0
- package/dist/shared/workflow-artifacts.js +97 -0
- package/package.json +2 -2
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import { COMMAND_SNIPPETS } from "./command-snippets.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
lines.push(`## ${section.heading}`, "", section.summary, "");
|
|
7
|
-
for (const command of section.commands) {
|
|
8
|
-
lines.push(`- \`${command}\``);
|
|
9
|
-
}
|
|
10
|
-
lines.push("");
|
|
11
|
-
}
|
|
12
|
-
if (lines.at(-1) === "")
|
|
13
|
-
lines.pop();
|
|
14
|
-
return lines;
|
|
2
|
+
import { BOOTSTRAP_PREFLIGHT_COMMANDS, BOOTSTRAP_TASK_PREP_COMMANDS } from "./bootstrap-guide.js";
|
|
3
|
+
const SHARED_STARTUP_NOTE = `- Shared startup path: \`${COMMAND_SNIPPETS.core.quickstart}\` is the canonical installed bootstrap; use \`${COMMAND_SNIPPETS.core.role}\` only for role-specific deltas.`;
|
|
4
|
+
function renderQuickstartCommandBlock(commands) {
|
|
5
|
+
return ["```bash", ...commands, "```"];
|
|
15
6
|
}
|
|
16
7
|
const ROLE_GUIDES = [
|
|
17
8
|
{
|
|
18
9
|
role: "ORCHESTRATOR",
|
|
19
10
|
lines: [
|
|
20
|
-
|
|
11
|
+
SHARED_STARTUP_NOTE,
|
|
21
12
|
"- Owns preflight, plan summaries, approvals, and scope checkpoints.",
|
|
22
13
|
"- Does not create non-executable tasks or bypass lifecycle guardrails.",
|
|
23
14
|
],
|
|
@@ -25,7 +16,7 @@ const ROLE_GUIDES = [
|
|
|
25
16
|
{
|
|
26
17
|
role: "PLANNER",
|
|
27
18
|
lines: [
|
|
28
|
-
|
|
19
|
+
SHARED_STARTUP_NOTE,
|
|
29
20
|
'- Create executable tasks with `agentplane task new --title "..." --description "..." --priority med --owner <ROLE> --tag <tag>`.',
|
|
30
21
|
'- Fill docs with `agentplane task doc set <task-id> --section <name> --text "..."` and set plan text with `agentplane task plan set <task-id> --text "..." --updated-by <ROLE>`.',
|
|
31
22
|
"- Approve plan only after required sections and Verify Steps are ready.",
|
|
@@ -34,34 +25,37 @@ const ROLE_GUIDES = [
|
|
|
34
25
|
{
|
|
35
26
|
role: "CODER",
|
|
36
27
|
lines: [
|
|
37
|
-
|
|
28
|
+
SHARED_STARTUP_NOTE,
|
|
38
29
|
"- direct: stay in the current checkout; branch_pr: start a task branch/worktree first.",
|
|
39
30
|
`- Start deterministically with \`${COMMAND_SNIPPETS.core.startTask}\` after plan approval.`,
|
|
40
31
|
'- Treat `agentplane task verify-show <task-id>` as the verification contract, then record `agentplane verify <task-id> --ok|--rework --by <ROLE> --note "..."`.',
|
|
41
32
|
`- Preferred direct close path: \`${COMMAND_SNIPPETS.core.finishTask}\` with \`--result "..." \`; add \`--no-close-commit\` only for explicit manual close handling.`,
|
|
33
|
+
"- For manual close or allowlist detail, use `agentplane help finish` and `agentplane help commit` on demand.",
|
|
42
34
|
],
|
|
43
35
|
},
|
|
44
36
|
{
|
|
45
37
|
role: "TESTER",
|
|
46
38
|
lines: [
|
|
47
|
-
|
|
39
|
+
SHARED_STARTUP_NOTE,
|
|
48
40
|
"- Start only after plan approval and explicit Verify Steps exist.",
|
|
49
41
|
'- Use `agentplane task verify-show <task-id>` before running checks, then record `agentplane verify <task-id> --ok|--rework --by <ROLE> --note "..."`.',
|
|
50
42
|
`- In direct mode, close with \`${COMMAND_SNIPPETS.core.finishTask}\` plus \`--result "..." \` when you own final verification.`,
|
|
43
|
+
"- For mixed-state recovery or runtime ambiguity, use `agentplane doctor` and `agentplane runtime explain` instead of relying on the short quickstart screen.",
|
|
51
44
|
],
|
|
52
45
|
},
|
|
53
46
|
{
|
|
54
47
|
role: "DOCS",
|
|
55
48
|
lines: [
|
|
56
|
-
|
|
49
|
+
SHARED_STARTUP_NOTE,
|
|
57
50
|
'- Keep task docs and user docs aligned with runtime behavior via `agentplane task doc set <task-id> --section <name> --text "..."`.',
|
|
58
51
|
"- For implementation tasks, verify generated/help surfaces after changing CLI-facing text.",
|
|
52
|
+
"- The docs site may expand CLI behavior, but installed runtime guidance must stay self-contained and must not depend on repo-only docs paths.",
|
|
59
53
|
],
|
|
60
54
|
},
|
|
61
55
|
{
|
|
62
56
|
role: "REVIEWER",
|
|
63
57
|
lines: [
|
|
64
|
-
|
|
58
|
+
SHARED_STARTUP_NOTE,
|
|
65
59
|
"- Review artifacts with `agentplane task show <task-id>` and `agentplane pr check <task-id>` when relevant.",
|
|
66
60
|
"- Focus on regressions, lifecycle drift, and missing verification evidence.",
|
|
67
61
|
],
|
|
@@ -69,15 +63,16 @@ const ROLE_GUIDES = [
|
|
|
69
63
|
{
|
|
70
64
|
role: "INTEGRATOR",
|
|
71
65
|
lines: [
|
|
72
|
-
|
|
66
|
+
SHARED_STARTUP_NOTE,
|
|
73
67
|
'- branch_pr: `agentplane pr check <task-id>` -> `agentplane integrate <task-id> --branch task/<task-id>/<slug> --merge-strategy squash --run-verify` -> `agentplane finish <task-id> --commit <git-rev> --author INTEGRATOR --body "Verified: ..." --result "..." --close-commit`.',
|
|
74
68
|
`- direct: the task owner normally closes with \`${COMMAND_SNIPPETS.core.finishTask}\` plus \`--result "..." \`.`,
|
|
69
|
+
"- For branch-level flags and branch/base diagnostics, use `agentplane help work start`, `agentplane help integrate`, and `agentplane help branch base`.",
|
|
75
70
|
],
|
|
76
71
|
},
|
|
77
72
|
{
|
|
78
73
|
role: "CREATOR",
|
|
79
74
|
lines: [
|
|
80
|
-
|
|
75
|
+
SHARED_STARTUP_NOTE,
|
|
81
76
|
`- Use \`${COMMAND_SNIPPETS.core.startTask}\` only when the new-agent creation task is approved and ready.`,
|
|
82
77
|
"- Keep commits scoped to the created agent artifacts and task docs.",
|
|
83
78
|
],
|
|
@@ -85,7 +80,7 @@ const ROLE_GUIDES = [
|
|
|
85
80
|
{
|
|
86
81
|
role: "REDMINE",
|
|
87
82
|
lines: [
|
|
88
|
-
|
|
83
|
+
SHARED_STARTUP_NOTE,
|
|
89
84
|
`- Sync explicitly with \`${COMMAND_SNIPPETS.sync.pullRedmineExplicit}\` / \`${COMMAND_SNIPPETS.sync.pushRedmineExplicitWithYes}\`.`,
|
|
90
85
|
"- After sync, follow the same task/bootstrap lifecycle as local backends.",
|
|
91
86
|
],
|
|
@@ -93,7 +88,7 @@ const ROLE_GUIDES = [
|
|
|
93
88
|
{
|
|
94
89
|
role: "UPDATER",
|
|
95
90
|
lines: [
|
|
96
|
-
|
|
91
|
+
SHARED_STARTUP_NOTE,
|
|
97
92
|
"- Read-only role: inspect state, do not mutate task or workflow artifacts.",
|
|
98
93
|
],
|
|
99
94
|
},
|
|
@@ -101,52 +96,81 @@ const ROLE_GUIDES = [
|
|
|
101
96
|
export function listRoles() {
|
|
102
97
|
return ROLE_GUIDES.map((guide) => guide.role);
|
|
103
98
|
}
|
|
104
|
-
export function
|
|
99
|
+
export function getRoleSupplementLines(roleRaw) {
|
|
105
100
|
const trimmed = roleRaw.trim();
|
|
106
101
|
if (!trimmed)
|
|
107
102
|
return null;
|
|
108
103
|
const normalized = trimmed.toUpperCase();
|
|
109
104
|
const guide = ROLE_GUIDES.find((entry) => entry.role.toUpperCase() === normalized);
|
|
110
|
-
|
|
105
|
+
return guide ? guide.lines : null;
|
|
106
|
+
}
|
|
107
|
+
function renderRoleList(title, items) {
|
|
108
|
+
return items && items.length > 0 ? ["", `${title}:`, ...items.map((item) => `- ${item}`)] : [];
|
|
109
|
+
}
|
|
110
|
+
export function renderRole(roleRaw, opts = {}) {
|
|
111
|
+
const trimmed = roleRaw.trim();
|
|
112
|
+
if (!trimmed)
|
|
111
113
|
return null;
|
|
112
|
-
|
|
114
|
+
const normalized = trimmed.toUpperCase();
|
|
115
|
+
const supplementLines = getRoleSupplementLines(normalized);
|
|
116
|
+
const profile = opts.profile ?? null;
|
|
117
|
+
if (!supplementLines && !profile)
|
|
118
|
+
return null;
|
|
119
|
+
const heading = (typeof profile?.id === "string" && profile.id.trim()) || normalized;
|
|
120
|
+
const role = typeof profile?.role === "string" ? profile.role.trim() : "";
|
|
121
|
+
const description = typeof profile?.description === "string" ? profile.description.trim() : "";
|
|
122
|
+
const lines = [
|
|
123
|
+
`### ${heading}`,
|
|
124
|
+
...(role ? [`Role: ${role}`] : []),
|
|
125
|
+
...(description ? [`Description: ${description}`] : []),
|
|
126
|
+
...renderRoleList("Inputs", profile?.inputs),
|
|
127
|
+
...renderRoleList("Outputs", profile?.outputs),
|
|
128
|
+
...renderRoleList("Permissions", profile?.permissions),
|
|
129
|
+
...renderRoleList("Workflow", profile?.workflow),
|
|
130
|
+
...(supplementLines ? ["", "CLI/runtime notes:", ...supplementLines] : []),
|
|
131
|
+
...(profile?.filename
|
|
132
|
+
? [
|
|
133
|
+
"",
|
|
134
|
+
`Source: .agentplane/agents/${profile.filename} (role-specific content); policy gateway files still have higher priority.`,
|
|
135
|
+
]
|
|
136
|
+
: []),
|
|
137
|
+
];
|
|
138
|
+
return lines.join("\n").trimEnd();
|
|
113
139
|
}
|
|
114
140
|
export function renderQuickstart() {
|
|
115
141
|
return [
|
|
116
142
|
"# agentplane quickstart",
|
|
117
143
|
"",
|
|
118
|
-
"The policy gateway file (AGENTS.md or CLAUDE.md) is the source of truth for workflow/process policy.
|
|
144
|
+
"The policy gateway file (AGENTS.md or CLAUDE.md) is the source of truth for workflow/process policy.",
|
|
145
|
+
"Keep this first screen short: use it for startup only, then go deeper with `agentplane role <ROLE>` or `agentplane help <command>`.",
|
|
119
146
|
"Do not edit `.agentplane/tasks.json` by hand.",
|
|
120
147
|
"If the repository is not initialized yet, stop and run `agentplane init` first.",
|
|
121
148
|
"",
|
|
122
|
-
|
|
123
|
-
"",
|
|
124
|
-
...renderBootstrapOverview(),
|
|
149
|
+
`Canonical installed startup surface: \`${COMMAND_SNIPPETS.core.quickstart}\`.`,
|
|
125
150
|
"",
|
|
126
|
-
"##
|
|
151
|
+
"## First screen",
|
|
127
152
|
"",
|
|
128
|
-
|
|
129
|
-
"- Role output should add deltas, not replace the canonical bootstrap flow.",
|
|
153
|
+
"Run preflight:",
|
|
130
154
|
"",
|
|
131
|
-
|
|
155
|
+
...renderQuickstartCommandBlock(BOOTSTRAP_PREFLIGHT_COMMANDS),
|
|
132
156
|
"",
|
|
133
|
-
"
|
|
134
|
-
"- `agentplane pr open <task-id>` / `agentplane pr update <task-id>` / `agentplane pr check <task-id>`",
|
|
135
|
-
"- `agentplane integrate <task-id> --branch task/<task-id>/<slug> --run-verify`",
|
|
157
|
+
"Default direct route:",
|
|
136
158
|
"",
|
|
137
|
-
|
|
159
|
+
`- Task setup: \`${BOOTSTRAP_TASK_PREP_COMMANDS[0]}\` -> \`${BOOTSTRAP_TASK_PREP_COMMANDS[1]}\` -> \`${BOOTSTRAP_TASK_PREP_COMMANDS[2]}\`.`,
|
|
160
|
+
`- Execution: \`${COMMAND_SNIPPETS.core.startTask}\` -> \`agentplane task verify-show <task-id>\` -> \`${COMMAND_SNIPPETS.core.verifyTask}\` -> \`${COMMAND_SNIPPETS.core.finishTask}\` with \`--result "..." \`.`,
|
|
161
|
+
"- In `direct`, `finish` creates the deterministic close commit by default.",
|
|
138
162
|
"",
|
|
139
|
-
"
|
|
140
|
-
`- \`${COMMAND_SNIPPETS.core.role}\` for role-specific deltas.`,
|
|
141
|
-
`- \`${AGENT_BOOTSTRAP_DOC_PATH}\` for the canonical startup path in repository docs.`,
|
|
163
|
+
"## Go deeper",
|
|
142
164
|
"",
|
|
143
|
-
|
|
165
|
+
`- \`${COMMAND_SNIPPETS.core.role}\` for role-specific deltas and mode-specific ownership rules.`,
|
|
166
|
+
"- `agentplane help <command>` for flags, examples, and exceptional/manual flows.",
|
|
167
|
+
"- Keep installed runtime guidance self-contained; do not depend on repo-only docs files.",
|
|
168
|
+
"- If you need the docs site, treat it as a public reference surface rather than a required local file.",
|
|
144
169
|
"",
|
|
145
|
-
"
|
|
170
|
+
"## Non-default",
|
|
146
171
|
"",
|
|
147
|
-
"
|
|
148
|
-
"-
|
|
149
|
-
"-
|
|
150
|
-
"- Comment-driven commit bodies are structured: `Task`, `Primary`, `Status`, `Comment`.",
|
|
172
|
+
"- `branch_pr`: use `agentplane help work start`, `agentplane help pr`, and `agentplane help integrate`.",
|
|
173
|
+
"- Recovery/mixed state: use `agentplane doctor`, `agentplane upgrade`, and `agentplane runtime explain`.",
|
|
174
|
+
"- Manual close or allowlist details belong in command-specific help, not on this first screen.",
|
|
151
175
|
].join("\n");
|
|
152
176
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { COMMANDS } from "./command-catalog.js";
|
|
2
|
+
export type CatalogMatch = {
|
|
3
|
+
entry: (typeof COMMANDS)[number];
|
|
4
|
+
consumed: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function matchCommandCatalog(tokens: readonly string[]): CatalogMatch | null;
|
|
7
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,GAAG,IAAI,CAkBlF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { COMMANDS } from "./command-catalog.js";
|
|
2
|
+
export function matchCommandCatalog(tokens) {
|
|
3
|
+
let best = null;
|
|
4
|
+
for (const entry of COMMANDS) {
|
|
5
|
+
const id = entry.spec.id;
|
|
6
|
+
if (tokens.length < id.length)
|
|
7
|
+
continue;
|
|
8
|
+
let ok = true;
|
|
9
|
+
for (const [i, seg] of id.entries()) {
|
|
10
|
+
if (tokens[i] !== seg) {
|
|
11
|
+
ok = false;
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (!ok)
|
|
16
|
+
continue;
|
|
17
|
+
if (!best || id.length > best.consumed) {
|
|
18
|
+
best = { entry, consumed: id.length };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return best;
|
|
22
|
+
}
|
|
@@ -15,5 +15,5 @@ export type CommandEntry = {
|
|
|
15
15
|
needsConfig: boolean;
|
|
16
16
|
needsTaskContext: boolean;
|
|
17
17
|
};
|
|
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, 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, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry];
|
|
19
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;AAmHvD,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,+5CA6iBuB,CAAC"}
|
|
@@ -67,6 +67,7 @@ import { workflowBuildSpec } from "../../commands/workflow-build.command.js";
|
|
|
67
67
|
import { workflowRestoreSpec } from "../../commands/workflow-restore.command.js";
|
|
68
68
|
import { workflowDebugSpec, workflowLandSpec, workflowSyncSpec, } from "../../commands/workflow-playbook.command.js";
|
|
69
69
|
import { docsCliSpec } from "../../commands/docs/cli.command.js";
|
|
70
|
+
import { runtimeExplainSpec, runtimeSpec } from "../../commands/runtime.command.js";
|
|
70
71
|
import { hooksSpec } from "../../commands/hooks/hooks.command.js";
|
|
71
72
|
import { hooksInstallSpec } from "../../commands/hooks/install.command.js";
|
|
72
73
|
import { hooksUninstallSpec } from "../../commands/hooks/uninstall.command.js";
|
|
@@ -124,6 +125,16 @@ export const COMMANDS = [
|
|
|
124
125
|
needsConfig: false,
|
|
125
126
|
needsTaskContext: false,
|
|
126
127
|
}),
|
|
128
|
+
entry(runtimeSpec, () => import("../../commands/runtime.command.js").then((m) => m.runRuntime), {
|
|
129
|
+
needsProject: false,
|
|
130
|
+
needsConfig: false,
|
|
131
|
+
needsTaskContext: false,
|
|
132
|
+
}),
|
|
133
|
+
entry(runtimeExplainSpec, () => import("../../commands/runtime.command.js").then((m) => m.runRuntimeExplain), {
|
|
134
|
+
needsProject: false,
|
|
135
|
+
needsConfig: false,
|
|
136
|
+
needsTaskContext: false,
|
|
137
|
+
}),
|
|
127
138
|
entry(roleSpec, () => import("./commands/core.js").then((m) => m.runRole), {
|
|
128
139
|
needsProject: false,
|
|
129
140
|
needsConfig: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/core.ts"],"names":[],"mappings":"AAYA,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":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAatE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIrD,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAcxD,CAAC;AA6BF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAE1D,CAAC;AAEF,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AACtC,KAAK,eAAe,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAkP9D,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,eAAe,CAuCtD,CAAC;AAiDF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,eAAe,CAExD,CAAC;AAEF,KAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,UAAU,CAe5C,CAAC;AA4OF,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,CA0FhF"}
|
|
@@ -8,7 +8,7 @@ import { fileExists } from "../../fs-utils.js";
|
|
|
8
8
|
import { CliError } from "../../../shared/errors.js";
|
|
9
9
|
import { dedupeStrings } from "../../../shared/strings.js";
|
|
10
10
|
import { usageError } from "../../spec/errors.js";
|
|
11
|
-
import { listRoles, renderQuickstart, renderRole } from "../../command-guide.js";
|
|
11
|
+
import { getRoleSupplementLines, listRoles, renderQuickstart, renderRole, } from "../../command-guide.js";
|
|
12
12
|
import { isWorkflowEnforcementDisabled, validateWorkflowAtPath, workflowEnforcementEnvHint, } from "../../../workflow-runtime/index.js";
|
|
13
13
|
import { toStringList } from "../../spec/parse-utils.js";
|
|
14
14
|
import { wrapCommand } from "./wrap-command.js";
|
|
@@ -420,7 +420,7 @@ async function readAgentProfile(opts) {
|
|
|
420
420
|
const raw = parseAgentProfileJson(filePath, await readFile(filePath, "utf8"));
|
|
421
421
|
return { agentplaneDir: listing.agentplaneDir, filename, profile: raw };
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function toRoleProfileGuide(opts) {
|
|
424
424
|
const id = (typeof opts.profile.id === "string" ? opts.profile.id : "").trim() || opts.roleId;
|
|
425
425
|
const role = (typeof opts.profile.role === "string" ? opts.profile.role : "").trim();
|
|
426
426
|
const description = (typeof opts.profile.description === "string" ? opts.profile.description : "").trim();
|
|
@@ -428,18 +428,16 @@ function renderAgentProfileBlock(opts) {
|
|
|
428
428
|
const outputs = toStringList(opts.profile.outputs);
|
|
429
429
|
const permissions = toStringList(opts.profile.permissions);
|
|
430
430
|
const workflow = toStringList(opts.profile.workflow);
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
];
|
|
442
|
-
return lines.join("\n").trimEnd();
|
|
431
|
+
return {
|
|
432
|
+
filename: opts.filename,
|
|
433
|
+
id,
|
|
434
|
+
role,
|
|
435
|
+
description,
|
|
436
|
+
inputs,
|
|
437
|
+
outputs,
|
|
438
|
+
permissions,
|
|
439
|
+
workflow,
|
|
440
|
+
};
|
|
443
441
|
}
|
|
444
442
|
async function cmdRole(opts) {
|
|
445
443
|
return wrapCommand({ command: "role", rootOverride: opts.rootOverride }, async () => {
|
|
@@ -452,12 +450,19 @@ async function cmdRole(opts) {
|
|
|
452
450
|
});
|
|
453
451
|
}
|
|
454
452
|
const normalizedRole = normalizeRoleId(roleRaw);
|
|
455
|
-
const guide = renderRole(normalizedRole);
|
|
456
453
|
const agentProfile = await readAgentProfile({
|
|
457
454
|
cwd: opts.cwd,
|
|
458
455
|
rootOverride: opts.rootOverride,
|
|
459
456
|
roleId: normalizedRole,
|
|
460
457
|
});
|
|
458
|
+
const normalizedProfile = agentProfile
|
|
459
|
+
? toRoleProfileGuide({
|
|
460
|
+
filename: agentProfile.filename,
|
|
461
|
+
roleId: normalizedRole,
|
|
462
|
+
profile: agentProfile.profile,
|
|
463
|
+
})
|
|
464
|
+
: null;
|
|
465
|
+
const guide = renderRole(normalizedRole, { profile: normalizedProfile });
|
|
461
466
|
if (!guide && !agentProfile) {
|
|
462
467
|
const builtin = listRoles();
|
|
463
468
|
const agentIds = await listAgentProfileIds({
|
|
@@ -477,11 +482,15 @@ async function cmdRole(opts) {
|
|
|
477
482
|
if (opts.json) {
|
|
478
483
|
const payload = {
|
|
479
484
|
role: normalizedRole,
|
|
480
|
-
|
|
485
|
+
guide: guide
|
|
481
486
|
.split("\n")
|
|
482
487
|
.map((line) => line.trim())
|
|
483
488
|
.filter((line) => line.length > 0),
|
|
484
489
|
};
|
|
490
|
+
const supplementLines = getRoleSupplementLines(normalizedRole);
|
|
491
|
+
if (supplementLines) {
|
|
492
|
+
payload.builtin_guide = supplementLines;
|
|
493
|
+
}
|
|
485
494
|
if (agentProfile) {
|
|
486
495
|
payload.agent_profile = {
|
|
487
496
|
filename: agentProfile.filename,
|
|
@@ -492,14 +501,6 @@ async function cmdRole(opts) {
|
|
|
492
501
|
return 0;
|
|
493
502
|
}
|
|
494
503
|
process.stdout.write(`${guide}\n`);
|
|
495
|
-
if (agentProfile) {
|
|
496
|
-
const block = renderAgentProfileBlock({
|
|
497
|
-
filename: agentProfile.filename,
|
|
498
|
-
roleId: normalizedRole,
|
|
499
|
-
profile: agentProfile.profile,
|
|
500
|
-
});
|
|
501
|
-
process.stdout.write(`\n## Agent profile\n\n${block}\n`);
|
|
502
|
-
}
|
|
503
504
|
return 0;
|
|
504
505
|
}
|
|
505
506
|
if (!agentProfile) {
|
|
@@ -510,14 +511,21 @@ async function cmdRole(opts) {
|
|
|
510
511
|
message: `Unknown role: ${roleRaw}.`,
|
|
511
512
|
});
|
|
512
513
|
}
|
|
513
|
-
const block =
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
514
|
+
const block = renderRole(normalizedRole, { profile: normalizedProfile });
|
|
515
|
+
if (!block) {
|
|
516
|
+
throw usageError({
|
|
517
|
+
spec: roleSpec,
|
|
518
|
+
command: "role",
|
|
519
|
+
message: `Unknown role: ${roleRaw}.`,
|
|
520
|
+
});
|
|
521
|
+
}
|
|
518
522
|
if (opts.json) {
|
|
519
523
|
process.stdout.write(`${JSON.stringify({
|
|
520
524
|
role: normalizedRole,
|
|
525
|
+
guide: block
|
|
526
|
+
.split("\n")
|
|
527
|
+
.map((line) => line.trim())
|
|
528
|
+
.filter((line) => line.length > 0),
|
|
521
529
|
agent_profile: {
|
|
522
530
|
filename: agentProfile.filename,
|
|
523
531
|
profile: agentProfile.profile,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-config.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"write-config.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-config.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,cAAc,GAAG,UAAU,GAAG,YAAY,CAAC;IACpD,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,yCAAyC,EAAE,MAAM,EAAE,CAAC;CACrD,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB"}
|
|
@@ -2,6 +2,7 @@ import { mkdir } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { defaultConfig, saveConfig, setByDottedKey } from "@agentplaneorg/core";
|
|
4
4
|
import { writeJsonStableIfChanged } from "../../../../shared/write-if-changed.js";
|
|
5
|
+
import { getVersion } from "../../../../meta/version.js";
|
|
5
6
|
export async function ensureAgentplaneDirs(agentplaneDir, backend) {
|
|
6
7
|
await mkdir(agentplaneDir, { recursive: true });
|
|
7
8
|
await mkdir(path.join(agentplaneDir, "tasks"), { recursive: true });
|
|
@@ -21,6 +22,7 @@ export async function writeInitConfig(opts) {
|
|
|
21
22
|
setByDottedKey(rawConfig, "agents.approvals.require_plan", String(opts.requirePlanApproval));
|
|
22
23
|
setByDottedKey(rawConfig, "agents.approvals.require_network", String(opts.requireNetworkApproval));
|
|
23
24
|
setByDottedKey(rawConfig, "agents.approvals.require_verify", String(opts.requireVerifyApproval));
|
|
25
|
+
setByDottedKey(rawConfig, "framework.cli.expected_version", getVersion());
|
|
24
26
|
setByDottedKey(rawConfig, "execution", JSON.stringify(opts.execution));
|
|
25
27
|
await saveConfig(opts.agentplaneDir, rawConfig);
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-workflow.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"write-workflow.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-workflow.ts"],"names":[],"mappings":"AAEA,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,QAAQ,GAAG,WAAW,CAAC;IACrC,SAAS,EAAE;QACT,mBAAmB,EAAE,OAAO,CAAC;QAC7B,qBAAqB,EAAE,OAAO,CAAC;QAC/B,sBAAsB,EAAE,OAAO,CAAC;KACjC,CAAC;CACH,GAAG,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAOtC"}
|
|
@@ -1,58 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DEFAULT_WORKFLOW_TEMPLATE, buildWorkflowFromTemplates, diagnosticsSummary, publishWorkflowCandidate, resolveWorkflowPaths, } from "../../../../workflow-runtime/index.js";
|
|
1
|
+
import { ensureWorkflowArtifacts } from "../../../../shared/workflow-artifacts.js";
|
|
3
2
|
export async function ensureInitWorkflow(opts) {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
mode: opts.workflowMode,
|
|
9
|
-
version: 1,
|
|
10
|
-
approvals: {
|
|
11
|
-
require_plan: opts.approvals.requirePlanApproval,
|
|
12
|
-
require_verify: opts.approvals.requireVerifyApproval,
|
|
13
|
-
require_network: opts.approvals.requireNetworkApproval,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
runtime: {
|
|
17
|
-
repo_name: opts.gitRoot.split(/[/\\\\]/).findLast((segment) => segment.length > 0) ?? "repo",
|
|
18
|
-
repo_root: opts.gitRoot,
|
|
19
|
-
timestamp: new Date().toISOString(),
|
|
20
|
-
},
|
|
21
|
-
},
|
|
3
|
+
const ensured = await ensureWorkflowArtifacts({
|
|
4
|
+
gitRoot: opts.gitRoot,
|
|
5
|
+
workflowMode: opts.workflowMode,
|
|
6
|
+
approvals: opts.approvals,
|
|
22
7
|
});
|
|
23
|
-
|
|
24
|
-
throw new CliError({
|
|
25
|
-
exitCode: 3,
|
|
26
|
-
code: "E_VALIDATION",
|
|
27
|
-
message: `Failed to generate WORKFLOW.md: ${diagnosticsSummary(built.diagnostics)}`,
|
|
28
|
-
context: {
|
|
29
|
-
diagnostics: built.diagnostics.map((d) => ({
|
|
30
|
-
severity: d.severity,
|
|
31
|
-
code: d.code,
|
|
32
|
-
path: d.path,
|
|
33
|
-
message: d.message,
|
|
34
|
-
})),
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
const published = await publishWorkflowCandidate(opts.gitRoot, built.text);
|
|
39
|
-
if (!published.ok) {
|
|
40
|
-
throw new CliError({
|
|
41
|
-
exitCode: 3,
|
|
42
|
-
code: "E_VALIDATION",
|
|
43
|
-
message: `Failed to publish WORKFLOW.md: ${diagnosticsSummary(published.diagnostics)}`,
|
|
44
|
-
context: {
|
|
45
|
-
diagnostics: published.diagnostics.map((d) => ({
|
|
46
|
-
severity: d.severity,
|
|
47
|
-
code: d.code,
|
|
48
|
-
path: d.path,
|
|
49
|
-
message: d.message,
|
|
50
|
-
})),
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
const workflowPaths = resolveWorkflowPaths(opts.gitRoot);
|
|
55
|
-
return {
|
|
56
|
-
installPaths: [workflowPaths.workflowPath, workflowPaths.lastKnownGoodPath],
|
|
57
|
-
};
|
|
8
|
+
return { installPaths: ensured.installPaths };
|
|
58
9
|
}
|
|
@@ -220,8 +220,8 @@ export const initSpec = {
|
|
|
220
220
|
why: "Non-interactive setup with flexible defaults.",
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
|
-
cmd: "agentplane init --workflow direct --backend local --hooks true --require-
|
|
224
|
-
why: "Non-interactive setup with explicit
|
|
223
|
+
cmd: "agentplane init --workflow direct --backend local --hooks true --require-network-approval true --yes",
|
|
224
|
+
why: "Non-interactive setup with profile defaults plus an explicit network-approval override.",
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
227
|
cmd: "agentplane init --force --yes",
|
|
@@ -318,14 +318,11 @@ async function cmdInit(opts) {
|
|
|
318
318
|
const isInteractive = process.stdin.isTTY && !flags.yes;
|
|
319
319
|
if (!process.stdin.isTTY &&
|
|
320
320
|
!flags.yes &&
|
|
321
|
-
(!flags.workflow ||
|
|
322
|
-
flags.requirePlanApproval === undefined ||
|
|
323
|
-
flags.requireNetworkApproval === undefined ||
|
|
324
|
-
flags.requireVerifyApproval === undefined)) {
|
|
321
|
+
(!flags.workflow || flags.requireNetworkApproval === undefined)) {
|
|
325
322
|
throw usageError({
|
|
326
323
|
spec: initSpec,
|
|
327
324
|
command: "init",
|
|
328
|
-
message: "Non-interactive init requires --yes or explicit values for: --workflow, --require-
|
|
325
|
+
message: "Non-interactive init requires --yes or explicit values for: --workflow, --require-network-approval.",
|
|
329
326
|
});
|
|
330
327
|
}
|
|
331
328
|
if (isInteractive) {
|
|
@@ -406,16 +403,10 @@ async function cmdInit(opts) {
|
|
|
406
403
|
if (flags.strictUnsafeConfirm === undefined) {
|
|
407
404
|
strictUnsafeConfirm = await askYesNo("Require strict explicit confirmation for extra unsafe actions?", strictUnsafeConfirm);
|
|
408
405
|
}
|
|
409
|
-
process.stdout.write(renderInitSection("
|
|
410
|
-
if (flags.requirePlanApproval === undefined) {
|
|
411
|
-
requirePlanApproval = await askYesNo("Require plan approval before work starts?", requirePlanApproval);
|
|
412
|
-
}
|
|
406
|
+
process.stdout.write(renderInitSection("Network Approval", "Control whether network actions require explicit approval by default. Plan and verification approvals follow the selected setup profile unless you override them with explicit flags."));
|
|
413
407
|
if (flags.requireNetworkApproval === undefined) {
|
|
414
408
|
requireNetworkApproval = await askYesNo("Require explicit approval for network actions?", requireNetworkApproval);
|
|
415
409
|
}
|
|
416
|
-
if (flags.requireVerifyApproval === undefined) {
|
|
417
|
-
requireVerifyApproval = await askYesNo("Require explicit approval before recording verification?", requireVerifyApproval);
|
|
418
|
-
}
|
|
419
410
|
process.stdout.write(renderInitSection("Recipes", "Optional: install recipe packs now (comma-separated IDs) or choose none."));
|
|
420
411
|
if (!flags.recipes) {
|
|
421
412
|
process.stdout.write(`${renderBundledRecipesHint()}\n`);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CliError } from "../../shared/errors.js";
|
|
2
|
+
export type NextAction = {
|
|
3
|
+
command: string;
|
|
4
|
+
reason: string;
|
|
5
|
+
reasonCode?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function writeError(err: CliError, jsonErrors: boolean): void;
|
|
8
|
+
export declare function resolveAgentplaneHome(): string;
|
|
9
|
+
//# sourceMappingURL=error-guidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-guidance.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/error-guidance.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGvD,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AASF,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CA4CnE;AAID,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C"}
|