agentplane 0.3.13 → 0.3.15
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/RUNNER.md +1 -1
- package/assets/agents/ORCHESTRATOR.json +1 -1
- package/assets/agents/SKILL_EXTRACTOR.json +31 -0
- package/assets/framework.manifest.json +7 -0
- package/assets/policy/incidents.md +5 -3
- package/assets/policy/workflow.branch_pr.md +10 -5
- package/dist/.build-manifest.json +280 -180
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +33 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +29 -87
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +16 -38
- package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +23 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +6 -18
- 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/commands/init/recipes.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/recipes.js +1 -0
- package/dist/cli/run-cli.js +1 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -74
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +1 -769
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +5 -9
- package/dist/commands/branch/work-start.command.d.ts.map +1 -1
- package/dist/commands/branch/work-start.command.js +1 -0
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +2 -0
- package/dist/commands/doctor/branch-pr.d.ts +1 -1
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
- package/dist/commands/doctor/branch-pr.js +5 -2
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -1
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -1
- package/dist/commands/guard/impl/env.d.ts +6 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +41 -0
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -1
- package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-branch.js +113 -0
- package/dist/commands/pr/internal/sync-github.d.ts +28 -0
- package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-github.js +178 -0
- package/dist/commands/pr/internal/sync-model.d.ts +36 -0
- package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-model.js +1 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
- package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-open-step.js +128 -0
- package/dist/commands/pr/internal/sync-support.d.ts +7 -0
- package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-support.js +29 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
- package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
- package/dist/commands/pr/internal/sync-update-step.js +68 -0
- package/dist/commands/pr/internal/sync.d.ts +2 -6
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +83 -529
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +25 -8
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +7 -2
- package/dist/commands/recipes/impl/apply.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +1 -2
- package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/active.js +6 -5
- package/dist/commands/recipes/impl/commands/add.d.ts +1 -0
- package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/add.js +32 -27
- package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/detach.js +35 -21
- package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/disable.js +5 -3
- package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/enable.js +5 -3
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +57 -47
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +25 -21
- package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +3 -13
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +7 -6
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +12 -7
- package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/update.js +38 -24
- package/dist/commands/recipes/impl/index.d.ts +1 -1
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
- package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
- package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
- package/dist/commands/recipes/impl/overlay-project.d.ts +19 -3
- package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -1
- package/dist/commands/recipes/impl/overlay-project.js +76 -38
- package/dist/commands/recipes/impl/paths.d.ts +0 -3
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +0 -3
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +4 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +6 -4
- package/dist/commands/recipes/impl/project-recipe-state.d.ts +1 -1
- package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.d.ts +5 -1
- package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-registry.js +34 -14
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/types.d.ts +1 -1
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/impl/version.d.ts +5 -0
- package/dist/commands/recipes/impl/version.d.ts.map +1 -0
- package/dist/commands/recipes/impl/version.js +9 -0
- package/dist/commands/recipes.d.ts +5 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +3 -3
- package/dist/commands/release/apply.command.d.ts +1 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +15 -379
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +24 -1
- package/dist/commands/release/apply.pipeline.d.ts +22 -0
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline.js +371 -0
- package/dist/commands/release/apply.preflight.d.ts +2 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +13 -4
- package/dist/commands/release/apply.types.d.ts +27 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.d.ts +4 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -1
- package/dist/commands/release.test-helpers.js +7 -0
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +2 -2
- package/dist/commands/shared/task-backend.d.ts +6 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -2
- package/dist/commands/shared/task-mutation.d.ts.map +1 -1
- package/dist/commands/shared/task-mutation.js +4 -4
- package/dist/commands/shared/task-store/intents.d.ts +34 -0
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
- package/dist/commands/shared/task-store/intents.js +265 -0
- package/dist/commands/shared/task-store/readme.d.ts +28 -0
- package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
- package/dist/commands/shared/task-store/readme.js +125 -0
- package/dist/commands/shared/task-store/store.d.ts +26 -0
- package/dist/commands/shared/task-store/store.d.ts.map +1 -0
- package/dist/commands/shared/task-store/store.js +105 -0
- package/dist/commands/shared/task-store/types.d.ts +94 -0
- package/dist/commands/shared/task-store/types.d.ts.map +1 -0
- package/dist/commands/shared/task-store/types.js +1 -0
- package/dist/commands/shared/task-store.d.ts +3 -109
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +2 -493
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +7 -2
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +7 -2
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +3 -3
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +102 -15
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +23 -2
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +9 -4
- package/dist/commands/task/list.run.d.ts.map +1 -1
- package/dist/commands/task/list.run.js +14 -4
- package/dist/commands/task/new.command.d.ts.map +1 -1
- package/dist/commands/task/new.command.js +16 -2
- package/dist/commands/task/new.js +2 -2
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +3 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +11 -3
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +3 -33
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +3 -30
- package/dist/runner/adapters/runtime-shared.d.ts +14 -0
- package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
- package/dist/runner/adapters/runtime-shared.js +36 -0
- package/dist/runner/context/base-prompt-sources.d.ts +30 -0
- package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
- package/dist/runner/context/base-prompt-sources.js +144 -0
- package/dist/runner/context/base-prompts.d.ts +3 -22
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +6 -450
- package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
- package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/overlay-prompt-blocks.js +72 -0
- package/dist/runner/context/prompt-block-shared.d.ts +54 -0
- package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
- package/dist/runner/context/prompt-block-shared.js +106 -0
- package/dist/runner/context/recipe-context.d.ts +2 -1
- package/dist/runner/context/recipe-context.d.ts.map +1 -1
- package/dist/runner/context/recipe-context.js +2 -1
- package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
- package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/recipe-prompt-blocks.js +143 -0
- package/dist/runner/usecases/scenario-materialize-task.js +2 -2
- package/dist/runner/usecases/task-run-inspect.js +2 -2
- package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
- package/dist/runner/usecases/task-run.d.ts.map +1 -1
- package/dist/runner/usecases/task-run.js +4 -2
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
- package/dist/runtime/execution-context.d.ts +63 -0
- package/dist/runtime/execution-context.d.ts.map +1 -0
- package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
- package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
- package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/advice-strategy.js +54 -0
- package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
- package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/plan-strategy.js +205 -0
- package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
- package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
- package/dist/runtime/incidents/registry-strategy.js +280 -0
- package/dist/runtime/incidents/resolve.d.ts +3 -25
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +3 -683
- package/dist/runtime/incidents/shared.d.ts +34 -0
- package/dist/runtime/incidents/shared.d.ts.map +1 -0
- package/dist/runtime/incidents/shared.js +171 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
- package/dist/testing/cli-harness/recipe-archives.js +374 -0
- package/dist/testing/cli-harness/stdio.d.ts +26 -0
- package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
- package/dist/testing/cli-harness/stdio.js +84 -0
- package/dist/testing/cli-harness.d.ts +25 -0
- package/dist/testing/cli-harness.d.ts.map +1 -0
- package/dist/testing/cli-harness.js +313 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +7 -4
- package/dist/commands/recipes/impl/manifest.d.ts +0 -4
- package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
- package/dist/commands/recipes/impl/manifest.js +0 -7
- package/dist/commands/recipes/impl/normalize.d.ts +0 -8
- package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
- package/dist/commands/recipes/impl/normalize.js +0 -54
- package/dist/commands/recipes/impl/scenario.d.ts +0 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
- package/dist/commands/recipes/impl/scenario.js +0 -262
- package/dist/recipes/bundled-recipes.d.ts +0 -17
- package/dist/recipes/bundled-recipes.d.ts.map +0 -1
- package/dist/recipes/bundled-recipes.js +0 -15
- package/dist/usecases/context/resolve-context.d.ts +0 -68
- package/dist/usecases/context/resolve-context.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.d.ts +0 -9
- package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-list-usecase.js +0 -17
- package/dist/usecases/task/task-new-usecase.d.ts +0 -9
- package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
- package/dist/usecases/task/task-new-usecase.js +0 -17
package/dist/commands/pr/open.js
CHANGED
|
@@ -4,7 +4,7 @@ import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
|
4
4
|
import { createCliEmitter } from "../../cli/output.js";
|
|
5
5
|
import { CliError } from "../../shared/errors.js";
|
|
6
6
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
7
|
-
import { gitBranchUpstream } from "../shared/git-ops.js";
|
|
7
|
+
import { gitBranchUpstream, gitCurrentBranch } from "../shared/git-ops.js";
|
|
8
8
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
9
9
|
import { maybeAutoCommitTaskPrArtifacts } from "./internal/auto-commit.js";
|
|
10
10
|
import { syncPrArtifacts } from "./internal/sync.js";
|
|
@@ -21,8 +21,25 @@ function prOpenOutcomeDetails(meta, openOutcome) {
|
|
|
21
21
|
async function pushTaskBranchUpstreamIfConfigured(opts) {
|
|
22
22
|
const upstream = await gitBranchUpstream(opts.gitRoot, opts.branch);
|
|
23
23
|
const trimmed = upstream?.trim() ?? "";
|
|
24
|
-
if (!trimmed)
|
|
25
|
-
|
|
24
|
+
if (!trimmed) {
|
|
25
|
+
const currentBranch = await gitCurrentBranch(opts.gitRoot).catch(() => "");
|
|
26
|
+
if (currentBranch.trim() !== opts.branch.trim())
|
|
27
|
+
return false;
|
|
28
|
+
try {
|
|
29
|
+
await execFileAsync("git", ["remote", "get-url", "origin"], {
|
|
30
|
+
cwd: opts.gitRoot,
|
|
31
|
+
env: gitEnv(),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
await execFileAsync("git", ["push", "--no-verify", "-u", "origin", `HEAD:${opts.branch}`], {
|
|
38
|
+
cwd: opts.gitRoot,
|
|
39
|
+
env: gitEnv(),
|
|
40
|
+
});
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
26
43
|
const slashIndex = trimmed.indexOf("/");
|
|
27
44
|
if (slashIndex <= 0 || slashIndex === trimmed.length - 1)
|
|
28
45
|
return false;
|
|
@@ -59,14 +76,14 @@ export async function cmdPrOpen(opts) {
|
|
|
59
76
|
branch: opts.branch,
|
|
60
77
|
remoteMode: "sync-only",
|
|
61
78
|
});
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
if (initialSync.meta.branch) {
|
|
80
|
+
await maybeAutoCommitTaskPrArtifacts({
|
|
64
81
|
ctx: commandCtx,
|
|
65
82
|
taskId: opts.taskId,
|
|
66
83
|
branch: initialSync.meta.branch,
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
if (
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (!opts.syncOnly && initialSync.meta.branch) {
|
|
70
87
|
await pushTaskBranchUpstreamIfConfigured({
|
|
71
88
|
gitRoot: commandCtx.resolvedProject.gitRoot,
|
|
72
89
|
branch: initialSync.meta.branch,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/pr.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAWhE,KAAK,aAAa,GAAG,kBAAkB,CAAC;AAExC,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,aAAa,CA8B7C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/pr.command.ts"],"names":[],"mappings":"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"}
|
|
@@ -34,7 +34,7 @@ export const prSpec = {
|
|
|
34
34
|
export const prOpenSpec = {
|
|
35
35
|
id: ["pr", "open"],
|
|
36
36
|
group: "PR",
|
|
37
|
-
summary: "Create PR artifacts for a task.",
|
|
37
|
+
summary: "Create PR artifacts for a task and, unless --sync-only is set, publish/link the remote GitHub PR.",
|
|
38
38
|
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
39
39
|
options: [
|
|
40
40
|
{
|
|
@@ -57,7 +57,12 @@ export const prOpenSpec = {
|
|
|
57
57
|
description: "Only write local PR artifacts; do not create a remote GitHub PR.",
|
|
58
58
|
},
|
|
59
59
|
],
|
|
60
|
-
examples: [
|
|
60
|
+
examples: [
|
|
61
|
+
{
|
|
62
|
+
cmd: "agentplane pr open 202602030608-F1Q8AB --author CODER",
|
|
63
|
+
why: "Sync local artifacts, publish the task branch to origin if needed, and create/link the GitHub PR.",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
61
66
|
validateRaw: (raw) => {
|
|
62
67
|
const author = typeof raw.opts.author === "string" ? raw.opts.author.trim() : "";
|
|
63
68
|
if (!author) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAWhC,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAarF;AAyBD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDhB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cp, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { normalizeAgentId, readScenarioDefinition, } from "@agentplaneorg/recipes";
|
|
3
4
|
import { exitCodeForError } from "../../../cli/exit-codes.js";
|
|
4
5
|
import { fileExists, getPathKind } from "../../../cli/fs-utils.js";
|
|
5
6
|
import { invalidFieldMessage, missingFileMessage } from "../../../cli/output.js";
|
|
@@ -7,8 +8,6 @@ import { CliError } from "../../../shared/errors.js";
|
|
|
7
8
|
import { isRecord } from "../../../shared/guards.js";
|
|
8
9
|
import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
|
|
9
10
|
import { RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME } from "./constants.js";
|
|
10
|
-
import { readScenarioDefinition } from "./scenario.js";
|
|
11
|
-
import { normalizeAgentId } from "./normalize.js";
|
|
12
11
|
export async function moveRecipeDir(opts) {
|
|
13
12
|
await mkdir(path.dirname(opts.to), { recursive: true });
|
|
14
13
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/active.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/active.ts"],"names":[],"mappings":"AAWA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { resolveProject } from "@agentplaneorg/core";
|
|
2
2
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
|
-
import { emptyStateMessage } from "../../../../cli/output.js";
|
|
3
|
+
import { createCliEmitter, emptyStateMessage } from "../../../../cli/output.js";
|
|
4
4
|
import { CliError } from "../../../../shared/errors.js";
|
|
5
5
|
import { readActiveRecipeIds } from "../overlay-project.js";
|
|
6
6
|
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
7
|
+
const output = createCliEmitter();
|
|
7
8
|
export async function cmdRecipeActiveParsed(opts) {
|
|
8
9
|
try {
|
|
9
10
|
const project = await resolveProject({
|
|
@@ -18,11 +19,11 @@ export async function cmdRecipeActiveParsed(opts) {
|
|
|
18
19
|
.map((id) => installed.recipes.find((entry) => entry.id === id))
|
|
19
20
|
.filter(Boolean);
|
|
20
21
|
if (active.length === 0) {
|
|
21
|
-
|
|
22
|
+
output.line(emptyStateMessage("active overlays"));
|
|
22
23
|
return 0;
|
|
23
24
|
}
|
|
24
25
|
if (opts.full) {
|
|
25
|
-
|
|
26
|
+
output.json({
|
|
26
27
|
schema_version: 1,
|
|
27
28
|
active: active.map((entry) => ({
|
|
28
29
|
id: entry.id,
|
|
@@ -30,11 +31,11 @@ export async function cmdRecipeActiveParsed(opts) {
|
|
|
30
31
|
kind: entry.manifest.kind,
|
|
31
32
|
summary: entry.manifest.summary,
|
|
32
33
|
})),
|
|
33
|
-
}
|
|
34
|
+
});
|
|
34
35
|
return 0;
|
|
35
36
|
}
|
|
36
37
|
for (const entry of active) {
|
|
37
|
-
|
|
38
|
+
output.line(`${entry.id}@${entry.version} [${entry.manifest.kind}]`);
|
|
38
39
|
}
|
|
39
40
|
return 0;
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/add.ts"],"names":[],"mappings":"AAuCA,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmFlB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { cp, mkdir, rm, symlink } from "node:fs/promises";
|
|
2
|
+
import { normalizeRecipeTags } from "@agentplaneorg/recipes";
|
|
2
3
|
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
3
4
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
4
5
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
5
6
|
import { CliError } from "../../../../shared/errors.js";
|
|
6
|
-
import {
|
|
7
|
+
import { runVendoredRecipeMutation } from "../mutation-transaction.js";
|
|
8
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
7
9
|
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
8
|
-
import { normalizeRecipeTags } from "../normalize.js";
|
|
9
10
|
import { hashRecipeTree } from "../project-recipe-state.js";
|
|
10
|
-
import { readProjectRecipesRegistry,
|
|
11
|
+
import { readProjectRecipesRegistry, replaceProjectRecipeRegistryEntry, } from "../project-registry.js";
|
|
12
|
+
import { pickLatestRecipeVersion } from "../version.js";
|
|
11
13
|
import { resolveInstalledRecipeDir, resolveInstalledRecipesPath, resolveProjectRecipesPackagesDir, resolveProjectVendoredRecipeDir, } from "../paths.js";
|
|
12
14
|
function parseRecipeRef(raw) {
|
|
13
15
|
const value = raw.trim();
|
|
@@ -32,12 +34,10 @@ export async function cmdRecipeAddParsed(opts) {
|
|
|
32
34
|
const loaded = await loadConfig(project.agentplaneDir);
|
|
33
35
|
const requested = parseRecipeRef(opts.recipeRef);
|
|
34
36
|
const cache = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
35
|
-
const cachedEntries = cache.recipes
|
|
36
|
-
.filter((entry) => entry.id === requested.id)
|
|
37
|
-
.toSorted((left, right) => left.version.localeCompare(right.version));
|
|
37
|
+
const cachedEntries = cache.recipes.filter((entry) => entry.id === requested.id);
|
|
38
38
|
const cached = requested.version
|
|
39
39
|
? cachedEntries.find((entry) => entry.version === requested.version)
|
|
40
|
-
: cachedEntries
|
|
40
|
+
: pickLatestRecipeVersion(cachedEntries);
|
|
41
41
|
if (!cached) {
|
|
42
42
|
throw new CliError({
|
|
43
43
|
exitCode: exitCodeForError("E_IO"),
|
|
@@ -61,31 +61,36 @@ export async function cmdRecipeAddParsed(opts) {
|
|
|
61
61
|
: `Recipe already vendored: ${cached.id}@${existing.version}. Remove it first or use a dedicated update flow instead of overwriting it with recipes add.`,
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
await mkdir(resolveProjectRecipesPackagesDir(project), { recursive: true });
|
|
65
|
-
await rm(targetDir, { recursive: true, force: true });
|
|
66
|
-
await (materialization === "link"
|
|
67
|
-
? symlink(sourceDir, targetDir, "dir")
|
|
68
|
-
: cp(sourceDir, targetDir, { recursive: true }));
|
|
69
64
|
const installedAt = new Date().toISOString();
|
|
70
65
|
const tags = normalizeRecipeTags(cached.tags ?? cached.manifest.tags ?? []);
|
|
71
66
|
const sourceSha256 = await hashRecipeTree(sourceDir);
|
|
72
|
-
|
|
73
|
-
await
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
await mkdir(resolveProjectRecipesPackagesDir(project), { recursive: true });
|
|
68
|
+
await runVendoredRecipeMutation({
|
|
69
|
+
targetDir,
|
|
70
|
+
mode: "create",
|
|
71
|
+
materialize: async (nextTargetDir) => {
|
|
72
|
+
await rm(nextTargetDir, { recursive: true, force: true });
|
|
73
|
+
await (materialization === "link"
|
|
74
|
+
? symlink(sourceDir, nextTargetDir, "dir")
|
|
75
|
+
: cp(sourceDir, nextTargetDir, { recursive: true }));
|
|
76
|
+
},
|
|
77
|
+
commit: async () => {
|
|
78
|
+
const vendoredSha256 = await hashRecipeTree(targetDir);
|
|
79
|
+
const nextRegistry = replaceProjectRecipeRegistryEntry(registry, {
|
|
80
|
+
id: cached.id,
|
|
81
|
+
version: cached.version,
|
|
82
|
+
path: `packages/${cached.id}`,
|
|
83
|
+
active: opts.activate === true,
|
|
84
|
+
materialization,
|
|
85
|
+
source_ref: `${cached.id}@${cached.version}`,
|
|
86
|
+
source_sha256: sourceSha256,
|
|
87
|
+
vendored_sha256: vendoredSha256,
|
|
88
|
+
installed_at: installedAt,
|
|
89
|
+
tags,
|
|
90
|
+
});
|
|
91
|
+
await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
86
92
|
},
|
|
87
93
|
});
|
|
88
|
-
await refreshProjectOverlayArtifacts(project);
|
|
89
94
|
process.stdout.write(`Vendored recipe ${cached.id}@${cached.version} into project (${materialization})\n`);
|
|
90
95
|
if (materialization === "link") {
|
|
91
96
|
process.stdout.write("Warning: link mode is not portable; use `agentplane recipes detach` before sharing the repo.\n");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/detach.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/detach.ts"],"names":[],"mappings":"AAoBA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CA2FlB"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { cp
|
|
1
|
+
import { cp } from "node:fs/promises";
|
|
2
|
+
import { normalizeRecipeTags } from "@agentplaneorg/recipes";
|
|
2
3
|
import { loadConfig, resolveProject } from "@agentplaneorg/core";
|
|
3
4
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
4
5
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
5
6
|
import { CliError } from "../../../../shared/errors.js";
|
|
6
7
|
import { ensureActionApproved } from "../../../shared/approval-requirements.js";
|
|
7
8
|
import { readInstalledRecipesFile } from "../installed-recipes.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { runVendoredRecipeMutation } from "../mutation-transaction.js";
|
|
10
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
10
11
|
import { hashRecipeTree, inspectProjectRecipe } from "../project-recipe-state.js";
|
|
11
|
-
import {
|
|
12
|
+
import { readProjectRecipesRegistry, replaceProjectRecipeRegistryEntry, } from "../project-registry.js";
|
|
12
13
|
import { resolveInstalledRecipesPath, resolveProjectVendoredRecipeDir } from "../paths.js";
|
|
13
14
|
export async function cmdRecipeDetachParsed(opts) {
|
|
14
15
|
try {
|
|
@@ -32,6 +33,14 @@ export async function cmdRecipeDetachParsed(opts) {
|
|
|
32
33
|
message: `Cached source is missing for ${inspection.entry.id}@${inspection.entry.version}. Re-install it before detaching.`,
|
|
33
34
|
});
|
|
34
35
|
}
|
|
36
|
+
const currentSourceSha256 = inspection.current_source_sha256;
|
|
37
|
+
if (!currentSourceSha256) {
|
|
38
|
+
throw new CliError({
|
|
39
|
+
exitCode: exitCodeForError("E_IO"),
|
|
40
|
+
code: "E_IO",
|
|
41
|
+
message: `Cached source hash is missing for ${inspection.entry.id}@${inspection.entry.version}`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
35
44
|
if (inspection.state === "modified") {
|
|
36
45
|
throw new CliError({
|
|
37
46
|
exitCode: exitCodeForError("E_USAGE"),
|
|
@@ -40,7 +49,7 @@ export async function cmdRecipeDetachParsed(opts) {
|
|
|
40
49
|
});
|
|
41
50
|
}
|
|
42
51
|
const cache = await readInstalledRecipesFile(resolveInstalledRecipesPath());
|
|
43
|
-
const
|
|
52
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
44
53
|
const cached = cache.recipes.find((entry) => entry.id === inspection.entry.id && entry.version === inspection.entry.version);
|
|
45
54
|
if (!cached) {
|
|
46
55
|
throw new CliError({
|
|
@@ -56,24 +65,29 @@ export async function cmdRecipeDetachParsed(opts) {
|
|
|
56
65
|
reason: `recipes detach ${inspection.entry.id}@${inspection.entry.version}`,
|
|
57
66
|
});
|
|
58
67
|
const targetDir = resolveProjectVendoredRecipeDir(project, inspection.entry.id);
|
|
59
|
-
await
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
await runVendoredRecipeMutation({
|
|
69
|
+
targetDir,
|
|
70
|
+
mode: "replace",
|
|
71
|
+
materialize: async (nextTargetDir) => {
|
|
72
|
+
await cp(inspection.source_dir, nextTargetDir, { recursive: true });
|
|
73
|
+
},
|
|
74
|
+
commit: async () => {
|
|
75
|
+
const vendoredSha256 = await hashRecipeTree(targetDir);
|
|
76
|
+
const nextRegistry = replaceProjectRecipeRegistryEntry(registry, {
|
|
77
|
+
id: inspection.entry.id,
|
|
78
|
+
version: inspection.entry.version,
|
|
79
|
+
path: inspection.entry.project_path,
|
|
80
|
+
active: registry.recipes.find((entry) => entry.id === inspection.entry.id)?.active === true,
|
|
81
|
+
materialization: "copy",
|
|
82
|
+
source_ref: inspection.entry.source_ref,
|
|
83
|
+
source_sha256: currentSourceSha256,
|
|
84
|
+
vendored_sha256: vendoredSha256,
|
|
85
|
+
installed_at: inspection.entry.installed_at,
|
|
86
|
+
tags: normalizeRecipeTags(cached.tags ?? cached.manifest.tags ?? []),
|
|
87
|
+
});
|
|
88
|
+
await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
74
89
|
},
|
|
75
90
|
});
|
|
76
|
-
await refreshProjectOverlayArtifacts(project);
|
|
77
91
|
process.stdout.write(`Detached recipe ${inspection.entry.id}@${inspection.entry.version} into a project-local copy.\n`);
|
|
78
92
|
return 0;
|
|
79
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/disable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/disable.ts"],"names":[],"mappings":"AAQA,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CAelB"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { resolveProject } from "@agentplaneorg/core";
|
|
2
2
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
3
|
import { CliError } from "../../../../shared/errors.js";
|
|
4
|
-
import {
|
|
4
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
5
|
+
import { readProjectRecipesRegistry, setProjectRecipeActiveInFile } from "../project-registry.js";
|
|
5
6
|
export async function cmdRecipeDisableParsed(opts) {
|
|
6
7
|
try {
|
|
7
8
|
const project = await resolveProject({
|
|
8
9
|
cwd: opts.cwd,
|
|
9
10
|
rootOverride: opts.rootOverride ?? null,
|
|
10
11
|
});
|
|
11
|
-
await
|
|
12
|
-
const
|
|
12
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
13
|
+
const nextRegistry = setProjectRecipeActiveInFile(registry, opts.id, false);
|
|
14
|
+
const { bundle } = await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
13
15
|
process.stdout.write(`Disabled overlay ${opts.id} (${bundle.active.length} active)\n`);
|
|
14
16
|
return 0;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/enable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/enable.ts"],"names":[],"mappings":"AAUA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BlB"}
|
|
@@ -2,8 +2,9 @@ import { resolveProject } from "@agentplaneorg/core";
|
|
|
2
2
|
import { mapCoreError } from "../../../../cli/error-map.js";
|
|
3
3
|
import { exitCodeForError } from "../../../../cli/exit-codes.js";
|
|
4
4
|
import { CliError } from "../../../../shared/errors.js";
|
|
5
|
-
import {
|
|
5
|
+
import { publishProjectRecipesState } from "../overlay-project.js";
|
|
6
6
|
import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
|
|
7
|
+
import { readProjectRecipesRegistry, setProjectRecipeActiveInFile } from "../project-registry.js";
|
|
7
8
|
export async function cmdRecipeEnableParsed(opts) {
|
|
8
9
|
try {
|
|
9
10
|
const project = await resolveProject({
|
|
@@ -26,8 +27,9 @@ export async function cmdRecipeEnableParsed(opts) {
|
|
|
26
27
|
message: `Recipe ${opts.id} is not a project overlay`,
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
await
|
|
30
|
-
const
|
|
30
|
+
const registry = await readProjectRecipesRegistry(project);
|
|
31
|
+
const nextRegistry = setProjectRecipeActiveInFile(registry, opts.id, true);
|
|
32
|
+
const { bundle } = await publishProjectRecipesState({ project, registry: nextRegistry });
|
|
31
33
|
process.stdout.write(`Enabled overlay ${opts.id} (${bundle.active.length} active)\n`);
|
|
32
34
|
return 0;
|
|
33
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/explain.ts"],"names":[],"mappings":"AAkBA,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,MAAM,CAAC,CA0LlB"}
|