agentplane 0.3.4 → 0.3.6
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 +103 -75
- package/assets/AGENTS.md +4 -2
- package/bin/dist-guard.js +13 -3
- package/bin/runtime-watch.d.ts +1 -0
- package/bin/runtime-watch.js +22 -5
- package/bin/stale-dist-policy.js +9 -2
- package/dist/.build-manifest.json +220 -790
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.js +5 -2
- package/dist/backends/task-backend/local-backend.d.ts +13 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +17 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +18 -0
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +35 -25
- package/dist/backends/task-backend/shared/types.d.ts +20 -0
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
- package/dist/backends/task-backend/shared.d.ts +1 -1
- package/dist/backends/task-backend/shared.d.ts.map +1 -1
- package/dist/backends/task-backend.d.ts +1 -1
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.test-helpers.d.ts +4 -0
- package/dist/backends/task-backend.test-helpers.d.ts.map +1 -0
- package/dist/backends/task-backend.test-helpers.js +33 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +1 -0
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +3 -2
- package/dist/cli/reason-codes.d.ts.map +1 -1
- package/dist/cli/reason-codes.js +30 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/core.js +137 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.js +52 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/project.js +78 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts +19 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/shared.js +9 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/task.js +85 -0
- package/dist/cli/run-cli/command-catalog.d.ts +3 -18
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +8 -337
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/ide.js +64 -2
- package/dist/cli/run-cli/commands/init/ui.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/ui.js +33 -13
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.js +41 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +2 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.js +6 -0
- package/dist/cli/run-cli.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +138 -6
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -2
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +3 -6
- package/dist/commands/doctor/workspace.d.ts +4 -1
- package/dist/commands/doctor/workspace.d.ts.map +1 -1
- package/dist/commands/doctor/workspace.js +87 -4
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +8 -1
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/allow.d.ts +5 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +15 -10
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +137 -18
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +8 -35
- package/dist/commands/recipes/impl/apply.d.ts +4 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +34 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +70 -11
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +24 -12
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +32 -36
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +7 -4
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +9 -11
- package/dist/commands/recipes/impl/constants.d.ts +2 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
- package/dist/commands/recipes/impl/constants.js +2 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
- package/dist/commands/recipes/impl/manifest.js +219 -23
- package/dist/commands/recipes/impl/normalize.d.ts +3 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -1
- package/dist/commands/recipes/impl/normalize.js +28 -24
- package/dist/commands/recipes/impl/paths.d.ts +9 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +10 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +7 -0
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-installed-recipes.js +102 -0
- package/dist/commands/recipes/impl/resolver.d.ts +20 -0
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -0
- package/dist/commands/recipes/impl/resolver.js +220 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
- package/dist/commands/recipes/impl/scenario.js +40 -11
- package/dist/commands/recipes/impl/types.d.ts +145 -16
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.js +3 -2
- package/dist/commands/recipes.d.ts +6 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +5 -3
- package/dist/commands/recipes.test-helpers.d.ts +185 -0
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -0
- package/dist/commands/recipes.test-helpers.js +339 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +192 -336
- package/dist/commands/scenario/info.command.d.ts.map +1 -1
- package/dist/commands/scenario/info.command.js +7 -2
- package/dist/commands/scenario/list.command.js +2 -2
- package/dist/commands/scenario/run.command.d.ts.map +1 -1
- package/dist/commands/scenario/run.command.js +7 -2
- package/dist/commands/shared/git-context.d.ts +1 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +4 -0
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +77 -2
- package/dist/commands/shared/task-backend.d.ts +5 -0
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +24 -0
- package/dist/commands/shared/task-store.d.ts +32 -1
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +166 -42
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +46 -29
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +12 -37
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +12 -30
- package/dist/commands/task/close-shared.d.ts +14 -0
- package/dist/commands/task/close-shared.d.ts.map +1 -0
- package/dist/commands/task/close-shared.js +76 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +35 -17
- package/dist/commands/task/doc-set.command.d.ts +2 -1
- package/dist/commands/task/doc-set.command.d.ts.map +1 -1
- package/dist/commands/task/doc-set.command.js +36 -4
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +2 -7
- package/dist/commands/task/doc.command.js +1 -1
- package/dist/commands/task/doc.d.ts +2 -1
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +123 -71
- package/dist/commands/task/export.d.ts.map +1 -1
- package/dist/commands/task/export.js +4 -4
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +141 -78
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +15 -11
- package/dist/commands/task/plan-set.command.js +1 -1
- package/dist/commands/task/plan.command.d.ts +8 -0
- package/dist/commands/task/plan.command.d.ts.map +1 -0
- package/dist/commands/task/plan.command.js +37 -0
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +190 -93
- package/dist/commands/task/set-status.command.d.ts.map +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +40 -3
- package/dist/commands/task/shared/docs.d.ts +1 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +7 -0
- package/dist/commands/task/shared/transitions.d.ts +0 -2
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +0 -6
- package/dist/commands/task/shared.d.ts +2 -2
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +88 -63
- package/dist/commands/task/task.command.d.ts +8 -0
- package/dist/commands/task/task.command.d.ts.map +1 -0
- package/dist/commands/task/task.command.js +71 -0
- package/dist/commands/task/verify-command-shared.d.ts +16 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -0
- package/dist/commands/task/verify-command-shared.js +53 -0
- package/dist/commands/task/verify-ok.command.d.ts +2 -6
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +8 -50
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +119 -140
- package/dist/commands/task/verify-rework.command.d.ts +2 -6
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +8 -50
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +3 -12
- package/dist/policy/rules/allowlist.d.ts.map +1 -1
- package/dist/policy/rules/allowlist.js +13 -4
- package/dist/policy/rules/protected-paths.d.ts.map +1 -1
- package/dist/policy/rules/protected-paths.js +6 -1
- package/dist/ports/task-backend-port.d.ts +1 -1
- package/dist/ports/task-backend-port.d.ts.map +1 -1
- package/dist/shared/agent-emoji.d.ts.map +1 -1
- package/dist/shared/protected-paths.d.ts +7 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +26 -10
- package/dist/shared/repo-cli-version.d.ts.map +1 -1
- package/dist/shared/repo-cli-version.js +9 -3
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import { backendNotSupportedMessage } from "../../cli/output.js";
|
|
|
6
6
|
import { CliError } from "../../shared/errors.js";
|
|
7
7
|
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
8
8
|
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
9
|
-
import { ensureAgentFilledRequiredDocSections, extractDocSection, extractTaskObservationSection, isVerifyStepsFilled, nowIso, normalizeTaskDocVersion, taskObservationSectionName, requiresVerifyStepsByPrimary, toStringArray, } from "./shared.js";
|
|
9
|
+
import { decodeEscapedTaskTextNewlines, ensureAgentFilledRequiredDocSections, extractDocSection, extractTaskObservationSection, isVerifyStepsFilled, nowIso, normalizeTaskDocVersion, taskObservationSectionName, requiresVerifyStepsByPrimary, toStringArray, } from "./shared.js";
|
|
10
10
|
async function loadPlanTask(opts) {
|
|
11
11
|
const ctx = opts.ctx ??
|
|
12
12
|
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
@@ -28,6 +28,68 @@ async function loadPlanTask(opts) {
|
|
|
28
28
|
function normalizeForComparison(text) {
|
|
29
29
|
return text.replaceAll("\r\n", "\n").trim();
|
|
30
30
|
}
|
|
31
|
+
function buildPlanDocUpdate(opts) {
|
|
32
|
+
const baseDoc = ensureDocSections(opts.currentDocRaw ?? "", opts.requiredSections);
|
|
33
|
+
const currentPlan = extractDocSection(baseDoc, "Plan") ?? "";
|
|
34
|
+
const planChanged = normalizeForComparison(currentPlan) !== normalizeForComparison(opts.text);
|
|
35
|
+
const nextDoc = ensureDocSections(setMarkdownSection(baseDoc, "Plan", opts.text), opts.requiredSections);
|
|
36
|
+
return {
|
|
37
|
+
currentPlan,
|
|
38
|
+
nextPlan: extractDocSection(nextDoc, "Plan") ?? "",
|
|
39
|
+
planChanged,
|
|
40
|
+
docChanged: nextDoc !== baseDoc,
|
|
41
|
+
nextDoc,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function assertPlanSectionPresent(taskId, doc, action) {
|
|
45
|
+
const plan = extractDocSection(doc, "Plan");
|
|
46
|
+
if (!plan || plan.trim().length === 0) {
|
|
47
|
+
throw new CliError({
|
|
48
|
+
exitCode: 3,
|
|
49
|
+
code: "E_VALIDATION",
|
|
50
|
+
message: `${taskId}: cannot ${action} plan: ## Plan section is missing or empty`,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function assertPlanCanBeApproved(opts) {
|
|
55
|
+
assertPlanSectionPresent(opts.task.id, opts.doc, "approve");
|
|
56
|
+
ensureAgentFilledRequiredDocSections({
|
|
57
|
+
task: opts.task,
|
|
58
|
+
config: opts.config,
|
|
59
|
+
doc: opts.doc,
|
|
60
|
+
action: "approve plan",
|
|
61
|
+
});
|
|
62
|
+
const enforceVerifySteps = opts.config.tasks.verify.enforce_on_plan_approve !== false;
|
|
63
|
+
if (!enforceVerifySteps)
|
|
64
|
+
return;
|
|
65
|
+
const tags = toStringArray(opts.task.tags);
|
|
66
|
+
const spikeTag = (opts.config.tasks.verify.spike_tag ?? "spike").trim().toLowerCase();
|
|
67
|
+
const verifyRequired = requiresVerifyStepsByPrimary(tags, opts.config);
|
|
68
|
+
const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
|
|
69
|
+
if (verifyRequired || isSpike) {
|
|
70
|
+
const verifySteps = extractDocSection(opts.doc, "Verify Steps");
|
|
71
|
+
if (!isVerifyStepsFilled(verifySteps)) {
|
|
72
|
+
throw new CliError({
|
|
73
|
+
exitCode: 3,
|
|
74
|
+
code: "E_VALIDATION",
|
|
75
|
+
message: `${opts.task.id}: cannot approve plan: ## Verify Steps section is missing/empty/unfilled ` +
|
|
76
|
+
"(fill it before approving plan)",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!isSpike)
|
|
81
|
+
return;
|
|
82
|
+
const observationSection = taskObservationSectionName(normalizeTaskDocVersion(opts.task.doc_version));
|
|
83
|
+
const observation = extractTaskObservationSection(opts.doc, normalizeTaskDocVersion(opts.task.doc_version));
|
|
84
|
+
if (!observation || observation.trim().length === 0) {
|
|
85
|
+
throw new CliError({
|
|
86
|
+
exitCode: 3,
|
|
87
|
+
code: "E_VALIDATION",
|
|
88
|
+
message: `${opts.task.id}: cannot approve plan for spike: ## ${observationSection} section is missing or empty ` +
|
|
89
|
+
"(include Findings/Decision/Next Steps)",
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
31
93
|
export async function cmdTaskPlanSet(opts) {
|
|
32
94
|
try {
|
|
33
95
|
const { ctx, backend, task, useStore, store } = await loadPlanTask({
|
|
@@ -60,6 +122,9 @@ export async function cmdTaskPlanSet(opts) {
|
|
|
60
122
|
updatedBy = trimmed;
|
|
61
123
|
}
|
|
62
124
|
let text = opts.text ?? "";
|
|
125
|
+
if (hasText) {
|
|
126
|
+
text = decodeEscapedTaskTextNewlines(text);
|
|
127
|
+
}
|
|
63
128
|
if (hasFile) {
|
|
64
129
|
try {
|
|
65
130
|
text = await readFile(path.resolve(opts.cwd, opts.file ?? ""), "utf8");
|
|
@@ -68,28 +133,80 @@ export async function cmdTaskPlanSet(opts) {
|
|
|
68
133
|
throw mapCoreError(err, { command: "task plan set", filePath: opts.file ?? "" });
|
|
69
134
|
}
|
|
70
135
|
}
|
|
71
|
-
const existingDoc = useStore
|
|
72
|
-
? String(task.doc ?? "")
|
|
73
|
-
: (typeof task.doc === "string" ? task.doc : "") || (await backend.getTaskDoc(task.id));
|
|
74
|
-
const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
|
|
75
|
-
const currentPlan = extractDocSection(baseDoc, "Plan") ?? "";
|
|
76
|
-
const planChanged = normalizeForComparison(currentPlan) !== normalizeForComparison(text);
|
|
77
|
-
const nextDoc = ensureDocSections(setMarkdownSection(baseDoc, "Plan", text), config.tasks.doc.required_sections);
|
|
78
|
-
const docChanged = nextDoc !== baseDoc;
|
|
79
136
|
const readmePath = path.join(resolved.gitRoot, config.paths.workflow_dir, task.id, "README.md");
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
137
|
+
if (useStore) {
|
|
138
|
+
let expectedCurrentPlan;
|
|
139
|
+
await store.patch(opts.taskId, (current) => {
|
|
140
|
+
const { currentPlan, nextPlan, planChanged, docChanged } = buildPlanDocUpdate({
|
|
141
|
+
currentDocRaw: String(current.doc ?? ""),
|
|
142
|
+
text,
|
|
143
|
+
requiredSections: config.tasks.doc.required_sections,
|
|
144
|
+
});
|
|
145
|
+
if (!planChanged && !docChanged && !updatedBy)
|
|
146
|
+
return null;
|
|
147
|
+
if (!docChanged) {
|
|
148
|
+
return {
|
|
149
|
+
...(planChanged
|
|
150
|
+
? {
|
|
151
|
+
task: {
|
|
152
|
+
plan_approval: {
|
|
153
|
+
state: "pending",
|
|
154
|
+
updated_at: null,
|
|
155
|
+
updated_by: null,
|
|
156
|
+
note: null,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
}
|
|
160
|
+
: {}),
|
|
161
|
+
...(updatedBy ? { docMeta: { touch: true, updatedBy } } : {}),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
expectedCurrentPlan ??= currentPlan;
|
|
165
|
+
return {
|
|
166
|
+
doc: {
|
|
167
|
+
kind: "set-section",
|
|
168
|
+
section: "Plan",
|
|
169
|
+
text: nextPlan,
|
|
170
|
+
requiredSections: config.tasks.doc.required_sections,
|
|
171
|
+
expectedCurrentText: expectedCurrentPlan,
|
|
172
|
+
},
|
|
173
|
+
...(planChanged
|
|
174
|
+
? {
|
|
175
|
+
task: {
|
|
176
|
+
plan_approval: {
|
|
177
|
+
state: "pending",
|
|
178
|
+
updated_at: null,
|
|
179
|
+
updated_by: null,
|
|
180
|
+
note: null,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
}
|
|
184
|
+
: {}),
|
|
185
|
+
...(updatedBy ? { docMeta: { updatedBy } } : {}),
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
const existingDoc = (typeof task.doc === "string" ? task.doc : "") || (await backend.getTaskDoc(task.id));
|
|
191
|
+
const { planChanged, docChanged, nextDoc } = buildPlanDocUpdate({
|
|
192
|
+
currentDocRaw: existingDoc,
|
|
193
|
+
text,
|
|
194
|
+
requiredSections: config.tasks.doc.required_sections,
|
|
195
|
+
});
|
|
196
|
+
if (!planChanged && !docChanged && !updatedBy) {
|
|
197
|
+
process.stdout.write(`${readmePath}\n`);
|
|
198
|
+
return 0;
|
|
199
|
+
}
|
|
200
|
+
const nextTask = {
|
|
201
|
+
...task,
|
|
202
|
+
doc: nextDoc,
|
|
203
|
+
...(planChanged
|
|
204
|
+
? { plan_approval: { state: "pending", updated_at: null, updated_by: null, note: null } }
|
|
205
|
+
: {}),
|
|
206
|
+
...(updatedBy ? { doc_updated_by: updatedBy } : {}),
|
|
207
|
+
};
|
|
208
|
+
await backend.writeTask(nextTask);
|
|
83
209
|
}
|
|
84
|
-
const nextTask = {
|
|
85
|
-
...task,
|
|
86
|
-
doc: nextDoc,
|
|
87
|
-
...(planChanged
|
|
88
|
-
? { plan_approval: { state: "pending", updated_at: null, updated_by: null, note: null } }
|
|
89
|
-
: {}),
|
|
90
|
-
...(updatedBy ? { doc_updated_by: updatedBy } : {}),
|
|
91
|
-
};
|
|
92
|
-
await (useStore ? store.update(opts.taskId, () => nextTask) : backend.writeTask(nextTask));
|
|
93
210
|
process.stdout.write(`${readmePath}\n`);
|
|
94
211
|
return 0;
|
|
95
212
|
}
|
|
@@ -121,60 +238,32 @@ export async function cmdTaskPlanApprove(opts) {
|
|
|
121
238
|
? String(task.doc ?? "")
|
|
122
239
|
: (typeof task.doc === "string" ? task.doc : "") || (await backend.getTaskDoc(task.id));
|
|
123
240
|
const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
message: `${task.id}: cannot approve plan: ## Verify Steps section is missing/empty/unfilled ` +
|
|
151
|
-
"(fill it before approving plan)",
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (isSpike) {
|
|
156
|
-
const observationSection = taskObservationSectionName(normalizeTaskDocVersion(task.doc_version));
|
|
157
|
-
const observation = extractTaskObservationSection(baseDoc, normalizeTaskDocVersion(task.doc_version));
|
|
158
|
-
if (!observation || observation.trim().length === 0) {
|
|
159
|
-
throw new CliError({
|
|
160
|
-
exitCode: 3,
|
|
161
|
-
code: "E_VALIDATION",
|
|
162
|
-
message: `${task.id}: cannot approve plan for spike: ## ${observationSection} section is missing or empty ` +
|
|
163
|
-
"(include Findings/Decision/Next Steps)",
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
const nextTask = {
|
|
169
|
-
...task,
|
|
170
|
-
plan_approval: {
|
|
171
|
-
state: "approved",
|
|
172
|
-
updated_at: nowIso(),
|
|
173
|
-
updated_by: by,
|
|
174
|
-
note: note || null,
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
await (useStore ? store.update(opts.taskId, () => nextTask) : backend.writeTask(nextTask));
|
|
241
|
+
assertPlanCanBeApproved({ task, config, doc: baseDoc });
|
|
242
|
+
const approvedAt = nowIso();
|
|
243
|
+
await (useStore
|
|
244
|
+
? store.patch(opts.taskId, (current) => {
|
|
245
|
+
const currentDoc = ensureDocSections(String(current.doc ?? ""), config.tasks.doc.required_sections);
|
|
246
|
+
assertPlanCanBeApproved({ task: current, config, doc: currentDoc });
|
|
247
|
+
return {
|
|
248
|
+
task: {
|
|
249
|
+
plan_approval: {
|
|
250
|
+
state: "approved",
|
|
251
|
+
updated_at: approvedAt,
|
|
252
|
+
updated_by: by,
|
|
253
|
+
note: note || null,
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
})
|
|
258
|
+
: backend.writeTask({
|
|
259
|
+
...task,
|
|
260
|
+
plan_approval: {
|
|
261
|
+
state: "approved",
|
|
262
|
+
updated_at: approvedAt,
|
|
263
|
+
updated_by: by,
|
|
264
|
+
note: note || null,
|
|
265
|
+
},
|
|
266
|
+
}));
|
|
178
267
|
return 0;
|
|
179
268
|
}
|
|
180
269
|
catch (err) {
|
|
@@ -212,24 +301,32 @@ export async function cmdTaskPlanReject(opts) {
|
|
|
212
301
|
? String(task.doc ?? "")
|
|
213
302
|
: (typeof task.doc === "string" ? task.doc : "") || (await backend.getTaskDoc(task.id));
|
|
214
303
|
const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
304
|
+
assertPlanSectionPresent(task.id, baseDoc, "reject");
|
|
305
|
+
const rejectedAt = nowIso();
|
|
306
|
+
await (useStore
|
|
307
|
+
? store.patch(opts.taskId, (current) => {
|
|
308
|
+
const currentDoc = ensureDocSections(String(current.doc ?? ""), config.tasks.doc.required_sections);
|
|
309
|
+
assertPlanSectionPresent(current.id, currentDoc, "reject");
|
|
310
|
+
return {
|
|
311
|
+
task: {
|
|
312
|
+
plan_approval: {
|
|
313
|
+
state: "rejected",
|
|
314
|
+
updated_at: rejectedAt,
|
|
315
|
+
updated_by: by,
|
|
316
|
+
note: note || null,
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
})
|
|
321
|
+
: backend.writeTask({
|
|
322
|
+
...task,
|
|
323
|
+
plan_approval: {
|
|
324
|
+
state: "rejected",
|
|
325
|
+
updated_at: rejectedAt,
|
|
326
|
+
updated_by: by,
|
|
327
|
+
note: note || null,
|
|
328
|
+
},
|
|
329
|
+
}));
|
|
233
330
|
return 0;
|
|
234
331
|
}
|
|
235
332
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-status.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/set-status.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAOtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"set-status.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/set-status.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAOtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CA0K9D,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC5E,KAAK,UAAU,EAAE,GAAG,mBAAmB,KAAG,OAAO,CAAC,MAAM,CAAC,CAsBxE"}
|
|
@@ -71,7 +71,7 @@ export const taskSetStatusSpec = {
|
|
|
71
71
|
kind: "boolean",
|
|
72
72
|
name: "commit-allow-tasks",
|
|
73
73
|
default: true,
|
|
74
|
-
description: "Allow
|
|
74
|
+
description: "Allow the tasks export snapshot plus artifacts under the active task subtree when commit-from-comment is used.",
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
kind: "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-status.d.ts","sourceRoot":"","sources":["../../../src/commands/task/set-status.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,2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AC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6LlB"}
|
|
@@ -87,6 +87,10 @@ export async function cmdTaskSetStatus(opts) {
|
|
|
87
87
|
}
|
|
88
88
|
const at = nowIso();
|
|
89
89
|
const eventAuthor = resolveDocUpdatedBy(task, opts.author);
|
|
90
|
+
const commitInfo = opts.commit ? await readCommitInfo(resolved.gitRoot, opts.commit) : null;
|
|
91
|
+
const nextCommit = opts.commit
|
|
92
|
+
? { hash: commitInfo.hash, message: commitInfo.message }
|
|
93
|
+
: undefined;
|
|
90
94
|
const next = {
|
|
91
95
|
...task,
|
|
92
96
|
status: nextStatus,
|
|
@@ -104,10 +108,43 @@ export async function cmdTaskSetStatus(opts) {
|
|
|
104
108
|
doc_updated_by: eventAuthor,
|
|
105
109
|
};
|
|
106
110
|
if (opts.commit) {
|
|
107
|
-
|
|
108
|
-
next.commit = { hash: commitInfo.hash, message: commitInfo.message };
|
|
111
|
+
next.commit = nextCommit;
|
|
109
112
|
}
|
|
110
|
-
await (useStore
|
|
113
|
+
await (useStore
|
|
114
|
+
? store.patch(opts.taskId, (current) => {
|
|
115
|
+
const currentStatus = String(current.status || "TODO").toUpperCase();
|
|
116
|
+
ensureStatusTransitionAllowed({
|
|
117
|
+
currentStatus,
|
|
118
|
+
nextStatus,
|
|
119
|
+
force: opts.force,
|
|
120
|
+
});
|
|
121
|
+
const currentEventAuthor = resolveDocUpdatedBy(current, opts.author);
|
|
122
|
+
return {
|
|
123
|
+
task: {
|
|
124
|
+
status: nextStatus,
|
|
125
|
+
...(nextCommit ? { commit: nextCommit } : {}),
|
|
126
|
+
},
|
|
127
|
+
...(commentBody
|
|
128
|
+
? { appendComments: [{ author: opts.author, body: commentBody }] }
|
|
129
|
+
: {}),
|
|
130
|
+
appendEvents: [
|
|
131
|
+
{
|
|
132
|
+
type: "status",
|
|
133
|
+
at,
|
|
134
|
+
author: currentEventAuthor,
|
|
135
|
+
from: currentStatus,
|
|
136
|
+
to: nextStatus,
|
|
137
|
+
note: commentBody,
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
docMeta: {
|
|
141
|
+
touch: true,
|
|
142
|
+
updatedBy: currentEventAuthor,
|
|
143
|
+
version: normalizeTaskDocVersion(current.doc_version),
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
})
|
|
147
|
+
: ctx.taskBackend.writeTask(next));
|
|
111
148
|
// tasks.json is export-only; generated via `agentplane task export`.
|
|
112
149
|
if (opts.commitFromComment) {
|
|
113
150
|
if (!opts.body) {
|
|
@@ -5,6 +5,7 @@ export declare const VERIFY_STEPS_PLACEHOLDER = "<!-- TODO: REPLACE WITH TASK-SP
|
|
|
5
5
|
export declare const VERIFICATION_RESULTS_BEGIN = "<!-- BEGIN VERIFICATION RESULTS -->";
|
|
6
6
|
export declare const VERIFICATION_RESULTS_END = "<!-- END VERIFICATION RESULTS -->";
|
|
7
7
|
export type TaskDocVersion = 2 | 3;
|
|
8
|
+
export declare function decodeEscapedTaskTextNewlines(text: string): string;
|
|
8
9
|
export declare function extractDocSection(doc: string, sectionName: string): string | null;
|
|
9
10
|
export declare function isVerifyStepsFilled(sectionText: string | null): boolean;
|
|
10
11
|
export declare function normalizeTaskDocVersion(value: unknown, fallback?: TaskDocVersion): TaskDocVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAA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|
|
6
6
|
export const VERIFY_STEPS_PLACEHOLDER = "<!-- TODO: REPLACE WITH TASK-SPECIFIC ACCEPTANCE STEPS -->";
|
|
7
7
|
export const VERIFICATION_RESULTS_BEGIN = "<!-- BEGIN VERIFICATION RESULTS -->";
|
|
8
8
|
export const VERIFICATION_RESULTS_END = "<!-- END VERIFICATION RESULTS -->";
|
|
9
|
+
export function decodeEscapedTaskTextNewlines(text) {
|
|
10
|
+
const normalized = text.replaceAll("\r\n", "\n");
|
|
11
|
+
if (!normalized.includes(String.raw `\n`) && !normalized.includes(String.raw `\r\n`)) {
|
|
12
|
+
return normalized;
|
|
13
|
+
}
|
|
14
|
+
return normalized.replaceAll(String.raw `\r\n`, "\n").replaceAll(String.raw `\n`, "\n");
|
|
15
|
+
}
|
|
9
16
|
export function extractDocSection(doc, sectionName) {
|
|
10
17
|
const lines = doc.replaceAll("\r\n", "\n").split("\n");
|
|
11
18
|
let capturing = false;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AgentplaneConfig } from "@agentplaneorg/core";
|
|
2
2
|
import type { TaskData, TaskEvent } from "../../../backends/task-backend.js";
|
|
3
|
-
import type { CommandContext } from "../../shared/task-backend.js";
|
|
4
3
|
export declare function appendTaskEvent(task: TaskData, event: TaskEvent): TaskEvent[];
|
|
5
4
|
export declare function ensurePlanApprovedIfRequired(task: TaskData, config: AgentplaneConfig): void;
|
|
6
5
|
export declare function ensureVerificationSatisfiedIfRequired(task: TaskData, config: AgentplaneConfig): void;
|
|
@@ -38,5 +37,4 @@ export declare function readCommitInfo(cwd: string, rev: string): Promise<{
|
|
|
38
37
|
message: string;
|
|
39
38
|
}>;
|
|
40
39
|
export declare function defaultCommitEmojiForStatus(status: string): string;
|
|
41
|
-
export declare function defaultCommitEmojiForAgentId(ctx: CommandContext, agentId: string): Promise<string>;
|
|
42
40
|
//# sourceMappingURL=transitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAK5D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAK7E,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,CAW7E;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAc3F;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,gBAAgB,GACvB,IAAI,CAkBN;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAO1E;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,IAAI,CAUP;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAmBP;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAgB7F;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAI5F;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,MAAM,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CA8BP;AAUD,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK3F;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAI5C;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMlE"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
|
-
import path from "node:path";
|
|
3
2
|
import { promisify } from "node:util";
|
|
4
3
|
import { warnMessage } from "../../../cli/output.js";
|
|
5
|
-
import { resolveCommitEmojiForAgent } from "../../../shared/agent-emoji.js";
|
|
6
4
|
import { CliError } from "../../../shared/errors.js";
|
|
7
5
|
import { parseGitLogHashSubject } from "../../../shared/git-log.js";
|
|
8
6
|
import { requiresVerificationByPrimary, toStringArray } from "./tags.js";
|
|
@@ -169,7 +167,3 @@ export function defaultCommitEmojiForStatus(status) {
|
|
|
169
167
|
return "⛔";
|
|
170
168
|
return "🧩";
|
|
171
169
|
}
|
|
172
|
-
export async function defaultCommitEmojiForAgentId(ctx, agentId) {
|
|
173
|
-
const agentsDir = path.join(ctx.resolvedProject.gitRoot, ctx.config.paths.agents_dir);
|
|
174
|
-
return await resolveCommitEmojiForAgent({ agentsDirAbs: agentsDir, agentId });
|
|
175
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { dedupeStrings } from "../../shared/strings.js";
|
|
2
|
-
export { nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
|
|
2
|
+
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
|
|
3
3
|
export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, type PrimaryTagResolution, type TaskTagPolicy, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
|
|
4
4
|
export { type DependencyState, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
|
|
5
|
-
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, requireStructuredComment, enforceStatusCommitPolicy, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus,
|
|
5
|
+
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, requireStructuredComment, enforceStatusCommitPolicy, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
|
|
6
6
|
export { type TaskListFilters, parseTaskListFilters, handleTaskListWarnings, taskTextBlob, } from "./shared/listing.js";
|
|
7
7
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { dedupeStrings } from "../../shared/strings.js";
|
|
2
|
-
export { nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
|
|
2
|
+
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, } from "./shared/docs.js";
|
|
3
3
|
export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
|
|
4
4
|
export { ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
|
|
5
|
-
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, requireStructuredComment, enforceStatusCommitPolicy, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus,
|
|
5
|
+
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, requireStructuredComment, enforceStatusCommitPolicy, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
|
|
6
6
|
export { parseTaskListFilters, handleTaskListWarnings, taskTextBlob, } from "./shared/listing.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAiEnC,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6KlB"}
|