agentplane 0.2.3 → 0.2.5
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 +59 -33
- package/assets/framework.manifest.json +89 -0
- package/dist/adapters/clock/system-clock-adapter.d.ts +5 -0
- package/dist/adapters/clock/system-clock-adapter.d.ts.map +1 -0
- package/dist/adapters/clock/system-clock-adapter.js +5 -0
- package/dist/adapters/fs/node-fs-adapter.d.ts +15 -0
- package/dist/adapters/fs/node-fs-adapter.d.ts.map +1 -0
- package/dist/adapters/fs/node-fs-adapter.js +47 -0
- package/dist/adapters/git/git-context-adapter.d.ts +21 -0
- package/dist/adapters/git/git-context-adapter.d.ts.map +1 -0
- package/dist/adapters/git/git-context-adapter.js +27 -0
- package/dist/adapters/index.d.ts +13 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +12 -0
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +12 -0
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -0
- package/dist/adapters/task-backend/task-backend-adapter.js +22 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +39 -34
- package/dist/backends/task-index.d.ts +9 -3
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +64 -14
- package/dist/cli/cli-error.d.ts +9 -0
- package/dist/cli/cli-error.d.ts.map +1 -0
- package/dist/cli/cli-error.js +13 -0
- package/dist/cli/command-guide.js +2 -2
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +13 -2
- package/dist/cli/parse/lifecycle.d.ts.map +1 -1
- package/dist/cli/parse/lifecycle.js +6 -1
- 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 +8 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/conflicts.js +2 -1
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-agents.js +27 -4
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +0 -4
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +14 -5
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +35 -1
- package/dist/commands/branch/internal/work-validate.d.ts.map +1 -1
- package/dist/commands/branch/internal/work-validate.js +13 -4
- package/dist/commands/branch/status.d.ts.map +1 -1
- package/dist/commands/branch/status.js +9 -4
- package/dist/commands/branch/work-start.command.d.ts.map +1 -1
- package/dist/commands/branch/work-start.command.js +3 -2
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.js +95 -2
- package/dist/commands/doctor.command.d.ts +8 -0
- package/dist/commands/doctor.command.d.ts.map +1 -0
- package/dist/commands/doctor.command.js +137 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +7 -2
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -1
- package/dist/commands/guard/impl/close-message.js +7 -2
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +7 -2
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -1
- package/dist/commands/pr/integrate/artifacts.js +6 -1
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +7 -6
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +9 -4
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -1
- package/dist/commands/pr/integrate/verify.js +3 -1
- package/dist/commands/pr/note.d.ts.map +1 -1
- package/dist/commands/pr/note.js +13 -4
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +8 -3
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +2 -1
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +2 -1
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +2 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +5 -4
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +2 -1
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +8 -7
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +4 -3
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +7 -2
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +24 -0
- package/dist/commands/task/list.command.d.ts.map +1 -1
- package/dist/commands/task/list.command.js +4 -5
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +2 -1
- package/dist/commands/task/new.command.d.ts.map +1 -1
- package/dist/commands/task/new.command.js +2 -8
- package/dist/commands/task/rebuild-index.command.d.ts +6 -0
- package/dist/commands/task/rebuild-index.command.d.ts.map +1 -0
- package/dist/commands/task/rebuild-index.command.js +18 -0
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +15 -6
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +52 -4
- package/dist/commands/upgrade.d.ts +10 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +332 -91
- package/dist/policy/engine.d.ts +21 -0
- package/dist/policy/engine.d.ts.map +1 -0
- package/dist/policy/engine.js +32 -0
- package/dist/ports/clock-port.d.ts +4 -0
- package/dist/ports/clock-port.d.ts.map +1 -0
- package/dist/ports/clock-port.js +1 -0
- package/dist/ports/fs-port.d.ts +18 -0
- package/dist/ports/fs-port.d.ts.map +1 -0
- package/dist/ports/fs-port.js +1 -0
- package/dist/ports/git-port.d.ts +18 -0
- package/dist/ports/git-port.d.ts.map +1 -0
- package/dist/ports/git-port.js +1 -0
- package/dist/ports/task-backend-port.d.ts +8 -0
- package/dist/ports/task-backend-port.d.ts.map +1 -0
- package/dist/ports/task-backend-port.js +1 -0
- package/dist/usecases/context/resolve-context.d.ts +14 -0
- package/dist/usecases/context/resolve-context.d.ts.map +1 -0
- package/dist/usecases/context/resolve-context.js +13 -0
- package/dist/usecases/task/task-list-usecase.d.ts +9 -0
- package/dist/usecases/task/task-list-usecase.d.ts.map +1 -0
- package/dist/usecases/task/task-list-usecase.js +17 -0
- package/dist/usecases/task/task-new-usecase.d.ts +9 -0
- package/dist/usecases/task/task-new-usecase.d.ts.map +1 -0
- package/dist/usecases/task/task-new-usecase.js +17 -0
- package/package.json +2 -2
|
@@ -4,6 +4,7 @@ import { readdir } from "node:fs/promises";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { invalidValueForFlag, invalidValueMessage, missingValueMessage, warnMessage, } from "../../cli/output.js";
|
|
6
6
|
import { fileExists } from "../../cli/fs-utils.js";
|
|
7
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
7
8
|
import { CliError } from "../../shared/errors.js";
|
|
8
9
|
import { dedupeStrings } from "../../shared/strings.js";
|
|
9
10
|
import { parseGitLogHashSubject } from "../../shared/git-log.js";
|
|
@@ -269,7 +270,7 @@ export function parseTaskListFilters(args, opts) {
|
|
|
269
270
|
const next = args[i + 1];
|
|
270
271
|
if (!next) {
|
|
271
272
|
throw new CliError({
|
|
272
|
-
exitCode:
|
|
273
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
273
274
|
code: "E_USAGE",
|
|
274
275
|
message: missingValueMessage("--status"),
|
|
275
276
|
});
|
|
@@ -282,7 +283,7 @@ export function parseTaskListFilters(args, opts) {
|
|
|
282
283
|
const next = args[i + 1];
|
|
283
284
|
if (!next) {
|
|
284
285
|
throw new CliError({
|
|
285
|
-
exitCode:
|
|
286
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
286
287
|
code: "E_USAGE",
|
|
287
288
|
message: missingValueMessage("--owner"),
|
|
288
289
|
});
|
|
@@ -294,7 +295,11 @@ export function parseTaskListFilters(args, opts) {
|
|
|
294
295
|
if (arg === "--tag") {
|
|
295
296
|
const next = args[i + 1];
|
|
296
297
|
if (!next) {
|
|
297
|
-
throw new CliError({
|
|
298
|
+
throw new CliError({
|
|
299
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
300
|
+
code: "E_USAGE",
|
|
301
|
+
message: missingValueMessage("--tag"),
|
|
302
|
+
});
|
|
298
303
|
}
|
|
299
304
|
out.tag.push(next);
|
|
300
305
|
i++;
|
|
@@ -304,7 +309,7 @@ export function parseTaskListFilters(args, opts) {
|
|
|
304
309
|
const next = args[i + 1];
|
|
305
310
|
if (!next) {
|
|
306
311
|
throw new CliError({
|
|
307
|
-
exitCode:
|
|
312
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
308
313
|
code: "E_USAGE",
|
|
309
314
|
message: missingValueMessage("--limit"),
|
|
310
315
|
});
|
|
@@ -312,7 +317,7 @@ export function parseTaskListFilters(args, opts) {
|
|
|
312
317
|
const parsed = Number.parseInt(next, 10);
|
|
313
318
|
if (!Number.isFinite(parsed)) {
|
|
314
319
|
throw new CliError({
|
|
315
|
-
exitCode:
|
|
320
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
316
321
|
code: "E_USAGE",
|
|
317
322
|
message: invalidValueForFlag("--limit", next, "integer"),
|
|
318
323
|
});
|
|
@@ -322,7 +327,11 @@ export function parseTaskListFilters(args, opts) {
|
|
|
322
327
|
continue;
|
|
323
328
|
}
|
|
324
329
|
if (arg.startsWith("--")) {
|
|
325
|
-
throw new CliError({
|
|
330
|
+
throw new CliError({
|
|
331
|
+
exitCode: exitCodeForError("E_USAGE"),
|
|
332
|
+
code: "E_USAGE",
|
|
333
|
+
message: `Unknown flag: ${arg}`,
|
|
334
|
+
});
|
|
326
335
|
}
|
|
327
336
|
}
|
|
328
337
|
return out;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CA0JlD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,aAAa,CACsB,CAAC"}
|
|
@@ -4,8 +4,32 @@ export const upgradeSpec = {
|
|
|
4
4
|
id: ["upgrade"],
|
|
5
5
|
group: "Setup",
|
|
6
6
|
summary: "Upgrade the local agentplane framework bundle in the repo.",
|
|
7
|
-
description: "
|
|
7
|
+
description: "Upgrades the local agentplane framework bundle in the repo using a strict manifest of managed files. By default, upgrade generates an agent-assisted plan from the locally installed agentplane package assets (no network) and does not modify files. Use --auto to apply changes. Use --remote to fetch a GitHub release bundle; network access is gated by config approvals.",
|
|
8
8
|
options: [
|
|
9
|
+
{
|
|
10
|
+
kind: "boolean",
|
|
11
|
+
name: "agent",
|
|
12
|
+
default: false,
|
|
13
|
+
description: "Generate an agent-assisted upgrade plan (no files are modified). This is the default mode.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "boolean",
|
|
17
|
+
name: "auto",
|
|
18
|
+
default: false,
|
|
19
|
+
description: "Apply the upgrade automatically (writes managed files).",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
kind: "boolean",
|
|
23
|
+
name: "remote",
|
|
24
|
+
default: false,
|
|
25
|
+
description: "Fetch the framework bundle from GitHub releases (requires network approvals).",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
kind: "boolean",
|
|
29
|
+
name: "allow-tarball",
|
|
30
|
+
default: false,
|
|
31
|
+
description: "Allow falling back to a GitHub repo tarball when release assets are missing (no checksum verification).",
|
|
32
|
+
},
|
|
9
33
|
{
|
|
10
34
|
kind: "string",
|
|
11
35
|
name: "tag",
|
|
@@ -61,14 +85,27 @@ export const upgradeSpec = {
|
|
|
61
85
|
description: "Auto-approve network access prompts (subject to config approvals).",
|
|
62
86
|
},
|
|
63
87
|
],
|
|
88
|
+
validateRaw: (raw) => {
|
|
89
|
+
if (raw.opts.agent === true && raw.opts.auto === true) {
|
|
90
|
+
throw usageError({
|
|
91
|
+
spec: upgradeSpec,
|
|
92
|
+
command: "upgrade",
|
|
93
|
+
message: "Options --agent and --auto are mutually exclusive.",
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
},
|
|
64
97
|
examples: [
|
|
65
98
|
{
|
|
66
99
|
cmd: "agentplane upgrade",
|
|
67
|
-
why: "
|
|
100
|
+
why: "Generate an agent-assisted plan using locally installed assets (no network).",
|
|
68
101
|
},
|
|
69
102
|
{
|
|
70
|
-
cmd: "agentplane upgrade --
|
|
71
|
-
why: "
|
|
103
|
+
cmd: "agentplane upgrade --auto",
|
|
104
|
+
why: "Apply the upgrade automatically (writes managed files).",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
cmd: "agentplane upgrade --remote --tag v0.1.9 --dry-run",
|
|
108
|
+
why: "Preview changes for a specific GitHub release tag (no writes).",
|
|
72
109
|
},
|
|
73
110
|
{
|
|
74
111
|
cmd: "agentplane upgrade --bundle ./agentplane-upgrade.tar.gz --checksum ./agentplane-upgrade.tar.gz.sha256",
|
|
@@ -78,6 +115,9 @@ export const upgradeSpec = {
|
|
|
78
115
|
parse: (raw) => {
|
|
79
116
|
const noBackup = raw.opts["no-backup"] === true;
|
|
80
117
|
return {
|
|
118
|
+
mode: raw.opts.auto === true ? "auto" : "agent",
|
|
119
|
+
remote: raw.opts.remote === true,
|
|
120
|
+
allowTarball: raw.opts["allow-tarball"] === true,
|
|
81
121
|
source: raw.opts.source,
|
|
82
122
|
tag: raw.opts.tag,
|
|
83
123
|
bundle: raw.opts.bundle,
|
|
@@ -99,6 +139,14 @@ export const upgradeSpec = {
|
|
|
99
139
|
message: "Options --bundle and --checksum must be provided together (or omitted together).",
|
|
100
140
|
});
|
|
101
141
|
}
|
|
142
|
+
const hasRemoteHints = Boolean(p.source) || Boolean(p.tag) || Boolean(p.asset) || Boolean(p.checksumAsset);
|
|
143
|
+
if (!p.remote && hasRemoteHints && !hasBundle) {
|
|
144
|
+
throw usageError({
|
|
145
|
+
spec: upgradeSpec,
|
|
146
|
+
command: "upgrade",
|
|
147
|
+
message: "Remote upgrade options (--tag/--source/--asset/--checksum-asset) require --remote.",
|
|
148
|
+
});
|
|
149
|
+
}
|
|
102
150
|
},
|
|
103
151
|
};
|
|
104
152
|
export const runUpgrade = (ctx, flags) => cmdUpgradeParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, flags });
|
|
@@ -5,11 +5,15 @@ export type UpgradeFlags = {
|
|
|
5
5
|
checksum?: string;
|
|
6
6
|
asset?: string;
|
|
7
7
|
checksumAsset?: string;
|
|
8
|
+
mode: "agent" | "auto";
|
|
9
|
+
remote: boolean;
|
|
10
|
+
allowTarball: boolean;
|
|
8
11
|
dryRun: boolean;
|
|
9
12
|
backup: boolean;
|
|
10
13
|
yes: boolean;
|
|
11
14
|
};
|
|
12
15
|
type GitHubRelease = {
|
|
16
|
+
tag_name?: string;
|
|
13
17
|
assets?: {
|
|
14
18
|
name?: string;
|
|
15
19
|
browser_download_url?: string;
|
|
@@ -36,6 +40,12 @@ export declare function resolveUpgradeDownloadFromRelease(opts: {
|
|
|
36
40
|
kind: "tarball";
|
|
37
41
|
tarballUrl: string;
|
|
38
42
|
};
|
|
43
|
+
export declare function resolveRepoTarballUrl(opts: {
|
|
44
|
+
release: GitHubRelease;
|
|
45
|
+
owner: string;
|
|
46
|
+
repo: string;
|
|
47
|
+
explicitTag?: string;
|
|
48
|
+
}): string;
|
|
39
49
|
export declare function cmdUpgradeParsed(opts: {
|
|
40
50
|
cwd: string;
|
|
41
51
|
rootOverride?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAoCA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AA2DF,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,MAAM,GAAG;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,CAWA;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE;IACtD,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,GACG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAqB1C;AAUD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAgBT;AAkPD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6dlB"}
|