@unbrained/pm-cli 2026.8.19 → 2026.8.21
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 +41 -0
- package/dist/cli/error-guidance.d.ts +20 -0
- package/dist/cli/error-guidance.js +29 -30
- package/dist/cli/register-list-query.js +12 -10
- package/dist/cli/register-structured-mutation.d.ts +2 -0
- package/dist/cli/register-structured-mutation.js +29 -6
- package/dist/cli-bundle/bundle-manifest.json +156 -148
- package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +197 -0
- package/dist/cli-bundle/chunks/{chunk-4NRRH7AM.js → chunk-3AFAUHUE.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7VHZS727.js +5 -0
- package/dist/cli-bundle/chunks/chunk-BKYB45NQ.js +2092 -0
- package/dist/cli-bundle/chunks/{chunk-BHYMXLAE.js → chunk-BUNIEJNE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QXSH7BLM.js → chunk-JSLOFXGA.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-LARJJ3RK.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-TOXJM4WA.js → chunk-LOVTQ52Z.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-N3DSV4CH.js +77 -0
- package/dist/cli-bundle/chunks/chunk-OCLPLFAY.js +35 -0
- package/dist/cli-bundle/chunks/chunk-S4IRYKBU.js +13 -0
- package/dist/cli-bundle/chunks/register-list-query-F57EWDEF.js +11 -0
- package/dist/cli-bundle/chunks/{register-mutation-AUWVCW4M.js → register-mutation-7IY2D5KO.js} +20 -20
- package/dist/cli-bundle/chunks/{register-operations-PZQPHXW5.js → register-operations-FALL3YTU.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-I4LUHGVW.js → register-setup-HXU7IZZD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2NIY5NKG.js +18 -0
- package/dist/cli-bundle/focused-chunks/{chunk-US7VEYZG.js → chunk-4ERLO7QD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +50 -0
- package/dist/cli-bundle/focused-chunks/{chunk-MCZXYZAF.js → chunk-CKKQSJNN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZBIQQYMI.js → chunk-F2A56DHV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ESISGDAY.js → chunk-F4YEW5I2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ODHQEECS.js → chunk-FH6DYED3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-FJ22HNRP.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-JEAVFOWM.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-EXBCLIBU.js → chunk-KDNG7TKQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-NJ63LOP6.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-NXRTQ7HI.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-JDOMQ7VQ.js → chunk-TJ7EMJ46.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-UZE7XUZK.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-DKPLYW3L.js → chunk-YKBKIEAJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-VXDSU5MC.js → chunk-ZOSEELYJ.js} +2 -2
- package/dist/cli-bundle/main.js +12 -12
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +41 -41
- 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 +32 -32
- 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 +5 -5
- package/dist/core/output/mutation-projection.js +26 -2
- package/dist/core/shared/constants.d.ts +1 -5
- package/dist/core/shared/constants.js +3 -81
- package/dist/core/shared/errors.d.ts +16 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/item-metadata-contract.d.ts +14 -0
- package/dist/core/shared/item-metadata-contract.js +90 -0
- package/dist/core/store/item-store.d.ts +60 -0
- package/dist/core/store/item-store.js +26 -94
- package/dist/core/store/tracker-preflight.d.ts +7 -0
- package/dist/core/store/tracker-preflight.js +142 -0
- package/dist/sdk/agent/closed-domain-contracts.d.ts +25 -0
- package/dist/sdk/agent/closed-domain-contracts.js +140 -0
- package/dist/sdk/agent/refusal-closure.d.ts +13 -1
- package/dist/sdk/agent/refusal-closure.js +45 -3
- package/dist/sdk/agent/refusal-reachability.d.ts +26 -0
- package/dist/sdk/agent/refusal-reachability.js +26 -2
- package/dist/sdk/agent/tracker-preflight-contracts.d.ts +63 -0
- package/dist/sdk/agent/tracker-preflight-contracts.js +127 -0
- package/dist/sdk/agent-capability-contracts.js +6 -11
- package/dist/sdk/annotations.js +6 -7
- package/dist/sdk/cli-contracts/completeness.js +8 -2
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +16 -6
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +11 -2
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +19 -2
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +105 -5
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/grammar-contracts.js +5 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +7 -3
- package/dist/sdk/cli-contracts/tool-schema.js +7 -2
- package/dist/sdk/cli-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts.js +4 -4
- package/dist/sdk/config.d.ts +5 -0
- package/dist/sdk/config.js +5 -5
- package/dist/sdk/context-intent-runtime.js +7 -4
- package/dist/sdk/contracts.d.ts +2 -0
- package/dist/sdk/contracts.js +4 -2
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/dependencies.js +5 -7
- package/dist/sdk/dependency-flag-validation.d.ts +1 -1
- package/dist/sdk/dependency-flag-validation.js +10 -4
- package/dist/sdk/environment/tracker-preflight.d.ts +6 -0
- package/dist/sdk/environment/tracker-preflight.js +10 -0
- package/dist/sdk/eval.js +5 -7
- package/dist/sdk/files.js +6 -10
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +110 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +179 -46
- package/dist/sdk/governance/assurance.d.ts +36 -2
- package/dist/sdk/governance/assurance.js +184 -10
- package/dist/sdk/governance/gc.js +5 -6
- package/dist/sdk/governance/health.js +5 -6
- package/dist/sdk/governance/reindex.js +5 -6
- package/dist/sdk/governance/validate.d.ts +1 -2
- package/dist/sdk/governance/validate.js +6 -12
- package/dist/sdk/graph/governance.d.ts +7 -5
- package/dist/sdk/graph/governance.js +32 -16
- package/dist/sdk/graph/run.js +5 -7
- package/dist/sdk/graph/traversal.js +14 -5
- package/dist/sdk/history-compact.js +6 -9
- package/dist/sdk/history-read.js +5 -7
- package/dist/sdk/history-redact.js +5 -6
- package/dist/sdk/history-repair.js +6 -9
- package/dist/sdk/improvement-ledger.js +7 -10
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +8 -4
- package/dist/sdk/init-agent-guidance.d.ts +5 -3
- package/dist/sdk/init-agent-guidance.js +69 -9
- package/dist/sdk/lifecycle/append.d.ts +0 -5
- package/dist/sdk/lifecycle/append.js +5 -6
- package/dist/sdk/lifecycle/claim.d.ts +0 -5
- package/dist/sdk/lifecycle/claim.js +6 -9
- package/dist/sdk/lifecycle/close-many.d.ts +0 -5
- package/dist/sdk/lifecycle/close-many.js +5 -6
- package/dist/sdk/lifecycle/close.d.ts +0 -5
- package/dist/sdk/lifecycle/close.js +5 -6
- package/dist/sdk/lifecycle/copy.d.ts +0 -5
- package/dist/sdk/lifecycle/copy.js +5 -6
- package/dist/sdk/lifecycle/create.d.ts +0 -5
- package/dist/sdk/lifecycle/create.js +5 -9
- package/dist/sdk/lifecycle/delete.js +5 -6
- package/dist/sdk/lifecycle/focus.d.ts +0 -5
- package/dist/sdk/lifecycle/focus.js +5 -6
- package/dist/sdk/lifecycle/mcp-actions.d.ts +18 -0
- package/dist/sdk/lifecycle/mcp-actions.js +52 -0
- package/dist/sdk/lifecycle/plan.d.ts +0 -5
- package/dist/sdk/lifecycle/plan.js +5 -6
- package/dist/sdk/lifecycle/reopen.d.ts +44 -0
- package/dist/sdk/lifecycle/reopen.js +69 -0
- package/dist/sdk/lifecycle/restore.js +5 -6
- package/dist/sdk/lifecycle/update-many.d.ts +0 -5
- package/dist/sdk/lifecycle/update-many.js +5 -6
- package/dist/sdk/lifecycle/update.d.ts +31 -5
- package/dist/sdk/lifecycle/update.js +140 -19
- package/dist/sdk/linked-artifacts.js +6 -7
- package/dist/sdk/merge/install.js +5 -6
- package/dist/sdk/mutation-events.js +5 -7
- package/dist/sdk/package-import-adapters.js +6 -8
- package/dist/sdk/profile.js +6 -7
- package/dist/sdk/query/activity.js +5 -6
- package/dist/sdk/query/calendar.js +5 -6
- package/dist/sdk/query/get.d.ts +1 -6
- package/dist/sdk/query/get.js +20 -55
- package/dist/sdk/query/history.d.ts +0 -5
- package/dist/sdk/query/history.js +5 -6
- package/dist/sdk/query/list.d.ts +7 -21
- package/dist/sdk/query/list.js +38 -54
- package/dist/sdk/query/projection-contracts.d.ts +33 -0
- package/dist/sdk/query/projection-contracts.js +185 -0
- package/dist/sdk/query/search-contracts.d.ts +2 -1
- package/dist/sdk/query/search-contracts.js +18 -87
- package/dist/sdk/query/search.d.ts +15 -0
- package/dist/sdk/query/search.js +34 -10
- package/dist/sdk/relationship-kinds/contract.d.ts +8 -0
- package/dist/sdk/relationship-kinds/contract.js +13 -13
- package/dist/sdk/relationships.d.ts +1 -1
- package/dist/sdk/relationships.js +20 -2
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/dist/sdk/runtime.d.ts +6 -0
- package/dist/sdk/runtime.js +18 -14
- package/dist/sdk/schema-migration.js +6 -7
- package/dist/sdk/schema.js +5 -6
- package/dist/sdk/similarity.d.ts +13 -0
- package/dist/sdk/similarity.js +32 -6
- package/dist/sdk/stats.js +5 -8
- package/dist/sdk/templates.js +5 -6
- package/dist/sdk/test/batch.js +5 -7
- package/dist/sdk/test/execution.js +4 -5
- package/dist/sdk/test/runs.js +5 -7
- package/docs/AGENT_UX_CONTRACTS.md +8 -1
- package/docs/COMMANDS.md +13 -1
- package/docs/DEPENDENCY_KIND_CONTRACT.md +12 -1
- package/docs/README.md +1 -0
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +151 -0
- package/docs/RELATIONSHIP_GRAPH.md +92 -10
- package/docs/SDK.md +10 -2
- package/docs/SDK_CONTEXT_INTEGRITY.md +45 -0
- package/docs/SDK_PRIMITIVE_INVENTORY.md +15 -1
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
- package/docs/performance/sdk-entrypoint-import-costs.md +14 -21
- package/marketplace.json +2 -2
- package/package.json +5 -5
- 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 +640 -44
- package/dist/cli-bundle/chunks/chunk-4THEB6PD.js +0 -13
- package/dist/cli-bundle/chunks/chunk-GWMXAQOD.js +0 -197
- package/dist/cli-bundle/chunks/chunk-HVFQTLYM.js +0 -35
- package/dist/cli-bundle/chunks/chunk-OI4XI562.js +0 -5
- package/dist/cli-bundle/chunks/chunk-OIOKV6NO.js +0 -2092
- package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +0 -3
- package/dist/cli-bundle/chunks/chunk-YBMRWW4E.js +0 -77
- package/dist/cli-bundle/chunks/register-list-query-Y56KINDU.js +0 -11
- package/dist/cli-bundle/focused-chunks/chunk-34QBIYZI.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-BJRYFVSH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-EF6ZS5GH.js +0 -50
- package/dist/cli-bundle/focused-chunks/chunk-L623ZPNK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PRHY2IMX.js +0 -18
- package/dist/cli-bundle/focused-chunks/chunk-RZU5U6Q7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-YBMGXBFV.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-YLVBJ6GF.js +0 -2
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm append command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="73184370-6517-533e-90db-536893402616")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { EXIT_CODE, PmCliError, resolveAuthor, toItemRecord, createStdinTokenResolver, mutateItem, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
|
|
9
10
|
/** Implements run append for the public runtime surface of this module. */
|
|
10
11
|
export async function runAppend(id, options, global) {
|
|
11
12
|
if (options.body === undefined) {
|
|
@@ -13,9 +14,7 @@ export async function runAppend(id, options, global) {
|
|
|
13
14
|
}
|
|
14
15
|
const stdinResolver = createStdinTokenResolver();
|
|
15
16
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
16
|
-
|
|
17
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
18
|
-
}
|
|
17
|
+
await assertInitializedTracker(pmRoot);
|
|
19
18
|
const settings = await readSettings(pmRoot);
|
|
20
19
|
const author = resolveAuthor(options.author, settings.author_default);
|
|
21
20
|
// options.body is guaranteed defined by the guard above, so resolveValue returns a defined string.
|
|
@@ -52,4 +51,4 @@ export async function runAppend(id, options, global) {
|
|
|
52
51
|
};
|
|
53
52
|
}
|
|
54
53
|
//# sourceMappingURL=append.js.map
|
|
55
|
-
//# debugId=
|
|
54
|
+
//# debugId=73184370-6517-533e-90db-536893402616
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module cli/commands/claim
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm claim command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import { type NextRecommendation, type NextOptions } from "../query/next.js";
|
|
8
3
|
/** Stable warning/error code for an exhausted atomic next-work walk. */
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm claim command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="1a61bf25-e320-5adc-8f5a-a427bc89af1a")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { resolveRuntimeStatusRegistry, statusIsTerminal, EXIT_CODE, PmCliError, toItemRecord, mutateItem, resolvePmRoot, readSettings, resolveAuthor, resolveClaimPrincipal, } from "../runtime-primitives.js";
|
|
9
10
|
import { wrapOwnershipConflict } from "../annotations.js";
|
|
10
11
|
import { describeItemOwnershipConflict } from "../ownership-source.js";
|
|
11
12
|
import { runNext, } from "../query/next.js";
|
|
@@ -26,9 +27,7 @@ export function isAlreadyClaimedError(error) {
|
|
|
26
27
|
/** Implements run claim for the public runtime surface of this module. */
|
|
27
28
|
export async function runClaim(id, force, global, options = {}) {
|
|
28
29
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
29
|
-
|
|
30
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
31
|
-
}
|
|
30
|
+
await assertInitializedTracker(pmRoot);
|
|
32
31
|
const settings = await readSettings(pmRoot);
|
|
33
32
|
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
34
33
|
const author = resolveAuthor(options.author, settings.author_default);
|
|
@@ -184,9 +183,7 @@ export async function claimNextFromRecommendations(recommendations, force, globa
|
|
|
184
183
|
/** Implements run release for the public runtime surface of this module. */
|
|
185
184
|
export async function runRelease(id, force, global, options = {}) {
|
|
186
185
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
187
|
-
|
|
188
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
189
|
-
}
|
|
186
|
+
await assertInitializedTracker(pmRoot);
|
|
190
187
|
const settings = await readSettings(pmRoot);
|
|
191
188
|
const author = resolveAuthor(options.author, settings.author_default);
|
|
192
189
|
const claimPrincipal = resolveClaimPrincipal(author);
|
|
@@ -237,4 +234,4 @@ export async function runRelease(id, force, global, options = {}) {
|
|
|
237
234
|
};
|
|
238
235
|
}
|
|
239
236
|
//# sourceMappingURL=claim.js.map
|
|
240
|
-
//# debugId=
|
|
237
|
+
//# debugId=1a61bf25-e320-5adc-8f5a-a427bc89af1a
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module cli/commands/close-many
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm close many command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { type GlobalOptions, readSettings } from "../runtime-primitives.js";
|
|
7
2
|
import { type ListOptions } from "../query/list.js";
|
|
8
3
|
import { type PmCommandEffectReceipt } from "../cli-contracts/command-exit-contracts.js";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm close many command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="a7113374-b169-5f92-9c20-075a47520440")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, getActiveExtensionRegistrations, isTerminalStatus, resolveItemTypeRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, PmCliError, toErrorMessage, resolveAuthor, nowIso, listAllItemMetadataLight, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
|
|
9
10
|
import { runClose } from "./close.js";
|
|
10
11
|
import { hasListFilters } from "../query/list-filter-shared.js";
|
|
11
12
|
import { runList } from "../query/list.js";
|
|
@@ -336,9 +337,7 @@ async function resolveCloseManyCheckpointInfo(params) {
|
|
|
336
337
|
/** Implements run close many for the public runtime surface of this module. */
|
|
337
338
|
export async function runCloseMany(options, global) {
|
|
338
339
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
339
|
-
|
|
340
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
341
|
-
}
|
|
340
|
+
await assertInitializedTracker(pmRoot);
|
|
342
341
|
const settings = await readSettings(pmRoot);
|
|
343
342
|
const dryRun = options.dryRun === true;
|
|
344
343
|
const rollbackId = resolveCloseManyRollbackId(options);
|
|
@@ -428,4 +427,4 @@ export const _testOnly = {
|
|
|
428
427
|
resolveReason,
|
|
429
428
|
};
|
|
430
429
|
//# sourceMappingURL=close-many.js.map
|
|
431
|
-
//# debugId=
|
|
430
|
+
//# debugId=a7113374-b169-5f92-9c20-075a47520440
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/lifecycle/close
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm close command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import { collectBlockedByIds } from "../actionability.js";
|
|
8
3
|
import { type CloseOperationOptions, type CloseOperationResult } from "../lifecycle-policy.js";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm close command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="781b5118-7b07-53c7-802f-c889cb797a96")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { toItemRecord, isTerminalStatus, resolveItemTypeRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, PmCliError, buildItemNotFoundError, listAllItemMetadataLight, locateItem, mutateItem, readLocatedItem, resolvePmRoot, readSettings, resolveAuthor, resolveIsoOrRelative, shouldCompletePlanOnClose, getActiveExtensionRegistrations, } from "../runtime-primitives.js";
|
|
9
10
|
import { collectBlockedByIds, indexBlockedByIds } from "../actionability.js";
|
|
10
11
|
import { applyTerminalOrderingPolicy, requireTerminalReason, } from "../lifecycle-policy.js";
|
|
11
12
|
import { renderPmCommand } from "../command-line.js";
|
|
@@ -367,9 +368,7 @@ export const _testOnlyCloseCommand = {
|
|
|
367
368
|
/** Close one item through the SDK-owned lifecycle transaction and policy. */
|
|
368
369
|
export async function closeItem(id, closeReasonText, options, global) {
|
|
369
370
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
370
|
-
|
|
371
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
372
|
-
}
|
|
371
|
+
await assertInitializedTracker(pmRoot);
|
|
373
372
|
const settings = await readSettings(pmRoot);
|
|
374
373
|
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
375
374
|
const author = resolveAuthor(options.author, settings.author_default);
|
|
@@ -458,4 +457,4 @@ export function runClose(id, closeReasonText, options, global) {
|
|
|
458
457
|
return closeItem(id, closeReasonText, options, global);
|
|
459
458
|
}
|
|
460
459
|
//# sourceMappingURL=close.js.map
|
|
461
|
-
//# debugId=
|
|
460
|
+
//# debugId=781b5118-7b07-53c7-802f-c889cb797a96
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/lifecycle/copy
|
|
3
|
-
*
|
|
4
|
-
* Implements the SDK-owned copy lifecycle operation shared by every surface.
|
|
5
|
-
*/
|
|
6
1
|
import { type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import { type SimilarityAdvisory } from "../similarity.js";
|
|
8
3
|
import type { ItemMetadata } from "../../types/index.js";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the SDK-owned copy lifecycle operation shared by every surface.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="b59e8e54-f9e0-5cdb-bc59-6dcbf67f278d")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { removeFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, generateItemId, canonicalDocument, serializeItemDocument, acquireLock, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveOnWriteHooks, collectRegisteredItemFieldNames, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, nowIso, PmCliError, resolveItemTypeRegistry, buildItemNotFoundError, locateItem, readLocatedItem, getHistoryPath, getItemPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
9
10
|
import { evaluateSimilarityGovernance, similarityAdvisoryWarnings, } from "../similarity.js";
|
|
10
11
|
import { acquireItemMetadataDerivedIndexLock, refreshItemMetadataDerivedIndex, } from "../item-metadata-index.js";
|
|
11
12
|
function buildChangedFields(itemMetadata, body) {
|
|
@@ -29,9 +30,7 @@ function buildCopyMessage(sourceId, message) {
|
|
|
29
30
|
/** Implements run copy for the public runtime surface of this module. */
|
|
30
31
|
export async function runCopy(sourceId, options, global) {
|
|
31
32
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
32
|
-
|
|
33
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
34
|
-
}
|
|
33
|
+
await assertInitializedTracker(pmRoot);
|
|
35
34
|
const settings = await readSettings(pmRoot);
|
|
36
35
|
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
37
36
|
const located = await locateItem(pmRoot, sourceId, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
@@ -211,4 +210,4 @@ export async function runCopy(sourceId, options, global) {
|
|
|
211
210
|
};
|
|
212
211
|
}
|
|
213
212
|
//# sourceMappingURL=copy.js.map
|
|
214
|
-
//# debugId=
|
|
213
|
+
//# debugId=b59e8e54-f9e0-5cdb-bc59-6dcbf67f278d
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/lifecycle/create
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm create command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { type ResolvedItemTypeDefinition, type RuntimeFieldRegistry, type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import { type SimilarityAdvisory } from "../similarity.js";
|
|
8
3
|
import { type LifecycleTransitionSuggestion } from "./lifecycle-transitions.js";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm create command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="a10348fe-746d-5dc7-8cd4-30453c602a3f")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { removeFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, generateItemId, normalizeItemId, canonicalDocument, normalizeItemMetadata, serializeItemDocument, assertParentReferenceIsNotSelf, isPlaceholderReferenceToken, normalizeParentReferenceValue, validateMissingParentReference, validateSprintOrReleaseValue, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, resolvePriority, getFocusedItem, normalizeStatusInput, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, acquireLock, printError, buildInvalidTypeError, resolveTypeSynonym, collectRuntimeCreateFieldValues, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, PmCliError, nowIso, resolveIsoOrRelative, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveCommandHandler, runActiveBeforeMutationHooks, runActiveOnWriteHooks, collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, listAllItemMetadataLight, locateItem, createMutationGuardSdk, getHistoryPath, getItemPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
9
10
|
import { requireTerminalReasonWithRecovery } from "../lifecycle-policy.js";
|
|
10
11
|
import { evaluateSimilarityGovernance, similarityAdvisoryWarnings, } from "../similarity.js";
|
|
11
12
|
import { acquireItemMetadataDerivedIndexLock, refreshItemMetadataDerivedIndex, } from "../item-metadata-index.js";
|
|
@@ -837,12 +838,7 @@ async function loadCreateTemplateOptionsFromRuntime(templateName, global, pmRoot
|
|
|
837
838
|
return readTemplateOptionsFromRuntimeResult(handlerResult.result, templateName);
|
|
838
839
|
}
|
|
839
840
|
function ensureInitHasRun(pmRoot) {
|
|
840
|
-
return
|
|
841
|
-
/* c8 ignore next -- init guard failures are covered by top-level create command tests. */
|
|
842
|
-
if (!exists) {
|
|
843
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
844
|
-
}
|
|
845
|
-
});
|
|
841
|
+
return assertInitializedTracker(pmRoot);
|
|
846
842
|
}
|
|
847
843
|
/**
|
|
848
844
|
* Resolve an optional string item-metadata field for {@link runCreate}: yields
|
|
@@ -1890,4 +1886,4 @@ export const _testOnlyCreateCommand = {
|
|
|
1890
1886
|
typeOptionExampleValue,
|
|
1891
1887
|
};
|
|
1892
1888
|
//# sourceMappingURL=create.js.map
|
|
1893
|
-
//# debugId=
|
|
1889
|
+
//# debugId=a10348fe-746d-5dc7-8cd4-30453c602a3f
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* Implements the SDK-owned delete lifecycle operation shared by every surface.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="7819b53c-b0e4-50b0-a670-f80b36765085")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
8
9
|
import path from "node:path";
|
|
9
|
-
import {
|
|
10
|
+
import { toItemRecord, deleteItem, getHistoryPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
10
11
|
/** Implements run delete for the public runtime surface of this module. */
|
|
11
12
|
export async function runDelete(id, options, global) {
|
|
12
13
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
13
|
-
|
|
14
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
15
|
-
}
|
|
14
|
+
await assertInitializedTracker(pmRoot);
|
|
16
15
|
const settings = await readSettings(pmRoot);
|
|
17
16
|
const author = resolveAuthor(options.author, settings.author_default);
|
|
18
17
|
const result = await deleteItem({
|
|
@@ -44,4 +43,4 @@ export async function runDelete(id, options, global) {
|
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
//# sourceMappingURL=delete.js.map
|
|
47
|
-
//# debugId=
|
|
46
|
+
//# debugId=7819b53c-b0e4-50b0-a670-f80b36765085
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/lifecycle/focus
|
|
3
|
-
*
|
|
4
|
-
* Implements the SDK-owned focus lifecycle operation shared by every surface.
|
|
5
|
-
*/
|
|
6
1
|
import { type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
/** Documents the focus options payload exchanged by command, SDK, and package integrations. */
|
|
8
3
|
export interface FocusOptions {
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
* Implements the SDK-owned focus lifecycle operation shared by every surface.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="a5ddb139-9780-50e0-87a5-621913cb0de4")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { getActiveExtensionRegistrations, normalizeItemId, resolveItemTypeRegistry, EXIT_CODE, PmCliError, clearFocusedItem, getFocusedItem, setFocusedItem, buildItemNotFoundError, locateItem, readLocatedItem, resolvePmRoot, readSettings, resolveAuthor, resolveClaimPrincipal, } from "../runtime-primitives.js";
|
|
9
10
|
import { recordFocusSemanticAttribution } from "../context/semantic-session-attribution.js";
|
|
10
11
|
async function ensureInitialized(pmRoot) {
|
|
11
|
-
|
|
12
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
13
|
-
}
|
|
12
|
+
await assertInitializedTracker(pmRoot);
|
|
14
13
|
}
|
|
15
14
|
/** Implements run focus for the public runtime surface of this module. */
|
|
16
15
|
export async function runFocus(id, options, global) {
|
|
@@ -90,4 +89,4 @@ function nonEmptyTitleOrNull(title) {
|
|
|
90
89
|
return title.trim().length > 0 ? title : null;
|
|
91
90
|
}
|
|
92
91
|
//# sourceMappingURL=focus.js.map
|
|
93
|
-
//# debugId=
|
|
92
|
+
//# debugId=a5ddb139-9780-50e0-87a5-621913cb0de4
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
2
|
+
/** Minimal generic dispatch context consumed by lifecycle mutation adapters. */
|
|
3
|
+
export interface LifecycleMutationActionContext {
|
|
4
|
+
/** Flat MCP/action arguments. */
|
|
5
|
+
args: Record<string, unknown>;
|
|
6
|
+
/** Normalized command option bag. */
|
|
7
|
+
options: Record<string, unknown>;
|
|
8
|
+
/** Item id resolved from flat arguments, when present. */
|
|
9
|
+
id: string | undefined;
|
|
10
|
+
/** Normalized transport-level force override. */
|
|
11
|
+
force?: boolean;
|
|
12
|
+
/** Presentation-neutral global command options. */
|
|
13
|
+
global: GlobalOptions;
|
|
14
|
+
}
|
|
15
|
+
/** Dispatch close through the shared MCP mutation compaction contract. */
|
|
16
|
+
export declare function runMcpCloseAction(context: LifecycleMutationActionContext): Promise<unknown>;
|
|
17
|
+
/** Dispatch recurrence through the shared MCP mutation compaction contract. */
|
|
18
|
+
export declare function runMcpReopenAction(context: LifecycleMutationActionContext): Promise<unknown>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/runtime-mutation-actions
|
|
3
|
+
*
|
|
4
|
+
* Keeps lifecycle-specific MCP mutation adapters outside the generic runtime
|
|
5
|
+
* dispatcher while preserving the shared token-efficient result projection.
|
|
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]="55869854-565d-52d2-8dca-b66aade074bb")}catch(e){}}();
|
|
9
|
+
import { projectMutationResult } from "../../core/output/mutation-projection.js";
|
|
10
|
+
import { PmCliError } from "../../core/shared/errors.js";
|
|
11
|
+
import { runClose } from "./close.js";
|
|
12
|
+
import { runReopen } from "./reopen.js";
|
|
13
|
+
import { readRuntimeString, withMutationCompaction } from "../runtime-input.js";
|
|
14
|
+
function requireLifecycleItemId(context, options) {
|
|
15
|
+
const id = context.id ?? readRuntimeString(options, "id");
|
|
16
|
+
if (!id) {
|
|
17
|
+
throw new PmCliError("Missing required argument: id", 64);
|
|
18
|
+
}
|
|
19
|
+
return id;
|
|
20
|
+
}
|
|
21
|
+
function readLifecycleReason(context, options) {
|
|
22
|
+
return (readRuntimeString(context.args, "reason") ??
|
|
23
|
+
readRuntimeString(context.args, "text") ??
|
|
24
|
+
readRuntimeString(options, "reason") ??
|
|
25
|
+
readRuntimeString(options, "text"));
|
|
26
|
+
}
|
|
27
|
+
/** Dispatch close through the shared MCP mutation compaction contract. */
|
|
28
|
+
export async function runMcpCloseAction(context) {
|
|
29
|
+
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(context.args, context.options);
|
|
30
|
+
return projectMutationResult(await runClose(requireLifecycleItemId(context, runnerOptions), readLifecycleReason(context, runnerOptions), {
|
|
31
|
+
...runnerOptions,
|
|
32
|
+
force: context.force === true || runnerOptions.force === true,
|
|
33
|
+
}, context.global), {
|
|
34
|
+
changedFields,
|
|
35
|
+
compactEnvelope: changedFields === "compact" && !idOnly,
|
|
36
|
+
idOnly,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/** Dispatch recurrence through the shared MCP mutation compaction contract. */
|
|
40
|
+
export async function runMcpReopenAction(context) {
|
|
41
|
+
const { changedFields, idOnly, runnerOptions } = withMutationCompaction(context.args, context.options);
|
|
42
|
+
return projectMutationResult(await runReopen(requireLifecycleItemId(context, runnerOptions), readLifecycleReason(context, runnerOptions) ?? "", {
|
|
43
|
+
...runnerOptions,
|
|
44
|
+
force: context.force === true || runnerOptions.force === true,
|
|
45
|
+
}, context.global), {
|
|
46
|
+
changedFields,
|
|
47
|
+
compactEnvelope: changedFields === "compact" && !idOnly,
|
|
48
|
+
idOnly,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=mcp-actions.js.map
|
|
52
|
+
//# debugId=55869854-565d-52d2-8dca-b66aade074bb
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/lifecycle/plan
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm plan command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import type { DependencyKind, ItemMetadata, PlanDecision, PlanDiscovery, PlanHarness, PlanMode, PlanStep, PlanStepStatus, PlanValidationCheck } from "../../types/index.js";
|
|
8
3
|
import type { MutationMetadataCommandOptions, SharedLinkedResourceOptions } from "./mutation-command-options.js";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm plan command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
8
|
-
import {
|
|
7
|
+
!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]="49fd5730-99c2-5a93-a80e-83c806a124bf")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { getActiveExtensionRegistrations, isTerminalStatus, resolveItemTypeRegistry, resolveRuntimeStatusRegistry, resolveTypeName, EXIT_CODE, PmCliError, splitCommaList, nowIso, locateItem, mutateItem, readLocatedItem, resolvePmRoot, readSettings, resolveAuthor, isTerminalPlanMode, } from "../runtime-primitives.js";
|
|
9
10
|
import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
|
|
10
11
|
import { runCreate, } from "./create.js";
|
|
11
12
|
import { createUnknownSubcommandError } from "../agent/subcommand-recovery.js";
|
|
@@ -547,9 +548,7 @@ function ensurePlanItem(item) {
|
|
|
547
548
|
}
|
|
548
549
|
async function loadContext(global) {
|
|
549
550
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
550
|
-
|
|
551
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
552
|
-
}
|
|
551
|
+
await assertInitializedTracker(pmRoot);
|
|
553
552
|
const settings = await readSettings(pmRoot);
|
|
554
553
|
return { pmRoot, settings };
|
|
555
554
|
}
|
|
@@ -1587,4 +1586,4 @@ export const _testOnlyPlanCommand = {
|
|
|
1587
1586
|
changedPlanMetadataFields,
|
|
1588
1587
|
};
|
|
1589
1588
|
//# sourceMappingURL=plan.js.map
|
|
1590
|
-
//# debugId=
|
|
1589
|
+
//# debugId=49fd5730-99c2-5a93-a80e-83c806a124bf
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/lifecycle/reopen
|
|
3
|
+
*
|
|
4
|
+
* Reopens terminal work as a recurrence while preserving immutable closure
|
|
5
|
+
* evidence and delegating every state change to the canonical update pipeline.
|
|
6
|
+
*/
|
|
7
|
+
import type { GlobalOptions } from "../../core/shared/command-types.js";
|
|
8
|
+
import { type PreviousTerminalEvidence } from "./update.js";
|
|
9
|
+
export type { PreviousTerminalEvidence } from "./update.js";
|
|
10
|
+
/** Options accepted by the SDK and `pm item reopen` recurrence primitive. */
|
|
11
|
+
export interface ReopenCommandOptions {
|
|
12
|
+
/** Active target status; only the workspace open or in-progress status is allowed. */
|
|
13
|
+
status?: string;
|
|
14
|
+
/** Explicit mutation author override. */
|
|
15
|
+
author?: string;
|
|
16
|
+
/** Optional human-readable history message in addition to structured recurrence context. */
|
|
17
|
+
message?: string;
|
|
18
|
+
/** Override an ownership or stale-lock conflict. */
|
|
19
|
+
force?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Structured recurrence receipt returned by every presentation surface. */
|
|
22
|
+
export interface RecurrenceReceipt {
|
|
23
|
+
/** Required reason that the terminal work became active again. */
|
|
24
|
+
reason: string;
|
|
25
|
+
/** Terminal status observed while holding the item lock. */
|
|
26
|
+
from_status: string;
|
|
27
|
+
/** Active status written through the update pipeline. */
|
|
28
|
+
to_status: string;
|
|
29
|
+
/** Prior terminal evidence retained in immutable history. */
|
|
30
|
+
previous_terminal: PreviousTerminalEvidence;
|
|
31
|
+
}
|
|
32
|
+
/** Result returned after a terminal item is reopened. */
|
|
33
|
+
export interface ReopenResult {
|
|
34
|
+
/** Reopened item metadata. */
|
|
35
|
+
item: Record<string, unknown>;
|
|
36
|
+
/** Fields changed by the canonical update pipeline. */
|
|
37
|
+
changed_fields: string[];
|
|
38
|
+
/** Non-fatal mutation and extension warnings. */
|
|
39
|
+
warnings: string[];
|
|
40
|
+
/** Immutable recurrence transition receipt. */
|
|
41
|
+
recurrence: RecurrenceReceipt;
|
|
42
|
+
}
|
|
43
|
+
/** Reopen terminal work through the canonical update mutation and history path. */
|
|
44
|
+
export declare function runReopen(id: string, reason: string, options: ReopenCommandOptions, global: GlobalOptions): Promise<ReopenResult>;
|
|
@@ -0,0 +1,69 @@
|
|
|
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]="08dcee99-5572-5133-b76a-6a50e4e292e7")}catch(e){}}();
|
|
3
|
+
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
4
|
+
import { PmCliError } from "../../core/shared/errors.js";
|
|
5
|
+
import { normalizeStatusInput } from "../../core/item/status.js";
|
|
6
|
+
import { resolveRuntimeStatusRegistry } from "../../core/schema/runtime-schema.js";
|
|
7
|
+
import { resolvePmRoot } from "../../core/store/paths.js";
|
|
8
|
+
import { readSettings } from "../../core/store/settings.js";
|
|
9
|
+
import { resolveStartTaskInProgressStatus } from "../start-task-status.js";
|
|
10
|
+
import { runReopenUpdate, } from "./update.js";
|
|
11
|
+
/** Reopen terminal work through the canonical update mutation and history path. */
|
|
12
|
+
export async function runReopen(id, reason, options, global) {
|
|
13
|
+
const normalizedReason = reason.trim();
|
|
14
|
+
if (normalizedReason.length === 0) {
|
|
15
|
+
throw new PmCliError("pm item reopen requires a non-empty recurrence reason.", EXIT_CODE.USAGE, {
|
|
16
|
+
code: "reopen_reason_required",
|
|
17
|
+
required: "Describe why the terminal work became active again.",
|
|
18
|
+
recovery: {
|
|
19
|
+
suggested_retry: `pm item reopen ${id} "<recurrence reason>"`,
|
|
20
|
+
suggested_retry_args: ["item", "reopen", id, "<recurrence reason>"],
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
25
|
+
const statusRegistry = resolveRuntimeStatusRegistry((await readSettings(pmRoot)).schema);
|
|
26
|
+
const openStatus = statusRegistry.open_status;
|
|
27
|
+
const inProgressStatus = resolveStartTaskInProgressStatus(statusRegistry);
|
|
28
|
+
const requestedStatus = options.status ?? openStatus;
|
|
29
|
+
const targetStatus = normalizeStatusInput(requestedStatus, statusRegistry) ?? requestedStatus;
|
|
30
|
+
if (targetStatus !== openStatus && targetStatus !== inProgressStatus) {
|
|
31
|
+
throw new PmCliError(`Reopen target status must be ${openStatus} or ${inProgressStatus}; received ${requestedStatus}.`, EXIT_CODE.USAGE, {
|
|
32
|
+
code: "reopen_target_status_invalid",
|
|
33
|
+
required: "Choose the workspace open or in-progress lifecycle status.",
|
|
34
|
+
recovery: {
|
|
35
|
+
allowed_values: [...new Set([openStatus, inProgressStatus])],
|
|
36
|
+
suggested_retry: `pm item reopen ${id} "${normalizedReason}" --status ${openStatus}`,
|
|
37
|
+
suggested_retry_args: [
|
|
38
|
+
"item",
|
|
39
|
+
"reopen",
|
|
40
|
+
id,
|
|
41
|
+
normalizedReason,
|
|
42
|
+
"--status",
|
|
43
|
+
openStatus,
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const update = await runReopenUpdate(id, {
|
|
49
|
+
status: targetStatus,
|
|
50
|
+
unset: [
|
|
51
|
+
"close-reason",
|
|
52
|
+
"resolution",
|
|
53
|
+
"expected-result",
|
|
54
|
+
"actual-result",
|
|
55
|
+
"fixed-version",
|
|
56
|
+
],
|
|
57
|
+
author: options.author,
|
|
58
|
+
message: options.message,
|
|
59
|
+
force: options.force,
|
|
60
|
+
}, global, normalizedReason);
|
|
61
|
+
return {
|
|
62
|
+
item: update.item,
|
|
63
|
+
changed_fields: update.changed_fields,
|
|
64
|
+
warnings: update.warnings,
|
|
65
|
+
recurrence: update.lifecycle_transition,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=reopen.js.map
|
|
69
|
+
//# debugId=08dcee99-5572-5133-b76a-6a50e4e292e7
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Implements the SDK-owned restore lifecycle operation shared by every surface.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="db5f3a6d-9ae5-5f9b-bedf-766b2b79324c")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
8
9
|
import jsonPatch from "fast-json-patch";
|
|
9
10
|
import fs from "node:fs/promises";
|
|
10
|
-
import { pathExists, readFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, enforceHistoryStreamPolicyForItem, normalizeItemId, normalizeRawItemId, canonicalDocument, serializeItemDocument, resolveItemTypeRegistry, acquireLock, EXIT_CODE, PmCliError, nowIso, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveOnWriteHooks, runActiveBeforeMutationHooks, locateItem, createMutationGuardSdk, readLocatedItem, getHistoryPath, getItemPath,
|
|
11
|
+
import { pathExists, readFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, replayToCanonicalItemDocument, replayToItemDocument, toReplayDocument, enforceHistoryStreamPolicyForItem, normalizeItemId, normalizeRawItemId, canonicalDocument, serializeItemDocument, resolveItemTypeRegistry, acquireLock, EXIT_CODE, PmCliError, nowIso, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveOnWriteHooks, runActiveBeforeMutationHooks, locateItem, createMutationGuardSdk, readLocatedItem, getHistoryPath, getItemPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
11
12
|
import { applyHistoryPatch, ensureMaterializedHistoryTarget as ensureMaterializedRestoreTarget, extractPatchFailureContext, readHistoryEntries, replayHistoryToTarget as replayToTarget, resolveHistoryTarget, } from "../history-read.js";
|
|
12
13
|
import { acquireItemMetadataDerivedIndexLock, refreshItemMetadataDerivedIndex, } from "../item-metadata-index.js";
|
|
13
14
|
/** Resolve restore targets with the command's established wording and at-or-before timestamp semantics. */
|
|
@@ -163,9 +164,7 @@ async function runRestoreWriteHooks(params) {
|
|
|
163
164
|
/** Implements run restore for the public runtime surface of this module. */
|
|
164
165
|
export async function runRestore(id, target, options, global) {
|
|
165
166
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
166
|
-
|
|
167
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
168
|
-
}
|
|
167
|
+
await assertInitializedTracker(pmRoot);
|
|
169
168
|
const settings = await readSettings(pmRoot);
|
|
170
169
|
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
171
170
|
const subject = await resolveRestoreSubject(pmRoot, id, settings, typeRegistry.type_to_folder);
|
|
@@ -317,4 +316,4 @@ export const _testOnlyRestoreCommand = {
|
|
|
317
316
|
resolveRestoreSubject,
|
|
318
317
|
};
|
|
319
318
|
//# sourceMappingURL=restore.js.map
|
|
320
|
-
//# debugId=
|
|
319
|
+
//# debugId=db5f3a6d-9ae5-5f9b-bedf-766b2b79324c
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module cli/commands/update-many
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm update many command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { type RuntimeFieldRegistry, type RuntimeStatusRegistry, type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import type { ItemStatus, PmSettings } from "../../types/index.js";
|
|
8
3
|
import { hasListFilters } from "../query/list-filter-shared.js";
|