@unbrained/pm-cli 2026.9.7 → 2026.9.9
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/.agents/skills/pm-developer/SKILL.md +12 -4
- package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +19 -10
- package/.agents/skills/pm-extensions/SKILL.md +6 -0
- package/.agents/skills/pm-sdk/SKILL.md +11 -2
- package/.agents/skills/pm-user/SKILL.md +7 -2
- package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +95 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +231 -182
- package/dist/cli/after-command-context-usage.js +1 -48
- package/dist/cli/argv-utils.js +1 -40
- package/dist/cli/bootstrap-args.js +1 -9
- package/dist/cli/bundle-integrity.js +2 -110
- package/dist/cli/commander-usage.js +11 -771
- package/dist/cli/commands/activity.js +1 -9
- package/dist/cli/commands/aggregate.js +1 -5
- package/dist/cli/commands/append.js +1 -5
- package/dist/cli/commands/claim.js +1 -5
- package/dist/cli/commands/close-many.js +1 -5
- package/dist/cli/commands/close.js +1 -9
- package/dist/cli/commands/comments.js +1 -5
- package/dist/cli/commands/config.js +1 -9
- package/dist/cli/commands/context.js +1 -9
- package/dist/cli/commands/contracts.js +1 -5
- package/dist/cli/commands/copy.js +1 -9
- package/dist/cli/commands/create.js +1 -9
- package/dist/cli/commands/delete.js +1 -9
- package/dist/cli/commands/deps.js +1 -9
- package/dist/cli/commands/docs.js +1 -9
- package/dist/cli/commands/duplicates.js +1 -9
- package/dist/cli/commands/eval.js +1 -9
- package/dist/cli/commands/extension/describe.js +1 -5
- package/dist/cli/commands/extension/scaffold.js +1 -5
- package/dist/cli/commands/extension/shared.js +1 -5
- package/dist/cli/commands/extension.js +1 -9
- package/dist/cli/commands/files.js +1 -9
- package/dist/cli/commands/focus.js +1 -9
- package/dist/cli/commands/gc.js +1 -9
- package/dist/cli/commands/get.js +1 -9
- package/dist/cli/commands/graph.js +1 -10
- package/dist/cli/commands/health.js +1 -9
- package/dist/cli/commands/history-compact.js +1 -10
- package/dist/cli/commands/history-redact.js +1 -11
- package/dist/cli/commands/history-repair.js +1 -10
- package/dist/cli/commands/history.js +1 -5
- package/dist/cli/commands/index.js +1 -58
- package/dist/cli/commands/init-agent-guidance.js +1 -9
- package/dist/cli/commands/init.js +1 -9
- package/dist/cli/commands/learnings.js +1 -5
- package/dist/cli/commands/lifecycle-transitions.js +1 -5
- package/dist/cli/commands/list.js +1 -9
- package/dist/cli/commands/merge.js +1 -11
- package/dist/cli/commands/next.js +1 -9
- package/dist/cli/commands/notes.js +1 -5
- package/dist/cli/commands/plan.js +1 -9
- package/dist/cli/commands/profile.js +1 -9
- package/dist/cli/commands/restore.js +1 -9
- package/dist/cli/commands/scheduling-shortcuts.js +1 -9
- package/dist/cli/commands/schema.js +1 -10
- package/dist/cli/commands/search.js +1 -9
- package/dist/cli/commands/stats.js +1 -9
- package/dist/cli/commands/telemetry.js +1 -9
- package/dist/cli/commands/test-all.js +1 -9
- package/dist/cli/commands/test-runs.js +1 -9
- package/dist/cli/commands/test.js +1 -9
- package/dist/cli/commands/update-many.js +1 -5
- package/dist/cli/commands/update.js +1 -9
- package/dist/cli/commands/upgrade.js +1 -5
- package/dist/cli/commands/validate.js +1 -15
- package/dist/cli/context-intent-invocation.js +1 -20
- package/dist/cli/description-stdin.js +1 -17
- package/dist/cli/error-guidance.js +1 -1353
- package/dist/cli/extension-command-help.js +5 -636
- package/dist/cli/extension-command-options.js +1 -427
- package/dist/cli/extension-recovery.js +1 -126
- package/dist/cli/help-content.js +2 -1001
- package/dist/cli/help-json-payload.js +4 -570
- package/dist/cli/main.d.ts +4 -0
- package/dist/cli/main.js +5 -2573
- package/dist/cli/migration-gates.js +1 -289
- package/dist/cli/public.js +1 -20
- package/dist/cli/register-annotations.js +1 -270
- package/dist/cli/register-assurance.js +1 -62
- package/dist/cli/register-files-lookup.js +1 -56
- package/dist/cli/register-history-activity.d.ts +8 -0
- package/dist/cli/register-history-activity.js +2 -0
- package/dist/cli/register-history-author.js +1 -38
- package/dist/cli/register-history-maintenance.d.ts +9 -0
- package/dist/cli/register-history-maintenance.js +2 -0
- package/dist/cli/register-list-query.js +10 -943
- package/dist/cli/register-mutation-options.js +1 -9
- package/dist/cli/register-mutation.d.ts +0 -5
- package/dist/cli/register-mutation.js +19 -1893
- package/dist/cli/register-operations.js +1 -920
- package/dist/cli/register-setup.js +1 -716
- package/dist/cli/register-structured-mutation.js +1 -196
- package/dist/cli/registration-helpers.js +1 -5
- package/dist/cli/runtime-compatibility-boundary.js +4 -42
- package/dist/cli/schema-registration-helpers.js +1 -73
- package/dist/cli/search-refresh.js +1 -13
- package/dist/cli/stats-analytics-json.js +1 -68
- package/dist/cli/telemetry-flush.js +1 -10
- package/dist/cli-bundle/bundle-manifest.json +164 -156
- package/dist/cli-bundle/chunks/{chunk-NPN5I67J.js → chunk-3IPRM75M.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-4VL5P22L.js +2 -0
- package/dist/cli-bundle/chunks/chunk-AAFBV3U3.js +29 -0
- package/dist/cli-bundle/chunks/chunk-D3YVILJJ.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-WYRZZ5ZE.js → chunk-DEZPZOQ7.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-ECBLPN7B.js +3 -0
- package/dist/cli-bundle/chunks/chunk-J6ERHBV2.js +235 -0
- package/dist/cli-bundle/chunks/chunk-JUNJ5EKI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-L5RCDKQ2.js +2 -0
- package/dist/cli-bundle/chunks/chunk-NSAPNEYH.js +2 -0
- package/dist/cli-bundle/chunks/chunk-OHNLSGGV.js +79 -0
- package/dist/cli-bundle/chunks/chunk-WQKMSFBV.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-BAX2BYUW.js → chunk-XZ6T7YPP.js} +256 -150
- package/dist/cli-bundle/chunks/{chunk-JT6XF6GE.js → chunk-Z3XVXUVF.js} +4 -4
- package/dist/cli-bundle/chunks/register-list-query-UIHRCS6D.js +11 -0
- package/dist/cli-bundle/chunks/register-mutation-WHWMGRVX.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-64YZYTC5.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-PERI45EM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-2W4XIYOB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-2WSBXIGF.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-5FHTCOHS.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-7N6DOREF.js +26 -0
- package/dist/cli-bundle/focused-chunks/{chunk-3BZEOXLT.js → chunk-7PC4R5QB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-BUCJUZVG.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-FE3BABLJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IWITF53W.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OQUGRHKV.js +10 -0
- package/dist/cli-bundle/focused-chunks/{chunk-M6PBRFSH.js → chunk-PNKIANFZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LIJIA4TY.js → chunk-QQQ4SAUO.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-TTYXF5YD.js +177 -0
- package/dist/cli-bundle/focused-chunks/chunk-XNR3DM6J.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XSS3APUF.js +9 -0
- package/dist/cli-bundle/focused-chunks/chunk-YCDQ2N23.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-YJUXGS57.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-ZTCE4UO6.js +58 -0
- package/dist/cli-bundle/main.js +20 -20
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +37 -37
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +42 -42
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +11 -11
- package/dist/cli.js +1 -104
- package/dist/core/checkpoint/checkpoint-gc.js +1 -169
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -133
- package/dist/core/config/nested-settings.js +1 -534
- package/dist/core/config/positional-value.js +1 -109
- package/dist/core/diagnostics/remediation.js +1 -506
- package/dist/core/extensions/activation-summary-markdown.js +2 -145
- package/dist/core/extensions/activation-summary.js +1 -92
- package/dist/core/extensions/activation-transaction.js +1 -46
- package/dist/core/extensions/capability-usage.js +1 -173
- package/dist/core/extensions/command-hook-context.js +1 -13
- package/dist/core/extensions/command-metadata-contract.js +1 -22
- package/dist/core/extensions/command-visibility-tier.js +1 -29
- package/dist/core/extensions/contribution-inventory.js +1 -173
- package/dist/core/extensions/exporter-output-contract.js +1 -66
- package/dist/core/extensions/extension-candidate.js +1 -18
- package/dist/core/extensions/extension-capability-aliases.js +1 -158
- package/dist/core/extensions/extension-hook-runtime.js +1 -699
- package/dist/core/extensions/extension-policy.js +1 -599
- package/dist/core/extensions/extension-registries.js +1 -62
- package/dist/core/extensions/extension-runtime-helpers.js +1 -33
- package/dist/core/extensions/extension-types.js +1 -102
- package/dist/core/extensions/flag-definition-validation.js +1 -52
- package/dist/core/extensions/flag-value-types.js +1 -64
- package/dist/core/extensions/index.js +1 -526
- package/dist/core/extensions/item-field-types.js +1 -39
- package/dist/core/extensions/item-fields.js +1 -261
- package/dist/core/extensions/loader.js +1 -2223
- package/dist/core/extensions/manifest-schema.js +1 -69
- package/dist/core/extensions/module-graph-snapshot.js +1 -33
- package/dist/core/extensions/preflight-ownership.js +1 -41
- package/dist/core/extensions/registration-validation.js +1 -82
- package/dist/core/extensions/registration-values.js +1 -209
- package/dist/core/extensions/reserved-host-flags.js +1 -36
- package/dist/core/extensions/runtime-registrations.js +1 -67
- package/dist/core/extensions/service-ownership.js +1 -19
- package/dist/core/extensions/version-compat.js +1 -216
- package/dist/core/fs/fs-utils.js +2 -158
- package/dist/core/fs/host-environment-errors.js +1 -141
- package/dist/core/fs/index.js +1 -9
- package/dist/core/fs/path-utils.js +1 -17
- package/dist/core/governance/content-fields.js +1 -160
- package/dist/core/governance/issue-codes.js +1 -151
- package/dist/core/governance/metadata-coverage.js +1 -358
- package/dist/core/history/drift-cache.js +3 -72
- package/dist/core/history/drift-scan.js +1 -342
- package/dist/core/history/event-classification.js +1 -109
- package/dist/core/history/event-index.js +8 -784
- package/dist/core/history/history-compact-bulk.js +1 -104
- package/dist/core/history/history-diff.js +1 -158
- package/dist/core/history/history-rewrite.d.ts +6 -1
- package/dist/core/history/history-rewrite.js +1 -107
- package/dist/core/history/history-storage-stats.js +1 -102
- package/dist/core/history/history-stream-policy.js +1 -62
- package/dist/core/history/history.js +2 -617
- package/dist/core/history/identity.js +1 -30
- package/dist/core/history/index.js +1 -9
- package/dist/core/history/projection.js +1 -196
- package/dist/core/history/read.d.ts +9 -0
- package/dist/core/history/read.js +1 -57
- package/dist/core/history/replay.js +2 -439
- package/dist/core/history/version-address.js +1 -32
- package/dist/core/history/workspace-history.js +2 -433
- package/dist/core/io/body-file.js +1 -62
- package/dist/core/io/bulk-ids-input.js +1 -112
- package/dist/core/item/actionability.js +1 -327
- package/dist/core/item/dependency-reference.js +1 -20
- package/dist/core/item/id.js +1 -112
- package/dist/core/item/index.js +1 -12
- package/dist/core/item/item-format-version.js +1 -78
- package/dist/core/item/item-format.js +5 -1473
- package/dist/core/item/item-record.js +1 -23
- package/dist/core/item/item-type-definition.js +1 -133
- package/dist/core/item/parent-reference-policy.js +1 -57
- package/dist/core/item/parse.js +2 -603
- package/dist/core/item/plan-lifecycle.js +1 -19
- package/dist/core/item/priority.js +1 -61
- package/dist/core/item/sprint-release-format.js +1 -38
- package/dist/core/item/status-filter.js +1 -115
- package/dist/core/item/status.js +1 -43
- package/dist/core/item/toon-decode.js +1 -29
- package/dist/core/item/type-registry.js +1 -715
- package/dist/core/item/type-synonyms.js +1 -38
- package/dist/core/lock/index.js +1 -9
- package/dist/core/lock/lock-gc.js +1 -240
- package/dist/core/lock/lock.js +3 -590
- package/dist/core/output/mutation-projection.js +1 -217
- package/dist/core/output/output-control.js +1 -25
- package/dist/core/output/output.js +11 -494
- package/dist/core/output/query-summary.js +1 -58
- package/dist/core/output/tabular.js +1 -77
- package/dist/core/packages/manifest.js +1 -244
- package/dist/core/packages/root.js +1 -84
- package/dist/core/policy/workflow-policy-schema.d.ts +312 -0
- package/dist/core/policy/workflow-policy-schema.js +2 -0
- package/dist/core/policy/workflow-policy-store.d.ts +24 -0
- package/dist/core/policy/workflow-policy-store.js +2 -0
- package/dist/core/policy/workflow-policy.d.ts +139 -0
- package/dist/core/policy/workflow-policy.js +2 -0
- package/dist/core/profile/profile-describe.js +1 -83
- package/dist/core/profile/profile-lint.js +1 -415
- package/dist/core/profile/profile-plan.js +0 -0
- package/dist/core/profile/profile-presets.js +1 -370
- package/dist/core/reproducibility/context.js +1 -82
- package/dist/core/schema/fields-file.js +2 -288
- package/dist/core/schema/item-types-file.js +2 -296
- package/dist/core/schema/runtime-field-filters.js +1 -49
- package/dist/core/schema/runtime-field-values.js +1 -313
- package/dist/core/schema/runtime-schema.js +2 -826
- package/dist/core/schema/status-defs-file.js +2 -227
- package/dist/core/schema/status-token.js +1 -31
- package/dist/core/schema/type-inference.js +1 -95
- package/dist/core/schema/type-presets.js +1 -87
- package/dist/core/schema/type-workflows.js +1 -104
- package/dist/core/search/background-refresh.js +2 -286
- package/dist/core/search/bm25.js +1 -146
- package/dist/core/search/cache.js +2 -534
- package/dist/core/search/corpus.js +1 -311
- package/dist/core/search/embedding-batches.js +1 -163
- package/dist/core/search/eval.js +1 -225
- package/dist/core/search/http-client.js +1 -75
- package/dist/core/search/providers.js +1 -242
- package/dist/core/search/relevance.js +1 -244
- package/dist/core/search/semantic-defaults.js +1 -199
- package/dist/core/search/staleness.js +1 -30
- package/dist/core/search/vector-stores.js +2 -664
- package/dist/core/search/vectorization-metadata.js +1 -81
- package/dist/core/sentry/helpers.js +1 -272
- package/dist/core/sentry/instrument.js +1 -387
- package/dist/core/session/session-state.js +1 -260
- package/dist/core/shared/agent-session-context.js +1 -133
- package/dist/core/shared/author.js +1 -1172
- package/dist/core/shared/command-types.js +1 -4
- package/dist/core/shared/conflict-markers.js +1 -31
- package/dist/core/shared/constants.js +1 -405
- package/dist/core/shared/errors.js +1 -20
- package/dist/core/shared/html-entity-decode.js +1 -131
- package/dist/core/shared/index.js +1 -12
- package/dist/core/shared/item-metadata-contract.js +1 -89
- package/dist/core/shared/lazy-module.js +1 -16
- package/dist/core/shared/levenshtein.js +1 -61
- package/dist/core/shared/memo.js +1 -19
- package/dist/core/shared/numeric-parsers.js +1 -20
- package/dist/core/shared/option-alias-visibility.js +1 -67
- package/dist/core/shared/primitives.js +1 -127
- package/dist/core/shared/serial-queue.js +1 -79
- package/dist/core/shared/serialization.js +1 -210
- package/dist/core/shared/split-comma-list.js +1 -30
- package/dist/core/shared/text-normalization.js +1 -38
- package/dist/core/shared/time.js +1 -306
- package/dist/core/store/index.js +1 -12
- package/dist/core/store/item-format-migration.js +1 -125
- package/dist/core/store/item-metadata-cache.js +1 -1116
- package/dist/core/store/item-metadata-query-index.js +9 -394
- package/dist/core/store/item-metadata-read-work.js +1 -43
- package/dist/core/store/item-store.js +1 -693
- package/dist/core/store/paths.d.ts +1 -1
- package/dist/core/store/paths.js +1 -214
- package/dist/core/store/settings-read-cache.js +1 -85
- package/dist/core/store/settings-validator.d.ts +1 -0
- package/dist/core/store/settings-validator.js +1 -421
- package/dist/core/store/settings.js +3 -1309
- package/dist/core/store/tracker-preflight.js +1 -141
- package/dist/core/telemetry/consent.js +5 -108
- package/dist/core/telemetry/observability.js +1 -246
- package/dist/core/telemetry/runtime.js +4 -1988
- package/dist/core/test/background-runs.js +4 -945
- package/dist/core/test/item-test-run-tracking.js +1 -63
- package/dist/core/test/run-selectors.js +1 -120
- package/dist/core/validate/estimate-defaults.js +1 -89
- package/dist/core/validate/fix-planning.js +1 -189
- package/dist/core/validate/linked-artifact-reference.js +1 -36
- package/dist/core/validate/missing-by-type.js +1 -34
- package/dist/core/validate/missing-link-owners.js +1 -95
- package/dist/core/validate/stale-file-classification.js +1 -82
- package/dist/mcp/http-server.js +5 -448
- package/dist/mcp/legacy-adapter.js +1 -77
- package/dist/mcp/runtime-capabilities.js +1 -200
- package/dist/mcp/server.js +4 -1233
- package/dist/mcp/tool-definitions.js +1 -804
- package/dist/sdk/actionability.js +1 -13
- package/dist/sdk/agent/closed-domain-contracts.js +1 -161
- package/dist/sdk/agent/command-recovery.js +1 -59
- package/dist/sdk/agent/command-suggestions.js +1 -66
- package/dist/sdk/agent/create-option-policy.js +1 -31
- package/dist/sdk/agent/identity-config.js +1 -106
- package/dist/sdk/agent/item-addressing.js +1 -207
- package/dist/sdk/agent/refusal-closure-census.js +1 -151
- package/dist/sdk/agent/refusal-closure.js +1 -133
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -193
- package/dist/sdk/agent/refusal-reachability.js +1 -593
- package/dist/sdk/agent/subcommand-recovery.js +1 -83
- package/dist/sdk/agent/task-transcript-contracts.js +1 -197
- package/dist/sdk/agent/tracker-preflight-contracts.js +1 -126
- package/dist/sdk/agent-capability-contracts.js +1 -428
- package/dist/sdk/agent-session-context.js +1 -9
- package/dist/sdk/annotations.js +1 -448
- package/dist/sdk/author-attribution.js +1 -468
- package/dist/sdk/authoring.js +1 -20
- package/dist/sdk/cli-bootstrap.js +1 -838
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.js +4 -476
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -79
- package/dist/sdk/cli-contracts/command-aliases.d.ts +4 -0
- package/dist/sdk/cli-contracts/command-aliases.js +1 -107
- package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -151
- package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1081
- package/dist/sdk/cli-contracts/commander-types.js +1 -159
- package/dist/sdk/cli-contracts/completeness.js +1 -393
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -222
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1947
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -347
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -986
- package/dist/sdk/cli-contracts/registration-helpers.js +7 -990
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -2090
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -324
- package/dist/sdk/cli-contracts/string-lists.js +1 -16
- package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -461
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -2167
- package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1664
- package/dist/sdk/cli-contracts/typed-action-inputs.js +1 -4
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +1 -17
- package/dist/sdk/cli-program.js +1 -49
- package/dist/sdk/command-line.d.ts +2 -5
- package/dist/sdk/command-line.js +1 -78
- package/dist/sdk/comments.js +1 -133
- package/dist/sdk/compile-cache.js +1 -73
- package/dist/sdk/completion.js +174 -839
- package/dist/sdk/compose.js +1 -1090
- package/dist/sdk/config.js +1 -1204
- package/dist/sdk/context/recency.js +1 -33
- package/dist/sdk/context/semantic-session-attribution.js +1 -82
- package/dist/sdk/context/usage-egress.js +1 -29
- package/dist/sdk/context/usage-ledger.js +3 -185
- package/dist/sdk/context-intent-contracts.js +1 -709
- package/dist/sdk/context-intent-runtime.js +1 -115
- package/dist/sdk/context-packing.js +1 -218
- package/dist/sdk/context-relevance.js +1 -503
- package/dist/sdk/context-signal-store.js +2 -426
- package/dist/sdk/context-usage.js +1 -367
- package/dist/sdk/contracts.js +1 -23
- package/dist/sdk/core-governance.js +1 -14
- package/dist/sdk/core.js +1 -14
- package/dist/sdk/corpus-shape.js +1 -401
- package/dist/sdk/define.js +1 -220
- package/dist/sdk/dependencies.js +1 -718
- package/dist/sdk/dependency-flag-validation.js +1 -156
- package/dist/sdk/dependency-provenance.js +1 -135
- package/dist/sdk/docs.js +1 -14
- package/dist/sdk/duplicates.js +1 -40
- package/dist/sdk/environment/agent-environment.js +1 -466
- package/dist/sdk/environment/host-environment-errors.js +1 -8
- package/dist/sdk/environment/project-runtime-compatibility.js +1 -481
- package/dist/sdk/environment/source-context.js +1 -28
- package/dist/sdk/environment/tracker-preflight.js +1 -9
- package/dist/sdk/error-code-catalog.js +1 -153
- package/dist/sdk/error-runtime.js +1 -58
- package/dist/sdk/errors.js +1 -58
- package/dist/sdk/eval.js +1 -190
- package/dist/sdk/extension/author-manifest.js +1 -92
- package/dist/sdk/extension/bundled-catalog.js +1 -332
- package/dist/sdk/extension/concurrency.js +1 -25
- package/dist/sdk/extension/copy-scope.d.ts +2 -0
- package/dist/sdk/extension/copy-scope.js +2 -0
- package/dist/sdk/extension/custom-field-collisions.js +1 -30
- package/dist/sdk/extension/describe.js +3 -189
- package/dist/sdk/extension/doctor.js +1 -606
- package/dist/sdk/extension/install-plan.d.ts +69 -0
- package/dist/sdk/extension/install-plan.js +2 -0
- package/dist/sdk/extension/install-receipts.d.ts +7 -0
- package/dist/sdk/extension/install-receipts.js +2 -0
- package/dist/sdk/extension/install-runtime.js +3 -313
- package/dist/sdk/extension/install-snapshot.js +1 -66
- package/dist/sdk/extension/install-sources.js +5 -1057
- package/dist/sdk/extension/managed-state.js +2 -252
- package/dist/sdk/extension/migrations.js +2 -174
- package/dist/sdk/extension/output-ownership.js +1 -25
- package/dist/sdk/extension/runtime-summary.js +1 -18
- package/dist/sdk/extension/scaffold.js +4 -2308
- package/dist/sdk/extension/shared.js +1 -147
- package/dist/sdk/extension/source-resolution.js +1 -65
- package/dist/sdk/extension/update-check.js +1 -67
- package/dist/sdk/extension-command-context.js +1 -44
- package/dist/sdk/extension-contracts.js +1 -73
- package/dist/sdk/extension.d.ts +7 -2
- package/dist/sdk/extension.js +1 -2196
- package/dist/sdk/files.js +1 -535
- package/dist/sdk/flag-invocation-contracts.d.ts +0 -5
- package/dist/sdk/flag-invocation-contracts.js +1 -344
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -2224
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -2236
- package/dist/sdk/generated-error-code-catalog.js +1 -16
- package/dist/sdk/governance/assurance-action-contracts.js +1 -4
- package/dist/sdk/governance/assurance-action.js +1 -411
- package/dist/sdk/governance/assurance-limits.js +1 -10
- package/dist/sdk/governance/assurance-mutation-error.js +1 -81
- package/dist/sdk/governance/assurance-presets.js +1 -135
- package/dist/sdk/governance/assurance-runtime.js +1 -238
- package/dist/sdk/governance/assurance.js +4 -1182
- package/dist/sdk/governance/boundary-fixtures.js +1 -200
- package/dist/sdk/governance/coverage-assurance.js +1 -60
- package/dist/sdk/governance/defect-recurrence-coverage.js +1 -188
- package/dist/sdk/governance/defect-recurrence-graph.js +1 -120
- package/dist/sdk/governance/defect-recurrence-signals.js +1 -24
- package/dist/sdk/governance/defect-recurrence.js +1 -623
- package/dist/sdk/governance/extension-host-version.js +1 -115
- package/dist/sdk/governance/gc.js +1 -368
- package/dist/sdk/governance/health.js +1 -2367
- package/dist/sdk/governance/hierarchy-validation.js +1 -108
- package/dist/sdk/governance/linked-file-report.js +1 -71
- package/dist/sdk/governance/merge-receipt-history.js +1 -206
- package/dist/sdk/governance/provenance-health.js +1 -282
- package/dist/sdk/governance/reindex.js +4 -761
- package/dist/sdk/governance/stale-work.js +1 -82
- package/dist/sdk/governance/status-role-diagnostics.js +1 -35
- package/dist/sdk/governance/storage-integrity.js +1 -280
- package/dist/sdk/governance/tracked-runtime-cache.js +1 -106
- package/dist/sdk/governance/upgrade.js +2 -327
- package/dist/sdk/governance/validate-history-drift.js +1 -81
- package/dist/sdk/governance/validate-item-reader.js +1 -17
- package/dist/sdk/governance/validate-normalization.js +1 -36
- package/dist/sdk/governance/validate.d.ts +3 -1
- package/dist/sdk/governance/validate.js +1 -2261
- package/dist/sdk/governance/workflow-completeness.d.ts +32 -0
- package/dist/sdk/governance/workflow-completeness.js +2 -0
- package/dist/sdk/governance/workflow-policy.d.ts +47 -0
- package/dist/sdk/governance/workflow-policy.js +4 -0
- package/dist/sdk/governance/workspace-position.js +1 -163
- package/dist/sdk/governance.d.ts +2 -0
- package/dist/sdk/governance.js +1 -31
- package/dist/sdk/graph/adapter.js +1 -181
- package/dist/sdk/graph/analytics.js +1 -474
- package/dist/sdk/graph/assembly.js +1 -377
- package/dist/sdk/graph/cache.js +1 -160
- package/dist/sdk/graph/centrality.js +1 -258
- package/dist/sdk/graph/conformance.js +1 -130
- package/dist/sdk/graph/deadline-scheduling.d.ts +90 -0
- package/dist/sdk/graph/deadline-scheduling.js +2 -0
- package/dist/sdk/graph/durable-cache.d.ts +1 -1
- package/dist/sdk/graph/durable-cache.js +1 -361
- package/dist/sdk/graph/governance-contracts.js +1 -34
- package/dist/sdk/graph/governance.d.ts +13 -1
- package/dist/sdk/graph/governance.js +1 -735
- package/dist/sdk/graph/hierarchy-integrity.js +1 -310
- package/dist/sdk/graph/index.d.ts +3 -2
- package/dist/sdk/graph/index.js +1 -26
- package/dist/sdk/graph/lifecycle-coverage.d.ts +32 -0
- package/dist/sdk/graph/lifecycle-coverage.js +2 -0
- package/dist/sdk/graph/mutation-advisory.js +1 -176
- package/dist/sdk/graph/remediation.js +1 -197
- package/dist/sdk/graph/run.d.ts +15 -1
- package/dist/sdk/graph/run.js +1 -768
- package/dist/sdk/graph/scheduling.js +1 -124
- package/dist/sdk/graph/traversal.js +1 -284
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -27
- package/dist/sdk/graph.js +1 -15
- package/dist/sdk/guide-topics.js +1 -707
- package/dist/sdk/guide.js +1 -279
- package/dist/sdk/history/maintenance.d.ts +71 -0
- package/dist/sdk/history/maintenance.js +2 -0
- package/dist/sdk/history/salvage.js +2 -247
- package/dist/sdk/history/subject.d.ts +19 -0
- package/dist/sdk/history/subject.js +2 -0
- package/dist/sdk/history-analytics.js +1 -282
- package/dist/sdk/history-compact.js +1 -527
- package/dist/sdk/history-mcp.js +1 -68
- package/dist/sdk/history-provenance.js +1 -182
- package/dist/sdk/history-read.js +1 -96
- package/dist/sdk/history-redact.d.ts +1 -14
- package/dist/sdk/history-redact.js +1 -643
- package/dist/sdk/history-repair.d.ts +5 -0
- package/dist/sdk/history-repair.js +1 -657
- package/dist/sdk/improvement-ledger-validation.js +1 -62
- package/dist/sdk/improvement-ledger.js +2 -257
- package/dist/sdk/index.d.ts +4 -1
- package/dist/sdk/index.js +1 -183
- package/dist/sdk/init-agent-guidance.js +2 -496
- package/dist/sdk/init.js +2 -820
- package/dist/sdk/invocation-author.js +1 -39
- package/dist/sdk/item-children.js +1 -90
- package/dist/sdk/item-metadata-index.js +1 -15
- package/dist/sdk/item-schedule.js +1 -27
- package/dist/sdk/item-transaction.js +1 -396
- package/dist/sdk/learnings.js +1 -29
- package/dist/sdk/lifecycle/append.js +2 -53
- package/dist/sdk/lifecycle/claim.d.ts +2 -0
- package/dist/sdk/lifecycle/claim.js +1 -242
- package/dist/sdk/lifecycle/close-many.js +1 -438
- package/dist/sdk/lifecycle/close.js +1 -468
- package/dist/sdk/lifecycle/copy.js +1 -212
- package/dist/sdk/lifecycle/create.js +1 -1949
- package/dist/sdk/lifecycle/delete.js +1 -45
- package/dist/sdk/lifecycle/event-validation-messages.js +1 -91
- package/dist/sdk/lifecycle/focus.js +1 -91
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -24
- package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -149
- package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -40
- package/dist/sdk/lifecycle/mcp-actions.d.ts +2 -0
- package/dist/sdk/lifecycle/mcp-actions.js +1 -51
- package/dist/sdk/lifecycle/metadata-normalizers.js +1 -46
- package/dist/sdk/lifecycle/mutation-command-options.js +1 -9
- package/dist/sdk/lifecycle/plan.js +1 -1606
- package/dist/sdk/lifecycle/recurrence-parsers.d.ts +1 -1
- package/dist/sdk/lifecycle/recurrence-parsers.js +1 -147
- package/dist/sdk/lifecycle/reopen.js +1 -68
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +1 -143
- package/dist/sdk/lifecycle/restore.d.ts +1 -0
- package/dist/sdk/lifecycle/restore.js +1 -330
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -295
- package/dist/sdk/lifecycle/update-many.js +1 -861
- package/dist/sdk/lifecycle/update.js +1 -2136
- package/dist/sdk/lifecycle-completion.js +1 -92
- package/dist/sdk/lifecycle-policy.js +1 -120
- package/dist/sdk/linked-artifacts.js +1 -530
- package/dist/sdk/mcp/apps.js +4 -133
- package/dist/sdk/mcp/authorization.js +1 -404
- package/dist/sdk/mcp/discovery.js +1 -494
- package/dist/sdk/mcp/interactions.js +1 -336
- package/dist/sdk/mcp/protocol.d.ts +7 -0
- package/dist/sdk/mcp/protocol.js +1 -184
- package/dist/sdk/mcp/skills.js +1 -389
- package/dist/sdk/mcp/subscriptions.js +1 -211
- package/dist/sdk/mcp/tasks.js +2 -430
- package/dist/sdk/mcp/transport.js +1 -260
- package/dist/sdk/merge/abandoned-receipts.js +1 -46
- package/dist/sdk/merge/driver.js +1 -212
- package/dist/sdk/merge/index.js +1 -16
- package/dist/sdk/merge/install.js +3 -561
- package/dist/sdk/merge/receipt-file-boundary.js +1 -46
- package/dist/sdk/merge/receipt-operation.js +1 -96
- package/dist/sdk/merge/receipt-schema.js +1 -397
- package/dist/sdk/merge/receipts.js +4 -525
- package/dist/sdk/merge/reconcile.js +1 -352
- package/dist/sdk/merge/three-way.js +3 -775
- package/dist/sdk/merge.js +1 -10
- package/dist/sdk/mutation-events.js +1 -292
- package/dist/sdk/mutation-guard.js +1 -216
- package/dist/sdk/notes.js +1 -139
- package/dist/sdk/output-contracts.js +1 -172
- package/dist/sdk/output-projection.js +1 -430
- package/dist/sdk/output-token-accounting.js +1 -140
- package/dist/sdk/output.js +1 -64
- package/dist/sdk/ownership-source.js +1 -21
- package/dist/sdk/package-import-adapters.js +1 -442
- package/dist/sdk/package-migrations.js +1 -20
- package/dist/sdk/package-runtime-options.js +1 -80
- package/dist/sdk/pagination.js +1 -162
- package/dist/sdk/profile.js +1 -454
- package/dist/sdk/provenance.js +1 -258
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.js +1 -401
- package/dist/sdk/query/aggregate.d.ts +16 -0
- package/dist/sdk/query/aggregate.js +1 -390
- package/dist/sdk/query/calendar.js +1 -964
- package/dist/sdk/query/complete-list.js +1 -215
- package/dist/sdk/query/context.js +1 -1702
- package/dist/sdk/query/duplicate-candidates.js +1 -70
- package/dist/sdk/query/get.js +1 -450
- package/dist/sdk/query/history.js +1 -186
- package/dist/sdk/query/item-filter-options.js +1 -9
- package/dist/sdk/query/light-metadata.js +1 -18
- package/dist/sdk/query/list-filter-shared.js +1 -81
- package/dist/sdk/query/list.js +1 -1304
- package/dist/sdk/query/multi-value-filters.js +1 -78
- package/dist/sdk/query/next.js +1 -513
- package/dist/sdk/query/parsers.js +1 -44
- package/dist/sdk/query/projection-contracts.js +1 -184
- package/dist/sdk/query/search-contracts.d.ts +27 -0
- package/dist/sdk/query/search-contracts.js +1 -230
- package/dist/sdk/query/search-pagination.js +1 -35
- package/dist/sdk/query/search-rendering.js +1 -105
- package/dist/sdk/query/search.d.ts +6 -4
- package/dist/sdk/query/search.js +2 -1987
- package/dist/sdk/query.js +1 -35
- package/dist/sdk/read-output/continuation.js +1 -194
- package/dist/sdk/read-output-budget.js +1 -135
- package/dist/sdk/read-output-contracts.d.ts +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1225
- package/dist/sdk/read-output-rows.js +1 -186
- package/dist/sdk/read-output-session.js +1 -208
- package/dist/sdk/relationship-analytics.js +1 -410
- package/dist/sdk/relationship-context.js +1 -284
- package/dist/sdk/relationship-history.js +4 -519
- package/dist/sdk/relationship-kinds/contract.js +1 -22
- package/dist/sdk/relationship-migration.js +1 -77
- package/dist/sdk/relationships.js +1 -579
- package/dist/sdk/reproducibility/process.js +1 -87
- package/dist/sdk/runtime-action-aliases.js +1 -59
- package/dist/sdk/runtime-extended-actions.js +1 -177
- package/dist/sdk/runtime-input.js +1 -614
- package/dist/sdk/runtime-primitives.js +1 -84
- package/dist/sdk/runtime-public-contracts.d.ts +2 -1
- package/dist/sdk/runtime-public-contracts.js +1 -4
- package/dist/sdk/runtime-stats-options.js +1 -38
- package/dist/sdk/runtime.d.ts +4 -0
- package/dist/sdk/runtime.js +1 -1928
- package/dist/sdk/scheduling-shortcuts.js +1 -63
- package/dist/sdk/schema-migration.js +3 -856
- package/dist/sdk/schema.d.ts +2 -1
- package/dist/sdk/schema.js +1 -1376
- package/dist/sdk/search-refresh-worker.js +1 -18
- package/dist/sdk/similarity-scoring.js +1 -53
- package/dist/sdk/similarity.js +1 -326
- package/dist/sdk/start-task-status.js +1 -14
- package/dist/sdk/stats.js +1 -270
- package/dist/sdk/structured-mutations.js +1 -580
- package/dist/sdk/telemetry-flush.js +1 -13
- package/dist/sdk/telemetry.js +1 -405
- package/dist/sdk/templates.js +2 -292
- package/dist/sdk/test/batch.js +2 -509
- package/dist/sdk/test/entry.js +1 -70
- package/dist/sdk/test/execution.js +6 -2211
- package/dist/sdk/test/linked-command-detection.js +1 -546
- package/dist/sdk/test/measurements.js +1 -91
- package/dist/sdk/test/parsers.js +1 -545
- package/dist/sdk/test/runs.js +1 -193
- package/dist/sdk/test/trust.js +2 -206
- package/dist/sdk/testing.js +4 -1391
- package/dist/sdk/traceability/runtime-files-lookup.js +1 -32
- package/dist/sdk/traceability/source-traceability.js +1 -292
- package/dist/sdk/tracker-root-discovery.js +1 -9
- package/dist/sdk/workspace-contracts-cache.js +1 -28
- package/dist/sdk/workspace-contracts.js +1 -33
- package/dist/sdk/workspace-memory.js +2 -318
- package/dist/sdk/workspace-recipe.js +1 -71
- package/dist/sdk/workspace-snapshot.js +4 -613
- package/dist/sdk/workspace-transaction-gc.js +1 -149
- package/dist/sdk/workspace-transaction.js +2 -363
- package/dist/sdk/workspace.js +3 -127
- package/dist/types/index.js +1 -9
- package/dist/types.d.ts +4 -0
- package/dist/types.js +1 -245
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/COMMANDS.md +10 -0
- package/docs/CONFIGURATION.md +12 -1
- package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +167 -0
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +9 -3
- package/docs/EXTENSIONS.md +1 -0
- package/docs/HISTORY_MAINTENANCE.md +125 -0
- package/docs/MCP_2026_07_28_CONFORMANCE.md +20 -10
- package/docs/PACKAGE_EVIDENCE.md +92 -0
- package/docs/PLANNING_MEASUREMENTS.md +183 -0
- package/docs/README.md +4 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +5 -0
- package/docs/SCRIPTING.md +21 -0
- package/docs/TESTING.md +33 -0
- package/docs/WORKFLOW_POLICIES.md +129 -0
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +7 -7
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -5
- package/marketplace.json +2 -2
- package/package.json +5 -5
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/finalize-build.mjs +45 -3
- package/dist/cli-bundle/chunks/chunk-AZDFJGH6.js +0 -9
- package/dist/cli-bundle/chunks/chunk-CKOL5U7J.js +0 -77
- package/dist/cli-bundle/chunks/chunk-JX4DH4WC.js +0 -3
- package/dist/cli-bundle/chunks/chunk-OF76PSDQ.js +0 -5
- package/dist/cli-bundle/chunks/chunk-QUWFABDM.js +0 -232
- package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-RWWBOWJ5.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WGAOYSYH.js +0 -40
- package/dist/cli-bundle/chunks/chunk-WI2AYPA7.js +0 -2
- package/dist/cli-bundle/chunks/register-list-query-5JL52D33.js +0 -11
- package/dist/cli-bundle/chunks/register-mutation-ZPG7KMVP.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-I5W3KMGB.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-H4SVAVX7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-AL5ON6K6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CHC2IDXA.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-CK6QFAPZ.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-EZR3GHFE.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-H2WJWK7L.js +0 -56
- package/dist/cli-bundle/focused-chunks/chunk-NTPY5GSO.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-P5O7MP5Y.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PDMW2E36.js +0 -177
- package/dist/cli-bundle/focused-chunks/chunk-PEFABF7E.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-QTVCLMSZ.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-QTZRBUYA.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-SGQST3PQ.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-UKHASMMP.js +0 -10
- package/dist/cli-bundle/focused-chunks/chunk-ZPEKQHOC.js +0 -2
package/dist/sdk/query/list.js
CHANGED
|
@@ -1,1305 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module sdk/query/list
|
|
3
|
-
*
|
|
4
|
-
* Implements the pm list command surface and its agent-facing runtime behavior.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ccdb7d16-4f38-58d4-a19d-4ab1516cb1d7")}catch(e){}}();
|
|
8
|
-
import { assertInitializedTracker } from "../environment/tracker-preflight.js";
|
|
9
|
-
import { getActiveExtensionRegistrations, hasActiveOnReadHooks, } from "../../core/extensions/index.js";
|
|
10
|
-
import { toItemRecord } from "../../core/item/item-record.js";
|
|
11
|
-
import { isTerminalStatus } from "../../core/item/status.js";
|
|
12
|
-
import { collectDependencyBlockedIds } from "../actionability.js";
|
|
13
|
-
import { isStatusAllFilterInput, parseStatusFilterCsv, } from "../../core/item/status-filter.js";
|
|
14
|
-
import { resolveItemTypeRegistry, } from "../../core/item/type-registry.js";
|
|
15
|
-
import { parseIntegerLimit } from "./parsers.js";
|
|
16
|
-
import { parsePriorityFilterSet, parseStringFilterSet, parseTypeFilterSet, } from "./multi-value-filters.js";
|
|
17
|
-
import { collectRuntimeFilterValues, matchesRuntimeFilters, } from "../../core/schema/runtime-field-filters.js";
|
|
18
|
-
import { hasMissingMetadataFilter, itemMatchesMissingMetadata, lifecycleClassifierFromStatusRegistry, } from "../../core/governance/metadata-coverage.js";
|
|
19
|
-
import { contentFiltersNeedBody, contentFiltersNeedCollections, hasContentFieldFilter, itemMatchesContentFilters, } from "../../core/governance/content-fields.js";
|
|
20
|
-
import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
21
|
-
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
22
|
-
import { PmCliError } from "../../core/shared/errors.js";
|
|
23
|
-
import { compareTimestampStrings, matchesTimestampFilters, nowIso, resolveIsoOrRelative, } from "../../core/shared/time.js";
|
|
24
|
-
import { listAllItemMetadata, listAllItemMetadataLight, listAllItemMetadataWithBody, } from "../../core/store/item-store.js";
|
|
25
|
-
import { HEAVY_METADATA_KEYS, readItemMetadataDerivedIndexState, } from "../../core/store/item-metadata-cache.js";
|
|
26
|
-
import { queryItemMetadataIndex } from "../../core/store/item-metadata-query-index.js";
|
|
27
|
-
import { resolvePmRoot } from "../../core/store/paths.js";
|
|
28
|
-
import { readSettings } from "../../core/store/settings.js";
|
|
29
|
-
import { LIST_FILTER_FLAG_CONTRACTS } from "../cli-contracts/flag-contracts.js";
|
|
30
|
-
import { resolveWorkspaceRelationshipKindRegistry } from "../graph/assembly.js";
|
|
31
|
-
import { collectHierarchyRelations, indexHierarchyRelations, } from "../graph/hierarchy-integrity.js";
|
|
32
|
-
import { createQueryFingerprint, encodeQueryCursor, resolveQueryCursorStart, selectCursorSemanticOptions, } from "../pagination.js";
|
|
33
|
-
import { BRIEF_LIST_FIELDS, DEFAULT_COMPACT_LIST_FIELDS, listListProjectionFields, } from "./projection-contracts.js";
|
|
34
|
-
export { BRIEF_LIST_FIELDS, DEFAULT_COMPACT_LIST_FIELDS, LIST_COMMAND_DEFAULT_PROJECTIONS, listListProjectionFields, } from "./projection-contracts.js";
|
|
35
|
-
/** Extract the missing-metadata selection filters from list/update-many options. */
|
|
36
|
-
export const resolveMissingMetadataFilters = (options) => {
|
|
37
|
-
return {
|
|
38
|
-
acMissing: options.filterAcMissing === true,
|
|
39
|
-
estimatesMissing: options.filterEstimatesMissing === true,
|
|
40
|
-
resolutionMissing: options.filterResolutionMissing === true,
|
|
41
|
-
metadataMissing: options.filterMetadataMissing === true,
|
|
42
|
-
reviewerMissing: options.filterReviewerMissing === true,
|
|
43
|
-
riskMissing: options.filterRiskMissing === true,
|
|
44
|
-
confidenceMissing: options.filterConfidenceMissing === true,
|
|
45
|
-
sprintMissing: options.filterSprintMissing === true,
|
|
46
|
-
releaseMissing: options.filterReleaseMissing === true,
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
const CONTENT_FIELD_FLAG_MAPPINGS = [
|
|
50
|
-
{
|
|
51
|
-
field: "notes",
|
|
52
|
-
presentKey: "hasNotes",
|
|
53
|
-
absentKey: "noNotes",
|
|
54
|
-
presentFlag: "--has-notes",
|
|
55
|
-
absentFlag: "--no-notes",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
field: "learnings",
|
|
59
|
-
presentKey: "hasLearnings",
|
|
60
|
-
absentKey: "noLearnings",
|
|
61
|
-
presentFlag: "--has-learnings",
|
|
62
|
-
absentFlag: "--no-learnings",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
field: "files",
|
|
66
|
-
presentKey: "hasFiles",
|
|
67
|
-
absentKey: "noFiles",
|
|
68
|
-
presentFlag: "--has-files",
|
|
69
|
-
absentFlag: "--no-files",
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
field: "docs",
|
|
73
|
-
presentKey: "hasDocs",
|
|
74
|
-
absentKey: "noDocs",
|
|
75
|
-
presentFlag: "--has-docs",
|
|
76
|
-
absentFlag: "--no-docs",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
field: "tests",
|
|
80
|
-
presentKey: "hasTests",
|
|
81
|
-
absentKey: "noTests",
|
|
82
|
-
presentFlag: "--has-tests",
|
|
83
|
-
absentFlag: "--no-tests",
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
field: "comments",
|
|
87
|
-
presentKey: "hasComments",
|
|
88
|
-
absentKey: "noComments",
|
|
89
|
-
presentFlag: "--has-comments",
|
|
90
|
-
absentFlag: "--no-comments",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
field: "deps",
|
|
94
|
-
presentKey: "hasDeps",
|
|
95
|
-
absentKey: "noDeps",
|
|
96
|
-
presentFlag: "--has-deps",
|
|
97
|
-
absentFlag: "--no-deps",
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
field: "body",
|
|
101
|
-
presentKey: "hasBody",
|
|
102
|
-
absentKey: "emptyBody",
|
|
103
|
-
presentFlag: "--has-body",
|
|
104
|
-
absentFlag: "--empty-body",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
field: "linked_command",
|
|
108
|
-
presentKey: "hasLinkedCommand",
|
|
109
|
-
absentKey: "noLinkedCommand",
|
|
110
|
-
presentFlag: "--has-linked-command",
|
|
111
|
-
absentFlag: "--no-linked-command",
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
/** Resolve the content-field presence/absence selections from list/search options. A field requested both present AND absent is a usage error (the two selections are mutually exclusive). Returns an empty object when no content-field filter is active. */
|
|
115
|
-
export const resolveContentFieldFilters = (options) => {
|
|
116
|
-
const conflict = CONTENT_FIELD_FLAG_MAPPINGS.find((mapping) => options[mapping.presentKey] === true &&
|
|
117
|
-
options[mapping.absentKey] === true);
|
|
118
|
-
if (conflict) {
|
|
119
|
-
throw new PmCliError(`Cannot combine ${conflict.presentFlag} with ${conflict.absentFlag} for the same field.`, EXIT_CODE.USAGE);
|
|
120
|
-
}
|
|
121
|
-
return Object.fromEntries(CONTENT_FIELD_FLAG_MAPPINGS.flatMap((mapping) => {
|
|
122
|
-
if (options[mapping.presentKey] === true) {
|
|
123
|
-
return [[mapping.field, "present"]];
|
|
124
|
-
}
|
|
125
|
-
return options[mapping.absentKey] === true
|
|
126
|
-
? [[mapping.field, "absent"]]
|
|
127
|
-
: [];
|
|
128
|
-
}));
|
|
129
|
-
};
|
|
130
|
-
/** Public contract for list sort fields, shared by SDK and presentation-layer consumers. */
|
|
131
|
-
export const LIST_SORT_FIELDS = [
|
|
132
|
-
"priority",
|
|
133
|
-
"deadline",
|
|
134
|
-
"updated_at",
|
|
135
|
-
"created_at",
|
|
136
|
-
"title",
|
|
137
|
-
"parent",
|
|
138
|
-
];
|
|
139
|
-
/** Supported values accepted by the list sort order contract. */
|
|
140
|
-
export const LIST_SORT_ORDER_VALUES = ["asc", "desc"];
|
|
141
|
-
// A projection that selects any heavy collection field (or `--full`, which returns
|
|
142
|
-
// items verbatim) must load the full metadata; everything else takes the light path.
|
|
143
|
-
// Sourced from the single HEAVY_METADATA_KEYS definition in the cache layer so the
|
|
144
|
-
// light/heavy split can never drift between the cache and the projection routing.
|
|
145
|
-
const HEAVY_PROJECTION_FIELDS = new Set(HEAVY_METADATA_KEYS);
|
|
146
|
-
/** Build the source-corpus certificate and enforce fail-closed list reads. */
|
|
147
|
-
function resolveListCompleteness(warnings, indexed, strict) {
|
|
148
|
-
const unreadableItemCount = warnings.filter((warning) => warning.startsWith("item_list_item_read_failed:")).length;
|
|
149
|
-
const unreadableDirectoryCount = warnings.filter((warning) => warning.startsWith("item_list_directory_read_failed:")).length;
|
|
150
|
-
const completeness = {
|
|
151
|
-
status: indexed
|
|
152
|
-
? "unchecked"
|
|
153
|
-
: unreadableItemCount + unreadableDirectoryCount > 0
|
|
154
|
-
? "partial"
|
|
155
|
-
: "complete",
|
|
156
|
-
unreadable_item_count: unreadableItemCount,
|
|
157
|
-
unreadable_directory_count: unreadableDirectoryCount,
|
|
158
|
-
};
|
|
159
|
-
if (strict && completeness.status === "partial") {
|
|
160
|
-
throw new PmCliError(`List source is incomplete: ${unreadableItemCount} item document(s) and ${unreadableDirectoryCount} item directory/directories could not be read.`, EXIT_CODE.GENERIC_FAILURE, {
|
|
161
|
-
code: "list_source_incomplete",
|
|
162
|
-
why: "Strict list reads fail closed so agents and SDK consumers never treat an omitted item as a complete workspace.",
|
|
163
|
-
nextSteps: [
|
|
164
|
-
"Run pm validate --check-storage-integrity to locate unreadable tracker artifacts.",
|
|
165
|
-
"Repair the reported files or align the installed decoder version, then retry.",
|
|
166
|
-
],
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
return completeness;
|
|
170
|
-
}
|
|
171
|
-
function isNonEmptyRecord(value) {
|
|
172
|
-
return (typeof value === "object" &&
|
|
173
|
-
value !== null &&
|
|
174
|
-
!Array.isArray(value) &&
|
|
175
|
-
Object.keys(value).length > 0);
|
|
176
|
-
}
|
|
177
|
-
// Active content-field filter flags, keyed by the options dest and the snake_case
|
|
178
|
-
// summary key emitted in the filters echo (GH-242). Presence and absence are
|
|
179
|
-
// distinct echo keys (has_notes vs no_notes; has_body vs empty_body).
|
|
180
|
-
const CONTENT_FILTER_ECHO_ENTRIES = [
|
|
181
|
-
{ key: "hasNotes", summaryKey: "has_notes" },
|
|
182
|
-
{ key: "hasLearnings", summaryKey: "has_learnings" },
|
|
183
|
-
{ key: "hasFiles", summaryKey: "has_files" },
|
|
184
|
-
{ key: "hasDocs", summaryKey: "has_docs" },
|
|
185
|
-
{ key: "hasTests", summaryKey: "has_tests" },
|
|
186
|
-
{ key: "hasComments", summaryKey: "has_comments" },
|
|
187
|
-
{ key: "hasDeps", summaryKey: "has_deps" },
|
|
188
|
-
{ key: "hasBody", summaryKey: "has_body" },
|
|
189
|
-
{ key: "hasLinkedCommand", summaryKey: "has_linked_command" },
|
|
190
|
-
{ key: "noNotes", summaryKey: "no_notes" },
|
|
191
|
-
{ key: "noLearnings", summaryKey: "no_learnings" },
|
|
192
|
-
{ key: "noFiles", summaryKey: "no_files" },
|
|
193
|
-
{ key: "noDocs", summaryKey: "no_docs" },
|
|
194
|
-
{ key: "noTests", summaryKey: "no_tests" },
|
|
195
|
-
{ key: "noComments", summaryKey: "no_comments" },
|
|
196
|
-
{ key: "noDeps", summaryKey: "no_deps" },
|
|
197
|
-
{ key: "emptyBody", summaryKey: "empty_body" },
|
|
198
|
-
{ key: "noLinkedCommand", summaryKey: "no_linked_command" },
|
|
199
|
-
];
|
|
200
|
-
// Active governance-missing filter flags (GH-236), keyed by options dest and the
|
|
201
|
-
// snake_case summary key emitted in the filters echo.
|
|
202
|
-
const GOVERNANCE_MISSING_ECHO_ENTRIES = [
|
|
203
|
-
{ key: "filterReviewerMissing", summaryKey: "filter_reviewer_missing" },
|
|
204
|
-
{ key: "filterRiskMissing", summaryKey: "filter_risk_missing" },
|
|
205
|
-
{ key: "filterConfidenceMissing", summaryKey: "filter_confidence_missing" },
|
|
206
|
-
{ key: "filterSprintMissing", summaryKey: "filter_sprint_missing" },
|
|
207
|
-
{ key: "filterReleaseMissing", summaryKey: "filter_release_missing" },
|
|
208
|
-
];
|
|
209
|
-
function applyContentFilterEcho(filters, options) {
|
|
210
|
-
for (const entry of CONTENT_FILTER_ECHO_ENTRIES) {
|
|
211
|
-
if (options[entry.key] === true) {
|
|
212
|
-
filters[entry.summaryKey] = true;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
function applyGovernanceMissingFilterEcho(filters, options) {
|
|
217
|
-
for (const entry of GOVERNANCE_MISSING_ECHO_ENTRIES) {
|
|
218
|
-
if (options[entry.key] === true) {
|
|
219
|
-
filters[entry.summaryKey] = true;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Copies user-supplied option values into compact filter summaries.
|
|
225
|
-
*
|
|
226
|
-
* Compact list/search responses are optimized for agent context: they echo only
|
|
227
|
-
* filters the caller actually supplied. Keeping this helper shared prevents the
|
|
228
|
-
* list and search command summaries from drifting as new scalar filters are
|
|
229
|
-
* added.
|
|
230
|
-
*/
|
|
231
|
-
export function applyFilterValueEcho(filters, options, entries) {
|
|
232
|
-
for (const entry of entries) {
|
|
233
|
-
const value = options[entry.optionKey];
|
|
234
|
-
if (value !== undefined) {
|
|
235
|
-
filters[entry.summaryKey] = entry.normalize
|
|
236
|
-
? entry.normalize(value)
|
|
237
|
-
: value;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
/** Implements build content filter echo for the public runtime surface of this module. */
|
|
242
|
-
export function buildContentFilterEcho(options) {
|
|
243
|
-
const echo = {};
|
|
244
|
-
applyContentFilterEcho(echo, options);
|
|
245
|
-
return echo;
|
|
246
|
-
}
|
|
247
|
-
/** Implements build governance missing filter echo for the public runtime surface of this module. */
|
|
248
|
-
export function buildGovernanceMissingFilterEcho(options) {
|
|
249
|
-
const echo = {};
|
|
250
|
-
applyGovernanceMissingFilterEcho(echo, options);
|
|
251
|
-
return echo;
|
|
252
|
-
}
|
|
253
|
-
const COMPACT_LIST_VALUE_FILTER_ECHO_ENTRIES = [
|
|
254
|
-
{ optionKey: "type", summaryKey: "type" },
|
|
255
|
-
{ optionKey: "tag", summaryKey: "tag" },
|
|
256
|
-
{ optionKey: "priority", summaryKey: "priority" },
|
|
257
|
-
{ optionKey: "deadlineBefore", summaryKey: "deadline_before" },
|
|
258
|
-
{ optionKey: "deadlineAfter", summaryKey: "deadline_after" },
|
|
259
|
-
{ optionKey: "updatedAfter", summaryKey: "updated_after" },
|
|
260
|
-
{ optionKey: "updatedBefore", summaryKey: "updated_before" },
|
|
261
|
-
{ optionKey: "createdAfter", summaryKey: "created_after" },
|
|
262
|
-
{ optionKey: "createdBefore", summaryKey: "created_before" },
|
|
263
|
-
{ optionKey: "ids", summaryKey: "ids" },
|
|
264
|
-
{ optionKey: "assignee", summaryKey: "assignee" },
|
|
265
|
-
{ optionKey: "assigneeFilter", summaryKey: "assignee_filter" },
|
|
266
|
-
{ optionKey: "parent", summaryKey: "parent" },
|
|
267
|
-
{ optionKey: "sprint", summaryKey: "sprint" },
|
|
268
|
-
{ optionKey: "release", summaryKey: "release" },
|
|
269
|
-
];
|
|
270
|
-
const VERBOSE_LIST_VALUE_FILTER_ECHO_ENTRIES = [
|
|
271
|
-
{ optionKey: "type", summaryKey: "type" },
|
|
272
|
-
{ optionKey: "tag", summaryKey: "tag" },
|
|
273
|
-
{ optionKey: "priority", summaryKey: "priority" },
|
|
274
|
-
{ optionKey: "deadlineBefore", summaryKey: "deadline_before" },
|
|
275
|
-
{ optionKey: "deadlineAfter", summaryKey: "deadline_after" },
|
|
276
|
-
{ optionKey: "updatedAfter", summaryKey: "updated_after" },
|
|
277
|
-
{ optionKey: "updatedBefore", summaryKey: "updated_before" },
|
|
278
|
-
{ optionKey: "createdAfter", summaryKey: "created_after" },
|
|
279
|
-
{ optionKey: "createdBefore", summaryKey: "created_before" },
|
|
280
|
-
{ optionKey: "ids", summaryKey: "ids" },
|
|
281
|
-
{ optionKey: "assignee", summaryKey: "assignee" },
|
|
282
|
-
{ optionKey: "assigneeFilter", summaryKey: "assignee_filter" },
|
|
283
|
-
{ optionKey: "parent", summaryKey: "parent" },
|
|
284
|
-
{ optionKey: "sprint", summaryKey: "sprint" },
|
|
285
|
-
{ optionKey: "release", summaryKey: "release" },
|
|
286
|
-
{ optionKey: "limit", summaryKey: "limit" },
|
|
287
|
-
{ optionKey: "offset", summaryKey: "offset" },
|
|
288
|
-
{ optionKey: "includeBody", summaryKey: "include_body" },
|
|
289
|
-
{ optionKey: "compact", summaryKey: "compact" },
|
|
290
|
-
{ optionKey: "fields", summaryKey: "fields" },
|
|
291
|
-
];
|
|
292
|
-
const VERBOSE_LIST_BOOLEAN_FILTER_ECHO_ENTRIES = [
|
|
293
|
-
{ key: "filterAcMissing", summaryKey: "filter_ac_missing" },
|
|
294
|
-
{ key: "filterEstimatesMissing", summaryKey: "filter_estimates_missing" },
|
|
295
|
-
{ key: "filterResolutionMissing", summaryKey: "filter_resolution_missing" },
|
|
296
|
-
{ key: "filterMetadataMissing", summaryKey: "filter_metadata_missing" },
|
|
297
|
-
];
|
|
298
|
-
const LIST_RECENT_WINDOW = "-7d";
|
|
299
|
-
function buildCompactListFilterSummary(params) {
|
|
300
|
-
const { filtersStatus, options, treeEnabled, treeDepth, sortField, sortOrder, runtimeFieldFilters, } = params;
|
|
301
|
-
const filters = {};
|
|
302
|
-
if (filtersStatus !== null) {
|
|
303
|
-
filters.status = filtersStatus;
|
|
304
|
-
}
|
|
305
|
-
if (options.dependencyBlocked === true) {
|
|
306
|
-
filters.blocked_semantics = "status_or_dependency";
|
|
307
|
-
}
|
|
308
|
-
applyFilterValueEcho(filters, options, COMPACT_LIST_VALUE_FILTER_ECHO_ENTRIES);
|
|
309
|
-
applyListWindowFilterEcho(filters, options);
|
|
310
|
-
if (options.filterAcMissing === true) {
|
|
311
|
-
filters.filter_ac_missing = true;
|
|
312
|
-
}
|
|
313
|
-
if (options.filterEstimatesMissing === true) {
|
|
314
|
-
filters.filter_estimates_missing = true;
|
|
315
|
-
}
|
|
316
|
-
if (options.filterResolutionMissing === true) {
|
|
317
|
-
filters.filter_resolution_missing = true;
|
|
318
|
-
}
|
|
319
|
-
if (options.filterMetadataMissing === true) {
|
|
320
|
-
filters.filter_metadata_missing = true;
|
|
321
|
-
}
|
|
322
|
-
applyGovernanceMissingFilterEcho(filters, options);
|
|
323
|
-
applyContentFilterEcho(filters, options);
|
|
324
|
-
if (options.limit !== undefined) {
|
|
325
|
-
filters.limit = options.limit;
|
|
326
|
-
}
|
|
327
|
-
if (options.offset !== undefined) {
|
|
328
|
-
filters.offset = options.offset;
|
|
329
|
-
}
|
|
330
|
-
if (options.includeBody === true) {
|
|
331
|
-
filters.include_body = true;
|
|
332
|
-
}
|
|
333
|
-
if (options.fields !== undefined) {
|
|
334
|
-
filters.fields = options.fields;
|
|
335
|
-
}
|
|
336
|
-
if (treeEnabled) {
|
|
337
|
-
filters.tree = true;
|
|
338
|
-
if (treeDepth !== undefined) {
|
|
339
|
-
filters.tree_depth = treeDepth;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
if (sortField !== undefined) {
|
|
343
|
-
filters.sort = sortField;
|
|
344
|
-
filters.order = sortOrder;
|
|
345
|
-
}
|
|
346
|
-
if (isNonEmptyRecord(runtimeFieldFilters)) {
|
|
347
|
-
filters.runtime_filters = runtimeFieldFilters;
|
|
348
|
-
}
|
|
349
|
-
return filters;
|
|
350
|
-
}
|
|
351
|
-
function compareDefaultSort(left, right, statusRegistry) {
|
|
352
|
-
const leftTerminal = isTerminalStatus(left.status, statusRegistry);
|
|
353
|
-
const rightTerminal = isTerminalStatus(right.status, statusRegistry);
|
|
354
|
-
if (leftTerminal !== rightTerminal) {
|
|
355
|
-
return leftTerminal ? 1 : -1;
|
|
356
|
-
}
|
|
357
|
-
const byPriority = left.priority - right.priority;
|
|
358
|
-
if (byPriority !== 0) {
|
|
359
|
-
return byPriority;
|
|
360
|
-
}
|
|
361
|
-
const byUpdated = compareTimestampStrings(right.updated_at, left.updated_at);
|
|
362
|
-
if (byUpdated !== 0) {
|
|
363
|
-
return byUpdated;
|
|
364
|
-
}
|
|
365
|
-
return (left.id ?? "").localeCompare(right.id ?? "");
|
|
366
|
-
}
|
|
367
|
-
function sortItemsDefault(items, statusRegistry) {
|
|
368
|
-
return [...items].sort((left, right) => compareDefaultSort(left, right, statusRegistry));
|
|
369
|
-
}
|
|
370
|
-
function parseDeadline(raw, fieldLabel) {
|
|
371
|
-
if (raw === undefined)
|
|
372
|
-
return undefined;
|
|
373
|
-
return resolveIsoOrRelative(raw, new Date(), fieldLabel);
|
|
374
|
-
}
|
|
375
|
-
// updated/created date-window filters share the deadline ISO+relative resolver
|
|
376
|
-
// so agents doing incremental "what changed since my last context window" syncs
|
|
377
|
-
// can pass either an ISO timestamp (the common case — feed back the previous
|
|
378
|
-
// run's `now`) or a SIGNED relative offset where "-2h"/"-7d" reach into the
|
|
379
|
-
// past and "+1d" into the future (units h/d/w/m, m = months — there is no
|
|
380
|
-
// minutes unit, matching the deadline resolver).
|
|
381
|
-
function parseTimestampWindow(raw, fieldLabel) {
|
|
382
|
-
if (raw == null)
|
|
383
|
-
return undefined;
|
|
384
|
-
const value = String(raw).trim();
|
|
385
|
-
if (value.length === 0)
|
|
386
|
-
return undefined;
|
|
387
|
-
return resolveIsoOrRelative(value, new Date(), fieldLabel);
|
|
388
|
-
}
|
|
389
|
-
function resolveListUpdatedAfter(options) {
|
|
390
|
-
const hasUpdatedAfter = options.updatedAfter != null &&
|
|
391
|
-
String(options.updatedAfter).trim().length > 0;
|
|
392
|
-
const selectedWindows = [
|
|
393
|
-
options.today === true,
|
|
394
|
-
options.recent === true,
|
|
395
|
-
hasUpdatedAfter,
|
|
396
|
-
].filter((selected) => selected).length;
|
|
397
|
-
if (selectedWindows > 1) {
|
|
398
|
-
throw new PmCliError("Choose only one updated_at window: --today, --recent, or --updated-after.", EXIT_CODE.USAGE);
|
|
399
|
-
}
|
|
400
|
-
if (options.today === true) {
|
|
401
|
-
const today = new Date();
|
|
402
|
-
today.setHours(0, 0, 0, 0);
|
|
403
|
-
return today.toISOString();
|
|
404
|
-
}
|
|
405
|
-
if (options.recent === true) {
|
|
406
|
-
return parseTimestampWindow(LIST_RECENT_WINDOW, "recent");
|
|
407
|
-
}
|
|
408
|
-
return parseTimestampWindow(options.updatedAfter, "updated-after");
|
|
409
|
-
}
|
|
410
|
-
function applyListWindowFilterEcho(filters, options) {
|
|
411
|
-
if (options.today === true) {
|
|
412
|
-
filters.today = true;
|
|
413
|
-
}
|
|
414
|
-
if (options.recent === true) {
|
|
415
|
-
filters.recent = true;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
function parseIdsFilter(raw) {
|
|
419
|
-
if (raw == null)
|
|
420
|
-
return undefined;
|
|
421
|
-
const value = String(raw).trim();
|
|
422
|
-
if (value.length === 0) {
|
|
423
|
-
throw new PmCliError("--ids requires at least one non-empty item ID", EXIT_CODE.USAGE);
|
|
424
|
-
}
|
|
425
|
-
const ids = value
|
|
426
|
-
.split(",")
|
|
427
|
-
.map((entry) => entry.trim())
|
|
428
|
-
.filter((entry) => entry.length > 0);
|
|
429
|
-
if (ids.length === 0) {
|
|
430
|
-
throw new PmCliError("--ids requires at least one non-empty item ID", EXIT_CODE.USAGE);
|
|
431
|
-
}
|
|
432
|
-
return new Set(ids);
|
|
433
|
-
}
|
|
434
|
-
function parseOffset(raw) {
|
|
435
|
-
if (raw === undefined)
|
|
436
|
-
return undefined;
|
|
437
|
-
const normalized = String(raw).trim();
|
|
438
|
-
const parsed = normalized.length === 0 ? Number.NaN : Number(normalized);
|
|
439
|
-
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
440
|
-
throw new PmCliError("Offset filter must be a non-negative integer", EXIT_CODE.USAGE);
|
|
441
|
-
}
|
|
442
|
-
return parsed;
|
|
443
|
-
}
|
|
444
|
-
function parseFieldSelectors(raw) {
|
|
445
|
-
if (raw === undefined) {
|
|
446
|
-
return undefined;
|
|
447
|
-
}
|
|
448
|
-
const selectors = raw
|
|
449
|
-
.split(",")
|
|
450
|
-
.map((entry) => entry.trim())
|
|
451
|
-
.filter((entry) => entry.length > 0);
|
|
452
|
-
if (selectors.length === 0) {
|
|
453
|
-
throw new PmCliError("List --fields requires a comma-separated list of field names", EXIT_CODE.USAGE);
|
|
454
|
-
}
|
|
455
|
-
return [...new Set(selectors)];
|
|
456
|
-
}
|
|
457
|
-
function parseProjectionConfig(options, invokedCommand = options.projectionCommand ?? "list") {
|
|
458
|
-
const compactRequested = options.compact === true;
|
|
459
|
-
const briefRequested = options.brief === true;
|
|
460
|
-
const fullRequested = options.full === true;
|
|
461
|
-
const fieldSelectors = parseFieldSelectors(options.fields);
|
|
462
|
-
const enabledModes = Number(compactRequested) +
|
|
463
|
-
Number(briefRequested) +
|
|
464
|
-
Number(fullRequested) +
|
|
465
|
-
Number(fieldSelectors !== undefined);
|
|
466
|
-
if (enabledModes > 1) {
|
|
467
|
-
throw new PmCliError("List projection options are mutually exclusive. Use one of --compact, --brief, --full, or --fields.", EXIT_CODE.USAGE, {
|
|
468
|
-
code: "projection_options_mutually_exclusive",
|
|
469
|
-
recovery: {
|
|
470
|
-
suggested_retry: `pm ${invokedCommand} --brief`,
|
|
471
|
-
suggested_retry_args: [invokedCommand, "--brief"],
|
|
472
|
-
},
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
if (fullRequested) {
|
|
476
|
-
return {
|
|
477
|
-
mode: "full",
|
|
478
|
-
fields: [],
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
if (briefRequested) {
|
|
482
|
-
return {
|
|
483
|
-
mode: "brief",
|
|
484
|
-
fields: [...BRIEF_LIST_FIELDS],
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
if (compactRequested) {
|
|
488
|
-
return {
|
|
489
|
-
mode: "compact",
|
|
490
|
-
fields: [...DEFAULT_COMPACT_LIST_FIELDS],
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
if (fieldSelectors) {
|
|
494
|
-
return {
|
|
495
|
-
mode: "fields",
|
|
496
|
-
fields: [
|
|
497
|
-
...new Set(fieldSelectors.map((field) => normalizeProjectionField(field))),
|
|
498
|
-
],
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
return {
|
|
502
|
-
mode: "full",
|
|
503
|
-
fields: [],
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
function normalizeProjectionField(field) {
|
|
507
|
-
return field.startsWith("item.") ? field.slice("item.".length) : field;
|
|
508
|
-
}
|
|
509
|
-
function validateListProjectionFields(projection, runtimeMetadataKeys, invokedCommand) {
|
|
510
|
-
if (projection.mode !== "fields") {
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
const allowedValues = listListProjectionFields(runtimeMetadataKeys);
|
|
514
|
-
const allowed = new Set(allowedValues.map((field) => normalizeProjectionField(field)));
|
|
515
|
-
const unknown = projection.fields.filter((field) => !allowed.has(normalizeProjectionField(field)));
|
|
516
|
-
if (unknown.length > 0) {
|
|
517
|
-
throw new PmCliError(`Unknown list --fields value(s): ${unknown.join(", ")}`, EXIT_CODE.USAGE, {
|
|
518
|
-
code: "unknown_field_projection",
|
|
519
|
-
examples: [
|
|
520
|
-
"pm list-open --fields id,title,status,type,updated_at",
|
|
521
|
-
"pm list --fields id,title,parent,priority --limit 10",
|
|
522
|
-
"pm list-all --fields id,title,body --limit 5",
|
|
523
|
-
],
|
|
524
|
-
recovery: {
|
|
525
|
-
allowed_values: allowedValues,
|
|
526
|
-
suggested_retry: `pm ${invokedCommand} --fields id,title,status --limit 10`,
|
|
527
|
-
suggested_retry_args: [
|
|
528
|
-
invokedCommand,
|
|
529
|
-
"--fields",
|
|
530
|
-
"id,title,status",
|
|
531
|
-
"--limit",
|
|
532
|
-
"10",
|
|
533
|
-
],
|
|
534
|
-
},
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
// Convenience aliases so agents/humans who reach for the bare verb form
|
|
539
|
-
// (e.g. `--sort updated`) land on the canonical timestamp fields instead of an error.
|
|
540
|
-
// A Map (not a plain object) avoids prototype-chain lookups for keys like "__proto__".
|
|
541
|
-
const LIST_SORT_FIELD_ALIASES = new Map([
|
|
542
|
-
["updated", "updated_at"],
|
|
543
|
-
["update", "updated_at"],
|
|
544
|
-
["modified", "updated_at"],
|
|
545
|
-
["created", "created_at"],
|
|
546
|
-
["create", "created_at"],
|
|
547
|
-
]);
|
|
548
|
-
function parseSortField(raw) {
|
|
549
|
-
if (raw === undefined) {
|
|
550
|
-
return undefined;
|
|
551
|
-
}
|
|
552
|
-
const normalized = raw.trim().toLowerCase();
|
|
553
|
-
const aliased = LIST_SORT_FIELD_ALIASES.get(normalized);
|
|
554
|
-
if (aliased) {
|
|
555
|
-
return aliased;
|
|
556
|
-
}
|
|
557
|
-
if (!LIST_SORT_FIELDS.includes(normalized)) {
|
|
558
|
-
throw new PmCliError(`Sort field must be one of ${LIST_SORT_FIELDS.join("|")} (aliases: updated->updated_at, created->created_at)`, EXIT_CODE.USAGE);
|
|
559
|
-
}
|
|
560
|
-
return normalized;
|
|
561
|
-
}
|
|
562
|
-
function parseSortOrder(raw) {
|
|
563
|
-
if (raw === undefined) {
|
|
564
|
-
return undefined;
|
|
565
|
-
}
|
|
566
|
-
const normalized = raw.trim().toLowerCase();
|
|
567
|
-
if (!LIST_SORT_ORDER_VALUES.includes(normalized)) {
|
|
568
|
-
throw new PmCliError(`Sort order must be one of ${LIST_SORT_ORDER_VALUES.join("|")}`, EXIT_CODE.USAGE);
|
|
569
|
-
}
|
|
570
|
-
return normalized;
|
|
571
|
-
}
|
|
572
|
-
function parseTreeDepth(raw) {
|
|
573
|
-
return parseIntegerLimit(raw, "--tree-depth");
|
|
574
|
-
}
|
|
575
|
-
function parseAssigneeFilter(raw) {
|
|
576
|
-
if (raw === undefined) {
|
|
577
|
-
return undefined;
|
|
578
|
-
}
|
|
579
|
-
const normalized = raw.trim().toLowerCase();
|
|
580
|
-
if (!normalized) {
|
|
581
|
-
throw new PmCliError("Assignee filter must be one of assigned|unassigned", EXIT_CODE.USAGE);
|
|
582
|
-
}
|
|
583
|
-
if (normalized !== "assigned" && normalized !== "unassigned") {
|
|
584
|
-
throw new PmCliError(`Invalid assignee filter "${raw}". Allowed: assigned|unassigned`, EXIT_CODE.USAGE);
|
|
585
|
-
}
|
|
586
|
-
return normalized;
|
|
587
|
-
}
|
|
588
|
-
// Resolve built-in, runtime, and workflow-group aliases through the shared
|
|
589
|
-
// registry, rejecting typos instead of returning a misleading empty result.
|
|
590
|
-
function resolveStatusFilter(status, statusRegistry) {
|
|
591
|
-
return parseStatusFilterCsv(status, statusRegistry, { strict: true });
|
|
592
|
-
}
|
|
593
|
-
function parseListTagFilters(raw) {
|
|
594
|
-
return parseStringFilterSet(raw, {
|
|
595
|
-
label: "--tag",
|
|
596
|
-
normalize: (tag) => tag.toLowerCase(),
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
function appendUnknownTagWarning(items, rawTags, warnings) {
|
|
600
|
-
const requestedTags = parseListTagFilters(rawTags);
|
|
601
|
-
if (requestedTags === undefined) {
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
const knownTags = new Set(items.flatMap((item) => item.tags.map((tag) => tag.trim().toLowerCase())));
|
|
605
|
-
const unknownTags = [...requestedTags].filter((tag) => !knownTags.has(tag));
|
|
606
|
-
if (unknownTags.length > 0) {
|
|
607
|
-
warnings.push(`unknown_tags:${unknownTags.join(",")}`);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
function assertListAssigneeFilters(assigneeFilter, assigneeModeFilter) {
|
|
611
|
-
if (assigneeFilter &&
|
|
612
|
-
[...assigneeFilter].some((value) => value.toLowerCase() === "none" || value.toLowerCase() === "null")) {
|
|
613
|
-
throw new PmCliError('--assignee no longer accepts "none" or "null". Use --assignee-filter unassigned.', EXIT_CODE.USAGE);
|
|
614
|
-
}
|
|
615
|
-
if (assigneeFilter !== undefined && assigneeModeFilter === "unassigned") {
|
|
616
|
-
throw new PmCliError("Cannot combine --assignee with --assignee-filter unassigned", EXIT_CODE.USAGE);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
function resolveListFilterSet(status, options, typeRegistry, statusRegistry) {
|
|
620
|
-
const assigneeFilter = parseStringFilterSet(options.assignee, {
|
|
621
|
-
label: "--assignee",
|
|
622
|
-
});
|
|
623
|
-
const assigneeModeFilter = parseAssigneeFilter(options.assigneeFilter);
|
|
624
|
-
assertListAssigneeFilters(assigneeFilter, assigneeModeFilter);
|
|
625
|
-
const missingMetadataFilters = resolveMissingMetadataFilters(options);
|
|
626
|
-
const contentFieldFilters = resolveContentFieldFilters(options);
|
|
627
|
-
return {
|
|
628
|
-
idsFilter: parseIdsFilter(options.ids),
|
|
629
|
-
statusSet: status && status.length > 0 ? new Set(status) : undefined,
|
|
630
|
-
excludeTerminal: options.excludeTerminal === true,
|
|
631
|
-
typeFilter: parseTypeFilterSet(options.type, typeRegistry),
|
|
632
|
-
tagFilters: parseListTagFilters(options.tag),
|
|
633
|
-
priorityFilter: parsePriorityFilterSet(options.priority),
|
|
634
|
-
deadlineBefore: parseDeadline(options.deadlineBefore, "deadline-before"),
|
|
635
|
-
deadlineAfter: parseDeadline(options.deadlineAfter, "deadline-after"),
|
|
636
|
-
updatedAfter: resolveListUpdatedAfter(options),
|
|
637
|
-
updatedBefore: parseTimestampWindow(options.updatedBefore, "updated-before"),
|
|
638
|
-
createdAfter: parseTimestampWindow(options.createdAfter, "created-after"),
|
|
639
|
-
createdBefore: parseTimestampWindow(options.createdBefore, "created-before"),
|
|
640
|
-
assigneeFilter,
|
|
641
|
-
assigneeModeFilter,
|
|
642
|
-
parentFilter: options.parent?.trim(),
|
|
643
|
-
treeEnabled: options.tree === true,
|
|
644
|
-
sprintFilter: parseStringFilterSet(options.sprint, { label: "--sprint" }),
|
|
645
|
-
releaseFilter: parseStringFilterSet(options.release, {
|
|
646
|
-
label: "--release",
|
|
647
|
-
}),
|
|
648
|
-
missingMetadataFilters,
|
|
649
|
-
missingMetadataActive: hasMissingMetadataFilter(missingMetadataFilters),
|
|
650
|
-
lifecycleClassifier: lifecycleClassifierFromStatusRegistry(statusRegistry),
|
|
651
|
-
contentFieldFilters,
|
|
652
|
-
contentFiltersActive: hasContentFieldFilter(contentFieldFilters),
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
function matchesListIdentityFilters(item, filters, statusRegistry) {
|
|
656
|
-
if (filters.idsFilter && !filters.idsFilter.has(item.id))
|
|
657
|
-
return false;
|
|
658
|
-
if (filters.statusSet && !filters.statusSet.has(item.status))
|
|
659
|
-
return false;
|
|
660
|
-
if (filters.excludeTerminal && isTerminalStatus(item.status, statusRegistry))
|
|
661
|
-
return false;
|
|
662
|
-
if (filters.typeFilter && !filters.typeFilter.has(item.type))
|
|
663
|
-
return false;
|
|
664
|
-
if (filters.tagFilters &&
|
|
665
|
-
![...filters.tagFilters].some((tag) => (item.tags ?? []).some((candidate) => candidate.trim().toLowerCase() === tag))) {
|
|
666
|
-
return false;
|
|
667
|
-
}
|
|
668
|
-
return (filters.priorityFilter === undefined ||
|
|
669
|
-
filters.priorityFilter.has(item.priority));
|
|
670
|
-
}
|
|
671
|
-
function matchesListDateFilters(item, filters) {
|
|
672
|
-
return matchesTimestampFilters(item, filters);
|
|
673
|
-
}
|
|
674
|
-
function matchesListAssigneeFilterSet(item, filters) {
|
|
675
|
-
if (filters.assigneeModeFilter === "assigned" && !item.assignee)
|
|
676
|
-
return false;
|
|
677
|
-
if (filters.assigneeModeFilter === "unassigned" && item.assignee)
|
|
678
|
-
return false;
|
|
679
|
-
return (filters.assigneeFilter === undefined ||
|
|
680
|
-
(item.assignee !== undefined && filters.assigneeFilter.has(item.assignee)));
|
|
681
|
-
}
|
|
682
|
-
function matchesListScopeFilters(item, filters, parentsByChild) {
|
|
683
|
-
const scalarParent = item.parent?.trim().toLowerCase();
|
|
684
|
-
const logicalParentIds = [
|
|
685
|
-
...new Set([
|
|
686
|
-
...(parentsByChild?.get(item.id.trim().toLowerCase()) ?? []),
|
|
687
|
-
...(scalarParent ? [scalarParent] : []),
|
|
688
|
-
]),
|
|
689
|
-
];
|
|
690
|
-
if (filters.parentFilter !== undefined &&
|
|
691
|
-
!filters.treeEnabled &&
|
|
692
|
-
!logicalParentIds.includes(filters.parentFilter.trim().toLowerCase()))
|
|
693
|
-
return false;
|
|
694
|
-
if (filters.sprintFilter !== undefined &&
|
|
695
|
-
(item.sprint === undefined || !filters.sprintFilter.has(item.sprint)))
|
|
696
|
-
return false;
|
|
697
|
-
return (filters.releaseFilter === undefined ||
|
|
698
|
-
(item.release !== undefined && filters.releaseFilter.has(item.release)));
|
|
699
|
-
}
|
|
700
|
-
function matchesListFilterSet(item, filters, statusRegistry, runtimeFieldFilters, parentsByChild) {
|
|
701
|
-
if (!matchesListIdentityFilters(item, filters, statusRegistry) ||
|
|
702
|
-
!matchesListDateFilters(item, filters) ||
|
|
703
|
-
!matchesListAssigneeFilterSet(item, filters) ||
|
|
704
|
-
!matchesListScopeFilters(item, filters, parentsByChild)) {
|
|
705
|
-
return false;
|
|
706
|
-
}
|
|
707
|
-
if (filters.missingMetadataActive &&
|
|
708
|
-
!itemMatchesMissingMetadata(item, filters.missingMetadataFilters, filters.lifecycleClassifier)) {
|
|
709
|
-
return false;
|
|
710
|
-
}
|
|
711
|
-
if (filters.contentFiltersActive &&
|
|
712
|
-
!itemMatchesContentFilters(item, filters.contentFieldFilters)) {
|
|
713
|
-
return false;
|
|
714
|
-
}
|
|
715
|
-
if (!matchesRuntimeFilters(item, runtimeFieldFilters)) {
|
|
716
|
-
return false;
|
|
717
|
-
}
|
|
718
|
-
return true;
|
|
719
|
-
}
|
|
720
|
-
function applyFilters(items, status, options, typeRegistry, statusRegistry, runtimeFieldFilters, parentsByChild) {
|
|
721
|
-
const filters = resolveListFilterSet(status, options, typeRegistry, statusRegistry);
|
|
722
|
-
return items.filter((item) => matchesListFilterSet(item, filters, statusRegistry, runtimeFieldFilters, parentsByChild));
|
|
723
|
-
}
|
|
724
|
-
function trimNonEmpty(value) {
|
|
725
|
-
if (typeof value !== "string") {
|
|
726
|
-
return undefined;
|
|
727
|
-
}
|
|
728
|
-
const trimmed = value.trim();
|
|
729
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
730
|
-
}
|
|
731
|
-
function withTreeMetadata(item, depth, childCount, parentId) {
|
|
732
|
-
const itemRecord = toItemRecord(item);
|
|
733
|
-
const title = typeof itemRecord.title === "string" ? itemRecord.title : "";
|
|
734
|
-
const parent = parentId ??
|
|
735
|
-
trimNonEmpty(typeof itemRecord.parent === "string" ? itemRecord.parent : undefined) ??
|
|
736
|
-
null;
|
|
737
|
-
return {
|
|
738
|
-
...item,
|
|
739
|
-
tree_depth: depth,
|
|
740
|
-
tree_parent: parent,
|
|
741
|
-
tree_children: childCount,
|
|
742
|
-
tree_title: `${" ".repeat(depth)}${title}`,
|
|
743
|
-
};
|
|
744
|
-
}
|
|
745
|
-
function buildListTreeIndexes(sortedItems, hierarchyIndexes) {
|
|
746
|
-
const byId = new Map();
|
|
747
|
-
const childrenByParent = new Map();
|
|
748
|
-
for (const item of sortedItems) {
|
|
749
|
-
const itemId = item.id.trim().toLowerCase();
|
|
750
|
-
byId.set(itemId, item);
|
|
751
|
-
const parentIds = hierarchyIndexes
|
|
752
|
-
? (hierarchyIndexes.parents_by_child.get(itemId) ?? [])
|
|
753
|
-
: [trimNonEmpty(item.parent)?.toLowerCase()].filter((value) => value !== undefined);
|
|
754
|
-
for (const parentId of parentIds) {
|
|
755
|
-
const children = childrenByParent.get(parentId) ?? [];
|
|
756
|
-
children.push(item);
|
|
757
|
-
childrenByParent.set(parentId, children);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
return { byId, childrenByParent };
|
|
761
|
-
}
|
|
762
|
-
function resolveListTreeRoots(sortedItems, parentRoot, byId, childrenByParent, hierarchyIndexes) {
|
|
763
|
-
return parentRoot
|
|
764
|
-
? [...(childrenByParent.get(parentRoot.toLowerCase()) ?? [])]
|
|
765
|
-
: sortedItems.filter((item) => {
|
|
766
|
-
const parentIds = hierarchyIndexes
|
|
767
|
-
? (hierarchyIndexes.parents_by_child.get(item.id.trim().toLowerCase()) ?? [])
|
|
768
|
-
: [trimNonEmpty(item.parent)?.toLowerCase()].filter((value) => value !== undefined);
|
|
769
|
-
return parentIds.every((parentId) => !byId.has(parentId));
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
function orderItemsAsTree(sortedItems, parentRoot, maxDepth, hierarchyIndexes, completeItems = sortedItems) {
|
|
773
|
-
const { byId, childrenByParent } = buildListTreeIndexes(sortedItems, hierarchyIndexes);
|
|
774
|
-
const roots = resolveListTreeRoots(sortedItems, parentRoot, byId, childrenByParent, hierarchyIndexes);
|
|
775
|
-
const ordered = [];
|
|
776
|
-
const visited = new Set();
|
|
777
|
-
const canonicalIdByLowercase = new Map(completeItems.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]));
|
|
778
|
-
const pending = [...roots].reverse().map((node) => ({
|
|
779
|
-
node,
|
|
780
|
-
depth: 0,
|
|
781
|
-
parentId: parentRoot === undefined
|
|
782
|
-
? undefined
|
|
783
|
-
: (canonicalIdByLowercase.get(parentRoot.trim().toLowerCase()) ??
|
|
784
|
-
parentRoot.trim()),
|
|
785
|
-
}));
|
|
786
|
-
while (pending.length > 0) {
|
|
787
|
-
const { node, depth, parentId } = pending.pop();
|
|
788
|
-
const nodeId = node.id.trim().toLowerCase();
|
|
789
|
-
if (visited.has(nodeId))
|
|
790
|
-
continue;
|
|
791
|
-
visited.add(nodeId);
|
|
792
|
-
const children = childrenByParent.get(nodeId) ?? [];
|
|
793
|
-
ordered.push(withTreeMetadata(node, depth, children.length, parentId));
|
|
794
|
-
if (maxDepth !== undefined && depth >= maxDepth)
|
|
795
|
-
continue;
|
|
796
|
-
for (const child of [...children].reverse()) {
|
|
797
|
-
pending.push({
|
|
798
|
-
node: child,
|
|
799
|
-
depth: depth + 1,
|
|
800
|
-
parentId: canonicalIdByLowercase.get(nodeId),
|
|
801
|
-
});
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
if (parentRoot === undefined && maxDepth === undefined) {
|
|
805
|
-
for (const item of sortedItems) {
|
|
806
|
-
const itemId = item.id.trim().toLowerCase();
|
|
807
|
-
if (visited.has(itemId))
|
|
808
|
-
continue;
|
|
809
|
-
visited.add(itemId);
|
|
810
|
-
ordered.push(withTreeMetadata(item, 0, childrenByParent.get(itemId)?.length ?? 0));
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
return ordered;
|
|
814
|
-
}
|
|
815
|
-
function compareNullableString(left, right) {
|
|
816
|
-
if (left === right) {
|
|
817
|
-
return 0;
|
|
818
|
-
}
|
|
819
|
-
if (left === null) {
|
|
820
|
-
return 1;
|
|
821
|
-
}
|
|
822
|
-
if (right === null) {
|
|
823
|
-
return -1;
|
|
824
|
-
}
|
|
825
|
-
return left.localeCompare(right);
|
|
826
|
-
}
|
|
827
|
-
function compareNullableTimestamp(left, right) {
|
|
828
|
-
if (left === right) {
|
|
829
|
-
return 0;
|
|
830
|
-
}
|
|
831
|
-
if (left === null) {
|
|
832
|
-
return 1;
|
|
833
|
-
}
|
|
834
|
-
if (right === null) {
|
|
835
|
-
return -1;
|
|
836
|
-
}
|
|
837
|
-
return compareTimestampStrings(left, right);
|
|
838
|
-
}
|
|
839
|
-
function compareBySortField(left, right, field) {
|
|
840
|
-
switch (field) {
|
|
841
|
-
case "priority":
|
|
842
|
-
return left.priority - right.priority;
|
|
843
|
-
case "deadline":
|
|
844
|
-
return compareNullableTimestamp(left.deadline ?? null, right.deadline ?? null);
|
|
845
|
-
case "updated_at":
|
|
846
|
-
return compareTimestampStrings(left.updated_at, right.updated_at);
|
|
847
|
-
case "created_at":
|
|
848
|
-
return compareTimestampStrings(left.created_at, right.created_at);
|
|
849
|
-
case "title":
|
|
850
|
-
return (left.title ?? "").localeCompare(right.title ?? "");
|
|
851
|
-
case "parent":
|
|
852
|
-
return compareNullableString(left.parent ?? null, right.parent ?? null);
|
|
853
|
-
default:
|
|
854
|
-
return 0;
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
function sortItems(items, sortField, sortOrder, statusRegistry) {
|
|
858
|
-
if (!sortField) {
|
|
859
|
-
return sortItemsDefault(items, statusRegistry);
|
|
860
|
-
}
|
|
861
|
-
return [...items].sort((left, right) => {
|
|
862
|
-
const byField = compareBySortField(left, right, sortField);
|
|
863
|
-
if (byField !== 0) {
|
|
864
|
-
return sortOrder === "desc" ? -byField : byField;
|
|
865
|
-
}
|
|
866
|
-
const fallback = compareDefaultSort(left, right, statusRegistry);
|
|
867
|
-
return sortOrder === "desc" ? -fallback : fallback;
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
function readListFieldValue(item, field, treeMode = false) {
|
|
871
|
-
const normalized = normalizeProjectionField(field.trim());
|
|
872
|
-
if (normalized.length === 0) {
|
|
873
|
-
return null;
|
|
874
|
-
}
|
|
875
|
-
const itemRecord = toItemRecord(item);
|
|
876
|
-
if (treeMode &&
|
|
877
|
-
normalized === "title" &&
|
|
878
|
-
typeof itemRecord.tree_title === "string") {
|
|
879
|
-
return itemRecord.tree_title;
|
|
880
|
-
}
|
|
881
|
-
if (Object.prototype.hasOwnProperty.call(itemRecord, normalized)) {
|
|
882
|
-
return itemRecord[normalized] ?? null;
|
|
883
|
-
}
|
|
884
|
-
return null;
|
|
885
|
-
}
|
|
886
|
-
function projectListItems(items, projection, treeMode = false) {
|
|
887
|
-
if (projection.mode === "full") {
|
|
888
|
-
return items;
|
|
889
|
-
}
|
|
890
|
-
return items.map((item) => {
|
|
891
|
-
const projected = {};
|
|
892
|
-
for (const field of projection.fields) {
|
|
893
|
-
// Field values are read straight off the parsed item metadata, so the
|
|
894
|
-
// typed core keys (id/title/status/...) hold their declared runtime
|
|
895
|
-
// shapes; the cast only widens the write, not the read surface.
|
|
896
|
-
projected[field] = readListFieldValue(item, field, treeMode);
|
|
897
|
-
}
|
|
898
|
-
return projected;
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
function runtimeMetadataKeysForProjection(definitions) {
|
|
902
|
-
const keys = [];
|
|
903
|
-
for (const field of definitions) {
|
|
904
|
-
keys.push(field.metadata_key);
|
|
905
|
-
}
|
|
906
|
-
return keys;
|
|
907
|
-
}
|
|
908
|
-
function resolveListPageLimit(options, totalRows) {
|
|
909
|
-
if (options.noTruncate === true) {
|
|
910
|
-
return undefined;
|
|
911
|
-
}
|
|
912
|
-
return (parseIntegerLimit(options.limit) ?? (totalRows >= 10_000 ? 20 : undefined));
|
|
913
|
-
}
|
|
914
|
-
function resolveListPageStart(ordered, options, cursorFingerprint) {
|
|
915
|
-
if (options.after === undefined) {
|
|
916
|
-
return parseOffset(options.offset) ?? 0;
|
|
917
|
-
}
|
|
918
|
-
return resolveQueryCursorStart(ordered, options.after, cursorFingerprint, (item) => item.id);
|
|
919
|
-
}
|
|
920
|
-
function buildListPageExtras(limit, hasMore, nextCursor) {
|
|
921
|
-
return {
|
|
922
|
-
...(limit !== undefined ? { applied_limit: limit } : {}),
|
|
923
|
-
has_more: hasMore,
|
|
924
|
-
truncated: hasMore,
|
|
925
|
-
next_cursor: nextCursor ?? null,
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
async function resolveListRuntimeContext(options, global) {
|
|
929
|
-
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
930
|
-
await assertInitializedTracker(pmRoot);
|
|
931
|
-
const settings = await readSettings(pmRoot);
|
|
932
|
-
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
933
|
-
const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
|
|
934
|
-
const invokedCommand = options.projectionCommand ?? "list";
|
|
935
|
-
const projection = parseProjectionConfig(options, invokedCommand);
|
|
936
|
-
validateListProjectionFields(projection, runtimeMetadataKeysForProjection(runtimeFieldRegistry.definitions), invokedCommand);
|
|
937
|
-
return {
|
|
938
|
-
pmRoot,
|
|
939
|
-
settings,
|
|
940
|
-
statusRegistry,
|
|
941
|
-
runtimeFieldFilters: collectRuntimeFilterValues(options, runtimeFieldRegistry, "list"),
|
|
942
|
-
typeRegistry: resolveItemTypeRegistry(settings, getActiveExtensionRegistrations()),
|
|
943
|
-
projection,
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
async function loadListItems(options, runtime, listWarnings) {
|
|
947
|
-
const projectionNeedsBody = runtime.projection.fields.some((field) => normalizeProjectionField(field) === "body");
|
|
948
|
-
const projectionNeedsCollections = runtime.projection.mode === "full" ||
|
|
949
|
-
runtime.projection.fields.some((field) => HEAVY_PROJECTION_FIELDS.has(normalizeProjectionField(field)));
|
|
950
|
-
const contentFieldFilters = resolveContentFieldFilters(options);
|
|
951
|
-
const contentNeedsCollections = contentFiltersNeedCollections(contentFieldFilters);
|
|
952
|
-
const contentNeedsBody = contentFiltersNeedBody(contentFieldFilters);
|
|
953
|
-
if (options.includeBody || projectionNeedsBody || contentNeedsBody) {
|
|
954
|
-
return await listAllItemMetadataWithBody(runtime.pmRoot, runtime.settings.item_format, runtime.typeRegistry.type_to_folder, listWarnings, runtime.settings.schema);
|
|
955
|
-
}
|
|
956
|
-
if (projectionNeedsCollections || contentNeedsCollections) {
|
|
957
|
-
return await listAllItemMetadata(runtime.pmRoot, runtime.settings.item_format, runtime.typeRegistry.type_to_folder, listWarnings, runtime.settings.schema);
|
|
958
|
-
}
|
|
959
|
-
return await listAllItemMetadataLight(runtime.pmRoot, runtime.settings.item_format, runtime.typeRegistry.type_to_folder, listWarnings, runtime.settings.schema);
|
|
960
|
-
}
|
|
961
|
-
function resolveListOrderingOptions(options) {
|
|
962
|
-
const sortField = parseSortField(options.sort);
|
|
963
|
-
const sortOrder = parseSortOrder(options.order) ?? "asc";
|
|
964
|
-
const treeEnabled = options.tree === true;
|
|
965
|
-
if (!treeEnabled && options.treeDepth !== undefined) {
|
|
966
|
-
throw new PmCliError("List --tree-depth requires --tree", EXIT_CODE.USAGE);
|
|
967
|
-
}
|
|
968
|
-
if (!sortField && options.order !== undefined) {
|
|
969
|
-
throw new PmCliError("List --order requires --sort", EXIT_CODE.USAGE);
|
|
970
|
-
}
|
|
971
|
-
return {
|
|
972
|
-
sortField,
|
|
973
|
-
sortOrder,
|
|
974
|
-
treeEnabled,
|
|
975
|
-
treeDepth: treeEnabled ? parseTreeDepth(options.treeDepth) : undefined,
|
|
976
|
-
parentRoot: treeEnabled ? trimNonEmpty(options.parent) : undefined,
|
|
977
|
-
};
|
|
978
|
-
}
|
|
979
|
-
function resolveListStatusSelection(status, options, statusRegistry) {
|
|
980
|
-
const explicitStatus = resolveStatusFilter(options.status, statusRegistry);
|
|
981
|
-
let lifecycleStatus;
|
|
982
|
-
if (options.lifecycleBucket === "in_progress") {
|
|
983
|
-
lifecycleStatus = [statusRegistry.in_progress_status];
|
|
984
|
-
}
|
|
985
|
-
else if (options.lifecycleBucket === "open") {
|
|
986
|
-
lifecycleStatus = [...statusRegistry.active_statuses]
|
|
987
|
-
.filter((entry) => entry !== statusRegistry.in_progress_status)
|
|
988
|
-
.sort((left, right) => left.localeCompare(right));
|
|
989
|
-
}
|
|
990
|
-
const resolvedStatus = explicitStatus ??
|
|
991
|
-
lifecycleStatus ??
|
|
992
|
-
resolveStatusFilter(status, statusRegistry);
|
|
993
|
-
const explicitAllStatuses = isStatusAllFilterInput(options.status);
|
|
994
|
-
const effectiveOptions = explicitStatus || explicitAllStatuses
|
|
995
|
-
? { ...options, excludeTerminal: false }
|
|
996
|
-
: options;
|
|
997
|
-
let filtersStatus = "all";
|
|
998
|
-
if (explicitAllStatuses) {
|
|
999
|
-
filtersStatus = "all";
|
|
1000
|
-
}
|
|
1001
|
-
else if (explicitStatus !== undefined) {
|
|
1002
|
-
filtersStatus =
|
|
1003
|
-
explicitStatus.length === 1 ? explicitStatus[0] : explicitStatus;
|
|
1004
|
-
}
|
|
1005
|
-
else if (options.lifecycleBucket !== undefined) {
|
|
1006
|
-
filtersStatus = options.lifecycleBucket;
|
|
1007
|
-
}
|
|
1008
|
-
else if (resolvedStatus !== undefined) {
|
|
1009
|
-
filtersStatus =
|
|
1010
|
-
resolvedStatus.length === 1 ? resolvedStatus[0] : resolvedStatus;
|
|
1011
|
-
}
|
|
1012
|
-
else if (effectiveOptions.excludeTerminal === true) {
|
|
1013
|
-
filtersStatus = null;
|
|
1014
|
-
}
|
|
1015
|
-
return {
|
|
1016
|
-
resolvedStatus,
|
|
1017
|
-
explicitAllStatuses,
|
|
1018
|
-
effectiveOptions,
|
|
1019
|
-
filtersStatus,
|
|
1020
|
-
};
|
|
1021
|
-
}
|
|
1022
|
-
function pageAndProjectListItems(ordered, options, projection, treeEnabled, cursorFingerprint) {
|
|
1023
|
-
if (options.after !== undefined && options.offset !== undefined) {
|
|
1024
|
-
throw new PmCliError("List --after cannot be combined with --offset.", EXIT_CODE.USAGE);
|
|
1025
|
-
}
|
|
1026
|
-
const limit = resolveListPageLimit(options, ordered.length);
|
|
1027
|
-
const offset = resolveListPageStart(ordered, options, cursorFingerprint);
|
|
1028
|
-
const limited = limit === undefined
|
|
1029
|
-
? ordered.slice(offset)
|
|
1030
|
-
: ordered.slice(offset, offset + limit);
|
|
1031
|
-
const projected = projectListItems(limited, projection, treeEnabled);
|
|
1032
|
-
const totalMatched = ordered.length;
|
|
1033
|
-
const hasMore = limited.length > 0 && offset + limited.length < totalMatched;
|
|
1034
|
-
const nextCursor = hasMore && limited.length > 0
|
|
1035
|
-
? encodeQueryCursor(cursorFingerprint, limited[limited.length - 1].id, offset + limited.length - 1)
|
|
1036
|
-
: undefined;
|
|
1037
|
-
return {
|
|
1038
|
-
projected,
|
|
1039
|
-
totalMatched,
|
|
1040
|
-
pageExtras: buildListPageExtras(limit, hasMore, nextCursor),
|
|
1041
|
-
};
|
|
1042
|
-
}
|
|
1043
|
-
function buildListCursorFingerprint(status, options, ordering) {
|
|
1044
|
-
return createQueryFingerprint("list", {
|
|
1045
|
-
status,
|
|
1046
|
-
options: selectCursorSemanticOptions(options, LIST_FILTER_FLAG_CONTRACTS),
|
|
1047
|
-
sort: ordering.sortField ?? "default",
|
|
1048
|
-
order: ordering.sortOrder,
|
|
1049
|
-
tree: ordering.treeEnabled,
|
|
1050
|
-
tree_depth: ordering.treeDepth ?? null,
|
|
1051
|
-
});
|
|
1052
|
-
}
|
|
1053
|
-
async function tryLoadIndexedListPage(params) {
|
|
1054
|
-
const { options, runtime, statusSelection, ordering } = params;
|
|
1055
|
-
const supportedOptionKeys = new Set([
|
|
1056
|
-
"status",
|
|
1057
|
-
"limit",
|
|
1058
|
-
"offset",
|
|
1059
|
-
"compact",
|
|
1060
|
-
"brief",
|
|
1061
|
-
"full",
|
|
1062
|
-
"fields",
|
|
1063
|
-
"format",
|
|
1064
|
-
"stream",
|
|
1065
|
-
"includeBody",
|
|
1066
|
-
"excludeTerminal",
|
|
1067
|
-
"dependencyBlocked",
|
|
1068
|
-
"lifecycleBucket",
|
|
1069
|
-
"noTruncate",
|
|
1070
|
-
"projectionCommand",
|
|
1071
|
-
"truncate",
|
|
1072
|
-
"notes",
|
|
1073
|
-
"learnings",
|
|
1074
|
-
"files",
|
|
1075
|
-
"docs",
|
|
1076
|
-
"tests",
|
|
1077
|
-
"comments",
|
|
1078
|
-
"deps",
|
|
1079
|
-
"linkedCommand",
|
|
1080
|
-
]);
|
|
1081
|
-
const projectionNeedsHeavyData = [
|
|
1082
|
-
runtime.projection.mode === "full",
|
|
1083
|
-
runtime.projection.fields.some((field) => {
|
|
1084
|
-
const normalized = normalizeProjectionField(field);
|
|
1085
|
-
return normalized === "body" || HEAVY_PROJECTION_FIELDS.has(normalized);
|
|
1086
|
-
}),
|
|
1087
|
-
].includes(true);
|
|
1088
|
-
const requiresFallback = [
|
|
1089
|
-
options.limit === undefined,
|
|
1090
|
-
options.after !== undefined,
|
|
1091
|
-
options.noTruncate === true,
|
|
1092
|
-
options.includeBody === true,
|
|
1093
|
-
options.dependencyBlocked === true,
|
|
1094
|
-
options.strictRead === true,
|
|
1095
|
-
ordering.treeEnabled,
|
|
1096
|
-
ordering.sortField !== undefined,
|
|
1097
|
-
projectionNeedsHeavyData,
|
|
1098
|
-
hasActiveOnReadHooks(),
|
|
1099
|
-
Object.keys(runtime.runtimeFieldFilters).length > 0,
|
|
1100
|
-
Object.entries(options).some(([key, value]) => value !== undefined && !supportedOptionKeys.has(key)),
|
|
1101
|
-
].includes(true);
|
|
1102
|
-
if (requiresFallback) {
|
|
1103
|
-
return null;
|
|
1104
|
-
}
|
|
1105
|
-
const indexState = await readItemMetadataDerivedIndexState(runtime.pmRoot, [
|
|
1106
|
-
...new Set(Object.values(runtime.typeRegistry.type_to_folder)),
|
|
1107
|
-
]);
|
|
1108
|
-
if (!indexState)
|
|
1109
|
-
return null;
|
|
1110
|
-
const limit = parseIntegerLimit(options.limit);
|
|
1111
|
-
const offset = parseOffset(options.offset) ?? 0;
|
|
1112
|
-
const indexed = await queryItemMetadataIndex({
|
|
1113
|
-
pmRoot: runtime.pmRoot,
|
|
1114
|
-
expectedSourceCursor: indexState.source_cursor,
|
|
1115
|
-
query: {
|
|
1116
|
-
statuses: statusSelection.resolvedStatus,
|
|
1117
|
-
excludeStatuses: statusSelection.resolvedStatus === undefined &&
|
|
1118
|
-
statusSelection.effectiveOptions.excludeTerminal === true
|
|
1119
|
-
? [...runtime.statusRegistry.terminal_statuses]
|
|
1120
|
-
: undefined,
|
|
1121
|
-
terminalStatuses: [...runtime.statusRegistry.terminal_statuses],
|
|
1122
|
-
limit,
|
|
1123
|
-
offset,
|
|
1124
|
-
},
|
|
1125
|
-
});
|
|
1126
|
-
if (!indexed)
|
|
1127
|
-
return null;
|
|
1128
|
-
const hasMore = indexed.items.length > 0 && offset + indexed.items.length < indexed.total;
|
|
1129
|
-
const nextCursor = hasMore
|
|
1130
|
-
? encodeQueryCursor(buildListCursorFingerprint(statusSelection.filtersStatus, options, ordering), indexed.items.at(-1).id, offset + indexed.items.length - 1)
|
|
1131
|
-
: undefined;
|
|
1132
|
-
return {
|
|
1133
|
-
projected: projectListItems(indexed.items, runtime.projection, false),
|
|
1134
|
-
totalMatched: indexed.total,
|
|
1135
|
-
pageExtras: buildListPageExtras(limit, hasMore, nextCursor),
|
|
1136
|
-
};
|
|
1137
|
-
}
|
|
1138
|
-
function buildVerboseListFilters(params) {
|
|
1139
|
-
const { filtersStatus, options, noTruncate, treeEnabled, treeDepth, sortField, sortOrder, runtimeFieldFilters, } = params;
|
|
1140
|
-
const filters = {};
|
|
1141
|
-
if (filtersStatus !== null) {
|
|
1142
|
-
filters.status = filtersStatus;
|
|
1143
|
-
}
|
|
1144
|
-
if (options.dependencyBlocked === true) {
|
|
1145
|
-
filters.blocked_semantics = "status_or_dependency";
|
|
1146
|
-
}
|
|
1147
|
-
const optionRecord = options;
|
|
1148
|
-
for (const entry of VERBOSE_LIST_VALUE_FILTER_ECHO_ENTRIES) {
|
|
1149
|
-
const value = optionRecord[entry.optionKey];
|
|
1150
|
-
if (value !== undefined && value !== null) {
|
|
1151
|
-
filters[entry.summaryKey] = value;
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
for (const entry of VERBOSE_LIST_BOOLEAN_FILTER_ECHO_ENTRIES) {
|
|
1155
|
-
if (optionRecord[entry.key] === true) {
|
|
1156
|
-
filters[entry.summaryKey] = true;
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
Object.assign(filters, buildGovernanceMissingFilterEcho(options), buildContentFilterEcho(options));
|
|
1160
|
-
applyListWindowFilterEcho(filters, options);
|
|
1161
|
-
if (noTruncate) {
|
|
1162
|
-
filters.no_truncate = true;
|
|
1163
|
-
}
|
|
1164
|
-
if (options.strictRead === true) {
|
|
1165
|
-
filters.strict_read = true;
|
|
1166
|
-
}
|
|
1167
|
-
if (treeEnabled) {
|
|
1168
|
-
filters.tree = true;
|
|
1169
|
-
if (treeDepth !== undefined) {
|
|
1170
|
-
filters.tree_depth = treeDepth;
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
if (sortField !== undefined) {
|
|
1174
|
-
filters.sort = sortField;
|
|
1175
|
-
filters.order = sortOrder;
|
|
1176
|
-
}
|
|
1177
|
-
filters.runtime_filters = runtimeFieldFilters;
|
|
1178
|
-
return filters;
|
|
1179
|
-
}
|
|
1180
|
-
/** Execute a list query with projection-aware public result typing. */
|
|
1181
|
-
export async function runList(status, options, global) {
|
|
1182
|
-
const runtime = await resolveListRuntimeContext(options, global);
|
|
1183
|
-
const listWarnings = [];
|
|
1184
|
-
const ordering = resolveListOrderingOptions(options);
|
|
1185
|
-
const statusSelection = resolveListStatusSelection(status, options, runtime.statusRegistry);
|
|
1186
|
-
const noTruncate = options.noTruncate === true;
|
|
1187
|
-
const indexedPage = await tryLoadIndexedListPage({
|
|
1188
|
-
options,
|
|
1189
|
-
runtime,
|
|
1190
|
-
statusSelection,
|
|
1191
|
-
ordering,
|
|
1192
|
-
});
|
|
1193
|
-
let page = indexedPage;
|
|
1194
|
-
if (!page) {
|
|
1195
|
-
const items = await loadListItems(options, runtime, listWarnings);
|
|
1196
|
-
const needsHierarchyIndexes = ordering.treeEnabled || trimNonEmpty(options.parent) !== undefined;
|
|
1197
|
-
const hierarchyIndexes = needsHierarchyIndexes
|
|
1198
|
-
? indexHierarchyRelations(collectHierarchyRelations(items, resolveWorkspaceRelationshipKindRegistry()))
|
|
1199
|
-
: undefined;
|
|
1200
|
-
appendUnknownTagWarning(items, options.tag, listWarnings);
|
|
1201
|
-
const filtered = applyFilters(items, statusSelection.resolvedStatus, statusSelection.effectiveOptions, runtime.typeRegistry, runtime.statusRegistry, runtime.runtimeFieldFilters, hierarchyIndexes?.parents_by_child);
|
|
1202
|
-
// Edge-aware blocked selection (GH-578): classify against the complete
|
|
1203
|
-
// loaded corpus so terminal blocker targets count as satisfied, then narrow
|
|
1204
|
-
// the already-filtered rows to the shared blocked set.
|
|
1205
|
-
const scoped = options.dependencyBlocked === true
|
|
1206
|
-
? (() => {
|
|
1207
|
-
const blockedIds = collectDependencyBlockedIds(items, runtime.statusRegistry);
|
|
1208
|
-
return filtered.filter((item) => blockedIds.has(item.id.trim().toLowerCase()));
|
|
1209
|
-
})()
|
|
1210
|
-
: filtered;
|
|
1211
|
-
const sorted = sortItems(scoped, ordering.sortField, ordering.sortOrder, runtime.statusRegistry);
|
|
1212
|
-
const ordered = ordering.treeEnabled
|
|
1213
|
-
? orderItemsAsTree(sorted, ordering.parentRoot, ordering.treeDepth, hierarchyIndexes, items)
|
|
1214
|
-
: sorted;
|
|
1215
|
-
page = pageAndProjectListItems(ordered, options, runtime.projection, ordering.treeEnabled, buildListCursorFingerprint(statusSelection.filtersStatus, options, ordering));
|
|
1216
|
-
}
|
|
1217
|
-
const now = nowIso();
|
|
1218
|
-
const warnings = [...new Set(listWarnings)].sort((left, right) => left.localeCompare(right));
|
|
1219
|
-
const completeness = resolveListCompleteness(warnings, indexedPage !== null, options.strictRead === true);
|
|
1220
|
-
const projectionFields = runtime.projection.mode === "full" ? null : [...runtime.projection.fields];
|
|
1221
|
-
const compactSummaryMode = runtime.projection.mode === "compact" && options.compact === true;
|
|
1222
|
-
if (compactSummaryMode) {
|
|
1223
|
-
const compactFilters = buildCompactListFilterSummary({
|
|
1224
|
-
filtersStatus: statusSelection.filtersStatus,
|
|
1225
|
-
options,
|
|
1226
|
-
treeEnabled: ordering.treeEnabled,
|
|
1227
|
-
treeDepth: ordering.treeDepth,
|
|
1228
|
-
sortField: ordering.sortField,
|
|
1229
|
-
sortOrder: ordering.sortOrder,
|
|
1230
|
-
runtimeFieldFilters: runtime.runtimeFieldFilters,
|
|
1231
|
-
});
|
|
1232
|
-
return {
|
|
1233
|
-
items: page.projected,
|
|
1234
|
-
count: page.projected.length,
|
|
1235
|
-
total: page.totalMatched,
|
|
1236
|
-
...page.pageExtras,
|
|
1237
|
-
completeness,
|
|
1238
|
-
filters: compactFilters,
|
|
1239
|
-
projection: {
|
|
1240
|
-
mode: "compact",
|
|
1241
|
-
fields: projectionFields,
|
|
1242
|
-
},
|
|
1243
|
-
...(warnings.length > 0 ? { warnings } : {}),
|
|
1244
|
-
};
|
|
1245
|
-
}
|
|
1246
|
-
return {
|
|
1247
|
-
items: page.projected,
|
|
1248
|
-
count: page.projected.length,
|
|
1249
|
-
total: page.totalMatched,
|
|
1250
|
-
...page.pageExtras,
|
|
1251
|
-
completeness,
|
|
1252
|
-
filters: buildVerboseListFilters({
|
|
1253
|
-
filtersStatus: statusSelection.filtersStatus,
|
|
1254
|
-
options,
|
|
1255
|
-
noTruncate,
|
|
1256
|
-
treeEnabled: ordering.treeEnabled,
|
|
1257
|
-
treeDepth: ordering.treeDepth,
|
|
1258
|
-
sortField: ordering.sortField,
|
|
1259
|
-
sortOrder: ordering.sortOrder,
|
|
1260
|
-
runtimeFieldFilters: runtime.runtimeFieldFilters,
|
|
1261
|
-
}),
|
|
1262
|
-
projection: {
|
|
1263
|
-
mode: runtime.projection.mode,
|
|
1264
|
-
fields: projectionFields,
|
|
1265
|
-
},
|
|
1266
|
-
sorting: {
|
|
1267
|
-
sort: ordering.sortField ?? "default",
|
|
1268
|
-
order: ordering.sortField ? ordering.sortOrder : "asc",
|
|
1269
|
-
},
|
|
1270
|
-
now,
|
|
1271
|
-
...(warnings.length > 0 ? { warnings } : {}),
|
|
1272
|
-
};
|
|
1273
|
-
}
|
|
1274
|
-
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
1275
|
-
export const _testOnly = {
|
|
1276
|
-
applyFilters,
|
|
1277
|
-
buildCompactListFilterSummary,
|
|
1278
|
-
buildContentFilterEcho,
|
|
1279
|
-
buildGovernanceMissingFilterEcho,
|
|
1280
|
-
resolveContentFieldFilters,
|
|
1281
|
-
resolveMissingMetadataFilters,
|
|
1282
|
-
compareBySortField,
|
|
1283
|
-
compareDefaultSort,
|
|
1284
|
-
compareNullableString,
|
|
1285
|
-
compareNullableTimestamp,
|
|
1286
|
-
normalizeProjectionField,
|
|
1287
|
-
parseAssigneeFilter,
|
|
1288
|
-
parseFieldSelectors,
|
|
1289
|
-
parseIdsFilter,
|
|
1290
|
-
parseOffset,
|
|
1291
|
-
parseProjectionConfig,
|
|
1292
|
-
resolveListUpdatedAfter,
|
|
1293
|
-
resolveListPageLimit,
|
|
1294
|
-
parseSortField,
|
|
1295
|
-
parseSortOrder,
|
|
1296
|
-
orderItemsAsTree,
|
|
1297
|
-
projectListItems,
|
|
1298
|
-
readListFieldValue,
|
|
1299
|
-
runtimeMetadataKeysForProjection,
|
|
1300
|
-
sortItems,
|
|
1301
|
-
trimNonEmpty,
|
|
1302
|
-
withTreeMetadata,
|
|
1303
|
-
};
|
|
1
|
+
!(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]="9957767d-cc97-58ad-a46e-3f88a18a3c8c")}catch(e2){}})();import{assertInitializedTracker}from"../environment/tracker-preflight.js";import{getActiveExtensionRegistrations,hasActiveOnReadHooks}from"../../core/extensions/index.js";import{toItemRecord}from"../../core/item/item-record.js";import{isTerminalStatus}from"../../core/item/status.js";import{collectDependencyBlockedIds}from"../actionability.js";import{isStatusAllFilterInput,parseStatusFilterCsv}from"../../core/item/status-filter.js";import{resolveItemTypeRegistry}from"../../core/item/type-registry.js";import{parseIntegerLimit}from"./parsers.js";import{parsePriorityFilterSet,parseStringFilterSet,parseTypeFilterSet}from"./multi-value-filters.js";import{collectRuntimeFilterValues,matchesRuntimeFilters}from"../../core/schema/runtime-field-filters.js";import{hasMissingMetadataFilter,itemMatchesMissingMetadata,lifecycleClassifierFromStatusRegistry}from"../../core/governance/metadata-coverage.js";import{contentFiltersNeedBody,contentFiltersNeedCollections,hasContentFieldFilter,itemMatchesContentFilters}from"../../core/governance/content-fields.js";import{resolveRuntimeFieldRegistry,resolveRuntimeStatusRegistry}from"../../core/schema/runtime-schema.js";import{EXIT_CODE}from"../../core/shared/constants.js";import{PmCliError}from"../../core/shared/errors.js";import{compareTimestampStrings,matchesTimestampFilters,nowIso,resolveIsoOrRelative}from"../../core/shared/time.js";import{listAllItemMetadata,listAllItemMetadataLight,listAllItemMetadataWithBody}from"../../core/store/item-store.js";import{HEAVY_METADATA_KEYS,readItemMetadataDerivedIndexState}from"../../core/store/item-metadata-cache.js";import{queryItemMetadataIndex}from"../../core/store/item-metadata-query-index.js";import{resolvePmRoot}from"../../core/store/paths.js";import{readSettings}from"../../core/store/settings.js";import{LIST_FILTER_FLAG_CONTRACTS}from"../cli-contracts/flag-contracts.js";import{resolveWorkspaceRelationshipKindRegistry}from"../graph/assembly.js";import{collectHierarchyRelations,indexHierarchyRelations}from"../graph/hierarchy-integrity.js";import{createQueryFingerprint,encodeQueryCursor,resolveQueryCursorStart,selectCursorSemanticOptions}from"../pagination.js";import{BRIEF_LIST_FIELDS,DEFAULT_COMPACT_LIST_FIELDS,listListProjectionFields}from"./projection-contracts.js";import{BRIEF_LIST_FIELDS as BRIEF_LIST_FIELDS2,DEFAULT_COMPACT_LIST_FIELDS as DEFAULT_COMPACT_LIST_FIELDS2,LIST_COMMAND_DEFAULT_PROJECTIONS,listListProjectionFields as listListProjectionFields2}from"./projection-contracts.js";const resolveMissingMetadataFilters=options=>{return{acMissing:options.filterAcMissing===true,estimatesMissing:options.filterEstimatesMissing===true,resolutionMissing:options.filterResolutionMissing===true,metadataMissing:options.filterMetadataMissing===true,reviewerMissing:options.filterReviewerMissing===true,riskMissing:options.filterRiskMissing===true,confidenceMissing:options.filterConfidenceMissing===true,sprintMissing:options.filterSprintMissing===true,releaseMissing:options.filterReleaseMissing===true}};const CONTENT_FIELD_FLAG_MAPPINGS=[{field:"notes",presentKey:"hasNotes",absentKey:"noNotes",presentFlag:"--has-notes",absentFlag:"--no-notes"},{field:"learnings",presentKey:"hasLearnings",absentKey:"noLearnings",presentFlag:"--has-learnings",absentFlag:"--no-learnings"},{field:"files",presentKey:"hasFiles",absentKey:"noFiles",presentFlag:"--has-files",absentFlag:"--no-files"},{field:"docs",presentKey:"hasDocs",absentKey:"noDocs",presentFlag:"--has-docs",absentFlag:"--no-docs"},{field:"tests",presentKey:"hasTests",absentKey:"noTests",presentFlag:"--has-tests",absentFlag:"--no-tests"},{field:"comments",presentKey:"hasComments",absentKey:"noComments",presentFlag:"--has-comments",absentFlag:"--no-comments"},{field:"deps",presentKey:"hasDeps",absentKey:"noDeps",presentFlag:"--has-deps",absentFlag:"--no-deps"},{field:"body",presentKey:"hasBody",absentKey:"emptyBody",presentFlag:"--has-body",absentFlag:"--empty-body"},{field:"linked_command",presentKey:"hasLinkedCommand",absentKey:"noLinkedCommand",presentFlag:"--has-linked-command",absentFlag:"--no-linked-command"}];const resolveContentFieldFilters=options=>{const conflict=CONTENT_FIELD_FLAG_MAPPINGS.find(mapping=>options[mapping.presentKey]===true&&options[mapping.absentKey]===true);if(conflict){throw new PmCliError(`Cannot combine ${conflict.presentFlag} with ${conflict.absentFlag} for the same field.`,EXIT_CODE.USAGE)}return Object.fromEntries(CONTENT_FIELD_FLAG_MAPPINGS.flatMap(mapping=>{if(options[mapping.presentKey]===true){return[[mapping.field,"present"]]}return options[mapping.absentKey]===true?[[mapping.field,"absent"]]:[]}))};const LIST_SORT_FIELDS=["priority","deadline","updated_at","created_at","title","parent"];const LIST_SORT_ORDER_VALUES=["asc","desc"];const HEAVY_PROJECTION_FIELDS=new Set(HEAVY_METADATA_KEYS);function resolveListCompleteness(warnings,indexed,strict){const unreadableItemCount=warnings.filter(warning=>warning.startsWith("item_list_item_read_failed:")).length;const unreadableDirectoryCount=warnings.filter(warning=>warning.startsWith("item_list_directory_read_failed:")).length;const completeness={status:indexed?"unchecked":unreadableItemCount+unreadableDirectoryCount>0?"partial":"complete",unreadable_item_count:unreadableItemCount,unreadable_directory_count:unreadableDirectoryCount};if(strict&&completeness.status==="partial"){throw new PmCliError(`List source is incomplete: ${unreadableItemCount} item document(s) and ${unreadableDirectoryCount} item directory/directories could not be read.`,EXIT_CODE.GENERIC_FAILURE,{code:"list_source_incomplete",why:"Strict list reads fail closed so agents and SDK consumers never treat an omitted item as a complete workspace.",nextSteps:["Run pm validate --check-storage-integrity to locate unreadable tracker artifacts.","Repair the reported files or align the installed decoder version, then retry."]})}return completeness}function isNonEmptyRecord(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)&&Object.keys(value).length>0}const CONTENT_FILTER_ECHO_ENTRIES=[{key:"hasNotes",summaryKey:"has_notes"},{key:"hasLearnings",summaryKey:"has_learnings"},{key:"hasFiles",summaryKey:"has_files"},{key:"hasDocs",summaryKey:"has_docs"},{key:"hasTests",summaryKey:"has_tests"},{key:"hasComments",summaryKey:"has_comments"},{key:"hasDeps",summaryKey:"has_deps"},{key:"hasBody",summaryKey:"has_body"},{key:"hasLinkedCommand",summaryKey:"has_linked_command"},{key:"noNotes",summaryKey:"no_notes"},{key:"noLearnings",summaryKey:"no_learnings"},{key:"noFiles",summaryKey:"no_files"},{key:"noDocs",summaryKey:"no_docs"},{key:"noTests",summaryKey:"no_tests"},{key:"noComments",summaryKey:"no_comments"},{key:"noDeps",summaryKey:"no_deps"},{key:"emptyBody",summaryKey:"empty_body"},{key:"noLinkedCommand",summaryKey:"no_linked_command"}];const GOVERNANCE_MISSING_ECHO_ENTRIES=[{key:"filterReviewerMissing",summaryKey:"filter_reviewer_missing"},{key:"filterRiskMissing",summaryKey:"filter_risk_missing"},{key:"filterConfidenceMissing",summaryKey:"filter_confidence_missing"},{key:"filterSprintMissing",summaryKey:"filter_sprint_missing"},{key:"filterReleaseMissing",summaryKey:"filter_release_missing"}];function applyContentFilterEcho(filters,options){for(const entry of CONTENT_FILTER_ECHO_ENTRIES){if(options[entry.key]===true){filters[entry.summaryKey]=true}}}function applyGovernanceMissingFilterEcho(filters,options){for(const entry of GOVERNANCE_MISSING_ECHO_ENTRIES){if(options[entry.key]===true){filters[entry.summaryKey]=true}}}function applyFilterValueEcho(filters,options,entries){for(const entry of entries){const value=options[entry.optionKey];if(value!==void 0){filters[entry.summaryKey]=entry.normalize?entry.normalize(value):value}}}function buildContentFilterEcho(options){const echo={};applyContentFilterEcho(echo,options);return echo}function buildGovernanceMissingFilterEcho(options){const echo={};applyGovernanceMissingFilterEcho(echo,options);return echo}const COMPACT_LIST_VALUE_FILTER_ECHO_ENTRIES=[{optionKey:"type",summaryKey:"type"},{optionKey:"tag",summaryKey:"tag"},{optionKey:"priority",summaryKey:"priority"},{optionKey:"deadlineBefore",summaryKey:"deadline_before"},{optionKey:"deadlineAfter",summaryKey:"deadline_after"},{optionKey:"updatedAfter",summaryKey:"updated_after"},{optionKey:"updatedBefore",summaryKey:"updated_before"},{optionKey:"createdAfter",summaryKey:"created_after"},{optionKey:"createdBefore",summaryKey:"created_before"},{optionKey:"ids",summaryKey:"ids"},{optionKey:"assignee",summaryKey:"assignee"},{optionKey:"assigneeFilter",summaryKey:"assignee_filter"},{optionKey:"parent",summaryKey:"parent"},{optionKey:"sprint",summaryKey:"sprint"},{optionKey:"release",summaryKey:"release"}];const VERBOSE_LIST_VALUE_FILTER_ECHO_ENTRIES=[{optionKey:"type",summaryKey:"type"},{optionKey:"tag",summaryKey:"tag"},{optionKey:"priority",summaryKey:"priority"},{optionKey:"deadlineBefore",summaryKey:"deadline_before"},{optionKey:"deadlineAfter",summaryKey:"deadline_after"},{optionKey:"updatedAfter",summaryKey:"updated_after"},{optionKey:"updatedBefore",summaryKey:"updated_before"},{optionKey:"createdAfter",summaryKey:"created_after"},{optionKey:"createdBefore",summaryKey:"created_before"},{optionKey:"ids",summaryKey:"ids"},{optionKey:"assignee",summaryKey:"assignee"},{optionKey:"assigneeFilter",summaryKey:"assignee_filter"},{optionKey:"parent",summaryKey:"parent"},{optionKey:"sprint",summaryKey:"sprint"},{optionKey:"release",summaryKey:"release"},{optionKey:"limit",summaryKey:"limit"},{optionKey:"offset",summaryKey:"offset"},{optionKey:"includeBody",summaryKey:"include_body"},{optionKey:"compact",summaryKey:"compact"},{optionKey:"fields",summaryKey:"fields"}];const VERBOSE_LIST_BOOLEAN_FILTER_ECHO_ENTRIES=[{key:"filterAcMissing",summaryKey:"filter_ac_missing"},{key:"filterEstimatesMissing",summaryKey:"filter_estimates_missing"},{key:"filterResolutionMissing",summaryKey:"filter_resolution_missing"},{key:"filterMetadataMissing",summaryKey:"filter_metadata_missing"}];const LIST_RECENT_WINDOW="-7d";function buildCompactListFilterSummary(params){const{filtersStatus,options,treeEnabled,treeDepth,sortField,sortOrder,runtimeFieldFilters}=params;const filters={};if(filtersStatus!==null){filters.status=filtersStatus}if(options.dependencyBlocked===true){filters.blocked_semantics="status_or_dependency"}applyFilterValueEcho(filters,options,COMPACT_LIST_VALUE_FILTER_ECHO_ENTRIES);applyListWindowFilterEcho(filters,options);if(options.filterAcMissing===true){filters.filter_ac_missing=true}if(options.filterEstimatesMissing===true){filters.filter_estimates_missing=true}if(options.filterResolutionMissing===true){filters.filter_resolution_missing=true}if(options.filterMetadataMissing===true){filters.filter_metadata_missing=true}applyGovernanceMissingFilterEcho(filters,options);applyContentFilterEcho(filters,options);if(options.limit!==void 0){filters.limit=options.limit}if(options.offset!==void 0){filters.offset=options.offset}if(options.includeBody===true){filters.include_body=true}if(options.fields!==void 0){filters.fields=options.fields}if(treeEnabled){filters.tree=true;if(treeDepth!==void 0){filters.tree_depth=treeDepth}}if(sortField!==void 0){filters.sort=sortField;filters.order=sortOrder}if(isNonEmptyRecord(runtimeFieldFilters)){filters.runtime_filters=runtimeFieldFilters}return filters}function compareDefaultSort(left,right,statusRegistry){const leftTerminal=isTerminalStatus(left.status,statusRegistry);const rightTerminal=isTerminalStatus(right.status,statusRegistry);if(leftTerminal!==rightTerminal){return leftTerminal?1:-1}const byPriority=left.priority-right.priority;if(byPriority!==0){return byPriority}const byUpdated=compareTimestampStrings(right.updated_at,left.updated_at);if(byUpdated!==0){return byUpdated}return(left.id??"").localeCompare(right.id??"")}function sortItemsDefault(items,statusRegistry){return[...items].sort((left,right)=>compareDefaultSort(left,right,statusRegistry))}function parseDeadline(raw,fieldLabel){if(raw===void 0)return void 0;return resolveIsoOrRelative(raw,new Date,fieldLabel)}function parseTimestampWindow(raw,fieldLabel){if(raw==null)return void 0;const value=String(raw).trim();if(value.length===0)return void 0;return resolveIsoOrRelative(value,new Date,fieldLabel)}function resolveListUpdatedAfter(options){const hasUpdatedAfter=options.updatedAfter!=null&&String(options.updatedAfter).trim().length>0;const selectedWindows=[options.today===true,options.recent===true,hasUpdatedAfter].filter(selected=>selected).length;if(selectedWindows>1){throw new PmCliError("Choose only one updated_at window: --today, --recent, or --updated-after.",EXIT_CODE.USAGE)}if(options.today===true){const today=new Date;today.setHours(0,0,0,0);return today.toISOString()}if(options.recent===true){return parseTimestampWindow(LIST_RECENT_WINDOW,"recent")}return parseTimestampWindow(options.updatedAfter,"updated-after")}function applyListWindowFilterEcho(filters,options){if(options.today===true){filters.today=true}if(options.recent===true){filters.recent=true}}function parseIdsFilter(raw){if(raw==null)return void 0;const value=String(raw).trim();if(value.length===0){throw new PmCliError("--ids requires at least one non-empty item ID",EXIT_CODE.USAGE)}const ids=value.split(",").map(entry=>entry.trim()).filter(entry=>entry.length>0);if(ids.length===0){throw new PmCliError("--ids requires at least one non-empty item ID",EXIT_CODE.USAGE)}return new Set(ids)}function parseOffset(raw){if(raw===void 0)return void 0;const normalized=String(raw).trim();const parsed=normalized.length===0?Number.NaN:Number(normalized);if(!Number.isInteger(parsed)||parsed<0){throw new PmCliError("Offset filter must be a non-negative integer",EXIT_CODE.USAGE)}return parsed}function parseFieldSelectors(raw){if(raw===void 0){return void 0}const selectors=raw.split(",").map(entry=>entry.trim()).filter(entry=>entry.length>0);if(selectors.length===0){throw new PmCliError("List --fields requires a comma-separated list of field names",EXIT_CODE.USAGE)}return[...new Set(selectors)]}function parseProjectionConfig(options,invokedCommand=options.projectionCommand??"list"){const compactRequested=options.compact===true;const briefRequested=options.brief===true;const fullRequested=options.full===true;const fieldSelectors=parseFieldSelectors(options.fields);const enabledModes=Number(compactRequested)+Number(briefRequested)+Number(fullRequested)+Number(fieldSelectors!==void 0);if(enabledModes>1){throw new PmCliError("List projection options are mutually exclusive. Use one of --compact, --brief, --full, or --fields.",EXIT_CODE.USAGE,{code:"projection_options_mutually_exclusive",recovery:{suggested_retry:`pm ${invokedCommand} --brief`,suggested_retry_args:[invokedCommand,"--brief"]}})}if(fullRequested){return{mode:"full",fields:[]}}if(briefRequested){return{mode:"brief",fields:[...BRIEF_LIST_FIELDS]}}if(compactRequested){return{mode:"compact",fields:[...DEFAULT_COMPACT_LIST_FIELDS]}}if(fieldSelectors){return{mode:"fields",fields:[...new Set(fieldSelectors.map(field=>normalizeProjectionField(field)))]}}return{mode:"full",fields:[]}}function normalizeProjectionField(field){return field.startsWith("item.")?field.slice("item.".length):field}function validateListProjectionFields(projection,runtimeMetadataKeys,invokedCommand){if(projection.mode!=="fields"){return}const allowedValues=listListProjectionFields(runtimeMetadataKeys);const allowed=new Set(allowedValues.map(field=>normalizeProjectionField(field)));const unknown=projection.fields.filter(field=>!allowed.has(normalizeProjectionField(field)));if(unknown.length>0){throw new PmCliError(`Unknown list --fields value(s): ${unknown.join(", ")}`,EXIT_CODE.USAGE,{code:"unknown_field_projection",examples:["pm list-open --fields id,title,status,type,updated_at","pm list --fields id,title,parent,priority --limit 10","pm list-all --fields id,title,body --limit 5"],recovery:{allowed_values:allowedValues,suggested_retry:`pm ${invokedCommand} --fields id,title,status --limit 10`,suggested_retry_args:[invokedCommand,"--fields","id,title,status","--limit","10"]}})}}const LIST_SORT_FIELD_ALIASES=new Map([["updated","updated_at"],["update","updated_at"],["modified","updated_at"],["created","created_at"],["create","created_at"]]);function parseSortField(raw){if(raw===void 0){return void 0}const normalized=raw.trim().toLowerCase();const aliased=LIST_SORT_FIELD_ALIASES.get(normalized);if(aliased){return aliased}if(!LIST_SORT_FIELDS.includes(normalized)){throw new PmCliError(`Sort field must be one of ${LIST_SORT_FIELDS.join("|")} (aliases: updated->updated_at, created->created_at)`,EXIT_CODE.USAGE)}return normalized}function parseSortOrder(raw){if(raw===void 0){return void 0}const normalized=raw.trim().toLowerCase();if(!LIST_SORT_ORDER_VALUES.includes(normalized)){throw new PmCliError(`Sort order must be one of ${LIST_SORT_ORDER_VALUES.join("|")}`,EXIT_CODE.USAGE)}return normalized}function parseTreeDepth(raw){return parseIntegerLimit(raw,"--tree-depth")}function parseAssigneeFilter(raw){if(raw===void 0){return void 0}const normalized=raw.trim().toLowerCase();if(!normalized){throw new PmCliError("Assignee filter must be one of assigned|unassigned",EXIT_CODE.USAGE)}if(normalized!=="assigned"&&normalized!=="unassigned"){throw new PmCliError(`Invalid assignee filter "${raw}". Allowed: assigned|unassigned`,EXIT_CODE.USAGE)}return normalized}function resolveStatusFilter(status,statusRegistry){return parseStatusFilterCsv(status,statusRegistry,{strict:true})}function parseListTagFilters(raw){return parseStringFilterSet(raw,{label:"--tag",normalize:tag=>tag.toLowerCase()})}function appendUnknownTagWarning(items,rawTags,warnings){const requestedTags=parseListTagFilters(rawTags);if(requestedTags===void 0){return}const knownTags=new Set(items.flatMap(item=>item.tags.map(tag=>tag.trim().toLowerCase())));const unknownTags=[...requestedTags].filter(tag=>!knownTags.has(tag));if(unknownTags.length>0){warnings.push(`unknown_tags:${unknownTags.join(",")}`)}}function assertListAssigneeFilters(assigneeFilter,assigneeModeFilter){if(assigneeFilter&&[...assigneeFilter].some(value=>value.toLowerCase()==="none"||value.toLowerCase()==="null")){throw new PmCliError('--assignee no longer accepts "none" or "null". Use --assignee-filter unassigned.',EXIT_CODE.USAGE)}if(assigneeFilter!==void 0&&assigneeModeFilter==="unassigned"){throw new PmCliError("Cannot combine --assignee with --assignee-filter unassigned",EXIT_CODE.USAGE)}}function resolveListFilterSet(status,options,typeRegistry,statusRegistry){const assigneeFilter=parseStringFilterSet(options.assignee,{label:"--assignee"});const assigneeModeFilter=parseAssigneeFilter(options.assigneeFilter);assertListAssigneeFilters(assigneeFilter,assigneeModeFilter);const missingMetadataFilters=resolveMissingMetadataFilters(options);const contentFieldFilters=resolveContentFieldFilters(options);return{idsFilter:parseIdsFilter(options.ids),statusSet:status&&status.length>0?new Set(status):void 0,excludeTerminal:options.excludeTerminal===true,typeFilter:parseTypeFilterSet(options.type,typeRegistry),tagFilters:parseListTagFilters(options.tag),priorityFilter:parsePriorityFilterSet(options.priority),deadlineBefore:parseDeadline(options.deadlineBefore,"deadline-before"),deadlineAfter:parseDeadline(options.deadlineAfter,"deadline-after"),updatedAfter:resolveListUpdatedAfter(options),updatedBefore:parseTimestampWindow(options.updatedBefore,"updated-before"),createdAfter:parseTimestampWindow(options.createdAfter,"created-after"),createdBefore:parseTimestampWindow(options.createdBefore,"created-before"),assigneeFilter,assigneeModeFilter,parentFilter:options.parent?.trim(),treeEnabled:options.tree===true,sprintFilter:parseStringFilterSet(options.sprint,{label:"--sprint"}),releaseFilter:parseStringFilterSet(options.release,{label:"--release"}),missingMetadataFilters,missingMetadataActive:hasMissingMetadataFilter(missingMetadataFilters),lifecycleClassifier:lifecycleClassifierFromStatusRegistry(statusRegistry),contentFieldFilters,contentFiltersActive:hasContentFieldFilter(contentFieldFilters)}}function matchesListIdentityFilters(item,filters,statusRegistry){if(filters.idsFilter&&!filters.idsFilter.has(item.id))return false;if(filters.statusSet&&!filters.statusSet.has(item.status))return false;if(filters.excludeTerminal&&isTerminalStatus(item.status,statusRegistry))return false;if(filters.typeFilter&&!filters.typeFilter.has(item.type))return false;if(filters.tagFilters&&![...filters.tagFilters].some(tag=>(item.tags??[]).some(candidate=>candidate.trim().toLowerCase()===tag))){return false}return filters.priorityFilter===void 0||filters.priorityFilter.has(item.priority)}function matchesListDateFilters(item,filters){return matchesTimestampFilters(item,filters)}function matchesListAssigneeFilterSet(item,filters){if(filters.assigneeModeFilter==="assigned"&&!item.assignee)return false;if(filters.assigneeModeFilter==="unassigned"&&item.assignee)return false;return filters.assigneeFilter===void 0||item.assignee!==void 0&&filters.assigneeFilter.has(item.assignee)}function matchesListScopeFilters(item,filters,parentsByChild){const scalarParent=item.parent?.trim().toLowerCase();const logicalParentIds=[...new Set([...parentsByChild?.get(item.id.trim().toLowerCase())??[],...scalarParent?[scalarParent]:[]])];if(filters.parentFilter!==void 0&&!filters.treeEnabled&&!logicalParentIds.includes(filters.parentFilter.trim().toLowerCase()))return false;if(filters.sprintFilter!==void 0&&(item.sprint===void 0||!filters.sprintFilter.has(item.sprint)))return false;return filters.releaseFilter===void 0||item.release!==void 0&&filters.releaseFilter.has(item.release)}function matchesListFilterSet(item,filters,statusRegistry,runtimeFieldFilters,parentsByChild){if(!matchesListIdentityFilters(item,filters,statusRegistry)||!matchesListDateFilters(item,filters)||!matchesListAssigneeFilterSet(item,filters)||!matchesListScopeFilters(item,filters,parentsByChild)){return false}if(filters.missingMetadataActive&&!itemMatchesMissingMetadata(item,filters.missingMetadataFilters,filters.lifecycleClassifier)){return false}if(filters.contentFiltersActive&&!itemMatchesContentFilters(item,filters.contentFieldFilters)){return false}if(!matchesRuntimeFilters(item,runtimeFieldFilters)){return false}return true}function applyFilters(items,status,options,typeRegistry,statusRegistry,runtimeFieldFilters,parentsByChild){const filters=resolveListFilterSet(status,options,typeRegistry,statusRegistry);return items.filter(item=>matchesListFilterSet(item,filters,statusRegistry,runtimeFieldFilters,parentsByChild))}function trimNonEmpty(value){if(typeof value!=="string"){return void 0}const trimmed=value.trim();return trimmed.length>0?trimmed:void 0}function withTreeMetadata(item,depth,childCount,parentId){const itemRecord=toItemRecord(item);const title=typeof itemRecord.title==="string"?itemRecord.title:"";const parent=parentId??trimNonEmpty(typeof itemRecord.parent==="string"?itemRecord.parent:void 0)??null;return{...item,tree_depth:depth,tree_parent:parent,tree_children:childCount,tree_title:`${" ".repeat(depth)}${title}`}}function buildListTreeIndexes(sortedItems,hierarchyIndexes){const byId=new Map;const childrenByParent=new Map;for(const item of sortedItems){const itemId=item.id.trim().toLowerCase();byId.set(itemId,item);const parentIds=hierarchyIndexes?hierarchyIndexes.parents_by_child.get(itemId)??[]:[trimNonEmpty(item.parent)?.toLowerCase()].filter(value=>value!==void 0);for(const parentId of parentIds){const children=childrenByParent.get(parentId)??[];children.push(item);childrenByParent.set(parentId,children)}}return{byId,childrenByParent}}function resolveListTreeRoots(sortedItems,parentRoot,byId,childrenByParent,hierarchyIndexes){return parentRoot?[...childrenByParent.get(parentRoot.toLowerCase())??[]]:sortedItems.filter(item=>{const parentIds=hierarchyIndexes?hierarchyIndexes.parents_by_child.get(item.id.trim().toLowerCase())??[]:[trimNonEmpty(item.parent)?.toLowerCase()].filter(value=>value!==void 0);return parentIds.every(parentId=>!byId.has(parentId))})}function orderItemsAsTree(sortedItems,parentRoot,maxDepth,hierarchyIndexes,completeItems=sortedItems){const{byId,childrenByParent}=buildListTreeIndexes(sortedItems,hierarchyIndexes);const roots=resolveListTreeRoots(sortedItems,parentRoot,byId,childrenByParent,hierarchyIndexes);const ordered=[];const visited=new Set;const canonicalIdByLowercase=new Map(completeItems.map(item=>[item.id.trim().toLowerCase(),item.id.trim()]));const pending=[...roots].reverse().map(node=>({node,depth:0,parentId:parentRoot===void 0?void 0:canonicalIdByLowercase.get(parentRoot.trim().toLowerCase())??parentRoot.trim()}));while(pending.length>0){const{node,depth,parentId}=pending.pop();const nodeId=node.id.trim().toLowerCase();if(visited.has(nodeId))continue;visited.add(nodeId);const children=childrenByParent.get(nodeId)??[];ordered.push(withTreeMetadata(node,depth,children.length,parentId));if(maxDepth!==void 0&&depth>=maxDepth)continue;for(const child of[...children].reverse()){pending.push({node:child,depth:depth+1,parentId:canonicalIdByLowercase.get(nodeId)})}}if(parentRoot===void 0&&maxDepth===void 0){for(const item of sortedItems){const itemId=item.id.trim().toLowerCase();if(visited.has(itemId))continue;visited.add(itemId);ordered.push(withTreeMetadata(item,0,childrenByParent.get(itemId)?.length??0))}}return ordered}function compareNullableString(left,right){if(left===right){return 0}if(left===null){return 1}if(right===null){return-1}return left.localeCompare(right)}function compareNullableTimestamp(left,right){if(left===right){return 0}if(left===null){return 1}if(right===null){return-1}return compareTimestampStrings(left,right)}function compareBySortField(left,right,field){switch(field){case"priority":return left.priority-right.priority;case"deadline":return compareNullableTimestamp(left.deadline??null,right.deadline??null);case"updated_at":return compareTimestampStrings(left.updated_at,right.updated_at);case"created_at":return compareTimestampStrings(left.created_at,right.created_at);case"title":return(left.title??"").localeCompare(right.title??"");case"parent":return compareNullableString(left.parent??null,right.parent??null);default:return 0}}function sortItems(items,sortField,sortOrder,statusRegistry){if(!sortField){return sortItemsDefault(items,statusRegistry)}return[...items].sort((left,right)=>{const byField=compareBySortField(left,right,sortField);if(byField!==0){return sortOrder==="desc"?-byField:byField}const fallback=compareDefaultSort(left,right,statusRegistry);return sortOrder==="desc"?-fallback:fallback})}function readListFieldValue(item,field,treeMode=false){const normalized=normalizeProjectionField(field.trim());if(normalized.length===0){return null}const itemRecord=toItemRecord(item);if(treeMode&&normalized==="title"&&typeof itemRecord.tree_title==="string"){return itemRecord.tree_title}if(Object.prototype.hasOwnProperty.call(itemRecord,normalized)){return itemRecord[normalized]??null}return null}function projectListItems(items,projection,treeMode=false){if(projection.mode==="full"){return items}return items.map(item=>{const projected={};for(const field of projection.fields){projected[field]=readListFieldValue(item,field,treeMode)}return projected})}function runtimeMetadataKeysForProjection(definitions){const keys=[];for(const field of definitions){keys.push(field.metadata_key)}return keys}function resolveListPageLimit(options,totalRows){if(options.noTruncate===true){return void 0}return parseIntegerLimit(options.limit)??(totalRows>=1e4?20:void 0)}function resolveListPageStart(ordered,options,cursorFingerprint){if(options.after===void 0){return parseOffset(options.offset)??0}return resolveQueryCursorStart(ordered,options.after,cursorFingerprint,item=>item.id)}function buildListPageExtras(limit,hasMore,nextCursor){return{...limit!==void 0?{applied_limit:limit}:{},has_more:hasMore,truncated:hasMore,next_cursor:nextCursor??null}}async function resolveListRuntimeContext(options,global2){const pmRoot=resolvePmRoot(process.cwd(),global2.path);await assertInitializedTracker(pmRoot);const settings=await readSettings(pmRoot);const statusRegistry=resolveRuntimeStatusRegistry(settings.schema);const runtimeFieldRegistry=resolveRuntimeFieldRegistry(settings.schema);const invokedCommand=options.projectionCommand??"list";const projection=parseProjectionConfig(options,invokedCommand);validateListProjectionFields(projection,runtimeMetadataKeysForProjection(runtimeFieldRegistry.definitions),invokedCommand);return{pmRoot,settings,statusRegistry,runtimeFieldFilters:collectRuntimeFilterValues(options,runtimeFieldRegistry,"list"),typeRegistry:resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()),projection}}async function loadListItems(options,runtime,listWarnings){const projectionNeedsBody=runtime.projection.fields.some(field=>normalizeProjectionField(field)==="body");const projectionNeedsCollections=runtime.projection.mode==="full"||runtime.projection.fields.some(field=>HEAVY_PROJECTION_FIELDS.has(normalizeProjectionField(field)));const contentFieldFilters=resolveContentFieldFilters(options);const contentNeedsCollections=contentFiltersNeedCollections(contentFieldFilters);const contentNeedsBody=contentFiltersNeedBody(contentFieldFilters);if(options.includeBody||projectionNeedsBody||contentNeedsBody){return await listAllItemMetadataWithBody(runtime.pmRoot,runtime.settings.item_format,runtime.typeRegistry.type_to_folder,listWarnings,runtime.settings.schema)}if(projectionNeedsCollections||contentNeedsCollections){return await listAllItemMetadata(runtime.pmRoot,runtime.settings.item_format,runtime.typeRegistry.type_to_folder,listWarnings,runtime.settings.schema)}return await listAllItemMetadataLight(runtime.pmRoot,runtime.settings.item_format,runtime.typeRegistry.type_to_folder,listWarnings,runtime.settings.schema)}function resolveListOrderingOptions(options){const sortField=parseSortField(options.sort);const sortOrder=parseSortOrder(options.order)??"asc";const treeEnabled=options.tree===true;if(!treeEnabled&&options.treeDepth!==void 0){throw new PmCliError("List --tree-depth requires --tree",EXIT_CODE.USAGE)}if(!sortField&&options.order!==void 0){throw new PmCliError("List --order requires --sort",EXIT_CODE.USAGE)}return{sortField,sortOrder,treeEnabled,treeDepth:treeEnabled?parseTreeDepth(options.treeDepth):void 0,parentRoot:treeEnabled?trimNonEmpty(options.parent):void 0}}function resolveListStatusSelection(status,options,statusRegistry){const explicitStatus=resolveStatusFilter(options.status,statusRegistry);let lifecycleStatus;if(options.lifecycleBucket==="in_progress"){lifecycleStatus=[statusRegistry.in_progress_status]}else if(options.lifecycleBucket==="open"){lifecycleStatus=[...statusRegistry.active_statuses].filter(entry=>entry!==statusRegistry.in_progress_status).sort((left,right)=>left.localeCompare(right))}const resolvedStatus=explicitStatus??lifecycleStatus??resolveStatusFilter(status,statusRegistry);const explicitAllStatuses=isStatusAllFilterInput(options.status);const effectiveOptions=explicitStatus||explicitAllStatuses?{...options,excludeTerminal:false}:options;let filtersStatus="all";if(explicitAllStatuses){filtersStatus="all"}else if(explicitStatus!==void 0){filtersStatus=explicitStatus.length===1?explicitStatus[0]:explicitStatus}else if(options.lifecycleBucket!==void 0){filtersStatus=options.lifecycleBucket}else if(resolvedStatus!==void 0){filtersStatus=resolvedStatus.length===1?resolvedStatus[0]:resolvedStatus}else if(effectiveOptions.excludeTerminal===true){filtersStatus=null}return{resolvedStatus,explicitAllStatuses,effectiveOptions,filtersStatus}}function pageAndProjectListItems(ordered,options,projection,treeEnabled,cursorFingerprint){if(options.after!==void 0&&options.offset!==void 0){throw new PmCliError("List --after cannot be combined with --offset.",EXIT_CODE.USAGE)}const limit=resolveListPageLimit(options,ordered.length);const offset=resolveListPageStart(ordered,options,cursorFingerprint);const limited=limit===void 0?ordered.slice(offset):ordered.slice(offset,offset+limit);const projected=projectListItems(limited,projection,treeEnabled);const totalMatched=ordered.length;const hasMore=limited.length>0&&offset+limited.length<totalMatched;const nextCursor=hasMore&&limited.length>0?encodeQueryCursor(cursorFingerprint,limited[limited.length-1].id,offset+limited.length-1):void 0;return{projected,totalMatched,pageExtras:buildListPageExtras(limit,hasMore,nextCursor)}}function buildListCursorFingerprint(status,options,ordering){return createQueryFingerprint("list",{status,options:selectCursorSemanticOptions(options,LIST_FILTER_FLAG_CONTRACTS),sort:ordering.sortField??"default",order:ordering.sortOrder,tree:ordering.treeEnabled,tree_depth:ordering.treeDepth??null})}async function tryLoadIndexedListPage(params){const{options,runtime,statusSelection,ordering}=params;const supportedOptionKeys=new Set(["status","limit","offset","compact","brief","full","fields","format","stream","includeBody","excludeTerminal","dependencyBlocked","lifecycleBucket","noTruncate","projectionCommand","truncate","notes","learnings","files","docs","tests","comments","deps","linkedCommand"]);const projectionNeedsHeavyData=[runtime.projection.mode==="full",runtime.projection.fields.some(field=>{const normalized=normalizeProjectionField(field);return normalized==="body"||HEAVY_PROJECTION_FIELDS.has(normalized)})].includes(true);const requiresFallback=[options.limit===void 0,options.after!==void 0,options.noTruncate===true,options.includeBody===true,options.dependencyBlocked===true,options.strictRead===true,ordering.treeEnabled,ordering.sortField!==void 0,projectionNeedsHeavyData,hasActiveOnReadHooks(),Object.keys(runtime.runtimeFieldFilters).length>0,Object.entries(options).some(([key,value])=>value!==void 0&&!supportedOptionKeys.has(key))].includes(true);if(requiresFallback){return null}const indexState=await readItemMetadataDerivedIndexState(runtime.pmRoot,[...new Set(Object.values(runtime.typeRegistry.type_to_folder))]);if(!indexState)return null;const limit=parseIntegerLimit(options.limit);const offset=parseOffset(options.offset)??0;const indexed=await queryItemMetadataIndex({pmRoot:runtime.pmRoot,expectedSourceCursor:indexState.source_cursor,query:{statuses:statusSelection.resolvedStatus,excludeStatuses:statusSelection.resolvedStatus===void 0&&statusSelection.effectiveOptions.excludeTerminal===true?[...runtime.statusRegistry.terminal_statuses]:void 0,terminalStatuses:[...runtime.statusRegistry.terminal_statuses],limit,offset}});if(!indexed)return null;const hasMore=indexed.items.length>0&&offset+indexed.items.length<indexed.total;const nextCursor=hasMore?encodeQueryCursor(buildListCursorFingerprint(statusSelection.filtersStatus,options,ordering),indexed.items.at(-1).id,offset+indexed.items.length-1):void 0;return{projected:projectListItems(indexed.items,runtime.projection,false),totalMatched:indexed.total,pageExtras:buildListPageExtras(limit,hasMore,nextCursor)}}function buildVerboseListFilters(params){const{filtersStatus,options,noTruncate,treeEnabled,treeDepth,sortField,sortOrder,runtimeFieldFilters}=params;const filters={};if(filtersStatus!==null){filters.status=filtersStatus}if(options.dependencyBlocked===true){filters.blocked_semantics="status_or_dependency"}const optionRecord=options;for(const entry of VERBOSE_LIST_VALUE_FILTER_ECHO_ENTRIES){const value=optionRecord[entry.optionKey];if(value!==void 0&&value!==null){filters[entry.summaryKey]=value}}for(const entry of VERBOSE_LIST_BOOLEAN_FILTER_ECHO_ENTRIES){if(optionRecord[entry.key]===true){filters[entry.summaryKey]=true}}Object.assign(filters,buildGovernanceMissingFilterEcho(options),buildContentFilterEcho(options));applyListWindowFilterEcho(filters,options);if(noTruncate){filters.no_truncate=true}if(options.strictRead===true){filters.strict_read=true}if(treeEnabled){filters.tree=true;if(treeDepth!==void 0){filters.tree_depth=treeDepth}}if(sortField!==void 0){filters.sort=sortField;filters.order=sortOrder}filters.runtime_filters=runtimeFieldFilters;return filters}async function runList(status,options,global2){const runtime=await resolveListRuntimeContext(options,global2);const listWarnings=[];const ordering=resolveListOrderingOptions(options);const statusSelection=resolveListStatusSelection(status,options,runtime.statusRegistry);const noTruncate=options.noTruncate===true;const indexedPage=await tryLoadIndexedListPage({options,runtime,statusSelection,ordering});let page=indexedPage;if(!page){const items=await loadListItems(options,runtime,listWarnings);const needsHierarchyIndexes=ordering.treeEnabled||trimNonEmpty(options.parent)!==void 0;const hierarchyIndexes=needsHierarchyIndexes?indexHierarchyRelations(collectHierarchyRelations(items,resolveWorkspaceRelationshipKindRegistry())):void 0;appendUnknownTagWarning(items,options.tag,listWarnings);const filtered=applyFilters(items,statusSelection.resolvedStatus,statusSelection.effectiveOptions,runtime.typeRegistry,runtime.statusRegistry,runtime.runtimeFieldFilters,hierarchyIndexes?.parents_by_child);const scoped=options.dependencyBlocked===true?(()=>{const blockedIds=collectDependencyBlockedIds(items,runtime.statusRegistry);return filtered.filter(item=>blockedIds.has(item.id.trim().toLowerCase()))})():filtered;const sorted=sortItems(scoped,ordering.sortField,ordering.sortOrder,runtime.statusRegistry);const ordered=ordering.treeEnabled?orderItemsAsTree(sorted,ordering.parentRoot,ordering.treeDepth,hierarchyIndexes,items):sorted;page=pageAndProjectListItems(ordered,options,runtime.projection,ordering.treeEnabled,buildListCursorFingerprint(statusSelection.filtersStatus,options,ordering))}const now=nowIso();const warnings=[...new Set(listWarnings)].sort((left,right)=>left.localeCompare(right));const completeness=resolveListCompleteness(warnings,indexedPage!==null,options.strictRead===true);const projectionFields=runtime.projection.mode==="full"?null:[...runtime.projection.fields];const compactSummaryMode=runtime.projection.mode==="compact"&&options.compact===true;if(compactSummaryMode){const compactFilters=buildCompactListFilterSummary({filtersStatus:statusSelection.filtersStatus,options,treeEnabled:ordering.treeEnabled,treeDepth:ordering.treeDepth,sortField:ordering.sortField,sortOrder:ordering.sortOrder,runtimeFieldFilters:runtime.runtimeFieldFilters});return{items:page.projected,count:page.projected.length,total:page.totalMatched,...page.pageExtras,completeness,filters:compactFilters,projection:{mode:"compact",fields:projectionFields},...warnings.length>0?{warnings}:{}}}return{items:page.projected,count:page.projected.length,total:page.totalMatched,...page.pageExtras,completeness,filters:buildVerboseListFilters({filtersStatus:statusSelection.filtersStatus,options,noTruncate,treeEnabled:ordering.treeEnabled,treeDepth:ordering.treeDepth,sortField:ordering.sortField,sortOrder:ordering.sortOrder,runtimeFieldFilters:runtime.runtimeFieldFilters}),projection:{mode:runtime.projection.mode,fields:projectionFields},sorting:{sort:ordering.sortField??"default",order:ordering.sortField?ordering.sortOrder:"asc"},now,...warnings.length>0?{warnings}:{}}}const _testOnly={applyFilters,buildCompactListFilterSummary,buildContentFilterEcho,buildGovernanceMissingFilterEcho,resolveContentFieldFilters,resolveMissingMetadataFilters,compareBySortField,compareDefaultSort,compareNullableString,compareNullableTimestamp,normalizeProjectionField,parseAssigneeFilter,parseFieldSelectors,parseIdsFilter,parseOffset,parseProjectionConfig,resolveListUpdatedAfter,resolveListPageLimit,parseSortField,parseSortOrder,orderItemsAsTree,projectListItems,readListFieldValue,runtimeMetadataKeysForProjection,sortItems,trimNonEmpty,withTreeMetadata};export{BRIEF_LIST_FIELDS2 as BRIEF_LIST_FIELDS,DEFAULT_COMPACT_LIST_FIELDS2 as DEFAULT_COMPACT_LIST_FIELDS,LIST_COMMAND_DEFAULT_PROJECTIONS,LIST_SORT_FIELDS,LIST_SORT_ORDER_VALUES,_testOnly,applyFilterValueEcho,buildContentFilterEcho,buildGovernanceMissingFilterEcho,listListProjectionFields2 as listListProjectionFields,resolveContentFieldFilters,resolveMissingMetadataFilters,runList};
|
|
1304
2
|
//# sourceMappingURL=list.js.map
|
|
1305
|
-
//# debugId=ccdb7d16-4f38-58d4-a19d-4ab1516cb1d7
|