agentplane 0.3.5 → 0.3.7
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 +251 -821
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +2 -2
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.js +2 -2
- package/dist/backends/task-backend/local-backend.d.ts +7 -5
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +79 -7
- package/dist/backends/task-backend/redmine/env.d.ts +1 -1
- package/dist/backends/task-backend/redmine/env.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/env.js +3 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts +11 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/inspect.js +75 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/mapping.js +21 -2
- package/dist/backends/task-backend/redmine/state.d.ts +17 -0
- package/dist/backends/task-backend/redmine/state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/state.js +95 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +10 -16
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +205 -15
- package/dist/backends/task-backend/shared/constants.d.ts +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/record.js +20 -1
- package/dist/backends/task-backend/shared/types.d.ts +42 -4
- 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/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +1 -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 +80 -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/commands/init/write-env.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-env.js +12 -0
- 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 +140 -6
- package/dist/commands/backend/sync.command.d.ts +5 -1
- package/dist/commands/backend/sync.command.d.ts.map +1 -1
- package/dist/commands/backend/sync.command.js +67 -3
- package/dist/commands/backend.d.ts +22 -0
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +110 -1
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +31 -7
- 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 +8 -0
- package/dist/commands/doctor/workspace.d.ts.map +1 -1
- package/dist/commands/doctor/workspace.js +127 -3
- package/dist/commands/guard/commit.command.d.ts.map +1 -1
- package/dist/commands/guard/commit.command.js +30 -6
- package/dist/commands/guard/impl/allow.d.ts +9 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +26 -10
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +146 -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/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +77 -2
- package/dist/commands/shared/task-backend.d.ts +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +9 -0
- package/dist/commands/shared/task-store.d.ts +92 -2
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +405 -43
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +84 -46
- 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 +73 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +34 -21
- package/dist/commands/task/derive.command.d.ts +1 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -1
- package/dist/commands/task/derive.command.js +15 -2
- package/dist/commands/task/derive.d.ts +1 -0
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +27 -4
- 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 +139 -76
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +142 -80
- package/dist/commands/task/migrate-doc.d.ts +15 -0
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +128 -43
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +3 -1
- 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 +198 -101
- 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 +115 -35
- package/dist/commands/task/shared/dependencies.d.ts +1 -0
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
- package/dist/commands/task/shared/dependencies.js +10 -0
- 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 +8 -1
- package/dist/commands/task/shared/transitions.d.ts +17 -2
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +20 -13
- package/dist/commands/task/shared.d.ts +3 -3
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +3 -3
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +101 -71
- 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 +124 -145
- 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/upgrade/apply.d.ts +2 -0
- package/dist/commands/upgrade/apply.d.ts.map +1 -1
- package/dist/commands/upgrade/apply.js +33 -1
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +25 -0
- package/dist/commands/upgrade.d.ts +1 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +34 -0
- 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 +16 -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 +2 -2
- 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 +17 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +59 -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
package/dist/commands/upgrade.js
CHANGED
|
@@ -11,7 +11,10 @@ import { exitCodeForError } from "../cli/exit-codes.js";
|
|
|
11
11
|
import { warnMessage } from "../cli/output.js";
|
|
12
12
|
import { CliError } from "../shared/errors.js";
|
|
13
13
|
import { ensureWorkflowArtifacts } from "../shared/workflow-artifacts.js";
|
|
14
|
+
import { checkTaskReadmeMigrationState } from "./doctor/workspace.js";
|
|
15
|
+
import { loadCommandContext } from "./shared/task-backend.js";
|
|
14
16
|
import { ensureNetworkApproved } from "./shared/network-approval.js";
|
|
17
|
+
import { migrateTaskDocsInWorkspace } from "./task/migrate-doc.js";
|
|
15
18
|
import { getVersion } from "../meta/version.js";
|
|
16
19
|
import { applyManagedFiles, cleanupAutoUpgradeArtifacts, createUpgradeCommit, ensureCleanTrackedTreeForUpgrade, persistUpgradeState, } from "./upgrade/apply.js";
|
|
17
20
|
import { printUpgradeDryRun, writeUpgradeAgentReview } from "./upgrade/report.js";
|
|
@@ -210,6 +213,12 @@ export async function cmdUpgradeParsed(opts) {
|
|
|
210
213
|
rootOverride: opts.rootOverride ?? null,
|
|
211
214
|
});
|
|
212
215
|
const loaded = await loadConfig(resolved.agentplaneDir);
|
|
216
|
+
const commandCtx = await loadCommandContext({
|
|
217
|
+
cwd: opts.cwd,
|
|
218
|
+
rootOverride: opts.rootOverride ?? null,
|
|
219
|
+
resolvedProject: resolved,
|
|
220
|
+
config: loaded.config,
|
|
221
|
+
});
|
|
213
222
|
if (flags.mode === "auto" && !flags.dryRun) {
|
|
214
223
|
await ensureCleanTrackedTreeForUpgrade(resolved.gitRoot);
|
|
215
224
|
}
|
|
@@ -624,6 +633,21 @@ export async function cmdUpgradeParsed(opts) {
|
|
|
624
633
|
createdBackups,
|
|
625
634
|
toBaselineKey,
|
|
626
635
|
});
|
|
636
|
+
const migratedTaskDocs = flags.migrateTaskDocs
|
|
637
|
+
? await migrateTaskDocsInWorkspace({
|
|
638
|
+
cwd: opts.cwd,
|
|
639
|
+
rootOverride: opts.rootOverride ?? null,
|
|
640
|
+
all: true,
|
|
641
|
+
taskIds: [],
|
|
642
|
+
resolvedProject: resolved,
|
|
643
|
+
config: loaded.config,
|
|
644
|
+
ctx: commandCtx,
|
|
645
|
+
})
|
|
646
|
+
: { changed: 0, changedPaths: [] };
|
|
647
|
+
if (flags.migrateTaskDocs) {
|
|
648
|
+
const details = migratedTaskDocs.changed > 0 ? `changed=${migratedTaskDocs.changed}` : "already current";
|
|
649
|
+
process.stdout.write(`Task README migration: ${details}\n`);
|
|
650
|
+
}
|
|
627
651
|
const hasManagedMutations = additions.length > 0 || updates.length > 0;
|
|
628
652
|
const shouldMutateConfig = await persistUpgradeState({
|
|
629
653
|
agentplaneDir: resolved.agentplaneDir,
|
|
@@ -655,6 +679,7 @@ export async function cmdUpgradeParsed(opts) {
|
|
|
655
679
|
...new Set([
|
|
656
680
|
...additions,
|
|
657
681
|
...updates,
|
|
682
|
+
...migratedTaskDocs.changedPaths,
|
|
658
683
|
...workflowArtifacts.commitPaths,
|
|
659
684
|
...(shouldMutateConfig ? [CONFIG_REL_PATH] : []),
|
|
660
685
|
]),
|
|
@@ -662,6 +687,8 @@ export async function cmdUpgradeParsed(opts) {
|
|
|
662
687
|
const commit = await createUpgradeCommit({
|
|
663
688
|
gitRoot: resolved.gitRoot,
|
|
664
689
|
paths: commitPaths,
|
|
690
|
+
tasksPath: loaded.config.paths.tasks_path,
|
|
691
|
+
workflowDir: loaded.config.paths.workflow_dir,
|
|
665
692
|
versionLabel: upgradeVersionLabel,
|
|
666
693
|
source: bundleLayout,
|
|
667
694
|
additions: additions.length,
|
|
@@ -677,6 +704,13 @@ export async function cmdUpgradeParsed(opts) {
|
|
|
677
704
|
if (commit) {
|
|
678
705
|
process.stdout.write(`Upgrade commit: ${commit.hash.slice(0, 12)} ${commit.subject}\n`);
|
|
679
706
|
}
|
|
707
|
+
const taskReadmeMigrationFindings = await checkTaskReadmeMigrationState(resolved.gitRoot, commandCtx);
|
|
708
|
+
if (taskReadmeMigrationFindings.length > 0) {
|
|
709
|
+
process.stderr.write(`${warnMessage("upgrade post-check: task README migration follow-up detected")}\n`);
|
|
710
|
+
for (const finding of taskReadmeMigrationFindings) {
|
|
711
|
+
process.stderr.write(`- ${finding}\n`);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
680
714
|
return 0;
|
|
681
715
|
}
|
|
682
716
|
finally {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.spec.d.ts","sourceRoot":"","sources":["../../src/commands/verify.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"verify.spec.d.ts","sourceRoot":"","sources":["../../src/commands/verify.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,KAAK,WAAW,GAAG,IAAI,GAAG,cAAc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAoFhD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { usageError } from "../cli/spec/errors.js";
|
|
2
|
+
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, } from "./task/verify-command-shared.js";
|
|
2
3
|
export const verifySpec = {
|
|
3
4
|
id: ["verify"],
|
|
4
5
|
group: "Lifecycle",
|
|
@@ -72,13 +73,7 @@ export const verifySpec = {
|
|
|
72
73
|
message: "Exactly one of --ok or --rework must be provided.",
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
-
throw usageError({
|
|
77
|
-
spec: verifySpec,
|
|
78
|
-
command: "verify",
|
|
79
|
-
message: "Options --details and --file are mutually exclusive.",
|
|
80
|
-
});
|
|
81
|
-
}
|
|
76
|
+
validateVerifyDetailsFileExclusive(raw, verifySpec, { command: "verify" });
|
|
82
77
|
},
|
|
83
78
|
parse: (raw) => {
|
|
84
79
|
const ok = raw.opts.ok === true;
|
|
@@ -86,11 +81,7 @@ export const verifySpec = {
|
|
|
86
81
|
return {
|
|
87
82
|
taskId: typeof raw.args["task-id"] === "string" ? raw.args["task-id"] : "",
|
|
88
83
|
state,
|
|
89
|
-
|
|
90
|
-
note: raw.opts.note,
|
|
91
|
-
details: raw.opts.details,
|
|
92
|
-
file: raw.opts.file,
|
|
93
|
-
quiet: raw.opts.quiet === true,
|
|
84
|
+
...parseVerifyCommonOptions(raw),
|
|
94
85
|
};
|
|
95
86
|
},
|
|
96
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/allowlist.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/allowlist.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAqD9D"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { gitPathIsUnderPrefix, normalizeGitPathPrefix } from "../../shared/git-path.js";
|
|
2
|
+
import { protectedPathAllowPrefixes } from "../../shared/protected-paths.js";
|
|
2
3
|
import { gitError, okResult } from "../result.js";
|
|
3
4
|
export function allowlistRule(ctx) {
|
|
4
5
|
const allowRaw = ctx.allow?.prefixes ?? [];
|
|
5
6
|
const staged = ctx.git.stagedPaths ?? [];
|
|
7
|
+
const allow = allowRaw.map((p) => normalizeGitPathPrefix(p));
|
|
8
|
+
const protectedAllow = protectedPathAllowPrefixes({
|
|
9
|
+
tasksPath: ctx.config.paths.tasks_path,
|
|
10
|
+
workflowDir: ctx.config.paths.workflow_dir,
|
|
11
|
+
taskId: ctx.taskId,
|
|
12
|
+
allowTasks: ctx.allow?.allowTasks === true,
|
|
13
|
+
allowPolicy: ctx.allow?.allowPolicy === true,
|
|
14
|
+
allowConfig: ctx.allow?.allowConfig === true,
|
|
15
|
+
allowHooks: ctx.allow?.allowHooks === true,
|
|
16
|
+
allowCI: ctx.allow?.allowCI === true,
|
|
17
|
+
});
|
|
18
|
+
const effectiveAllow = [...new Set([...allow, ...protectedAllow])];
|
|
6
19
|
if (staged.length === 0) {
|
|
7
20
|
return { ok: false, errors: [gitError("No staged files (git index empty)")], warnings: [] };
|
|
8
21
|
}
|
|
9
|
-
if (
|
|
22
|
+
if (effectiveAllow.length === 0) {
|
|
10
23
|
const message = ctx.action === "guard_commit" || ctx.action === "commit"
|
|
11
24
|
? "Provide at least one --allow <path> prefix"
|
|
12
25
|
: "Provide at least one allowlist prefix";
|
|
@@ -16,8 +29,7 @@ export function allowlistRule(ctx) {
|
|
|
16
29
|
warnings: [],
|
|
17
30
|
};
|
|
18
31
|
}
|
|
19
|
-
|
|
20
|
-
if (allow.includes(".")) {
|
|
32
|
+
if (effectiveAllow.includes(".")) {
|
|
21
33
|
return {
|
|
22
34
|
ok: false,
|
|
23
35
|
errors: [
|
|
@@ -28,7 +40,7 @@ export function allowlistRule(ctx) {
|
|
|
28
40
|
}
|
|
29
41
|
const errors = [];
|
|
30
42
|
for (const filePath of staged) {
|
|
31
|
-
if (!
|
|
43
|
+
if (!effectiveAllow.some((prefix) => gitPathIsUnderPrefix(filePath, prefix))) {
|
|
32
44
|
errors.push(`Staged file is outside allowlist: ${filePath}`);
|
|
33
45
|
}
|
|
34
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protected-paths.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/protected-paths.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAgB,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc7E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"protected-paths.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/protected-paths.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAgB,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc7E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAqDnE"}
|
|
@@ -18,7 +18,12 @@ export function protectedPathsRule(ctx) {
|
|
|
18
18
|
const allowCI = ctx.allow?.allowCI === true;
|
|
19
19
|
const errors = [];
|
|
20
20
|
for (const filePath of staged) {
|
|
21
|
-
const kind = protectedPathKindForFile({
|
|
21
|
+
const kind = protectedPathKindForFile({
|
|
22
|
+
filePath,
|
|
23
|
+
tasksPath,
|
|
24
|
+
workflowDir: ctx.config.paths.workflow_dir,
|
|
25
|
+
taskId: ctx.taskId,
|
|
26
|
+
});
|
|
22
27
|
if (!kind)
|
|
23
28
|
continue;
|
|
24
29
|
if (kind === "tasks" && !allowTasks) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { TaskData } from "../backends/task-backend.js";
|
|
1
|
+
import type { TaskData, TaskWriteOptions } from "../backends/task-backend.js";
|
|
2
2
|
export type TaskBackendPort = {
|
|
3
3
|
listTasks(): Promise<TaskData[]>;
|
|
4
4
|
getTask(id: string): Promise<TaskData | null>;
|
|
5
|
-
writeTask(task: TaskData): Promise<void>;
|
|
5
|
+
writeTask(task: TaskData, opts?: TaskWriteOptions): Promise<void>;
|
|
6
6
|
exportProjectionSnapshot(path: string): Promise<void>;
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=task-backend-port.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-backend-port.d.ts","sourceRoot":"","sources":["../../src/ports/task-backend-port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"task-backend-port.d.ts","sourceRoot":"","sources":["../../src/ports/task-backend-port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE9E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC9C,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-emoji.d.ts","sourceRoot":"","sources":["../../src/shared/agent-emoji.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-emoji.d.ts","sourceRoot":"","sources":["../../src/shared/agent-emoji.ts"],"names":[],"mappings":"AAkCA,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB"}
|
|
@@ -4,9 +4,26 @@ export type ProtectedPathOverride = {
|
|
|
4
4
|
cliFlag: string;
|
|
5
5
|
envVar: string;
|
|
6
6
|
};
|
|
7
|
+
export declare function taskArtifactPrefixes(opts: {
|
|
8
|
+
tasksPath: string;
|
|
9
|
+
workflowDir?: string;
|
|
10
|
+
taskId?: string;
|
|
11
|
+
}): string[];
|
|
12
|
+
export declare function protectedPathAllowPrefixes(opts: {
|
|
13
|
+
tasksPath: string;
|
|
14
|
+
workflowDir?: string;
|
|
15
|
+
taskId?: string;
|
|
16
|
+
allowTasks?: boolean;
|
|
17
|
+
allowPolicy?: boolean;
|
|
18
|
+
allowConfig?: boolean;
|
|
19
|
+
allowHooks?: boolean;
|
|
20
|
+
allowCI?: boolean;
|
|
21
|
+
}): string[];
|
|
7
22
|
export declare function getProtectedPathOverride(kind: ProtectedPathKind): ProtectedPathOverride;
|
|
8
23
|
export declare function protectedPathKindForFile(opts: {
|
|
9
24
|
filePath: string;
|
|
10
25
|
tasksPath: string;
|
|
26
|
+
workflowDir?: string;
|
|
27
|
+
taskId?: string;
|
|
11
28
|
}): ProtectedPathKind | null;
|
|
12
29
|
//# sourceMappingURL=protected-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protected-paths.d.ts","sourceRoot":"","sources":["../../src/shared/protected-paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protected-paths.d.ts","sourceRoot":"","sources":["../../src/shared/protected-paths.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;AAE/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAYF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,EAAE,CAOX;AAYD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,EAAE,CAkBX;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,qBAAqB,CAkBvF;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,iBAAiB,GAAG,IAAI,CAsC3B"}
|
|
@@ -1,9 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { gitPathIsUnderPrefix, normalizeGitPathPrefix } from "./git-path.js";
|
|
2
|
+
function taskWorkflowPrefix(workflowDir, taskId) {
|
|
3
|
+
const dir = normalizeGitPathPrefix(workflowDir ?? "");
|
|
4
|
+
const id = (taskId ?? "").trim();
|
|
5
|
+
if (!dir || !id)
|
|
6
|
+
return null;
|
|
7
|
+
return normalizeGitPathPrefix(`${dir}/${id}`);
|
|
8
|
+
}
|
|
9
|
+
export function taskArtifactPrefixes(opts) {
|
|
10
|
+
const out = new Set();
|
|
11
|
+
const tasksPath = normalizeGitPathPrefix(opts.tasksPath);
|
|
12
|
+
if (tasksPath)
|
|
13
|
+
out.add(tasksPath);
|
|
14
|
+
const workflowPrefix = taskWorkflowPrefix(opts.workflowDir, opts.taskId);
|
|
15
|
+
if (workflowPrefix)
|
|
16
|
+
out.add(workflowPrefix);
|
|
17
|
+
return [...out].toSorted((a, b) => a.localeCompare(b));
|
|
18
|
+
}
|
|
19
|
+
const POLICY_PATH_PREFIXES = [
|
|
20
|
+
"AGENTS.md",
|
|
21
|
+
"CLAUDE.md",
|
|
22
|
+
"packages/agentplane/assets/AGENTS.md",
|
|
23
|
+
".agentplane/agents",
|
|
24
|
+
];
|
|
25
|
+
const CONFIG_PATH_PREFIXES = [".agentplane/config.json", ".agentplane/backends"];
|
|
26
|
+
const HOOK_PATH_PREFIXES = ["lefthook.yml"];
|
|
27
|
+
const CI_PATH_PREFIXES = [".github/workflows", ".github/actions"];
|
|
28
|
+
export function protectedPathAllowPrefixes(opts) {
|
|
29
|
+
const out = new Set();
|
|
30
|
+
if (opts.allowTasks) {
|
|
31
|
+
for (const prefix of taskArtifactPrefixes(opts))
|
|
32
|
+
out.add(prefix);
|
|
33
|
+
}
|
|
34
|
+
if (opts.allowPolicy) {
|
|
35
|
+
for (const prefix of POLICY_PATH_PREFIXES)
|
|
36
|
+
out.add(prefix);
|
|
37
|
+
}
|
|
38
|
+
if (opts.allowConfig) {
|
|
39
|
+
for (const prefix of CONFIG_PATH_PREFIXES)
|
|
40
|
+
out.add(prefix);
|
|
41
|
+
}
|
|
42
|
+
if (opts.allowHooks) {
|
|
43
|
+
for (const prefix of HOOK_PATH_PREFIXES)
|
|
44
|
+
out.add(prefix);
|
|
45
|
+
}
|
|
46
|
+
if (opts.allowCI) {
|
|
47
|
+
for (const prefix of CI_PATH_PREFIXES)
|
|
48
|
+
out.add(prefix);
|
|
49
|
+
}
|
|
50
|
+
return [...out].toSorted((a, b) => a.localeCompare(b));
|
|
7
51
|
}
|
|
8
52
|
export function getProtectedPathOverride(kind) {
|
|
9
53
|
switch (kind) {
|
|
@@ -28,24 +72,29 @@ export function protectedPathKindForFile(opts) {
|
|
|
28
72
|
const p = opts.filePath;
|
|
29
73
|
if (!p)
|
|
30
74
|
return null;
|
|
31
|
-
if (
|
|
75
|
+
if (taskArtifactPrefixes({
|
|
76
|
+
tasksPath: opts.tasksPath,
|
|
77
|
+
workflowDir: opts.workflowDir,
|
|
78
|
+
taskId: opts.taskId,
|
|
79
|
+
}).some((prefix) => gitPathIsUnderPrefix(p, prefix))) {
|
|
32
80
|
return "tasks";
|
|
81
|
+
}
|
|
33
82
|
// "Rules of the game": authoring/agent policies and registry.
|
|
34
83
|
if (p === "AGENTS.md" ||
|
|
35
84
|
p === "CLAUDE.md" ||
|
|
36
85
|
p === "packages/agentplane/assets/AGENTS.md" ||
|
|
37
|
-
|
|
86
|
+
gitPathIsUnderPrefix(p, ".agentplane/agents")) {
|
|
38
87
|
return "policy";
|
|
39
88
|
}
|
|
40
89
|
// Framework config and task backend config determine enforcement behavior.
|
|
41
|
-
if (p === ".agentplane/config.json" ||
|
|
90
|
+
if (p === ".agentplane/config.json" || gitPathIsUnderPrefix(p, ".agentplane/backends")) {
|
|
42
91
|
return "config";
|
|
43
92
|
}
|
|
44
93
|
// Local hook orchestrator is a quality gate for commits.
|
|
45
94
|
if (p === "lefthook.yml")
|
|
46
95
|
return "hooks";
|
|
47
96
|
// CI workflows are "remote hooks" for quality gates.
|
|
48
|
-
if (
|
|
97
|
+
if (gitPathIsUnderPrefix(p, ".github/workflows") || gitPathIsUnderPrefix(p, ".github/actions")) {
|
|
49
98
|
return "ci";
|
|
50
99
|
}
|
|
51
100
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-cli-version.d.ts","sourceRoot":"","sources":["../../src/shared/repo-cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,WAAW,GACX,qBAAqB,GACrB,2BAA2B,CAAC;AAEhC,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAKjF;
|
|
1
|
+
{"version":3,"file":"repo-cli-version.d.ts","sourceRoot":"","sources":["../../src/shared/repo-cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,WAAW,GACX,qBAAqB,GACrB,2BAA2B,CAAC;AAEhC,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAKjF;AA8BD,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,GACzB,yBAAyB,CAuC3B"}
|
|
@@ -9,16 +9,22 @@ export function getRepoExpectedCliVersion(config) {
|
|
|
9
9
|
function buildRecovery(runtime, expectedVersion) {
|
|
10
10
|
switch (runtime.mode) {
|
|
11
11
|
case "global-installed": {
|
|
12
|
-
return `Run: npm i -g agentplane@${expectedVersion}`;
|
|
12
|
+
return `Run: npm i -g agentplane@${expectedVersion}. Then verify: agentplane runtime explain`;
|
|
13
13
|
}
|
|
14
14
|
case "global-in-framework":
|
|
15
15
|
case "global-forced-in-framework": {
|
|
16
|
-
|
|
16
|
+
const prefix = runtime.mode === "global-forced-in-framework"
|
|
17
|
+
? "Unset AGENTPLANE_USE_GLOBAL_IN_FRAMEWORK=1 if forced global mode is not intentional. "
|
|
18
|
+
: "";
|
|
19
|
+
return (`${prefix}Run: scripts/reinstall-global-agentplane.sh. ` +
|
|
20
|
+
"Fallback: node packages/agentplane/bin/agentplane.js runtime explain. " +
|
|
21
|
+
"Then verify: agentplane runtime explain");
|
|
17
22
|
}
|
|
18
23
|
case "repo-local":
|
|
19
24
|
case "repo-local-handoff": {
|
|
20
25
|
return (`Sync this framework checkout to agentplane ${expectedVersion} or lower ` +
|
|
21
|
-
"framework.cli.expected_version if the repository intentionally targets an older CLI."
|
|
26
|
+
"framework.cli.expected_version if the repository intentionally targets an older CLI. " +
|
|
27
|
+
"Then verify: agentplane runtime explain");
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentplane",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Agent Plane CLI for task workflows, recipes, and project automation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentplane",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"prepublishOnly": "node ../../scripts/enforce-github-publish.mjs && npm run prepack"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@agentplaneorg/core": "0.3.
|
|
58
|
+
"@agentplaneorg/core": "0.3.7",
|
|
59
59
|
"yauzl": "^2.10.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|