@unbrained/pm-cli 2026.8.7 → 2026.8.8
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +35 -0
- package/dist/cli/main.js +4 -3
- package/dist/cli/register-annotations.d.ts +11 -0
- package/dist/cli/register-annotations.js +195 -0
- package/dist/cli/register-history-author.js +7 -30
- package/dist/cli/register-mutation.js +25 -206
- package/dist/cli/runtime-compatibility-boundary.d.ts +17 -0
- package/dist/cli/runtime-compatibility-boundary.js +43 -0
- package/dist/cli-bundle/bundle-manifest.json +155 -691
- package/dist/cli-bundle/chunks/chunk-2ZMXX3Q6.js +2068 -0
- package/dist/cli-bundle/chunks/chunk-ALDHXLPS.js +3 -0
- package/dist/cli-bundle/chunks/chunk-CBLA33YK.js +8 -0
- package/dist/cli-bundle/chunks/chunk-GKA54IJM.js +5 -0
- package/dist/cli-bundle/chunks/chunk-KRY7SRUO.js +2 -0
- package/dist/cli-bundle/chunks/chunk-MNJ4NNSY.js +26 -0
- package/dist/cli-bundle/chunks/chunk-NUXRRNAB.js +77 -0
- package/dist/cli-bundle/chunks/chunk-OJPCFDDY.js +13 -0
- package/dist/cli-bundle/chunks/chunk-PFSD3DAN.js +194 -0
- package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SQ7QZFQ6.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-FJZCJ67O.js → register-list-query-WFZAMJHZ.js} +8 -8
- package/dist/cli-bundle/chunks/register-mutation-SOKKOTHQ.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-5XQETS6E.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-2HL5ZHMK.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-54EU2UVO.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-VZFU2R4M.js → chunk-5FLBTZJQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5GJ57YKN.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-HNL6IFGS.js → chunk-ANTMGYLI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-CMDS3KYT.js +14 -0
- package/dist/cli-bundle/focused-chunks/{chunk-NBJKQP4S.js → chunk-DMKOMTTY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CIXVQPB7.js → chunk-F5B3HBEZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-R2LEMEV5.js → chunk-FI6DWU2M.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-3K4XV2BF.js → chunk-FNOKJG6N.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-RW5IYD4J.js → chunk-FPDYXZBK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QHRTT7WT.js → chunk-GWI6YIKJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MHMTKV5V.js → chunk-HCUC62AB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MOTJFQ3F.js → chunk-HGNKPSCB.js} +12 -12
- package/dist/cli-bundle/focused-chunks/{chunk-4VJQTS3P.js → chunk-IAS7PMLG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TIKDBG4D.js → chunk-PL2EYDJK.js} +27 -27
- package/dist/cli-bundle/focused-chunks/chunk-SM2PJGP3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RPNYG5MO.js → chunk-TCSAPH33.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-U646T7Z6.js +18 -0
- package/dist/cli-bundle/focused-chunks/chunk-YKPE4PPY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-YZEZAPJK.js → chunk-YSAHYUXX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-73JUDYXT.js → chunk-ZOLDTUU7.js} +2 -2
- package/dist/cli-bundle/main.js +13 -13
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +38 -38
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +1 -1
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -1
- package/dist/cli.js +14 -4
- package/dist/core/output/output.js +9 -2
- package/dist/core/sentry/helpers.d.ts +10 -0
- package/dist/core/sentry/helpers.js +59 -4
- package/dist/core/shared/constants.d.ts +2 -0
- package/dist/core/shared/constants.js +4 -2
- package/dist/sdk/annotations.d.ts +40 -0
- package/dist/sdk/annotations.js +61 -9
- package/dist/sdk/author-attribution.d.ts +12 -0
- package/dist/sdk/author-attribution.js +73 -11
- package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +118 -0
- package/dist/sdk/cli-contracts/command-exit-contracts.js +152 -0
- package/dist/sdk/cli-contracts/completeness.js +5 -3
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +11 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +29 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -2
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +6 -3
- package/dist/sdk/comments.d.ts +7 -0
- package/dist/sdk/comments.js +2 -2
- package/dist/sdk/completion.js +9 -5
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/environment/host-environment-errors.d.ts +27 -0
- package/dist/sdk/environment/host-environment-errors.js +124 -0
- package/dist/sdk/environment/project-runtime-compatibility.d.ts +65 -0
- package/dist/sdk/environment/project-runtime-compatibility.js +385 -0
- package/dist/sdk/environment/source-context.d.ts +23 -0
- package/dist/sdk/environment/source-context.js +29 -0
- package/dist/sdk/error-code-catalog.d.ts +6 -0
- package/dist/sdk/error-code-catalog.js +62 -8
- package/dist/sdk/generated-error-code-catalog.js +629 -3
- package/dist/sdk/governance/health.d.ts +11 -3
- package/dist/sdk/governance/health.js +5 -5
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +9 -5
- package/dist/sdk/learnings.d.ts +15 -0
- package/dist/sdk/learnings.js +2 -2
- package/dist/sdk/lifecycle/close-many.d.ts +6 -1
- package/dist/sdk/lifecycle/close-many.js +43 -5
- package/dist/sdk/lifecycle/update-many.d.ts +2 -1
- package/dist/sdk/lifecycle/update-many.js +29 -5
- package/dist/sdk/merge/index.d.ts +1 -1
- package/dist/sdk/merge/index.js +3 -3
- package/dist/sdk/merge/install.d.ts +21 -0
- package/dist/sdk/merge/install.js +50 -20
- package/dist/sdk/notes.d.ts +7 -0
- package/dist/sdk/notes.js +2 -2
- package/dist/sdk/read-output-contracts.js +83 -4
- package/dist/sdk/runtime.d.ts +1 -1
- package/dist/sdk/runtime.js +9 -25
- package/dist/sdk/test/execution.js +4 -2
- package/dist/sdk/test/parsers.js +5 -2
- package/dist/sdk/workspace-snapshot.d.ts +9 -0
- package/dist/sdk/workspace-snapshot.js +48 -16
- package/docs/AGENT_RUNTIME_PRIMITIVES.md +11 -4
- package/docs/README.md +1 -0
- package/docs/RELEASING.md +27 -2
- package/docs/SCRIPTING.md +27 -1
- package/docs/SDK_CONTEXT_INTEGRITY.md +66 -0
- package/docs/SDK_RUNTIME_BOUNDARIES.md +58 -0
- package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
- package/docs/TESTING.md +17 -0
- package/marketplace.json +2 -2
- package/package.json +5 -3
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +529 -34
- package/dist/cli-bundle/chunks/append-7BXBFDGD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2AXF3VSK.js +0 -2
- package/dist/cli-bundle/chunks/chunk-2XS43CCV.js +0 -2
- package/dist/cli-bundle/chunks/chunk-3A6KWB72.js +0 -8
- package/dist/cli-bundle/chunks/chunk-3ISTDB42.js +0 -8
- package/dist/cli-bundle/chunks/chunk-4MTI7XOV.js +0 -5
- package/dist/cli-bundle/chunks/chunk-6BX5UDCN.js +0 -3
- package/dist/cli-bundle/chunks/chunk-6QPO7KLR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-7MXHZHSQ.js +0 -5
- package/dist/cli-bundle/chunks/chunk-7ZPMJW4U.js +0 -2
- package/dist/cli-bundle/chunks/chunk-A6KGKEWT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-AGYNSNCI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-B4H7FEFH.js +0 -5
- package/dist/cli-bundle/chunks/chunk-B4KLBBMN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-BXCSXK4J.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CALJHNBL.js +0 -23
- package/dist/cli-bundle/chunks/chunk-CFIGP5LY.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CHOQ2VAW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CS6MRHG7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-CUGNQQKH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-D4FPS43D.js +0 -164
- package/dist/cli-bundle/chunks/chunk-E2ZSLTOP.js +0 -2
- package/dist/cli-bundle/chunks/chunk-FB7G2HY2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y5YE6A.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H5Y6UV6E.js +0 -2
- package/dist/cli-bundle/chunks/chunk-H7KGWPDF.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HFSD77TQ.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HX2GTA6L.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2IEKAVR.js +0 -2
- package/dist/cli-bundle/chunks/chunk-JC6FKIFM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K44PYFXH.js +0 -2
- package/dist/cli-bundle/chunks/chunk-K4KGEEBT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KFLK5TRH.js +0 -21
- package/dist/cli-bundle/chunks/chunk-KL6IEBV2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KWQZDZSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KZ4X3DGU.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LD77HJMQ.js +0 -13
- package/dist/cli-bundle/chunks/chunk-LEPJJ6QC.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ME2JJ4LA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-NE5VRDAI.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NFLJ3FHD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NG6OXIBR.js +0 -19
- package/dist/cli-bundle/chunks/chunk-NYIGHWQY.js +0 -8
- package/dist/cli-bundle/chunks/chunk-NZ75GNSA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PCJWJNC2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PD3225AM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PDEGKG7P.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PIE5HBNA.js +0 -2
- package/dist/cli-bundle/chunks/chunk-PW2H7YJR.js +0 -56
- package/dist/cli-bundle/chunks/chunk-RSIC5OPE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPKN3S7S.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TPXAXTCO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UFWUJO4V.js +0 -2
- package/dist/cli-bundle/chunks/chunk-UQLZQVFW.js +0 -55
- package/dist/cli-bundle/chunks/chunk-VT3Z5G7D.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WOD3WWUN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WSJEIGJF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-WYNUU7ZW.js +0 -2008
- package/dist/cli-bundle/chunks/chunk-YGPNCCXZ.js +0 -2
- package/dist/cli-bundle/chunks/close-CMY3BAUG.js +0 -2
- package/dist/cli-bundle/chunks/close-many-SA4XZCTK.js +0 -2
- package/dist/cli-bundle/chunks/comments-EZ556ZD3.js +0 -2
- package/dist/cli-bundle/chunks/copy-ZSGPA52X.js +0 -2
- package/dist/cli-bundle/chunks/create-I5DVV4YG.js +0 -2
- package/dist/cli-bundle/chunks/delete-RL3JACSW.js +0 -2
- package/dist/cli-bundle/chunks/deps-S7UBCECS.js +0 -2
- package/dist/cli-bundle/chunks/docs-ZZNVBBYO.js +0 -2
- package/dist/cli-bundle/chunks/files-27C337VT.js +0 -2
- package/dist/cli-bundle/chunks/focus-5Z2SG7LU.js +0 -2
- package/dist/cli-bundle/chunks/history-compact-HJQK67CZ.js +0 -2
- package/dist/cli-bundle/chunks/history-redact-PWC6PDWA.js +0 -2
- package/dist/cli-bundle/chunks/history-repair-N3CY4WBF.js +0 -2
- package/dist/cli-bundle/chunks/learnings-4FH23XDT.js +0 -2
- package/dist/cli-bundle/chunks/profile-5Y5XXH5N.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-YGYPW3BL.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-WMDSUMQF.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-DL7FFABC.js +0 -2
- package/dist/cli-bundle/chunks/restore-6KYBV5BY.js +0 -2
- package/dist/cli-bundle/chunks/schema-EQGKBYXJ.js +0 -2
- package/dist/cli-bundle/chunks/update-QVTYOD6I.js +0 -2
- package/dist/cli-bundle/chunks/update-many-DJSBU525.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ECLECMK.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-4EX25PXM.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-DLTS3IHM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DQ6FKGL3.js +0 -14
- package/dist/cli-bundle/focused-chunks/chunk-JLG2C4EQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZJIMJHDB.js +0 -2
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e5b9b4c9-c2eb-5282-99da-702a8887c4e4")}catch(e){}}();
|
|
3
3
|
import { resolveBodyFileContent, EXIT_CODE, splitCommaList, PmCliError, } from "../sdk/runtime-primitives.js";
|
|
4
4
|
import { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, } from "../sdk/cli-contracts.js";
|
|
5
5
|
import { BUILTIN_ITEM_TYPE_VALUES } from "../types/index.js";
|
|
6
6
|
import { MERGE_DRIVER_ARTIFACT_VALUES, runMergeDriver, runMergeInstall, runMergeReconcile, runMergeReceiptReport, } from "./commands/merge.js";
|
|
7
|
+
import { runAppend } from "./commands/append.js";
|
|
8
|
+
import { runClose } from "./commands/close.js";
|
|
9
|
+
import { runCloseMany } from "./commands/close-many.js";
|
|
10
|
+
import { runCopy } from "./commands/copy.js";
|
|
11
|
+
import { runCreate } from "./commands/create.js";
|
|
12
|
+
import { runDelete } from "./commands/delete.js";
|
|
13
|
+
import { runDeps } from "./commands/deps.js";
|
|
14
|
+
import { runDocs } from "./commands/docs.js";
|
|
15
|
+
import { runFiles, runFilesDiscover } from "./commands/files.js";
|
|
16
|
+
import { runFocus } from "./commands/focus.js";
|
|
17
|
+
import { assertHistoryCompactTarget, runHistoryCompact, runHistoryCompactBulk, } from "./commands/history-compact.js";
|
|
18
|
+
import { runHistoryRedact } from "./commands/history-redact.js";
|
|
19
|
+
import { assertHistoryRepairTarget, runHistoryRepair, runHistoryRepairAll, } from "./commands/history-repair.js";
|
|
20
|
+
import * as profileModule from "./commands/profile.js";
|
|
21
|
+
import { runRestore } from "./commands/restore.js";
|
|
22
|
+
import * as schemaModule from "./commands/schema.js";
|
|
23
|
+
import { runUpdate } from "./commands/update.js";
|
|
24
|
+
import { runUpdateMany } from "./commands/update-many.js";
|
|
7
25
|
import { createStdinTokenResolver } from "../sdk/runtime-primitives.js";
|
|
8
26
|
import { resolveDescriptionStdin } from "./description-stdin.js";
|
|
9
27
|
import { itemDocumentToMutationOptions } from "../sdk/structured-mutations.js";
|
|
10
28
|
import { registerStructuredMutationCommands } from "./register-structured-mutation.js";
|
|
11
29
|
import { registerHistoryAuthorAcknowledgeCommand } from "./register-history-author.js";
|
|
12
30
|
import { PLAN_SUBCOMMANDS, runPlan } from "./commands/plan.js";
|
|
13
|
-
import {
|
|
31
|
+
import { registerAnnotationCommands } from "./register-annotations.js";
|
|
14
32
|
import { registerFilesLookupCommand } from "./register-files-lookup.js";
|
|
15
33
|
import { isPureSnakeCaseAlias, looksLikeSchemaSubcommandTypo, parseSchemaOrderOption, } from "./schema-registration-helpers.js";
|
|
16
34
|
export { looksLikeSchemaSubcommandTypo, parseSchemaOrderOption, } from "./schema-registration-helpers.js";
|
|
@@ -514,7 +532,6 @@ async function runCreateAction(typeOrTitle, secondTitle, options, command) {
|
|
|
514
532
|
delete options.bodyFile;
|
|
515
533
|
}
|
|
516
534
|
const normalized = normalizeCreateOptions(options, { requireType: false });
|
|
517
|
-
const { runCreate } = await import("./commands/create.js");
|
|
518
535
|
const result = await runCreate(normalized, globalOptions);
|
|
519
536
|
await invalidateSearchCachesForMutation(globalOptions, result);
|
|
520
537
|
printResult(result, globalOptions);
|
|
@@ -547,7 +564,6 @@ function buildCloseManyListOptions(options) {
|
|
|
547
564
|
async function runCloseManyAction(options, command) {
|
|
548
565
|
const globalOptions = getGlobalOptions(command);
|
|
549
566
|
const startedAt = Date.now();
|
|
550
|
-
const { runCloseMany } = await import("./commands/close-many.js");
|
|
551
567
|
const result = await runCloseMany({
|
|
552
568
|
status: readOptionString(options, "filterStatus"),
|
|
553
569
|
list: buildCloseManyListOptions(options),
|
|
@@ -575,7 +591,6 @@ async function runCloseManyAction(options, command) {
|
|
|
575
591
|
async function runUpdateManyAction(options, command) {
|
|
576
592
|
const globalOptions = getGlobalOptions(command);
|
|
577
593
|
const startedAt = Date.now();
|
|
578
|
-
const { runUpdateMany } = await import("./commands/update-many.js");
|
|
579
594
|
const result = await runUpdateMany({
|
|
580
595
|
status: readOptionString(options, "filterStatus"),
|
|
581
596
|
list: buildUpdateManyListOptions(options),
|
|
@@ -593,7 +608,6 @@ async function runUpdateManyAction(options, command) {
|
|
|
593
608
|
async function runCloseAction(id, text, options, command) {
|
|
594
609
|
const globalOptions = getGlobalOptions(command);
|
|
595
610
|
const startedAt = Date.now();
|
|
596
|
-
const { runClose } = await import("./commands/close.js");
|
|
597
611
|
const reasonFromOption = (typeof options.reason === "string" &&
|
|
598
612
|
options.reason.trim().length > 0 &&
|
|
599
613
|
options.reason) ||
|
|
@@ -807,7 +821,6 @@ async function runMergeAction(subcommand, artifact, base, ours, theirs, options,
|
|
|
807
821
|
async function runHistoryCompactAction(id, options, command) {
|
|
808
822
|
const globalOptions = getGlobalOptions(command);
|
|
809
823
|
const startedAt = Date.now();
|
|
810
|
-
const { runHistoryCompact, runHistoryCompactBulk, assertHistoryCompactTarget, } = await import("./commands/history-compact.js");
|
|
811
824
|
const ids = typeof options.ids === "string" ? splitCommaList(options.ids) : undefined;
|
|
812
825
|
const allOver = parseNonNegativeIntFlag(options.allOver, "--all-over");
|
|
813
826
|
const minEntries = parseNonNegativeIntFlag(options.minEntries, "--min-entries");
|
|
@@ -866,7 +879,6 @@ function splitCollectedCommaList(raw) {
|
|
|
866
879
|
async function runSchemaAction(subcommand, name, options, command) {
|
|
867
880
|
const globalOptions = getGlobalOptions(command);
|
|
868
881
|
const startedAt = Date.now();
|
|
869
|
-
const schemaModule = await import("./commands/schema.js");
|
|
870
882
|
const { SCHEMA_SUBCOMMANDS } = schemaModule;
|
|
871
883
|
let normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
|
|
872
884
|
let typeName = name;
|
|
@@ -931,72 +943,9 @@ function assertSchemaSubcommandPresent(normalizedSubcommand, allowed) {
|
|
|
931
943
|
],
|
|
932
944
|
});
|
|
933
945
|
}
|
|
934
|
-
function resolveCommentSources(text, options) {
|
|
935
|
-
const editIndex = typeof options.edit === "number" ? options.edit : undefined;
|
|
936
|
-
const deleteIndex = typeof options.delete === "number" ? options.delete : undefined;
|
|
937
|
-
const addFromOption = readOptionString(options, "add") ??
|
|
938
|
-
readOptionString(options, "body") ??
|
|
939
|
-
readOptionString(options, "comment");
|
|
940
|
-
const addFromPositional = typeof text === "string" ? text : undefined;
|
|
941
|
-
const readFromStdin = options.stdin === true;
|
|
942
|
-
const readFromFile = readOptionString(options, "file");
|
|
943
|
-
const sourceCount = Number(addFromOption !== undefined) +
|
|
944
|
-
Number(addFromPositional !== undefined) +
|
|
945
|
-
Number(readFromStdin) +
|
|
946
|
-
Number(readFromFile !== undefined);
|
|
947
|
-
if (sourceCount > 1) {
|
|
948
|
-
if (addFromOption !== undefined &&
|
|
949
|
-
addFromPositional !== undefined &&
|
|
950
|
-
!readFromStdin &&
|
|
951
|
-
readFromFile === undefined) {
|
|
952
|
-
throw new PmCliError("Specify comment text either as positional [text] or with --add, not both", EXIT_CODE.USAGE);
|
|
953
|
-
}
|
|
954
|
-
throw new PmCliError("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file", EXIT_CODE.USAGE);
|
|
955
|
-
}
|
|
956
|
-
const add = addFromOption ?? addFromPositional;
|
|
957
|
-
const isMutation = typeof add === "string" ||
|
|
958
|
-
readFromStdin ||
|
|
959
|
-
readFromFile !== undefined ||
|
|
960
|
-
editIndex !== undefined ||
|
|
961
|
-
deleteIndex !== undefined;
|
|
962
|
-
return {
|
|
963
|
-
add,
|
|
964
|
-
readFromStdin,
|
|
965
|
-
readFromFile,
|
|
966
|
-
editIndex,
|
|
967
|
-
deleteIndex,
|
|
968
|
-
isMutation,
|
|
969
|
-
};
|
|
970
|
-
}
|
|
971
|
-
async function runCommentsAction(id, text, options, command) {
|
|
972
|
-
const globalOptions = getGlobalOptions(command);
|
|
973
|
-
const startedAt = Date.now();
|
|
974
|
-
const sources = resolveCommentSources(text, options);
|
|
975
|
-
const { runComments } = await import("./commands/comments.js");
|
|
976
|
-
const result = await runComments(id, {
|
|
977
|
-
add: sources.add,
|
|
978
|
-
stdin: sources.readFromStdin,
|
|
979
|
-
file: sources.readFromFile,
|
|
980
|
-
edit: sources.editIndex,
|
|
981
|
-
delete: sources.deleteIndex,
|
|
982
|
-
limit: readOptionString(options, "limit"),
|
|
983
|
-
author: readOptionString(options, "author"),
|
|
984
|
-
message: readOptionString(options, "message"),
|
|
985
|
-
ownershipAppendBypass: options.ownershipAppendBypass === true,
|
|
986
|
-
force: Boolean(options.force),
|
|
987
|
-
}, globalOptions);
|
|
988
|
-
if (sources.isMutation) {
|
|
989
|
-
await invalidateSearchCachesForMutation(globalOptions, result);
|
|
990
|
-
}
|
|
991
|
-
printResult(result, globalOptions);
|
|
992
|
-
if (globalOptions.profile) {
|
|
993
|
-
printError(`profile:command=comments took_ms=${Date.now() - startedAt}`);
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
946
|
async function runCopyAction(id, options, command) {
|
|
997
947
|
const globalOptions = getGlobalOptions(command);
|
|
998
948
|
const startedAt = Date.now();
|
|
999
|
-
const { runCopy } = await import("./commands/copy.js");
|
|
1000
949
|
const result = await runCopy(id, {
|
|
1001
950
|
title: readOptionString(options, "title"),
|
|
1002
951
|
author: readOptionString(options, "author"),
|
|
@@ -1012,7 +961,6 @@ async function runCopyAction(id, options, command) {
|
|
|
1012
961
|
async function runFocusAction(id, options, command) {
|
|
1013
962
|
const globalOptions = getGlobalOptions(command);
|
|
1014
963
|
const startedAt = Date.now();
|
|
1015
|
-
const { runFocus } = await import("./commands/focus.js");
|
|
1016
964
|
const result = await runFocus(id, { clear: options.clear === true }, globalOptions);
|
|
1017
965
|
printResult(result, globalOptions);
|
|
1018
966
|
if (globalOptions.profile) {
|
|
@@ -1034,7 +982,6 @@ async function runUpdateAction(id, options, command) {
|
|
|
1034
982
|
options.body = await resolveBodyFileContent(options.bodyFile, options.body !== undefined ? String(options.body) : undefined);
|
|
1035
983
|
delete options.bodyFile;
|
|
1036
984
|
}
|
|
1037
|
-
const { runUpdate } = await import("./commands/update.js");
|
|
1038
985
|
const result = await runUpdate(id, normalizeUpdateOptions(options), globalOptions);
|
|
1039
986
|
await invalidateSearchCachesForMutation(globalOptions, result);
|
|
1040
987
|
printResult(await applyActiveCommandResultService("update", [id], options, globalOptions, result), globalOptions);
|
|
@@ -1045,7 +992,6 @@ async function runUpdateAction(id, options, command) {
|
|
|
1045
992
|
async function runDeleteAction(id, options, command) {
|
|
1046
993
|
const globalOptions = getGlobalOptions(command);
|
|
1047
994
|
const startedAt = Date.now();
|
|
1048
|
-
const { runDelete } = await import("./commands/delete.js");
|
|
1049
995
|
const result = await runDelete(id, {
|
|
1050
996
|
author: readOptionString(options, "author"),
|
|
1051
997
|
message: readOptionString(options, "message"),
|
|
@@ -1060,14 +1006,6 @@ async function runDeleteAction(id, options, command) {
|
|
|
1060
1006
|
printError(`profile:command=delete took_ms=${Date.now() - startedAt}`);
|
|
1061
1007
|
}
|
|
1062
1008
|
}
|
|
1063
|
-
function resolveSingleTextSource(label, positional, options) {
|
|
1064
|
-
const addFromOption = readOptionString(options, "add");
|
|
1065
|
-
const addFromPositional = typeof positional === "string" ? positional : undefined;
|
|
1066
|
-
if (addFromOption !== undefined && addFromPositional !== undefined) {
|
|
1067
|
-
throw new PmCliError(`Specify ${label} text either as positional [text] or with --add, not both`, EXIT_CODE.USAGE);
|
|
1068
|
-
}
|
|
1069
|
-
return addFromOption ?? addFromPositional;
|
|
1070
|
-
}
|
|
1071
1009
|
function resolveAppendBody(text, options) {
|
|
1072
1010
|
const bodyFromOption = readOptionString(options, "body");
|
|
1073
1011
|
const bodyFromAlias = readOptionString(options, "text");
|
|
@@ -1089,7 +1027,6 @@ function resolveAppendBody(text, options) {
|
|
|
1089
1027
|
async function runAppendAction(id, text, options, command) {
|
|
1090
1028
|
const globalOptions = getGlobalOptions(command);
|
|
1091
1029
|
const startedAt = Date.now();
|
|
1092
|
-
const { runAppend } = await import("./commands/append.js");
|
|
1093
1030
|
const result = await runAppend(id, {
|
|
1094
1031
|
body: resolveAppendBody(text, options),
|
|
1095
1032
|
author: readOptionString(options, "author"),
|
|
@@ -1105,7 +1042,6 @@ async function runAppendAction(id, text, options, command) {
|
|
|
1105
1042
|
async function runRestoreAction(id, target, options, command) {
|
|
1106
1043
|
const globalOptions = getGlobalOptions(command);
|
|
1107
1044
|
const startedAt = Date.now();
|
|
1108
|
-
const { runRestore } = await import("./commands/restore.js");
|
|
1109
1045
|
const result = await runRestore(id, target, {
|
|
1110
1046
|
author: readOptionString(options, "author"),
|
|
1111
1047
|
message: readOptionString(options, "message"),
|
|
@@ -1120,7 +1056,6 @@ async function runRestoreAction(id, target, options, command) {
|
|
|
1120
1056
|
async function runProfileAction(subcommand, name, options, command) {
|
|
1121
1057
|
const globalOptions = getGlobalOptions(command);
|
|
1122
1058
|
const startedAt = Date.now();
|
|
1123
|
-
const profileModule = await import("./commands/profile.js");
|
|
1124
1059
|
const { PROFILE_SUBCOMMANDS } = profileModule;
|
|
1125
1060
|
const normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
|
|
1126
1061
|
if (!normalizedSubcommand) {
|
|
@@ -1156,68 +1091,6 @@ async function runProfileAction(subcommand, name, options, command) {
|
|
|
1156
1091
|
printError(`profile:command=profile took_ms=${Date.now() - startedAt}`);
|
|
1157
1092
|
}
|
|
1158
1093
|
}
|
|
1159
|
-
async function runNotesAction(id, text, options, command) {
|
|
1160
|
-
const globalOptions = getGlobalOptions(command);
|
|
1161
|
-
const startedAt = Date.now();
|
|
1162
|
-
const add = resolveSingleTextSource("note", text, options);
|
|
1163
|
-
const result = await runNotes(id, {
|
|
1164
|
-
add,
|
|
1165
|
-
addJson: readOptionString(options, "addJson"),
|
|
1166
|
-
stdin: options.stdin === true,
|
|
1167
|
-
file: readOptionString(options, "file"),
|
|
1168
|
-
edit: typeof options.edit === "number" ? options.edit : undefined,
|
|
1169
|
-
delete: typeof options.delete === "number" ? options.delete : undefined,
|
|
1170
|
-
limit: readOptionString(options, "limit"),
|
|
1171
|
-
since: readOptionString(options, "since"),
|
|
1172
|
-
eventType: readOptionString(options, "eventType"),
|
|
1173
|
-
includeMeta: options.includeMeta === true,
|
|
1174
|
-
author: readOptionString(options, "author"),
|
|
1175
|
-
message: readOptionString(options, "message"),
|
|
1176
|
-
ownershipAppendBypass: options.ownershipAppendBypass === true,
|
|
1177
|
-
force: Boolean(options.force),
|
|
1178
|
-
}, globalOptions);
|
|
1179
|
-
if (typeof add === "string" ||
|
|
1180
|
-
typeof options.addJson === "string" ||
|
|
1181
|
-
options.stdin === true ||
|
|
1182
|
-
typeof options.file === "string" ||
|
|
1183
|
-
typeof options.edit === "number" ||
|
|
1184
|
-
typeof options.delete === "number") {
|
|
1185
|
-
await invalidateSearchCachesForMutation(globalOptions, result);
|
|
1186
|
-
}
|
|
1187
|
-
printResult(result, globalOptions);
|
|
1188
|
-
if (globalOptions.profile) {
|
|
1189
|
-
printError(`profile:command=notes took_ms=${Date.now() - startedAt}`);
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
async function runLearningsAction(id, text, options, command) {
|
|
1193
|
-
const globalOptions = getGlobalOptions(command);
|
|
1194
|
-
const startedAt = Date.now();
|
|
1195
|
-
const add = resolveSingleTextSource("learning", text, options);
|
|
1196
|
-
const { runLearnings } = await import("./commands/learnings.js");
|
|
1197
|
-
const result = await runLearnings(id, {
|
|
1198
|
-
add,
|
|
1199
|
-
stdin: options.stdin === true,
|
|
1200
|
-
file: readOptionString(options, "file"),
|
|
1201
|
-
edit: typeof options.edit === "number" ? options.edit : undefined,
|
|
1202
|
-
delete: typeof options.delete === "number" ? options.delete : undefined,
|
|
1203
|
-
limit: readOptionString(options, "limit"),
|
|
1204
|
-
author: readOptionString(options, "author"),
|
|
1205
|
-
message: readOptionString(options, "message"),
|
|
1206
|
-
ownershipAppendBypass: options.ownershipAppendBypass === true,
|
|
1207
|
-
force: Boolean(options.force),
|
|
1208
|
-
}, globalOptions);
|
|
1209
|
-
if (typeof add === "string" ||
|
|
1210
|
-
options.stdin === true ||
|
|
1211
|
-
typeof options.file === "string" ||
|
|
1212
|
-
typeof options.edit === "number" ||
|
|
1213
|
-
typeof options.delete === "number") {
|
|
1214
|
-
await invalidateSearchCachesForMutation(globalOptions, result);
|
|
1215
|
-
}
|
|
1216
|
-
printResult(result, globalOptions);
|
|
1217
|
-
if (globalOptions.profile) {
|
|
1218
|
-
printError(`profile:command=learnings took_ms=${Date.now() - startedAt}`);
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
1094
|
function readStringArrayOption(options, key) {
|
|
1222
1095
|
return stringArrayOption(options[key]) ?? [];
|
|
1223
1096
|
}
|
|
@@ -1228,7 +1101,6 @@ async function runFilesAction(id, options, command) {
|
|
|
1228
1101
|
const addGlobValues = readStringArrayOption(options, "addGlob");
|
|
1229
1102
|
const removeValues = readStringArrayOption(options, "remove");
|
|
1230
1103
|
const migrateValues = readStringArrayOption(options, "migrate");
|
|
1231
|
-
const { runFiles } = await import("./commands/files.js");
|
|
1232
1104
|
const result = await runFiles(id, {
|
|
1233
1105
|
add: addValues,
|
|
1234
1106
|
addGlob: addGlobValues,
|
|
@@ -1263,7 +1135,6 @@ async function runFilesDiscoverAction(id, options, command) {
|
|
|
1263
1135
|
...command.optsWithGlobals(),
|
|
1264
1136
|
...options,
|
|
1265
1137
|
};
|
|
1266
|
-
const { runFilesDiscover } = await import("./commands/files.js");
|
|
1267
1138
|
const result = await runFilesDiscover(id, {
|
|
1268
1139
|
apply: Boolean(mergedOptions.apply),
|
|
1269
1140
|
note: readOptionString(mergedOptions, "note"),
|
|
@@ -1287,7 +1158,6 @@ async function runDocsAction(id, options, command) {
|
|
|
1287
1158
|
const addGlobValues = readStringArrayOption(options, "addGlob");
|
|
1288
1159
|
const removeValues = readStringArrayOption(options, "remove");
|
|
1289
1160
|
const migrateValues = readStringArrayOption(options, "migrate");
|
|
1290
|
-
const { runDocs } = await import("./commands/docs.js");
|
|
1291
1161
|
const result = await runDocs(id, {
|
|
1292
1162
|
add: addValues,
|
|
1293
1163
|
addGlob: addGlobValues,
|
|
@@ -1314,7 +1184,6 @@ async function runDocsAction(id, options, command) {
|
|
|
1314
1184
|
async function runDepsAction(id, options, command) {
|
|
1315
1185
|
const globalOptions = getGlobalOptions(command);
|
|
1316
1186
|
const startedAt = Date.now();
|
|
1317
|
-
const { runDeps } = await import("./commands/deps.js");
|
|
1318
1187
|
// --format and --collapse carry commander defaults ("tree"/"none"), so
|
|
1319
1188
|
// they are always strings by the time the action runs; --maxDepth has no
|
|
1320
1189
|
// default and may be unset. Use `as string` rather than String(...) so an
|
|
@@ -1750,7 +1619,6 @@ export function registerMutationCommands(program, registrationOptions = {}) {
|
|
|
1750
1619
|
.action(async (id, options, command) => {
|
|
1751
1620
|
const globalOptions = getGlobalOptions(command);
|
|
1752
1621
|
const startedAt = Date.now();
|
|
1753
|
-
const { runHistoryRedact } = await import("./commands/history-redact.js");
|
|
1754
1622
|
const literal = Array.isArray(options.literal)
|
|
1755
1623
|
? options.literal
|
|
1756
1624
|
: undefined;
|
|
@@ -1788,7 +1656,6 @@ export function registerMutationCommands(program, registrationOptions = {}) {
|
|
|
1788
1656
|
.action(async (id, options, command) => {
|
|
1789
1657
|
const globalOptions = getGlobalOptions(command);
|
|
1790
1658
|
const startedAt = Date.now();
|
|
1791
|
-
const { runHistoryRepair, runHistoryRepairAll, assertHistoryRepairTarget, } = await import("./commands/history-repair.js");
|
|
1792
1659
|
const all = options.all === true;
|
|
1793
1660
|
assertHistoryRepairTarget(id, all);
|
|
1794
1661
|
const repairOptions = {
|
|
@@ -1887,58 +1754,10 @@ export function registerMutationCommands(program, registrationOptions = {}) {
|
|
|
1887
1754
|
.option("--force", "Force ownership/lock override")
|
|
1888
1755
|
.description("List, show, apply, and lint project profiles — archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.");
|
|
1889
1756
|
profileCommand.action(runProfileAction);
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
.
|
|
1893
|
-
.
|
|
1894
|
-
.option("--add <text>", "Add one comment entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)")
|
|
1895
|
-
.option("--stdin", "Read comment text from stdin (supports multiline markdown)")
|
|
1896
|
-
.option("--file <path>", "Read comment text from file (supports multiline markdown)")
|
|
1897
|
-
.option("--edit <index>", "Replace the comment at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveIntOption("--edit"))
|
|
1898
|
-
.option("--delete <index>", "Delete the comment at 1-based <index>", parsePositiveIntOption("--delete"))
|
|
1899
|
-
.option("--limit <n>", "Return only latest n comments")
|
|
1900
|
-
.option("--author [value]", "Comment author (optional; falls back to PM_AUTHOR/settings)")
|
|
1901
|
-
.option("--message <value>", "History message")
|
|
1902
|
-
.option("--force", "Force ownership override")
|
|
1903
|
-
.description("List, add, edit, or delete comments for an item.")
|
|
1904
|
-
.action(runCommentsAction);
|
|
1905
|
-
addHiddenOption(commentsCommand, "--body <text>", "Alias for --add", false);
|
|
1906
|
-
addHiddenOption(commentsCommand, "--comment <text>", "Alias for --add", false);
|
|
1907
|
-
program
|
|
1908
|
-
.command("notes")
|
|
1909
|
-
.argument("<id>", "Item id")
|
|
1910
|
-
.argument("[text]", "Optional note text shorthand (equivalent to --add; use - for stdin)")
|
|
1911
|
-
.option("--add <text>", "Add a text note (- reads stdin)")
|
|
1912
|
-
.option("--add-json <json>", "Append a merge-safe JSON event")
|
|
1913
|
-
.option("--stdin", "Read note text from stdin")
|
|
1914
|
-
.option("--file <path>", "Read note text from a UTF-8 file")
|
|
1915
|
-
.option("--edit <index>", "Replace a 1-based note using the selected text input", parsePositiveIntOption("--edit"))
|
|
1916
|
-
.option("--delete <index>", "Delete the note at 1-based <index>", parsePositiveIntOption("--delete"))
|
|
1917
|
-
.option("--limit <n>", "Return only latest n notes")
|
|
1918
|
-
.option("--since <timestamp>", "Filter JSON events from this ISO time")
|
|
1919
|
-
.option("--event-type <value>", "Filter JSON events by top-level type")
|
|
1920
|
-
.option("--include-meta", "Include count and truncation metadata")
|
|
1921
|
-
.option("--author [value]", "Author; defaults to PM_AUTHOR/settings")
|
|
1922
|
-
.option("--message <value>", "History message")
|
|
1923
|
-
.option("--force", "Force ownership override")
|
|
1924
|
-
.description("Manage merge-safe text notes and JSON context events.")
|
|
1925
|
-
.action(runNotesAction);
|
|
1926
|
-
program
|
|
1927
|
-
.command("learnings")
|
|
1928
|
-
.argument("<id>", "Item id")
|
|
1929
|
-
.argument("[text]", "Optional learning text shorthand (equivalent to --add; use - for stdin)")
|
|
1930
|
-
.option("--add <text>", "Add one learning entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)")
|
|
1931
|
-
.option("--stdin", "Read learning text from stdin (supports multiline markdown)")
|
|
1932
|
-
.option("--file <path>", "Read learning text from file (supports multiline markdown)")
|
|
1933
|
-
.option("--edit <index>", "Replace the learning at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveIntOption("--edit"))
|
|
1934
|
-
.option("--delete <index>", "Delete the learning at 1-based <index>", parsePositiveIntOption("--delete"))
|
|
1935
|
-
.option("--limit <n>", "Return only latest n learnings")
|
|
1936
|
-
.option("--author [value]", "Learning author (optional; falls back to PM_AUTHOR/settings)")
|
|
1937
|
-
.option("--message <value>", "History message")
|
|
1938
|
-
.option("--force", "Force ownership override")
|
|
1939
|
-
.description("List, add, edit, or delete learnings for an item.")
|
|
1940
|
-
.action(runLearningsAction);
|
|
1941
|
-
const filesCommand = program.command("files").description("Manage files linked to an item.");
|
|
1757
|
+
registerAnnotationCommands(program, parsePositiveIntOption);
|
|
1758
|
+
const filesCommand = program
|
|
1759
|
+
.command("files")
|
|
1760
|
+
.description("Manage files linked to an item.");
|
|
1942
1761
|
filesCommand
|
|
1943
1762
|
.argument("<id>", "Item id")
|
|
1944
1763
|
.option("--add <value>", "Add linked file entry (CSV/markdown pairs or - for stdin)", collect)
|
|
@@ -1998,4 +1817,4 @@ export function registerMutationCommands(program, registrationOptions = {}) {
|
|
|
1998
1817
|
.action(runDepsAction);
|
|
1999
1818
|
}
|
|
2000
1819
|
//# sourceMappingURL=register-mutation.js.map
|
|
2001
|
-
//# debugId=
|
|
1820
|
+
//# debugId=e5b9b4c9-c2eb-5282-99da-702a8887c4e4
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Options for one early CLI compatibility check and deferred dispatch. */
|
|
2
|
+
export interface RuntimeCompatibleCliOptions {
|
|
3
|
+
/** Version of the executable package, when its manifest was readable. */
|
|
4
|
+
executingVersion?: string;
|
|
5
|
+
/** Project root whose local package and lock metadata governs mutation. */
|
|
6
|
+
projectRoot: string;
|
|
7
|
+
/** CLI invocation arguments after the executable path. */
|
|
8
|
+
argv: readonly string[];
|
|
9
|
+
/** Explicit recovery override for one invocation. */
|
|
10
|
+
allowStale: boolean;
|
|
11
|
+
/** Deferred CLI bundle dispatch, called only after compatibility succeeds. */
|
|
12
|
+
run: () => Promise<void>;
|
|
13
|
+
/** Error sink used by the executable transport. */
|
|
14
|
+
writeError: (message: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/** Run CLI dispatch after the SDK compatibility guard and handle declared refusal exits. */
|
|
17
|
+
export declare function runRuntimeCompatibleCli(options: RuntimeCompatibleCliOptions): Promise<void>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module cli/runtime-compatibility-boundary
|
|
3
|
+
*
|
|
4
|
+
* Applies the SDK-owned stale-runtime mutation policy before CLI dispatch and
|
|
5
|
+
* preserves the normal structured error presentation contract.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6254a0a8-8f21-5ca3-a1bc-45015dd6308b")}catch(e){}}();
|
|
9
|
+
import { formatPmCliErrorForDisplay, formatPmCliErrorForJson, } from "./error-guidance.js";
|
|
10
|
+
import { assertProjectRuntimeCompatibility, PmCliError, } from "../sdk/environment/project-runtime-compatibility.js";
|
|
11
|
+
/** Run CLI dispatch after the SDK compatibility guard and handle declared refusal exits. */
|
|
12
|
+
export async function runRuntimeCompatibleCli(options) {
|
|
13
|
+
const outputFormatIndex = options.argv.indexOf("--output-format");
|
|
14
|
+
const jsonOutput = options.argv.includes("--json") ||
|
|
15
|
+
options.argv.includes("--output-format=json") ||
|
|
16
|
+
(outputFormatIndex >= 0 && options.argv[outputFormatIndex + 1] === "json");
|
|
17
|
+
try {
|
|
18
|
+
if (options.executingVersion !== undefined) {
|
|
19
|
+
const compatibility = assertProjectRuntimeCompatibility({
|
|
20
|
+
executingVersion: options.executingVersion,
|
|
21
|
+
projectRoot: options.projectRoot,
|
|
22
|
+
argv: options.argv,
|
|
23
|
+
allowStale: options.allowStale,
|
|
24
|
+
});
|
|
25
|
+
if (compatibility.warning !== undefined) {
|
|
26
|
+
options.writeError(jsonOutput
|
|
27
|
+
? `${JSON.stringify({ type: "warning", ...compatibility.warning })}\n`
|
|
28
|
+
: `[pm] warning: ${compatibility.warning.code} — ${compatibility.warning.message} Running ${compatibility.warning.executing_version}; project pin ${compatibility.warning.project_version} (${compatibility.warning.source}). ${compatibility.warning.next_steps[0]}\n`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
await options.run();
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (!(error instanceof PmCliError))
|
|
35
|
+
throw error;
|
|
36
|
+
options.writeError(`${jsonOutput
|
|
37
|
+
? JSON.stringify(formatPmCliErrorForJson(error.message, error.exitCode, error.context), null, 2)
|
|
38
|
+
: formatPmCliErrorForDisplay(error.message, error.context)}\n`);
|
|
39
|
+
process.exitCode = error.exitCode;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=runtime-compatibility-boundary.js.map
|
|
43
|
+
//# debugId=6254a0a8-8f21-5ca3-a1bc-45015dd6308b
|