agentplane 0.3.1 → 0.3.3
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 +5 -4
- package/assets/agents/CODER.json +4 -3
- package/assets/agents/DOCS.json +1 -1
- package/assets/agents/INTEGRATOR.json +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +3 -1
- 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 +10 -5
- package/bin/agentplane.js +116 -18
- package/bin/dist-guard.js +78 -10
- package/bin/runtime-context.d.ts +23 -0
- package/bin/runtime-context.js +94 -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 +2480 -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 +16 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -0
- package/dist/cli/bootstrap-guide.js +112 -0
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +62 -203
- package/dist/cli/command-snippets.d.ts +2 -2
- package/dist/cli/command-snippets.js +2 -2
- 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.js +1 -1
- 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.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 -305
- 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/finish.run.d.ts.map +1 -1
- package/dist/commands/finish.run.js +1 -0
- package/dist/commands/finish.spec.d.ts +1 -0
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +23 -2
- 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 -7
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +159 -382
- 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 +1 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +26 -10
- 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.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +11 -7
- package/dist/commands/upgrade.d.ts +1 -35
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +54 -320
- 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/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-backend.d.ts","sourceRoot":"","sources":["../../../src/backends/task-backend/local-backend.ts"],"names":[],"mappings":"AAqBA,OAAO,EAiBL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AAErB,qBAAa,YAAa,YAAW,WAAW;IAC9C,EAAE,SAAW;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,gBAAgB,CAAgB;gBAE5B,QAAQ,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;IAKrD,cAAc,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB3E,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAwHtC,mBAAmB,IAAI,MAAM,EAAE;IAIzB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAoBjD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC;IAKzD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO3C,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAyExC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"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C,cAAc,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAuF/D,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzD"}
|
|
@@ -4,7 +4,7 @@ import { docChanged, parseTaskReadme, renderTaskReadme, taskReadmePath, } from "
|
|
|
4
4
|
import { isRecord } from "../../shared/guards.js";
|
|
5
5
|
import { writeTextIfChanged } from "../../shared/write-if-changed.js";
|
|
6
6
|
import { buildTaskIndexEntry, loadTaskIndex, resolveTaskIndexPath, saveTaskIndex, } from "../task-index.js";
|
|
7
|
-
import { DEFAULT_DOC_UPDATED_BY,
|
|
7
|
+
import { DEFAULT_DOC_UPDATED_BY, defaultPlanApproval, defaultVerificationResult, extractTaskDoc, generateTaskId, invalidLengthMessage, mapLimit, mergeTaskDoc, missingTaskIdMessage, normalizeDocVersion, nowIso, resolveDocUpdatedByFromFrontmatter, resolveDocUpdatedByFromTask, taskRecordToData, validateTaskId, writeTasksExportFromTasks, } from "./shared.js";
|
|
8
8
|
export class LocalBackend {
|
|
9
9
|
id = "local";
|
|
10
10
|
root;
|
|
@@ -229,18 +229,17 @@ export class LocalBackend {
|
|
|
229
229
|
if (payload.verification === undefined) {
|
|
230
230
|
payload.verification = defaultVerificationResult();
|
|
231
231
|
}
|
|
232
|
+
const existingDocVersion = normalizeDocVersion(existingFrontmatter.doc_version);
|
|
232
233
|
if (task.doc !== undefined) {
|
|
233
234
|
const docText = String(task.doc ?? "");
|
|
234
235
|
body = mergeTaskDoc(body, docText);
|
|
235
236
|
if (docChanged(existingDoc, docText)) {
|
|
236
|
-
payload.doc_version =
|
|
237
|
+
payload.doc_version = normalizeDocVersion(task.doc_version, existingDocVersion);
|
|
237
238
|
payload.doc_updated_at = nowIso();
|
|
238
239
|
payload.doc_updated_by = resolveDocUpdatedByFromTask(task, this.updatedBy);
|
|
239
240
|
}
|
|
240
241
|
}
|
|
241
|
-
|
|
242
|
-
payload.doc_version = DOC_VERSION;
|
|
243
|
-
}
|
|
242
|
+
payload.doc_version = normalizeDocVersion(payload.doc_version, existingDocVersion);
|
|
244
243
|
if (payload.doc_updated_at === undefined || payload.doc_updated_at === "") {
|
|
245
244
|
payload.doc_updated_at = nowIso();
|
|
246
245
|
}
|
|
@@ -258,14 +257,13 @@ export class LocalBackend {
|
|
|
258
257
|
const docText = String(doc ?? "");
|
|
259
258
|
const body = mergeTaskDoc(parsed.body, docText);
|
|
260
259
|
const frontmatter = { ...parsed.frontmatter };
|
|
260
|
+
const currentDocVersion = normalizeDocVersion(frontmatter.doc_version);
|
|
261
261
|
if (docChanged(extractTaskDoc(parsed.body), docText) || !frontmatter.doc_updated_at) {
|
|
262
|
-
frontmatter.doc_version =
|
|
262
|
+
frontmatter.doc_version = currentDocVersion;
|
|
263
263
|
frontmatter.doc_updated_at = nowIso();
|
|
264
264
|
frontmatter.doc_updated_by = resolveDocUpdatedByFromFrontmatter(frontmatter, updatedBy, this.updatedBy);
|
|
265
265
|
}
|
|
266
|
-
|
|
267
|
-
frontmatter.doc_version = DOC_VERSION;
|
|
268
|
-
}
|
|
266
|
+
frontmatter.doc_version = normalizeDocVersion(frontmatter.doc_version, currentDocVersion);
|
|
269
267
|
const next = renderTaskReadme(frontmatter, body);
|
|
270
268
|
await writeTextIfChanged(readme, next.endsWith("\n") ? next : `${next}\n`);
|
|
271
269
|
}
|
|
@@ -274,7 +272,7 @@ export class LocalBackend {
|
|
|
274
272
|
const text = await readFile(readme, "utf8");
|
|
275
273
|
const parsed = parseTaskReadme(text);
|
|
276
274
|
const frontmatter = { ...parsed.frontmatter };
|
|
277
|
-
frontmatter.doc_version =
|
|
275
|
+
frontmatter.doc_version = normalizeDocVersion(frontmatter.doc_version);
|
|
278
276
|
frontmatter.doc_updated_at = nowIso();
|
|
279
277
|
frontmatter.doc_updated_by = resolveDocUpdatedByFromFrontmatter(frontmatter, updatedBy, this.updatedBy);
|
|
280
278
|
const next = renderTaskReadme(frontmatter, parsed.body || "");
|
|
@@ -340,8 +338,7 @@ export class LocalBackend {
|
|
|
340
338
|
}
|
|
341
339
|
if (payload.verification === undefined)
|
|
342
340
|
payload.verification = defaultVerificationResult();
|
|
343
|
-
|
|
344
|
-
payload.doc_version = DOC_VERSION;
|
|
341
|
+
payload.doc_version = normalizeDocVersion(payload.doc_version, normalizeDocVersion(fm.doc_version));
|
|
345
342
|
if (payload.doc_updated_at === undefined || payload.doc_updated_at === "") {
|
|
346
343
|
payload.doc_updated_at = nowIso();
|
|
347
344
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redmine-backend.d.ts","sourceRoot":"","sources":["../../../src/backends/task-backend/redmine-backend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA2BvD,OAAO,
|
|
1
|
+
{"version":3,"file":"redmine-backend.d.ts","sourceRoot":"","sources":["../../../src/backends/task-backend/redmine-backend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA2BvD,OAAO,EAmBL,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,cAAe,YAA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1B"}
|
|
@@ -7,7 +7,7 @@ import { doneRatioForStatus, issueToTask as issueToTaskImpl, startDateFromTaskId
|
|
|
7
7
|
import { coerceDocVersion as coerceRedmineDocVersion, maybeParseJson as maybeParseRedmineJson, } from "./redmine/parse.js";
|
|
8
8
|
import { findIssueByTaskId as findIssueByTaskIdImpl, listTasksRemote as listTasksRemoteImpl, } from "./redmine/remote.js";
|
|
9
9
|
import { readRedmineEnv } from "./redmine/env.js";
|
|
10
|
-
import { BackendError, DEFAULT_DOC_UPDATED_BY, DOC_VERSION, RedmineUnavailable, ensureDocMetadata, firstNonEmptyString, generateTaskId, mapLimit, missingTaskIdMessage, nowIso, redmineConfigMissingEnvMessage, redmineIssueIdMissingMessage, sleep, toStringSafe, unknownTaskIdMessage, validateTaskId, writeTasksExportFromTasks, } from "./shared.js";
|
|
10
|
+
import { BackendError, DEFAULT_DOC_UPDATED_BY, DOC_VERSION, RedmineUnavailable, ensureDocMetadata, firstNonEmptyString, generateTaskId, mapLimit, missingTaskIdMessage, normalizeDocVersion, nowIso, redmineConfigMissingEnvMessage, redmineIssueIdMissingMessage, sleep, toStringSafe, unknownTaskIdMessage, validateTaskId, writeTasksExportFromTasks, } from "./shared.js";
|
|
11
11
|
export class RedmineBackend {
|
|
12
12
|
id = "redmine";
|
|
13
13
|
baseUrl;
|
|
@@ -151,7 +151,11 @@ export class RedmineBackend {
|
|
|
151
151
|
const issueIdText = toStringSafe(issue.id);
|
|
152
152
|
if (!issueIdText)
|
|
153
153
|
throw new Error(redmineIssueIdMissingMessage());
|
|
154
|
-
const
|
|
154
|
+
const cachedTask = this.issueToTask(issue, taskId);
|
|
155
|
+
const taskDoc = {
|
|
156
|
+
doc: String(doc ?? ""),
|
|
157
|
+
doc_version: cachedTask?.doc_version,
|
|
158
|
+
};
|
|
155
159
|
ensureDocMetadata(taskDoc, updatedBy);
|
|
156
160
|
const customFields = [];
|
|
157
161
|
this.appendCustomField(customFields, "doc", taskDoc.doc);
|
|
@@ -161,13 +165,12 @@ export class RedmineBackend {
|
|
|
161
165
|
await this.requestJson("PUT", `issues/${issueIdText}.json`, {
|
|
162
166
|
issue: { custom_fields: customFields },
|
|
163
167
|
});
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
await this.cacheTask(task, false);
|
|
168
|
+
if (cachedTask) {
|
|
169
|
+
cachedTask.doc = taskDoc.doc;
|
|
170
|
+
cachedTask.doc_version = taskDoc.doc_version;
|
|
171
|
+
cachedTask.doc_updated_at = taskDoc.doc_updated_at;
|
|
172
|
+
cachedTask.doc_updated_by = taskDoc.doc_updated_by;
|
|
173
|
+
await this.cacheTask(cachedTask, false);
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
catch (err) {
|
|
@@ -195,7 +198,11 @@ export class RedmineBackend {
|
|
|
195
198
|
if (!issueIdText)
|
|
196
199
|
throw new Error(redmineIssueIdMissingMessage());
|
|
197
200
|
const docValue = this.customFieldValue(issue, this.customFields.doc);
|
|
198
|
-
const
|
|
201
|
+
const cachedTask = this.issueToTask(issue, taskId);
|
|
202
|
+
const taskDoc = {
|
|
203
|
+
doc: docValue ?? "",
|
|
204
|
+
doc_version: cachedTask?.doc_version,
|
|
205
|
+
};
|
|
199
206
|
ensureDocMetadata(taskDoc, updatedBy);
|
|
200
207
|
const customFields = [];
|
|
201
208
|
this.appendCustomField(customFields, "doc_version", taskDoc.doc_version);
|
|
@@ -205,12 +212,11 @@ export class RedmineBackend {
|
|
|
205
212
|
await this.requestJson("PUT", `issues/${issueIdText}.json`, {
|
|
206
213
|
issue: { custom_fields: customFields },
|
|
207
214
|
});
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
await this.cacheTask(task, false);
|
|
215
|
+
if (cachedTask) {
|
|
216
|
+
cachedTask.doc_version = taskDoc.doc_version;
|
|
217
|
+
cachedTask.doc_updated_at = taskDoc.doc_updated_at;
|
|
218
|
+
cachedTask.doc_updated_by = taskDoc.doc_updated_by;
|
|
219
|
+
await this.cacheTask(cachedTask, false);
|
|
214
220
|
}
|
|
215
221
|
}
|
|
216
222
|
}
|
|
@@ -311,8 +317,7 @@ export class RedmineBackend {
|
|
|
311
317
|
ensureDocMetadata(task) {
|
|
312
318
|
if (task.doc === undefined)
|
|
313
319
|
return;
|
|
314
|
-
|
|
315
|
-
task.doc_version = DOC_VERSION;
|
|
320
|
+
task.doc_version = normalizeDocVersion(task.doc_version);
|
|
316
321
|
task.doc_updated_at ??= nowIso();
|
|
317
322
|
task.doc_updated_by ??= DEFAULT_DOC_UPDATED_BY;
|
|
318
323
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAA6D,CAAC;AACrF,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,WAAW,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAA6D,CAAC;AACrF,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,sBAAsB,iBAAkB,CAAC"}
|
|
@@ -2,3 +2,4 @@ import { TASK_ID_ALPHABET } from "@agentplaneorg/core";
|
|
|
2
2
|
export const TASK_ID_RE = new RegExp(String.raw `^\d{12}-[${TASK_ID_ALPHABET}]{4,}$`);
|
|
3
3
|
export const DEFAULT_DOC_UPDATED_BY = "agentplane";
|
|
4
4
|
export const DOC_VERSION = 2;
|
|
5
|
+
export const SUPPORTED_DOC_VERSIONS = [2, 3];
|
|
@@ -6,6 +6,7 @@ declare const mergeTaskDoc: MergeTaskDoc;
|
|
|
6
6
|
export declare function nowIso(): string;
|
|
7
7
|
export declare function resolveDocUpdatedByFromFrontmatter(frontmatter: Record<string, unknown>, updatedBy: string | undefined, fallback: string): string;
|
|
8
8
|
export declare function resolveDocUpdatedByFromTask(task: TaskData, fallback: string): string;
|
|
9
|
+
export declare function normalizeDocVersion(value: unknown, fallback?: 2 | 3): 2 | 3;
|
|
9
10
|
export declare function ensureDocMetadata(task: TaskDocMeta & Partial<Pick<TaskData, "comments" | "owner">>, updatedBy?: string): void;
|
|
10
11
|
export { extractTaskDoc, mergeTaskDoc };
|
|
11
12
|
//# sourceMappingURL=doc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/doc.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAC/C,KAAK,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAE1D,QAAA,MAAM,cAAc,EAAE,cAAmC,CAAC;AAC1D,QAAA,MAAM,YAAY,EAAE,YAA+B,CAAC;AAEpD,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAyBD,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GACf,MAAM,CAaR;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASpF;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,EACjE,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAUN;AAED,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/doc.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAC/C,KAAK,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAE1D,QAAA,MAAM,cAAc,EAAE,cAAmC,CAAC;AAC1D,QAAA,MAAM,YAAY,EAAE,YAA+B,CAAC;AAEpD,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAyBD,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GACf,MAAM,CAaR;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASpF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,CAAC,GAAG,CAAe,GAAG,CAAC,GAAG,CAAC,CAExF;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,EACjE,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAUN;AAED,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -64,8 +64,11 @@ export function resolveDocUpdatedByFromTask(task, fallback) {
|
|
|
64
64
|
const fallbackValue = normalizeUpdatedBy(fallback);
|
|
65
65
|
return fallbackValue || fallback;
|
|
66
66
|
}
|
|
67
|
+
export function normalizeDocVersion(value, fallback = DOC_VERSION) {
|
|
68
|
+
return value === 3 ? 3 : value === 2 ? 2 : fallback;
|
|
69
|
+
}
|
|
67
70
|
export function ensureDocMetadata(task, updatedBy) {
|
|
68
|
-
task.doc_version =
|
|
71
|
+
task.doc_version = normalizeDocVersion(task.doc_version);
|
|
69
72
|
task.doc_updated_at = nowIso();
|
|
70
73
|
const explicit = normalizeUpdatedBy(updatedBy);
|
|
71
74
|
if (updatedBy !== undefined) {
|
|
@@ -3,8 +3,8 @@ import { mkdir } from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { canonicalizeJson } from "@agentplaneorg/core";
|
|
5
5
|
import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
|
|
6
|
-
import { DEFAULT_DOC_UPDATED_BY
|
|
7
|
-
import { resolveDocUpdatedByFromTask } from "./doc.js";
|
|
6
|
+
import { DEFAULT_DOC_UPDATED_BY } from "./constants.js";
|
|
7
|
+
import { normalizeDocVersion, resolveDocUpdatedByFromTask } from "./doc.js";
|
|
8
8
|
import { toStringArray } from "./strings.js";
|
|
9
9
|
function taskDataToExport(task) {
|
|
10
10
|
const base = {
|
|
@@ -22,7 +22,7 @@ function taskDataToExport(task) {
|
|
|
22
22
|
comments: Array.isArray(task.comments)
|
|
23
23
|
? task.comments.filter((item) => !!item && typeof item.author === "string" && typeof item.body === "string")
|
|
24
24
|
: [],
|
|
25
|
-
doc_version: task.doc_version
|
|
25
|
+
doc_version: normalizeDocVersion(task.doc_version),
|
|
26
26
|
doc_updated_at: task.doc_updated_at ?? "",
|
|
27
27
|
doc_updated_by: resolveDocUpdatedByFromTask(task, DEFAULT_DOC_UPDATED_BY),
|
|
28
28
|
dirty: Boolean(task.dirty),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const AGENT_BOOTSTRAP_DOC_PATH = "docs/user/agent-bootstrap.generated.mdx";
|
|
2
|
+
export type BootstrapSection = {
|
|
3
|
+
heading: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
commands: readonly string[];
|
|
6
|
+
notes?: readonly string[];
|
|
7
|
+
};
|
|
8
|
+
export declare const BOOTSTRAP_PREFLIGHT_COMMANDS: readonly ["agentplane config show", "agentplane quickstart", "agentplane task list", "git status --short --untracked-files=no", "git rev-parse --abbrev-ref HEAD"];
|
|
9
|
+
export declare const BOOTSTRAP_TASK_PREP_COMMANDS: string[];
|
|
10
|
+
export declare const BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS: readonly [...string[], "agentplane task start-ready <task-id> --author <ROLE> --body \"Start: ...\"", "agentplane task verify-show <task-id>", "agentplane verify <task-id> --ok|--rework --by <ROLE> --note \"...\"", "agentplane finish <task-id> --author <ROLE> --body \"Verified: ...\" --result \"...\" --commit <git-rev>"];
|
|
11
|
+
export declare const BOOTSTRAP_RECOVERY_COMMANDS: readonly ["agentplane doctor", "agentplane upgrade --dry-run", "agentplane upgrade"];
|
|
12
|
+
export declare const BOOTSTRAP_SECTIONS: readonly BootstrapSection[];
|
|
13
|
+
export declare function renderBootstrapReferenceLine(): string;
|
|
14
|
+
export declare function renderBootstrapSectionLines(sections: readonly BootstrapSection[]): string[];
|
|
15
|
+
export declare function renderBootstrapDoc(): string;
|
|
16
|
+
//# sourceMappingURL=bootstrap-guide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-guide.d.ts","sourceRoot":"","sources":["../../src/cli/bootstrap-guide.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,4CAA4C,CAAC;AAElF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,4BAA4B,oKAM/B,CAAC;AAEX,eAAO,MAAM,4BAA4B,UAIxC,CAAC;AAEF,eAAO,MAAM,oCAAoC,oUAMvC,CAAC;AAEX,eAAO,MAAM,2BAA2B,sFAI9B,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAmChD,CAAC;AAEX,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAiB3F;AAMD,wBAAgB,kBAAkB,IAAI,MAAM,CA2B3C"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { COMMAND_SNIPPETS } from "./command-snippets.js";
|
|
2
|
+
export const AGENT_BOOTSTRAP_DOC_PATH = "docs/user/agent-bootstrap.generated.mdx";
|
|
3
|
+
export const BOOTSTRAP_PREFLIGHT_COMMANDS = [
|
|
4
|
+
"agentplane config show",
|
|
5
|
+
"agentplane quickstart",
|
|
6
|
+
"agentplane task list",
|
|
7
|
+
"git status --short --untracked-files=no",
|
|
8
|
+
"git rev-parse --abbrev-ref HEAD",
|
|
9
|
+
];
|
|
10
|
+
export const BOOTSTRAP_TASK_PREP_COMMANDS = [
|
|
11
|
+
COMMAND_SNIPPETS.core.taskNew,
|
|
12
|
+
'agentplane task plan set <task-id> --text "..." --updated-by <ROLE>',
|
|
13
|
+
"agentplane task plan approve <task-id> --by ORCHESTRATOR",
|
|
14
|
+
];
|
|
15
|
+
export const BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS = [
|
|
16
|
+
...BOOTSTRAP_TASK_PREP_COMMANDS,
|
|
17
|
+
COMMAND_SNIPPETS.core.startTask,
|
|
18
|
+
"agentplane task verify-show <task-id>",
|
|
19
|
+
COMMAND_SNIPPETS.core.verifyTask,
|
|
20
|
+
'agentplane finish <task-id> --author <ROLE> --body "Verified: ..." --result "..." --commit <git-rev>',
|
|
21
|
+
];
|
|
22
|
+
export const BOOTSTRAP_RECOVERY_COMMANDS = [
|
|
23
|
+
"agentplane doctor",
|
|
24
|
+
"agentplane upgrade --dry-run",
|
|
25
|
+
"agentplane upgrade",
|
|
26
|
+
];
|
|
27
|
+
export const BOOTSTRAP_SECTIONS = [
|
|
28
|
+
{
|
|
29
|
+
heading: "1. Preflight",
|
|
30
|
+
summary: "Establish workflow mode, current branch, current task state, and tracked working-tree state.",
|
|
31
|
+
commands: BOOTSTRAP_PREFLIGHT_COMMANDS,
|
|
32
|
+
notes: [
|
|
33
|
+
"Run this before any mutation.",
|
|
34
|
+
"If the project is not initialized, stop and use `agentplane init` first.",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
heading: "2. Direct happy path",
|
|
39
|
+
summary: "Use one short direct-mode route: create the task, approve it, start it, verify it, and finish it.",
|
|
40
|
+
commands: BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS,
|
|
41
|
+
notes: [
|
|
42
|
+
"Use `task doc set` to fill required README sections before approval.",
|
|
43
|
+
"For dependent tasks, wait until upstream tasks are DONE before `task start-ready`.",
|
|
44
|
+
"`task plan approve` and `task start-ready` must run sequentially, never in parallel.",
|
|
45
|
+
"In `direct`, `finish` creates the deterministic close commit by default.",
|
|
46
|
+
"Treat `task verify-show` as the verification contract right before `verify` and `finish`.",
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
heading: "3. Fallbacks and recovery",
|
|
51
|
+
summary: "Keep exceptional paths out of the normal route: use these only for recovery, framework upgrades, or branch_pr work.",
|
|
52
|
+
commands: BOOTSTRAP_RECOVERY_COMMANDS,
|
|
53
|
+
notes: [
|
|
54
|
+
"Run `doctor` before touching managed policy files by hand.",
|
|
55
|
+
"`upgrade` applies the managed framework files from the installed CLI bundle.",
|
|
56
|
+
"Manual close handling (`--no-close-commit`, `--close-unstage-others`) belongs here, not in the default direct path.",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
export function renderBootstrapReferenceLine() {
|
|
61
|
+
return `Canonical bootstrap doc: \`${AGENT_BOOTSTRAP_DOC_PATH}\`.`;
|
|
62
|
+
}
|
|
63
|
+
export function renderBootstrapSectionLines(sections) {
|
|
64
|
+
const lines = [];
|
|
65
|
+
for (const section of sections) {
|
|
66
|
+
lines.push(`## ${section.heading}`, "", section.summary, "");
|
|
67
|
+
for (const command of section.commands) {
|
|
68
|
+
lines.push(`- \`${command}\``);
|
|
69
|
+
}
|
|
70
|
+
if (section.notes && section.notes.length > 0) {
|
|
71
|
+
lines.push("");
|
|
72
|
+
for (const note of section.notes) {
|
|
73
|
+
lines.push(`- ${note}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
lines.push("");
|
|
77
|
+
}
|
|
78
|
+
if (lines.at(-1) === "")
|
|
79
|
+
lines.pop();
|
|
80
|
+
return lines;
|
|
81
|
+
}
|
|
82
|
+
function renderCommandBlock(commands) {
|
|
83
|
+
return ["```bash", ...commands, "```"];
|
|
84
|
+
}
|
|
85
|
+
export function renderBootstrapDoc() {
|
|
86
|
+
const lines = [
|
|
87
|
+
"---",
|
|
88
|
+
'title: "Agent bootstrap"',
|
|
89
|
+
'description: "The shortest canonical startup path for agent work in an Agent Plane repository."',
|
|
90
|
+
"---",
|
|
91
|
+
"",
|
|
92
|
+
"This page is generated from `packages/agentplane/src/cli/bootstrap-guide.ts`.",
|
|
93
|
+
"",
|
|
94
|
+
"Use it as the single startup path for agents. `AGENTS.md`, `agentplane quickstart`, and `agentplane role <ROLE>` should point here instead of restating lifecycle prose.",
|
|
95
|
+
"",
|
|
96
|
+
"## Copy-paste start block",
|
|
97
|
+
"",
|
|
98
|
+
...renderCommandBlock(BOOTSTRAP_PREFLIGHT_COMMANDS),
|
|
99
|
+
"",
|
|
100
|
+
"After preflight, stay on the direct happy path unless the repository state is broken or you are explicitly in `branch_pr`.",
|
|
101
|
+
"",
|
|
102
|
+
...renderBootstrapSectionLines(BOOTSTRAP_SECTIONS),
|
|
103
|
+
"",
|
|
104
|
+
"## Non-default paths",
|
|
105
|
+
"",
|
|
106
|
+
"- `direct`: the default route is `task new/plan approve/start-ready -> task verify-show -> verify -> finish`.",
|
|
107
|
+
"- `branch_pr`: start a task branch/worktree, maintain PR artifacts, and let INTEGRATOR close on base.",
|
|
108
|
+
"- Use manual close flags only when a specific policy or recovery situation requires them.",
|
|
109
|
+
"",
|
|
110
|
+
];
|
|
111
|
+
return `${lines.join("\n")}\n`;
|
|
112
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-guide.d.ts","sourceRoot":"","sources":["../../src/cli/command-guide.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-guide.d.ts","sourceRoot":"","sources":["../../src/cli/command-guide.ts"],"names":[],"mappings":"AA4GA,wBAAgB,SAAS,IAAI,MAAM,EAAE,CAEpC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOzD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAoCzC"}
|