@unbrained/pm-cli 2026.5.18 → 2026.5.27
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/CHANGELOG.md +953 -472
- package/README.md +4 -11
- package/dist/cli/bootstrap-args.d.ts +18 -1
- package/dist/cli/bootstrap-args.js +143 -3
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +147 -10
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +49 -0
- package/dist/cli/commands/annotation-command.js +135 -0
- package/dist/cli/commands/annotation-command.js.map +1 -0
- package/dist/cli/commands/append.js +5 -8
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -6
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js +15 -24
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +63 -10
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +5 -0
- package/dist/cli/commands/comments.js +27 -117
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.d.ts +2 -2
- package/dist/cli/commands/completion.js +203 -63
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.js +82 -4
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +4 -10
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +168 -36
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +53 -313
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +7 -4
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.d.ts +3 -0
- package/dist/cli/commands/delete.js +11 -9
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +2 -12
- package/dist/cli/commands/docs.js +8 -316
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.d.ts +3 -0
- package/dist/cli/commands/event-validation-messages.js +44 -0
- package/dist/cli/commands/event-validation-messages.js.map +1 -0
- package/dist/cli/commands/extension/bundled-catalog.d.ts +14 -0
- package/dist/cli/commands/extension/bundled-catalog.js +268 -0
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -0
- package/dist/cli/commands/extension/doctor.d.ts +31 -0
- package/dist/cli/commands/extension/doctor.js +345 -0
- package/dist/cli/commands/extension/doctor.js.map +1 -0
- package/dist/cli/commands/extension/install-sources.d.ts +37 -0
- package/dist/cli/commands/extension/install-sources.js +384 -0
- package/dist/cli/commands/extension/install-sources.js.map +1 -0
- package/dist/cli/commands/extension/managed-state.d.ts +48 -0
- package/dist/cli/commands/extension/managed-state.js +172 -0
- package/dist/cli/commands/extension/managed-state.js.map +1 -0
- package/dist/cli/commands/extension/scaffold.d.ts +14 -0
- package/dist/cli/commands/extension/scaffold.js +169 -0
- package/dist/cli/commands/extension/scaffold.js.map +1 -0
- package/dist/cli/commands/extension/shared.d.ts +14 -0
- package/dist/cli/commands/extension/shared.js +106 -0
- package/dist/cli/commands/extension/shared.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +37 -68
- package/dist/cli/commands/extension.js +157 -1319
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.d.ts +1 -12
- package/dist/cli/commands/files.js +14 -318
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +17 -4
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +3 -2
- package/dist/cli/commands/get.js +52 -9
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +10 -0
- package/dist/cli/commands/health.js +269 -76
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -0
- package/dist/cli/commands/history-redact.js +35 -113
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +33 -0
- package/dist/cli/commands/history-repair.js +172 -0
- package/dist/cli/commands/history-repair.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -4
- package/dist/cli/commands/history.js +10 -88
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +28 -0
- package/dist/cli/commands/init.js +23 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +20 -119
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/legacy-none-tokens.d.ts +3 -0
- package/dist/cli/commands/legacy-none-tokens.js +39 -0
- package/dist/cli/commands/legacy-none-tokens.js.map +1 -0
- package/dist/cli/commands/linked-artifacts.d.ts +96 -0
- package/dist/cli/commands/linked-artifacts.js +335 -0
- package/dist/cli/commands/linked-artifacts.js.map +1 -0
- package/dist/cli/commands/linked-test-entry.d.ts +3 -0
- package/dist/cli/commands/linked-test-entry.js +62 -0
- package/dist/cli/commands/linked-test-entry.js.map +1 -0
- package/dist/cli/commands/linked-test-parsers.d.ts +28 -0
- package/dist/cli/commands/linked-test-parsers.js +192 -0
- package/dist/cli/commands/linked-test-parsers.js.map +1 -0
- package/dist/cli/commands/list.js +49 -24
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +4 -3
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +20 -119
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +3 -0
- package/dist/cli/commands/plan.js +184 -22
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.d.ts +26 -0
- package/dist/cli/commands/recurrence-parsers.js +98 -0
- package/dist/cli/commands/recurrence-parsers.js.map +1 -0
- package/dist/cli/commands/restore.js +24 -56
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +31 -0
- package/dist/cli/commands/schema.js +98 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.js +154 -42
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +4 -0
- package/dist/cli/commands/templates.js +89 -17
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test/linked-command-detection.d.ts +37 -0
- package/dist/cli/commands/test/linked-command-detection.js +200 -0
- package/dist/cli/commands/test/linked-command-detection.js.map +1 -0
- package/dist/cli/commands/test-all.js +4 -8
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +2 -2
- package/dist/cli/commands/test.js +12 -357
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +6 -9
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +167 -401
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -1
- package/dist/cli/commands/validate.js +23 -71
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +1 -0
- package/dist/cli/error-guidance.js +100 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +0 -1
- package/dist/cli/extension-command-help.js +2 -13
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +106 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +0 -1
- package/dist/cli/help-content.js +13 -9
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +1 -0
- package/dist/cli/help-json-payload.js +33 -3
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +11 -0
- package/dist/cli/main.js +109 -55
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +5 -2
- package/dist/cli/register-list-query.js +254 -192
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +1 -1
- package/dist/cli/register-mutation.js +247 -64
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +17 -12
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +33 -16
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/registration-helpers.js +14 -40
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli.js +25 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/config/positional-value.d.ts +44 -0
- package/dist/core/config/positional-value.js +109 -0
- package/dist/core/config/positional-value.js.map +1 -0
- package/dist/core/extensions/extension-capability-aliases.d.ts +14 -0
- package/dist/core/extensions/extension-capability-aliases.js +159 -0
- package/dist/core/extensions/extension-capability-aliases.js.map +1 -0
- package/dist/core/extensions/extension-hook-runtime.d.ts +13 -0
- package/dist/core/extensions/extension-hook-runtime.js +414 -0
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -0
- package/dist/core/extensions/extension-policy.d.ts +69 -0
- package/dist/core/extensions/extension-policy.js +481 -0
- package/dist/core/extensions/extension-policy.js.map +1 -0
- package/dist/core/extensions/extension-registries.d.ts +8 -0
- package/dist/core/extensions/extension-registries.js +52 -0
- package/dist/core/extensions/extension-registries.js.map +1 -0
- package/dist/core/extensions/extension-runtime-helpers.d.ts +6 -0
- package/dist/core/extensions/extension-runtime-helpers.js +29 -0
- package/dist/core/extensions/extension-runtime-helpers.js.map +1 -0
- package/dist/core/extensions/extension-types.d.ts +13 -39
- package/dist/core/extensions/extension-types.js +34 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +7 -1
- package/dist/core/extensions/index.js +11 -14
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +4 -22
- package/dist/core/extensions/loader.js +23 -1146
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/path-utils.d.ts +1 -0
- package/dist/core/fs/path-utils.js +12 -0
- package/dist/core/fs/path-utils.js.map +1 -0
- package/dist/core/history/drift-scan.d.ts +22 -0
- package/dist/core/history/drift-scan.js +149 -0
- package/dist/core/history/drift-scan.js.map +1 -0
- package/dist/core/history/history-rewrite.d.ts +43 -0
- package/dist/core/history/history-rewrite.js +48 -0
- package/dist/core/history/history-rewrite.js.map +1 -0
- package/dist/core/history/history.js +5 -4
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/history/replay.d.ts +82 -0
- package/dist/core/history/replay.js +250 -0
- package/dist/core/history/replay.js.map +1 -0
- package/dist/core/item/item-format.js +11 -8
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-record.d.ts +19 -0
- package/dist/core/item/item-record.js +24 -0
- package/dist/core/item/item-record.js.map +1 -0
- package/dist/core/item/item-type-definition.d.ts +52 -0
- package/dist/core/item/item-type-definition.js +123 -0
- package/dist/core/item/item-type-definition.js.map +1 -0
- package/dist/core/item/parse.js +3 -2
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/priority.d.ts +23 -0
- package/dist/core/item/priority.js +55 -0
- package/dist/core/item/priority.js.map +1 -0
- package/dist/core/item/status.d.ts +14 -1
- package/dist/core/item/status.js +22 -2
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +19 -0
- package/dist/core/item/toon-decode.js +69 -0
- package/dist/core/item/toon-decode.js.map +1 -0
- package/dist/core/item/type-registry.js +13 -84
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/mutation-projection.d.ts +31 -0
- package/dist/core/output/mutation-projection.js +103 -0
- package/dist/core/output/mutation-projection.js.map +1 -0
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +5 -3
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/packages/manifest.js +3 -9
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +85 -0
- package/dist/core/schema/item-types-file.js +243 -0
- package/dist/core/schema/item-types-file.js.map +1 -0
- package/dist/core/schema/runtime-schema.d.ts +2 -1
- package/dist/core/schema/runtime-schema.js +17 -45
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +3 -3
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +46 -9
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.d.ts +1 -1
- package/dist/core/sentry/helpers.js +20 -3
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/shared/author.d.ts +1 -0
- package/dist/core/shared/author.js +9 -0
- package/dist/core/shared/author.js.map +1 -0
- package/dist/core/shared/command-types.d.ts +1 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/constants.d.ts +10 -1
- package/dist/core/shared/constants.js +56 -58
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/lazy-module.d.ts +1 -0
- package/dist/core/shared/lazy-module.js +11 -0
- package/dist/core/shared/lazy-module.js.map +1 -0
- package/dist/core/shared/option-alias-visibility.d.ts +44 -0
- package/dist/core/shared/option-alias-visibility.js +76 -0
- package/dist/core/shared/option-alias-visibility.js.map +1 -0
- package/dist/core/shared/primitives.d.ts +23 -0
- package/dist/core/shared/primitives.js +39 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/shared/text-normalization.d.ts +0 -1
- package/dist/core/shared/text-normalization.js +2 -5
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +16 -2
- package/dist/core/store/front-matter-cache.js +99 -33
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +76 -110
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +106 -0
- package/dist/core/store/settings-validator.js +279 -0
- package/dist/core/store/settings-validator.js.map +1 -0
- package/dist/core/store/settings.js +6 -343
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.js +5 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +138 -39
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +20 -0
- package/dist/sdk/cli-contracts/enum-contracts.js +156 -0
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +14 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +243 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +11 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +901 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +18 -33
- package/dist/sdk/cli-contracts.js +96 -1238
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/package-import-adapters.d.ts +74 -0
- package/dist/sdk/package-import-adapters.js +186 -0
- package/dist/sdk/package-import-adapters.js.map +1 -0
- package/dist/sdk/package-runtime-options.d.ts +26 -0
- package/dist/sdk/package-runtime-options.js +71 -0
- package/dist/sdk/package-runtime-options.js.map +1 -0
- package/dist/sdk/runtime.d.ts +27 -1
- package/dist/sdk/runtime.js +48 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +10 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +13 -11
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +5 -28
- package/docs/CODEX_PLUGIN.md +5 -5
- package/docs/COMMANDS.md +58 -9
- package/docs/CONFIGURATION.md +16 -1
- package/docs/EXTENSIONS.md +4 -63
- package/docs/RELEASING.md +12 -8
- package/docs/SDK.md +11 -2
- package/marketplace.json +7 -3
- package/package.json +18 -14
- package/packages/pm-beads/extensions/beads/index.js +2 -49
- package/packages/pm-beads/extensions/beads/index.ts +2 -54
- package/packages/pm-beads/extensions/beads/runtime-loader.js +86 -0
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +88 -0
- package/packages/pm-beads/extensions/beads/runtime.js +26 -115
- package/packages/pm-beads/extensions/beads/runtime.ts +33 -132
- package/packages/pm-calendar/README.md +3 -1
- package/packages/pm-calendar/extensions/calendar/index.js +66 -2
- package/packages/pm-calendar/extensions/calendar/index.ts +71 -2
- package/packages/pm-calendar/extensions/calendar/runtime.js +1 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +1 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +14 -41
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +25 -41
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +10 -50
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +17 -50
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +8 -40
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +10 -40
- package/packages/pm-search-advanced/README.md +8 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +75 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +58 -33
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +60 -33
- package/packages/pm-templates/extensions/templates/runtime.js +11 -202
- package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
- package/packages/pm-todos/extensions/todos/index.js +3 -50
- package/packages/pm-todos/extensions/todos/index.ts +3 -55
- package/packages/pm-todos/extensions/todos/runtime-loader.js +86 -0
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +88 -0
- package/packages/pm-todos/extensions/todos/runtime.js +24 -117
- package/packages/pm-todos/extensions/todos/runtime.ts +32 -129
- package/plugins/pm-claude/README.md +2 -2
- package/plugins/pm-claude/commands/pm-planner.md +1 -15
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +5 -2
- package/plugins/pm-claude/skills/pm-planner/SKILL.md +3 -21
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +15 -6
- package/plugins/pm-codex/skills/pm-native/SKILL.md +1 -13
- package/PRD.md +0 -1734
- package/dist/core/output/command-aware.d.ts +0 -1
- package/dist/core/output/command-aware.js +0 -397
- package/dist/core/output/command-aware.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared external-source import adapter primitives for bundled pm packages.
|
|
3
|
+
*
|
|
4
|
+
* The Beads (pm-beads) and Todos (pm-todos) importers map records from an
|
|
5
|
+
* external format into pm items. The field-by-field mapping is intentionally
|
|
6
|
+
* package-specific (different source schemas, type vocabularies, and timestamp
|
|
7
|
+
* rules), but a number of value-coercion helpers and the item write/commit
|
|
8
|
+
* sequence are behavior-identical across both adapters.
|
|
9
|
+
*
|
|
10
|
+
* These primitives are re-exported from the SDK runtime surface (`src/sdk/runtime.ts`),
|
|
11
|
+
* which is the only module bundled packages are permitted to import (they load it
|
|
12
|
+
* at runtime via `PM_CLI_PACKAGE_ROOT`). Centralizing them here removes copy-pasted
|
|
13
|
+
* helper bodies while keeping each package's explicit field mapping in the package.
|
|
14
|
+
*/
|
|
15
|
+
import type { ItemDocument, ItemStatus, PmSettings } from "../types/index.js";
|
|
16
|
+
/**
|
|
17
|
+
* Returns the trimmed string when `value` is a non-empty string, else undefined.
|
|
18
|
+
*/
|
|
19
|
+
export declare function toNonEmptyImportString(value: unknown): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Coerces a non-negative finite numeric estimate (number or numeric string).
|
|
22
|
+
*/
|
|
23
|
+
export declare function toEstimatedMinutesValue(value: unknown): number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Coerces a priority into the 0..4 range, defaulting to 2.
|
|
26
|
+
*/
|
|
27
|
+
export declare function toImportPriority(value: unknown): 0 | 1 | 2 | 3 | 4;
|
|
28
|
+
/**
|
|
29
|
+
* Normalizes tags from an array of strings or a comma-separated string.
|
|
30
|
+
*/
|
|
31
|
+
export declare function toImportTags(value: unknown): string[];
|
|
32
|
+
/**
|
|
33
|
+
* Maps a raw status value to a canonical pm status, defaulting to "open".
|
|
34
|
+
*/
|
|
35
|
+
export declare function toImportStatus(value: unknown): ItemStatus;
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the effective import author: explicit flag, PM_AUTHOR, then settings,
|
|
38
|
+
* falling back to "unknown".
|
|
39
|
+
*/
|
|
40
|
+
export declare function selectImportAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Throws a NOT_FOUND PmCliError when the tracker has not been initialized.
|
|
43
|
+
*/
|
|
44
|
+
export declare function ensureTrackerInitialized(pmRoot: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Returns an empty item document used as the `before` state on import.
|
|
47
|
+
*/
|
|
48
|
+
export declare function emptyImportedDocument(): ItemDocument;
|
|
49
|
+
export interface CommitImportedItemParams {
|
|
50
|
+
pmRoot: string;
|
|
51
|
+
id: string;
|
|
52
|
+
itemPath: string;
|
|
53
|
+
document: ItemDocument;
|
|
54
|
+
author: string;
|
|
55
|
+
message: string;
|
|
56
|
+
settings: PmSettings;
|
|
57
|
+
/** Warning prefix emitted on a lock conflict, e.g. "beads_import_lock_conflict". */
|
|
58
|
+
conflictWarningPrefix: string;
|
|
59
|
+
}
|
|
60
|
+
export type CommitImportedItemResult = {
|
|
61
|
+
committed: true;
|
|
62
|
+
writeWarnings: string[];
|
|
63
|
+
} | {
|
|
64
|
+
committed: false;
|
|
65
|
+
conflictWarning: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Performs the shared item write/commit sequence: acquire the per-item lock,
|
|
69
|
+
* atomically write the TOON document, append the import history entry, and run
|
|
70
|
+
* on-write hooks. On a lock CONFLICT it returns a `conflictWarning` (using the
|
|
71
|
+
* caller-supplied prefix) instead of throwing; any other error removes the
|
|
72
|
+
* partially written file and rethrows.
|
|
73
|
+
*/
|
|
74
|
+
export declare function commitImportedItem(params: CommitImportedItemParams): Promise<CommitImportedItemResult>;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared external-source import adapter primitives for bundled pm packages.
|
|
3
|
+
*
|
|
4
|
+
* The Beads (pm-beads) and Todos (pm-todos) importers map records from an
|
|
5
|
+
* external format into pm items. The field-by-field mapping is intentionally
|
|
6
|
+
* package-specific (different source schemas, type vocabularies, and timestamp
|
|
7
|
+
* rules), but a number of value-coercion helpers and the item write/commit
|
|
8
|
+
* sequence are behavior-identical across both adapters.
|
|
9
|
+
*
|
|
10
|
+
* These primitives are re-exported from the SDK runtime surface (`src/sdk/runtime.ts`),
|
|
11
|
+
* which is the only module bundled packages are permitted to import (they load it
|
|
12
|
+
* at runtime via `PM_CLI_PACKAGE_ROOT`). Centralizing them here removes copy-pasted
|
|
13
|
+
* helper bodies while keeping each package's explicit field mapping in the package.
|
|
14
|
+
*/
|
|
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]="35a75913-7781-5119-9497-42f4316b14c6")}catch(e){}}();
|
|
17
|
+
import { appendHistoryEntry, createHistoryEntry } from "../core/history/history.js";
|
|
18
|
+
import { acquireLock } from "../core/lock/lock.js";
|
|
19
|
+
import { parseTags } from "../core/item/parse.js";
|
|
20
|
+
import { normalizeStatusInput } from "../core/item/status.js";
|
|
21
|
+
import { serializeItemDocument } from "../core/item/item-format.js";
|
|
22
|
+
import { getHistoryPath, getSettingsPath } from "../core/store/paths.js";
|
|
23
|
+
import { pathExists, removeFileIfExists, writeFileAtomic } from "../core/fs/fs-utils.js";
|
|
24
|
+
import { runActiveOnWriteHooks } from "../core/extensions/index.js";
|
|
25
|
+
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
26
|
+
import { PmCliError } from "../core/shared/errors.js";
|
|
27
|
+
import { nowIso } from "../core/shared/time.js";
|
|
28
|
+
/**
|
|
29
|
+
* Returns the trimmed string when `value` is a non-empty string, else undefined.
|
|
30
|
+
*/
|
|
31
|
+
export function toNonEmptyImportString(value) {
|
|
32
|
+
if (typeof value !== "string") {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const trimmed = value.trim();
|
|
36
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Coerces a non-negative finite numeric estimate (number or numeric string).
|
|
40
|
+
*/
|
|
41
|
+
export function toEstimatedMinutesValue(value) {
|
|
42
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
46
|
+
const parsed = Number(value);
|
|
47
|
+
if (Number.isFinite(parsed) && parsed >= 0) {
|
|
48
|
+
return parsed;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Coerces a priority into the 0..4 range, defaulting to 2.
|
|
55
|
+
*/
|
|
56
|
+
export function toImportPriority(value) {
|
|
57
|
+
if (typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 4) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
61
|
+
const parsed = Number(value);
|
|
62
|
+
if (Number.isInteger(parsed) && parsed >= 0 && parsed <= 4) {
|
|
63
|
+
return parsed;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return 2;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Normalizes tags from an array of strings or a comma-separated string.
|
|
70
|
+
*/
|
|
71
|
+
export function toImportTags(value) {
|
|
72
|
+
if (Array.isArray(value)) {
|
|
73
|
+
const tags = value
|
|
74
|
+
.filter((entry) => typeof entry === "string")
|
|
75
|
+
.map((entry) => entry.trim().toLowerCase())
|
|
76
|
+
.filter((entry) => entry.length > 0);
|
|
77
|
+
return Array.from(new Set(tags)).sort((left, right) => left.localeCompare(right));
|
|
78
|
+
}
|
|
79
|
+
if (typeof value === "string") {
|
|
80
|
+
return parseTags(value);
|
|
81
|
+
}
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Maps a raw status value to a canonical pm status, defaulting to "open".
|
|
86
|
+
*/
|
|
87
|
+
export function toImportStatus(value) {
|
|
88
|
+
const normalized = toNonEmptyImportString(value);
|
|
89
|
+
if (normalized) {
|
|
90
|
+
const canonical = normalizeStatusInput(normalized);
|
|
91
|
+
if (canonical) {
|
|
92
|
+
return canonical;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return "open";
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Resolves the effective import author: explicit flag, PM_AUTHOR, then settings,
|
|
99
|
+
* falling back to "unknown".
|
|
100
|
+
*/
|
|
101
|
+
export function selectImportAuthor(explicitAuthor, settingsAuthor) {
|
|
102
|
+
const explicit = explicitAuthor?.trim();
|
|
103
|
+
if (explicit && explicit.length > 0) {
|
|
104
|
+
return explicit;
|
|
105
|
+
}
|
|
106
|
+
const envAuthor = process.env.PM_AUTHOR?.trim();
|
|
107
|
+
if (envAuthor && envAuthor.length > 0) {
|
|
108
|
+
return envAuthor;
|
|
109
|
+
}
|
|
110
|
+
const settings = settingsAuthor.trim();
|
|
111
|
+
return settings.length > 0 ? settings : "unknown";
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Throws a NOT_FOUND PmCliError when the tracker has not been initialized.
|
|
115
|
+
*/
|
|
116
|
+
export async function ensureTrackerInitialized(pmRoot) {
|
|
117
|
+
const exists = await pathExists(getSettingsPath(pmRoot));
|
|
118
|
+
if (!exists) {
|
|
119
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns an empty item document used as the `before` state on import.
|
|
124
|
+
*/
|
|
125
|
+
export function emptyImportedDocument() {
|
|
126
|
+
return {
|
|
127
|
+
metadata: {},
|
|
128
|
+
body: "",
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Performs the shared item write/commit sequence: acquire the per-item lock,
|
|
133
|
+
* atomically write the TOON document, append the import history entry, and run
|
|
134
|
+
* on-write hooks. On a lock CONFLICT it returns a `conflictWarning` (using the
|
|
135
|
+
* caller-supplied prefix) instead of throwing; any other error removes the
|
|
136
|
+
* partially written file and rethrows.
|
|
137
|
+
*/
|
|
138
|
+
export async function commitImportedItem(params) {
|
|
139
|
+
const { pmRoot, id, itemPath, document, author, message, settings, conflictWarningPrefix } = params;
|
|
140
|
+
const historyPath = getHistoryPath(pmRoot, id);
|
|
141
|
+
try {
|
|
142
|
+
const releaseLock = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author);
|
|
143
|
+
try {
|
|
144
|
+
await writeFileAtomic(itemPath, serializeItemDocument(document, { format: "toon" }));
|
|
145
|
+
try {
|
|
146
|
+
const entry = createHistoryEntry({
|
|
147
|
+
nowIso: nowIso(),
|
|
148
|
+
author,
|
|
149
|
+
op: "import",
|
|
150
|
+
before: emptyImportedDocument(),
|
|
151
|
+
after: document,
|
|
152
|
+
message,
|
|
153
|
+
});
|
|
154
|
+
await appendHistoryEntry(historyPath, entry);
|
|
155
|
+
const writeWarnings = [
|
|
156
|
+
...(await runActiveOnWriteHooks({
|
|
157
|
+
path: itemPath,
|
|
158
|
+
scope: "project",
|
|
159
|
+
op: "import",
|
|
160
|
+
})),
|
|
161
|
+
...(await runActiveOnWriteHooks({
|
|
162
|
+
path: historyPath,
|
|
163
|
+
scope: "project",
|
|
164
|
+
op: "import:history",
|
|
165
|
+
})),
|
|
166
|
+
];
|
|
167
|
+
return { committed: true, writeWarnings };
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
await removeFileIfExists(itemPath);
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
await releaseLock();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
if (error instanceof PmCliError && error.exitCode === EXIT_CODE.CONFLICT) {
|
|
180
|
+
return { committed: false, conflictWarning: `${conflictWarningPrefix}:${id}` };
|
|
181
|
+
}
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=package-import-adapters.js.map
|
|
186
|
+
//# debugId=35a75913-7781-5119-9497-42f4316b14c6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-import-adapters.js","sources":["sdk/package-import-adapters.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared external-source import adapter primitives for bundled pm packages.\n *\n * The Beads (pm-beads) and Todos (pm-todos) importers map records from an\n * external format into pm items. The field-by-field mapping is intentionally\n * package-specific (different source schemas, type vocabularies, and timestamp\n * rules), but a number of value-coercion helpers and the item write/commit\n * sequence are behavior-identical across both adapters.\n *\n * These primitives are re-exported from the SDK runtime surface (`src/sdk/runtime.ts`),\n * which is the only module bundled packages are permitted to import (they load it\n * at runtime via `PM_CLI_PACKAGE_ROOT`). Centralizing them here removes copy-pasted\n * helper bodies while keeping each package's explicit field mapping in the package.\n */\n\nimport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport { parseTags } from \"../core/item/parse.js\";\nimport { normalizeStatusInput } from \"../core/item/status.js\";\nimport { serializeItemDocument } from \"../core/item/item-format.js\";\nimport { getHistoryPath, getSettingsPath } from \"../core/store/paths.js\";\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nimport { runActiveOnWriteHooks } from \"../core/extensions/index.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { nowIso } from \"../core/shared/time.js\";\nimport type { ItemDocument, ItemMetadata, ItemStatus, PmSettings } from \"../types/index.js\";\n\n/**\n * Returns the trimmed string when `value` is a non-empty string, else undefined.\n */\nexport function toNonEmptyImportString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\n/**\n * Coerces a non-negative finite numeric estimate (number or numeric string).\n */\nexport function toEstimatedMinutesValue(value: unknown): number | undefined {\n if (typeof value === \"number\" && Number.isFinite(value) && value >= 0) {\n return value;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n if (Number.isFinite(parsed) && parsed >= 0) {\n return parsed;\n }\n }\n return undefined;\n}\n\n/**\n * Coerces a priority into the 0..4 range, defaulting to 2.\n */\nexport function toImportPriority(value: unknown): 0 | 1 | 2 | 3 | 4 {\n if (typeof value === \"number\" && Number.isInteger(value) && value >= 0 && value <= 4) {\n return value as 0 | 1 | 2 | 3 | 4;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n if (Number.isInteger(parsed) && parsed >= 0 && parsed <= 4) {\n return parsed as 0 | 1 | 2 | 3 | 4;\n }\n }\n return 2;\n}\n\n/**\n * Normalizes tags from an array of strings or a comma-separated string.\n */\nexport function toImportTags(value: unknown): string[] {\n if (Array.isArray(value)) {\n const tags = value\n .filter((entry): entry is string => typeof entry === \"string\")\n .map((entry) => entry.trim().toLowerCase())\n .filter((entry) => entry.length > 0);\n return Array.from(new Set(tags)).sort((left, right) => left.localeCompare(right));\n }\n if (typeof value === \"string\") {\n return parseTags(value);\n }\n return [];\n}\n\n/**\n * Maps a raw status value to a canonical pm status, defaulting to \"open\".\n */\nexport function toImportStatus(value: unknown): ItemStatus {\n const normalized = toNonEmptyImportString(value);\n if (normalized) {\n const canonical = normalizeStatusInput(normalized);\n if (canonical) {\n return canonical;\n }\n }\n return \"open\";\n}\n\n/**\n * Resolves the effective import author: explicit flag, PM_AUTHOR, then settings,\n * falling back to \"unknown\".\n */\nexport function selectImportAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const explicit = explicitAuthor?.trim();\n if (explicit && explicit.length > 0) {\n return explicit;\n }\n const envAuthor = process.env.PM_AUTHOR?.trim();\n if (envAuthor && envAuthor.length > 0) {\n return envAuthor;\n }\n const settings = settingsAuthor.trim();\n return settings.length > 0 ? settings : \"unknown\";\n}\n\n/**\n * Throws a NOT_FOUND PmCliError when the tracker has not been initialized.\n */\nexport async function ensureTrackerInitialized(pmRoot: string): Promise<void> {\n const exists = await pathExists(getSettingsPath(pmRoot));\n if (!exists) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\n/**\n * Returns an empty item document used as the `before` state on import.\n */\nexport function emptyImportedDocument(): ItemDocument {\n return {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n}\n\nexport interface CommitImportedItemParams {\n pmRoot: string;\n id: string;\n itemPath: string;\n document: ItemDocument;\n author: string;\n message: string;\n settings: PmSettings;\n /** Warning prefix emitted on a lock conflict, e.g. \"beads_import_lock_conflict\". */\n conflictWarningPrefix: string;\n}\n\nexport type CommitImportedItemResult =\n | { committed: true; writeWarnings: string[] }\n | { committed: false; conflictWarning: string };\n\n/**\n * Performs the shared item write/commit sequence: acquire the per-item lock,\n * atomically write the TOON document, append the import history entry, and run\n * on-write hooks. On a lock CONFLICT it returns a `conflictWarning` (using the\n * caller-supplied prefix) instead of throwing; any other error removes the\n * partially written file and rethrows.\n */\nexport async function commitImportedItem(\n params: CommitImportedItemParams,\n): Promise<CommitImportedItemResult> {\n const { pmRoot, id, itemPath, document, author, message, settings, conflictWarningPrefix } = params;\n const historyPath = getHistoryPath(pmRoot, id);\n try {\n const releaseLock = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author);\n try {\n await writeFileAtomic(itemPath, serializeItemDocument(document, { format: \"toon\" }));\n try {\n const entry = createHistoryEntry({\n nowIso: nowIso(),\n author,\n op: \"import\",\n before: emptyImportedDocument(),\n after: document,\n message,\n });\n await appendHistoryEntry(historyPath, entry);\n const writeWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"import\",\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"import:history\",\n })),\n ];\n return { committed: true, writeWarnings };\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n } finally {\n await releaseLock();\n }\n } catch (error: unknown) {\n if (error instanceof PmCliError && error.exitCode === EXIT_CODE.CONFLICT) {\n return { committed: false, conflictWarning: `${conflictWarningPrefix}:${id}` };\n }\n throw error;\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;AAEH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EA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AAE,CAAC;QACxB,IAAI,KAAK,YAAY,UAAU,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,qBAAqB,IAAI,EAAE,EAAE,EAAE,CAAC;QACjF,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","debugId":"35a75913-7781-5119-9497-42f4316b14c6"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure option-parsing helpers shared by bundled pm package runtimes.
|
|
3
|
+
*
|
|
4
|
+
* Bundled packages (pm-beads, pm-todos, pm-guide-shell, pm-governance-audit,
|
|
5
|
+
* pm-linked-test-adapters, pm-search-advanced, ...) are standalone-installable
|
|
6
|
+
* and may only depend on the public SDK runtime surface that they already load
|
|
7
|
+
* via `PM_CLI_PACKAGE_ROOT`. These helpers are dependency-free string/boolean
|
|
8
|
+
* coercion utilities; centralizing them here removes copy-pasted helper bodies
|
|
9
|
+
* from each package runtime while staying on the SDK surface those packages are
|
|
10
|
+
* permitted to import.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Returns the first non-empty string value found for `key` or any alias.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readStringOption(options: Record<string, unknown>, key: string, aliases?: string[]): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Coerces the first defined value found for `key` or any alias into a boolean.
|
|
18
|
+
*
|
|
19
|
+
* Accepts native booleans and the canonical truthy/falsy string literals; any
|
|
20
|
+
* other value is ignored so a later alias can still match.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readBooleanOption(options: Record<string, unknown>, key: string, aliases?: string[]): boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Splits a comma-separated string option into trimmed, non-empty entries.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readCsvListOption(options: Record<string, unknown>, key: string, aliases?: string[]): string[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure option-parsing helpers shared by bundled pm package runtimes.
|
|
3
|
+
*
|
|
4
|
+
* Bundled packages (pm-beads, pm-todos, pm-guide-shell, pm-governance-audit,
|
|
5
|
+
* pm-linked-test-adapters, pm-search-advanced, ...) are standalone-installable
|
|
6
|
+
* and may only depend on the public SDK runtime surface that they already load
|
|
7
|
+
* via `PM_CLI_PACKAGE_ROOT`. These helpers are dependency-free string/boolean
|
|
8
|
+
* coercion utilities; centralizing them here removes copy-pasted helper bodies
|
|
9
|
+
* from each package runtime while staying on the SDK surface those packages are
|
|
10
|
+
* permitted to import.
|
|
11
|
+
*/
|
|
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]="73038184-28df-5df7-ad1e-0be2af421b92")}catch(e){}}();
|
|
14
|
+
const BOOLEAN_TRUE_VALUES = new Set(["true", "1", "yes", "on"]);
|
|
15
|
+
const BOOLEAN_FALSE_VALUES = new Set(["false", "0", "no", "off"]);
|
|
16
|
+
/**
|
|
17
|
+
* Returns the first non-empty string value found for `key` or any alias.
|
|
18
|
+
*/
|
|
19
|
+
export function readStringOption(options, key, aliases = []) {
|
|
20
|
+
const keys = [key, ...aliases];
|
|
21
|
+
for (const candidate of keys) {
|
|
22
|
+
const value = options[candidate];
|
|
23
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
24
|
+
return value.trim();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Coerces the first defined value found for `key` or any alias into a boolean.
|
|
31
|
+
*
|
|
32
|
+
* Accepts native booleans and the canonical truthy/falsy string literals; any
|
|
33
|
+
* other value is ignored so a later alias can still match.
|
|
34
|
+
*/
|
|
35
|
+
export function readBooleanOption(options, key, aliases = []) {
|
|
36
|
+
const keys = [key, ...aliases];
|
|
37
|
+
for (const candidate of keys) {
|
|
38
|
+
const value = options[candidate];
|
|
39
|
+
if (value === undefined) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (typeof value === "boolean") {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
if (typeof value === "string") {
|
|
46
|
+
const normalized = value.trim().toLowerCase();
|
|
47
|
+
if (BOOLEAN_TRUE_VALUES.has(normalized)) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (BOOLEAN_FALSE_VALUES.has(normalized)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Splits a comma-separated string option into trimmed, non-empty entries.
|
|
59
|
+
*/
|
|
60
|
+
export function readCsvListOption(options, key, aliases = []) {
|
|
61
|
+
const value = readStringOption(options, key, aliases);
|
|
62
|
+
if (!value) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
return value
|
|
66
|
+
.split(",")
|
|
67
|
+
.map((entry) => entry.trim())
|
|
68
|
+
.filter((entry) => entry.length > 0);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=package-runtime-options.js.map
|
|
71
|
+
//# debugId=73038184-28df-5df7-ad1e-0be2af421b92
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-runtime-options.js","sources":["sdk/package-runtime-options.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Pure option-parsing helpers shared by bundled pm package runtimes.\n *\n * Bundled packages (pm-beads, pm-todos, pm-guide-shell, pm-governance-audit,\n * pm-linked-test-adapters, pm-search-advanced, ...) are standalone-installable\n * and may only depend on the public SDK runtime surface that they already load\n * via `PM_CLI_PACKAGE_ROOT`. These helpers are dependency-free string/boolean\n * coercion utilities; centralizing them here removes copy-pasted helper bodies\n * from each package runtime while staying on the SDK surface those packages are\n * permitted to import.\n */\n\nconst BOOLEAN_TRUE_VALUES = new Set([\"true\", \"1\", \"yes\", \"on\"]);\nconst BOOLEAN_FALSE_VALUES = new Set([\"false\", \"0\", \"no\", \"off\"]);\n\n/**\n * Returns the first non-empty string value found for `key` or any alias.\n */\nexport function readStringOption(\n options: Record<string, unknown>,\n key: string,\n aliases: string[] = [],\n): string | undefined {\n const keys = [key, ...aliases];\n for (const candidate of keys) {\n const value = options[candidate];\n if (typeof value === \"string\" && value.trim().length > 0) {\n return value.trim();\n }\n }\n return undefined;\n}\n\n/**\n * Coerces the first defined value found for `key` or any alias into a boolean.\n *\n * Accepts native booleans and the canonical truthy/falsy string literals; any\n * other value is ignored so a later alias can still match.\n */\nexport function readBooleanOption(\n options: Record<string, unknown>,\n key: string,\n aliases: string[] = [],\n): boolean | undefined {\n const keys = [key, ...aliases];\n for (const candidate of keys) {\n const value = options[candidate];\n if (value === undefined) {\n continue;\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"string\") {\n const normalized = value.trim().toLowerCase();\n if (BOOLEAN_TRUE_VALUES.has(normalized)) {\n return true;\n }\n if (BOOLEAN_FALSE_VALUES.has(normalized)) {\n return false;\n }\n }\n }\n return undefined;\n}\n\n/**\n * Splits a comma-separated string option into trimmed, non-empty entries.\n */\nexport function readCsvListOption(\n options: Record<string, unknown>,\n key: string,\n aliases: string[] = [],\n): string[] {\n const value = readStringOption(options, key, aliases);\n if (!value) {\n return [];\n }\n return value\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;;AAEH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAChE,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,O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ACf,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAgC,EAChC,GAAW,EACX,UAAoB,EAAE;IAEtB,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACtD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK;SACT,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC","debugId":"73038184-28df-5df7-ad1e-0be2af421b92"}
|
package/dist/sdk/runtime.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { type ExtensionRegistrationRegistry } from "../core/extensions/index.js";
|
|
2
|
+
import { type ContractsCommandOptions, type ContractsResult } from "../cli/commands/contracts.js";
|
|
1
3
|
export { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks, } from "../core/extensions/index.js";
|
|
2
4
|
export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from "../core/fs/fs-utils.js";
|
|
3
5
|
export { appendHistoryEntry, createHistoryEntry } from "../core/history/history.js";
|
|
4
6
|
export { generateItemId, normalizeItemId, normalizeRawItemId } from "../core/item/id.js";
|
|
7
|
+
export { readBooleanOption, readCsvListOption, readStringOption } from "./package-runtime-options.js";
|
|
8
|
+
export { commitImportedItem, emptyImportedDocument, ensureTrackerInitialized, selectImportAuthor, toEstimatedMinutesValue, toImportPriority, toImportStatus, toImportTags, toNonEmptyImportString, type CommitImportedItemParams, type CommitImportedItemResult, } from "./package-import-adapters.js";
|
|
5
9
|
export { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter, } from "../core/item/item-format.js";
|
|
6
10
|
export { parseTags } from "../core/item/parse.js";
|
|
7
11
|
export { normalizeStatusInput } from "../core/item/status.js";
|
|
@@ -24,6 +28,28 @@ export { runReindex, type ReindexOptions, type ReindexResult } from "../cli/comm
|
|
|
24
28
|
export { runSearch, type SearchOptions, type SearchResult } from "../cli/commands/search.js";
|
|
25
29
|
export { loadCreateTemplateOptions, runTemplatesList, runTemplatesSave, runTemplatesShow, type CreateTemplateOptions, type TemplatesListResult, type TemplatesSaveResult, type TemplatesShowResult, } from "../cli/commands/templates.js";
|
|
26
30
|
export { runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, type TestRunsListCommandOptions, type TestRunsLogsCommandOptions, type TestRunsResumeCommandOptions, type TestRunsStopCommandOptions, } from "../cli/commands/test-runs.js";
|
|
27
|
-
export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, } from "../types/index.js";
|
|
31
|
+
export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, BUILTIN_ITEM_TYPE_VALUES, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, RISK_VALUES, STATUS_VALUES, } from "../types/index.js";
|
|
28
32
|
export type { GlobalOptions } from "../core/shared/command-types.js";
|
|
29
33
|
export type { Dependency, ItemDocument, ItemMetadata, ItemStatus, ItemType, LinkedDoc, LinkedFile, LinkedTest, LogNote, PmSettings, } from "../types/index.js";
|
|
34
|
+
export interface GetContractsOptions extends ContractsCommandOptions {
|
|
35
|
+
pmRoot?: string;
|
|
36
|
+
cwd?: string;
|
|
37
|
+
noExtensions?: boolean;
|
|
38
|
+
quiet?: boolean;
|
|
39
|
+
profile?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface WorkspaceContractsOptions {
|
|
42
|
+
extensionRegistrations?: ExtensionRegistrationRegistry | null;
|
|
43
|
+
noExtensions?: boolean;
|
|
44
|
+
cwd?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface WorkspaceContracts {
|
|
47
|
+
types: string[];
|
|
48
|
+
statuses: string[];
|
|
49
|
+
openStatus: string;
|
|
50
|
+
closeStatus: string;
|
|
51
|
+
canceledStatus: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function getWorkspaceContracts(pmRoot: string, options?: WorkspaceContractsOptions): Promise<WorkspaceContracts>;
|
|
54
|
+
export declare function getContracts(pmRootOrOptions?: string | GetContractsOptions, options?: GetContractsOptions): Promise<ContractsResult>;
|
|
55
|
+
export type { ContractsCommandOptions, ContractsResult };
|
package/dist/sdk/runtime.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9dfba929-1fc6-569e-8311-91fc06f420bc")}catch(e){}}();
|
|
3
|
+
import { activateExtensions, loadExtensions, } from "../core/extensions/index.js";
|
|
4
|
+
import { resolveItemTypeRegistry } from "../core/item/type-registry.js";
|
|
5
|
+
import { resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
|
|
6
|
+
import { readSettings } from "../core/store/settings.js";
|
|
7
|
+
import { runContracts, } from "../cli/commands/contracts.js";
|
|
3
8
|
export { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks, } from "../core/extensions/index.js";
|
|
4
9
|
export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from "../core/fs/fs-utils.js";
|
|
5
10
|
export { appendHistoryEntry, createHistoryEntry } from "../core/history/history.js";
|
|
6
11
|
export { generateItemId, normalizeItemId, normalizeRawItemId } from "../core/item/id.js";
|
|
12
|
+
export { readBooleanOption, readCsvListOption, readStringOption } from "./package-runtime-options.js";
|
|
13
|
+
export { commitImportedItem, emptyImportedDocument, ensureTrackerInitialized, selectImportAuthor, toEstimatedMinutesValue, toImportPriority, toImportStatus, toImportTags, toNonEmptyImportString, } from "./package-import-adapters.js";
|
|
7
14
|
export { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter, } from "../core/item/item-format.js";
|
|
8
15
|
export { parseTags } from "../core/item/parse.js";
|
|
9
16
|
export { normalizeStatusInput } from "../core/item/status.js";
|
|
@@ -26,6 +33,44 @@ export { runReindex } from "../cli/commands/reindex.js";
|
|
|
26
33
|
export { runSearch } from "../cli/commands/search.js";
|
|
27
34
|
export { loadCreateTemplateOptions, runTemplatesList, runTemplatesSave, runTemplatesShow, } from "../cli/commands/templates.js";
|
|
28
35
|
export { runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, } from "../cli/commands/test-runs.js";
|
|
29
|
-
export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, } from "../types/index.js";
|
|
36
|
+
export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, BUILTIN_ITEM_TYPE_VALUES, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, RISK_VALUES, STATUS_VALUES, } from "../types/index.js";
|
|
37
|
+
export async function getWorkspaceContracts(pmRoot, options = {}) {
|
|
38
|
+
const settings = await readSettings(pmRoot);
|
|
39
|
+
const extensionRegistrations = options.extensionRegistrations ??
|
|
40
|
+
(options.noExtensions === true ? null : await loadWorkspaceExtensionRegistrations(pmRoot, settings, options.cwd));
|
|
41
|
+
const typeRegistry = resolveItemTypeRegistry(settings, extensionRegistrations);
|
|
42
|
+
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
43
|
+
return {
|
|
44
|
+
types: [...typeRegistry.types],
|
|
45
|
+
statuses: statusRegistry.definitions.map((definition) => definition.id),
|
|
46
|
+
openStatus: statusRegistry.open_status,
|
|
47
|
+
closeStatus: statusRegistry.close_status,
|
|
48
|
+
canceledStatus: statusRegistry.canceled_status,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export async function getContracts(pmRootOrOptions, options = {}) {
|
|
52
|
+
const resolvedOptions = typeof pmRootOrOptions === "string"
|
|
53
|
+
? { ...options, pmRoot: pmRootOrOptions }
|
|
54
|
+
: (pmRootOrOptions ?? options);
|
|
55
|
+
const global = {
|
|
56
|
+
json: true,
|
|
57
|
+
quiet: resolvedOptions.quiet ?? true,
|
|
58
|
+
noExtensions: resolvedOptions.noExtensions ?? false,
|
|
59
|
+
noPager: true,
|
|
60
|
+
profile: resolvedOptions.profile ?? false,
|
|
61
|
+
path: resolvedOptions.pmRoot,
|
|
62
|
+
};
|
|
63
|
+
return runContracts(resolvedOptions, global);
|
|
64
|
+
}
|
|
65
|
+
async function loadWorkspaceExtensionRegistrations(pmRoot, settings, cwd) {
|
|
66
|
+
const loadResult = await loadExtensions({
|
|
67
|
+
pmRoot,
|
|
68
|
+
settings,
|
|
69
|
+
cwd: cwd ?? process.cwd(),
|
|
70
|
+
noExtensions: false,
|
|
71
|
+
});
|
|
72
|
+
const activationResult = await activateExtensions(loadResult);
|
|
73
|
+
return activationResult.registrations;
|
|
74
|
+
}
|
|
30
75
|
//# sourceMappingURL=runtime.js.map
|
|
31
|
-
//# debugId=
|
|
76
|
+
//# debugId=9dfba929-1fc6-569e-8311-91fc06f420bc
|
package/dist/sdk/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sources":["sdk/runtime.ts"],"sourceRoot":"/","sourcesContent":["export {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nexport { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nexport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nexport { generateItemId, normalizeItemId, normalizeRawItemId } from \"../core/item/id.js\";\nexport {\n canonicalDocument,\n normalizeFrontMatter,\n serializeItemDocument,\n splitFrontMatter,\n} from \"../core/item/item-format.js\";\nexport { parseTags } from \"../core/item/parse.js\";\nexport { normalizeStatusInput } from \"../core/item/status.js\";\nexport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nexport { acquireLock } from \"../core/lock/lock.js\";\nexport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nexport { EXIT_CODE } from \"../core/shared/constants.js\";\nexport { PmCliError } from \"../core/shared/errors.js\";\nexport { isTimestampLiteral, nowIso } from \"../core/shared/time.js\";\nexport { listAllFrontMatter, locateItem, readLocatedItem } from \"../core/store/item-store.js\";\nexport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nexport { readSettings } from \"../core/store/settings.js\";\nexport {\n renderCalendarMarkdown,\n resolveCalendarOutputFormat,\n runCalendar,\n type CalendarOptions,\n type CalendarResult,\n} from \"../cli/commands/calendar.js\";\nexport {\n renderGuideMarkdown,\n resolveGuideOutputFormat,\n runGuide,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n} from \"../cli/commands/guide.js\";\nexport { runCompletion, type CompletionResult, type CompletionShell } from \"../cli/commands/completion.js\";\nexport {\n runCommentsAudit,\n type CommentsAuditEntry,\n type CommentsAuditHistoryRow,\n type CommentsAuditOptions,\n type CommentsAuditResult,\n type CommentsAuditSummary,\n type CommentsAuditTypeSummary,\n} from \"../cli/commands/comments-audit.js\";\nexport {\n runDedupeAudit,\n type DedupeAuditCandidate,\n type DedupeAuditCluster,\n type DedupeAuditOptions,\n type DedupeAuditResult,\n} from \"../cli/commands/dedupe-audit.js\";\nexport { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from \"../cli/commands/normalize.js\";\nexport { runReindex, type ReindexOptions, type ReindexResult } from \"../cli/commands/reindex.js\";\nexport { runSearch, type SearchOptions, type SearchResult } from \"../cli/commands/search.js\";\nexport {\n loadCreateTemplateOptions,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n type CreateTemplateOptions,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n} from \"../cli/commands/templates.js\";\nexport {\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n} from \"../cli/commands/test-runs.js\";\nexport {\n CONFIDENCE_TEXT_VALUES,\n DEPENDENCY_KIND_VALUES,\n ISSUE_SEVERITY_VALUES,\n RISK_VALUES,\n} from \"../types/index.js\";\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,S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ACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAKhB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,GACZ,MAAM,mBAAmB,CAAC","debugId":"6b365b7c-339a-5b75-b897-27352e2f3495"}
|
|
1
|
+
{"version":3,"file":"runtime.js","sources":["sdk/runtime.ts"],"sourceRoot":"/","sourcesContent":["import {\n activateExtensions,\n loadExtensions,\n type ExtensionRegistrationRegistry,\n} from \"../core/extensions/index.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport {\n runContracts,\n type ContractsCommandOptions,\n type ContractsResult,\n} from \"../cli/commands/contracts.js\";\n\nexport {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nexport { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nexport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nexport { generateItemId, normalizeItemId, normalizeRawItemId } from \"../core/item/id.js\";\nexport { readBooleanOption, readCsvListOption, readStringOption } from \"./package-runtime-options.js\";\nexport {\n commitImportedItem,\n emptyImportedDocument,\n ensureTrackerInitialized,\n selectImportAuthor,\n toEstimatedMinutesValue,\n toImportPriority,\n toImportStatus,\n toImportTags,\n toNonEmptyImportString,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n} from \"./package-import-adapters.js\";\nexport {\n canonicalDocument,\n normalizeFrontMatter,\n serializeItemDocument,\n splitFrontMatter,\n} from \"../core/item/item-format.js\";\nexport { parseTags } from \"../core/item/parse.js\";\nexport { normalizeStatusInput } from \"../core/item/status.js\";\nexport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nexport { acquireLock } from \"../core/lock/lock.js\";\nexport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nexport { EXIT_CODE } from \"../core/shared/constants.js\";\nexport { PmCliError } from \"../core/shared/errors.js\";\nexport { isTimestampLiteral, nowIso } from \"../core/shared/time.js\";\nexport { listAllFrontMatter, locateItem, readLocatedItem } from \"../core/store/item-store.js\";\nexport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nexport { readSettings } from \"../core/store/settings.js\";\nexport {\n renderCalendarMarkdown,\n resolveCalendarOutputFormat,\n runCalendar,\n type CalendarOptions,\n type CalendarResult,\n} from \"../cli/commands/calendar.js\";\nexport {\n renderGuideMarkdown,\n resolveGuideOutputFormat,\n runGuide,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n} from \"../cli/commands/guide.js\";\nexport { runCompletion, type CompletionResult, type CompletionShell } from \"../cli/commands/completion.js\";\nexport {\n runCommentsAudit,\n type CommentsAuditEntry,\n type CommentsAuditHistoryRow,\n type CommentsAuditOptions,\n type CommentsAuditResult,\n type CommentsAuditSummary,\n type CommentsAuditTypeSummary,\n} from \"../cli/commands/comments-audit.js\";\nexport {\n runDedupeAudit,\n type DedupeAuditCandidate,\n type DedupeAuditCluster,\n type DedupeAuditOptions,\n type DedupeAuditResult,\n} from \"../cli/commands/dedupe-audit.js\";\nexport { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from \"../cli/commands/normalize.js\";\nexport { runReindex, type ReindexOptions, type ReindexResult } from \"../cli/commands/reindex.js\";\nexport { runSearch, type SearchOptions, type SearchResult } from \"../cli/commands/search.js\";\nexport {\n loadCreateTemplateOptions,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n type CreateTemplateOptions,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n} from \"../cli/commands/templates.js\";\nexport {\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n} from \"../cli/commands/test-runs.js\";\nexport {\n CONFIDENCE_TEXT_VALUES,\n DEPENDENCY_KIND_VALUES,\n BUILTIN_ITEM_TYPE_VALUES,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n RISK_VALUES,\n STATUS_VALUES,\n} from \"../types/index.js\";\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n\nexport interface GetContractsOptions extends ContractsCommandOptions {\n pmRoot?: string;\n cwd?: string;\n noExtensions?: boolean;\n quiet?: boolean;\n profile?: boolean;\n}\n\nexport interface WorkspaceContractsOptions {\n extensionRegistrations?: ExtensionRegistrationRegistry | null;\n noExtensions?: boolean;\n cwd?: string;\n}\n\nexport interface WorkspaceContracts {\n types: string[];\n statuses: string[];\n openStatus: string;\n closeStatus: string;\n canceledStatus: string;\n}\n\nexport async function getWorkspaceContracts(\n pmRoot: string,\n options: WorkspaceContractsOptions = {},\n): Promise<WorkspaceContracts> {\n const settings = await readSettings(pmRoot);\n const extensionRegistrations =\n options.extensionRegistrations ??\n (options.noExtensions === true ? null : await loadWorkspaceExtensionRegistrations(pmRoot, settings, options.cwd));\n const typeRegistry = resolveItemTypeRegistry(settings, extensionRegistrations);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n\n return {\n types: [...typeRegistry.types],\n statuses: statusRegistry.definitions.map((definition) => definition.id),\n openStatus: statusRegistry.open_status,\n closeStatus: statusRegistry.close_status,\n canceledStatus: statusRegistry.canceled_status,\n };\n}\n\nexport async function getContracts(\n pmRootOrOptions?: string | GetContractsOptions,\n options: GetContractsOptions = {},\n): Promise<ContractsResult> {\n const resolvedOptions =\n typeof pmRootOrOptions === \"string\"\n ? { ...options, pmRoot: pmRootOrOptions }\n : (pmRootOrOptions ?? options);\n const global: GlobalOptions = {\n json: true,\n quiet: resolvedOptions.quiet ?? true,\n noExtensions: resolvedOptions.noExtensions ?? false,\n noPager: true,\n profile: resolvedOptions.profile ?? false,\n path: resolvedOptions.pmRoot,\n };\n\n return runContracts(resolvedOptions, global);\n}\n\nasync function loadWorkspaceExtensionRegistrations(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n cwd?: string,\n): Promise<ExtensionRegistrationRegistry | null> {\n const loadResult = await loadExtensions({\n pmRoot,\n settings,\n cwd: cwd ?? process.cwd(),\n noExtensions: false,\n });\n const activationResult = await activateExtensions(loadResult);\n return activationResult.registrations;\n}\n\nexport type { ContractsCommandOptions, ContractsResult };\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,GAEf,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,YAAY,GAGb,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC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Ac,EAAE,cAAc,CAAC,eAAe;KAC/C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,eAA8C,EAC9C,UAA+B,EAAE;IAEjC,MAAM,eAAe,GACnB,OAAO,eAAe,KAAK,QAAQ;QACjC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE;QACzC,CAAC,CAAC,CAAC,eAAe,IAAI,OAAO,CAAC,CAAC;IACnC,MAAM,MAAM,GAAkB;QAC5B,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,eAAe,CAAC,KAAK,IAAI,IAAI;QACpC,YAAY,EAAE,eAAe,CAAC,YAAY,IAAI,KAAK;QACnD,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,eAAe,CAAC,OAAO,IAAI,KAAK;QACzC,IAAI,EAAE,eAAe,CAAC,MAAM;KAC7B,CAAC;IAEF,OAAO,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,mCAAmC,CAChD,MAAc,EACd,QAAkD,EAClD,GAAY;IAEZ,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC;QACtC,MAAM;QACN,QAAQ;QACR,GAAG,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QACzB,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;IACH,MAAM,gBAAgB,GAAG,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,gBAAgB,CAAC,aAAa,CAAC;AACxC,CAAC","debugId":"9dfba929-1fc6-569e-8311-91fc06f420bc"}
|
package/dist/types.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ export declare const RECURRENCE_FREQUENCY_VALUES: readonly ["daily", "weekly", "
|
|
|
45
45
|
export type RecurrenceFrequency = (typeof RECURRENCE_FREQUENCY_VALUES)[number];
|
|
46
46
|
export declare const RECURRENCE_WEEKDAY_VALUES: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
47
47
|
export type RecurrenceWeekday = (typeof RECURRENCE_WEEKDAY_VALUES)[number];
|
|
48
|
+
/**
|
|
49
|
+
* Canonical week-order index for a recurrence weekday (mon=0 .. sun=6).
|
|
50
|
+
* Shared by item serialization, create/update parsing, and calendar expansion
|
|
51
|
+
* so weekday ordering cannot drift between those modules.
|
|
52
|
+
*/
|
|
53
|
+
export declare function weekdayOrderIndex(value: RecurrenceWeekday): number;
|
|
48
54
|
export interface Dependency {
|
|
49
55
|
id: string;
|
|
50
56
|
kind: DependencyKind;
|
package/dist/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="68c1fa65-9fc4-5566-9c23-bdb17c35cb53")}catch(e){}}();
|
|
3
3
|
export const BUILTIN_ITEM_TYPE_VALUES = [
|
|
4
4
|
"Epic",
|
|
5
5
|
"Feature",
|
|
@@ -76,6 +76,14 @@ export const VALIDATE_METADATA_REQUIRED_FIELD_VALUES = [
|
|
|
76
76
|
];
|
|
77
77
|
export const RECURRENCE_FREQUENCY_VALUES = ["daily", "weekly", "monthly", "yearly"];
|
|
78
78
|
export const RECURRENCE_WEEKDAY_VALUES = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
79
|
+
/**
|
|
80
|
+
* Canonical week-order index for a recurrence weekday (mon=0 .. sun=6).
|
|
81
|
+
* Shared by item serialization, create/update parsing, and calendar expansion
|
|
82
|
+
* so weekday ordering cannot drift between those modules.
|
|
83
|
+
*/
|
|
84
|
+
export function weekdayOrderIndex(value) {
|
|
85
|
+
return RECURRENCE_WEEKDAY_VALUES.indexOf(value);
|
|
86
|
+
}
|
|
79
87
|
export const PLAN_MODE_VALUES = [
|
|
80
88
|
"draft",
|
|
81
89
|
"research",
|
|
@@ -117,4 +125,4 @@ export const CONTEXT_SECTION_VALUES = [
|
|
|
117
125
|
"tests",
|
|
118
126
|
];
|
|
119
127
|
//# sourceMappingURL=types.js.map
|
|
120
|
-
//# debugId=
|
|
128
|
+
//# debugId=68c1fa65-9fc4-5566-9c23-bdb17c35cb53
|