agentplane 0.2.21 → 0.2.23
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 +2 -1
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +27 -7
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +60 -12
- package/dist/cli/run-cli/commands/core.d.ts +2 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +32 -5
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-agents.js +33 -1
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +3 -1
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +47 -7
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +1 -3
- package/dist/cli/spec/docs-render.d.ts.map +1 -1
- package/dist/cli/spec/docs-render.js +13 -6
- package/dist/commands/backend/sync.command.d.ts +3 -2
- package/dist/commands/backend/sync.command.d.ts.map +1 -1
- package/dist/commands/backend/sync.command.js +13 -15
- package/dist/commands/pr/pr.command.d.ts +1 -1
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +15 -15
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +15 -18
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +14 -7
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +14 -2
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +6 -8
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +18 -23
- package/dist/commands/task/shared.d.ts +16 -1
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +54 -3
- package/dist/commands/task/start-ready.d.ts.map +1 -1
- package/dist/commands/task/start-ready.js +6 -15
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +18 -23
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +67 -19
- package/package.json +2 -2
- package/dist/cli/parse/lifecycle.d.ts +0 -64
- package/dist/cli/parse/lifecycle.d.ts.map +0 -1
- package/dist/cli/parse/lifecycle.js +0 -285
package/assets/AGENTS.md
CHANGED
|
@@ -137,7 +137,7 @@ Precedence:
|
|
|
137
137
|
|
|
138
138
|
## Framework Upgrade / Prompt Merge
|
|
139
139
|
|
|
140
|
-
`agentplane upgrade` is responsible for mechanical upgrades and safe merges.
|
|
140
|
+
`agentplane upgrade` is responsible for mechanical upgrades and safe merges. Treat prompt-merge as required only for unresolved semantic conflicts (for example, both local and incoming changes exist relative to a baseline and cannot be safely reconciled automatically, or merge parsing fails). If local files did not change relative to baseline, the upgrade may apply incoming framework updates without semantic review.
|
|
141
141
|
|
|
142
142
|
Trigger:
|
|
143
143
|
|
|
@@ -145,6 +145,7 @@ Trigger:
|
|
|
145
145
|
- Agent mode: `.agentplane/.upgrade/agent/<runId>/review.json`
|
|
146
146
|
- Auto mode: `.agentplane/.upgrade/last-review.json`
|
|
147
147
|
- If any record has `needsSemanticReview: true`, prompt merge is required.
|
|
148
|
+
- `needsSemanticReview: false` means the change was mechanically safe (including cases where local files were unchanged vs baseline and incoming updates were applied directly).
|
|
148
149
|
|
|
149
150
|
Protocol:
|
|
150
151
|
|
|
@@ -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,EA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CAAC;IAyExC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB1E,oBAAoB,CAAC,MAAM,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;IAoF/D,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzD"}
|
|
@@ -41,14 +41,15 @@ export class LocalBackend {
|
|
|
41
41
|
const entries = await readdir(this.root, { withFileTypes: true }).catch(() => []);
|
|
42
42
|
const indexPath = resolveTaskIndexPath(this.root);
|
|
43
43
|
const cachedIndex = await loadTaskIndex(indexPath);
|
|
44
|
-
const
|
|
44
|
+
const cachedEntryByPath = new Map();
|
|
45
45
|
if (cachedIndex) {
|
|
46
46
|
for (const [readmePath, taskId] of Object.entries(cachedIndex.byPath)) {
|
|
47
47
|
const entry = cachedIndex.byId[taskId];
|
|
48
48
|
if (entry)
|
|
49
|
-
|
|
49
|
+
cachedEntryByPath.set(readmePath, entry);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
let indexDirty = cachedIndex === null;
|
|
52
53
|
const nextById = {};
|
|
53
54
|
const nextByPath = {};
|
|
54
55
|
const seen = new Set();
|
|
@@ -68,10 +69,11 @@ export class LocalBackend {
|
|
|
68
69
|
}
|
|
69
70
|
if (!stats.isFile())
|
|
70
71
|
return null;
|
|
71
|
-
const cached =
|
|
72
|
+
const cached = cachedEntryByPath.get(readme);
|
|
72
73
|
if (cached?.mtimeMs === stats.mtimeMs) {
|
|
73
74
|
return { task: cached.task, index: cached, mtimeMs: stats.mtimeMs, readme };
|
|
74
75
|
}
|
|
76
|
+
indexDirty = true;
|
|
75
77
|
let text = "";
|
|
76
78
|
try {
|
|
77
79
|
text = await readFile(readme, "utf8");
|
|
@@ -115,11 +117,29 @@ export class LocalBackend {
|
|
|
115
117
|
nextByPath[entry.readmePath] = taskId;
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
if (cachedIndex && indexDirty === false) {
|
|
121
|
+
const cachedPaths = Object.keys(cachedIndex.byPath);
|
|
122
|
+
const nextPaths = Object.keys(nextByPath);
|
|
123
|
+
if (cachedPaths.length === nextPaths.length) {
|
|
124
|
+
for (const readmePath of nextPaths) {
|
|
125
|
+
if (cachedIndex.byPath[readmePath] === nextByPath[readmePath]) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
indexDirty = true;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
indexDirty = true;
|
|
134
|
+
}
|
|
120
135
|
}
|
|
121
|
-
|
|
122
|
-
|
|
136
|
+
if (indexDirty) {
|
|
137
|
+
try {
|
|
138
|
+
await saveTaskIndex(indexPath, { schema_version: 2, byId: nextById, byPath: nextByPath });
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// Best-effort cache; ignore failures.
|
|
142
|
+
}
|
|
123
143
|
}
|
|
124
144
|
return tasks;
|
|
125
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/command-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAoGvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EA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CAAC,CAAC;IACjF,eAAe,EAAE,CAAC,sBAAsB,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3E,kBAAkB,EAAE,MAAM,SAAS,QAAQ,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgBF,eAAO,MAAM,QAAQ,iyCAgeuB,CAAC"}
|
|
@@ -173,7 +173,11 @@ export const COMMANDS = [
|
|
|
173
173
|
entry(taskUpdateSpec, (deps) => import("../../commands/task/update.command.js").then((m) => m.makeRunTaskUpdateHandler(deps.getCtx))),
|
|
174
174
|
entry(taskCommentSpec, (deps) => import("../../commands/task/comment.command.js").then((m) => m.makeRunTaskCommentHandler(deps.getCtx))),
|
|
175
175
|
entry(taskSetStatusSpec, (deps) => import("../../commands/task/set-status.command.js").then((m) => m.makeRunTaskSetStatusHandler(deps.getCtx))),
|
|
176
|
-
entry(taskDocSpec, () => import("../../commands/task/doc.command.js").then((m) => m.runTaskDoc)
|
|
176
|
+
entry(taskDocSpec, () => import("../../commands/task/doc.command.js").then((m) => m.runTaskDoc), {
|
|
177
|
+
needsProject: false,
|
|
178
|
+
needsConfig: false,
|
|
179
|
+
needsTaskContext: false,
|
|
180
|
+
}),
|
|
177
181
|
entry(taskDocShowSpec, (deps) => import("../../commands/task/doc-show.command.js").then((m) => m.makeRunTaskDocShowHandler(deps.getCtx))),
|
|
178
182
|
entry(taskDocSetSpec, (deps) => import("../../commands/task/doc-set.command.js").then((m) => m.makeRunTaskDocSetHandler(deps.getCtx))),
|
|
179
183
|
entry(taskScrubSpec, (deps) => import("../../commands/task/scrub.command.js").then((m) => m.makeRunTaskScrubHandler(deps.getCtx))),
|
|
@@ -186,14 +190,26 @@ export const COMMANDS = [
|
|
|
186
190
|
entry(taskPlanSetSpec, (deps) => import("../../commands/task/plan-set.command.js").then((m) => m.makeRunTaskPlanSetHandler(deps.getCtx))),
|
|
187
191
|
entry(taskPlanApproveSpec, (deps) => import("../../commands/task/plan-approve.command.js").then((m) => m.makeRunTaskPlanApproveHandler(deps.getCtx))),
|
|
188
192
|
entry(taskPlanRejectSpec, (deps) => import("../../commands/task/plan-reject.command.js").then((m) => m.makeRunTaskPlanRejectHandler(deps.getCtx))),
|
|
189
|
-
entry(taskVerifySpec, () => import("../../commands/task/verify.command.js").then((m) => m.runTaskVerify)
|
|
193
|
+
entry(taskVerifySpec, () => import("../../commands/task/verify.command.js").then((m) => m.runTaskVerify), {
|
|
194
|
+
needsProject: false,
|
|
195
|
+
needsConfig: false,
|
|
196
|
+
needsTaskContext: false,
|
|
197
|
+
}),
|
|
190
198
|
entry(taskVerifyOkSpec, (deps) => import("../../commands/task/verify-ok.command.js").then((m) => m.makeRunTaskVerifyOkHandler(deps.getCtx))),
|
|
191
199
|
entry(taskVerifyReworkSpec, (deps) => import("../../commands/task/verify-rework.command.js").then((m) => m.makeRunTaskVerifyReworkHandler(deps.getCtx))),
|
|
192
200
|
entry(taskVerifyShowSpec, (deps) => import("../../commands/task/verify-show.command.js").then((m) => m.makeRunTaskVerifyShowHandler(deps.getCtx))),
|
|
193
201
|
entry(taskRebuildIndexSpec, (deps) => import("../../commands/task/rebuild-index.command.js").then((m) => m.makeRunTaskRebuildIndexHandler(deps.getCtx))),
|
|
194
202
|
entry(workStartSpec, (deps) => import("../../commands/branch/work-start.command.js").then((m) => m.makeRunWorkStartHandler(deps.getCtx))),
|
|
195
|
-
entry(recipesSpec, () => import("../../commands/recipes/recipes.command.js").then((m) => m.runRecipes)
|
|
196
|
-
|
|
203
|
+
entry(recipesSpec, () => import("../../commands/recipes/recipes.command.js").then((m) => m.runRecipes), {
|
|
204
|
+
needsProject: false,
|
|
205
|
+
needsConfig: false,
|
|
206
|
+
needsTaskContext: false,
|
|
207
|
+
}),
|
|
208
|
+
entry(recipesCacheSpec, () => import("../../commands/recipes/cache.command.js").then((m) => m.runRecipesCache), {
|
|
209
|
+
needsProject: false,
|
|
210
|
+
needsConfig: false,
|
|
211
|
+
needsTaskContext: false,
|
|
212
|
+
}),
|
|
197
213
|
entry(recipesListSpec, () => import("../../commands/recipes/list.command.js").then((m) => m.runRecipesList)),
|
|
198
214
|
entry(recipesListRemoteSpec, () => import("../../commands/recipes/list-remote.command.js").then((m) => m.runRecipesListRemote)),
|
|
199
215
|
entry(recipesInfoSpec, () => import("../../commands/recipes/info.command.js").then((m) => m.runRecipesInfo)),
|
|
@@ -201,21 +217,37 @@ export const COMMANDS = [
|
|
|
201
217
|
entry(recipesRemoveSpec, () => import("../../commands/recipes/remove.command.js").then((m) => m.runRecipesRemove)),
|
|
202
218
|
entry(recipesCachePruneSpec, () => import("../../commands/recipes/cache-prune.command.js").then((m) => m.runRecipesCachePrune)),
|
|
203
219
|
entry(recipesInstallSpec, () => import("../../commands/recipes/install.run.js").then((m) => m.runRecipesInstall)),
|
|
204
|
-
entry(scenarioSpec, () => import("../../commands/scenario/scenario.command.js").then((m) => m.runScenario)
|
|
220
|
+
entry(scenarioSpec, () => import("../../commands/scenario/scenario.command.js").then((m) => m.runScenario), {
|
|
221
|
+
needsProject: false,
|
|
222
|
+
needsConfig: false,
|
|
223
|
+
needsTaskContext: false,
|
|
224
|
+
}),
|
|
205
225
|
entry(scenarioListSpec, () => import("../../commands/scenario/list.command.js").then((m) => m.runScenarioList)),
|
|
206
226
|
entry(scenarioInfoSpec, () => import("../../commands/scenario/info.command.js").then((m) => m.runScenarioInfo)),
|
|
207
227
|
entry(scenarioRunSpec, () => import("../../commands/scenario/run.command.js").then((m) => m.runScenarioRun)),
|
|
208
|
-
entry(branchBaseSpec, () => import("../../commands/branch/base.command.js").then((m) => m.runBranchBase)
|
|
228
|
+
entry(branchBaseSpec, () => import("../../commands/branch/base.command.js").then((m) => m.runBranchBase), {
|
|
229
|
+
needsProject: false,
|
|
230
|
+
needsConfig: false,
|
|
231
|
+
needsTaskContext: false,
|
|
232
|
+
}),
|
|
209
233
|
entry(branchBaseGetSpec, () => import("../../commands/branch/base.command.js").then((m) => m.runBranchBaseGet)),
|
|
210
234
|
entry(branchBaseSetSpec, () => import("../../commands/branch/base.command.js").then((m) => m.runBranchBaseSet)),
|
|
211
235
|
entry(branchBaseClearSpec, () => import("../../commands/branch/base.command.js").then((m) => m.runBranchBaseClear)),
|
|
212
236
|
entry(branchBaseExplainSpec, () => import("../../commands/branch/base.command.js").then((m) => m.runBranchBaseExplain)),
|
|
213
237
|
entry(branchStatusSpec, () => import("../../commands/branch/status.command.js").then((m) => m.runBranchStatus)),
|
|
214
238
|
entry(branchRemoveSpec, () => import("../../commands/branch/remove.command.js").then((m) => m.runBranchRemove)),
|
|
215
|
-
entry(backendSpec, (deps) => import("../../commands/backend/sync.command.js").then((m) => m.makeRunBackendHandler(deps.getCtx))
|
|
239
|
+
entry(backendSpec, (deps) => import("../../commands/backend/sync.command.js").then((m) => m.makeRunBackendHandler(deps.getCtx)), {
|
|
240
|
+
needsProject: false,
|
|
241
|
+
needsConfig: false,
|
|
242
|
+
needsTaskContext: false,
|
|
243
|
+
}),
|
|
216
244
|
entry(backendSyncSpec, (deps) => import("../../commands/backend/sync.command.js").then((m) => m.makeRunBackendSyncHandler(deps.getCtx))),
|
|
217
245
|
entry(syncSpec, (deps) => import("../../commands/sync.command.js").then((m) => m.makeRunSyncHandler(deps.getCtx))),
|
|
218
|
-
entry(prSpec, (deps) => import("../../commands/pr/pr.command.js").then((m) => m.makeRunPrHandler(deps.getCtx))
|
|
246
|
+
entry(prSpec, (deps) => import("../../commands/pr/pr.command.js").then((m) => m.makeRunPrHandler(deps.getCtx)), {
|
|
247
|
+
needsProject: false,
|
|
248
|
+
needsConfig: false,
|
|
249
|
+
needsTaskContext: false,
|
|
250
|
+
}),
|
|
219
251
|
entry(prOpenSpec, (deps) => import("../../commands/pr/pr.command.js").then((m) => m.makeRunPrOpenHandler(deps.getCtx))),
|
|
220
252
|
entry(prUpdateSpec, (deps) => import("../../commands/pr/pr.command.js").then((m) => m.makeRunPrUpdateHandler(deps.getCtx))),
|
|
221
253
|
entry(prCheckSpec, (deps) => import("../../commands/pr/pr.command.js").then((m) => m.makeRunPrCheckHandler(deps.getCtx))),
|
|
@@ -227,14 +259,30 @@ export const COMMANDS = [
|
|
|
227
259
|
entry(verifySpec, (deps) => import("../../commands/verify.run.js").then((m) => m.makeRunVerifyHandler(deps.getCtx))),
|
|
228
260
|
entry(finishSpec, (deps) => import("../../commands/finish.run.js").then((m) => m.makeRunFinishHandler(deps.getCtx))),
|
|
229
261
|
entry(readySpec, (deps) => import("../../commands/ready.command.js").then((m) => m.makeRunReadyHandler(deps.getCtx))),
|
|
230
|
-
entry(docsCliSpec, (deps) => import("../../commands/docs/cli.command.js").then((m) => m.makeRunDocsCliHandler(deps.getHelpJsonForDocs))
|
|
231
|
-
|
|
262
|
+
entry(docsCliSpec, (deps) => import("../../commands/docs/cli.command.js").then((m) => m.makeRunDocsCliHandler(deps.getHelpJsonForDocs)), {
|
|
263
|
+
needsProject: false,
|
|
264
|
+
needsConfig: false,
|
|
265
|
+
needsTaskContext: false,
|
|
266
|
+
}),
|
|
267
|
+
entry(hooksSpec, () => import("../../commands/hooks/hooks.command.js").then((m) => m.runHooks), {
|
|
268
|
+
needsProject: false,
|
|
269
|
+
needsConfig: false,
|
|
270
|
+
needsTaskContext: false,
|
|
271
|
+
}),
|
|
232
272
|
entry(hooksInstallSpec, () => import("../../commands/hooks/install.command.js").then((m) => m.runHooksInstall)),
|
|
233
273
|
entry(hooksUninstallSpec, () => import("../../commands/hooks/uninstall.command.js").then((m) => m.runHooksUninstall)),
|
|
234
274
|
entry(hooksRunSpec, () => import("../../commands/hooks/run.command.js").then((m) => m.runHooksRun)),
|
|
235
|
-
entry(cleanupSpec, () => import("../../commands/cleanup/merged.command.js").then((m) => m.runCleanup)
|
|
275
|
+
entry(cleanupSpec, () => import("../../commands/cleanup/merged.command.js").then((m) => m.runCleanup), {
|
|
276
|
+
needsProject: false,
|
|
277
|
+
needsConfig: false,
|
|
278
|
+
needsTaskContext: false,
|
|
279
|
+
}),
|
|
236
280
|
entry(cleanupMergedSpec, (deps) => import("../../commands/cleanup/merged.command.js").then((m) => m.makeRunCleanupMergedHandler(deps.getCtx))),
|
|
237
|
-
entry(guardSpec, () => import("../../commands/guard/guard.command.js").then((m) => m.runGuard)
|
|
281
|
+
entry(guardSpec, () => import("../../commands/guard/guard.command.js").then((m) => m.runGuard), {
|
|
282
|
+
needsProject: false,
|
|
283
|
+
needsConfig: false,
|
|
284
|
+
needsTaskContext: false,
|
|
285
|
+
}),
|
|
238
286
|
entry(guardCleanSpec, () => import("../../commands/guard/clean.command.js").then((m) => m.runGuardClean)),
|
|
239
287
|
entry(guardSuggestAllowSpec, () => import("../../commands/guard/suggest-allow.command.js").then((m) => m.runGuardSuggestAllow)),
|
|
240
288
|
entry(guardCommitSpec, (deps) => import("../../commands/guard/commit.command.js").then((m) => m.makeRunGuardCommitHandler(deps.getCtx))),
|
|
@@ -5,8 +5,10 @@ type QuickstartParsed = {
|
|
|
5
5
|
};
|
|
6
6
|
export declare const quickstartSpec: CommandSpec<QuickstartParsed>;
|
|
7
7
|
export declare const runQuickstart: CommandHandler<QuickstartParsed>;
|
|
8
|
+
type PreflightMode = "quick" | "full";
|
|
8
9
|
type PreflightParsed = {
|
|
9
10
|
json: boolean;
|
|
11
|
+
mode: PreflightMode;
|
|
10
12
|
};
|
|
11
13
|
export declare const preflightSpec: CommandSpec<PreflightParsed>;
|
|
12
14
|
export declare const runPreflight: CommandHandler<PreflightParsed>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-c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,WAAW,CAAC,UAAU,CAe5C,CAAC;AAoOF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,UAAU,CAE9C,CAAC;AAEF,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAMhD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAAC,YAAY,CAAC,CA0FhF"}
|
|
@@ -129,9 +129,9 @@ async function buildPreflightReport(opts) {
|
|
|
129
129
|
}
|
|
130
130
|
let taskListLoaded = {
|
|
131
131
|
ok: false,
|
|
132
|
-
error: "project not resolved",
|
|
132
|
+
error: opts.mode === "quick" ? "skipped in quick mode" : "project not resolved",
|
|
133
133
|
};
|
|
134
|
-
if (resolved) {
|
|
134
|
+
if (opts.mode === "full" && resolved) {
|
|
135
135
|
try {
|
|
136
136
|
const loaded = await loadTaskBackend({
|
|
137
137
|
cwd: opts.cwd,
|
|
@@ -189,6 +189,7 @@ async function buildPreflightReport(opts) {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
return {
|
|
192
|
+
mode: opts.mode,
|
|
192
193
|
project_detected: resolved !== null,
|
|
193
194
|
config_loaded: configLoaded,
|
|
194
195
|
quickstart_loaded: quickstartLoaded,
|
|
@@ -206,6 +207,20 @@ export const preflightSpec = {
|
|
|
206
207
|
group: "Core",
|
|
207
208
|
summary: "Run aggregated preflight checks and print a deterministic readiness report.",
|
|
208
209
|
options: [
|
|
210
|
+
{
|
|
211
|
+
kind: "string",
|
|
212
|
+
name: "mode",
|
|
213
|
+
valueHint: "<quick|full>",
|
|
214
|
+
choices: ["quick", "full"],
|
|
215
|
+
default: "quick",
|
|
216
|
+
description: "Preflight depth. quick skips backend task-list probe; full includes backend readiness.",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
kind: "boolean",
|
|
220
|
+
name: "full",
|
|
221
|
+
default: false,
|
|
222
|
+
description: "Shortcut for --mode full.",
|
|
223
|
+
},
|
|
209
224
|
{
|
|
210
225
|
kind: "boolean",
|
|
211
226
|
name: "json",
|
|
@@ -215,17 +230,29 @@ export const preflightSpec = {
|
|
|
215
230
|
],
|
|
216
231
|
examples: [
|
|
217
232
|
{ cmd: "agentplane preflight --json", why: "Produce one-shot agent-readable preflight." },
|
|
233
|
+
{
|
|
234
|
+
cmd: "agentplane preflight --json --mode full",
|
|
235
|
+
why: "Run full preflight including backend task-list probe.",
|
|
236
|
+
},
|
|
218
237
|
],
|
|
219
|
-
parse: (raw) => ({
|
|
238
|
+
parse: (raw) => ({
|
|
239
|
+
json: raw.opts.json === true,
|
|
240
|
+
mode: raw.opts.full === true ? "full" : (raw.opts.mode ?? "quick"),
|
|
241
|
+
}),
|
|
220
242
|
};
|
|
221
243
|
async function cmdPreflight(opts) {
|
|
222
244
|
return wrapCommand({ command: "preflight", rootOverride: opts.rootOverride }, async () => {
|
|
223
|
-
const report = await buildPreflightReport({
|
|
245
|
+
const report = await buildPreflightReport({
|
|
246
|
+
cwd: opts.cwd,
|
|
247
|
+
rootOverride: opts.rootOverride,
|
|
248
|
+
mode: opts.mode,
|
|
249
|
+
});
|
|
224
250
|
if (opts.json) {
|
|
225
251
|
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
226
252
|
return 0;
|
|
227
253
|
}
|
|
228
254
|
process.stdout.write("Preflight Summary\n");
|
|
255
|
+
process.stdout.write(`- mode: ${report.mode}\n`);
|
|
229
256
|
process.stdout.write(`- project detected: ${report.project_detected ? "yes" : "no"}\n`);
|
|
230
257
|
process.stdout.write(`- config loaded: ${probeYesNo(report.config_loaded)}\n`);
|
|
231
258
|
process.stdout.write(`- quickstart loaded: ${probeYesNo(report.quickstart_loaded)}\n`);
|
|
@@ -248,7 +275,7 @@ async function cmdPreflight(opts) {
|
|
|
248
275
|
});
|
|
249
276
|
}
|
|
250
277
|
export const runPreflight = (ctx, p) => {
|
|
251
|
-
return cmdPreflight({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, json: p.json });
|
|
278
|
+
return cmdPreflight({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, json: p.json, mode: p.mode });
|
|
252
279
|
};
|
|
253
280
|
export const roleSpec = {
|
|
254
281
|
id: ["role"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-agents.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"write-agents.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-agents.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAkC1E,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,YAAY,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAuCtC"}
|
|
@@ -1,13 +1,37 @@
|
|
|
1
|
+
import { mkdir, readFile } from "node:fs/promises";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { atomicWriteFile } from "@agentplaneorg/core";
|
|
3
4
|
import { filterAgentsByWorkflow, loadAgentTemplates, loadAgentsTemplate, } from "../../../../agents/agents-template.js";
|
|
4
5
|
import { fileExists } from "../../../fs-utils.js";
|
|
6
|
+
function toUpgradeBaselineKey(repoRelativePath) {
|
|
7
|
+
if (repoRelativePath === "AGENTS.md")
|
|
8
|
+
return "AGENTS.md";
|
|
9
|
+
if (repoRelativePath.startsWith(".agentplane/")) {
|
|
10
|
+
return repoRelativePath.slice(".agentplane/".length);
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
async function seedUpgradeBaselineForInstalledFiles(opts) {
|
|
15
|
+
const baselineDir = path.join(opts.agentplaneDir, ".upgrade", "baseline");
|
|
16
|
+
for (const relPath of opts.repoRelativePaths) {
|
|
17
|
+
const normalizedRel = relPath.replaceAll("\\", "/");
|
|
18
|
+
const baselineKey = toUpgradeBaselineKey(normalizedRel);
|
|
19
|
+
if (!baselineKey)
|
|
20
|
+
continue;
|
|
21
|
+
const srcPath = path.join(opts.gitRoot, normalizedRel);
|
|
22
|
+
const contents = await readFile(srcPath);
|
|
23
|
+
const baselinePath = path.join(baselineDir, baselineKey);
|
|
24
|
+
await mkdir(path.dirname(baselinePath), { recursive: true });
|
|
25
|
+
await atomicWriteFile(baselinePath, contents);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
5
28
|
export async function ensureAgentsFiles(opts) {
|
|
6
29
|
const agentsPath = path.join(opts.gitRoot, "AGENTS.md");
|
|
7
30
|
const installPaths = [
|
|
8
31
|
path.relative(opts.gitRoot, opts.configPathAbs),
|
|
9
32
|
path.relative(opts.gitRoot, opts.backendPathAbs),
|
|
10
33
|
];
|
|
34
|
+
const installedManagedPaths = [];
|
|
11
35
|
let wroteAgents = false;
|
|
12
36
|
if (await fileExists(agentsPath)) {
|
|
13
37
|
// nothing
|
|
@@ -20,6 +44,7 @@ export async function ensureAgentsFiles(opts) {
|
|
|
20
44
|
}
|
|
21
45
|
if (wroteAgents) {
|
|
22
46
|
installPaths.push(path.relative(opts.gitRoot, agentsPath));
|
|
47
|
+
installedManagedPaths.push("AGENTS.md");
|
|
23
48
|
}
|
|
24
49
|
const agentTemplates = await loadAgentTemplates();
|
|
25
50
|
for (const agent of agentTemplates) {
|
|
@@ -27,7 +52,14 @@ export async function ensureAgentsFiles(opts) {
|
|
|
27
52
|
if (await fileExists(targetPath))
|
|
28
53
|
continue;
|
|
29
54
|
await atomicWriteFile(targetPath, agent.contents, "utf8");
|
|
30
|
-
|
|
55
|
+
const relPath = path.relative(opts.gitRoot, targetPath);
|
|
56
|
+
installPaths.push(relPath);
|
|
57
|
+
installedManagedPaths.push(relPath);
|
|
31
58
|
}
|
|
59
|
+
await seedUpgradeBaselineForInstalledFiles({
|
|
60
|
+
gitRoot: opts.gitRoot,
|
|
61
|
+
agentplaneDir: opts.agentplaneDir,
|
|
62
|
+
repoRelativePaths: installedManagedPaths,
|
|
63
|
+
});
|
|
32
64
|
return { installPaths };
|
|
33
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-config.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-config.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,cAAc,GAAG,UAAU,GAAG,YAAY,CAAC;IACpD,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,yCAAyC,EAAE,MAAM,EAAE,CAAC;CACrD,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"write-config.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-config.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,cAAc,GAAG,UAAU,GAAG,YAAY,CAAC;IACpD,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,yCAAyC,EAAE,MAAM,EAAE,CAAC;CACrD,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB"}
|
|
@@ -14,7 +14,9 @@ export async function writeInitConfig(opts) {
|
|
|
14
14
|
const rawConfig = defaultConfig();
|
|
15
15
|
setByDottedKey(rawConfig, "workflow_mode", opts.workflow);
|
|
16
16
|
setByDottedKey(rawConfig, "status_commit_policy", opts.workflow === "branch_pr" ? "confirm" : "warn");
|
|
17
|
-
setByDottedKey(rawConfig, "
|
|
17
|
+
setByDottedKey(rawConfig, "commit_automation", "finish_only");
|
|
18
|
+
// Keep status commits explicit by default in all modes to reduce commit noise.
|
|
19
|
+
setByDottedKey(rawConfig, "finish_auto_status_commit", "false");
|
|
18
20
|
setByDottedKey(rawConfig, "tasks_backend.config_path", path.relative(opts.gitRoot, opts.backendConfigPathAbs));
|
|
19
21
|
setByDottedKey(rawConfig, "agents.approvals.require_plan", String(opts.requirePlanApproval));
|
|
20
22
|
setByDottedKey(rawConfig, "agents.approvals.require_network", String(opts.requireNetworkApproval));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/commands/init.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAa7B,KAAK,SAAS,GAAG;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACtC,QAAQ,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAA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C,UAAU,CACmB,CAAC"}
|
|
@@ -18,6 +18,32 @@ import { ensureAgentsFiles } from "./init/write-agents.js";
|
|
|
18
18
|
import { ensureInitGitignore } from "./init/write-gitignore.js";
|
|
19
19
|
import { ensureInitRedmineEnvTemplate } from "./init/write-env.js";
|
|
20
20
|
import { renderInitSection, renderInitWelcome } from "./init/ui.js";
|
|
21
|
+
const setupProfilePresets = {
|
|
22
|
+
prod: {
|
|
23
|
+
mode: "prod",
|
|
24
|
+
description: "Production bootstrap: compact flow with default managed-file and approval settings.",
|
|
25
|
+
defaultHooks: false,
|
|
26
|
+
defaultStrictUnsafeConfirm: false,
|
|
27
|
+
},
|
|
28
|
+
"prod-strict": {
|
|
29
|
+
mode: "prod",
|
|
30
|
+
description: "Production bootstrap + strict defaults for safer installs (hooks on, strict unsafe confirmations).",
|
|
31
|
+
defaultHooks: true,
|
|
32
|
+
defaultStrictUnsafeConfirm: true,
|
|
33
|
+
},
|
|
34
|
+
dev: {
|
|
35
|
+
mode: "dev",
|
|
36
|
+
description: "Developer bootstrap: full questionnaire for every init aspect.",
|
|
37
|
+
defaultHooks: false,
|
|
38
|
+
defaultStrictUnsafeConfirm: false,
|
|
39
|
+
},
|
|
40
|
+
"dev-safe": {
|
|
41
|
+
mode: "dev",
|
|
42
|
+
description: "Developer bootstrap with explicit unsafe-action confirmation by default.",
|
|
43
|
+
defaultHooks: false,
|
|
44
|
+
defaultStrictUnsafeConfirm: true,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
21
47
|
function parseBooleanValueForInit(flag, value) {
|
|
22
48
|
const normalized = value.trim().toLowerCase();
|
|
23
49
|
if (["1", "true", "yes", "y", "on"].includes(normalized))
|
|
@@ -50,7 +76,7 @@ export const initSpec = {
|
|
|
50
76
|
name: "setup-profile",
|
|
51
77
|
valueHint: "<prod|dev>",
|
|
52
78
|
choices: ["prod", "dev"],
|
|
53
|
-
description: "Interactive preset. prod asks only essential questions; dev asks the full setup questionnaire.",
|
|
79
|
+
description: "Interactive preset. prod is the default and asks only essential questions; dev asks the full setup questionnaire.",
|
|
54
80
|
},
|
|
55
81
|
{
|
|
56
82
|
kind: "string",
|
|
@@ -235,6 +261,7 @@ async function cmdInit(opts) {
|
|
|
235
261
|
let executionProfile = flags.executionProfile ?? defaults.executionProfile;
|
|
236
262
|
let strictUnsafeConfirm = flags.strictUnsafeConfirm ?? defaults.strictUnsafeConfirm;
|
|
237
263
|
let setupProfile = flags.setupProfile ?? "prod";
|
|
264
|
+
let setupProfilePreset = flags.setupProfile ?? "prod";
|
|
238
265
|
const isInteractive = process.stdin.isTTY && !flags.yes;
|
|
239
266
|
if (!process.stdin.isTTY &&
|
|
240
267
|
!flags.yes &&
|
|
@@ -266,11 +293,24 @@ async function cmdInit(opts) {
|
|
|
266
293
|
return result;
|
|
267
294
|
};
|
|
268
295
|
process.stdout.write(renderInitWelcome());
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
296
|
+
const presetLines = Object.entries(setupProfilePresets).map(([id, preset]) => `- ${id}: ${preset.description}`);
|
|
297
|
+
process.stdout.write(renderInitSection("Setup Preset", "Choose a bootstrap preset. It controls what questions are shown and safe defaults used."));
|
|
298
|
+
process.stdout.write(`${presetLines.join("\n")}\n\n`);
|
|
299
|
+
if (flags.setupProfile) {
|
|
300
|
+
setupProfilePreset = flags.setupProfile;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
const selected = await askChoice("Setup preset", ["prod", "prod-strict", "dev", "dev-safe"], "prod");
|
|
304
|
+
setupProfilePreset = selected;
|
|
305
|
+
}
|
|
306
|
+
const selectedPreset = setupProfilePresets[setupProfilePreset];
|
|
307
|
+
setupProfile = selectedPreset.mode;
|
|
308
|
+
if (flags.hooks === undefined)
|
|
309
|
+
hooks = selectedPreset.defaultHooks;
|
|
310
|
+
if (flags.strictUnsafeConfirm === undefined) {
|
|
311
|
+
strictUnsafeConfirm = selectedPreset.defaultStrictUnsafeConfirm;
|
|
272
312
|
}
|
|
273
|
-
process.stdout.write(renderInitSection("Workflow", "Choose how
|
|
313
|
+
process.stdout.write(renderInitSection("Workflow", "Choose how this repository will be orchestrated: direct means one branch, branch_pr means PR-first tasks."));
|
|
274
314
|
ide = flags.ide ?? defaults.ide;
|
|
275
315
|
if (!flags.workflow && setupProfile === "dev") {
|
|
276
316
|
const choice = await askChoice("Workflow mode", ["direct", "branch_pr"], workflow);
|
|
@@ -314,13 +354,13 @@ async function cmdInit(opts) {
|
|
|
314
354
|
}
|
|
315
355
|
}
|
|
316
356
|
else {
|
|
317
|
-
hooks = flags.hooks ??
|
|
357
|
+
hooks = flags.hooks ?? selectedPreset.defaultHooks;
|
|
318
358
|
recipes = flags.recipes ?? defaults.recipes;
|
|
319
359
|
requirePlanApproval = flags.requirePlanApproval ?? defaults.requirePlanApproval;
|
|
320
360
|
requireNetworkApproval = flags.requireNetworkApproval ?? defaults.requireNetworkApproval;
|
|
321
361
|
requireVerifyApproval = flags.requireVerifyApproval ?? defaults.requireVerifyApproval;
|
|
322
362
|
executionProfile = flags.executionProfile ?? defaults.executionProfile;
|
|
323
|
-
strictUnsafeConfirm = flags.strictUnsafeConfirm ??
|
|
363
|
+
strictUnsafeConfirm = flags.strictUnsafeConfirm ?? selectedPreset.defaultStrictUnsafeConfirm;
|
|
324
364
|
process.stdout.write(renderInitSection("Defaults Applied", "Using compact prod defaults for hooks, approvals, execution profile, and recipes."));
|
|
325
365
|
}
|
|
326
366
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-cli.d.ts","sourceRoot":"","sources":["../../src/cli/run-cli.ts"],"names":[],"mappings":"AAibA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"run-cli.d.ts","sourceRoot":"","sources":["../../src/cli/run-cli.ts"],"names":[],"mappings":"AAibA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAiL5D"}
|
package/dist/cli/run-cli.js
CHANGED
|
@@ -404,9 +404,6 @@ export async function runCli(argv) {
|
|
|
404
404
|
const resolved = matched?.entry.needsProject === false
|
|
405
405
|
? null
|
|
406
406
|
: await maybeResolveProject({ cwd, rootOverride: globals.root });
|
|
407
|
-
if (resolved) {
|
|
408
|
-
await loadDotEnv(resolved.gitRoot);
|
|
409
|
-
}
|
|
410
407
|
let projectPromise = resolved
|
|
411
408
|
? Promise.resolve(resolved)
|
|
412
409
|
: null;
|
|
@@ -423,6 +420,7 @@ export async function runCli(argv) {
|
|
|
423
420
|
const getLoadedConfig = async (commandForErrorContext) => {
|
|
424
421
|
configPromise ??= (async () => {
|
|
425
422
|
const project = await getResolvedProject(commandForErrorContext);
|
|
423
|
+
await loadDotEnv(project.gitRoot);
|
|
426
424
|
return await loadConfig(project.agentplaneDir);
|
|
427
425
|
})();
|
|
428
426
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-render.d.ts","sourceRoot":"","sources":["../../../src/cli/spec/docs-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"docs-render.d.ts","sourceRoot":"","sources":["../../../src/cli/spec/docs-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAmCjD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,MAAM,CAsGnE"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
function
|
|
1
|
+
function escCode(text) {
|
|
2
2
|
return text.replaceAll("`", "\\`");
|
|
3
3
|
}
|
|
4
|
+
function escText(text) {
|
|
5
|
+
return text
|
|
6
|
+
.replaceAll("&", "&")
|
|
7
|
+
.replaceAll("<", "<")
|
|
8
|
+
.replaceAll(">", ">")
|
|
9
|
+
.replaceAll("`", "\\`");
|
|
10
|
+
}
|
|
4
11
|
function toAnchor(text) {
|
|
5
12
|
return text
|
|
6
13
|
.toLowerCase()
|
|
@@ -49,8 +56,8 @@ export function renderCliDocsMdx(specs) {
|
|
|
49
56
|
const groupHeader = ["", `## ${group}`];
|
|
50
57
|
const commandBlocks = specs.flatMap((s) => {
|
|
51
58
|
const summaryLines = s.description
|
|
52
|
-
? ["",
|
|
53
|
-
: ["",
|
|
59
|
+
? ["", escText(s.summary), "", escText(s.description)]
|
|
60
|
+
: ["", escText(s.summary)];
|
|
54
61
|
const usageLines = ["", "Usage:", "", "```text", ...(s.usage ?? []), "```"];
|
|
55
62
|
const visibleOpts = (s.options ?? []).filter((o) => !o.hidden);
|
|
56
63
|
const optionLines = visibleOpts.length === 0
|
|
@@ -73,11 +80,11 @@ export function renderCliDocsMdx(specs) {
|
|
|
73
80
|
o.deprecated ? `deprecated=${o.deprecated}` : null,
|
|
74
81
|
].filter((x) => x !== null);
|
|
75
82
|
const suffix = meta.length > 0 ? ` (${meta.join(", ")})` : "";
|
|
76
|
-
return `- \`${
|
|
83
|
+
return `- \`${escCode(head)}\`: ${escText(o.description)}${escText(suffix)}`;
|
|
77
84
|
}),
|
|
78
85
|
];
|
|
79
86
|
const notesLines = s.notes && s.notes.length > 0
|
|
80
|
-
? ["", "Notes:", "", ...s.notes.map((n) => `- ${
|
|
87
|
+
? ["", "Notes:", "", ...s.notes.map((n) => `- ${escText(n)}`)]
|
|
81
88
|
: [];
|
|
82
89
|
const examplesLines = s.examples && s.examples.length > 0
|
|
83
90
|
? [
|
|
@@ -85,7 +92,7 @@ export function renderCliDocsMdx(specs) {
|
|
|
85
92
|
"Examples:",
|
|
86
93
|
"",
|
|
87
94
|
...s.examples.flatMap((ex) => {
|
|
88
|
-
const why = ex.why ? [`- ${
|
|
95
|
+
const why = ex.why ? [`- ${escText(ex.why)}`] : [];
|
|
89
96
|
return ["```sh", ex.cmd, "```", ...why];
|
|
90
97
|
}),
|
|
91
98
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CommandCtx,
|
|
1
|
+
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
2
|
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
3
|
import { type BackendSyncParsed } from "../backend.js";
|
|
4
4
|
type BackendRootParsed = {
|
|
@@ -6,7 +6,8 @@ type BackendRootParsed = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const backendSpec: CommandSpec<BackendRootParsed>;
|
|
8
8
|
export declare const backendSyncSpec: CommandSpec<BackendSyncParsed>;
|
|
9
|
-
|
|
9
|
+
declare function runBackendRootGroup(_ctx: CommandCtx, p: BackendRootParsed): Promise<number>;
|
|
10
|
+
export declare function makeRunBackendHandler(_getCtx: (cmd: string) => Promise<CommandContext>): typeof runBackendRootGroup;
|
|
10
11
|
export declare function makeRunBackendSyncHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: BackendSyncParsed) => Promise<number>;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=sync.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.command.d.ts","sourceRoot":"","sources":["../../../src/commands/backend/sync.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"sync.command.d.ts","sourceRoot":"","sources":["../../../src/commands/backend/sync.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE7E,KAAK,iBAAiB,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE3C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,iBAAiB,CAQtD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,iBAAiB,CAuC1D,CAAC;AAEF,iBAAS,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAUpF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,8BAEtF;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC1E,KAAK,UAAU,EAAE,GAAG,iBAAiB,KAAG,OAAO,CAAC,MAAM,CAAC,CAStE"}
|