@unbrained/pm-cli 2026.8.20 → 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 +22 -0
- package/dist/cli/error-guidance.d.ts +20 -0
- package/dist/cli/error-guidance.js +29 -30
- package/dist/cli-bundle/bundle-manifest.json +151 -151
- package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +197 -0
- package/dist/cli-bundle/chunks/{chunk-K3EN3LK2.js → chunk-3AFAUHUE.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7VHZS727.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-L4LGPBJU.js → chunk-BKYB45NQ.js} +68 -68
- package/dist/cli-bundle/chunks/{chunk-4GB2LTOQ.js → chunk-BUNIEJNE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XYDDWBZN.js → chunk-JSLOFXGA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TSMWLCHS.js → chunk-LARJJ3RK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7BRF2BX2.js → chunk-LOVTQ52Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-US2ZQW2M.js → chunk-N3DSV4CH.js} +47 -47
- 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-JSAQCVOC.js → register-list-query-F57EWDEF.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-XJPAW63D.js → register-mutation-7IY2D5KO.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-DSOSB2XQ.js → register-operations-FALL3YTU.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-QUR6QL2C.js → register-setup-HXU7IZZD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FUREQLQN.js → chunk-2NIY5NKG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-G3C5ERXG.js → chunk-4ERLO7QD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +50 -0
- package/dist/cli-bundle/focused-chunks/{chunk-AZBACT5T.js → chunk-CKKQSJNN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-GXWQBE3T.js → chunk-F2A56DHV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-M32HFIQB.js → chunk-F4YEW5I2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UGSS4F5X.js → chunk-FH6DYED3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TDR5OGG3.js → chunk-FJ22HNRP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-Q47EX4DI.js → chunk-JEAVFOWM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OM65KHGF.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-JWKEDZJI.js → chunk-TJ7EMJ46.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5L7M4AI7.js → chunk-UZE7XUZK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-325UXIO7.js → chunk-YKBKIEAJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-BLJCGGID.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 +40 -40
- 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/shared/errors.d.ts +16 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/store/item-store.js +6 -91
- package/dist/core/store/tracker-preflight.d.ts +7 -0
- package/dist/core/store/tracker-preflight.js +142 -0
- package/dist/sdk/agent/tracker-preflight-contracts.d.ts +63 -0
- package/dist/sdk/agent/tracker-preflight-contracts.js +127 -0
- package/dist/sdk/annotations.js +6 -7
- 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 +1 -0
- package/dist/sdk/contracts.js +3 -2
- 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 +39 -3
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +69 -8
- 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 +2 -0
- package/dist/sdk/index.js +4 -2
- 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/plan.d.ts +0 -5
- package/dist/sdk/lifecycle/plan.js +5 -6
- 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 +0 -5
- package/dist/sdk/lifecycle/update.js +48 -9
- 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 +0 -5
- package/dist/sdk/query/get.js +5 -6
- package/dist/sdk/query/history.d.ts +0 -5
- package/dist/sdk/query/history.js +5 -6
- package/dist/sdk/query/list.js +5 -7
- package/dist/sdk/query/search.js +5 -7
- 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/schema-migration.js +6 -7
- package/dist/sdk/schema.js +5 -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/DEPENDENCY_KIND_CONTRACT.md +12 -1
- package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +37 -0
- package/docs/RELATIONSHIP_GRAPH.md +92 -10
- package/docs/SDK_PRIMITIVE_INVENTORY.md +15 -1
- package/marketplace.json +2 -2
- package/package.json +1 -1
- 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 +255 -21
- package/dist/cli-bundle/chunks/chunk-2RDVGYWE.js +0 -13
- package/dist/cli-bundle/chunks/chunk-BLVQHFSY.js +0 -35
- package/dist/cli-bundle/chunks/chunk-CU25EQVV.js +0 -5
- package/dist/cli-bundle/chunks/chunk-RS3IV2R6.js +0 -197
- package/dist/cli-bundle/focused-chunks/chunk-6AHG2YW7.js +0 -50
- package/dist/cli-bundle/focused-chunks/chunk-KYZ6JGPL.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-RIHDMCUM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-T4ZFY7ZJ.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-Z3PLWSGM.js +0 -2
|
@@ -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
|
|
@@ -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";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm update 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]="7a157c2e-e9e6-5bce-b124-0a7d34e3c7dc")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { createCheckpointId, loadMutationCheckpoint, restoreCheckpointItems, writeMutationCheckpoint, toItemRecord, applyAcceptanceCriteriaMutations, applyTagRemovals, mergeAdditiveTags, parseOptionalNonNegativeInteger, parseTags, splitAcceptanceCriteria, resolvePriority, normalizeStatusInput, resolveItemTypeRegistry, resolveTypeName, collectRuntimeUpdateFieldValues, buildInvalidTypeError, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, PmCliError, toErrorMessage, stableValueEquals, nowIso, resolveIsoOrRelative, getActiveExtensionRegistrations, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
9
10
|
import { assertDependencyTargetsResolvable } from "../dependency-flag-validation.js";
|
|
10
11
|
import { parseStatusFilterCsv } from "../../core/item/status-filter.js";
|
|
11
12
|
import { hasListFilters } from "../query/list-filter-shared.js";
|
|
@@ -588,9 +589,7 @@ const buildUnmatchedIdFields = (plan) => plan.unmatchedIds === undefined
|
|
|
588
589
|
/** Loads tracker settings and runtime registries for update-many execution. */
|
|
589
590
|
const loadUpdateManyRuntimeContext = async (global) => {
|
|
590
591
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
591
|
-
|
|
592
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
593
|
-
}
|
|
592
|
+
await assertInitializedTracker(pmRoot);
|
|
594
593
|
const settings = await readSettings(pmRoot);
|
|
595
594
|
return {
|
|
596
595
|
pmRoot,
|
|
@@ -853,4 +852,4 @@ export const _testOnlyUpdateManyCommand = {
|
|
|
853
852
|
toComparablePreviewValue,
|
|
854
853
|
};
|
|
855
854
|
//# sourceMappingURL=update-many.js.map
|
|
856
|
-
//# debugId=
|
|
855
|
+
//# debugId=7a157c2e-e9e6-5bce-b124-0a7d34e3c7dc
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/lifecycle/update
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm update command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { resolveItemTypeRegistry, type RuntimeFieldRegistry, type RuntimeStatusRegistry, type NormalizedTypeWorkflow, type GlobalOptions, PmCliError, getActiveExtensionRegistrations, readSettings } from "../runtime-primitives.js";
|
|
7
2
|
import type { Dependency, GovernanceWorkflowEnforcement, ItemDocument } from "../../types/index.js";
|
|
8
3
|
import { DEPENDENCY_KIND_VALUES } from "../../types/index.js";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm update 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]="d024d9cf-81f8-5690-b8f4-03620e3e9bf8")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { COMMON_MUTATION_COMMAND_OPTION_KEYS, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, normalizeItemId, toItemRecord, buildInvalidTypeError, assertParentReferenceIsNotSelf, normalizeParentReferenceValue, validateMissingParentReference, validateSprintOrReleaseValue, applyAcceptanceCriteriaMutations, applyTagRemovals, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, splitAcceptanceCriteria, resolvePriority, normalizeStatusInput, isTerminalStatus, collectRuntimeUpdateFieldValues, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, describeAllowedTransitions, evaluateTransition, resolveTypeWorkflows, EXIT_CODE, PmCliError, stableValueEquals, resolveIsoOrRelative, getActiveExtensionRegistrations, collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, buildItemNotFoundError, listAllItemMetadataLight, locateItem, readLocatedItem, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
9
10
|
import { mutateItemWithHistoryContextResolver } from "../../core/store/item-store.js";
|
|
10
11
|
import { runClose } from "./close.js";
|
|
11
12
|
import { normalizeRiskInput, normalizeSeverityInput, parseConfidenceInput, parseRegressionInput, } from "./metadata-normalizers.js";
|
|
@@ -440,9 +441,9 @@ function parseDependencyRemovals(raw, prefix) {
|
|
|
440
441
|
if (!trimmed) {
|
|
441
442
|
throw new PmCliError("--dep-remove requires id or key/value selectors", EXIT_CODE.USAGE);
|
|
442
443
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
444
|
+
const isStructured = looksLikeStructuredDependencyEntry(trimmed);
|
|
445
|
+
assertValidBareDependencyFlagValue(trimmed, isStructured, "--dep-remove");
|
|
446
|
+
if (isStructured) {
|
|
446
447
|
const kv = parseCsvKv(trimmed, "--dep-remove");
|
|
447
448
|
assertNoUnknownCsvKeys(kv, "--dep-remove", DEP_REMOVE_KEYS);
|
|
448
449
|
const idRaw = kv.id?.trim();
|
|
@@ -1082,9 +1083,7 @@ async function buildNoopUpdateResult(params) {
|
|
|
1082
1083
|
};
|
|
1083
1084
|
}
|
|
1084
1085
|
async function assertUpdateTrackerInitialized(pmRoot) {
|
|
1085
|
-
|
|
1086
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
1087
|
-
}
|
|
1086
|
+
await assertInitializedTracker(pmRoot);
|
|
1088
1087
|
}
|
|
1089
1088
|
function assertMatchingOrderRank(options) {
|
|
1090
1089
|
if (options.order !== undefined &&
|
|
@@ -1313,6 +1312,44 @@ function applyTypeOptionMutation(document, context, activeTypeName, changedField
|
|
|
1313
1312
|
}
|
|
1314
1313
|
document.metadata.type_options = validation.normalized;
|
|
1315
1314
|
}
|
|
1315
|
+
/** Collapse duplicate rows only for identities explicitly touched by this mutation. */
|
|
1316
|
+
function normalizeTouchedDependencyIdentities(current, additions) {
|
|
1317
|
+
const touchedKeys = new Set(additions.map((entry) => dependencyKey(entry)));
|
|
1318
|
+
const retainedTouchedKeys = new Set();
|
|
1319
|
+
return current.filter((entry) => {
|
|
1320
|
+
const key = dependencyKey(entry);
|
|
1321
|
+
if (!touchedKeys.has(key)) {
|
|
1322
|
+
return true;
|
|
1323
|
+
}
|
|
1324
|
+
if (retainedTouchedKeys.has(key)) {
|
|
1325
|
+
return false;
|
|
1326
|
+
}
|
|
1327
|
+
retainedTouchedKeys.add(key);
|
|
1328
|
+
return true;
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
/** Refuse lossless removals unless every selector resolves against stored edges. */
|
|
1332
|
+
function assertDependencyRemovalSelectorsMatch(current, selectors, itemId) {
|
|
1333
|
+
const unmatchedSelectors = selectors.filter((selector) => !current.some((entry) => matchesDependencySelector(entry, selector)));
|
|
1334
|
+
if (unmatchedSelectors.length === 0) {
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
throw new PmCliError(`Dependency removal did not match ${unmatchedSelectors.length === 1 ? "a stored edge" : "stored edges"}.`, EXIT_CODE.NOT_FOUND, {
|
|
1338
|
+
code: "dependency_remove_no_match",
|
|
1339
|
+
reason: "selector_not_found",
|
|
1340
|
+
unmatched_selectors: unmatchedSelectors,
|
|
1341
|
+
available_dependencies: current.map((entry) => ({
|
|
1342
|
+
id: entry.id,
|
|
1343
|
+
kind: entry.kind,
|
|
1344
|
+
source_kind: entry.source_kind,
|
|
1345
|
+
})),
|
|
1346
|
+
why: "Failing on a zero-match selector prevents a mistyped dependency removal from being reported as successful.",
|
|
1347
|
+
nextSteps: [
|
|
1348
|
+
`Inspect the current item with: pm get ${itemId} --full`,
|
|
1349
|
+
"Retry --dep-remove with the exact id, kind, and optional source_kind shown in dependencies.",
|
|
1350
|
+
],
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1316
1353
|
function applyDependencyMutations(document, context, changedFields) {
|
|
1317
1354
|
if (context.options.dep === undefined &&
|
|
1318
1355
|
context.options.depRemove === undefined &&
|
|
@@ -1323,6 +1360,7 @@ function applyDependencyMutations(document, context, changedFields) {
|
|
|
1323
1360
|
? []
|
|
1324
1361
|
: [...(document.metadata.dependencies ?? [])];
|
|
1325
1362
|
if (context.dependencyUpdates.additions.length > 0) {
|
|
1363
|
+
nextDependencies = normalizeTouchedDependencyIdentities(nextDependencies, context.dependencyUpdates.additions);
|
|
1326
1364
|
const seen = new Set(nextDependencies.map((entry) => dependencyKey(entry)));
|
|
1327
1365
|
for (const addition of context.dependencyUpdates.additions) {
|
|
1328
1366
|
const key = dependencyKey(addition);
|
|
@@ -1333,6 +1371,7 @@ function applyDependencyMutations(document, context, changedFields) {
|
|
|
1333
1371
|
}
|
|
1334
1372
|
}
|
|
1335
1373
|
if (context.dependencyRemovals.length > 0) {
|
|
1374
|
+
assertDependencyRemovalSelectorsMatch(nextDependencies, context.dependencyRemovals, document.metadata.id);
|
|
1336
1375
|
nextDependencies = nextDependencies.filter((entry) => !context.dependencyRemovals.some((selector) => matchesDependencySelector(entry, selector)));
|
|
1337
1376
|
}
|
|
1338
1377
|
if (nextDependencies.length === 0) {
|
|
@@ -1982,4 +2021,4 @@ export const _testOnlyUpdateCommand = {
|
|
|
1982
2021
|
resolveRuntimeUnsetDefinition: (token, registry) => resolveRuntimeUnsetFieldDefinition(token, "update", registry),
|
|
1983
2022
|
};
|
|
1984
2023
|
//# sourceMappingURL=update.js.map
|
|
1985
|
-
//# debugId=
|
|
2024
|
+
//# debugId=d024d9cf-81f8-5690-b8f4-03620e3e9bf8
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* Implements the pm linked artifacts 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]="
|
|
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]="1832e2b3-0ece-523d-8f38-598303d3f590")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
8
9
|
import fs from "node:fs/promises";
|
|
9
10
|
import path from "node:path";
|
|
10
11
|
import fg from "fast-glob";
|
|
11
|
-
import { isFileAbsentError
|
|
12
|
+
import { isFileAbsentError } from "../core/fs/fs-utils.js";
|
|
12
13
|
import { getActiveExtensionRegistrations } from "../core/extensions/index.js";
|
|
13
14
|
import { assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, parseCsvKv, } from "../core/item/parse.js";
|
|
14
15
|
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
@@ -18,7 +19,7 @@ import { PmCliError } from "../core/shared/errors.js";
|
|
|
18
19
|
import { splitCommaList } from "../core/shared/split-comma-list.js";
|
|
19
20
|
import { stableValueEquals } from "../core/shared/serialization.js";
|
|
20
21
|
import { locateItem, mutateItem, readLocatedItem, } from "../core/store/item-store.js";
|
|
21
|
-
import {
|
|
22
|
+
import { resolvePmRoot, resolveWorkspaceRoot, } from "../core/store/paths.js";
|
|
22
23
|
import { readSettings } from "../core/store/settings.js";
|
|
23
24
|
import { SCOPE_VALUES } from "../types/index.js";
|
|
24
25
|
import { resolveAuthor } from "../core/shared/author.js";
|
|
@@ -450,9 +451,7 @@ export async function runLinkedArtifacts(id, options, global, config) {
|
|
|
450
451
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
451
452
|
const workspaceRoot = resolveWorkspaceRoot(pmRoot);
|
|
452
453
|
const invocationRoot = process.cwd();
|
|
453
|
-
|
|
454
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
455
|
-
}
|
|
454
|
+
await assertInitializedTracker(pmRoot);
|
|
456
455
|
const settings = await readSettings(pmRoot);
|
|
457
456
|
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
458
457
|
const resolvedAdds = await stdinResolver.resolveList(options.add, "--add");
|
|
@@ -539,4 +538,4 @@ export function renameArtifactsResultKey(result, key) {
|
|
|
539
538
|
return out;
|
|
540
539
|
}
|
|
541
540
|
//# sourceMappingURL=linked-artifacts.js.map
|
|
542
|
-
//# debugId=
|
|
541
|
+
//# debugId=1832e2b3-0ece-523d-8f38-598303d3f590
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* mutations refresh the fenced block automatically once it is installed.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
!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]="
|
|
11
|
+
!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]="dea4137f-adbd-5dca-bfc7-b56c99c7aa79")}catch(e){}}();
|
|
12
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
12
13
|
import { isFileMissingError } from "../../core/fs/fs-utils.js";
|
|
13
14
|
import { readFile, realpath, writeFile } from "node:fs/promises";
|
|
14
15
|
import { execFile } from "node:child_process";
|
|
@@ -22,7 +23,7 @@ import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
|
22
23
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
23
24
|
import { resolveAuthor } from "../../core/shared/author.js";
|
|
24
25
|
import { nowIso } from "../../core/shared/time.js";
|
|
25
|
-
import {
|
|
26
|
+
import { resolvePmRoot } from "../../core/store/paths.js";
|
|
26
27
|
import { readSettings, resolveGovernanceKnobs, } from "../../core/store/settings.js";
|
|
27
28
|
import { isPathOutsideRoot } from "../workspace.js";
|
|
28
29
|
import { resolveSourceContextWritePolicy } from "../environment/source-context.js";
|
|
@@ -453,9 +454,7 @@ export async function runMergeInstall(options, global) {
|
|
|
453
454
|
environment: process.env,
|
|
454
455
|
});
|
|
455
456
|
const pmRoot = context.pm_root;
|
|
456
|
-
|
|
457
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
458
|
-
}
|
|
457
|
+
await assertInitializedTracker(pmRoot);
|
|
459
458
|
const workspaceRoot = await resolveGitWorkspaceRoot(context.workspace_start);
|
|
460
459
|
return installMergeFence({
|
|
461
460
|
pmRoot,
|
|
@@ -561,4 +560,4 @@ export async function installMergeFence(options) {
|
|
|
561
560
|
};
|
|
562
561
|
}
|
|
563
562
|
//# sourceMappingURL=install.js.map
|
|
564
|
-
//# debugId=
|
|
563
|
+
//# debugId=dea4137f-adbd-5dca-bfc7-b56c99c7aa79
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
* history store without requiring a daemon or shell subprocess.
|
|
6
6
|
*/
|
|
7
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]="
|
|
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]="01043e67-99d4-5b68-a1b2-33f35f5cef5f")}catch(e){}}();
|
|
9
|
+
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
9
10
|
import { createHash } from "node:crypto";
|
|
10
11
|
import { setTimeout as delay } from "node:timers/promises";
|
|
11
12
|
import { queryHistoryEventIndex, queryHistoryEventStreams, rebuildHistoryEventIndex, } from "../core/history/event-index.js";
|
|
12
|
-
import { pathExists } from "../core/fs/fs-utils.js";
|
|
13
13
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
14
14
|
import { PmCliError } from "../core/shared/errors.js";
|
|
15
15
|
import { stableStringify } from "../core/shared/serialization.js";
|
|
16
|
-
import {
|
|
16
|
+
import { resolvePmRoot } from "../core/store/paths.js";
|
|
17
17
|
import { readSettings } from "../core/store/settings.js";
|
|
18
18
|
import { parseHistoryProvenanceFilters, projectHistoryProvenance, resolveHistoryProvenanceDimensions, summarizeHistoryProvenance, } from "./history-provenance.js";
|
|
19
19
|
const MUTATION_EVENT_CURSOR_VERSION = 1;
|
|
@@ -150,9 +150,7 @@ function resolveMutationEventCursorMode(value) {
|
|
|
150
150
|
/** Read one bounded page of mutation events from the persistent projection. */
|
|
151
151
|
export async function listMutationEvents(options = {}) {
|
|
152
152
|
const pmRoot = resolvePmRoot(options.cwd ?? process.cwd(), options.pmRoot);
|
|
153
|
-
|
|
154
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
155
|
-
}
|
|
153
|
+
await assertInitializedTracker(pmRoot);
|
|
156
154
|
const requestedLimit = parseMutationEventLimit(options.limit);
|
|
157
155
|
const cursorMode = resolveMutationEventCursorMode(options.cursorMode);
|
|
158
156
|
if (options.full === true && options.provenance === true) {
|
|
@@ -292,4 +290,4 @@ export const _testOnlyMutationEvents = {
|
|
|
292
290
|
resolveMutationEventStart,
|
|
293
291
|
};
|
|
294
292
|
//# sourceMappingURL=mutation-events.js.map
|
|
295
|
-
//# debugId=
|
|
293
|
+
//# debugId=01043e67-99d4-5b68-a1b2-33f35f5cef5f
|
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
* helper bodies while keeping each package's explicit field mapping in the package.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
!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]="
|
|
16
|
+
!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]="863df651-49e0-552f-a7f0-92c3cc9a12a2")}catch(e){}}();
|
|
17
17
|
import { appendHistoryEntry, createHistoryEntry, } from "../core/history/history.js";
|
|
18
18
|
import { acquireLock } from "../core/lock/lock.js";
|
|
19
19
|
import { parseTags } from "../core/item/parse.js";
|
|
20
20
|
import { normalizeStatusInput } from "../core/item/status.js";
|
|
21
21
|
import { serializeItemDocument } from "../core/item/item-format.js";
|
|
22
|
-
import { getHistoryPath
|
|
23
|
-
import {
|
|
22
|
+
import { getHistoryPath } from "../core/store/paths.js";
|
|
23
|
+
import { removeFileIfExists, writeFileAtomic, } from "../core/fs/fs-utils.js";
|
|
24
24
|
import { runActiveOnWriteHooks } from "../core/extensions/index.js";
|
|
25
25
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
26
26
|
import { PmCliError } from "../core/shared/errors.js";
|
|
27
27
|
import { resolveAuthor } from "../core/shared/author.js";
|
|
28
28
|
import { nowIso } from "../core/shared/time.js";
|
|
29
|
+
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
29
30
|
/** Returns the trimmed string when `value` is a non-empty string, else undefined. */
|
|
30
31
|
export function toNonEmptyImportString(value) {
|
|
31
32
|
if (typeof value !== "string") {
|
|
@@ -367,10 +368,7 @@ function toImportLinkedTestAssertions(entry) {
|
|
|
367
368
|
}
|
|
368
369
|
/** Throws a NOT_FOUND PmCliError when the tracker has not been initialized. */
|
|
369
370
|
export async function ensureTrackerInitialized(pmRoot) {
|
|
370
|
-
|
|
371
|
-
if (!exists) {
|
|
372
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
373
|
-
}
|
|
371
|
+
await assertInitializedTracker(pmRoot);
|
|
374
372
|
}
|
|
375
373
|
/** Returns an empty item document used as the `before` state on import. */
|
|
376
374
|
export function emptyImportedDocument() {
|
|
@@ -442,4 +440,4 @@ export async function commitImportedItem(params) {
|
|
|
442
440
|
}
|
|
443
441
|
}
|
|
444
442
|
//# sourceMappingURL=package-import-adapters.js.map
|
|
445
|
-
//# debugId=
|
|
443
|
+
//# debugId=863df651-49e0-552f-a7f0-92c3cc9a12a2
|
package/dist/sdk/profile.js
CHANGED
|
@@ -10,16 +10,17 @@
|
|
|
10
10
|
* and human formatting around it.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
!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]="
|
|
13
|
+
!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]="f65b4f1f-5501-5829-a04b-d4fbcfb59f5c")}catch(e){}}();
|
|
14
|
+
import { assertInitializedTracker } from "./environment/tracker-preflight.js";
|
|
14
15
|
import path from "node:path";
|
|
15
|
-
import {
|
|
16
|
+
import { readFileIfExists, } from "../core/fs/fs-utils.js";
|
|
16
17
|
import { writeWorkspaceJsonWithHistory } from "../core/history/workspace-history.js";
|
|
17
18
|
import { acquireLock } from "../core/lock/lock.js";
|
|
18
19
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
19
20
|
import { PmCliError } from "../core/shared/errors.js";
|
|
20
21
|
import { resolveAuthor } from "../core/shared/author.js";
|
|
21
22
|
import { nowIso } from "../core/shared/time.js";
|
|
22
|
-
import {
|
|
23
|
+
import { resolvePmRoot } from "../core/store/paths.js";
|
|
23
24
|
import { readSettings, resolveGovernanceKnobs, writeSettings, } from "../core/store/settings.js";
|
|
24
25
|
import { DEFAULT_RUNTIME_SCHEMA_FILE_PATHS, filePathForSchemaSection, normalizeRuntimeSchemaSettings, } from "../core/schema/runtime-schema.js";
|
|
25
26
|
import { normalizeAddTypeInput, serializeItemTypesFile, } from "../core/schema/item-types-file.js";
|
|
@@ -198,9 +199,7 @@ function buildApplyResult(profile, plan, applied, dryRun, warnings) {
|
|
|
198
199
|
};
|
|
199
200
|
}
|
|
200
201
|
async function assertProfileTrackerInitialized(pmRoot) {
|
|
201
|
-
|
|
202
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
203
|
-
}
|
|
202
|
+
await assertInitializedTracker(pmRoot);
|
|
204
203
|
}
|
|
205
204
|
function resolveProfileForCommand(name) {
|
|
206
205
|
try {
|
|
@@ -453,4 +452,4 @@ export function formatProfileApplyHuman(result) {
|
|
|
453
452
|
}
|
|
454
453
|
/* c8 ignore stop */
|
|
455
454
|
//# sourceMappingURL=profile.js.map
|
|
456
|
-
//# debugId=
|
|
455
|
+
//# debugId=f65b4f1f-5501-5829-a04b-d4fbcfb59f5c
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* Implements the pm activity 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]="
|
|
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]="7005305a-5fd4-56b8-a0a0-5612e8bf48cc")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
8
9
|
import { isFileMissingError } from "../../core/fs/fs-utils.js";
|
|
9
10
|
import fs from "node:fs/promises";
|
|
10
11
|
import path from "node:path";
|
|
11
|
-
import { getActiveExtensionRegistrations, runActiveOnReadHooks,
|
|
12
|
+
import { getActiveExtensionRegistrations, runActiveOnReadHooks, enforceHistoryStreamPolicyForItems, resolveItemTypeRegistry, EXIT_CODE, PmCliError, compareTimestampStrings, nowIso, resolveIsoOrRelative, listAllItemMetadataLight, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
|
|
12
13
|
import { readHistoryEntries } from "../history-read.js";
|
|
13
14
|
import { parseLimit } from "./parsers.js";
|
|
14
15
|
import { resolveModePairedOutputOmissionReceipt, } from "../output-projection.js";
|
|
@@ -168,9 +169,7 @@ function resolveActivityFilters(options, projectionMode) {
|
|
|
168
169
|
}
|
|
169
170
|
async function resolveActivityRuntimeContext(global) {
|
|
170
171
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
171
|
-
|
|
172
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
173
|
-
}
|
|
172
|
+
await assertInitializedTracker(pmRoot);
|
|
174
173
|
return {
|
|
175
174
|
pmRoot,
|
|
176
175
|
settings: await readSettings(pmRoot),
|
|
@@ -400,4 +399,4 @@ export async function runActivity(options, global) {
|
|
|
400
399
|
};
|
|
401
400
|
}
|
|
402
401
|
//# sourceMappingURL=activity.js.map
|
|
403
|
-
//# debugId=
|
|
402
|
+
//# debugId=7005305a-5fd4-56b8-a0a0-5612e8bf48cc
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* Implements the pm calendar 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]="
|
|
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]="47de55f1-589f-5743-bcb8-3b7a6302dfbb")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
8
9
|
import { encode as encodeToon } from "@toon-format/toon";
|
|
9
|
-
import {
|
|
10
|
+
import { getActiveExtensionRegistrations, resolveItemTypeRegistry, normalizeStatusInput, collectRuntimeFilterValues, matchesRuntimeFilters, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, PmCliError, levenshteinDistanceWithinLimit, compareTimestampStrings, nowIso, resolveIsoOrRelative, listAllItemMetadataLight, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
|
|
10
11
|
import { parseIntegerLimit, parsePriority, parseType, } from "./parsers.js";
|
|
11
12
|
import { weekdayOrderIndex, } from "../../types/index.js";
|
|
12
13
|
const CALENDAR_VIEW_VALUES = ["agenda", "day", "week", "month"];
|
|
@@ -928,9 +929,7 @@ function buildCalendarRangeResult(options, rangeBounds) {
|
|
|
928
929
|
/** Implements run calendar for the public runtime surface of this module. */
|
|
929
930
|
export async function runCalendar(options, global) {
|
|
930
931
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
931
|
-
|
|
932
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
933
|
-
}
|
|
932
|
+
await assertInitializedTracker(pmRoot);
|
|
934
933
|
const inputs = resolveCalendarExecutionInputs(options);
|
|
935
934
|
const settings = await readSettings(pmRoot);
|
|
936
935
|
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
@@ -963,4 +962,4 @@ export async function runCalendar(options, global) {
|
|
|
963
962
|
};
|
|
964
963
|
}
|
|
965
964
|
//# sourceMappingURL=calendar.js.map
|
|
966
|
-
//# debugId=
|
|
965
|
+
//# debugId=47de55f1-589f-5743-bcb8-3b7a6302dfbb
|
package/dist/sdk/query/get.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/query/get
|
|
3
|
-
*
|
|
4
|
-
* Implements the SDK-owned item query shared by every surface.
|
|
5
|
-
*/
|
|
6
1
|
import { type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import { type ChildRollupContext } from "../item-children.js";
|
|
8
3
|
import { type ItemScheduleContext } from "../item-schedule.js";
|
package/dist/sdk/query/get.js
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the SDK-owned item query 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]="ff82974e-a48d-5d18-893f-fb618e378795")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { getActiveExtensionRegistrations, toItemRecord, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, TYPE_TO_FOLDER, PmCliError, buildItemNotFoundError, listAllItemMetadataLight, locateItem, readLocatedItem, getHistoryPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
|
|
9
10
|
import { readHistoryEntries } from "../history-read.js";
|
|
10
11
|
import { renderPmCommand } from "../command-line.js";
|
|
11
12
|
import { recordContextUsageTouches } from "../context-usage.js";
|
|
@@ -263,9 +264,7 @@ function resolveGetProjection(options, id) {
|
|
|
263
264
|
}
|
|
264
265
|
async function loadGetItemContext(id, global, at) {
|
|
265
266
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
266
|
-
|
|
267
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
268
|
-
}
|
|
267
|
+
await assertInitializedTracker(pmRoot);
|
|
269
268
|
const settings = await readSettings(pmRoot);
|
|
270
269
|
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
271
270
|
if (at !== undefined) {
|
|
@@ -448,4 +447,4 @@ export const _testOnlyGetCommand = {
|
|
|
448
447
|
shouldAutoIncludeGetChildren,
|
|
449
448
|
};
|
|
450
449
|
//# sourceMappingURL=get.js.map
|
|
451
|
-
//# debugId=
|
|
450
|
+
//# debugId=ff82974e-a48d-5d18-893f-fb618e378795
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module cli/commands/history
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm history command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
1
|
import { type HistoryDiffValueEntry, verifyHistoryChain, type GlobalOptions } from "../runtime-primitives.js";
|
|
7
2
|
import { type HistoryVerificationResult } from "../history-read.js";
|
|
8
3
|
export { readHistoryEntries } from "../history-read.js";
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Implements the pm history 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]="314adea1-6837-5eeb-abc3-57337a495221")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
+
import { pathExists, computeHistoryDiff, patchPathToChangedField, normalizeReplayPatchOps, verifyHistoryChain, enforceHistoryStreamPolicyForItem, EXIT_CODE, PmCliError, getActiveExtensionRegistrations, normalizeItemId, resolveItemTypeRegistry, locateItem, readLocatedItem, getHistoryPath, getWorkspaceHistoryPath, inspectWorkspaceHistoryState, resolvePmRoot, readSettings, WORKSPACE_HISTORY_ID, } from "../runtime-primitives.js";
|
|
9
10
|
import { readHistoryEntries, verifyHistoryEntries, } from "../history-read.js";
|
|
10
11
|
export { readHistoryEntries } from "../history-read.js";
|
|
11
12
|
import { parseLimit } from "./parsers.js";
|
|
@@ -39,9 +40,7 @@ function buildDiffEntries(entries, startIndex) {
|
|
|
39
40
|
}
|
|
40
41
|
async function resolveHistoryReadTarget(id, global) {
|
|
41
42
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
42
|
-
|
|
43
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
44
|
-
}
|
|
43
|
+
await assertInitializedTracker(pmRoot);
|
|
45
44
|
const settings = await readSettings(pmRoot);
|
|
46
45
|
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
47
46
|
const workspaceHistoryRequested = id.trim() === WORKSPACE_HISTORY_ID;
|
|
@@ -161,4 +160,4 @@ export async function runHistory(id, options, global) {
|
|
|
161
160
|
return result;
|
|
162
161
|
}
|
|
163
162
|
//# sourceMappingURL=history.js.map
|
|
164
|
-
//# debugId=
|
|
163
|
+
//# debugId=314adea1-6837-5eeb-abc3-57337a495221
|
package/dist/sdk/query/list.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Implements the pm list 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]="361f891a-5f10-529c-8161-dc5193c7e12a")}catch(e){}}();
|
|
8
|
+
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
9
|
import { getActiveExtensionRegistrations, hasActiveOnReadHooks, } from "../../core/extensions/index.js";
|
|
10
10
|
import { toItemRecord } from "../../core/item/item-record.js";
|
|
11
11
|
import { isTerminalStatus } from "../../core/item/status.js";
|
|
@@ -24,7 +24,7 @@ import { compareTimestampStrings, matchesTimestampFilters, nowIso, resolveIsoOrR
|
|
|
24
24
|
import { listAllItemMetadata, listAllItemMetadataLight, listAllItemMetadataWithBody, } from "../../core/store/item-store.js";
|
|
25
25
|
import { HEAVY_METADATA_KEYS, readItemMetadataDerivedIndexState, } from "../../core/store/item-metadata-cache.js";
|
|
26
26
|
import { queryItemMetadataIndex } from "../../core/store/item-metadata-query-index.js";
|
|
27
|
-
import {
|
|
27
|
+
import { resolvePmRoot } from "../../core/store/paths.js";
|
|
28
28
|
import { readSettings } from "../../core/store/settings.js";
|
|
29
29
|
import { LIST_FILTER_FLAG_CONTRACTS } from "../cli-contracts/flag-contracts.js";
|
|
30
30
|
import { createQueryFingerprint, encodeQueryCursor, resolveQueryCursorStart, selectCursorSemanticOptions, } from "../pagination.js";
|
|
@@ -891,9 +891,7 @@ function buildListPageExtras(limit, hasMore, nextCursor) {
|
|
|
891
891
|
}
|
|
892
892
|
async function resolveListRuntimeContext(options, global) {
|
|
893
893
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
894
|
-
|
|
895
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
896
|
-
}
|
|
894
|
+
await assertInitializedTracker(pmRoot);
|
|
897
895
|
const settings = await readSettings(pmRoot);
|
|
898
896
|
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
899
897
|
const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
|
|
@@ -1243,4 +1241,4 @@ export const _testOnly = {
|
|
|
1243
1241
|
withTreeMetadata,
|
|
1244
1242
|
};
|
|
1245
1243
|
//# sourceMappingURL=list.js.map
|
|
1246
|
-
//# debugId=
|
|
1244
|
+
//# debugId=361f891a-5f10-529c-8161-dc5193c7e12a
|