@unbrained/pm-cli 2026.11.22 → 2026.11.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/after-command-context-usage.js +1 -1
- package/dist/cli/argv-utils.js +1 -1
- package/dist/cli/bootstrap-args.js +1 -1
- package/dist/cli/bundle-integrity.js +2 -2
- package/dist/cli/command-namespaces.js +1 -1
- package/dist/cli/commander-usage.js +11 -11
- package/dist/cli/commands/annotations/comments.js +1 -1
- package/dist/cli/commands/annotations/docs.js +1 -1
- package/dist/cli/commands/annotations/files.js +1 -1
- package/dist/cli/commands/annotations/learnings.js +1 -1
- package/dist/cli/commands/annotations/notes.js +1 -1
- package/dist/cli/commands/extension/describe.js +1 -1
- package/dist/cli/commands/extension/extension.js +1 -1
- package/dist/cli/commands/extension/scaffold.js +1 -1
- package/dist/cli/commands/extension/shared.js +1 -1
- package/dist/cli/commands/governance/gc.js +1 -1
- package/dist/cli/commands/governance/health.js +1 -1
- package/dist/cli/commands/governance/telemetry.js +1 -1
- package/dist/cli/commands/governance/validate.js +1 -1
- package/dist/cli/commands/history/activity.js +1 -1
- package/dist/cli/commands/history/history-compact.js +1 -1
- package/dist/cli/commands/history/history-redact.js +1 -1
- package/dist/cli/commands/history/history-repair.js +1 -1
- package/dist/cli/commands/history/history.js +1 -1
- package/dist/cli/commands/history/restore.js +1 -1
- package/dist/cli/commands/lifecycle/append.js +1 -1
- package/dist/cli/commands/lifecycle/claim.js +1 -1
- package/dist/cli/commands/lifecycle/close-many.js +1 -1
- package/dist/cli/commands/lifecycle/close.js +1 -1
- package/dist/cli/commands/lifecycle/copy.js +1 -1
- package/dist/cli/commands/lifecycle/create.js +1 -1
- package/dist/cli/commands/lifecycle/delete.js +1 -1
- package/dist/cli/commands/lifecycle/focus.js +1 -1
- package/dist/cli/commands/lifecycle/plan.js +1 -1
- package/dist/cli/commands/lifecycle/update-many.js +1 -1
- package/dist/cli/commands/lifecycle/update.js +1 -1
- package/dist/cli/commands/query/aggregate.js +1 -1
- package/dist/cli/commands/query/context.js +1 -1
- package/dist/cli/commands/query/deps.js +1 -1
- package/dist/cli/commands/query/duplicates.js +1 -1
- package/dist/cli/commands/query/eval.js +1 -1
- package/dist/cli/commands/query/get.js +1 -1
- package/dist/cli/commands/query/graph.js +1 -1
- package/dist/cli/commands/query/list.js +1 -1
- package/dist/cli/commands/query/next.js +1 -1
- package/dist/cli/commands/query/search.js +1 -1
- package/dist/cli/commands/query/stats.js +1 -1
- package/dist/cli/commands/test/test-all.js +1 -1
- package/dist/cli/commands/test/test-runs.js +1 -1
- package/dist/cli/commands/test/test.js +1 -1
- package/dist/cli/commands/workspace/config.js +1 -1
- package/dist/cli/commands/workspace/contracts.js +1 -1
- package/dist/cli/commands/workspace/init.js +1 -1
- package/dist/cli/commands/workspace/merge.js +1 -1
- package/dist/cli/commands/workspace/profile.js +1 -1
- package/dist/cli/commands/workspace/schema.js +1 -1
- package/dist/cli/commands/workspace/upgrade.js +1 -1
- package/dist/cli/context-intent-invocation.js +1 -1
- package/dist/cli/description-stdin.js +1 -1
- package/dist/cli/error-guidance.js +5 -5
- package/dist/cli/expected-revisions.js +1 -1
- package/dist/cli/extension-command-help.js +6 -6
- package/dist/cli/extension-recovery.js +1 -1
- package/dist/cli/help-content.js +5 -5
- package/dist/cli/help-json-payload.js +7 -7
- package/dist/cli/invocation-profile.js +2 -2
- package/dist/cli/main.js +5 -5
- package/dist/cli/migration-gates.js +1 -1
- package/dist/cli/option-values.js +1 -1
- package/dist/cli/preflight-warnings.js +3 -3
- package/dist/cli/public.js +1 -1
- package/dist/cli/register-annotations.js +1 -1
- package/dist/cli/register-assurance.js +1 -1
- package/dist/cli/register-files-lookup.js +1 -1
- package/dist/cli/register-history-activity.js +1 -1
- package/dist/cli/register-history-author.js +1 -1
- package/dist/cli/register-history-maintenance.js +2 -2
- package/dist/cli/register-list-query.js +10 -10
- package/dist/cli/register-mutation-options.js +0 -1
- package/dist/cli/register-mutation.js +6 -6
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli/register-structured-mutation.js +1 -1
- package/dist/cli/registration-helpers.js +1 -1
- package/dist/cli/runtime/activation.js +1 -1
- package/dist/cli/runtime/annotation-option-retry.js +1 -1
- package/dist/cli/runtime/close-fields-retry.js +1 -1
- package/dist/cli/runtime/field-route-retry.js +1 -1
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli/runtime/invocation-rewrites.js +1 -1
- package/dist/cli/runtime/projection-retry.js +1 -1
- package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
- package/dist/cli/runtime/refusal-credential-redaction.js +1 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli/runtime/telemetry-outcome.js +1 -1
- package/dist/cli/runtime-compatibility-boundary.js +4 -4
- package/dist/cli/schema/registration.js +15 -15
- package/dist/cli/schema-registration-helpers.js +1 -1
- package/dist/cli/search-refresh.js +1 -1
- package/dist/cli/stats-analytics-json.js +1 -1
- package/dist/cli/telemetry-flush.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-2UQU7HRR.js +9 -0
- package/dist/cli-bundle/chunks/chunk-5DUP4AZA.js +2 -0
- package/dist/cli-bundle/chunks/chunk-5WZZ5XEN.js +3 -0
- package/dist/cli-bundle/chunks/chunk-6H36ZHMI.js +2 -0
- package/dist/cli-bundle/chunks/chunk-6MYJLOSG.js +2 -0
- package/dist/cli-bundle/chunks/chunk-AA52P34H.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-B76TFRO2.js → chunk-AEOHUSUI.js} +101 -101
- package/dist/cli-bundle/chunks/chunk-BSRIVYTM.js +8 -0
- package/dist/cli-bundle/chunks/chunk-CFWLQFJM.js +71 -0
- package/dist/cli-bundle/chunks/chunk-D6PDUKUG.js +9 -0
- package/dist/cli-bundle/chunks/chunk-ENKXRSFZ.js +31 -0
- package/dist/cli-bundle/chunks/chunk-F2Z6XLZB.js +3 -0
- package/dist/cli-bundle/chunks/chunk-FJOEL75F.js +2 -0
- package/dist/cli-bundle/chunks/chunk-GDXCAC52.js +2 -0
- package/dist/cli-bundle/chunks/chunk-H7JEXRIN.js +6 -0
- package/dist/cli-bundle/chunks/chunk-J2PDAVBC.js +2 -0
- package/dist/cli-bundle/chunks/chunk-KE7HMBEW.js +2 -0
- package/dist/cli-bundle/chunks/chunk-KZHIBEJL.js +33 -0
- package/dist/cli-bundle/chunks/chunk-NGJ5ERBF.js +115 -0
- package/dist/cli-bundle/chunks/chunk-NQ54T7T2.js +2 -0
- package/dist/cli-bundle/chunks/chunk-O7JHS64G.js +3 -0
- package/dist/cli-bundle/chunks/chunk-OKEZF7HU.js +2 -0
- package/dist/cli-bundle/chunks/chunk-OKIKF4FD.js +2 -0
- package/dist/cli-bundle/chunks/chunk-OPJF254V.js +9 -0
- package/dist/cli-bundle/chunks/chunk-PZA7QECY.js +1 -0
- package/dist/cli-bundle/chunks/chunk-RWA5YZ5X.js +2 -0
- package/dist/cli-bundle/chunks/chunk-S32NGRQM.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SLFRSZK6.js +1 -0
- package/dist/cli-bundle/chunks/chunk-TZY5MVJF.js +125 -0
- package/dist/cli-bundle/chunks/chunk-YYT3MIRF.js +3 -0
- package/dist/cli-bundle/chunks/chunk-ZPS4B6SI.js +8 -0
- package/dist/cli-bundle/chunks/context-budget-recovery-M5RFUEFG.js +2 -0
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-BPYKN5Q7.js +4 -0
- package/dist/cli-bundle/chunks/{item-revision-4QBMZXKX.js → item-revision-FMD4KWBB.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-SEHTH7N2.js +2 -0
- package/dist/cli-bundle/chunks/mutation-actor-SFGYIRPW.js +2 -0
- package/dist/cli-bundle/chunks/mutation-admission-57LBSKQI.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-RR5KACJ3.js → register-list-query-L4IBU64P.js} +11 -11
- package/dist/cli-bundle/chunks/register-mutation-6NUOPHZ3.js +21 -0
- package/dist/cli-bundle/chunks/register-operations-JGYVORNN.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-C44SIXEH.js +2 -0
- package/dist/cli-bundle/chunks/settlement-hook-6MR32OOC.js +7 -0
- package/dist/cli-bundle/chunks/stage-PQ7AB63N.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-6LKTEKHS.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-6LPXMFLM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-A6VEMCRR.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-AIDL2ZNT.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-BKPUUW5O.js +1 -0
- package/dist/cli-bundle/focused-chunks/chunk-BWOVFE5B.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HMDQDRV2.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-I66IKYKP.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IIP6LZ5E.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IR2J3NOT.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-IROZDIDX.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-ITKDHSBR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-K53OIT5J.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LQYYPXUK.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-NQTEE66P.js +13 -0
- package/dist/cli-bundle/focused-chunks/chunk-O7Z73ALG.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OTMMOKPM.js +91 -0
- package/dist/cli-bundle/focused-chunks/chunk-OXOCZJC6.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QLAHEDT6.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QQIIMMFU.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIE3SJSE.js +9 -0
- package/dist/cli-bundle/focused-chunks/chunk-TD544C74.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-UFTUNBMY.js +27 -0
- package/dist/cli-bundle/focused-chunks/chunk-X6CXWWNB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XRS3VNC6.js +44 -0
- package/dist/cli-bundle/focused-chunks/chunk-XYPEZGTR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Y2ESLKCF.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-YSJKQLFR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z2X7HH3C.js +102 -0
- package/dist/cli-bundle/focused-chunks/chunk-ZHWPCVQL.js +78 -0
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-CSJV3TY3.js +2 -0
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-EGEJMG3G.js +4 -0
- package/dist/cli-bundle/focused-chunks/{item-revision-2O6MLPEX.js → item-revision-YDACCDVY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-UKEQCTKB.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-actor-AS465LRX.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-E5UHJZFE.js +2 -0
- package/dist/cli-bundle/focused-chunks/settlement-hook-FMLGKG7J.js +7 -0
- package/dist/cli-bundle/focused-chunks/stage-36J7YLGI.js +2 -0
- package/dist/cli-bundle/main.js +27 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +5 -5
- package/dist/cli-bundle/sdk-core.js +1 -1
- 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 +66 -66
- 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 +12 -12
- package/dist/cli.js +1 -1
- package/dist/core/checkpoint/checkpoint-gc.js +1 -1
- package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
- package/dist/core/checkpoint/mutation-context.js +1 -1
- package/dist/core/config/nested-settings.js +1 -1
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/extensions/activation-summary-markdown.js +2 -2
- package/dist/core/extensions/activation-summary.js +1 -1
- package/dist/core/extensions/activation-transaction.js +1 -1
- package/dist/core/extensions/capability-usage.js +1 -1
- package/dist/core/extensions/command-hook-context.js +1 -1
- package/dist/core/extensions/command-metadata-contract.js +1 -1
- package/dist/core/extensions/command-visibility-tier.js +1 -1
- package/dist/core/extensions/contribution-inventory.js +1 -1
- package/dist/core/extensions/exporter-output-contract.js +1 -1
- package/dist/core/extensions/extension-candidate.js +1 -1
- package/dist/core/extensions/extension-capability-aliases.js +1 -1
- package/dist/core/extensions/extension-hook-runtime.js +1 -1
- package/dist/core/extensions/extension-policy.js +1 -1
- package/dist/core/extensions/extension-registries.js +1 -1
- package/dist/core/extensions/extension-runtime-helpers.js +1 -1
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/extensions/flag-definition-validation.js +1 -1
- package/dist/core/extensions/flag-value-types.js +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/item-field-types.js +1 -1
- package/dist/core/extensions/item-fields.js +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/manifest-parser.js +1 -1
- package/dist/core/extensions/manifest-schema.js +1 -1
- package/dist/core/extensions/module-graph-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor-snapshot.js +1 -1
- package/dist/core/extensions/mutation-actor.js +1 -1
- package/dist/core/extensions/preflight-ownership.js +1 -1
- package/dist/core/extensions/read-output-contract.js +1 -1
- package/dist/core/extensions/registration-contracts.js +1 -1
- package/dist/core/extensions/registration-validation.js +1 -1
- package/dist/core/extensions/registration-values.js +1 -1
- package/dist/core/extensions/reserved-host-flags.js +1 -1
- package/dist/core/extensions/runtime-registrations.js +1 -1
- package/dist/core/extensions/service-ownership.js +1 -1
- package/dist/core/extensions/version-compat.js +1 -1
- package/dist/core/extensions/version-diagnostics.js +1 -1
- package/dist/core/fs/atomic-create.js +1 -1
- package/dist/core/fs/file-glob.js +1 -1
- package/dist/core/fs/fs-utils.js +2 -2
- package/dist/core/fs/host-environment-errors.js +1 -1
- package/dist/core/fs/index.js +1 -1
- package/dist/core/fs/path-utils.js +1 -1
- package/dist/core/governance/content-fields.js +1 -1
- package/dist/core/governance/issue-codes.js +1 -1
- package/dist/core/governance/metadata-coverage.js +1 -1
- package/dist/core/history/bridge.js +1 -1
- package/dist/core/history/digest.js +1 -1
- package/dist/core/history/drift-cache.js +3 -3
- package/dist/core/history/drift-scan.js +1 -1
- package/dist/core/history/event-classification.js +1 -1
- package/dist/core/history/event-index.js +11 -11
- package/dist/core/history/history-compact-bulk.js +1 -1
- package/dist/core/history/history-diff.js +1 -1
- package/dist/core/history/history-rewrite.js +1 -1
- package/dist/core/history/history-storage-stats.js +1 -1
- package/dist/core/history/history-stream-policy.js +1 -1
- package/dist/core/history/history.js +2 -2
- package/dist/core/history/identity.js +1 -1
- package/dist/core/history/index.js +1 -1
- package/dist/core/history/operation-contract.js +1 -1
- package/dist/core/history/projection.js +1 -1
- package/dist/core/history/read.js +1 -1
- package/dist/core/history/replay.js +2 -2
- package/dist/core/history/stream-summary.js +2 -2
- package/dist/core/history/tombstone.js +1 -1
- package/dist/core/history/version-address.js +1 -1
- package/dist/core/history/workspace-history.js +2 -2
- package/dist/core/io/body-file.js +1 -1
- package/dist/core/io/bulk-ids-input.js +2 -2
- package/dist/core/item/actionability.js +1 -1
- package/dist/core/item/deferred-fields.js +1 -1
- package/dist/core/item/dependency-reference.js +1 -1
- package/dist/core/item/id.js +1 -1
- package/dist/core/item/index.js +1 -1
- package/dist/core/item/item-format-version.js +1 -1
- package/dist/core/item/item-format.js +7 -7
- package/dist/core/item/item-record.js +1 -1
- package/dist/core/item/item-type-definition.js +1 -1
- package/dist/core/item/literal-mutation-input.js +1 -1
- package/dist/core/item/parent-reference-policy.js +1 -1
- package/dist/core/item/parse.js +8 -8
- package/dist/core/item/plan-lifecycle.js +1 -1
- package/dist/core/item/priority.js +1 -1
- package/dist/core/item/sprint-release-format.js +1 -1
- package/dist/core/item/status-filter.js +1 -1
- package/dist/core/item/status.js +1 -1
- package/dist/core/item/toon-decode.js +1 -1
- package/dist/core/item/type-registry.js +1 -1
- package/dist/core/item/type-synonyms.js +1 -1
- package/dist/core/lock/index.js +1 -1
- package/dist/core/lock/lock-confinement.js +1 -1
- package/dist/core/lock/lock-gc.js +1 -1
- package/dist/core/lock/lock-owner.js +1 -1
- package/dist/core/lock/lock.js +4 -4
- package/dist/core/output/linked-test-projection.js +5 -5
- package/dist/core/output/mutation-projection.js +1 -1
- package/dist/core/output/output-control.js +1 -1
- package/dist/core/output/output.js +19 -19
- package/dist/core/output/query-summary.js +1 -1
- package/dist/core/output/tabular.js +3 -3
- package/dist/core/packages/manifest.js +1 -1
- package/dist/core/packages/root.js +1 -1
- package/dist/core/policy/workflow-policy-schema.js +1 -1
- package/dist/core/policy/workflow-policy-store.js +1 -1
- package/dist/core/policy/workflow-policy.js +1 -1
- package/dist/core/profile/profile-describe.js +1 -1
- package/dist/core/profile/profile-lint.d.ts +1 -1
- package/dist/core/profile/profile-lint.js +1 -1
- package/dist/core/profile/profile-plan.js +1 -1
- package/dist/core/profile/profile-presets.js +4 -4
- package/dist/core/reproducibility/context.js +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/item-types-file.js +2 -2
- package/dist/core/schema/runtime-field-filters.js +1 -1
- package/dist/core/schema/runtime-field-values.js +1 -1
- package/dist/core/schema/runtime-schema.js +2 -2
- package/dist/core/schema/status-defs-file.js +2 -2
- package/dist/core/schema/status-token.js +1 -1
- package/dist/core/schema/type-inference.js +1 -1
- package/dist/core/schema/type-presets.js +1 -1
- package/dist/core/schema/type-workflows.js +1 -1
- package/dist/core/search/background-refresh.js +2 -2
- package/dist/core/search/bm25.js +1 -1
- package/dist/core/search/cache.js +2 -2
- package/dist/core/search/corpus.js +1 -1
- package/dist/core/search/embedding-batches.js +1 -1
- package/dist/core/search/eval-thresholds.js +1 -1
- package/dist/core/search/eval.js +1 -1
- package/dist/core/search/http-client.js +1 -1
- package/dist/core/search/providers.js +1 -1
- package/dist/core/search/relevance.js +1 -1
- package/dist/core/search/semantic-defaults.js +1 -1
- package/dist/core/search/staleness.js +1 -1
- package/dist/core/search/vector-stores.js +2 -2
- package/dist/core/search/vectorization-metadata.js +1 -1
- package/dist/core/sentry/helpers.js +1 -1
- package/dist/core/sentry/instrument.js +1 -1
- package/dist/core/sentry/sensitive-assignments.js +1 -1
- package/dist/core/session/session-state.js +1 -1
- package/dist/core/shared/agent-session-context.js +1 -1
- package/dist/core/shared/author.js +5 -5
- package/dist/core/shared/command-line.js +1 -1
- package/dist/core/shared/command-types.js +0 -1
- package/dist/core/shared/conflict-markers.js +1 -1
- package/dist/core/shared/constants.js +1 -1
- package/dist/core/shared/error-details.js +1 -1
- package/dist/core/shared/errors.js +1 -1
- package/dist/core/shared/html-entity-decode.js +1 -1
- package/dist/core/shared/index.js +1 -1
- package/dist/core/shared/item-metadata-contract.js +1 -1
- package/dist/core/shared/lazy-module.js +1 -1
- package/dist/core/shared/levenshtein.js +1 -1
- package/dist/core/shared/memo.js +1 -1
- package/dist/core/shared/numeric-parsers.js +1 -1
- package/dist/core/shared/option-alias-visibility.js +1 -1
- package/dist/core/shared/output-unicode.js +1 -1
- package/dist/core/shared/primitives.js +1 -1
- package/dist/core/shared/process-tree.js +2 -2
- package/dist/core/shared/secret-rules.js +5 -5
- package/dist/core/shared/serial-queue.js +1 -1
- package/dist/core/shared/serialization.js +1 -1
- package/dist/core/shared/split-comma-list.js +1 -1
- package/dist/core/shared/text-normalization.js +1 -1
- package/dist/core/shared/time.js +2 -2
- package/dist/core/shared/url-credentials.js +1 -1
- package/dist/core/store/index.js +1 -1
- package/dist/core/store/item-format-migration.js +1 -1
- package/dist/core/store/item-metadata-cache.js +1 -1
- package/dist/core/store/item-metadata-query-index.js +11 -11
- package/dist/core/store/item-metadata-read-work.js +1 -1
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/paths.js +1 -1
- package/dist/core/store/settings-concurrency.js +1 -1
- package/dist/core/store/settings-read-cache.js +1 -1
- package/dist/core/store/settings-sections.js +2 -2
- package/dist/core/store/settings-validator.js +1 -1
- package/dist/core/store/settings.d.ts +3 -1
- package/dist/core/store/settings.js +6 -6
- package/dist/core/store/sqlite-runtime.js +1 -1
- package/dist/core/store/tracker-preflight.js +1 -1
- package/dist/core/store/transaction-coordinator-scope.js +1 -1
- package/dist/core/telemetry/consent.js +3 -3
- package/dist/core/telemetry/observability.js +1 -1
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/read-sampling.js +2 -2
- package/dist/core/telemetry/runtime.js +9 -9
- package/dist/core/test/background-runs.js +4 -4
- package/dist/core/test/item-test-run-tracking.js +1 -1
- package/dist/core/test/run-selectors.js +1 -1
- package/dist/core/validate/estimate-defaults.js +1 -1
- package/dist/core/validate/fix-planning.js +1 -1
- package/dist/core/validate/linked-artifact-reference.js +1 -1
- package/dist/core/validate/missing-by-type.js +1 -1
- package/dist/core/validate/missing-link-owners.js +1 -1
- package/dist/core/validate/stale-file-classification.js +1 -1
- package/dist/mcp/http-server.js +5 -5
- package/dist/mcp/legacy-adapter.js +1 -1
- package/dist/mcp/runtime-capabilities.js +1 -1
- package/dist/mcp/server.js +4 -4
- package/dist/mcp/tool-definitions.js +1 -1
- package/dist/sdk/actionability.js +1 -1
- package/dist/sdk/agent/closed-domain-contracts.js +1 -1
- package/dist/sdk/agent/command-recovery.js +1 -1
- package/dist/sdk/agent/command-suggestions.js +1 -1
- package/dist/sdk/agent/create-option-policy.js +1 -1
- package/dist/sdk/agent/identity-config.js +1 -1
- package/dist/sdk/agent/item-addressing.js +1 -1
- package/dist/sdk/agent/linked-resource-recovery.js +1 -1
- package/dist/sdk/agent/refusal-closure-census.js +2 -2
- package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
- package/dist/sdk/agent/subcommand-recovery.js +1 -1
- package/dist/sdk/agent-capability-contracts.js +3 -3
- package/dist/sdk/agent-session-context.js +1 -1
- package/dist/sdk/annotations.js +1 -1
- package/dist/sdk/author-attribution.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -5
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
- package/dist/sdk/cli-contracts/command-aliases.js +1 -1
- package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +1 -1
- package/dist/sdk/cli-contracts/completeness.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -2
- package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
- package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
- package/dist/sdk/cli-contracts/string-lists.js +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.js +0 -1
- package/dist/sdk/cli-contracts.js +1 -1
- package/dist/sdk/cli-program.js +1 -1
- package/dist/sdk/command-line.js +1 -1
- package/dist/sdk/comments.js +1 -1
- package/dist/sdk/compile-cache.js +1 -1
- package/dist/sdk/completion/bash.js +2 -2
- package/dist/sdk/completion/fish.js +72 -72
- package/dist/sdk/completion/shared.js +1 -1
- package/dist/sdk/completion/zsh.js +75 -75
- package/dist/sdk/completion.js +1 -1
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/context/recency.js +1 -1
- package/dist/sdk/context/semantic-session-attribution.js +1 -1
- package/dist/sdk/context/usage-egress.js +1 -1
- package/dist/sdk/context/usage-ledger.js +6 -6
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/context-intent-runtime.js +1 -1
- package/dist/sdk/context-packing.js +1 -1
- package/dist/sdk/context-relevance.js +1 -1
- package/dist/sdk/context-signal-store.js +2 -2
- package/dist/sdk/context-usage.js +1 -1
- package/dist/sdk/dependencies/context-budget-recovery.js +1 -1
- package/dist/sdk/dependencies.js +1 -1
- package/dist/sdk/dependency-flag-validation.js +1 -1
- package/dist/sdk/dependency-provenance.js +1 -1
- package/dist/sdk/docs.js +1 -1
- package/dist/sdk/duplicates.js +1 -1
- package/dist/sdk/environment/host-environment-errors.js +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.js +2 -2
- package/dist/sdk/environment/source-context.js +1 -1
- package/dist/sdk/environment/tracker-preflight.js +1 -1
- package/dist/sdk/error-code-catalog.js +1 -1
- package/dist/sdk/error-runtime.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/eval.js +1 -1
- package/dist/sdk/extension/author-manifest.js +1 -1
- package/dist/sdk/extension/bundled-catalog.js +1 -1
- package/dist/sdk/extension/command-options.js +1 -1
- package/dist/sdk/extension/concurrency.js +1 -1
- package/dist/sdk/extension/copy-scope.js +1 -1
- package/dist/sdk/extension/custom-field-collisions.js +1 -1
- package/dist/sdk/extension/describe.js +3 -3
- package/dist/sdk/extension/doctor.js +1 -1
- package/dist/sdk/extension/install-plan.js +1 -1
- package/dist/sdk/extension/install-receipts.js +1 -1
- package/dist/sdk/extension/install-runtime.js +3 -3
- package/dist/sdk/extension/install-snapshot.js +1 -1
- package/dist/sdk/extension/install-sources.js +5 -5
- package/dist/sdk/extension/managed-state.js +2 -2
- package/dist/sdk/extension/managed-update-status.js +1 -1
- package/dist/sdk/extension/migrations.js +2 -2
- package/dist/sdk/extension/native-command-options.js +1 -1
- package/dist/sdk/extension/output-ownership.js +1 -1
- package/dist/sdk/extension/runtime-summary.js +1 -1
- package/dist/sdk/extension/scaffold.js +11 -11
- package/dist/sdk/extension/shared.js +1 -1
- package/dist/sdk/extension/source-resolution.js +1 -1
- package/dist/sdk/extension/static-inventory.js +1 -1
- package/dist/sdk/extension/update-check.js +1 -1
- package/dist/sdk/extension-command-context.js +2 -2
- package/dist/sdk/extension-contracts.js +1 -1
- package/dist/sdk/extension.js +1 -1
- package/dist/sdk/files.js +1 -1
- package/dist/sdk/flag-invocation-contracts.js +1 -1
- package/dist/sdk/generated/error-code-catalog-rows.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/generated-error-code-catalog.js +1 -1
- package/dist/sdk/governance/assurance-action-contracts.js +0 -1
- package/dist/sdk/governance/assurance-action.js +1 -1
- package/dist/sdk/governance/assurance-limits.js +1 -1
- package/dist/sdk/governance/assurance-mutation-error.js +1 -1
- package/dist/sdk/governance/assurance-presets.js +1 -1
- package/dist/sdk/governance/assurance-runtime.js +1 -1
- package/dist/sdk/governance/assurance.js +4 -4
- package/dist/sdk/governance/boundary-fixtures.js +1 -1
- package/dist/sdk/governance/closure-timestamps.js +1 -1
- package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
- package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
- package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
- package/dist/sdk/governance/defect-recurrence.js +2 -2
- package/dist/sdk/governance/extension-host-version.js +1 -1
- package/dist/sdk/governance/gc.js +1 -1
- package/dist/sdk/governance/health/history-drift-remedies.js +1 -1
- package/dist/sdk/governance/health/projection.js +1 -1
- package/dist/sdk/governance/health-merge-evidence.js +1 -1
- package/dist/sdk/governance/health.js +2 -2
- package/dist/sdk/governance/hierarchy-validation.js +1 -1
- package/dist/sdk/governance/in-progress-work-health.js +1 -1
- package/dist/sdk/governance/lifecycle-dependency-cycles.js +1 -1
- package/dist/sdk/governance/linked-file-report.js +1 -1
- package/dist/sdk/governance/merge-receipt-history.js +1 -1
- package/dist/sdk/governance/provenance-health.js +4 -4
- package/dist/sdk/governance/reindex.js +5 -5
- package/dist/sdk/governance/stale-work.js +1 -1
- package/dist/sdk/governance/status-role-diagnostics.js +1 -1
- package/dist/sdk/governance/storage-integrity.js +1 -1
- package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
- package/dist/sdk/governance/upgrade.js +2 -2
- package/dist/sdk/governance/validate-deferred-fields.js +1 -1
- package/dist/sdk/governance/validate-history-drift.js +1 -1
- package/dist/sdk/governance/validate-item-reader.js +1 -1
- package/dist/sdk/governance/validate-normalization.js +1 -1
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/governance/workflow-completeness.js +1 -1
- package/dist/sdk/governance/workflow-policy.js +3 -3
- package/dist/sdk/governance/workspace-position.js +2 -2
- package/dist/sdk/graph/analytics.js +1 -1
- package/dist/sdk/graph/assembly.js +1 -1
- package/dist/sdk/graph/cache.js +1 -1
- package/dist/sdk/graph/cardinality-integrity.js +1 -1
- package/dist/sdk/graph/centrality.js +1 -1
- package/dist/sdk/graph/deadline-scheduling.js +1 -1
- package/dist/sdk/graph/durable-cache.js +1 -1
- package/dist/sdk/graph/governance-contracts.js +1 -1
- package/dist/sdk/graph/governance.js +1 -1
- package/dist/sdk/graph/hierarchy-integrity.js +1 -1
- package/dist/sdk/graph/lifecycle-coverage.js +1 -1
- package/dist/sdk/graph/mutation-advisory.js +1 -1
- package/dist/sdk/graph/query-contracts.js +1 -1
- package/dist/sdk/graph/remediation.js +1 -1
- package/dist/sdk/graph/run.js +1 -1
- package/dist/sdk/graph/scheduling.js +1 -1
- package/dist/sdk/graph/traversal.js +1 -1
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
- package/dist/sdk/guide-topics.js +1 -1
- package/dist/sdk/guide.js +7 -7
- package/dist/sdk/history/append-only-repair.js +4 -4
- package/dist/sdk/history/attestation-command.js +2 -2
- package/dist/sdk/history/attestation-contract.js +1 -1
- package/dist/sdk/history/attestation-scan.js +1 -1
- package/dist/sdk/history/attestation.js +1 -1
- package/dist/sdk/history/maintenance.js +1 -1
- package/dist/sdk/history/reanchor-refusal.js +1 -1
- package/dist/sdk/history/reseed.js +1 -1
- package/dist/sdk/history/salvage.js +5 -5
- package/dist/sdk/history/subject.js +1 -1
- package/dist/sdk/history-analytics.js +1 -1
- package/dist/sdk/history-compact.js +1 -1
- package/dist/sdk/history-mcp.js +1 -1
- package/dist/sdk/history-provenance.js +1 -1
- package/dist/sdk/history-read.js +1 -1
- package/dist/sdk/history-redact.js +1 -1
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/improvement-ledger-validation.js +1 -1
- package/dist/sdk/improvement-ledger.js +2 -2
- package/dist/sdk/init-agent-guidance.js +10 -10
- package/dist/sdk/init.js +14 -14
- package/dist/sdk/invocation-author.js +1 -1
- package/dist/sdk/item-children.js +1 -1
- package/dist/sdk/item-metadata-index.js +1 -1
- package/dist/sdk/item-schedule.js +1 -1
- package/dist/sdk/item-transaction.js +1 -1
- package/dist/sdk/learnings.js +1 -1
- package/dist/sdk/lifecycle/append.js +3 -3
- package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/cli-input.js +1 -1
- package/dist/sdk/lifecycle/close-many.js +1 -1
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/copy.js +1 -1
- package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
- package/dist/sdk/lifecycle/core-item-fields.js +1 -1
- package/dist/sdk/lifecycle/create-deferrals.js +1 -1
- package/dist/sdk/lifecycle/create.js +1 -1
- package/dist/sdk/lifecycle/delete.js +1 -1
- package/dist/sdk/lifecycle/dependency-removal.js +1 -1
- package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
- package/dist/sdk/lifecycle/focus.js +1 -1
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
- package/dist/sdk/lifecycle/item-revision.js +1 -1
- package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
- package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
- package/dist/sdk/lifecycle/mcp-actions.js +1 -1
- package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
- package/dist/sdk/lifecycle/mutation-command-options.js +0 -1
- package/dist/sdk/lifecycle/mutation-facet-contracts.js +1 -1
- package/dist/sdk/lifecycle/mutation-option-validation.js +1 -1
- package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
- package/dist/sdk/lifecycle/plan.js +1 -1
- package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
- package/dist/sdk/lifecycle/release-handoff.js +1 -1
- package/dist/sdk/lifecycle/reopen.js +1 -1
- package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -2
- package/dist/sdk/lifecycle/repeated-terminal-state.js +1 -1
- package/dist/sdk/lifecycle/restore.js +1 -1
- package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
- package/dist/sdk/lifecycle/start-blockers.js +1 -1
- package/dist/sdk/lifecycle/structured-mutation-plan.js +1 -1
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/lifecycle/update-many.js +1 -1
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/lifecycle/workflow-transition.js +1 -1
- package/dist/sdk/lifecycle-completion.js +1 -1
- package/dist/sdk/lifecycle-policy.js +1 -1
- package/dist/sdk/linked-artifacts.js +2 -2
- package/dist/sdk/mcp/apps.js +5 -5
- package/dist/sdk/mcp/authorization.js +1 -1
- package/dist/sdk/mcp/discovery.js +1 -1
- package/dist/sdk/mcp/executable.js +4 -4
- package/dist/sdk/mcp/interactions.js +1 -1
- package/dist/sdk/mcp/protocol.js +1 -1
- package/dist/sdk/mcp/skills.js +3 -3
- package/dist/sdk/mcp/subscriptions.js +1 -1
- package/dist/sdk/mcp/tasks.js +2 -2
- package/dist/sdk/mcp/transport.js +1 -1
- package/dist/sdk/merge/abandoned-receipts.js +1 -1
- package/dist/sdk/merge/driver.js +7 -7
- package/dist/sdk/merge/history-scalar-rebase.js +1 -1
- package/dist/sdk/merge/ignored-artifacts.js +1 -1
- package/dist/sdk/merge/index.js +1 -1
- package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
- package/dist/sdk/merge/install.js +6 -6
- package/dist/sdk/merge/receipt-file-boundary.js +1 -1
- package/dist/sdk/merge/receipt-operation.js +1 -1
- package/dist/sdk/merge/receipt-schema.js +1 -1
- package/dist/sdk/merge/receipts.js +4 -4
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/settlement-hook.js +4 -4
- package/dist/sdk/merge/stage.js +1 -1
- package/dist/sdk/merge/three-way.js +9 -9
- package/dist/sdk/merge/worktree-config.js +2 -2
- package/dist/sdk/merge.js +1 -1
- package/dist/sdk/mutation-events.js +1 -1
- package/dist/sdk/mutation-guard.js +1 -1
- package/dist/sdk/notes.js +1 -1
- package/dist/sdk/output/fit-envelope.js +1 -1
- package/dist/sdk/output/list-envelope.js +1 -1
- package/dist/sdk/output/table-rows.js +1 -1
- package/dist/sdk/output-contracts.js +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/output-token-accounting.js +1 -1
- package/dist/sdk/output.js +2 -2
- package/dist/sdk/ownership-source.js +1 -1
- package/dist/sdk/package-import-adapters.js +1 -1
- package/dist/sdk/package-migrations.js +1 -1
- package/dist/sdk/package-runtime-options.js +1 -1
- package/dist/sdk/pagination.js +1 -1
- package/dist/sdk/profile.js +5 -5
- package/dist/sdk/provenance.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/activity.js +1 -1
- package/dist/sdk/query/aggregate.js +1 -1
- package/dist/sdk/query/calendar.js +4 -4
- package/dist/sdk/query/complete-list.js +1 -1
- package/dist/sdk/query/context.js +2 -2
- package/dist/sdk/query/declared-blockers.js +1 -1
- package/dist/sdk/query/duplicate-candidates.js +1 -1
- package/dist/sdk/query/get-facet-roots.js +1 -1
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/history.js +1 -1
- package/dist/sdk/query/item-filter-options.js +0 -1
- package/dist/sdk/query/light-metadata.js +1 -1
- package/dist/sdk/query/list-filter-shared.js +1 -1
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/query/multi-value-filters.js +1 -1
- package/dist/sdk/query/next-ranking-policy.js +1 -1
- package/dist/sdk/query/next-ready-budget.js +1 -1
- package/dist/sdk/query/next.js +2 -2
- package/dist/sdk/query/parsers.js +1 -1
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/query/search/corpus.js +2 -2
- package/dist/sdk/query/search/filters.js +1 -1
- package/dist/sdk/query/search/input.js +1 -1
- package/dist/sdk/query/search/lexical.js +1 -1
- package/dist/sdk/query/search/response.js +1 -1
- package/dist/sdk/query/search/semantic.js +3 -3
- package/dist/sdk/query/search/types.js +0 -1
- package/dist/sdk/query/search-contracts.js +1 -1
- package/dist/sdk/query/search-pagination.js +1 -1
- package/dist/sdk/query/search-rendering.js +1 -1
- package/dist/sdk/query/search.js +1 -1
- package/dist/sdk/query/window-pagination.js +1 -1
- package/dist/sdk/query/workspace-contracts.js +1 -1
- package/dist/sdk/read-output/continuation.js +1 -1
- package/dist/sdk/read-output/extension.js +1 -1
- package/dist/sdk/read-output/options.js +1 -1
- package/dist/sdk/read-output/positional-rows.js +1 -1
- package/dist/sdk/read-output/provenance.js +1 -1
- package/dist/sdk/read-output/session-result.js +0 -1
- package/dist/sdk/read-output/surfaces.js +1 -1
- package/dist/sdk/read-output/tail-retention.js +1 -1
- package/dist/sdk/read-output-budget.js +1 -1
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/read-output-rows.js +1 -1
- package/dist/sdk/read-output-session.js +1 -1
- package/dist/sdk/relationship-analytics.js +1 -1
- package/dist/sdk/relationship-context.js +1 -1
- package/dist/sdk/relationship-history.js +6 -6
- package/dist/sdk/relationship-kinds/contract.js +1 -1
- package/dist/sdk/relationships.js +1 -1
- package/dist/sdk/reproducibility/process.js +1 -1
- package/dist/sdk/runtime/actions.js +1 -1
- package/dist/sdk/runtime/context.js +1 -1
- package/dist/sdk/runtime/mutation-admission.js +1 -1
- package/dist/sdk/runtime/mutation-value-validation.js +1 -1
- package/dist/sdk/runtime/schema-preview.js +1 -1
- package/dist/sdk/runtime/schema.js +1 -1
- package/dist/sdk/runtime-action-aliases.js +1 -1
- package/dist/sdk/runtime-extended-actions.js +1 -1
- package/dist/sdk/runtime-input.d.ts +2 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime-primitives.js +1 -1
- package/dist/sdk/runtime-public-contracts.js +0 -1
- package/dist/sdk/runtime-stats-options.js +1 -1
- package/dist/sdk/runtime.d.ts +5 -3
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/scheduling-shortcuts.js +1 -1
- package/dist/sdk/schema/field-option-collisions.js +2 -0
- package/dist/sdk/schema-migration.js +4 -4
- package/dist/sdk/schema.js +7 -7
- package/dist/sdk/search-refresh-worker.js +1 -1
- package/dist/sdk/similarity-scoring.js +1 -1
- package/dist/sdk/similarity.js +1 -1
- package/dist/sdk/start-task-status.js +1 -1
- package/dist/sdk/stats.js +1 -1
- package/dist/sdk/structured-mutations.js +1 -1
- package/dist/sdk/telemetry-flush.js +1 -1
- package/dist/sdk/telemetry.js +4 -4
- package/dist/sdk/templates.js +3 -3
- package/dist/sdk/test/batch.js +2 -2
- package/dist/sdk/test/command-args.js +1 -1
- package/dist/sdk/test/command-resolution.js +2 -2
- package/dist/sdk/test/entry.js +2 -2
- package/dist/sdk/test/execution-receipts.js +2 -2
- package/dist/sdk/test/execution.js +5 -5
- package/dist/sdk/test/json-path.js +1 -1
- package/dist/sdk/test/linked-command-detection.js +1 -1
- package/dist/sdk/test/measurements.js +1 -1
- package/dist/sdk/test/parsers.js +1 -1
- package/dist/sdk/test/prerequisites.js +1 -1
- package/dist/sdk/test/receipt-index-snapshot.js +1 -1
- package/dist/sdk/test/run-phases.js +1 -1
- package/dist/sdk/test/runs.js +1 -1
- package/dist/sdk/test/trust.js +2 -2
- package/dist/sdk/test/update.js +1 -1
- package/dist/sdk/test/workspace-snapshot.js +1 -1
- package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
- package/dist/sdk/traceability/source-traceability.js +2 -2
- package/dist/sdk/tracker-root-discovery.js +1 -1
- package/dist/sdk/transactions/item-finalization.js +1 -1
- package/dist/sdk/workspace-contracts-cache.js +1 -1
- package/dist/sdk/workspace-contracts.js +1 -1
- package/dist/sdk/workspace-memory.js +2 -2
- package/dist/sdk/workspace-snapshot.js +5 -5
- package/dist/sdk/workspace-transaction-gc.js +1 -1
- package/dist/sdk/workspace-transaction.js +2 -2
- package/dist/sdk/workspace.js +6 -6
- package/dist/types/index.js +1 -1
- package/dist/types.js +1 -1
- package/docs/COMMANDS.md +1 -1
- package/docs/EXTENSIONS.md +1 -1
- package/docs/SDK.md +74 -4
- package/marketplace.json +1 -1
- package/package.json +2 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/scripts/finalize-build.mjs +63 -24
- package/scripts/prepare-build-cache.mjs +28 -1
- package/dist/cli-bundle/chunks/chunk-3W47ZZ5T.js +0 -9
- package/dist/cli-bundle/chunks/chunk-4TB5D6HL.js +0 -125
- package/dist/cli-bundle/chunks/chunk-5ZMVLWE3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-6BBDEIKC.js +0 -33
- package/dist/cli-bundle/chunks/chunk-AR4NP5HI.js +0 -3
- package/dist/cli-bundle/chunks/chunk-B4PPFOPY.js +0 -3
- package/dist/cli-bundle/chunks/chunk-CAR2L5NW.js +0 -8
- package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-EIGUKEV6.js +0 -2
- package/dist/cli-bundle/chunks/chunk-GTPCAJMZ.js +0 -8
- package/dist/cli-bundle/chunks/chunk-GYP24M7W.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HC2OPETM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HKUV74K3.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HXHYDO2R.js +0 -115
- package/dist/cli-bundle/chunks/chunk-IB7UB5TE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J2LABXBL.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J52BEBSS.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KQIZ34SF.js +0 -3
- package/dist/cli-bundle/chunks/chunk-LQBWLNZJ.js +0 -3
- package/dist/cli-bundle/chunks/chunk-OJTMGDON.js +0 -31
- package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +0 -2
- package/dist/cli-bundle/chunks/chunk-TC6XLIYO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-U7EL3AYA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-VQFWW4EF.js +0 -6
- package/dist/cli-bundle/chunks/chunk-X6MIWTTT.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XC5Q2ZV7.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XFHPKXAE.js +0 -71
- package/dist/cli-bundle/chunks/chunk-YHVLVSEZ.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YMUSRWV4.js +0 -9
- package/dist/cli-bundle/chunks/chunk-YR2KEBHP.js +0 -2
- package/dist/cli-bundle/chunks/context-budget-recovery-L2WP5S26.js +0 -2
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-ITTXIN4K.js +0 -4
- package/dist/cli-bundle/chunks/item-transaction-QY3PUHEI.js +0 -2
- package/dist/cli-bundle/chunks/mutation-actor-FWLYWJ37.js +0 -2
- package/dist/cli-bundle/chunks/mutation-admission-7ZDCK3G2.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-57AJQWFV.js +0 -21
- package/dist/cli-bundle/chunks/register-operations-RKWST7CU.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-CMI23PC5.js +0 -2
- package/dist/cli-bundle/chunks/settlement-hook-BXN5LEQD.js +0 -7
- package/dist/cli-bundle/chunks/stage-4KDVXC5Z.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-2ZD7275J.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-324AHXJO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3IRCYJI5.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-3V53UBHN.js +0 -9
- package/dist/cli-bundle/focused-chunks/chunk-3XSWH6QC.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-4JZITIJB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4KTFKSS3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5C5TK3ET.js +0 -78
- package/dist/cli-bundle/focused-chunks/chunk-AKJYOZZP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-BRZV7BFV.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-CR7CGEB2.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-GHQVM6K6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HDEKFSOK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IWOXAUDU.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ML3JHCC6.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-OPGOOP25.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-RE7ZWT7D.js +0 -27
- package/dist/cli-bundle/focused-chunks/chunk-RKQNVYGF.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-RQ252B6V.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-SVOOGGAK.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-URGHTTT3.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-USPYKWQG.js +0 -13
- package/dist/cli-bundle/focused-chunks/chunk-UWS3FC4D.js +0 -102
- package/dist/cli-bundle/focused-chunks/chunk-UXQGFGAT.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-WZWXGDYY.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-YKSLZPLT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZWJTY4ID.js +0 -2
- package/dist/cli-bundle/focused-chunks/context-budget-recovery-5MKOCGY5.js +0 -2
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-AF4U3F3D.js +0 -4
- package/dist/cli-bundle/focused-chunks/item-transaction-GLACUTPL.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-actor-TCYDPUGG.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-LY73EJWM.js +0 -2
- package/dist/cli-bundle/focused-chunks/settlement-hook-ARYCZQY4.js +0 -7
- package/dist/cli-bundle/focused-chunks/stage-DQ7RQQ52.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="85813255-48e1-5b53-913e-27d433c3ff45")}catch{}})();import{createRequire}from"node:module";import{resolvePmCliVersion}from"../packages/root.js";import{resolveTelemetryEnvironmentPolicy,resolveTelemetrySourceAttribution}from"../telemetry/policy.js";import{redactUrlCredentialsInText}from"../shared/url-credentials.js";import{isPmCliExpectedError}from"../../sdk/errors.js";import{crashReportErrorContext,omitEmbeddedPmCliErrorDetails}from"../shared/error-details.js";import{scrubInlineSensitiveAssignments,SENSITIVE_KEY_PATTERN}from"./sensitive-assignments.js";const OPT_OUT_VALUES=new Set(["1","true","yes","on"]);function isSentryDisabled(){return!!(OPT_OUT_VALUES.has((process.env.PM_SENTRY_DISABLED??"").trim().toLowerCase())||resolveTelemetryEnvironmentPolicy().telemetry_disabled||typeof process.env.VITEST=="string"||typeof process.env.VITEST_WORKER_ID=="string")}const ABSOLUTE_PATH_TOKEN_RE=/(^|[\s"'`(=])\/(?:[^\s"'`),;]+)/g,FILE_URL_PATH_RE=/file:\/\/\/?[^\s"'`),;]+/giu,WINDOWS_PATH_TOKEN_RE=/\b[A-Za-z]:\\[^\s"'`),;]+/g,PRIVATE_IP_RE=/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,PATH_FIELD_KEY_PATTERN=/(?:^|[_-])(path|filename|file|module|cwd|dir|directory|location|source|script)s?$/i,MAX_KNOWN_NOISY_CONSOLE_MESSAGE_PATTERNS=15,KNOWN_NOISY_CONSOLE_MESSAGE_PATTERNS=["[starter-extension] activating","[starter-extension] all 8 capabilities registered.","[starter-extension] commands:","[starter] preflight check for workspace","[starter] output_format service override active","[pm-ext-ts-starter] activating","[pm-ext-ts-starter] all capabilities registered.","run `pm init` first to initialise a pm workspace"];function looksLikeFilesystemPath(value){const normalized=value.trim();return normalized.length===0?!1:normalized.startsWith("/")||normalized.startsWith("file://")||/^[A-Za-z]:\\/.test(normalized)||normalized.startsWith("\\\\")?!0:normalized.includes("/home/")}function scrubString(value,keyHint){if(keyHint&&PATH_FIELD_KEY_PATTERN.test(keyHint)&&looksLikeFilesystemPath(value))return"[scrubbed_path]";const scrubbed=scrubInlineSensitiveAssignments(redactUrlCredentialsInText(value)).replaceAll(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/giu,"[scrubbed_email]").replaceAll(/bearer\s+[a-z0-9._=-]+/giu,"bearer [scrubbed]").replaceAll(/sntr[ysu]_[A-Za-z0-9_-]+/g,"[scrubbed_sentry_token]").replaceAll(PRIVATE_IP_RE,"[scrubbed_ip]").replaceAll(FILE_URL_PATH_RE,"[scrubbed_path]").replaceAll(WINDOWS_PATH_TOKEN_RE,"[scrubbed_path]").replaceAll(ABSOLUTE_PATH_TOKEN_RE,(_match,prefix)=>`${prefix}[scrubbed_path]`);return looksLikeFilesystemPath(scrubbed)?"[scrubbed_path]":scrubbed}function scrubEventData(obj){const result={};for(const[key,value]of Object.entries(obj))SENSITIVE_KEY_PATTERN.test(key)||key.startsWith("sentry.message.parameter.")?result[key]="[scrubbed]":typeof value=="string"?result[key]=scrubString(value,key):Array.isArray(value)?result[key]=value.map(entry=>typeof entry=="string"?scrubString(entry,key):entry&&typeof entry=="object"?scrubEventData(entry):entry):value&&typeof value=="object"?result[key]=scrubEventData(value):result[key]=value;return result}function scrubStackFrame(frame){for(const key of["filename","absPath","abs_path","module"]){const rawValue=frame[key];typeof rawValue=="string"&&(frame[key]=scrubString(rawValue,key))}const contextLine=frame.context_line;typeof contextLine=="string"&&(frame.context_line=scrubString(contextLine,"context_line"));for(const key of["pre_context","post_context"]){const context=frame[key];Array.isArray(context)&&(frame[key]=context.map(entry=>typeof entry=="string"?scrubString(entry,key):entry))}frame.vars&&typeof frame.vars=="object"&&(frame.vars=scrubEventData(frame.vars)),frame.data&&typeof frame.data=="object"&&(frame.data=scrubEventData(frame.data))}const requireFromInstrument=createRequire(import.meta.url),defaultSentryLoader=()=>requireFromInstrument("@sentry/node");let _sentry,_initDone=!1,_loadSentry=defaultSentryLoader;const PM_CLI_SENTRY_DSN="https://bf7ad2ec76c0051c2ee94e48e8bd6868@o4510603477712896.ingest.de.sentry.io/4511316775338064";function hasPmCliErrorPrefix(value){return/^\s*PmCliError:/.test(value)}function isKnownNoisyConsoleMessage(value){const normalized=value.trim().toLowerCase();return normalized.length===0?!1:KNOWN_NOISY_CONSOLE_MESSAGE_PATTERNS.some(pattern=>normalized.includes(pattern))}function isKnownNoisyConsoleEvent(event){return event.logger!=="console"?!1:typeof event.message=="string"&&isKnownNoisyConsoleMessage(event.message)?!0:Array.isArray(event.exception?.values)&&event.exception.values.some(entry=>typeof entry.value=="string"&&isKnownNoisyConsoleMessage(entry.value))}function isNodeRuntimeWarningEvent(event){if(event.logger!=="console")return!1;const isRuntimeWarning=value=>typeof value=="string"&&/^\(node:\d+\) MaxListenersExceededWarning: Possible EventEmitter memory leak detected\./.test(value);return isRuntimeWarning(event.message)?!0:Array.isArray(event.exception?.values)&&event.exception.values.some(entry=>isRuntimeWarning(entry.value))}function isExpectedCliErrorEvent(event,originalException){return originalException instanceof Error?isPmCliExpectedError(originalException):!!(event.exception?.values?.some(ex=>ex.type==="PmCliError")||event.exception?.values?.some(ex=>typeof ex.value=="string"&&hasPmCliErrorPrefix(ex.value))||event.logger==="console"&&typeof event.message=="string"&&hasPmCliErrorPrefix(event.message))}function isPmCliErrorBreadcrumb(breadcrumb){return breadcrumb.category==="console"&&typeof breadcrumb.message=="string"&&hasPmCliErrorPrefix(breadcrumb.message)}function isKnownNoisyConsoleBreadcrumb(breadcrumb){return breadcrumb.category==="console"&&typeof breadcrumb.message=="string"&&isKnownNoisyConsoleMessage(breadcrumb.message)}function resolveCliVersion(){return resolvePmCliVersion(import.meta.url,["../../.."])??"0.0.0"}function resolveEnvironment(){const explicit=process.env.SENTRY_ENVIRONMENT?.trim();if(explicit&&explicit.length>0)return explicit;if(process.env.VITEST||process.env.VITEST_WORKER_ID||process.env.NODE_ENV==="test")return"test";if(process.env.CI)return"ci";const source=resolveTelemetrySourceAttribution().source_context;return source==="user"?"production":source}const DEFAULT_TRACES_SAMPLE_RATE=.2;function resolveTracesSampleRate(){const raw=process.env.SENTRY_TRACES_SAMPLE_RATE?.trim();if(!raw)return DEFAULT_TRACES_SAMPLE_RATE;const parsed=Number(raw);return!Number.isFinite(parsed)||parsed<0||parsed>1?DEFAULT_TRACES_SAMPLE_RATE:parsed}function scrubSentryExceptionValues(event){if(event.exception?.values){for(const exception of event.exception.values)if(exception.value&&(exception.value=scrubString(exception.value,"value")),exception.stacktrace?.frames)for(const frame of exception.stacktrace.frames)scrubStackFrame(frame)}}function scrubSentryBreadcrumbs(event){if(event.breadcrumbs)for(const breadcrumb of event.breadcrumbs)breadcrumb.message&&(breadcrumb.message=scrubString(breadcrumb.message)),breadcrumb.data&&typeof breadcrumb.data=="object"&&(breadcrumb.data=scrubEventData(breadcrumb.data))}function scrubSentryContexts(event){if(event.contexts)for(const[ctxKey,ctx]of Object.entries(event.contexts))ctx&&typeof ctx=="object"&&(event.contexts[ctxKey]=scrubEventData(ctx))}function scrubSentryRecordField(event,key){const target=event,value=target[key];value&&typeof value=="object"&&(target[key]=scrubEventData(value))}function sourceContextEnvironment(source){if(!process.env.SENTRY_ENVIRONMENT?.trim()&&(source==="automation"||source==="test"||source==="dogfood"||source==="user"))return source==="user"?"production":source}function applySourceContextEnvironment(event){const environment=sourceContextEnvironment(event.tags?.["pm.source_context"]);environment&&(event.environment=environment)}function omitProducerDiagnostics(event,originalException){const ownErrorContext=readOwnErrorContextExtra(event.extra);omitEmbeddedPmCliErrorDetails([event.contexts,event.extra,event.breadcrumbs]),rebuildErrorDataContexts(event.contexts,originalException),ownErrorContext!==void 0&&(event.extra.error_context=crashReportErrorContext(ownErrorContext))}function readOwnErrorContextExtra(extra){if(!(typeof extra!="object"||extra===null||!Object.hasOwn(extra,"error_context")))return extra.error_context}function rebuildErrorDataContexts(contexts,originalException){if(typeof contexts!="object"||contexts===null||typeof originalException!="object"||originalException===null)return;const record=contexts,keys=new Set(errorDataContextKeys(originalException)),rebuilt=safeErrorDataEntry(originalException);for(const[key,entry]of Object.entries(record))(keys.has(key)||typeof entry=="object"&&entry!==null&&Object.hasOwn(entry,"context"))&&(record[key]=rebuilt??{})}function errorDataContextKeys(error){try{return[error.name,error.constructor?.name].filter(candidate=>typeof candidate=="string"&&candidate.length>0)}catch{return[]}}function safeErrorDataEntry(error){try{const entry=crashReportErrorContext(error),context=Object.getOwnPropertyDescriptor(error,"context");return context!==void 0&&"value"in context&&(entry.context=crashReportErrorContext(context.value)),entry}catch{return}}const beforeSend=(event,hint)=>{if(isExpectedCliErrorEvent(event,hint?.originalException)||isKnownNoisyConsoleEvent(event))return null;omitProducerDiagnostics(event,hint?.originalException),applySourceContextEnvironment(event),isNodeRuntimeWarningEvent(event)&&(event.level="warning",event.tags={...event.tags,"pm.diagnostic_class":"node_runtime_warning"}),event.message&&(event.message=scrubString(event.message,"message")),event.transaction&&(event.transaction=scrubString(event.transaction,"transaction")),scrubSentryExceptionValues(event),scrubSentryBreadcrumbs(event),scrubSentryRecordField(event,"extra"),scrubSentryContexts(event);for(const key of["request","user","tags"])scrubSentryRecordField(event,key);return event},beforeSendTransaction=event=>(omitProducerDiagnostics(event),applySourceContextEnvironment(event),event.breadcrumbs&&(event.breadcrumbs=event.breadcrumbs.filter(breadcrumb=>!isPmCliErrorBreadcrumb(breadcrumb)&&!isKnownNoisyConsoleBreadcrumb(breadcrumb)),scrubSentryBreadcrumbs(event)),scrubSentryContexts(event),event),beforeSendSpan=span=>scrubEventData(span),beforeSendLog=log=>{if(log.message=scrubString(log.message),log.attributes){const environment=sourceContextEnvironment(log.attributes["pm.source_context"]);environment&&(log.attributes["sentry.environment"]=environment),log.attributes=scrubEventData(log.attributes)}return log};function applySerializedLogEnvironment(attributes){const environment=sourceContextEnvironment(attributes["pm.source_context"]?.value);environment&&(attributes["sentry.environment"]={type:"string",value:environment})}function scrubSentryLogEnvelope(envelope){for(const item of envelope[1])if(item[0].type==="log")for(const log of item[1].items){log.body=scrubString(log.body);const attributes=log.attributes;if(attributes){applySerializedLogEnvironment(attributes);for(const[key,attribute]of Object.entries(attributes)){const value=scrubEventData({[key]:attribute.value})[key];typeof value=="string"&&(attributes[key]={type:"string",value})}}}}const beforeBreadcrumb=breadcrumb=>isPmCliErrorBreadcrumb(breadcrumb)||isKnownNoisyConsoleBreadcrumb(breadcrumb)?null:(breadcrumb.message&&(breadcrumb.message=scrubString(breadcrumb.message,"message")),breadcrumb.data&&typeof breadcrumb.data=="object"&&(breadcrumb.data=scrubEventData(breadcrumb.data)),breadcrumb);async function ensureSentryInit(){if(_initDone)return _sentry;if(_initDone=!0,isSentryDisabled())return;const SentryModule=_loadSentry(),dsn=process.env.SENTRY_DSN?.trim()||PM_CLI_SENTRY_DSN,release=resolveCliVersion();SentryModule.init({dsn,release:`pm-cli@${release}`,environment:resolveEnvironment(),tracesSampleRate:resolveTracesSampleRate(),enableLogs:!0,attachStacktrace:!0,normalizeDepth:6,shutdownTimeout:3e3,traceLifecycle:"stream",dataCollection:{userInfo:!1,cookies:!1,httpHeaders:{request:!1,response:!1},httpBodies:[],urlQueryParams:!1,genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,graphQL:{document:!1,variables:!1},stackFrameVariables:!1,frameContextLines:0},serverName:void 0,integrations:[SentryModule.extraErrorDataIntegration({depth:4,captureErrorCause:!1}),SentryModule.captureConsoleIntegration({levels:["warn","error"]})],initialScope:{tags:{"cli.name":"pm-cli","cli.version":release,"runtime.node":process.version,"runtime.platform":process.platform,"runtime.arch":process.arch}},beforeSend,beforeSendTransaction,beforeSendSpan:SentryModule.withStreamedSpan(beforeSendSpan),beforeSendLog,beforeBreadcrumb});const client=SentryModule.getClient();if(!client)return;const attribution=resolveTelemetrySourceAttribution();return SentryModule.setTags({"pm.version":release,"pm.source_context":attribution.source_context,"pm.source_context_source":attribution.source_context_source}),SentryModule.setAttribute("pm.source_context",attribution.source_context),client.on("beforeEnvelope",scrubSentryLogEnvelope),_sentry=SentryModule,SentryModule}async function ensureSentryCommandTracing(telemetryEnabled){if(telemetryEnabled!==!0||!OPT_OUT_VALUES.has((process.env.PM_SENTRY_TRACE_COMMANDS??"").trim().toLowerCase())||resolveTracesSampleRate()===0||isSentryDisabled())return!1;try{return await ensureSentryInit()!==void 0}catch{return _sentry=void 0,!1}}function getSentry(){return _sentry}const _testOnly={isExpectedCliErrorEvent,isKnownNoisyConsoleEvent,isNodeRuntimeWarningEvent,isPmCliErrorBreadcrumb,isKnownNoisyConsoleBreadcrumb,scrubString,scrubEventData,resolveTracesSampleRate,KNOWN_NOISY_CONSOLE_MESSAGE_PATTERNS,MAX_KNOWN_NOISY_CONSOLE_MESSAGE_PATTERNS,defaultSentryLoader,setSentryLoaderForTests(loader){_loadSentry=loader??defaultSentryLoader},resetSentryStateForTests(){_sentry=void 0,_initDone=!1}};export{_testOnly,ensureSentryCommandTracing,ensureSentryInit,getSentry};
|
|
1
|
+
import{createRequire as D}from"node:module";import{resolvePmCliVersion as j}from"../packages/root.js";import{resolveTelemetryEnvironmentPolicy as k,resolveTelemetrySourceAttribution as b}from"../telemetry/policy.js";import{redactUrlCredentialsInText as M}from"../shared/url-credentials.js";import{isPmCliExpectedError as V}from"../../sdk/errors.js";import{crashReportErrorContext as f,omitEmbeddedPmCliErrorDetails as K}from"../shared/error-details.js";import{scrubInlineSensitiveAssignments as W,SENSITIVE_KEY_PATTERN as F}from"./sensitive-assignments.js";const S=new Set(["1","true","yes","on"]);function x(){return!!(S.has((process.env.PM_SENTRY_DISABLED??"").trim().toLowerCase())||k().telemetry_disabled||typeof process.env.VITEST=="string"||typeof process.env.VITEST_WORKER_ID=="string")}const Y=/(^|[\s"'`(=])\/(?:[^\s"'`),;]+)/g,z=/file:\/\/\/?[^\s"'`),;]+/giu,B=/\b[A-Za-z]:\\[^\s"'`),;]+/g,U=/\b(?:10\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|172\.(?:1[6-9]|2\d|3[01])\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.(?:25[0-5]|2[0-4]\d|[01]?\d?\d))\b/g,Z=/(?:^|[_-])(path|filename|file|module|cwd|dir|directory|location|source|script)s?$/i,q=15,T=["[starter-extension] activating","[starter-extension] all 8 capabilities registered.","[starter-extension] commands:","[starter] preflight check for workspace","[starter] output_format service override active","[pm-ext-ts-starter] activating","[pm-ext-ts-starter] all capabilities registered.","run `pm init` first to initialise a pm workspace"];function A(e){const t=e.trim();return t.length===0?!1:t.startsWith("/")||t.startsWith("file://")||/^[A-Za-z]:\\/.test(t)||t.startsWith("\\\\")?!0:t.includes("/home/")}function o(e,t){if(t&&Z.test(t)&&A(e))return"[scrubbed_path]";const r=W(M(e)).replaceAll(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/giu,"[scrubbed_email]").replaceAll(/bearer\s+[a-z0-9._=-]+/giu,"bearer [scrubbed]").replaceAll(/sntr[ysu]_[A-Za-z0-9_-]+/g,"[scrubbed_sentry_token]").replaceAll(U,"[scrubbed_ip]").replaceAll(z,"[scrubbed_path]").replaceAll(B,"[scrubbed_path]").replaceAll(Y,(n,s)=>`${s}[scrubbed_path]`);return A(r)?"[scrubbed_path]":r}function i(e){const t={};for(const[r,n]of Object.entries(e))F.test(r)||r.startsWith("sentry.message.parameter.")?t[r]="[scrubbed]":typeof n=="string"?t[r]=o(n,r):Array.isArray(n)?t[r]=n.map(s=>typeof s=="string"?o(s,r):s&&typeof s=="object"?i(s):s):n&&typeof n=="object"?t[r]=i(n):t[r]=n;return t}function H(e){for(const r of["filename","absPath","abs_path","module"]){const n=e[r];typeof n=="string"&&(e[r]=o(n,r))}const t=e.context_line;typeof t=="string"&&(e.context_line=o(t,"context_line"));for(const r of["pre_context","post_context"]){const n=e[r];Array.isArray(n)&&(e[r]=n.map(s=>typeof s=="string"?o(s,r):s))}e.vars&&typeof e.vars=="object"&&(e.vars=i(e.vars)),e.data&&typeof e.data=="object"&&(e.data=i(e.data))}const Q=D(import.meta.url),l=()=>Q("@sentry/node");let c,p=!1,h=l;const $="https://bf7ad2ec76c0051c2ee94e48e8bd6868@o4510603477712896.ingest.de.sentry.io/4511316775338064";function d(e){return/^\s*PmCliError:/.test(e)}function m(e){const t=e.trim().toLowerCase();return t.length===0?!1:T.some(r=>t.includes(r))}function N(e){return e.logger!=="console"?!1:typeof e.message=="string"&&m(e.message)?!0:Array.isArray(e.exception?.values)&&e.exception.values.some(t=>typeof t.value=="string"&&m(t.value))}function C(e){if(e.logger!=="console")return!1;const t=r=>typeof r=="string"&&/^\(node:\d+\) MaxListenersExceededWarning: Possible EventEmitter memory leak detected\./.test(r);return t(e.message)?!0:Array.isArray(e.exception?.values)&&e.exception.values.some(r=>t(r.value))}function R(e,t){return t instanceof Error?V(t):!!(e.exception?.values?.some(r=>r.type==="PmCliError")||e.exception?.values?.some(r=>typeof r.value=="string"&&d(r.value))||e.logger==="console"&&typeof e.message=="string"&&d(e.message))}function _(e){return e.category==="console"&&typeof e.message=="string"&&d(e.message)}function y(e){return e.category==="console"&&typeof e.message=="string"&&m(e.message)}function G(){return j(import.meta.url,["../../.."])??"0.0.0"}function X(){const e=process.env.SENTRY_ENVIRONMENT?.trim();if(e&&e.length>0)return e;if(process.env.VITEST||process.env.VITEST_WORKER_ID||process.env.NODE_ENV==="test")return"test";if(process.env.CI)return"ci";const t=b().source_context;return t==="user"?"production":t}const O=.2;function g(){const e=process.env.SENTRY_TRACES_SAMPLE_RATE?.trim();if(!e)return O;const t=Number(e);return!Number.isFinite(t)||t<0||t>1?O:t}function J(e){if(e.exception?.values){for(const t of e.exception.values)if(t.value&&(t.value=o(t.value,"value")),t.stacktrace?.frames)for(const r of t.stacktrace.frames)H(r)}}function P(e){if(e.breadcrumbs)for(const t of e.breadcrumbs)t.message&&(t.message=o(t.message)),t.data&&typeof t.data=="object"&&(t.data=i(t.data))}function v(e){if(e.contexts)for(const[t,r]of Object.entries(e.contexts))r&&typeof r=="object"&&(e.contexts[t]=i(r))}function I(e,t){const r=e,n=r[t];n&&typeof n=="object"&&(r[t]=i(n))}function E(e){if(!process.env.SENTRY_ENVIRONMENT?.trim()&&(e==="automation"||e==="test"||e==="dogfood"||e==="user"))return e==="user"?"production":e}function L(e){const t=E(e.tags?.["pm.source_context"]);t&&(e.environment=t)}function w(e,t){const r=ee(e.extra);K([e.contexts,e.extra,e.breadcrumbs]),te(e.contexts,t),r!==void 0&&(e.extra.error_context=f(r))}function ee(e){if(!(typeof e!="object"||e===null||!Object.hasOwn(e,"error_context")))return e.error_context}function te(e,t){if(typeof e!="object"||e===null||typeof t!="object"||t===null)return;const r=e,n=new Set(re(t)),s=ne(t);for(const[u,a]of Object.entries(r))(n.has(u)||typeof a=="object"&&a!==null&&Object.hasOwn(a,"context"))&&(r[u]=s??{})}function re(e){try{return[e.name,e.constructor?.name].filter(r=>typeof r=="string"&&r.length>0)}catch{return[]}}function ne(e){try{const t=f(e),r=Object.getOwnPropertyDescriptor(e,"context");return r!==void 0&&"value"in r&&(t.context=f(r.value)),t}catch{return}}const se=(e,t)=>{if(R(e,t?.originalException)||N(e))return null;w(e,t?.originalException),L(e),C(e)&&(e.level="warning",e.tags={...e.tags,"pm.diagnostic_class":"node_runtime_warning"}),e.message&&(e.message=o(e.message,"message")),e.transaction&&(e.transaction=o(e.transaction,"transaction")),J(e),P(e),I(e,"extra"),v(e);for(const r of["request","user","tags"])I(e,r);return e},oe=e=>(w(e),L(e),e.breadcrumbs&&(e.breadcrumbs=e.breadcrumbs.filter(t=>!_(t)&&!y(t)),P(e)),v(e),e),ie=e=>i(e),ae=e=>{if(e.message=o(e.message),e.attributes){const t=E(e.attributes["pm.source_context"]);t&&(e.attributes["sentry.environment"]=t),e.attributes=i(e.attributes)}return e};function ce(e){const t=E(e["pm.source_context"]?.value);t&&(e["sentry.environment"]={type:"string",value:t})}function ue(e){for(const t of e[1])if(t[0].type==="log")for(const r of t[1].items){r.body=o(r.body);const n=r.attributes;if(n){ce(n);for(const[s,u]of Object.entries(n)){const a=i({[s]:u.value})[s];typeof a=="string"&&(n[s]={type:"string",value:a})}}}}const fe=e=>_(e)||y(e)?null:(e.message&&(e.message=o(e.message,"message")),e.data&&typeof e.data=="object"&&(e.data=i(e.data)),e);async function le(){if(p)return c;if(p=!0,x())return;const e=h(),t=process.env.SENTRY_DSN?.trim()||$,r=G();e.init({dsn:t,release:`pm-cli@${r}`,environment:X(),tracesSampleRate:g(),enableLogs:!0,attachStacktrace:!0,normalizeDepth:6,shutdownTimeout:3e3,traceLifecycle:"stream",dataCollection:{userInfo:!1,cookies:!1,httpHeaders:{request:!1,response:!1},httpBodies:[],urlQueryParams:!1,genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,graphQL:{document:!1,variables:!1},stackFrameVariables:!1,frameContextLines:0},serverName:void 0,integrations:[e.extraErrorDataIntegration({depth:4,captureErrorCause:!1}),e.captureConsoleIntegration({levels:["warn","error"]})],initialScope:{tags:{"cli.name":"pm-cli","cli.version":r,"runtime.node":process.version,"runtime.platform":process.platform,"runtime.arch":process.arch}},beforeSend:se,beforeSendTransaction:oe,beforeSendSpan:e.withStreamedSpan(ie),beforeSendLog:ae,beforeBreadcrumb:fe});const n=e.getClient();if(!n)return;const s=b();return e.setTags({"pm.version":r,"pm.source_context":s.source_context,"pm.source_context_source":s.source_context_source}),e.setAttribute("pm.source_context",s.source_context),n.on("beforeEnvelope",ue),c=e,e}async function be(e){if(e!==!0||!S.has((process.env.PM_SENTRY_TRACE_COMMANDS??"").trim().toLowerCase())||g()===0||x())return!1;try{return await le()!==void 0}catch{return c=void 0,!1}}function Se(){return c}const xe={isExpectedCliErrorEvent:R,isKnownNoisyConsoleEvent:N,isNodeRuntimeWarningEvent:C,isPmCliErrorBreadcrumb:_,isKnownNoisyConsoleBreadcrumb:y,scrubString:o,scrubEventData:i,resolveTracesSampleRate:g,KNOWN_NOISY_CONSOLE_MESSAGE_PATTERNS:T,MAX_KNOWN_NOISY_CONSOLE_MESSAGE_PATTERNS:q,defaultSentryLoader:l,setSentryLoaderForTests(e){h=e??l},resetSentryStateForTests(){c=void 0,p=!1}};export{xe as _testOnly,be as ensureSentryCommandTracing,le as ensureSentryInit,Se as getSentry};
|
|
2
2
|
//# sourceMappingURL=instrument.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const u=/(?:token|secret|password|passwd|api[_-]?key|apikey|authorization|cookie|credentials|bearer|dsn)/i,a=new RegExp(`(?:\\b|(?<=_))(${u.source})\\s*[:=]\\s*([^\\s,;]+)`,"giu");function d(e,i,s){let t=i;for(;t>0&&e[t-1]==="\\";)t--;const n=s.length>1;if(n&&t===i)return;let c=n?(i-t)*2:i-t+1,o=1;for(;c%2===0;)o*=2,c/=2;const r=n?String.fromCharCode(Number.parseInt(s.slice(1),16)):s;return{index:t,end:i+s.length,identity:`${r}:${o}`,character:r,width:o}}function h(e,i){const s=/["']|u(?:0022|0027)/gi;s.lastIndex=i.end;for(const t of e.matchAll(s)){const n=d(e,t.index,t[0]);if(n?.identity===i.identity)return n.end}return e.length}function l(e,i,s,t){const n=e.pop();return n.character!==i.character||n.width!==i.width?t:e.length===0?s:void 0}function g(e,i){const s=[{character:i.character==="{"?"}":"]",width:i.width}],t=/["'{}[\]]|u(?:0022|0027|007b|007d|005b|005d)/gi;t.lastIndex=i.end;let n;for(;(n=t.exec(e))!==null;){const c=d(e,n.index,n[0]);if(!c)continue;const o=c.character;if(o==="{"||o==="["){s.push({character:o==="{"?"}":"]",width:c.width});continue}if(o==="}"||o==="]"){const r=l(s,c,c.end,e.length);if(r!==void 0)return r;continue}t.lastIndex=h(e,c)}return e.length}function m(e,i,s){const t=/^(\\*)(["'{[]|u(?:0022|0027|007b|005b))/i.exec(e.slice(i)),n=t?d(e,i+t[1].length,t[2]):void 0;return n?.character==="{"||n?.character==="["?g(e,n):n?h(e,n):s}function p(e){const i=[];let s=0;for(const t of e.matchAll(/u([\da-f]{4})/gi)){let n=t.index;for(;n>s&&e[n-1]==="\\";)n--;n!==t.index&&(i.push(e.slice(s,n),String.fromCharCode(Number.parseInt(t[1],16))),s=t.index+t[0].length)}return i.push(e.slice(s)),i.join("")}const f="(?:\\s|\\\\+u(?:0009|000a|000d|0020))*",x=new RegExp("^"+f+"(?::|=|\\\\+u(?:003a|003d))"+f,"iu");function E(e,i,s){const t=p(i);if(!u.test(t)&&!/\\u/iu.test(t))return;const n=e.slice(s),c=x.exec(n);if(!c)return/^\s*\\+u/iu.test(n)?{index:s,start:s,unquotedEnd:e.length,replacement:"[scrubbed]"}:void 0;const o=s+c[0].length,r=/^[^\s,;]+/u.exec(e.slice(o));return r?{index:o,start:o,unquotedEnd:o+r[0].length,replacement:"[scrubbed]"}:void 0}function I(e){const i=new Map,s=[];for(const t of e.matchAll(/["']|u(?:0022|0027)/gi)){const n=d(e,t.index,t[0]);if(!n)continue;const c=i.get(n.identity),o=n.end;if(i.set(n.identity,o),c===void 0)continue;const r=E(e,e.slice(c,n.index),o);r&&s.push(r)}return s}function w(e){const i=I(e);for(const n of e.matchAll(a)){const c=n.index+n[0].length;i.push({index:n.index,start:c-n[2].length,unquotedEnd:c,replacement:`${n[1]}=[scrubbed]`})}i.sort((n,c)=>n.index-c.index);const s=[];let t=0;for(const n of i)n.index<t||(s.push(e.slice(t,n.index),n.replacement),t=m(e,n.start,n.unquotedEnd));return s.push(e.slice(t)),s.join("")}export{u as SENSITIVE_KEY_PATTERN,w as scrubInlineSensitiveAssignments};
|
|
2
2
|
//# sourceMappingURL=sensitive-assignments.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{createHash as y}from"node:crypto";import{existsSync as d,promises as v,readFileSync as I}from"node:fs";import s from"node:path";import{writeFileAtomic as w}from"../fs/fs-utils.js";import{acquireLockLease as j}from"../lock/lock.js";import{SETTINGS_DEFAULTS as h}from"../shared/constants.js";import{getRuntimePath as x}from"../store/paths.js";const k="session.json";function u(e,t){return typeof e=="string"&&e.length>0&&e.length<=t}function S(e){if(e===null||typeof e!="object"||Array.isArray(e))return;const t=e,n=["implementer","planner","release-operator"].includes(String(t.role)),o=["high","medium"].includes(String(t.confidence)),i=u(t.topic,256),r=Array.isArray(t.evidence)&&t.evidence.length<=32&&t.evidence.every(a=>typeof a=="string"&&a.length<=128),c=Array.isArray(t.active_item_ids)&&t.active_item_ids.length<=64&&t.active_item_ids.every(a=>u(a,128)),A=t.focused_item_id===void 0||u(t.focused_item_id,128);if([n,o,i,r,c,A,t.rule_version==="v2"].every(Boolean))return t}function $(e){if(e===null||typeof e!="object"||Array.isArray(e))return;const t=Object.entries(e).slice(0,128).flatMap(([n,o])=>{const i=S(o);return i&&n.length<=128?[[n,i]]:[]});return t.length>0?Object.fromEntries(t):void 0}function f(e){return s.join(x(e),k)}async function b(e){try{const t=await v.readFile(f(e),"utf8"),n=JSON.parse(t);if(n===null||typeof n!="object"||Array.isArray(n))return{};const o=n,i=o.focused_item,r=$(o.semantic_attribution);return typeof i=="string"&&i.trim().length>0?{focused_item:i,...r?{semantic_attribution:r}:{}}:r?{semantic_attribution:r}:{}}catch{return{}}}async function m(e,t){const n=await j(e,"session-state",h.locks.ttl_seconds,"session-state",!1,!1,h.locks.wait_ms);try{const o=await b(e);t(o);const i=f(e);await n.fence(async()=>{await v.mkdir(s.dirname(i),{recursive:!0}),await w(i,JSON.stringify(o))})}finally{await n.release()}}function l(e){return/#([a-f0-9]{24})$/u.exec(e.trim())?.[1]??`author-${y("sha256").update(e).digest("hex").slice(0,24)}`}function p(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))].slice(0,32).map(t=>t.slice(0,128))}function _(e){const t=[...new Set(e)].sort((i,r)=>i.localeCompare(r));if(t.length===1)return t[0];const n=`workset:${t.join("+")}`;return n.length<=256?n:`workset:${t.join("+").slice(0,230)}+${y("sha256").update(t.join("\0")).digest("hex").slice(0,12)}`}async function g(e,t,n){await m(e,o=>{const i={...o.semantic_attribution},r=n(i[t]);r===void 0?delete i[t]:i[t]=r,Object.keys(i).length===0?delete o.semantic_attribution:o.semantic_attribution=i})}async function M(e){const t=l(e.principal);await g(e.pmRoot,t,n=>{const o=[...new Set([...n?.active_item_ids??[],e.itemId])].slice(-64).sort((r,c)=>r.localeCompare(c)),i=n?.focused_item_id;return{role:"implementer",topic:i??_(o),confidence:i?"high":"medium",rule_version:"v2",evidence:p([...o.map(r=>`claim:${r}`),...i?[`focus:${i}`]:[],...(e.lineageIds??[]).map(r=>`lineage:${r}`)]),active_item_ids:o,...i?{focused_item_id:i}:{}}})}async function P(e){const t=l(e.principal);await g(e.pmRoot,t,n=>{if(!n)return;const o=n.active_item_ids.filter(r=>r!==e.itemId);if(o.length===0&&!n.focused_item_id)return;const i=n.focused_item_id;return{...n,role:"release-operator",topic:i??_(o),confidence:i?"high":"medium",evidence:p([...o.map(r=>`claim:${r}`),...i?[`focus:${i}`]:[],`release:${e.itemId}`]),active_item_ids:o}})}async function B(e){const t=l(e.principal);await g(e.pmRoot,t,n=>{const o=n?.active_item_ids??[];if(!e.itemId&&o.length===0)return;const i=e.itemId;return{role:i?"planner":n.role,topic:i??_(o),confidence:i?"high":"medium",rule_version:"v2",evidence:p([...o.map(r=>`claim:${r}`),...i?[`focus:${i}`]:[],...(e.lineageIds??[]).map(r=>`lineage:${r}`)]),active_item_ids:o,...i?{focused_item_id:i}:{}}})}function F(e,t){const n=t.PM_PATH?.trim();if(n){const i=s.resolve(e,n);if(d(s.join(i,"settings.json")))return i;const r=s.join(i,".agents","pm");if(d(s.join(r,"settings.json")))return r}let o=s.resolve(e);for(let i=0;i<32;i+=1){const r=s.join(o,".agents","pm");if(d(s.join(r,"settings.json")))return r;const c=s.dirname(o);if(c===o)break;o=c}}function J(e){if(!e.key)return;const t=F(e.cwd,e.env);if(t)try{const n=JSON.parse(I(f(t),"utf8"));return S(n.semantic_attribution?.[e.key])}catch{return}}async function W(e){return(await b(e)).focused_item}async function H(e,t){await m(e,n=>{n.focused_item=t})}async function q(e){await m(e,t=>{delete t.focused_item})}export{q as clearFocusedItem,W as getFocusedItem,f as getSessionStatePath,J as readAgentSemanticAttributionSync,b as readSessionState,M as recordClaimedWorkAttribution,B as recordFocusedWorkAttribution,P as releaseClaimedWorkAttribution,l as semanticAttributionKey,H as setFocusedItem};
|
|
2
2
|
//# sourceMappingURL=session-state.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{AsyncLocalStorage as E}from"node:async_hooks";const f=new E,p=/^[A-Za-z0-9](?:[A-Za-z0-9._:-]{0,127})$/u;function u(n,e){const t=typeof n=="string"?n.trim():"";return t.length>0?t.slice(0,e):void 0}function r(n,e){if(n===void 0)return;const t=typeof n=="object"&&n!==null?n:{},i=u(t.id,128),o=u(t.parent_id,128);if(i===void 0||!p.test(i)||o!==void 0&&!p.test(o)){if(e)throw new Error("Agent episode ids must be 1-128 letters, digits, dots, underscores, colons, or hyphens.");return}const d=u(t.label,256);return{id:i,...d===void 0?{}:{label:d},...o===void 0?{}:{parent_id:o}}}function c(n){const e={};for(const[t,i]of Object.entries(n??{}).slice(0,32)){const o=t.trim().toLowerCase().slice(0,64),d=u(i,256);/^[a-z][a-z0-9_-]{0,63}$/u.test(o)&&d!==void 0&&(e[o]=d)}return e}function a(n,e,t){const i=f.getStore(),o=c({role:e.PM_AGENT_SESSION_ROLE,topic:e.PM_AGENT_SESSION_TOPIC}),d=r(e.PM_AGENT_EPISODE_ID===void 0?void 0:{id:e.PM_AGENT_EPISODE_ID,label:e.PM_AGENT_EPISODE_LABEL,parent_id:e.PM_AGENT_EPISODE_PARENT_ID},!1),s={...c(i?.provenance),...o,...c(n?.provenance)},_=r(n?.episode,!1)??r(t,!1)??d??r(i?.episode,!1);return Object.keys(s).length===0&&_===void 0?void 0:{...Object.keys(s).length===0?{}:{provenance:s},..._===void 0?{}:{episode:_}}}function S(n,e){return a(n.session_context,e,n.client_info?.episode)??{}}function P(n,e){const t=f.getStore(),i=r(n.episode,!0),o=r(t?.episode,!1),d=i!==void 0&&i.parent_id===void 0&&o!==void 0?{...i,parent_id:o.id}:i,s={...c(t?.provenance),...c(n.provenance)};return f.run({...Object.keys(s).length===0?{}:{provenance:s},...d===void 0?o===void 0?{}:{episode:o}:{episode:d}},e)}function A(n){const e=c(n.provenance),t=r(n.episode,!0);return{...t===void 0?{}:{PM_AGENT_EPISODE_ID:t.id,...t.label===void 0?{}:{PM_AGENT_EPISODE_LABEL:t.label},...t.parent_id===void 0?{}:{PM_AGENT_EPISODE_PARENT_ID:t.parent_id}},...e.role===void 0?{}:{PM_AGENT_SESSION_ROLE:e.role},...e.topic===void 0?{}:{PM_AGENT_SESSION_TOPIC:e.topic}}}export{A as agentSessionEnvironment,r as boundAgentEpisodeIdentity,a as resolveAgentSessionContext,S as resolveAgentSessionContextFromSignals,P as runWithAgentSessionContext};
|
|
2
2
|
//# sourceMappingURL=agent-session-context.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1ea9ada3-1c97-5787-9b6c-08aeaf825394")}catch{}})();import{AsyncLocalStorage}from"node:async_hooks";import{createHash}from"node:crypto";import fs from"node:fs";import os from"node:os";import path from"node:path";import{resolveAgentSessionContextFromSignals}from"./agent-session-context.js";import{readAgentSemanticAttributionSync}from"../session/session-state.js";import{isFileAbsentError}from"../fs/fs-utils.js";import{assertIdentityWithoutUrlCredentials}from"./url-credentials.js";const AGENT_PROVENANCE_DIMENSIONS=["model","effort","role","topic","version"],authorIdentityStorage=new AsyncLocalStorage,harnessDetectionStorage=new AsyncLocalStorage,workspaceHarnessSignalsStorage=new AsyncLocalStorage,BUILTIN_HARNESS_SIGNAL_DESCRIPTORS=[{harness:"claude-code",environment_keys:["CLAUDE_CODE","CLAUDECODE"],model_environment_keys:["ANTHROPIC_MODEL","CLAUDE_MODEL"],session_environment_keys:["CLAUDE_CODE_SESSION_ID"],provenance_environment_keys:{effort:["CLAUDE_EFFORT"]},provenance_resolvers:{model:"claude_session_file",version:"claude_session_file"},provenance_unavailable_dimensions:["role","topic"],argv_markers:["claude","claude-code"],client_names:["claude","claude-code","claude code"]},{harness:"codex",environment_keys:["CODEX_HOME","CODEX_CI","CODEX_THREAD_ID"],model_environment_keys:["CODEX_MODEL"],session_environment_keys:["CODEX_THREAD_ID"],provenance_environment_keys:{effort:["CODEX_REASONING_EFFORT","CODEX_EFFORT"],role:["CODEX_SESSION_ROLE"]},provenance_resolvers:{model:"codex_session_file",effort:"codex_session_file",version:"ai_agent_version"},provenance_unavailable_dimensions:["topic"],argv_markers:["codex"],client_names:["codex"]},{harness:"pi",environment_keys:["PI_AGENT","PI_CODING_AGENT"],model_environment_keys:["PI_MODEL"],session_environment_keys:["PI_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["pi"],client_names:["pi"]},{harness:"opencode",environment_keys:["OPENCODE","OPENCODE_SESSION_ID"],model_environment_keys:["OPENCODE_MODEL"],session_environment_keys:["OPENCODE_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["opencode"],client_names:["opencode"]},{harness:"cursor",environment_keys:["CURSOR_AGENT","CURSOR_TRACE_ID"],model_environment_keys:["CURSOR_MODEL"],session_environment_keys:["CURSOR_TRACE_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["cursor"],client_names:["cursor"]},{harness:"aider",environment_keys:["AIDER","AIDER_MODEL"],model_environment_keys:["AIDER_MODEL"],session_environment_keys:["AIDER_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["aider"],client_names:["aider"]},{harness:"gemini-cli",environment_keys:["GEMINI_CLI","GEMINI_CLI_HOME"],model_environment_keys:["GEMINI_MODEL"],session_environment_keys:["GEMINI_CLI_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["gemini","gemini-cli"],client_names:["gemini","gemini-cli","gemini cli"]},{harness:"ci",environment_keys:["CI","GITHUB_ACTIONS","BUILDKITE","GITLAB_CI"],provenance_unavailable_dimensions:["model","effort","role","topic"],argv_markers:[],client_names:[]}],PROVENANCE_PROBE_POLICY=Object.freeze({max_bytes:1048576,max_lines:4096,network_access:!1,subprocess_access:!1}),CODEX_PROVENANCE_PROBE_POLICY=Object.freeze({...PROVENANCE_PROBE_POLICY,max_bytes:4194304}),HARNESS_NAMESPACE_PATTERN=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function buildBuiltinProvenanceAdapter(descriptor){const unavailableDimensions=normalizeHarnessSignalDescriptor(descriptor).provenance_unavailable_dimensions,dimensions=new Set(["model","version",...Object.keys(descriptor.provenance_environment_keys??{}),...Object.keys(descriptor.provenance_resolvers??{})]);return Object.freeze({contract_version:1,adapter_version:"v1",priority:0,harness:descriptor.harness,descriptor,supported_dimensions:Object.freeze([...dimensions].sort()),native_sources:Object.freeze(["environment","argv","mcp_client",...Object.values(descriptor.provenance_resolvers??{}).some(resolver=>resolver?.endsWith("session_file"))?["session_file"]:[]]),probe_policy:descriptor.harness==="codex"?CODEX_PROVENANCE_PROBE_POLICY:PROVENANCE_PROBE_POLICY,normalization:Object.freeze({model_family:"v1",effort:"v1",preserve_raw:!0}),confidence:"high",waivers:Object.freeze(Object.fromEntries(unavailableDimensions.map(dimension=>[dimension,"Harness does not expose this dimension."])))})}const BUILTIN_AGENT_PROVENANCE_ADAPTERS=Object.freeze(BUILTIN_HARNESS_SIGNAL_DESCRIPTORS.filter(descriptor=>descriptor.harness!=="ci").map(buildBuiltinProvenanceAdapter).sort((left,right)=>left.harness.localeCompare(right.harness))),registeredAgentProvenanceAdapters=new Map,registeredHarnessSignalDescriptors=new Map;function nonBlank(value){const trimmed=typeof value=="string"?value.trim():void 0;return trimmed&&trimmed.length>0?trimmed:void 0}function boundedUniqueStrings(values){return[...new Set((values??[]).slice(0,64).map(value=>value.trim()).filter(value=>value.length>0).map(value=>value.slice(0,128)))]}function normalizeHarnessSignalDescriptor(descriptor){const harness=descriptor.harness.trim().toLowerCase();if(!HARNESS_NAMESPACE_PATTERN.test(harness))throw new Error(`Invalid harness signal descriptor namespace: ${descriptor.harness}`);return{harness,environment_keys:boundedUniqueStrings(descriptor.environment_keys),model_environment_keys:boundedUniqueStrings(descriptor.model_environment_keys),session_environment_keys:boundedUniqueStrings(descriptor.session_environment_keys),provenance_environment_keys:Object.fromEntries(Object.entries(descriptor.provenance_environment_keys??{}).slice(0,32).map(([dimension,keys])=>[dimension.trim().toLowerCase().slice(0,64),boundedUniqueStrings(keys)]).filter(([dimension])=>HARNESS_NAMESPACE_PATTERN.test(dimension))),provenance_resolvers:Object.fromEntries(Object.entries(descriptor.provenance_resolvers??{}).slice(0,32).map(([dimension,resolver])=>[dimension.trim().toLowerCase().slice(0,64),resolver]).filter(entry=>typeof entry[0]=="string"&&HARNESS_NAMESPACE_PATTERN.test(entry[0])&&(entry[1]==="ai_agent_version"||entry[1]==="claude_session_file"||entry[1]==="codex_session_file"))),provenance_unavailable_dimensions:boundedUniqueStrings(descriptor.provenance_unavailable_dimensions).map(value=>value.toLowerCase()),argv_markers:boundedUniqueStrings(descriptor.argv_markers).map(value=>value.toLowerCase()),client_names:boundedUniqueStrings(descriptor.client_names).map(value=>value.toLowerCase())}}const NORMALIZED_BUILTIN_HARNESS_SIGNAL_DESCRIPTORS=BUILTIN_HARNESS_SIGNAL_DESCRIPTORS.map(normalizeHarnessSignalDescriptor);function descriptorEquals(left,right){return JSON.stringify(left)===JSON.stringify(right)}function literalSignalMatches(value,marker){return value.toLowerCase().slice(0,512).split(/[/\\\s:=]+/u).filter(segment=>segment.length>0).includes(marker)||value.trim().toLowerCase()===marker}function currentHarnessSignalDescriptors(localDescriptors=[]){const adapterDescriptors=new Map(BUILTIN_HARNESS_SIGNAL_DESCRIPTORS.filter(descriptor=>descriptor.harness!=="ci").map(descriptor=>[descriptor.harness,normalizeHarnessSignalDescriptor(descriptor)]));for(const{adapter}of registeredAgentProvenanceAdapters.values())adapterDescriptors.set(adapter.harness,normalizeHarnessSignalDescriptor(adapter.descriptor));const descriptors=[...adapterDescriptors.values(),...NORMALIZED_BUILTIN_HARNESS_SIGNAL_DESCRIPTORS.filter(descriptor=>descriptor.harness==="ci"),...[...registeredHarnessSignalDescriptors.values()].map(entry=>entry.descriptor),...workspaceHarnessSignalsStorage.getStore()?.descriptors??[],...localDescriptors.map(normalizeHarnessSignalDescriptor)],seen=new Set;for(const descriptor of descriptors){if(seen.has(descriptor.harness))throw new Error(`Harness signal descriptor collision for "${descriptor.harness}"`);seen.add(descriptor.harness)}return descriptors}function firstEnvironmentValue(env,keys){for(const key of keys??[]){const value=nonBlank(env[key]);if(value)return value.slice(0,256)}}function provenanceFromArgv(argv,dimension){if(dimension==="role"){const command=argv.slice(0,8).map(token=>token.trim().toLowerCase()).find(token=>["claim","create","update","close","release","review"].includes(token));if(command==="review")return"reviewer";if(command)return"implementer"}}function provenanceFlagValue(argv,dimension){const acceptedFlags=dimension==="model"?["--model","--agent-model"]:[`--agent-${dimension}`],tokens=argv.slice(0,8);for(let index=0;index<tokens.length;index+=1){const token=tokens[index].slice(0,512);if(acceptedFlags.includes(token))return nonBlank(tokens[index+1])?.slice(0,256);const prefix=acceptedFlags.find(flag=>token.startsWith(`${flag}=`));if(prefix)return nonBlank(token.slice(prefix.length+1))?.slice(0,256)}}const AGENT_ROLE_VALUES=new Set(["implementation","implementer","investigator","orchestrator","planner","release-operator","reviewer"]);function normalizeProvenanceValue(dimension,value){if(dimension!=="role"||value===void 0)return value;const normalized=value.trim().toLowerCase().replaceAll(/[_\s]+/gu,"-");return AGENT_ROLE_VALUES.has(normalized)?normalized:void 0}function boundedProvenanceValue(provenance,dimension){return nonBlank(provenance?.[dimension])?.slice(0,256)}const MAX_PROVENANCE_PROBE_BYTES=1048576,MAX_CODEX_PROVENANCE_PROBE_BYTES=4194304,codexProvenanceSnapshotCache=new Map,EMPTY_CODEX_PROVENANCE_SNAPSHOT=Object.freeze({}),claudeProvenanceSnapshotCache=new Map,EMPTY_CLAUDE_PROVENANCE_SNAPSHOT=Object.freeze({});function asProvenanceRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)?value:void 0}function parseClaudeProvenanceLine(line){let parsed;try{parsed=JSON.parse(line)}catch{return EMPTY_CLAUDE_PROVENANCE_SNAPSHOT}const record=asProvenanceRecord(parsed);if(!record)return EMPTY_CLAUDE_PROVENANCE_SNAPSHOT;const queue=[{value:record,depth:0}];let visited=0,model,version;for(;queue.length>0&&visited<64;){const current=queue.shift();if(visited+=1,model??=nonBlank(current.value.model)?.slice(0,256),version??=nonBlank(current.value.version)?.slice(0,256),model&&version)break;if(!(current.depth>=4))for(const value of Object.values(current.value)){const nested=asProvenanceRecord(value);nested&&queue.push({value:nested,depth:current.depth+1})}}return Object.freeze({model,version})}function claudeTranscriptCandidateStatus(candidate){try{return fs.lstatSync(candidate).isFile()?"available":"missing"}catch(error){return isFileAbsentError(error)?"missing":"failed"}}function discoverClaudeSessionFile(projectsRoot,session){let discovered;try{discovered=fs.readdirSync(projectsRoot,{withFileTypes:!0}).filter(entry=>entry.isDirectory()).sort((left,right)=>left.name.localeCompare(right.name)).slice(0,512).map(entry=>{const candidate=path.join(projectsRoot,entry.name,`${session}.jsonl`);return{candidate,status:claudeTranscriptCandidateStatus(candidate)}})}catch(error){return{status:isFileAbsentError(error)?"missing":"failed"}}const matches=discovered.filter(({status})=>status==="available").map(({candidate})=>candidate);return matches.length===0?{status:discovered.some(({status})=>status==="failed")?"failed":"missing"}:matches.length>1?{status:"ambiguous"}:{status:"available",path:matches[0]}}function resolveClaudeSessionFile(signals,env){const session=nonBlank(env.CLAUDE_CODE_SESSION_ID);if(!session||!/^[A-Za-z0-9_-]{1,128}$/u.test(session))return{status:"unavailable"};const encodedWorkspace=path.resolve(signals.cwd??process.cwd()).replaceAll(/[^A-Za-z0-9-]/gu,"-"),projectsRoot=path.join(signals.home_dir??os.homedir(),".claude","projects"),directPath=path.join(projectsRoot,encodedWorkspace,`${session}.jsonl`),explicitPath=nonBlank(signals.session_file),suppliedPath=explicitPath&&path.basename(explicitPath)===`${session}.jsonl`?explicitPath:void 0;for(const candidate of[suppliedPath,directPath]){if(!candidate)continue;const status=claudeTranscriptCandidateStatus(candidate);if(status==="available")return{status,path:candidate};if(status==="failed")return{status}}return discoverClaudeSessionFile(projectsRoot,session)}function readClaudeSessionProvenance(dimension,signals,env){const resolution=resolveClaudeSessionFile(signals,env);if(resolution.status==="available")try{const file=fs.openSync(resolution.path,fs.constants.O_RDONLY|fs.constants.O_NOFOLLOW);try{const stats=fs.fstatSync(file),cacheKey=`${resolution.path}\0${stats.size}\0${stats.mtimeMs}`,cached=claudeProvenanceSnapshotCache.get(cacheKey);if(cached)return cached[dimension];const probeLength=Math.min(stats.size,MAX_PROVENANCE_PROBE_BYTES),headLength=Math.min(probeLength,Math.ceil(probeLength/2)),tailLength=Math.min(probeLength-headLength,stats.size-headLength),head=Buffer.alloc(headLength);fs.readSync(file,head,0,headLength,0);const tail=Buffer.alloc(tailLength);tailLength>0&&fs.readSync(file,tail,0,tailLength,stats.size-tailLength);const snapshot={},lines=stats.size<=probeLength?Buffer.concat([head,tail]).toString("utf8").split(`
|
|
2
|
-
`):[...
|
|
3
|
-
`).slice(0,4096),...
|
|
4
|
-
`).slice(-4096)];for(const
|
|
5
|
-
`).reverse().slice(0,linesRemaining);linesRemaining-=lines.length;for(const line of lines)if(mergeCodexTurnContext(snapshot,line),snapshot.model&&snapshot.effort)break;if(snapshot.model&&snapshot.effort||linesRemaining<=0)break}return snapshot}function readCodexSessionProvenance(dimension,signals,env){const session=nonBlank(env.CODEX_THREAD_ID);if(!session||!/^[A-Za-z0-9_-]{1,128}$/u.test(session))return;const sessionsRoot=path.join(signals.home_dir??os.homedir(),".codex","sessions"),cacheKey=`${sessionsRoot}\0${session}`,cached=codexProvenanceSnapshotCache.get(cacheKey);if(cached)return cached[dimension];const sessionPath=findCodexSessionFile(sessionsRoot,session);if(!sessionPath){codexProvenanceSnapshotCache.set(cacheKey,EMPTY_CODEX_PROVENANCE_SNAPSHOT);return}try{const file=fs.openSync(sessionPath,"r");try{const size=fs.fstatSync(file).size,snapshot=readCodexProvenanceSnapshot(file,size);return codexProvenanceSnapshotCache.set(cacheKey,snapshot),snapshot[dimension]}finally{fs.closeSync(file)}}catch{codexProvenanceSnapshotCache.set(cacheKey,EMPTY_CODEX_PROVENANCE_SNAPSHOT);return}}function resolveProvenanceProbe(dimension,signals,env,descriptor){const workspaceSignals=workspaceHarnessSignalsStorage.getStore();if(!(signals.probes_enabled!==!1&&workspaceSignals?.probesEnabled!==!1&&!["0","false","off"].includes(nonBlank(env.PM_AGENT_PROBES)?.toLowerCase()??"")))return;const resolver=descriptor?.provenance_resolvers[dimension];if(resolver==="claude_session_file")return readClaudeSessionProvenance(dimension,signals,env);if(resolver==="codex_session_file")return readCodexSessionProvenance(dimension,signals,env);if(resolver==="ai_agent_version"){const value=nonBlank(env.AI_AGENT);return!value||!descriptor||!literalSignalMatches(value,descriptor.harness)?void 0:/(?:^|[@/\s])v?(\d+\.\d+(?:\.\d+)?(?:[-+][A-Za-z0-9.-]+)?)$/u.exec(value)?.[1]?.slice(0,256)}}function provenanceResolverHasInput(resolver,descriptor,signals,env){if(resolver==="ai_agent_version"){const value=nonBlank(env.AI_AGENT);return value!==void 0&&literalSignalMatches(value,descriptor.harness)?"available":"unavailable"}return resolver==="codex_session_file"?nonBlank(env.CODEX_THREAD_ID)!==void 0?"available":"unavailable":resolveClaudeSessionFile(signals,env).status}function effectiveHarnessDetectionSignals(signals){return signals||(harnessDetectionStorage.getStore()??{env:process.env,argv:process.argv})}function descriptorMatchesSignals(descriptor,env,labels,clientName){const environmentMatch=descriptor.environment_keys.some(key=>nonBlank(env[key])!==void 0),argvMatch=descriptor.argv_markers.some(marker=>labels.some(label=>{const normalizedPath=label.replaceAll("\\","/");return literalSignalMatches(normalizedPath.slice(normalizedPath.lastIndexOf("/")+1),marker)})),clientMatch=descriptor.client_names.some(name=>clientName===name||literalSignalMatches(clientName,name));return environmentMatch||argvMatch||clientMatch}function inferredProvenanceObservation(dimension,semanticAttribution){if(!semanticAttribution)return;let value;if(dimension==="topic"&&(value=semanticAttribution.topic),dimension==="role"&&(value=semanticAttribution.role),!!value)return{value,source:"inferred",confidence:semanticAttribution.confidence,rule_version:semanticAttribution.rule_version,evidence:semanticAttribution.evidence}}function firstProvenanceObservation(candidates){const observed=candidates.find(([value])=>value!==void 0);return observed?.[0]?{value:observed[0],source:observed[1]}:void 0}function resolveAgentProvenanceObservation(dimension,signals,env,descriptor,sessionContext,semanticAttribution){const overrideKey=`PM_AGENT_${dimension.toUpperCase().replaceAll("-","_")}`,hostResolvedDimensions=new Set([...AGENT_PROVENANCE_DIMENSIONS,...Object.keys(descriptor?.provenance_environment_keys??{})]);let overrideValue,argvValue,argvFlagValue;hostResolvedDimensions.has(dimension)&&(overrideValue=normalizeProvenanceValue(dimension,nonBlank(env[overrideKey])?.slice(0,256)),argvFlagValue=normalizeProvenanceValue(dimension,provenanceFlagValue(signals.argv??[],dimension)),argvValue=normalizeProvenanceValue(dimension,provenanceFromArgv(signals.argv??[],dimension)));const environmentKeysByDimension={...descriptor?.provenance_environment_keys,model:descriptor?.model_environment_keys},clientProvenance={...signals.client_info?.provenance,model:signals.client_info?.model},sessionValue=boundedProvenanceValue(sessionContext?.provenance,dimension),environmentValue=normalizeProvenanceValue(dimension,firstEnvironmentValue(env,environmentKeysByDimension[dimension])),clientValue=normalizeProvenanceValue(dimension,boundedProvenanceValue(clientProvenance,dimension)),hostValue=normalizeProvenanceValue(dimension,boundedProvenanceValue(signals.provenance,dimension)),probeValue=resolveProvenanceProbe(dimension,signals,env,descriptor);return firstProvenanceObservation([[overrideValue,"override"],[sessionValue,"session"],[argvFlagValue,"argv"],[environmentValue,"environment"],[clientValue,"mcp_client"],[hostValue,"host"],[probeValue,"probe"]])??inferredProvenanceObservation(dimension,semanticAttribution)??(argvValue?{value:argvValue,source:"argv"}:void 0)}function resolveAgentInstance(harness,session){if(!(!harness||!session))return createHash("sha256").update(`pm-agent-instance:v1\0${harness}\0${session}`).digest("hex").slice(0,24)}function resolveAgentProvenance(signals,env,descriptor,sessionContext,semanticAttribution){const descriptorDimensions=Object.keys(descriptor?.provenance_environment_keys??{}),dimensions=new Set([...AGENT_PROVENANCE_DIMENSIONS,...descriptorDimensions,...Object.keys(descriptor?.provenance_resolvers??{}),...Object.keys(signals.provenance??{}),...Object.keys(signals.client_info?.provenance??{}),...Object.keys(sessionContext?.provenance??{})]),observations={};for(const dimension of dimensions){const observed=resolveAgentProvenanceObservation(dimension,signals,env,descriptor,sessionContext,semanticAttribution);observed?observations[dimension]=observed:descriptor&&(dimension!=="version"||descriptor.provenance_unavailable_dimensions.includes(dimension))&&(observations[dimension]=null)}return observations}function registerHarnessSignalDescriptors(descriptors){const normalized=descriptors.map(normalizeHarnessSignalDescriptor),builtins=new Map(NORMALIZED_BUILTIN_HARNESS_SIGNAL_DESCRIPTORS.map(descriptor=>[descriptor.harness,descriptor])),seen=new Set;for(const descriptor of normalized){if(seen.has(descriptor.harness)||builtins.has(descriptor.harness))throw new Error(`Harness signal descriptor collision for "${descriptor.harness}"`);const registered=registeredHarnessSignalDescriptors.get(descriptor.harness);if(registered&&!descriptorEquals(registered.descriptor,descriptor))throw new Error(`Harness signal descriptor collision for "${descriptor.harness}"`);seen.add(descriptor.harness)}for(const descriptor of normalized){const registered=registeredHarnessSignalDescriptors.get(descriptor.harness);registeredHarnessSignalDescriptors.set(descriptor.harness,{descriptor,registrations:(registered?.registrations??0)+1})}let active=!0;return()=>{if(active){active=!1;for(const descriptor of normalized){const registered=registeredHarnessSignalDescriptors.get(descriptor.harness);!registered||registered.registrations<=1?registeredHarnessSignalDescriptors.delete(descriptor.harness):registered.registrations-=1}}}}function normalizeAgentProvenanceAdapter(adapter){const descriptor=normalizeHarnessSignalDescriptor(adapter.descriptor),harness=adapter.harness.trim().toLowerCase();if(adapter.contract_version!==1)throw new Error(`Unsupported provenance adapter contract for "${harness}": ${adapter.contract_version}`);if(descriptor.harness!==harness)throw new Error(`Provenance adapter harness "${harness}" does not match descriptor "${descriptor.harness}".`);const adapterVersion=nonBlank(adapter.adapter_version)?.slice(0,64);if(!adapterVersion)throw new Error(`Provenance adapter "${harness}" requires a version.`);if(!Number.isSafeInteger(adapter.priority))throw new Error(`Provenance adapter "${harness}" requires an integer priority.`);if(adapter.probe_policy.network_access!==!1||adapter.probe_policy.subprocess_access!==!1||adapter.probe_policy.max_bytes>MAX_CODEX_PROVENANCE_PROBE_BYTES||adapter.probe_policy.max_lines>4096)throw new Error(`Provenance adapter "${harness}" exceeds the bounded local probe policy.`);return Object.freeze({...adapter,adapter_version:adapterVersion,harness,descriptor,supported_dimensions:Object.freeze(boundedUniqueStrings(adapter.supported_dimensions).map(dimension=>dimension.toLowerCase()).sort()),native_sources:Object.freeze([...new Set(adapter.native_sources)]),probe_policy:Object.freeze({...adapter.probe_policy}),normalization:Object.freeze({...adapter.normalization}),...adapter.waivers?{waivers:Object.freeze(Object.fromEntries(Object.entries(adapter.waivers).slice(0,32).map(([dimension,reason])=>[dimension.slice(0,64),reason.slice(0,256)])))}:{}})}function listAgentProvenanceAdapters(){const effective=new Map(BUILTIN_AGENT_PROVENANCE_ADAPTERS.map(adapter=>[adapter.harness,adapter]));for(const{adapter}of registeredAgentProvenanceAdapters.values())effective.set(adapter.harness,adapter);return Object.freeze([...effective.values()].sort((left,right)=>left.harness.localeCompare(right.harness)))}function registerAgentProvenanceAdapters(adapters){const normalized=adapters.map(normalizeAgentProvenanceAdapter),builtins=new Map(BUILTIN_AGENT_PROVENANCE_ADAPTERS.map(adapter=>[adapter.harness,adapter])),seen=new Set;for(const adapter of normalized){if(seen.has(adapter.harness))throw new Error(`Provenance adapter collision for "${adapter.harness}".`);const builtin=builtins.get(adapter.harness);if(builtin&&adapter.priority<=builtin.priority)throw new Error(`Provenance adapter override for "${adapter.harness}" requires priority greater than ${builtin.priority}.`);const registered=registeredAgentProvenanceAdapters.get(adapter.harness);if(registered&&JSON.stringify(registered.adapter)!==JSON.stringify(adapter))throw new Error(`Provenance adapter collision for "${adapter.harness}".`);seen.add(adapter.harness)}for(const adapter of normalized){const registered=registeredAgentProvenanceAdapters.get(adapter.harness);registeredAgentProvenanceAdapters.set(adapter.harness,{adapter,registrations:(registered?.registrations??0)+1})}let active=!0;return()=>{if(active){active=!1;for(const adapter of normalized){const registered=registeredAgentProvenanceAdapters.get(adapter.harness);!registered||registered.registrations<=1?registeredAgentProvenanceAdapters.delete(adapter.harness):registered.registrations-=1}}}}function normalizeAgentProvenanceAdapterValue(dimension,value){const raw=value.trim().slice(0,256);let normalized=raw.toLowerCase();if(dimension==="model"){const family=/^(gpt-\d+(?:\.\d+)?)/u.exec(normalized)?.[1];family&&(normalized=family)}else normalized=normalized.replaceAll(/[_\s-]+/gu,""),normalized={minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max",ultra:"ultra"}[normalized]??normalized;return{raw,normalized,vocabulary:"v1"}}function runWithHarnessDetectionSignals(signals,callback){return harnessDetectionStorage.run(signals,callback)}function runWithWorkspaceHarnessSignalDescriptors(descriptors,callback,options={}){const normalized=descriptors.map(normalizeHarnessSignalDescriptor);return currentHarnessSignalDescriptors(normalized),workspaceHarnessSignalsStorage.run({descriptors:normalized,probesEnabled:options.probesEnabled!==!1},callback)}function detectAgentIdentity(signals){const effectiveSignals=effectiveHarnessDetectionSignals(signals),env=effectiveSignals.env??{},descriptors=currentHarnessSignalDescriptors(effectiveSignals.descriptors),labels=[...(effectiveSignals.argv??[]).slice(0,3),...effectiveSignals.process_labels??[]].slice(0,64).map(token=>token.slice(0,512)),clientName=effectiveSignals.client_info?.name.trim().toLowerCase()??"",descriptor=descriptors.find(candidate=>descriptorMatchesSignals(candidate,env,labels,clientName)),sessionContext=resolveAgentSessionContextFromSignals(effectiveSignals,env),session=[firstEnvironmentValue(env,descriptor?.session_environment_keys),nonBlank(effectiveSignals.client_info?.session)?.slice(0,256)].find(candidate=>candidate!==void 0),instance=resolveAgentInstance(descriptor?.harness,session),semanticAttribution=readAgentSemanticAttributionSync({cwd:effectiveSignals.cwd??process.cwd(),env,key:instance}),provenance=resolveAgentProvenance(effectiveSignals,env,descriptor,sessionContext,semanticAttribution),modelCandidate=provenance.model,entries=[["harness",descriptor?.harness],["model",modelCandidate?.value],["model_source",modelCandidate?.source],["session",session],["instance",instance],["provenance",Object.keys(provenance).length>0?provenance:void 0],["episode",sessionContext.episode]];return Object.fromEntries(entries.filter(entry=>entry[1]!==void 0))}function provenanceResolverAbsence(resolverInput){return resolverInput==="unavailable"?{status:"unavailable",reason:"harness_unavailable"}:resolverInput==="missing"?{status:"unavailable",reason:"resolver_input_missing"}:{status:"failed",reason:"resolver_failed"}}function resolveProvenanceOutcome(dimension,identity,descriptor,signals,env,probesEnabled,invalidValue){const resolver=descriptor?.provenance_resolvers[dimension];if(identity.provenance?.[dimension])return{status:"resolved",...resolver?{resolver}:{},rule_version:"v1"};if(invalidValue)return{status:"unavailable",reason:"invalid_value",rule_version:"v1"};if(resolver){if(!probesEnabled)return{status:"unavailable",reason:"probes_disabled",resolver,rule_version:"v1"};const resolverInput=provenanceResolverHasInput(resolver,descriptor,signals,env);return{...provenanceResolverAbsence(resolverInput),resolver,rule_version:"v1"}}return{status:descriptor?.provenance_unavailable_dimensions.includes(dimension)?"unavailable":"not_configured",reason:descriptor?.provenance_unavailable_dimensions.includes(dimension)?"harness_unavailable":"resolver_not_configured",rule_version:"v1"}}function diagnoseAgentIdentity(signals){const effectiveSignals=effectiveHarnessDetectionSignals(signals),identity=detectAgentIdentity(effectiveSignals),descriptor=currentHarnessSignalDescriptors(effectiveSignals.descriptors).find(candidate=>candidate.harness===identity.harness),env=effectiveSignals.env??{},probesEnabled=effectiveSignals.probes_enabled!==!1&&workspaceHarnessSignalsStorage.getStore()?.probesEnabled!==!1&&!["0","false","off"].includes(nonBlank(env.PM_AGENT_PROBES)?.toLowerCase()??""),sessionContext=resolveAgentSessionContextFromSignals(effectiveSignals,env),invalidRoleValue=[env.PM_AGENT_ROLE,sessionContext.provenance?.role,firstEnvironmentValue(env,descriptor?.provenance_environment_keys.role),effectiveSignals.client_info?.provenance?.role,effectiveSignals.provenance?.role,provenanceFlagValue(effectiveSignals.argv??[],"role")].some(candidate=>{const value=nonBlank(candidate)?.slice(0,256);return value!==void 0&&normalizeProvenanceValue("role",value)===void 0}),outcomes=Object.fromEntries(AGENT_PROVENANCE_DIMENSIONS.map(dimension=>[dimension,resolveProvenanceOutcome(dimension,identity,descriptor,effectiveSignals,env,probesEnabled,dimension==="role"&&invalidRoleValue)]));return{...identity,provenance_outcomes:outcomes}}function readAuthorEnvironment(){return process.env.PM_AUTHOR}function writeAuthorEnvironment(author){author===void 0?delete process.env.PM_AUTHOR:process.env.PM_AUTHOR=author}function detectHarnessIdentity(signals){return detectAgentIdentity(signals).harness}function resolveAuthorIdentity(candidate,fallback,signals){const effectiveSignals=effectiveHarnessDetectionSignals(signals),detected=detectAgentIdentity(effectiveSignals);if(candidate!==void 0){const explicit=nonBlank(candidate);return assertIdentityWithoutUrlCredentials(explicit,"--author"),explicit?{author:explicit,source:"asserted",...detected}:{author:"unknown",source:"unknown",...detected}}if(effectiveSignals.env?.PM_AUTHOR!==void 0){const environment=nonBlank(effectiveSignals.env.PM_AUTHOR);return assertIdentityWithoutUrlCredentials(environment,"PM_AUTHOR"),environment?{author:environment,source:"asserted",...detected}:{author:"unknown",source:"unknown",...detected}}const configured=nonBlank(fallback);return configured?(assertIdentityWithoutUrlCredentials(configured,"default_author"),{author:configured,source:"configured",...detected}):detected.harness?{author:`harness:${detected.harness}`,source:"detected",...detected}:{author:"unknown",source:"unknown",...detected}}function resolveHistoryAuthorSource(author){const active=authorIdentityStorage.getStore();return active?.author===author?active.source:author.startsWith("harness:")?"detected":author==="unknown"?"unknown":"asserted"}function resolveHistoryAgentIdentity(author){const active=authorIdentityStorage.getStore();return active?.author!==author?author.startsWith("harness:")?{harness:author.slice(8)}:{}:{...active.harness?{harness:active.harness}:{},...active.model?{model:active.model}:{},...active.model_source?{model_source:active.model_source}:{},...active.session?{session:active.session}:{},...active.instance?{instance:active.instance}:{},...active.provenance?{provenance:active.provenance}:{},...active.episode?{episode:active.episode}:{}}}function resolveClaimPrincipal(author){const active=authorIdentityStorage.getStore();return active?.author===author&&active.source==="detected"&&active.instance?`${author}#${active.instance}`:author}function resolveAuthor(candidate,fallback){const identity=resolveAuthorIdentity(candidate,fallback);return authorIdentityStorage.enterWith(identity),identity.author}export{AGENT_PROVENANCE_DIMENSIONS,BUILTIN_AGENT_PROVENANCE_ADAPTERS,BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,detectAgentIdentity,detectHarnessIdentity,diagnoseAgentIdentity,listAgentProvenanceAdapters,normalizeAgentProvenanceAdapterValue,readAuthorEnvironment,registerAgentProvenanceAdapters,registerHarnessSignalDescriptors,resolveAuthor,resolveAuthorIdentity,resolveClaimPrincipal,resolveHistoryAgentIdentity,resolveHistoryAuthorSource,runWithHarnessDetectionSignals,runWithWorkspaceHarnessSignalDescriptors,writeAuthorEnvironment};
|
|
1
|
+
import{AsyncLocalStorage as I}from"node:async_hooks";import{createHash as ne}from"node:crypto";import d from"node:fs";import V from"node:os";import E from"node:path";import{resolveAgentSessionContextFromSignals as B}from"./agent-session-context.js";import{readAgentSemanticAttributionSync as re}from"../session/session-state.js";import{isFileAbsentError as G}from"../fs/fs-utils.js";import{assertIdentityWithoutUrlCredentials as N}from"./url-credentials.js";const R=["model","effort","role","topic","version"],C=new I,F=new I,k=new I,x=[{harness:"claude-code",environment_keys:["CLAUDE_CODE","CLAUDECODE"],model_environment_keys:["ANTHROPIC_MODEL","CLAUDE_MODEL"],session_environment_keys:["CLAUDE_CODE_SESSION_ID"],provenance_environment_keys:{effort:["CLAUDE_EFFORT"]},provenance_resolvers:{model:"claude_session_file",version:"claude_session_file"},provenance_unavailable_dimensions:["role","topic"],argv_markers:["claude","claude-code"],client_names:["claude","claude-code","claude code"]},{harness:"codex",environment_keys:["CODEX_HOME","CODEX_CI","CODEX_THREAD_ID"],model_environment_keys:["CODEX_MODEL"],session_environment_keys:["CODEX_THREAD_ID"],provenance_environment_keys:{effort:["CODEX_REASONING_EFFORT","CODEX_EFFORT"],role:["CODEX_SESSION_ROLE"]},provenance_resolvers:{model:"codex_session_file",effort:"codex_session_file",version:"ai_agent_version"},provenance_unavailable_dimensions:["topic"],argv_markers:["codex"],client_names:["codex"]},{harness:"pi",environment_keys:["PI_AGENT","PI_CODING_AGENT"],model_environment_keys:["PI_MODEL"],session_environment_keys:["PI_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["pi"],client_names:["pi"]},{harness:"opencode",environment_keys:["OPENCODE","OPENCODE_SESSION_ID"],model_environment_keys:["OPENCODE_MODEL"],session_environment_keys:["OPENCODE_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["opencode"],client_names:["opencode"]},{harness:"cursor",environment_keys:["CURSOR_AGENT","CURSOR_TRACE_ID"],model_environment_keys:["CURSOR_MODEL"],session_environment_keys:["CURSOR_TRACE_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["cursor"],client_names:["cursor"]},{harness:"aider",environment_keys:["AIDER","AIDER_MODEL"],model_environment_keys:["AIDER_MODEL"],session_environment_keys:["AIDER_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["aider"],client_names:["aider"]},{harness:"gemini-cli",environment_keys:["GEMINI_CLI","GEMINI_CLI_HOME"],model_environment_keys:["GEMINI_MODEL"],session_environment_keys:["GEMINI_CLI_SESSION_ID"],provenance_unavailable_dimensions:["effort","role","topic"],argv_markers:["gemini","gemini-cli"],client_names:["gemini","gemini-cli","gemini cli"]},{harness:"ci",environment_keys:["CI","GITHUB_ACTIONS","BUILDKITE","GITLAB_CI"],provenance_unavailable_dimensions:["model","effort","role","topic"],argv_markers:[],client_names:[]}],X=Object.freeze({max_bytes:1048576,max_lines:4096,network_access:!1,subprocess_access:!1}),se=Object.freeze({...X,max_bytes:4194304}),L=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function te(e){const n=g(e).provenance_unavailable_dimensions,r=new Set(["model","version",...Object.keys(e.provenance_environment_keys??{}),...Object.keys(e.provenance_resolvers??{})]);return Object.freeze({contract_version:1,adapter_version:"v1",priority:0,harness:e.harness,descriptor:e,supported_dimensions:Object.freeze([...r].sort()),native_sources:Object.freeze(["environment","argv","mcp_client",...Object.values(e.provenance_resolvers??{}).some(s=>s?.endsWith("session_file"))?["session_file"]:[]]),probe_policy:e.harness==="codex"?se:X,normalization:Object.freeze({model_family:"v1",effort:"v1",preserve_raw:!0}),confidence:"high",waivers:Object.freeze(Object.fromEntries(n.map(s=>[s,"Harness does not expose this dimension."])))})}const W=Object.freeze(x.filter(e=>e.harness!=="ci").map(te).sort((e,n)=>e.harness.localeCompare(n.harness))),O=new Map,y=new Map;function u(e){const n=typeof e=="string"?e.trim():void 0;return n&&n.length>0?n:void 0}function h(e){return[...new Set((e??[]).slice(0,64).map(n=>n.trim()).filter(n=>n.length>0).map(n=>n.slice(0,128)))]}function g(e){const n=e.harness.trim().toLowerCase();if(!L.test(n))throw new Error(`Invalid harness signal descriptor namespace: ${e.harness}`);return{harness:n,environment_keys:h(e.environment_keys),model_environment_keys:h(e.model_environment_keys),session_environment_keys:h(e.session_environment_keys),provenance_environment_keys:Object.fromEntries(Object.entries(e.provenance_environment_keys??{}).slice(0,32).map(([r,s])=>[r.trim().toLowerCase().slice(0,64),h(s)]).filter(([r])=>L.test(r))),provenance_resolvers:Object.fromEntries(Object.entries(e.provenance_resolvers??{}).slice(0,32).map(([r,s])=>[r.trim().toLowerCase().slice(0,64),s]).filter(r=>typeof r[0]=="string"&&L.test(r[0])&&(r[1]==="ai_agent_version"||r[1]==="claude_session_file"||r[1]==="codex_session_file"))),provenance_unavailable_dimensions:h(e.provenance_unavailable_dimensions).map(r=>r.toLowerCase()),argv_markers:h(e.argv_markers).map(r=>r.toLowerCase()),client_names:h(e.client_names).map(r=>r.toLowerCase())}}const Y=x.map(g);function oe(e,n){return JSON.stringify(e)===JSON.stringify(n)}function P(e,n){return e.toLowerCase().slice(0,512).split(/[/\\\s:=]+/u).filter(s=>s.length>0).includes(n)||e.trim().toLowerCase()===n}function j(e=[]){const n=new Map(x.filter(t=>t.harness!=="ci").map(t=>[t.harness,g(t)]));for(const{adapter:t}of O.values())n.set(t.harness,g(t.descriptor));const r=[...n.values(),...Y.filter(t=>t.harness==="ci"),...[...y.values()].map(t=>t.descriptor),...k.getStore()?.descriptors??[],...e.map(g)],s=new Set;for(const t of r){if(s.has(t.harness))throw new Error(`Harness signal descriptor collision for "${t.harness}"`);s.add(t.harness)}return r}function M(e,n){for(const r of n??[]){const s=u(e[r]);if(s)return s.slice(0,256)}}function ie(e,n){if(n==="role"){const r=e.slice(0,8).map(s=>s.trim().toLowerCase()).find(s=>["claim","create","update","close","release","review"].includes(s));if(r==="review")return"reviewer";if(r)return"implementer"}}function q(e,n){const r=n==="model"?["--model","--agent-model"]:[`--agent-${n}`],s=e.slice(0,8);for(let t=0;t<s.length;t+=1){const o=s[t].slice(0,512);if(r.includes(o))return u(s[t+1])?.slice(0,256);const i=r.find(a=>o.startsWith(`${a}=`));if(i)return u(o.slice(i.length+1))?.slice(0,256)}}const ae=new Set(["implementation","implementer","investigator","orchestrator","planner","release-operator","reviewer"]);function b(e,n){if(e!=="role"||n===void 0)return n;const r=n.trim().toLowerCase().replaceAll(/[_\s]+/gu,"-");return ae.has(r)?r:void 0}function T(e,n){return u(e?.[n])?.slice(0,256)}const ce=1048576,z=4194304,D=new Map,J=Object.freeze({}),H=new Map,K=Object.freeze({});function Z(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function le(e){let n;try{n=JSON.parse(e)}catch{return K}const r=Z(n);if(!r)return K;const s=[{value:r,depth:0}];let t=0,o,i;for(;s.length>0&&t<64;){const a=s.shift();if(t+=1,o??=u(a.value.model)?.slice(0,256),i??=u(a.value.version)?.slice(0,256),o&&i)break;if(!(a.depth>=4))for(const l of Object.values(a.value)){const c=Z(l);c&&s.push({value:c,depth:a.depth+1})}}return Object.freeze({model:o,version:i})}function Q(e){try{return d.lstatSync(e).isFile()?"available":"missing"}catch(n){return G(n)?"missing":"failed"}}function ue(e,n){let r;try{r=d.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).sort((t,o)=>t.name.localeCompare(o.name)).slice(0,512).map(t=>{const o=E.join(e,t.name,`${n}.jsonl`);return{candidate:o,status:Q(o)}})}catch(t){return{status:G(t)?"missing":"failed"}}const s=r.filter(({status:t})=>t==="available").map(({candidate:t})=>t);return s.length===0?{status:r.some(({status:t})=>t==="failed")?"failed":"missing"}:s.length>1?{status:"ambiguous"}:{status:"available",path:s[0]}}function ee(e,n){const r=u(n.CLAUDE_CODE_SESSION_ID);if(!r||!/^[A-Za-z0-9_-]{1,128}$/u.test(r))return{status:"unavailable"};const t=E.resolve(e.cwd??process.cwd()).replaceAll(/[^A-Za-z0-9-]/gu,"-"),o=E.join(e.home_dir??V.homedir(),".claude","projects"),i=E.join(o,t,`${r}.jsonl`),a=u(e.session_file),l=a&&E.basename(a)===`${r}.jsonl`?a:void 0;for(const c of[l,i]){if(!c)continue;const f=Q(c);if(f==="available")return{status:f,path:c};if(f==="failed")return{status:f}}return ue(o,r)}function fe(e,n,r){const s=ee(n,r);if(s.status==="available")try{const t=d.openSync(s.path,d.constants.O_RDONLY|d.constants.O_NOFOLLOW);try{const o=d.fstatSync(t),i=`${s.path}\0${o.size}\0${o.mtimeMs}`,a=H.get(i);if(a)return a[e];const l=Math.min(o.size,ce),c=Math.min(l,Math.ceil(l/2)),f=Math.min(l-c,o.size-c),v=Buffer.alloc(c);d.readSync(t,v,0,c,0);const m=Buffer.alloc(f);f>0&&d.readSync(t,m,0,f,o.size-f);const p={},_=o.size<=l?Buffer.concat([v,m]).toString("utf8").split(`
|
|
2
|
+
`):[...v.toString("utf8").split(`
|
|
3
|
+
`).slice(0,4096),...m.toString("utf8").split(`
|
|
4
|
+
`).slice(-4096)];for(const S of _){if(S.length===0||S.length>262144)continue;const w=le(S);if(p.model??=w.model,p.version??=w.version,p.model&&p.version)break}const A=Object.freeze(p);return H.clear(),H.set(i,A),A[e]}finally{d.closeSync(t)}}catch{return}}function de(e,n){let r=0;const s=(t,o)=>{if(o>4||r>=512)return;let i;try{i=d.readdirSync(t,{withFileTypes:!0}).sort((a,l)=>l.name.localeCompare(a.name))}catch{return}for(const a of i){if(r+=1,r>512)return;const l=E.join(t,a.name);if(a.isFile()&&a.name.endsWith(`-${n}.jsonl`))return l;if(a.isDirectory()){const c=s(l,o+1);if(c)return c}}};return s(e,0)}function _e(e){if(e<=z)return[{offset:0,length:e}];const n=Math.floor(z/2);return[{offset:e-n,length:n},{offset:0,length:n}]}function ve(e,n){if(n.length===0||n.length>262144)return;let r;try{r=JSON.parse(n)}catch{return}if(typeof r!="object"||r===null||Array.isArray(r))return;const s=r;if(s.type!=="turn_context")return;const t=typeof s.payload=="object"&&s.payload!==null?s.payload:void 0;e.model??=u(t?.model)?.slice(0,256),e.effort??=u(t?.effort)?.slice(0,256)}function pe(e,n){const r={};let s=4096;for(const t of _e(n)){const o=Buffer.alloc(t.length);d.readSync(e,o,0,t.length,t.offset);const i=o.toString("utf8").split(`
|
|
5
|
+
`).reverse().slice(0,s);s-=i.length;for(const a of i)if(ve(r,a),r.model&&r.effort)break;if(r.model&&r.effort||s<=0)break}return r}function me(e,n,r){const s=u(r.CODEX_THREAD_ID);if(!s||!/^[A-Za-z0-9_-]{1,128}$/u.test(s))return;const t=E.join(n.home_dir??V.homedir(),".codex","sessions"),o=`${t}\0${s}`,i=D.get(o);if(i)return i[e];const a=de(t,s);if(!a){D.set(o,J);return}try{const l=d.openSync(a,"r");try{const c=d.fstatSync(l).size,f=pe(l,c);return D.set(o,f),f[e]}finally{d.closeSync(l)}}catch{D.set(o,J);return}}function he(e,n,r,s){const t=k.getStore();if(!(n.probes_enabled!==!1&&t?.probesEnabled!==!1&&!["0","false","off"].includes(u(r.PM_AGENT_PROBES)?.toLowerCase()??"")))return;const i=s?.provenance_resolvers[e];if(i==="claude_session_file")return fe(e,n,r);if(i==="codex_session_file")return me(e,n,r);if(i==="ai_agent_version"){const a=u(r.AI_AGENT);return!a||!s||!P(a,s.harness)?void 0:/(?:^|[@/\s])v?(\d+\.\d+(?:\.\d+)?(?:[-+][A-Za-z0-9.-]+)?)$/u.exec(a)?.[1]?.slice(0,256)}}function ge(e,n,r,s){if(e==="ai_agent_version"){const t=u(s.AI_AGENT);return t!==void 0&&P(t,n.harness)?"available":"unavailable"}return e==="codex_session_file"?u(s.CODEX_THREAD_ID)!==void 0?"available":"unavailable":ee(r,s).status}function $(e){return e||(F.getStore()??{env:process.env,argv:process.argv})}function Ee(e,n,r,s){const t=e.environment_keys.some(a=>u(n[a])!==void 0),o=e.argv_markers.some(a=>r.some(l=>{const c=l.replaceAll("\\","/");return P(c.slice(c.lastIndexOf("/")+1),a)})),i=e.client_names.some(a=>s===a||P(s,a));return t||o||i}function Oe(e,n){if(!n)return;let r;if(e==="topic"&&(r=n.topic),e==="role"&&(r=n.role),!!r)return{value:r,source:"inferred",confidence:n.confidence,rule_version:n.rule_version,evidence:n.evidence}}function be(e){const n=e.find(([r])=>r!==void 0);return n?.[0]?{value:n[0],source:n[1]}:void 0}function ye(e,n,r,s,t,o){const i=`PM_AGENT_${e.toUpperCase().replaceAll("-","_")}`,a=new Set([...R,...Object.keys(s?.provenance_environment_keys??{})]);let l,c,f;a.has(e)&&(l=b(e,u(r[i])?.slice(0,256)),f=b(e,q(n.argv??[],e)),c=b(e,ie(n.argv??[],e)));const v={...s?.provenance_environment_keys,model:s?.model_environment_keys},m={...n.client_info?.provenance,model:n.client_info?.model},p=T(t?.provenance,e),_=b(e,M(r,v[e])),A=b(e,T(m,e)),S=b(e,T(n.provenance,e)),w=he(e,n,r,s);return be([[l,"override"],[p,"session"],[f,"argv"],[_,"environment"],[A,"mcp_client"],[S,"host"],[w,"probe"]])??Oe(e,o)??(c?{value:c,source:"argv"}:void 0)}function Se(e,n){if(!(!e||!n))return ne("sha256").update(`pm-agent-instance:v1\0${e}\0${n}`).digest("hex").slice(0,24)}function Ae(e,n,r,s,t){const o=Object.keys(r?.provenance_environment_keys??{}),i=new Set([...R,...o,...Object.keys(r?.provenance_resolvers??{}),...Object.keys(e.provenance??{}),...Object.keys(e.client_info?.provenance??{}),...Object.keys(s?.provenance??{})]),a={};for(const l of i){const c=ye(l,e,n,r,s,t);c?a[l]=c:r&&(l!=="version"||r.provenance_unavailable_dimensions.includes(l))&&(a[l]=null)}return a}function He(e){const n=e.map(g),r=new Map(Y.map(o=>[o.harness,o])),s=new Set;for(const o of n){if(s.has(o.harness)||r.has(o.harness))throw new Error(`Harness signal descriptor collision for "${o.harness}"`);const i=y.get(o.harness);if(i&&!oe(i.descriptor,o))throw new Error(`Harness signal descriptor collision for "${o.harness}"`);s.add(o.harness)}for(const o of n){const i=y.get(o.harness);y.set(o.harness,{descriptor:o,registrations:(i?.registrations??0)+1})}let t=!0;return()=>{if(t){t=!1;for(const o of n){const i=y.get(o.harness);!i||i.registrations<=1?y.delete(o.harness):i.registrations-=1}}}}function we(e){const n=g(e.descriptor),r=e.harness.trim().toLowerCase();if(e.contract_version!==1)throw new Error(`Unsupported provenance adapter contract for "${r}": ${e.contract_version}`);if(n.harness!==r)throw new Error(`Provenance adapter harness "${r}" does not match descriptor "${n.harness}".`);const s=u(e.adapter_version)?.slice(0,64);if(!s)throw new Error(`Provenance adapter "${r}" requires a version.`);if(!Number.isSafeInteger(e.priority))throw new Error(`Provenance adapter "${r}" requires an integer priority.`);if(e.probe_policy.network_access!==!1||e.probe_policy.subprocess_access!==!1||e.probe_policy.max_bytes>z||e.probe_policy.max_lines>4096)throw new Error(`Provenance adapter "${r}" exceeds the bounded local probe policy.`);return Object.freeze({...e,adapter_version:s,harness:r,descriptor:n,supported_dimensions:Object.freeze(h(e.supported_dimensions).map(t=>t.toLowerCase()).sort()),native_sources:Object.freeze([...new Set(e.native_sources)]),probe_policy:Object.freeze({...e.probe_policy}),normalization:Object.freeze({...e.normalization}),...e.waivers?{waivers:Object.freeze(Object.fromEntries(Object.entries(e.waivers).slice(0,32).map(([t,o])=>[t.slice(0,64),o.slice(0,256)])))}:{}})}function $e(){const e=new Map(W.map(n=>[n.harness,n]));for(const{adapter:n}of O.values())e.set(n.harness,n);return Object.freeze([...e.values()].sort((n,r)=>n.harness.localeCompare(r.harness)))}function Ue(e){const n=e.map(we),r=new Map(W.map(o=>[o.harness,o])),s=new Set;for(const o of n){if(s.has(o.harness))throw new Error(`Provenance adapter collision for "${o.harness}".`);const i=r.get(o.harness);if(i&&o.priority<=i.priority)throw new Error(`Provenance adapter override for "${o.harness}" requires priority greater than ${i.priority}.`);const a=O.get(o.harness);if(a&&JSON.stringify(a.adapter)!==JSON.stringify(o))throw new Error(`Provenance adapter collision for "${o.harness}".`);s.add(o.harness)}for(const o of n){const i=O.get(o.harness);O.set(o.harness,{adapter:o,registrations:(i?.registrations??0)+1})}let t=!0;return()=>{if(t){t=!1;for(const o of n){const i=O.get(o.harness);!i||i.registrations<=1?O.delete(o.harness):i.registrations-=1}}}}function Ve(e,n){const r=n.trim().slice(0,256);let s=r.toLowerCase();if(e==="model"){const t=/^(gpt-\d+(?:\.\d+)?)/u.exec(s)?.[1];t&&(s=t)}else s=s.replaceAll(/[_\s-]+/gu,""),s={minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max",ultra:"ultra"}[s]??s;return{raw:r,normalized:s,vocabulary:"v1"}}function Be(e,n){return F.run(e,n)}function Ge(e,n,r={}){const s=e.map(g);return j(s),k.run({descriptors:s,probesEnabled:r.probesEnabled!==!1},n)}function U(e){const n=$(e),r=n.env??{},s=j(n.descriptors),t=[...(n.argv??[]).slice(0,3),...n.process_labels??[]].slice(0,64).map(_=>_.slice(0,512)),o=n.client_info?.name.trim().toLowerCase()??"",i=s.find(_=>Ee(_,r,t,o)),a=B(n,r),l=[M(r,i?.session_environment_keys),u(n.client_info?.session)?.slice(0,256)].find(_=>_!==void 0),c=Se(i?.harness,l),f=re({cwd:n.cwd??process.cwd(),env:r,key:c}),v=Ae(n,r,i,a,f),m=v.model,p=[["harness",i?.harness],["model",m?.value],["model_source",m?.source],["session",l],["instance",c],["provenance",Object.keys(v).length>0?v:void 0],["episode",a.episode]];return Object.fromEntries(p.filter(_=>_[1]!==void 0))}function Ce(e){return e==="unavailable"?{status:"unavailable",reason:"harness_unavailable"}:e==="missing"?{status:"unavailable",reason:"resolver_input_missing"}:{status:"failed",reason:"resolver_failed"}}function ke(e,n,r,s,t,o,i){const a=r?.provenance_resolvers[e];if(n.provenance?.[e])return{status:"resolved",...a?{resolver:a}:{},rule_version:"v1"};if(i)return{status:"unavailable",reason:"invalid_value",rule_version:"v1"};if(a){if(!o)return{status:"unavailable",reason:"probes_disabled",resolver:a,rule_version:"v1"};const l=ge(a,r,s,t);return{...Ce(l),resolver:a,rule_version:"v1"}}return{status:r?.provenance_unavailable_dimensions.includes(e)?"unavailable":"not_configured",reason:r?.provenance_unavailable_dimensions.includes(e)?"harness_unavailable":"resolver_not_configured",rule_version:"v1"}}function Fe(e){const n=$(e),r=U(n),s=j(n.descriptors).find(c=>c.harness===r.harness),t=n.env??{},o=n.probes_enabled!==!1&&k.getStore()?.probesEnabled!==!1&&!["0","false","off"].includes(u(t.PM_AGENT_PROBES)?.toLowerCase()??""),i=B(n,t),a=[t.PM_AGENT_ROLE,i.provenance?.role,M(t,s?.provenance_environment_keys.role),n.client_info?.provenance?.role,n.provenance?.role,q(n.argv??[],"role")].some(c=>{const f=u(c)?.slice(0,256);return f!==void 0&&b("role",f)===void 0}),l=Object.fromEntries(R.map(c=>[c,ke(c,r,s,n,t,o,c==="role"&&a)]));return{...r,provenance_outcomes:l}}function Xe(){return process.env.PM_AUTHOR}function We(e){e===void 0?delete process.env.PM_AUTHOR:process.env.PM_AUTHOR=e}function Ye(e){return U(e).harness}function Pe(e,n,r){const s=$(r),t=U(s);if(e!==void 0){const i=u(e);return N(i,"--author"),i?{author:i,source:"asserted",...t}:{author:"unknown",source:"unknown",...t}}if(s.env?.PM_AUTHOR!==void 0){const i=u(s.env.PM_AUTHOR);return N(i,"PM_AUTHOR"),i?{author:i,source:"asserted",...t}:{author:"unknown",source:"unknown",...t}}const o=u(n);return o?(N(o,"default_author"),{author:o,source:"configured",...t}):t.harness?{author:`harness:${t.harness}`,source:"detected",...t}:{author:"unknown",source:"unknown",...t}}function qe(e){const n=C.getStore();return n?.author===e?n.source:e.startsWith("harness:")?"detected":e==="unknown"?"unknown":"asserted"}function Je(e){const n=C.getStore();return n?.author!==e?e.startsWith("harness:")?{harness:e.slice(8)}:{}:{...n.harness?{harness:n.harness}:{},...n.model?{model:n.model}:{},...n.model_source?{model_source:n.model_source}:{},...n.session?{session:n.session}:{},...n.instance?{instance:n.instance}:{},...n.provenance?{provenance:n.provenance}:{},...n.episode?{episode:n.episode}:{}}}function Ke(e){const n=C.getStore();return n?.author===e&&n.source==="detected"&&n.instance?`${e}#${n.instance}`:e}function Ze(e,n){const r=Pe(e,n);return C.enterWith(r),r.author}export{R as AGENT_PROVENANCE_DIMENSIONS,W as BUILTIN_AGENT_PROVENANCE_ADAPTERS,x as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,U as detectAgentIdentity,Ye as detectHarnessIdentity,Fe as diagnoseAgentIdentity,$e as listAgentProvenanceAdapters,Ve as normalizeAgentProvenanceAdapterValue,Xe as readAuthorEnvironment,Ue as registerAgentProvenanceAdapters,He as registerHarnessSignalDescriptors,Ze as resolveAuthor,Pe as resolveAuthorIdentity,Ke as resolveClaimPrincipal,Je as resolveHistoryAgentIdentity,qe as resolveHistoryAuthorSource,Be as runWithHarnessDetectionSignals,Ge as runWithWorkspaceHarnessSignalDescriptors,We as writeAuthorEnvironment};
|
|
6
6
|
//# sourceMappingURL=author.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const o=t=>{let n='"',e=0;for(const r of t){if(r==="\\"){e+=1;continue}n+="\\".repeat(r==='"'?e*2+1:e),n+=r,e=0}return`${n}${"\\".repeat(e*2)}"`},s=(t,n=process.platform)=>(n==="win32"?/^[A-Za-z0-9._:/\\@=-]+$/:/^[A-Za-z0-9._:/@=-]+$/).test(t)?t:n==="win32"?o(t):`"${t.replace(/(["\\$`])/g,"\\$1")}"`,a=(t,n=process.platform)=>{const e=t.map(r=>s(r,n)).join(" ");return e.length>0?`pm ${e}`:"pm"};export{s as quoteCommandArg,o as quoteWindowsCommandArg,a as renderPmCommand};
|
|
2
2
|
//# sourceMappingURL=command-line.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="40feb89e-a797-5d1d-8797-957fa490add4")}catch{}})();
|
|
2
1
|
//# sourceMappingURL=command-types.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const o=/^\s*(<<<<<<<|=======|>>>>>>>)(?:\s.*)?$/;function a(t){if(t.length===0)return[];const e=t.split(/\r?\n/),r=[];for(let n=0;n<e.length;n+=1){const s=e[n]??"",c=s.match(o);if(!c)continue;const i=c[1];r.push({line:n+1,marker:i,text:s})}return r}function f(t){return a(t)[0]}export{f as findFirstMergeConflictMarker,a as findMergeConflictMarkers};
|
|
2
2
|
//# sourceMappingURL=conflict-markers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{createDefaultExtensionGovernancePolicy as s}from"../extensions/extension-types.js";import{ITEM_METADATA_KEY_ORDER as A,ITEM_PROJECT_CONTEXT_KEYS as R}from"./item-metadata-contract.js";const n=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),a=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),m=".agents/pm",f="settings.json",E="Closed at creation via pm create",_=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],l=["decisions","events","reminders","milestones","meetings","plans"],h=[..._,...l],g={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},c={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},d=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],r={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function i(t){return t?[...t]:void 0}const k={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...d],lifecycle_closure_like_blocked_reason_patterns:[...r.blocked_reason],lifecycle_closure_like_resolution_patterns:[...r.resolution],lifecycle_closure_like_actual_result_patterns:[...r.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...c.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:n.map(t=>({...t,aliases:i(t.aliases),roles:i(t.roles)})),fields:[],workflow:{...a},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:s()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",default_mode:"auto",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,next_ranking_policy:"priority_floor",sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},v={metadata:{},body:""},T={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},u=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});function w(t){const e=(t??"").trim().toLowerCase();if(e.length===0)return"unknown";const o=u[e];return typeof o=="string"?o:e.includes("conflict")||e.includes("locked")?"conflict":e.startsWith("unknown_")||e.startsWith("missing_required_")?"usage":e.startsWith("invalid_")||e.endsWith("_not_found")||e.includes("validation")?"validation":e.endsWith("_error")||e.endsWith("_failed")?"runtime":"unknown"}export{E as CREATE_DIRECT_CLOSE_REASON_DEFAULT,n as DEFAULT_STATUS_DEFINITIONS,r as DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS,d as DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS,a as DEFAULT_WORKFLOW_DEFINITION,v as EMPTY_CANONICAL_DOCUMENT,T as EXIT_CODE,c as GOVERNANCE_PRESET_DEFAULTS,A as ITEM_METADATA_KEY_ORDER,R as ITEM_PROJECT_CONTEXT_KEYS,_ as PM_CORE_REQUIRED_SUBDIRS,m as PM_DIRNAME,l as PM_OPTIONAL_TYPE_SUBDIRS,h as PM_REQUIRED_SUBDIRS,k as SETTINGS_DEFAULTS,f as SETTINGS_FILENAME,u as TELEMETRY_ERROR_CATEGORY_BY_CODE,g as TYPE_TO_FOLDER,w as resolveTelemetryErrorCategory};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const c=Object.freeze({max_bytes:4096,max_depth:8}),m=160,A=new Set(["not_plain_object","unsupported_value","non_finite_number","malformed_unicode","reserved_key","depth_limit","byte_limit","diagnostic_budget"]),h=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u,C=new Set(["__proto__"]);class s extends Error{reason;path;constructor(t,r){super(t),this.reason=t,this.path=r}}function p(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function k(e,t){return/^[A-Za-z_$][\w$]*$/u.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function w(e){if(Buffer.byteLength(e,"utf8")<=m)return e;let t="",r=Buffer.byteLength("\u2026","utf8");for(const n of e){if(r+=Buffer.byteLength(n,"utf8"),r>m)break;t+=n}return`${t}\u2026`}function a(e,t,r){if(e.bytes+=t,!(e.bytes<=c.max_bytes))throw new s("byte_limit",r)}function O(e,t,r){if(e.bytes+t>c.max_bytes)throw new s("byte_limit",r)}function b(e,t,r){const n=Object.getOwnPropertyDescriptor(e,t);if(n===void 0||!("value"in n))throw new s("unsupported_value",r);return n.value}function N(e,t,r){if(typeof e=="number"&&!Number.isFinite(e))throw new s("non_finite_number",t);if(typeof e=="string"&&(O(r,e.length+2,t),h.test(e)))throw new s("malformed_unicode",t);if(e!==null&&!["boolean","number","string"].includes(typeof e))throw new s("unsupported_value",t);return a(r,Buffer.byteLength(JSON.stringify(e),"utf8"),t),e}function D(e,t,r,n){if(typeof e!="object"||e===null)return N(e,t,n);if(r>=c.max_depth)throw new s("depth_limit",t);if(Array.isArray(e)){const i=b(e,"length",t);if(typeof i!="number"||!Number.isSafeInteger(i)||i<0)throw new s("unsupported_value",t);a(n,i>0?i+1:2,t);const f=[];for(let o=0;o<i;o+=1){const u=`${t}[${o}]`;f.push(D(b(e,String(o),u),u,r+1,n))}return f}if(!p(e))throw new s("unsupported_value",t);return E(e,t,r+1,n)}function E(e,t,r,n){const i=Object.keys(e);a(n,i.length>0?i.length+1:2,t);const f={};for(const o of i){O(n,o.length+3,t);const u=k(t,o);if(C.has(o))throw new s("reserved_key",u);if(h.test(o))throw new s("malformed_unicode",u);a(n,Buffer.byteLength(JSON.stringify(o),"utf8")+1,u),f[o]=D(b(e,o,u),u,r,n)}return f}function T(e){try{if(e instanceof s)return e}catch{}return new s("unsupported_value","details")}function j(e){const t=c.max_bytes,r={bytes:0};try{if(!p(e))throw new s("not_plain_object","details");return{ok:!0,details:E(e,"details",0,r),byte_length:r.bytes}}catch(n){const i=T(n);return{ok:!1,omission:i.reason==="byte_limit"?{reason:"byte_limit",byte_limit:t}:{reason:i.reason,path:w(i.path),byte_limit:t}}}}function M(e){return j(e).ok}function F(e){if(e===void 0)return;const t=j(e);return t.ok?{details:t.details}:{details_omitted:t.omission}}function d(){return{reason:"unsupported_value",path:"details",byte_limit:c.max_bytes}}function g(e,t){const r=Object.getOwnPropertyDescriptor(e,t);return r!==void 0&&"value"in r?r.value:void 0}function I(e){if(!p(e))return;const t=g(e,"reason");if(typeof t!="string"||!A.has(t))return;const r=g(e,"path"),n=typeof r=="string"?w(r):void 0;return{reason:t,...n===void 0?{}:{path:n},byte_limit:c.max_bytes}}function L(e){const t={};try{if(typeof e!="object"||e===null||Array.isArray(e))return t;for(const[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))n.enumerable&&("value"in n?Object.defineProperty(t,r,{value:n.value,enumerable:!0,writable:!0,configurable:!0}):r==="details"&&(t.details_omitted=d()));return t}catch{return{}}}function R(e){if(!(typeof e!="object"||e===null))try{const t=Object.getOwnPropertyDescriptor(e,"details");if(t!==void 0&&!("value"in t))return{details_omitted:d()};if(t!==void 0&&t.value!==void 0)return F(t.value);const r=Object.getOwnPropertyDescriptor(e,"details_omitted"),n=r!==void 0&&"value"in r?I(r.value):void 0;return n===void 0?void 0:{details_omitted:n}}catch{return{details_omitted:d()}}}const S=new Set(["details","details_omitted"]);function P(e){const t={};for(const r of Object.keys(e)){if(S.has(r)||r==="toJSON")continue;const n=Object.getOwnPropertyDescriptor(e,r);n!==void 0&&"value"in n&&Object.defineProperty(t,r,{value:n.value,enumerable:!0,writable:!0,configurable:!0})}return t}function J(e){if(typeof e!="object"||e===null)return e;try{return Array.isArray(e)?e:{...P(e),...R(e)}}catch{return{details_omitted:d()}}}function Y(e){if(typeof e!="object"||e===null)return e;try{return Array.isArray(e)?e:P(e)}catch{return{}}}function K(e){const t={};for(const[r,n]of Object.entries(L(e)))S.has(r)||r==="toJSON"||(n===null||typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&Object.defineProperty(t,r,{value:n,enumerable:!0,writable:!0,configurable:!0});return t}const B=12,$=new Set(["context","error_context"]),x=new Set(["arguments"]);function V(e){const t=new WeakSet,r=(n,i)=>{if(typeof n!="object"||n===null||i>B||t.has(n))return;t.add(n);const f=n;let o;try{o=Object.keys(f)}catch{return}for(const u of o){const l=Object.getOwnPropertyDescriptor(f,u);if(l===void 0||!("value"in l))continue;const _=l.value,y=$.has(u)?{}:x.has(u)?[]:_;y!==_&&(f[u]=y),r(y,i+1)}};r(e,0)}export{c as PM_CLI_ERROR_DETAILS_LIMITS,j as admitPmCliErrorDetails,K as crashReportErrorContext,M as isPmCliErrorDetails,V as omitEmbeddedPmCliErrorDetails,Y as omitPmCliErrorDetails,J as projectPmCliErrorContextDetails,R as projectPmCliErrorContextDetailsSlot,F as projectPmCliErrorDetails,L as snapshotPmCliErrorContext};
|
|
2
2
|
//# sourceMappingURL=error-details.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
class s extends Error{exitCode;code;context;constructor(r,o,e={}){super(r),this.name="PmCliError",this.exitCode=o,this.context=e,this.code=e.code}}export{s as PmCliError};
|
|
2
2
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const i=Object.freeze({"<":"<",">":">",""":'"',"'":"'","&":"&"}),s=/&(?:lt|gt|quot|#39|amp);/g;function p(t){return typeof t!="string"||!t.includes("<")&&!t.includes(">")?t:t.replace(s,r=>i[r])}function u(t){return n(t,new WeakMap)}function n(t,r){if(typeof t=="string")return p(t);if(Array.isArray(t)){if(r.has(t))return r.get(t);const e=[];r.set(t,e);for(const o of t)e.push(n(o,r));return e}if(t!==null&&typeof t=="object"){if(!b(t))return t;if(r.has(t))return r.get(t);const e=t,o=Object.create(Object.getPrototypeOf(t));r.set(t,o);for(const[c,f]of Object.entries(e))Object.defineProperty(o,c,{value:n(f,r),enumerable:!0,writable:!0,configurable:!0});return o}return t}function b(t){const r=Object.getPrototypeOf(t);return r===Object.prototype||r===null}export{p as decodeHtmlEntitiesIfEscaped,u as decodeHtmlEntitiesInOptions};
|
|
2
2
|
//# sourceMappingURL=html-entity-decode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"./command-types.js";export*from"./constants.js";export*from"./errors.js";export*from"./primitives.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],t=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","deferred_fields","design","external_ref","definition_of_ready","order",...e,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],s=t;export{s as ITEM_METADATA_KEY_ORDER,e as ITEM_PROJECT_CONTEXT_KEYS};
|
|
2
2
|
//# sourceMappingURL=item-metadata-contract.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function t(r){let e=null;return()=>(e??=r(),e)}export{t as createLazyModule};
|
|
2
2
|
//# sourceMappingURL=lazy-module.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function M(o,e,u){if(o===e)return 0;if(Math.abs(o.length-e.length)>u)return null;const s=e.length+1,i=new Array(s),r=new Array(s),c=new Array(s);for(let t=0;t<s;t+=1)i[t]=0,r[t]=t;for(let t=1;t<=o.length;t+=1){c[0]=t;let a=c[0];for(let n=1;n<=e.length;n+=1){const w=o[t-1]===e[n-1]?0:1,h=r[n-1]+w,d=c[n-1]+1,m=r[n]+1;let l=Math.min(h,d,m);t>1&&n>1&&o[t-1]===e[n-2]&&o[t-2]===e[n-1]&&(l=Math.min(l,i[n-2]+1)),c[n]=l,l<a&&(a=l)}if(a>u)return null;for(let n=0;n<s;n+=1)i[n]=r[n],r[n]=c[n]}const f=r[e.length];return f<=u?f:null}export{M as levenshteinDistanceWithinLimit};
|
|
2
2
|
//# sourceMappingURL=levenshtein.js.map
|
package/dist/core/shared/memo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function n(e){let t=Math.ceil(e.size/2);for(const i of e.keys()){if(t===0)return;e.delete(i),t-=1}}export{n as evictOldestMemoEntries};
|
|
2
2
|
//# sourceMappingURL=memo.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{EXIT_CODE as n}from"./constants.js";import{PmCliError as t}from"./errors.js";function u(e,i="--limit"){if(e===void 0)return;const r=Number(e);if(!Number.isFinite(r)||r<0)throw new t(`${i} must be a non-negative number`,n.USAGE);return Math.floor(r)}export{u as parseLimit};
|
|
2
2
|
//# sourceMappingURL=numeric-parsers.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function n(e){return e.split(/[\s,|]+/).map(r=>r.trim()).filter(r=>r.startsWith("--"))}function i(e){return n(e)[0]??null}function u(e,r){const l=i(r);if(l===null)return!1;const s=t=>t.slice(2).replaceAll("-","_");return n(e).some(t=>!t.slice(2).includes("-")||l===t?!1:s(l)===s(t))}export{i as extractLongFlag,n as extractLongFlags,u as isPureSnakeCaseAlias};
|
|
2
2
|
//# sourceMappingURL=option-alias-visibility.js.map
|