@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbrained/pm-cli",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.27",
|
|
4
4
|
"description": "Git-native project management CLI for humans and agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "unbrained",
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
"import": "./dist/sdk/index.js",
|
|
29
29
|
"default": "./dist/sdk/index.js"
|
|
30
30
|
},
|
|
31
|
+
"./sdk/runtime": {
|
|
32
|
+
"types": "./dist/sdk/runtime.d.ts",
|
|
33
|
+
"import": "./dist/sdk/runtime.js",
|
|
34
|
+
"default": "./dist/sdk/runtime.js"
|
|
35
|
+
},
|
|
31
36
|
"./cli": {
|
|
32
37
|
"types": "./dist/cli/main.d.ts",
|
|
33
38
|
"import": "./dist/cli/main.js",
|
|
@@ -44,7 +49,6 @@
|
|
|
44
49
|
"CODE_OF_CONDUCT.md",
|
|
45
50
|
"LICENSE",
|
|
46
51
|
"AGENTS.md",
|
|
47
|
-
"PRD.md",
|
|
48
52
|
"docs/**",
|
|
49
53
|
".claude-plugin/**",
|
|
50
54
|
"plugins/**",
|
|
@@ -69,8 +73,10 @@
|
|
|
69
73
|
"smoke:claude-plugin": "node scripts/smoke-claude-plugin.mjs",
|
|
70
74
|
"version:check": "node scripts/release-version.mjs check",
|
|
71
75
|
"version:next": "node scripts/release-version.mjs next",
|
|
76
|
+
"changelog:pm:install": "node dist/cli.js install npm:pm-changelog --project",
|
|
77
|
+
"changelog:pm": "pnpm changelog:pm:install && node dist/cli.js changelog generate --output CHANGELOG.md --title \"Changelog\" --mode replace --all-release-tags --status closed --item-url-base https://github.com/unbraind/pm-cli/blob/main/.agents/pm",
|
|
78
|
+
"changelog:pm:check": "pnpm changelog:pm:install && node dist/cli.js changelog generate --output CHANGELOG.md --title \"Changelog\" --mode replace --all-release-tags --status closed --item-url-base https://github.com/unbraind/pm-cli/blob/main/.agents/pm --check",
|
|
72
79
|
"release:notes": "node scripts/generate-release-notes.mjs",
|
|
73
|
-
"release:changelog": "node scripts/release/changelog-promote.mjs",
|
|
74
80
|
"release:gates": "node scripts/release/run-gates.mjs --telemetry-mode best-effort",
|
|
75
81
|
"release:pipeline": "node scripts/release/run-release-pipeline.mjs",
|
|
76
82
|
"release:pipeline:dry-run": "node scripts/release/run-release-pipeline.mjs --dry-run",
|
|
@@ -108,22 +114,20 @@
|
|
|
108
114
|
}
|
|
109
115
|
},
|
|
110
116
|
"dependencies": {
|
|
111
|
-
"@sentry/node": "^10.
|
|
112
|
-
"@toon-format/toon": "^2.
|
|
117
|
+
"@sentry/node": "^10.54.0",
|
|
118
|
+
"@toon-format/toon": "^2.3.0",
|
|
113
119
|
"commander": "^14.0.3",
|
|
114
120
|
"fast-glob": "^3.3.3",
|
|
115
|
-
"fast-json-patch": "^3.1.1"
|
|
116
|
-
"undici": "^8.1.0",
|
|
117
|
-
"zod": "^4.3.6"
|
|
121
|
+
"fast-json-patch": "^3.1.1"
|
|
118
122
|
},
|
|
119
123
|
"devDependencies": {
|
|
120
|
-
"@sentry/cli": "^3.4.
|
|
121
|
-
"@types/node": "^25.
|
|
122
|
-
"@vitest/coverage-v8": "^4.1.
|
|
124
|
+
"@sentry/cli": "^3.4.3",
|
|
125
|
+
"@types/node": "^25.9.1",
|
|
126
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
123
127
|
"c8": "^11.0.0",
|
|
124
|
-
"tsx": "^4.
|
|
128
|
+
"tsx": "^4.22.3",
|
|
125
129
|
"typescript": "^6.0.3",
|
|
126
|
-
"vitest": "^4.1.
|
|
130
|
+
"vitest": "^4.1.7"
|
|
127
131
|
},
|
|
128
132
|
"pnpm": {
|
|
129
133
|
"onlyBuiltDependencies": [
|
|
@@ -131,7 +135,7 @@
|
|
|
131
135
|
],
|
|
132
136
|
"overrides": {
|
|
133
137
|
"rollup": ">=4.59.0",
|
|
134
|
-
"brace-expansion": ">=5.0.
|
|
138
|
+
"brace-expansion": ">=5.0.6",
|
|
135
139
|
"vite": "7.3.2"
|
|
136
140
|
}
|
|
137
141
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
|
-
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
4
|
-
const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
|
1
|
+
import { loadPackageRuntimeModule } from "./runtime-loader.js";
|
|
5
2
|
export const manifest = {
|
|
6
3
|
name: "builtin-beads-import",
|
|
7
4
|
version: "0.1.0",
|
|
@@ -23,52 +20,8 @@ function toBeadsImportOptions(options) {
|
|
|
23
20
|
preserveSourceIds: asBoolean(options.preserveSourceIds),
|
|
24
21
|
};
|
|
25
22
|
}
|
|
26
|
-
function resolvePackageRootCandidates() {
|
|
27
|
-
const candidates = [];
|
|
28
|
-
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
29
|
-
if (typeof envRoot === "string" && envRoot.trim().length > 0) {
|
|
30
|
-
candidates.push(path.resolve(envRoot.trim()));
|
|
31
|
-
}
|
|
32
|
-
const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
|
|
33
|
-
if (argvEntry.length > 0) {
|
|
34
|
-
const resolvedEntry = path.resolve(argvEntry);
|
|
35
|
-
const entryDir = path.dirname(resolvedEntry);
|
|
36
|
-
candidates.push(path.resolve(entryDir, ".."));
|
|
37
|
-
candidates.push(path.resolve(entryDir, "../.."));
|
|
38
|
-
candidates.push(path.resolve(entryDir, "../../.."));
|
|
39
|
-
}
|
|
40
|
-
return [...new Set(candidates)];
|
|
41
|
-
}
|
|
42
|
-
async function loadRuntimeModule() {
|
|
43
|
-
const attempted = [];
|
|
44
|
-
for (const packageRoot of resolvePackageRootCandidates()) {
|
|
45
|
-
const modulePaths = [
|
|
46
|
-
path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js"),
|
|
47
|
-
path.join(packageRoot, "packages", "pm-beads", "extensions", "beads", "runtime.js"),
|
|
48
|
-
];
|
|
49
|
-
for (const modulePath of modulePaths) {
|
|
50
|
-
attempted.push(modulePath);
|
|
51
|
-
try {
|
|
52
|
-
return await import(pathToFileURL(modulePath).href);
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
// Try the next package-root candidate.
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
|
|
60
|
-
attempted.push(localRuntimePath);
|
|
61
|
-
try {
|
|
62
|
-
return await import(pathToFileURL(localRuntimePath).href);
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
// Fall through to the diagnostic below.
|
|
66
|
-
}
|
|
67
|
-
throw new Error("Unable to resolve packaged beads extension runtime module. " +
|
|
68
|
-
`Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`);
|
|
69
|
-
}
|
|
70
23
|
async function runBeadsImportFromRuntime(options, global) {
|
|
71
|
-
const runtime = await
|
|
24
|
+
const runtime = await loadPackageRuntimeModule();
|
|
72
25
|
if (typeof runtime.runBeadsImport !== "function") {
|
|
73
26
|
throw new Error("Bundled beads runtime module is missing runBeadsImport().");
|
|
74
27
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
1
|
import type { CommandDefinition, ExtensionApi, GlobalOptions } from "../../../../src/sdk/index.js";
|
|
4
2
|
import type { BeadsImportOptions, BeadsImportResult } from "./runtime.js";
|
|
5
|
-
|
|
6
|
-
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
7
|
-
const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
|
3
|
+
import { loadPackageRuntimeModule } from "./runtime-loader.js";
|
|
8
4
|
|
|
9
5
|
export const manifest = {
|
|
10
6
|
name: "builtin-beads-import",
|
|
@@ -35,56 +31,8 @@ function toBeadsImportOptions(options: Record<string, unknown>): BeadsImportOpti
|
|
|
35
31
|
};
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
function resolvePackageRootCandidates(): string[] {
|
|
39
|
-
const candidates: string[] = [];
|
|
40
|
-
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
41
|
-
if (typeof envRoot === "string" && envRoot.trim().length > 0) {
|
|
42
|
-
candidates.push(path.resolve(envRoot.trim()));
|
|
43
|
-
}
|
|
44
|
-
const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
|
|
45
|
-
if (argvEntry.length > 0) {
|
|
46
|
-
const resolvedEntry = path.resolve(argvEntry);
|
|
47
|
-
const entryDir = path.dirname(resolvedEntry);
|
|
48
|
-
candidates.push(path.resolve(entryDir, ".."));
|
|
49
|
-
candidates.push(path.resolve(entryDir, "../.."));
|
|
50
|
-
candidates.push(path.resolve(entryDir, "../../.."));
|
|
51
|
-
}
|
|
52
|
-
return [...new Set(candidates)];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function loadRuntimeModule(): Promise<RuntimeModule> {
|
|
56
|
-
const attempted: string[] = [];
|
|
57
|
-
for (const packageRoot of resolvePackageRootCandidates()) {
|
|
58
|
-
const modulePaths = [
|
|
59
|
-
path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js"),
|
|
60
|
-
path.join(packageRoot, "packages", "pm-beads", "extensions", "beads", "runtime.js"),
|
|
61
|
-
];
|
|
62
|
-
for (const modulePath of modulePaths) {
|
|
63
|
-
attempted.push(modulePath);
|
|
64
|
-
try {
|
|
65
|
-
return await import(pathToFileURL(modulePath).href) as RuntimeModule;
|
|
66
|
-
} catch {
|
|
67
|
-
// Try the next package-root candidate.
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
|
|
73
|
-
attempted.push(localRuntimePath);
|
|
74
|
-
try {
|
|
75
|
-
return await import(pathToFileURL(localRuntimePath).href) as RuntimeModule;
|
|
76
|
-
} catch {
|
|
77
|
-
// Fall through to the diagnostic below.
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
throw new Error(
|
|
81
|
-
"Unable to resolve packaged beads extension runtime module. " +
|
|
82
|
-
`Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
34
|
async function runBeadsImportFromRuntime(options: BeadsImportOptions, global: GlobalOptions): Promise<BeadsImportResult> {
|
|
87
|
-
const runtime = await
|
|
35
|
+
const runtime = await loadPackageRuntimeModule() as RuntimeModule;
|
|
88
36
|
if (typeof runtime.runBeadsImport !== "function") {
|
|
89
37
|
throw new Error("Bundled beads runtime module is missing runBeadsImport().");
|
|
90
38
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* GENERATED by scripts/gen-package-runtime-loaders.mjs - do not edit directly.
|
|
7
|
+
* This file is shipped with the package extension and intentionally avoids
|
|
8
|
+
* static SDK imports so project-local installed extensions can load it.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
12
|
+
const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const EXTENSION_NAME = "beads";
|
|
14
|
+
const PACKAGE_NAME = "pm-beads";
|
|
15
|
+
const DIAGNOSTIC_NAME = "beads";
|
|
16
|
+
|
|
17
|
+
function isRecord(value) {
|
|
18
|
+
return typeof value === "object" && value !== null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isMissingRuntimeModuleError(error, modulePath) {
|
|
22
|
+
if (!isRecord(error) || error.code !== "ERR_MODULE_NOT_FOUND") {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const message = typeof error.message === "string" ? error.message : "";
|
|
26
|
+
const moduleUrl = pathToFileURL(modulePath).href;
|
|
27
|
+
return message.includes(modulePath) || message.includes(moduleUrl);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function resolvePackageRootCandidates() {
|
|
31
|
+
const candidates = [];
|
|
32
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
33
|
+
if (typeof envRoot === "string" && envRoot.trim().length > 0) {
|
|
34
|
+
candidates.push(path.resolve(envRoot.trim()));
|
|
35
|
+
}
|
|
36
|
+
const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
|
|
37
|
+
if (argvEntry.length > 0) {
|
|
38
|
+
const resolvedEntry = path.resolve(argvEntry);
|
|
39
|
+
const entryDir = path.dirname(resolvedEntry);
|
|
40
|
+
candidates.push(path.resolve(entryDir, ".."));
|
|
41
|
+
candidates.push(path.resolve(entryDir, "../.."));
|
|
42
|
+
candidates.push(path.resolve(entryDir, "../../.."));
|
|
43
|
+
}
|
|
44
|
+
return [...new Set(candidates)];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function loadPackageRuntimeModule() {
|
|
48
|
+
const attempted = [];
|
|
49
|
+
for (const packageRoot of resolvePackageRootCandidates()) {
|
|
50
|
+
const modulePaths = [
|
|
51
|
+
path.join(packageRoot, ".agents", "pm", "extensions", EXTENSION_NAME, "runtime.js"),
|
|
52
|
+
path.join(packageRoot, "packages", PACKAGE_NAME, "extensions", EXTENSION_NAME, "runtime.js"),
|
|
53
|
+
];
|
|
54
|
+
for (const modulePath of modulePaths) {
|
|
55
|
+
attempted.push(modulePath);
|
|
56
|
+
if (!existsSync(modulePath)) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
return await import(pathToFileURL(modulePath).href);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (isMissingRuntimeModuleError(error, modulePath)) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
|
|
71
|
+
attempted.push(localRuntimePath);
|
|
72
|
+
if (existsSync(localRuntimePath)) {
|
|
73
|
+
try {
|
|
74
|
+
return await import(pathToFileURL(localRuntimePath).href);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
if (!isMissingRuntimeModuleError(error, localRuntimePath)) {
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
throw new Error(
|
|
83
|
+
`Unable to resolve packaged ${DIAGNOSTIC_NAME} extension runtime module. ` +
|
|
84
|
+
`Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* GENERATED by scripts/gen-package-runtime-loaders.mjs - do not edit directly.
|
|
7
|
+
* This file is shipped with the package extension and intentionally avoids
|
|
8
|
+
* static SDK imports so project-local installed extensions can load it.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
12
|
+
const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const EXTENSION_NAME = "beads";
|
|
14
|
+
const PACKAGE_NAME = "pm-beads";
|
|
15
|
+
const DIAGNOSTIC_NAME = "beads";
|
|
16
|
+
|
|
17
|
+
export type PackageRuntimeModule = Record<string, unknown>;
|
|
18
|
+
|
|
19
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
20
|
+
return typeof value === "object" && value !== null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isMissingRuntimeModuleError(error: unknown, modulePath: string): boolean {
|
|
24
|
+
if (!isRecord(error) || error.code !== "ERR_MODULE_NOT_FOUND") {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const message = typeof error.message === "string" ? error.message : "";
|
|
28
|
+
const moduleUrl = pathToFileURL(modulePath).href;
|
|
29
|
+
return message.includes(modulePath) || message.includes(moduleUrl);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function resolvePackageRootCandidates(): string[] {
|
|
33
|
+
const candidates: string[] = [];
|
|
34
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
35
|
+
if (typeof envRoot === "string" && envRoot.trim().length > 0) {
|
|
36
|
+
candidates.push(path.resolve(envRoot.trim()));
|
|
37
|
+
}
|
|
38
|
+
const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
|
|
39
|
+
if (argvEntry.length > 0) {
|
|
40
|
+
const resolvedEntry = path.resolve(argvEntry);
|
|
41
|
+
const entryDir = path.dirname(resolvedEntry);
|
|
42
|
+
candidates.push(path.resolve(entryDir, ".."));
|
|
43
|
+
candidates.push(path.resolve(entryDir, "../.."));
|
|
44
|
+
candidates.push(path.resolve(entryDir, "../../.."));
|
|
45
|
+
}
|
|
46
|
+
return [...new Set(candidates)];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function loadPackageRuntimeModule(): Promise<PackageRuntimeModule> {
|
|
50
|
+
const attempted: string[] = [];
|
|
51
|
+
for (const packageRoot of resolvePackageRootCandidates()) {
|
|
52
|
+
const modulePaths = [
|
|
53
|
+
path.join(packageRoot, ".agents", "pm", "extensions", EXTENSION_NAME, "runtime.js"),
|
|
54
|
+
path.join(packageRoot, "packages", PACKAGE_NAME, "extensions", EXTENSION_NAME, "runtime.js"),
|
|
55
|
+
];
|
|
56
|
+
for (const modulePath of modulePaths) {
|
|
57
|
+
attempted.push(modulePath);
|
|
58
|
+
if (!existsSync(modulePath)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
return await import(pathToFileURL(modulePath).href) as PackageRuntimeModule;
|
|
63
|
+
} catch (error: unknown) {
|
|
64
|
+
if (isMissingRuntimeModuleError(error, modulePath)) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
|
|
73
|
+
attempted.push(localRuntimePath);
|
|
74
|
+
if (existsSync(localRuntimePath)) {
|
|
75
|
+
try {
|
|
76
|
+
return await import(pathToFileURL(localRuntimePath).href) as PackageRuntimeModule;
|
|
77
|
+
} catch (error: unknown) {
|
|
78
|
+
if (!isMissingRuntimeModuleError(error, localRuntimePath)) {
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
throw new Error(
|
|
85
|
+
`Unable to resolve packaged ${DIAGNOSTIC_NAME} extension runtime module. ` +
|
|
86
|
+
`Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { DEPENDENCY_KIND_VALUES, EXIT_CODE, PmCliError,
|
|
3
|
+
import { DEPENDENCY_KIND_VALUES, EXIT_CODE, PmCliError, canonicalDocument, commitImportedItem, generateItemId, getActiveExtensionRegistrations, getItemPath, isTimestampLiteral, locateItem, normalizeFrontMatter, normalizeItemId, normalizeRawItemId, nowIso, pathExists, readSettings, resolveItemTypeRegistry, resolvePmRoot, runActiveOnReadHooks, ensureTrackerInitialized, selectImportAuthor, toEstimatedMinutesValue, toImportPriority, toImportStatus, toImportTags, toNonEmptyImportString, } from "../../../../dist/sdk/index.js";
|
|
4
4
|
const PRIMARY_AUTO_DISCOVERY_FILES = [
|
|
5
5
|
".beads/issues.jsonl",
|
|
6
6
|
"issues.jsonl",
|
|
@@ -9,13 +9,13 @@ const UNSAFE_AUTO_DISCOVERY_FILES = [
|
|
|
9
9
|
".beads/sync_base.jsonl",
|
|
10
10
|
"sync_base.jsonl",
|
|
11
11
|
];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
// Shared, behavior-identical value coercers are sourced from the SDK adapter
|
|
13
|
+
// surface; package-specific mappings (timestamps, item types, dependencies,
|
|
14
|
+
// linked artifacts) stay local below.
|
|
15
|
+
const toNonEmptyString = toNonEmptyImportString;
|
|
16
|
+
const toEstimatedMinutes = toEstimatedMinutesValue;
|
|
17
|
+
const toPriority = toImportPriority;
|
|
18
|
+
const toTags = toImportTags;
|
|
19
19
|
function toIsoString(value) {
|
|
20
20
|
const raw = toNonEmptyString(value);
|
|
21
21
|
if (!raw) {
|
|
@@ -26,44 +26,6 @@ function toIsoString(value) {
|
|
|
26
26
|
}
|
|
27
27
|
return raw;
|
|
28
28
|
}
|
|
29
|
-
function toEstimatedMinutes(value) {
|
|
30
|
-
if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
|
|
31
|
-
return value;
|
|
32
|
-
}
|
|
33
|
-
if (typeof value === "string" && value.trim().length > 0) {
|
|
34
|
-
const parsed = Number(value);
|
|
35
|
-
if (Number.isFinite(parsed) && parsed >= 0) {
|
|
36
|
-
return parsed;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
function toPriority(value) {
|
|
42
|
-
const fallback = 2;
|
|
43
|
-
if (typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 4) {
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
|
-
if (typeof value === "string" && value.trim().length > 0) {
|
|
47
|
-
const parsed = Number(value);
|
|
48
|
-
if (Number.isInteger(parsed) && parsed >= 0 && parsed <= 4) {
|
|
49
|
-
return parsed;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return fallback;
|
|
53
|
-
}
|
|
54
|
-
function toTags(value) {
|
|
55
|
-
if (Array.isArray(value)) {
|
|
56
|
-
const tags = value
|
|
57
|
-
.filter((entry) => typeof entry === "string")
|
|
58
|
-
.map((entry) => entry.trim().toLowerCase())
|
|
59
|
-
.filter((entry) => entry.length > 0);
|
|
60
|
-
return Array.from(new Set(tags)).sort((left, right) => left.localeCompare(right));
|
|
61
|
-
}
|
|
62
|
-
if (typeof value === "string") {
|
|
63
|
-
return parseTags(value);
|
|
64
|
-
}
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
29
|
function toItemType(value) {
|
|
68
30
|
const raw = toNonEmptyString(value);
|
|
69
31
|
const normalized = raw?.toLowerCase();
|
|
@@ -86,16 +48,7 @@ function toItemType(value) {
|
|
|
86
48
|
return { type: "Task", sourceType: raw };
|
|
87
49
|
}
|
|
88
50
|
}
|
|
89
|
-
|
|
90
|
-
const normalized = toNonEmptyString(value);
|
|
91
|
-
if (normalized) {
|
|
92
|
-
const canonical = normalizeStatusInput(normalized);
|
|
93
|
-
if (canonical) {
|
|
94
|
-
return canonical;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return "open";
|
|
98
|
-
}
|
|
51
|
+
const toStatus = toImportStatus;
|
|
99
52
|
function toDependencyKind(value) {
|
|
100
53
|
const raw = toNonEmptyString(value);
|
|
101
54
|
const normalized = raw?.toLowerCase();
|
|
@@ -332,24 +285,8 @@ function toLinkedDocs(value) {
|
|
|
332
285
|
}
|
|
333
286
|
return docs.length > 0 ? docs : undefined;
|
|
334
287
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const trimmed = candidate.trim();
|
|
338
|
-
return trimmed.length > 0 ? trimmed : "unknown";
|
|
339
|
-
}
|
|
340
|
-
function ensureInitHasRun(pmRoot) {
|
|
341
|
-
return pathExists(getSettingsPath(pmRoot)).then((exists) => {
|
|
342
|
-
if (!exists) {
|
|
343
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
function emptyDocument() {
|
|
348
|
-
return {
|
|
349
|
-
metadata: {},
|
|
350
|
-
body: "",
|
|
351
|
-
};
|
|
352
|
-
}
|
|
288
|
+
const selectAuthor = selectImportAuthor;
|
|
289
|
+
const ensureInitHasRun = ensureTrackerInitialized;
|
|
353
290
|
function resolveInputPath(rawPath) {
|
|
354
291
|
return path.isAbsolute(rawPath) ? rawPath : path.resolve(process.cwd(), rawPath);
|
|
355
292
|
}
|
|
@@ -515,48 +452,22 @@ export async function runBeadsImport(options, global) {
|
|
|
515
452
|
continue;
|
|
516
453
|
}
|
|
517
454
|
const itemPath = getItemPath(pmRoot, type, id, "toon", typeRegistry.type_to_folder);
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
await appendHistoryEntry(historyPath, entry);
|
|
533
|
-
warnings.push(...(await runActiveOnWriteHooks({
|
|
534
|
-
path: itemPath,
|
|
535
|
-
scope: "project",
|
|
536
|
-
op: "import",
|
|
537
|
-
})), ...(await runActiveOnWriteHooks({
|
|
538
|
-
path: historyPath,
|
|
539
|
-
scope: "project",
|
|
540
|
-
op: "import:history",
|
|
541
|
-
})));
|
|
542
|
-
}
|
|
543
|
-
catch (error) {
|
|
544
|
-
await removeFileIfExists(itemPath);
|
|
545
|
-
throw error;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
finally {
|
|
549
|
-
await releaseLock();
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
catch (error) {
|
|
553
|
-
if (error instanceof PmCliError && error.exitCode === EXIT_CODE.CONFLICT) {
|
|
554
|
-
warnings.push(`beads_import_lock_conflict:${id}`);
|
|
555
|
-
skipped += 1;
|
|
556
|
-
continue;
|
|
557
|
-
}
|
|
558
|
-
throw error;
|
|
455
|
+
const commit = await commitImportedItem({
|
|
456
|
+
pmRoot,
|
|
457
|
+
id,
|
|
458
|
+
itemPath,
|
|
459
|
+
document: afterDocument,
|
|
460
|
+
author,
|
|
461
|
+
message,
|
|
462
|
+
settings,
|
|
463
|
+
conflictWarningPrefix: "beads_import_lock_conflict",
|
|
464
|
+
});
|
|
465
|
+
if (!commit.committed) {
|
|
466
|
+
warnings.push(commit.conflictWarning);
|
|
467
|
+
skipped += 1;
|
|
468
|
+
continue;
|
|
559
469
|
}
|
|
470
|
+
warnings.push(...commit.writeWarnings);
|
|
560
471
|
ids.push(id);
|
|
561
472
|
imported += 1;
|
|
562
473
|
}
|