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 +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,IAA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M,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5C,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,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AAkB;IAI1B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,gBAAgB;YAIV,WAAW;CAgB1B"}
|
|
@@ -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,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E,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),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const AGENT_BOOTSTRAP_DOC_PATH = "docs/user/agent-bootstrap.generated.mdx";
|
|
2
|
+
export declare const AGENT_BOOTSTRAP_RUNTIME_SURFACE = "agentplane quickstart";
|
|
2
3
|
export type BootstrapSection = {
|
|
3
4
|
heading: string;
|
|
4
5
|
summary: string;
|
|
@@ -7,9 +8,7 @@ export type BootstrapSection = {
|
|
|
7
8
|
};
|
|
8
9
|
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
10
|
export declare const BOOTSTRAP_TASK_PREP_COMMANDS: string[];
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const BOOTSTRAP_VERIFY_AND_FINISH_COMMANDS: readonly ["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>"];
|
|
12
|
-
export declare const BOOTSTRAP_VERIFICATION_COMMANDS: readonly ["agentplane task verify-show <task-id>", "agentplane verify <task-id> --ok|--rework --by <ROLE> --note \"...\"", "agentplane doctor", "node .agentplane/policy/check-routing.mjs"];
|
|
11
|
+
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>"];
|
|
13
12
|
export declare const BOOTSTRAP_RECOVERY_COMMANDS: readonly ["agentplane doctor", "agentplane upgrade --dry-run", "agentplane upgrade"];
|
|
14
13
|
export declare const BOOTSTRAP_SECTIONS: readonly BootstrapSection[];
|
|
15
14
|
export declare function renderBootstrapReferenceLine(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-guide.d.ts","sourceRoot":"","sources":["../../src/cli/bootstrap-guide.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap-guide.d.ts","sourceRoot":"","sources":["../../src/cli/bootstrap-guide.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,4CAA4C,CAAC;AAClF,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AAEvE,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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { COMMAND_SNIPPETS } from "./command-snippets.js";
|
|
2
2
|
export const AGENT_BOOTSTRAP_DOC_PATH = "docs/user/agent-bootstrap.generated.mdx";
|
|
3
|
+
export const AGENT_BOOTSTRAP_RUNTIME_SURFACE = "agentplane quickstart";
|
|
3
4
|
export const BOOTSTRAP_PREFLIGHT_COMMANDS = [
|
|
4
5
|
"agentplane config show",
|
|
5
6
|
"agentplane quickstart",
|
|
@@ -12,23 +13,13 @@ export const BOOTSTRAP_TASK_PREP_COMMANDS = [
|
|
|
12
13
|
'agentplane task plan set <task-id> --text "..." --updated-by <ROLE>',
|
|
13
14
|
"agentplane task plan approve <task-id> --by ORCHESTRATOR",
|
|
14
15
|
];
|
|
15
|
-
export const
|
|
16
|
+
export const BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS = [
|
|
16
17
|
...BOOTSTRAP_TASK_PREP_COMMANDS,
|
|
17
18
|
COMMAND_SNIPPETS.core.startTask,
|
|
18
|
-
COMMAND_SNIPPETS.core.verifyTask,
|
|
19
|
-
'agentplane finish <task-id> --author <ROLE> --body "Verified: ..." --result "..." --commit <git-rev>',
|
|
20
|
-
];
|
|
21
|
-
export const BOOTSTRAP_VERIFY_AND_FINISH_COMMANDS = [
|
|
22
19
|
"agentplane task verify-show <task-id>",
|
|
23
20
|
COMMAND_SNIPPETS.core.verifyTask,
|
|
24
21
|
'agentplane finish <task-id> --author <ROLE> --body "Verified: ..." --result "..." --commit <git-rev>',
|
|
25
22
|
];
|
|
26
|
-
export const BOOTSTRAP_VERIFICATION_COMMANDS = [
|
|
27
|
-
"agentplane task verify-show <task-id>",
|
|
28
|
-
COMMAND_SNIPPETS.core.verifyTask,
|
|
29
|
-
"agentplane doctor",
|
|
30
|
-
"node .agentplane/policy/check-routing.mjs",
|
|
31
|
-
];
|
|
32
23
|
export const BOOTSTRAP_RECOVERY_COMMANDS = [
|
|
33
24
|
"agentplane doctor",
|
|
34
25
|
"agentplane upgrade --dry-run",
|
|
@@ -45,41 +36,30 @@ export const BOOTSTRAP_SECTIONS = [
|
|
|
45
36
|
],
|
|
46
37
|
},
|
|
47
38
|
{
|
|
48
|
-
heading: "2.
|
|
49
|
-
summary: "
|
|
50
|
-
commands:
|
|
39
|
+
heading: "2. Direct happy path",
|
|
40
|
+
summary: "Use one short direct-mode route: create the task, approve it, start it, verify it, and finish it.",
|
|
41
|
+
commands: BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS,
|
|
51
42
|
notes: [
|
|
52
43
|
"Use `task doc set` to fill required README sections before approval.",
|
|
53
44
|
"For dependent tasks, wait until upstream tasks are DONE before `task start-ready`.",
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
heading: "3. Start work deterministically",
|
|
58
|
-
summary: "Move the task to DOING only after plan approval succeeds.",
|
|
59
|
-
commands: [COMMAND_SNIPPETS.core.startTask],
|
|
60
|
-
notes: ["`task plan approve` and `task start-ready` must run sequentially, never in parallel."],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
heading: "4. Verify and finish",
|
|
64
|
-
summary: "Treat Verify Steps as the contract, then record verification and close with traceable metadata.",
|
|
65
|
-
commands: BOOTSTRAP_VERIFY_AND_FINISH_COMMANDS,
|
|
66
|
-
notes: [
|
|
45
|
+
"`task plan approve` and `task start-ready` must run sequentially, never in parallel.",
|
|
67
46
|
"In `direct`, `finish` creates the deterministic close commit by default.",
|
|
68
|
-
"
|
|
47
|
+
"Treat `task verify-show` as the verification contract right before `verify` and `finish`.",
|
|
69
48
|
],
|
|
70
49
|
},
|
|
71
50
|
{
|
|
72
|
-
heading: "
|
|
73
|
-
summary: "
|
|
51
|
+
heading: "3. Fallbacks and recovery",
|
|
52
|
+
summary: "Keep exceptional paths out of the normal route: use these only for recovery, framework upgrades, or branch_pr work.",
|
|
74
53
|
commands: BOOTSTRAP_RECOVERY_COMMANDS,
|
|
75
54
|
notes: [
|
|
76
55
|
"Run `doctor` before touching managed policy files by hand.",
|
|
77
56
|
"`upgrade` applies the managed framework files from the installed CLI bundle.",
|
|
57
|
+
"Manual close handling (`--no-close-commit`, `--close-unstage-others`) belongs here, not in the default direct path.",
|
|
78
58
|
],
|
|
79
59
|
},
|
|
80
60
|
];
|
|
81
61
|
export function renderBootstrapReferenceLine() {
|
|
82
|
-
return `Canonical
|
|
62
|
+
return `Canonical installed startup surface: \`${AGENT_BOOTSTRAP_RUNTIME_SURFACE}\`.`;
|
|
83
63
|
}
|
|
84
64
|
export function renderBootstrapSectionLines(sections) {
|
|
85
65
|
const lines = [];
|
|
@@ -112,20 +92,21 @@ export function renderBootstrapDoc() {
|
|
|
112
92
|
"",
|
|
113
93
|
"This page is generated from `packages/agentplane/src/cli/bootstrap-guide.ts`.",
|
|
114
94
|
"",
|
|
115
|
-
"
|
|
95
|
+
"This is the docs-site rendering of the CLI bootstrap model. Installed repositories should rely on `agentplane quickstart` and `agentplane role <ROLE>` instead of requiring this file to exist locally.",
|
|
116
96
|
"",
|
|
117
97
|
"## Copy-paste start block",
|
|
118
98
|
"",
|
|
119
99
|
...renderCommandBlock(BOOTSTRAP_PREFLIGHT_COMMANDS),
|
|
120
100
|
"",
|
|
121
|
-
"After preflight,
|
|
101
|
+
"After preflight, stay on the direct happy path unless the repository state is broken or you are explicitly in `branch_pr`.",
|
|
122
102
|
"",
|
|
123
103
|
...renderBootstrapSectionLines(BOOTSTRAP_SECTIONS),
|
|
124
104
|
"",
|
|
125
|
-
"##
|
|
105
|
+
"## Non-default paths",
|
|
126
106
|
"",
|
|
127
|
-
"- `direct`:
|
|
107
|
+
"- `direct`: the default route is `task new/plan approve/start-ready -> task verify-show -> verify -> finish`.",
|
|
128
108
|
"- `branch_pr`: start a task branch/worktree, maintain PR artifacts, and let INTEGRATOR close on base.",
|
|
109
|
+
"- Use manual close flags only when a specific policy or recovery situation requires them.",
|
|
129
110
|
"",
|
|
130
111
|
];
|
|
131
112
|
return `${lines.join("\n")}\n`;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
export type RoleProfileGuide = {
|
|
2
|
+
filename?: string;
|
|
3
|
+
id?: string;
|
|
4
|
+
role?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
inputs?: readonly string[];
|
|
7
|
+
outputs?: readonly string[];
|
|
8
|
+
permissions?: readonly string[];
|
|
9
|
+
workflow?: readonly string[];
|
|
10
|
+
};
|
|
1
11
|
export declare function listRoles(): string[];
|
|
2
|
-
export declare function
|
|
12
|
+
export declare function getRoleSupplementLines(roleRaw: string): string[] | null;
|
|
13
|
+
export declare function renderRole(roleRaw: string, opts?: {
|
|
14
|
+
profile?: RoleProfileGuide | null;
|
|
15
|
+
}): string | null;
|
|
3
16
|
export declare function renderQuickstart(): string;
|
|
4
17
|
//# sourceMappingURL=command-guide.d.ts.map
|
|
@@ -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":"AAQA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAkGF,wBAAgB,SAAS,IAAI,MAAM,EAAE,CAEpC;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAMvE;AAMD,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAAO,GAC/C,MAAM,GAAG,IAAI,CA6Bf;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAoCzC"}
|