@unbrained/pm-cli 2026.11.3 → 2026.11.4
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/CHANGELOG.md +10 -0
- package/dist/cli/error-guidance.d.ts +14 -35
- package/dist/cli/error-guidance.js +2 -2
- package/dist/cli/expected-revisions.d.ts +55 -0
- package/dist/cli/expected-revisions.js +2 -0
- package/dist/cli/main.js +2 -2
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-UYNMKUGA.js → chunk-2GW662DP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-32BCU6HN.js → chunk-3OXQGGRD.js} +46 -46
- package/dist/cli-bundle/chunks/chunk-5BVZ32G7.js +2 -0
- package/dist/cli-bundle/chunks/chunk-5S6RT5LX.js +9 -0
- package/dist/cli-bundle/chunks/chunk-5Z6LWFDL.js +31 -0
- package/dist/cli-bundle/chunks/{chunk-MQJXZX3Q.js → chunk-6T2V3UIK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5JZMF4M5.js → chunk-7PGNAHNW.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7RCI7AAA.js +20 -0
- package/dist/cli-bundle/chunks/chunk-AQ5UHHQS.js +2 -0
- package/dist/cli-bundle/chunks/chunk-BK2XAQVC.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-TZ3D3DPQ.js → chunk-BRIPGUAO.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-BWAXA6S4.js +6 -0
- package/dist/cli-bundle/chunks/{chunk-5IPXDZKU.js → chunk-CERNIZLB.js} +66 -66
- package/dist/cli-bundle/chunks/chunk-DSCFJTHB.js +122 -0
- package/dist/cli-bundle/chunks/{chunk-JPKIUWLG.js → chunk-L4BKTPJ6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Y7H55PCY.js → chunk-NPEDFOVQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2CBHQXYJ.js → chunk-ODMJ3HIB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DEJHTFEF.js → chunk-QN7VCOUU.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-QQHMNUZT.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SRDO2NJU.js +2 -0
- package/dist/cli-bundle/chunks/chunk-T56MB6SF.js +2 -0
- package/dist/cli-bundle/chunks/chunk-TX2W6G37.js +3 -0
- package/dist/cli-bundle/chunks/item-revision-UAZOBP2Q.js +2 -0
- package/dist/cli-bundle/chunks/item-transaction-N5F4LXYV.js +2 -0
- package/dist/cli-bundle/chunks/mutation-admission-QZQI2NN5.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-I6AZA3IX.js → register-list-query-P3NOKQUA.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-3DAXCLXR.js → register-mutation-A6I5K5N6.js} +2 -2
- package/dist/cli-bundle/chunks/register-operations-SPKB3TNM.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-ZZRHJ4IS.js +2 -0
- package/dist/cli-bundle/chunks/{stage-7H36OTDJ.js → stage-L3T725DS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-5NGNO54M.js +44 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZQRCVRGS.js → chunk-A2246ZM7.js} +54 -54
- package/dist/cli-bundle/focused-chunks/chunk-B6U44WPW.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-BAW3DGQO.js +91 -0
- package/dist/cli-bundle/focused-chunks/chunk-BHNY3KPJ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-LKN2WGGB.js → chunk-C7UX2ZI3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YVLAP3BL.js → chunk-CBG67HUP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TYHDZUL4.js → chunk-CO2DNPH7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-CXTDEQ3N.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-FEPE2CE4.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-RY4QEMAE.js → chunk-FFO7RBLN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-I5FODKYB.js → chunk-FXFDVM5O.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-J3YOATXR.js +80 -0
- package/dist/cli-bundle/focused-chunks/{chunk-HOXIIZEO.js → chunk-J6FDCAMH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-J7M52SCZ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-JQS7TYQ6.js +12 -0
- package/dist/cli-bundle/focused-chunks/chunk-MEJKELWC.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-PMKR4MJI.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-PNPYQDHU.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Q4OIRSKL.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-F3X6UWMI.js → chunk-QEVJ3Y67.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-HJ27QLZV.js → chunk-SDLIUZEL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-TFYTTDAK.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-W3CSX6GI.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-D4XQOMG4.js → chunk-Y5GOUUYJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/item-revision-L6GVT42D.js +2 -0
- package/dist/cli-bundle/focused-chunks/item-transaction-GYGP264N.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-UWTH56OD.js +2 -0
- package/dist/cli-bundle/focused-chunks/{stage-4SQHVI3O.js → stage-WRSNJ7VI.js} +2 -2
- package/dist/cli-bundle/main.js +25 -25
- 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 +57 -57
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +11 -11
- package/dist/core/config/positional-value.d.ts +1 -1
- package/dist/core/config/positional-value.js +1 -1
- package/dist/core/extensions/reserved-host-flags.js +1 -1
- package/dist/core/history/history-rewrite.js +1 -1
- package/dist/core/shared/command-types.d.ts +7 -0
- package/dist/core/store/item-mutation-precondition.d.ts +70 -6
- package/dist/core/store/item-mutation-precondition.js +1 -1
- package/dist/core/store/item-store.js +1 -1
- package/dist/core/store/settings-validator.js +1 -1
- package/dist/core/store/settings.js +1 -1
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
- package/dist/sdk/cli-contracts/completeness.js +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +11 -0
- package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/registration-helpers.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-program.js +1 -1
- package/dist/sdk/config.d.ts +1 -1
- package/dist/sdk/config.js +1 -1
- package/dist/sdk/environment/project-runtime-compatibility.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/governance/validate.js +1 -1
- package/dist/sdk/history/salvage.js +3 -3
- package/dist/sdk/history-compact.d.ts +7 -1
- package/dist/sdk/history-compact.js +1 -1
- package/dist/sdk/history-repair.d.ts +2 -1
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/index.d.ts +3 -0
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +10 -2
- package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
- package/dist/sdk/lifecycle/claim.js +1 -1
- package/dist/sdk/lifecycle/close-many.d.ts +11 -2
- package/dist/sdk/lifecycle/close-many.js +1 -1
- package/dist/sdk/lifecycle/close.d.ts +15 -0
- package/dist/sdk/lifecycle/close.js +1 -1
- package/dist/sdk/lifecycle/item-revision.d.ts +162 -0
- package/dist/sdk/lifecycle/item-revision.js +2 -0
- package/dist/sdk/lifecycle/restore.js +1 -1
- package/dist/sdk/lifecycle/start-blockers.d.ts +52 -0
- package/dist/sdk/lifecycle/start-blockers.js +2 -0
- package/dist/sdk/lifecycle/task-composition.d.ts +11 -0
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/lifecycle/update-many.d.ts +11 -2
- package/dist/sdk/lifecycle/update-many.js +1 -1
- package/dist/sdk/lifecycle/update.js +2 -2
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/declared-blockers.d.ts +16 -0
- package/dist/sdk/query/declared-blockers.js +2 -0
- package/dist/sdk/query/get.d.ts +7 -0
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/projection-contracts.js +1 -1
- package/dist/sdk/runtime-input.d.ts +12 -0
- package/dist/sdk/runtime-input.js +1 -1
- package/dist/sdk/runtime.d.ts +10 -0
- package/dist/sdk/runtime.js +1 -1
- package/dist/sdk/structured-mutations.js +1 -1
- package/dist/sdk/test/batch.js +2 -2
- package/dist/sdk/test/execution.js +2 -2
- package/dist/sdk/test/linked-command-detection.js +1 -1
- package/dist/sdk/workspace-transaction.d.ts +17 -6
- package/dist/sdk/workspace-transaction.js +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +1 -1
- package/docs/COMMANDS.md +91 -0
- package/docs/CONFIGURATION.md +1 -0
- package/docs/SDK.md +110 -1
- package/docs/agent-task-token-baseline.json +1 -1
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +111 -111
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +12 -3
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-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/dist/cli-bundle/chunks/chunk-7ZEFHFAU.js +0 -2
- package/dist/cli-bundle/chunks/chunk-B6UTLYLM.js +0 -3
- package/dist/cli-bundle/chunks/chunk-HBKD5HZB.js +0 -2
- package/dist/cli-bundle/chunks/chunk-L6LCLC37.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NR4KABHC.js +0 -31
- package/dist/cli-bundle/chunks/chunk-PWD5RY2D.js +0 -2
- package/dist/cli-bundle/chunks/chunk-XRMYA4R7.js +0 -20
- package/dist/cli-bundle/chunks/chunk-YWS4XV4I.js +0 -6
- package/dist/cli-bundle/chunks/chunk-ZOAJNPBL.js +0 -129
- package/dist/cli-bundle/chunks/item-transaction-ZHLJTBD7.js +0 -2
- package/dist/cli-bundle/chunks/mutation-admission-ZQMRMGIB.js +0 -2
- package/dist/cli-bundle/chunks/register-operations-G3QGGQ5Z.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-LDXHMNOT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-3XGKBVJ3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-4HY6EGPB.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-AK2CI2GI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HUXZCPWT.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-IKXJ57XA.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-MOY6KZGJ.js +0 -44
- package/dist/cli-bundle/focused-chunks/chunk-PWUTFKSI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-PZRB7IXH.js +0 -91
- package/dist/cli-bundle/focused-chunks/chunk-WSYPVBKS.js +0 -80
- package/dist/cli-bundle/focused-chunks/chunk-WXLG7HZ5.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-WZDFCVLX.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-YGO3FWA2.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZYXQACPB.js +0 -2
- package/dist/cli-bundle/focused-chunks/item-transaction-PZ2FQ6B2.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-XOOK6XFH.js +0 -2
package/dist/cli/main.js
CHANGED
|
@@ -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]="24927174-96e0-5a97-bf58-8ecd6c4ac0c4")}catch{}})();import{attachPreflightWarnings,attachSerializedPreflightWarnings,emitPreflightWarning,runWithPreflightWarnings}from"./preflight-warnings.js";import{Command,CommanderError}from"commander";import{PM_COMMAND_ALIAS_CONTRACTS,findPmNamespacedCommand,resolvePmCommandOperation}from"../sdk/cli-contracts/command-aliases.js";import{createPmCliProgram}from"../sdk/cli-program.js";import{runWithDiscoveredContextIntentContracts}from"../sdk/context-intent-runtime.js";import{createExtensionCommandError,describeUnknownError,isCommanderError,normalizeThrownExitCode,readThrownExitCode,wrapThrownErrorForSentry}from"../sdk/error-runtime.js";import{createExtensionCommandSdk}from"../sdk/extension-command-context.js";import{isPmCliExpectedError,snapshotPmCliErrorContext}from"../sdk/errors.js";import{runExtensionMigrations}from"../sdk/extension/migrations.js";import{repairProjectionRecovery}from"./runtime/projection-retry.js";import{repairSchemaFieldRecovery}from"./runtime/field-route-retry.js";import{applyInvocationAuthorOverride}from"../sdk/invocation-author.js";import{attachOutputTokenAccounting}from"../sdk/output-token-accounting.js";import{validateReadOutputOptions}from"../sdk/read-output-contracts.js";import{runWithReproducibleProcessEnvironment}from"../sdk/reproducibility/process.js";import{resolveTelemetrySourceAttribution,EXIT_CODE,PmCliError,activateExtensions,clearActiveExtensionHooks,consumeAfterCommandAffectedItems,createCoreCommandHookContext,createEmptyExtensionRegistrationRegistry,createLazyModule,deriveTelemetryCommandResolution,discoverExtensions,emitTelemetryErrorEvent,ensureSentryInit,ensureSentryCommandTracing,getActiveCommandResult,getActiveExtensionRegistrations,getSettingsPath,loadExtensions,maybeRunFirstUseTelemetryPrompt,pathExists,printError,printResult,readSettings,readSettingsWithMetadata,resetActiveExtensionRuntimeState,resolveGlobalPmRoot,resolveItemTypeRegistry,resolvePmCliVersion,resolvePmPackageRootFromModule,resolvePmRoot,resolveRuntimeFieldRegistry,resolveTelemetryErrorCategory,runActiveCommandHandler,runActiveParserOverride,runActivePreflightOverride,runAfterCommandHooks,runBeforeCommandHooks,runWithConfigurationOnlySettings,runWithHarnessDetectionSignals,runWithWorkspaceHarnessSignalDescriptors,sentryCaptureCliError,sentryDiscardCommandSpan,sentryFinishCommandSpan,sentryFlush,sentryLogCliUsageError,sentrySetCommandContext,sentryStartCommandSpan,setActiveCommandContext,setActiveCommandResult,setActiveExtensionCommands,setActiveExtensionHooks,setActiveExtensionParsers,setActiveExtensionPreflight,setActiveExtensionRegistrations,setActiveExtensionRenderers,setActiveExtensionServices,startTelemetryCommand,writeStderr}from"../sdk/runtime-primitives.js";import{PmClient}from"../sdk/runtime.js";import{recordDeprecatedAliasUsage}from"../sdk/telemetry.js";import{finishActiveTelemetryCommand,recordAfterCommandContextUsage}from"./after-command-context-usage.js";import{extractProvidedOptionFlags,normalizeLongOptionFlag,redactSensitiveCommandArgs,renderPmCommand}from"./argv-utils.js";import{applyBootstrapPagerPolicy,findBootstrapCommandTokenIndex,normalizeBootstrapInvocation,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,stripGlobalBootstrapTokens}from"./bootstrap-args.js";import{installCommandNamespaces}from"./command-namespaces.js";import{appendCommanderExtensionFailures,formatCommanderUsageJson,formatCommanderUsageMessage,isKnownHelpCommandPath,resolveCommanderUsageContext,resolveUnknownCommanderToken}from"./commander-usage.js";import{loadContextIntentSnapshotForInvocation}from"./context-intent-invocation.js";import{classifyCommanderError,classifyPmCliError,classifyUnknownError,formatPmCliErrorForDisplay,formatPmCliErrorForJson,formatUnknownErrorForJson,projectLeanErrorEnvelope}from"./error-guidance.js";import{applyDynamicExtensionArguments,applyDynamicExtensionFlagOptions,buildCanonicalExtensionAliases,buildDynamicExtensionCommandMetadataHelp,buildResidualDynamicExtensionFlagHelp,collectDynamicExtensionFlagHelpByCommand,collectExtensionCommandHelpDescriptors,collectSafeExtensionCommandPaths,ensureCommandPath,extensionFlagTakesValueForInvocation,findCommandByPath,normalizeExtensionCommandPath,reportExtensionCommandCollision}from"./extension-command-help.js";import{collectLoosePositionalArgs,stripLooseCommandOptionTokens}from"./extension-command-options.js";import{loadExtensionRecoveryFailures,loadUnknownCommandRecoveryFailures}from"./extension-recovery.js";import{attachRichHelpText,isFullHelpDiscovery,setPmCommandHelpVisibilityTier}from"./help-content.js";import{attachCreateUpdatePolicyHelpText,maybeRenderBootstrapJsonHelp}from"./help-json-payload.js";import{collectMandatoryMigrationBlockers,enforceItemFormatWriteGateAndPreflightMigration,enforceMandatoryMigrationWriteGate,enforceMutationGuardPreflight}from"./migration-gates.js";import{applyDefaultOutputFormat,clearResolvedGlobalOptions,collect,formatHookWarnings,getCommandPath,getGlobalOptions,invalidateSearchCachesForMutation,setResolvedGlobalOptions,syncCommanderActionOptions}from"./registration-helpers.js";import{activationCommandMatchesProbe,buildBootstrapActivationProbe,buildRuntimeExtensionActivationScope,buildRuntimeExtensionFilterForProbe,collectActivationCommandCandidates,collectLeadingCommandArgs,collectParsedActivationCommandArgs,commandPathNeedsSearchExtensions,commandPathNeedsTemplateExtensions,discoveryNeedsActivationForProbe,extensionActivationCommands,extensionCapabilities,extensionNeedsActivationForProbe,extensionProvidesTemplatesRuntime,hasAnyCapability,hasGlobalExtensionContributions,matchesStaticExtensionCommand,probeUsesAnyFlag,resolveStaticExtensionActivationDecision}from"./runtime/activation.js";import{collectExtensionFlagDefinitionsForCommand,collectExtensionFlagDefinitionsForInvocation,copyReadOutputInvocationProvenance,dynamicCommandArguments,extractCommandScopedOptions,forwardReadOutputIncludeModes,isImporterOrExporterCommandPath,recordCliReadOutputInvocationProvenance,validateDynamicExtensionCommandArgs,validateDynamicExtensionCommandInvocation}from"./runtime/invocation-options.js";import{LIST_QUERY_COMMAND_NAMES,enforceExplicitRetryForFlagTypos,invocationRequestsVersion,isStaticExtensionInventoryInvocation,resolveStructuredMutationPreviewInvocation,resolveCoreCommandRegistrationSelection,shouldAttachRichHelpTextForInvocation,shouldRegisterDynamicExtensionPaths,shouldRegisterRuntimeSchemaFlags}from"./runtime/selection.js";import{buildPostActionTelemetryOutcome,inferPostActionErrorCode,inferPostActionFailureMessage,normalizeTelemetryCommandResolution,normalizeTelemetryErrorCategory,normalizeTelemetryResolutionStage,readRecordBoolean,readRecordNumber,readRecordString}from"./runtime/telemetry-outcome.js";const PM_PACKAGE_ROOT_ENV="PM_CLI_PACKAGE_ROOT",DEPRECATED_ALIAS_INVOCATION=Symbol("pm.deprecatedAliasInvocation"),COMMAND_ALIASES_BY_FIRST_TOKEN=new Map;for(const contract of PM_COMMAND_ALIAS_CONTRACTS){const firstToken=contract.alias.split(" ")[0],matches=COMMAND_ALIASES_BY_FIRST_TOKEN.get(firstToken)??[];matches.push(contract),COMMAND_ALIASES_BY_FIRST_TOKEN.set(firstToken,matches)}for(const matches of COMMAND_ALIASES_BY_FIRST_TOKEN.values())matches.sort((left,right)=>right.alias.split(" ").length-left.alias.split(" ").length);function resolvePmPackageRoot(){return resolvePmPackageRootFromModule(import.meta.url,["../.."])}(typeof process.env[PM_PACKAGE_ROOT_ENV]!="string"||process.env[PM_PACKAGE_ROOT_ENV]?.trim().length===0)&&(process.env[PM_PACKAGE_ROOT_ENV]=resolvePmPackageRoot());let activeExtensionHookContext=null,activeTelemetryCommandContext=null,activeSentryCommandContext=null;function setActiveExtensionHookContextForTest(context){activeExtensionHookContext=context}function setActiveRuntimeExtensionCommandDescriptorsForTest(descriptors){activeRuntimeExtensionCommandDescriptors=descriptors}let runtimeExtensionSnapshotCache=null,runtimeExtensionDiscoverySnapshotCache=null,activeRuntimeExtensionCommandDescriptors=new Map;const HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS=250,EXPECTED_HANDLED_ERROR_EXIT_CODES=new Set([EXIT_CODE.USAGE,EXIT_CODE.NOT_FOUND,EXIT_CODE.CONFLICT]),TRUE_LIKE_ENV_VALUES=new Set(["1","true","yes","on"]),loadSetupRegistrationModule=createLazyModule(()=>import("./register-setup.js")),loadListQueryRegistrationModule=createLazyModule(()=>import("./register-list-query.js")),loadMutationRegistrationModule=createLazyModule(()=>import("./register-mutation.js")),loadOperationRegistrationModule=createLazyModule(()=>import("./register-operations.js"));function renderAttemptedCommand(argv){return renderPmCommand(argv)}function inferMissingFieldsFromErrorMessage(message){const matches=message.match(/--[a-zA-Z0-9][a-zA-Z0-9_-]*/g);if(!matches||matches.length===0)return;const normalized=[...new Set(matches.map(entry=>normalizeLongOptionFlag(entry)??entry))];return normalized.length>0?normalized:void 0}function inferMissingFieldsForRecovery(rawMessage,invocationArgv,existingRecovery){if(existingRecovery?.suggested_retry||rawMessage.includes("failed in extension handler (")||!/\b(?:missing|required|requires)\b/i.test(rawMessage))return;const providedFields=extractProvidedOptionFlags(invocationArgv),providedSet=new Set(providedFields.map(flag=>normalizeLongOptionFlag(flag)??flag)),rawInferred=inferMissingFieldsFromErrorMessage(rawMessage),commandName=invocationArgv.find(token=>program.commands.some(candidate=>candidate.name()===token)),command=commandName?program.commands.find(candidate=>candidate.name()===commandName):void 0,declaredFlags=new Set([...program.options,...command?.options??[]].flatMap(option=>option.flags.split(/[ ,|]+/).map(flag=>normalizeLongOptionFlag(flag)).filter(flag=>flag!==void 0))),trulyMissing=rawInferred?.filter(flag=>{const normalized=normalizeLongOptionFlag(flag)??flag;return providedSet.has(normalized)?!1:declaredFlags.has(normalized)||extensionFlagTakesValueForInvocation(invocationArgv,commandName,normalized,activeRuntimeExtensionCommandDescriptors)!==void 0});return trulyMissing&&trulyMissing.length>0?trulyMissing:void 0}function resolveRecoverySuggestedRetry(invocationArgv,attemptedCommand,inferredMissing,existingRecovery){if(existingRecovery?.suggested_retry)return existingRecovery.suggested_retry;const missingFlag=inferredMissing?.[0],normalizedMissing=missingFlag?normalizeLongOptionFlag(missingFlag):void 0,commandName=invocationArgv.find(token=>program.commands.some(candidate=>candidate.name()===token)),command=commandName?program.commands.find(candidate=>candidate.name()===commandName):void 0,missingOption=normalizedMissing?command?.options.find(option=>option.flags.split(/[ ,|]+/).includes(normalizedMissing)):void 0,extensionFlagTakesValue=extensionFlagTakesValueForInvocation(invocationArgv,commandName,normalizedMissing,activeRuntimeExtensionCommandDescriptors),missingTokens=normalizedMissing?missingOption?.isBoolean()===!0||extensionFlagTakesValue===!1?[normalizedMissing]:[normalizedMissing,"<value>"]:[],suggestedRetry=normalizedMissing?renderAttemptedCommand([...invocationArgv,...missingTokens]):attemptedCommand;return suggestedRetry===attemptedCommand?void 0:suggestedRetry}function projectExistingRecoveryOptionalFields(existingRecovery){if(!existingRecovery)return{};const optionalFields=["recovery_mode","missing_required_fields","suggested_flags","suggested_retry_args","allowed_values","candidate_commands","candidate_commands_total","candidate_commands_truncated","fallback_candidates","next_best_command"],projected={};for(const field of optionalFields){const value=existingRecovery[field];value!=null&&(projected[field]=value)}return projected}function buildRecoveryPayload(params){const existingRecovery=params.existingRecovery;return{attempted_command:existingRecovery?.attempted_command??params.attemptedCommand,normalized_args:existingRecovery?.normalized_args??[...params.invocationArgv],provided_fields:existingRecovery?.provided_fields??(params.providedFields.length>0?params.providedFields:void 0),missing:existingRecovery?.missing??params.inferredMissing,...projectExistingRecoveryOptionalFields(existingRecovery),...params.suggestedRetry?{suggested_retry:params.suggestedRetry}:{}}}function withContextRecovery(context,recovery){return{...context,recovery}}function repairInvocationRecovery(argv,context){if(context!==void 0)return repairSchemaFieldRecovery(argv,context.code,context.field,repairProjectionRecovery(argv,context.code,context.recovery))}function buildPmCliRecoveryContext(context,invocationArgv,rawMessage){const safeInvocationArgv=redactSensitiveCommandArgs(invocationArgv),commandArgs=stripGlobalBootstrapTokens(safeInvocationArgv),commandIndex=findBootstrapCommandTokenIndex(commandArgs),[rootCommand,subcommand]=commandIndex===void 0?[]:commandArgs.slice(commandIndex,commandIndex+2),explainRequested=safeInvocationArgv.includes("--explain");context=context===void 0?void 0:snapshotPmCliErrorContext(context);const rawExistingRecovery=repairInvocationRecovery(safeInvocationArgv,context),existingRecovery=rawExistingRecovery&&(rootCommand==="history-redact"||rootCommand==="history"&&subcommand==="redact")?{...rawExistingRecovery,...rawExistingRecovery.attempted_command?{attempted_command:renderAttemptedCommand(safeInvocationArgv)}:{},...rawExistingRecovery.normalized_args?{normalized_args:[...safeInvocationArgv]}:{},...rawExistingRecovery.suggested_retry?{suggested_retry:renderAttemptedCommand(safeInvocationArgv)}:{},...rawExistingRecovery.suggested_retry_args?{suggested_retry_args:[...safeInvocationArgv]}:{}}:rawExistingRecovery;if(existingRecovery?.recovery_mode==="compact"&&!explainRequested)return withContextRecovery(context,existingRecovery);const attemptedCommand=renderAttemptedCommand(safeInvocationArgv),providedFields=extractProvidedOptionFlags(safeInvocationArgv),inferredMissing=inferMissingFieldsForRecovery(rawMessage,safeInvocationArgv,existingRecovery),suggestedRetry=resolveRecoverySuggestedRetry(safeInvocationArgv,attemptedCommand,inferredMissing,existingRecovery),recovery=buildRecoveryPayload({invocationArgv:safeInvocationArgv,attemptedCommand,providedFields,inferredMissing,suggestedRetry,existingRecovery});return withContextRecovery(context,recovery)}async function runAndClearAfterCommandHooks(outcome){const telemetryRuntime=activeTelemetryCommandContext;activeTelemetryCommandContext=null,await finishActiveTelemetryCommand(telemetryRuntime,outcome);const runtime=activeExtensionHookContext;if(activeExtensionHookContext=null,!runtime){clearActiveExtensionHooks();return}let hookWarnings=[];const affected=consumeAfterCommandAffectedItems();try{await recordAfterCommandContextUsage({pmRoot:runtime.pmRoot,author:runtime.globalOptions.author,itemIds:outcome.ok?affected?.map(item=>item.id)??[]:[],intent:runtime.commandName})}catch{hookWarnings.push("context_usage_feedback_write_failed")}try{hookWarnings.push(...await runAfterCommandHooks(runtime.hooks,{command:runtime.commandName,args:runtime.commandArgs,options:{...runtime.commandOptions},global:{...runtime.globalOptions},pm_root:runtime.pmRoot,ok:outcome.ok,error:outcome.error,result:getActiveCommandResult(),affected}))}catch(error){hookWarnings=[`afterCommand hooks failed: ${error instanceof Error?error.message:String(error)}`]}finally{clearActiveExtensionHooks()}!runtime.globalOptions.json&&hookWarnings.length>0&&printError(`[pm] warning: afterCommand hook_warnings=${formatHookWarnings(hookWarnings)}`),runtime.profileEnabled&&hookWarnings.length>0&&printError(`profile:extensions hook_warnings=${formatHookWarnings(hookWarnings)}`)}async function ensureSentryForErrorReporting(attemptedCommand,bootstrapGlobal){await ensureSentryInit();const runtime=activeTelemetryCommandContext,hook=activeExtensionHookContext,command=runtime?.command??hook?.commandName??attemptedCommand,attribution=runtime??resolveTelemetrySourceAttribution(hook?.globalOptions??bootstrapGlobal),source=activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(command))?.source;sentrySetCommandContext(command,hook?.commandArgs??[],{...hook?.commandOptions,...hook?.globalOptions},{source_context:attribution.source_context,source_context_source:attribution.source_context_source,pm_version:runtime?.pm_version??CLI_VERSION,extension:source})}function envFlagEnabled(key){return TRUE_LIKE_ENV_VALUES.has((process.env[key]??"").trim().toLowerCase())}function shouldLogHandledErrorToSentry(exitCode){return envFlagEnabled("PM_SENTRY_CAPTURE_EXPECTED_ERRORS")?!0:!EXPECTED_HANDLED_ERROR_EXIT_CODES.has(Math.trunc(exitCode))}async function maybeLogHandledCliErrorToSentry(params,bootstrapGlobal){return shouldLogHandledErrorToSentry(params.exit_code)?(await ensureSentryForErrorReporting(params.command,bootstrapGlobal),sentryLogCliUsageError({...params,source_context:params.source_context??resolveTelemetrySourceAttribution(bootstrapGlobal).source_context}),!0):!1}async function handleGenericRunPmCliError(params){const message=describeUnknownError(params.error),classification=classifyUnknownError(message);params.bootstrapGlobal.json?printError(JSON.stringify(attachPreflightWarnings(formatUnknownErrorForJson(message,EXIT_CODE.GENERIC_FAILURE)),null,2)):printError(message),process.exitCode=EXIT_CODE.GENERIC_FAILURE;let errorCategory="runtime",commandResolution="runtime_failed";try{await ensureSentryForErrorReporting(params.attemptedCommand,params.bootstrapGlobal),sentryCaptureCliError(params.error);const telemetry=await params.emitTelemetryCommandError({command:params.attemptedCommand,errorCode:classification.code,errorMessage:classification.detail,exitCode:EXIT_CODE.GENERIC_FAILURE,options:{bootstrap_global_options:params.bootstrapGlobal},resolutionStage:"execute"});errorCategory=telemetry.errorCategory,commandResolution=telemetry.commandResolution,await finishActiveSentryCommandSpan(!1,message,{error_code:classification.code,error_category:errorCategory,exit_code:EXIT_CODE.GENERIC_FAILURE,command_resolution:commandResolution,resolution_stage:"execute"})}catch(reportingError){params.bootstrapGlobal.json||printError(`Failed to report error: ${describeUnknownError(reportingError)}`)}try{await runAndClearAfterCommandHooks({ok:!1,error:message,exit_code:EXIT_CODE.GENERIC_FAILURE,error_code:classification.code,error_category:errorCategory,command_resolution:commandResolution,resolution_stage:"execute"})}catch(hookError){params.bootstrapGlobal.json||printError(`Failed to run error hooks: ${describeUnknownError(hookError)}`)}try{await sentryFlush()}catch(flushError){params.bootstrapGlobal.json||printError(`Failed to flush error reporting: ${describeUnknownError(flushError)}`)}}const RUNTIME_FIELD_COMMAND_BY_COMMAND_PATH={create:"create",update:"update","update-many":"update_many",list:"list","list-all":"list","list-draft":"list","list-open":"list","list-in-progress":"list","list-blocked":"list","list-closed":"list","list-canceled":"list",search:"search",calendar:"calendar",context:"context","templates save":"create"},runtimeFieldLooseFlagDefinitionCache=new Map;function toLooseFieldDefinitionType(fieldType){return fieldType==="number"?"number":fieldType==="boolean"?"boolean":"string"}function commandHasLongOption(command,longFlag){return command.options.some(option=>option.long===longFlag)}function commandHasShortOption(command,shortFlag){return command.options.some(option=>option.short===shortFlag)}function addRuntimeFieldOption(command,flagToken,description,repeatable){const normalizedToken=flagToken.trim();if(!normalizedToken)return;const helpText=description.length>0?description:`Runtime schema field (${flagToken})`;if(normalizedToken.startsWith("-")&&!normalizedToken.startsWith("--")){if(commandHasShortOption(command,normalizedToken))return;if(repeatable){command.option(`${normalizedToken} <value>`,`${helpText} (repeatable)`,collect);return}command.option(`${normalizedToken} <value>`,helpText);return}const longFlag=normalizedToken.startsWith("--")?normalizedToken:`--${normalizedToken}`;if(!commandHasLongOption(command,longFlag)){if(repeatable){command.option(`${longFlag} <value>`,`${helpText} (repeatable)`,collect);return}command.option(`${longFlag} <value>`,helpText)}}async function collectRuntimeFieldLooseFlagDefinitionsForCommand(commandPath,pmRoot){const runtimeCommand=RUNTIME_FIELD_COMMAND_BY_COMMAND_PATH[commandPath];if(!runtimeCommand)return[];const cacheKey=`${pmRoot}:${runtimeCommand}`,cached=runtimeFieldLooseFlagDefinitionCache.get(cacheKey);if(cached)return cached;if(!await pathExists(getSettingsPath(pmRoot)))return runtimeFieldLooseFlagDefinitionCache.set(cacheKey,[]),[];const settings=await readSettings(pmRoot),definitions=(resolveRuntimeFieldRegistry(settings.schema).command_to_fields.get(runtimeCommand)??[]).flatMap(field=>[field.cli_flag,...field.cli_aliases].map(token=>({long:`--${token}`,type:toLooseFieldDefinitionType(field.type),value_type:toLooseFieldDefinitionType(field.type)})));return runtimeFieldLooseFlagDefinitionCache.set(cacheKey,definitions),definitions}async function registerRuntimeSchemaFieldFlags(rootProgram,invocationArgv){const bootstrapGlobalOptions=parseBootstrapGlobalOptions(invocationArgv),pmRoot=resolvePmRoot(process.cwd(),bootstrapGlobalOptions.path);if(!await pathExists(getSettingsPath(pmRoot)))return;const cachedDiscovery=runtimeExtensionDiscoverySnapshotCache?.key===buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot)?runtimeExtensionDiscoverySnapshotCache.snapshot:null,settings=cachedDiscovery===null?await readSettings(pmRoot):cachedDiscovery.settings,fieldRegistry=resolveRuntimeFieldRegistry(settings.schema),mappings=[{path:"create",command:"create"},{path:"update",command:"update"},{path:"update-many",command:"update_many"},{path:"list",command:"list"},{path:"list-all",command:"list"},{path:"list-draft",command:"list"},{path:"list-open",command:"list"},{path:"list-in-progress",command:"list"},{path:"list-blocked",command:"list"},{path:"list-closed",command:"list"},{path:"list-canceled",command:"list"},{path:"search",command:"search"},{path:"calendar",command:"calendar"},{path:"context",command:"context"},{path:"templates save",command:"create"}];for(const mapping of mappings){const command=findCommandByPath(rootProgram,mapping.path.split(" "));if(command)for(const field of fieldRegistry.command_to_fields.get(mapping.command)??[]){const description=field.description??"";addRuntimeFieldOption(command,field.cli_flag,description,field.repeatable);for(const alias of field.cli_aliases)addRuntimeFieldOption(command,alias,`Alias for --${field.cli_flag}`,field.repeatable)}}}async function maybeAttachCreateUpdatePolicyHelpText(rootProgram,pmRoot,invocationArgv,registrations,settings){const bootstrapCommand=parseBootstrapCommandName(invocationArgv);if(!(bootstrapCommand!=="create"&&bootstrapCommand!=="update"))try{const resolvedSettings=settings??await readSettings(pmRoot),typeRegistry=resolveItemTypeRegistry(resolvedSettings,registrations);attachCreateUpdatePolicyHelpText(rootProgram,typeRegistry,invocationArgv)}catch{}}function defaultPreflightDecision(){return{enforce_item_format_gate:!0,run_preflight_item_format_sync:!0,run_extension_migrations:!0,enforce_mandatory_migration_gate:!0}}function buildRuntimeExtensionSnapshotCacheKey(pmRoot,activationScope="all"){return activationScope==="all"?`pm-root:${pmRoot}`:`pm-root:${pmRoot}:activation:${activationScope}`}function bootstrapProfileEnabled(invocationArgv){return invocationArgv.some(token=>token==="--profile")}function buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot){return`pm-root:${pmRoot}`}function emitSettingsReadWarnings(warnings){for(const warning of warnings)warning.startsWith("settings_read_")&&emitPreflightWarning(warning,`[pm] warning: ${warning} \u2014 settings.json could not be loaded and pm fell back to defaults; run pm health for remediation.`)}function emitExtensionProfile(globalOptions,snapshot){globalOptions.profile&&(printError(`profile:extensions loaded=${snapshot.loadedCount} failed=${snapshot.loadFailedCount} warnings=${snapshot.loadWarnings.length} activation_failed=${snapshot.activationFailedCount} hook_counts=before:${snapshot.hooks.beforeCommand.length}|after:${snapshot.hooks.afterCommand.length}|write:${snapshot.hooks.onWrite.length}|read:${snapshot.hooks.onRead.length}|index:${snapshot.hooks.onIndex.length} command_overrides=${snapshot.commands.overrides.length} command_handlers=${snapshot.commands.handlers.length} parser_overrides=${snapshot.parsers.overrides.length} preflight_overrides=${snapshot.preflight.overrides.length} service_overrides=${snapshot.services.overrides.length} renderer_overrides=${snapshot.renderers.overrides.length}`),snapshot.activationWarnings.length>0&&printError(`profile:extensions activation_warnings=${formatHookWarnings(snapshot.activationWarnings)}`))}function emitExtensionSkippedProfile(profileEnabled,snapshot,probe){if(!profileEnabled)return;const command=normalizeExtensionCommandPath(probe.commandPath??"")||"<none>";printError(`profile:extensions activation=skipped command=${command} effective=${snapshot.discovery.effective.length} warnings=${snapshot.discovery.warnings.length} discovery_ms=${snapshot.discoveryMs}`)}async function loadRuntimeExtensionDiscoverySnapshot(pmRoot,readSettingsWithMetadataFn=readSettingsWithMetadata){const cacheKey=buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot);if(runtimeExtensionDiscoverySnapshotCache?.key===cacheKey)return runtimeExtensionDiscoverySnapshotCache.snapshot;try{const startedAt=Date.now(),{settings,warnings:settingsReadWarnings}=await readSettingsWithMetadataFn(pmRoot),discovery=await discoverExtensions({pmRoot,settings,cwd:process.cwd(),noExtensions:!1}),snapshot={pmRoot,settings,discovery,discoveryMs:Date.now()-startedAt,settingsReadWarnings:[...settingsReadWarnings]};return runtimeExtensionDiscoverySnapshotCache={key:cacheKey,snapshot},snapshot}catch{return runtimeExtensionDiscoverySnapshotCache={key:cacheKey,snapshot:null},null}}async function loadRuntimeExtensionSnapshot(pmRoot,probe,readSettingsFn=readSettings){const activationScope=probe?buildRuntimeExtensionActivationScope(probe):"all",cacheKey=buildRuntimeExtensionSnapshotCacheKey(pmRoot,activationScope);if(runtimeExtensionSnapshotCache?.key===cacheKey)return runtimeExtensionSnapshotCache.snapshot;try{const settings=await readSettingsFn(pmRoot),loadResult=await loadExtensions({pmRoot,settings,cwd:process.cwd(),noExtensions:!1,extensionFilter:probe?buildRuntimeExtensionFilterForProbe(probe):void 0}),activationResult=await activateExtensions({...loadResult,loaded:loadResult.loaded}),commandHandlers=[...new Set(activationResult.commands.handlers.map(entry=>normalizeExtensionCommandPath(entry.command)))].filter(entry=>entry.length>0).sort((left,right)=>left.localeCompare(right)),commandFlagHelp=collectDynamicExtensionFlagHelpByCommand(activationResult.registrations.flags),canonicalAliases=buildCanonicalExtensionAliases(activationResult.commands.handlers,activationResult.registrations.commands),commandDescriptors=collectExtensionCommandHelpDescriptors(commandHandlers,activationResult.registrations.commands,activationResult.registrations.flags,canonicalAliases),snapshot={hooks:activationResult.hooks,commands:activationResult.commands,parsers:activationResult.parsers,preflight:activationResult.preflight,services:activationResult.services,renderers:activationResult.renderers,registrations:activationResult.registrations,pmRoot,settings,commandHandlers,commandFlagHelp,commandDescriptors,commandAliases:canonicalAliases,loadWarnings:[...loadResult.warnings],activationWarnings:[...activationResult.warnings],loadedCount:loadResult.loaded.length,loadFailedCount:loadResult.failed.length,activationFailedCount:activationResult.failed.length,contextIntentPackages:loadResult.loaded.map(({name,module})=>({name,module}))};return runtimeExtensionSnapshotCache={key:cacheKey,snapshot},snapshot}catch{return runtimeExtensionSnapshotCache={key:cacheKey,snapshot:null},null}}async function maybeLoadRuntimeExtensions(command){const globalOptions=getGlobalOptions(command);if(globalOptions.noExtensions){const noExtPmRoot=resolvePmRoot(process.cwd(),globalOptions.path);return await pathExists(getSettingsPath(noExtPmRoot))&&emitSettingsReadWarnings((await readSettingsWithMetadata(noExtPmRoot)).warnings),null}const pmRoot=resolvePmRoot(process.cwd(),globalOptions.path),discoverySnapshot=await loadRuntimeExtensionDiscoverySnapshot(pmRoot);if(!discoverySnapshot)return null;emitSettingsReadWarnings(discoverySnapshot.settingsReadWarnings);const probe={commandPath:getCommandPath(command),commandArgs:collectParsedActivationCommandArgs(command)};if(!discoveryNeedsActivationForProbe(discoverySnapshot.discovery,probe))return emitExtensionSkippedProfile(globalOptions.profile,discoverySnapshot,probe),null;const snapshot=await loadRuntimeExtensionSnapshot(pmRoot,probe);return snapshot?(emitExtensionProfile(globalOptions,snapshot),{hooks:snapshot.hooks,commands:snapshot.commands,parsers:snapshot.parsers,preflight:snapshot.preflight,services:snapshot.services,renderers:snapshot.renderers,registrations:snapshot.registrations,pmRoot}):null}async function loadRuntimeExtensionCommandDescriptorsForRecovery(pmRoot){const snapshot=await loadRuntimeExtensionSnapshot(pmRoot);return snapshot?new Map(snapshot.commandDescriptors):activeRuntimeExtensionCommandDescriptors}async function resolveHelpRecoveryDescriptors(helpRequest,bootstrapGlobal){return!helpRequest.requested||bootstrapGlobal.noExtensions||isKnownHelpCommandPath(program,helpRequest.commandPathTokens)?activeRuntimeExtensionCommandDescriptors:loadRuntimeExtensionCommandDescriptorsForRecovery(resolvePmRoot(process.cwd(),bootstrapGlobal.path))}async function executeRegisteredRuntimeMigrations(migrations,pmRoot){return(await runExtensionMigrations({pmRoot,migrations,author:"pm-extension-migration"})).migrations.filter(migration=>migration.outcome==="failed").map(migration=>`extension_migration_failed:${migration.layer}:${migration.extension}:${migration.id}`)}function buildExtensionCommandSdk(pmRoot,global2,commandPath){const author=global2.author;return createExtensionCommandSdk(pmRoot,PmClient.forActiveExtensionHost({pmRoot,author}),author,normalizeExtensionCommandPath(commandPath))}async function runRequiredExtensionCommand(command,options,globalOptions,extensionFlagDefinitions=[]){const commandPath=getCommandPath(command);let commandArgs=stripLooseCommandOptionTokens(command.args.map(String),extensionFlagDefinitions),commandOptions={...options};delete commandOptions.author;let resolvedGlobalOptions={...globalOptions};const pmRoot=resolvePmRoot(process.cwd(),globalOptions.path),parserOverride=await runActiveParserOverride({command:commandPath,args:commandArgs,options:commandOptions,global:resolvedGlobalOptions,pm_root:pmRoot});globalOptions.profile&&parserOverride.warnings.length>0&&printError(`profile:extensions parser_warnings=${formatHookWarnings(parserOverride.warnings)}`),commandArgs=parserOverride.context.args,commandOptions=parserOverride.context.options,resolvedGlobalOptions=parserOverride.context.global,validateDynamicExtensionCommandInvocation(activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(commandPath)),commandArgs,commandOptions,extensionFlagDefinitions),setActiveCommandResult(void 0),setActiveCommandContext({command:commandPath,args:commandArgs,options:{...commandOptions},global:{...resolvedGlobalOptions},pm_root:pmRoot});const extensionCommandResult=await runActiveCommandHandler({command:commandPath,args:commandArgs,options:commandOptions,global:resolvedGlobalOptions,pm_root:pmRoot,sdk:buildExtensionCommandSdk(pmRoot,resolvedGlobalOptions,commandPath)});if(resolvedGlobalOptions.profile&&extensionCommandResult.warnings.length>0&&printError(`profile:extensions command_handler_warnings=${formatHookWarnings(extensionCommandResult.warnings)}`),!extensionCommandResult.handled)throw extensionCommandResult.warnings.length>0?createExtensionCommandError(commandPath,extensionCommandResult):new PmCliError(`Command "${commandPath}" is provided by extensions and is not currently available.`,EXIT_CODE.NOT_FOUND);return extensionCommandResult.exitCode!==void 0&&(process.exitCode=extensionCommandResult.exitCode),setActiveCommandResult(extensionCommandResult.result),extensionCommandResult.result}const WRAPPED_ACTION_HANDLER=Symbol("pm.wrappedActionHandler");function resolveActionCommand(actionArgs,fallback){const possibleCommand=actionArgs[actionArgs.length-1];return possibleCommand instanceof Command?possibleCommand:fallback}function maybePrintExtensionProfileWarnings(enabled,label,warnings){enabled&&warnings.length>0&&printError(`profile:extensions ${label}=${formatHookWarnings(warnings)}`)}function validateDynamicInvocationArgs(params){const dynamicDescriptor=activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(params.commandPath));if(!dynamicDescriptor||!isImporterOrExporterCommandPath(params.activeRegistrations,params.commandPath))return;const positionalArgs=dynamicCommandArguments(dynamicDescriptor).length===0?collectLoosePositionalArgs(params.commandArgs):stripLooseCommandOptionTokens(params.commandArgs,params.extensionFlagDefinitions);validateDynamicExtensionCommandArgs(dynamicDescriptor,positionalArgs)}function syncCommanderActionArgs(actionCommand,actionArgs,commandArgs){actionCommand.args=[...commandArgs],"_processArguments"in actionCommand&&typeof actionCommand._processArguments=="function"&&actionCommand._processArguments(),actionArgs.length>0&&Array.isArray(actionArgs[0])&&(actionArgs[0]=[...actionCommand.processedArgs])}function wrapProgramActionsForExtensionHandlers(rootProgram){const visit=entry=>{const actionEntry=entry;if(typeof actionEntry._actionHandler=="function"&&actionEntry[WRAPPED_ACTION_HANDLER]!==!0){const originalAction=actionEntry._actionHandler;actionEntry._actionHandler=async function(...actionArgs){const actionCommand=resolveActionCommand(actionArgs,entry),startedAt=Date.now();clearResolvedGlobalOptions(actionCommand);let globalOptions=getGlobalOptions(actionCommand);const commandPath=resolvePmCommandOperation(getCommandPath(actionCommand));if(["package inventory","packages inventory","extension inventory"].includes(commandPath))return await originalAction.apply(this,actionArgs);const pmRoot=resolvePmRoot(process.cwd(),globalOptions.path);let commandArgs=actionCommand.args.map(String);const activeRegistrations=getActiveExtensionRegistrations(),extensionFlagDefinitions=activeRegistrations?collectExtensionFlagDefinitionsForInvocation(activeRegistrations,commandPath,commandArgs):[],runtimeFieldFlagDefinitions=await collectRuntimeFieldLooseFlagDefinitionsForCommand(commandPath,pmRoot);let commandOptions=extractCommandScopedOptions(actionCommand,commandArgs,[...extensionFlagDefinitions,...runtimeFieldFlagDefinitions]);activeRuntimeExtensionCommandDescriptors.has(normalizeExtensionCommandPath(commandPath))&&delete commandOptions.author;const parserOverride=await runActiveParserOverride({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:pmRoot});maybePrintExtensionProfileWarnings(globalOptions.profile,"parser_warnings",parserOverride.warnings),commandArgs=parserOverride.context.args,commandOptions=parserOverride.context.options,copyReadOutputInvocationProvenance(actionCommand,commandOptions),globalOptions=parserOverride.context.global,validateDynamicInvocationArgs({activeRegistrations,commandPath,commandArgs,extensionFlagDefinitions}),globalOptions=await applyDefaultOutputFormat(globalOptions),setResolvedGlobalOptions(actionCommand,globalOptions),syncCommanderActionArgs(actionCommand,actionArgs,commandArgs),syncCommanderActionOptions(actionCommand,commandOptions),setActiveCommandResult(void 0),setActiveCommandContext({command:commandPath,args:commandArgs,options:{...commandOptions},global:{...globalOptions},pm_root:pmRoot});const extensionCommandResult=await runActiveCommandHandler({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:pmRoot,sdk:buildExtensionCommandSdk(pmRoot,globalOptions,commandPath)});if(maybePrintExtensionProfileWarnings(globalOptions.profile,"command_handler_warnings",extensionCommandResult.warnings),extensionCommandResult.handled){setActiveCommandResult(extensionCommandResult.result),printResult(extensionCommandResult.result,{...globalOptions,command:commandPath,commandArgs,commandOptions,pmRoot}),globalOptions.profile&&printError(`profile:command=${commandPath} took_ms=${Date.now()-startedAt}`);return}return await originalAction.apply(this,actionArgs)},actionEntry[WRAPPED_ACTION_HANDLER]=!0}for(const child of entry.commands)visit(child)};visit(rootProgram)}async function clearDynamicExtensionCommandState(params){activeRuntimeExtensionCommandDescriptors=new Map,setActiveExtensionServices({overrides:[]}),params&&await maybeAttachCreateUpdatePolicyHelpText(params.rootProgram,params.pmRoot,params.invocationArgv,createEmptyExtensionRegistrationRegistry(),params.settings)}function attachDynamicExtensionHelp(command,descriptor,flagHelp,metadataHelp){if(descriptor?.flags&&descriptor.flags.length>0){applyDynamicExtensionFlagOptions(command,descriptor.flags);const residualFlagHelp=buildResidualDynamicExtensionFlagHelp(command,descriptor.flags);residualFlagHelp&&command.addHelpText("after",residualFlagHelp)}else flagHelp&&command.addHelpText("after",flagHelp);metadataHelp&&command.addHelpText("after",metadataHelp)}function applyDynamicExtensionRootHelpVisibility(rootProgram,preexistingTopLevelCommands,descriptors){const tierRank={core:0,standard:1,full:2,internal:3},applyVisibility=(command,pathParts)=>{const commandPath=pathParts.join(" "),matchingDescriptors=[...descriptors.entries()].filter(([path])=>path===commandPath||path.startsWith(`${commandPath} `)).map(([,descriptor])=>descriptor),tier=matchingDescriptors.length===0?"standard":matchingDescriptors.reduce((selected,descriptor)=>tierRank[descriptor.tier]<tierRank[selected]?descriptor.tier:selected,"internal");setPmCommandHelpVisibilityTier(command,tier);for(const child of command.commands)applyVisibility(child,[...pathParts,child.name()])};for(const command of rootProgram.commands)preexistingTopLevelCommands.has(command.name())||applyVisibility(command,[command.name()])}async function registerDynamicExtensionCommandPaths(rootProgram,invocationArgv){const bootstrapGlobalOptions=parseBootstrapGlobalOptions(invocationArgv),pmRoot=resolvePmRoot(process.cwd(),bootstrapGlobalOptions.path);if(bootstrapGlobalOptions.noExtensions){await clearDynamicExtensionCommandState({rootProgram,pmRoot,invocationArgv});return}const discoverySnapshot=await loadRuntimeExtensionDiscoverySnapshot(pmRoot),probe=buildBootstrapActivationProbe(invocationArgv);if(!discoverySnapshot){await clearDynamicExtensionCommandState();return}if(!discoveryNeedsActivationForProbe(discoverySnapshot.discovery,probe)){await clearDynamicExtensionCommandState({rootProgram,pmRoot,invocationArgv,settings:discoverySnapshot.settings}),emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv),discoverySnapshot,probe);return}const snapshot=await loadRuntimeExtensionSnapshot(pmRoot,probe);if(!snapshot){await clearDynamicExtensionCommandState({rootProgram,pmRoot,invocationArgv,settings:discoverySnapshot.settings});return}setActiveExtensionServices(snapshot.services),activeRuntimeExtensionCommandDescriptors=new Map(snapshot.commandDescriptors),await maybeAttachCreateUpdatePolicyHelpText(rootProgram,pmRoot,invocationArgv,snapshot.registrations,snapshot.settings);const commandPaths=collectSafeExtensionCommandPaths(rootProgram,snapshot.commandHandlers,snapshot.commandDescriptors,snapshot.commandAliases,warning=>reportExtensionCommandCollision(snapshot.activationWarnings,printError,warning)),preexistingTopLevelCommands=new Set(rootProgram.commands.map(command=>command.name())),registerCommandPath=commandPath=>{const pathParts=commandPath.split(" ").filter(part=>part.length>0),descriptor=snapshot.commandDescriptors.get(commandPath),existingCommand=findCommandByPath(rootProgram,pathParts),flagHelp=snapshot.commandFlagHelp.get(commandPath),metadataHelp=descriptor?buildDynamicExtensionCommandMetadataHelp(descriptor):null;if(existingCommand){attachDynamicExtensionHelp(existingCommand,descriptor,flagHelp,metadataHelp);return}const dynamicCommand=ensureCommandPath(rootProgram,pathParts);descriptor?.description&&dynamicCommand.description(descriptor.description);let residualDynamicFlagHelp=flagHelp;descriptor&&(applyDynamicExtensionArguments(dynamicCommand,descriptor),descriptor.flags.length>0&&(applyDynamicExtensionFlagOptions(dynamicCommand,descriptor.flags),residualDynamicFlagHelp=buildResidualDynamicExtensionFlagHelp(dynamicCommand,descriptor.flags)??void 0)),residualDynamicFlagHelp&&dynamicCommand.addHelpText("after",residualDynamicFlagHelp),metadataHelp&&dynamicCommand.addHelpText("after",metadataHelp),dynamicCommand.allowUnknownOption(!0).allowExcessArguments(!0).action(async(...actionArgs)=>{const maybeCommand=actionArgs[actionArgs.length-1],command=maybeCommand instanceof Command?maybeCommand:dynamicCommand,globalOptions=getGlobalOptions(command),startedAt=Date.now(),extensionFlagDefinitions=collectExtensionFlagDefinitionsForInvocation(snapshot.registrations,commandPath,command.args.map(String)),scopedOptions=extractCommandScopedOptions(command,command.args.map(String),extensionFlagDefinitions),result=await runRequiredExtensionCommand(command,scopedOptions,globalOptions,extensionFlagDefinitions);await invalidateSearchCachesForMutation(globalOptions,result),printResult(result,{...globalOptions,command:commandPath,commandArgs:command.args.map(String),commandOptions:scopedOptions,pmRoot}),globalOptions.profile&&printError(`profile:command=${commandPath} took_ms=${Date.now()-startedAt}`)})};for(const commandPath of commandPaths)registerCommandPath(commandPath);applyDynamicExtensionRootHelpVisibility(rootProgram,preexistingTopLevelCommands,snapshot.commandDescriptors)}const CLI_VERSION=resolvePmCliVersion(import.meta.url,["../.."])??"0.0.0";let program=createPmCliProgram(CLI_VERSION);async function recordActiveDeprecatedAliasUsage(rootProgram){if(!activeTelemetryCommandContext)return;const alias=Reflect.get(rootProgram,DEPRECATED_ALIAS_INVOCATION);typeof alias=="string"&&await recordDeprecatedAliasUsage(alias)}async function runCommandPreparation(actionCommand,skipped,run){const commandPath=getCommandPath(actionCommand);return["item mutate","item complete"].includes(commandPath)&&actionCommand.optsWithGlobals().dryRun===!0?skipped:run()}async function startActiveSentryCommandTracing(command,args,options){!activeTelemetryCommandContext||!await ensureSentryCommandTracing(!0)||(sentrySetCommandContext(command,args,options,{source_context:activeTelemetryCommandContext.source_context,source_context_source:activeTelemetryCommandContext.source_context_source}),sentryStartCommandSpan(command),activeSentryCommandContext=activeTelemetryCommandContext)}async function finishActiveSentryCommandSpan(ok,error,metadata){const runtime=activeSentryCommandContext;if(!runtime)return;activeSentryCommandContext=null;let consent=!1;try{const settings=await readSettings(runtime.global_pm_root);consent=settings.telemetry.enabled&&settings.telemetry.installation_id===runtime.installation_id}catch{}await ensureSentryCommandTracing(consent)?sentryFinishCommandSpan(ok,error,metadata):sentryDiscardCommandSpan()}async function loadRuntimeReadDeclarations(actionCommand){const snapshot=await maybeLoadRuntimeExtensions(actionCommand);return setActiveExtensionRegistrations(snapshot?.registrations??null),snapshot}function attachProgramLifecycleHooks(rootProgram,invocationArgv){invocationArgv&&isStaticExtensionInventoryInvocation(invocationArgv)||(rootProgram.hook("preAction",async(_thisCommand,actionCommand)=>{activeExtensionHookContext=null,activeTelemetryCommandContext=null,activeSentryCommandContext=null,clearActiveExtensionHooks(),clearResolvedGlobalOptions(actionCommand);const rawGlobalOptions=actionCommand.optsWithGlobals(),bootstrapGlobalOptions=getGlobalOptions(actionCommand),commandPath=resolvePmCommandOperation(getCommandPath(actionCommand));let commandArgs=actionCommand.args.map(String),commandOptions=extractCommandScopedOptions(actionCommand,commandArgs),globalOptions={...bootstrapGlobalOptions};const fallbackPmRoot=resolvePmRoot(process.cwd(),bootstrapGlobalOptions.path),runtimeExtensions=await loadRuntimeReadDeclarations(actionCommand);if(validateReadOutputOptions(commandPath,{...commandOptions,outputInclude:rawGlobalOptions.outputInclude,outputLimit:rawGlobalOptions.outputLimit,outputBudget:rawGlobalOptions.outputBudget,outputFormat:rawGlobalOptions.outputFormat,outputSession:rawGlobalOptions.outputSession,outputCursor:rawGlobalOptions.outputCursor}),forwardReadOutputIncludeModes(actionCommand,commandPath,globalOptions,commandOptions),await runCommandPreparation(actionCommand,void 0,()=>maybeRunFirstUseTelemetryPrompt(commandPath,globalOptions)),!runtimeExtensions){activeExtensionHookContext=createCoreCommandHookContext({commandName:commandPath,commandArgs,commandOptions,globalOptions,pmRoot:fallbackPmRoot}),activeTelemetryCommandContext=await startTelemetryCommand({command:commandPath,pm_version:CLI_VERSION,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:fallbackPmRoot}),await recordActiveDeprecatedAliasUsage(rootProgram),await startActiveSentryCommandTracing(commandPath,commandArgs,commandOptions),await enforceItemFormatWriteGateAndPreflightMigration(commandPath,commandOptions,fallbackPmRoot,defaultPreflightDecision()),await enforceMutationGuardPreflight(commandPath,commandArgs,commandOptions,globalOptions,fallbackPmRoot);return}setActiveExtensionHooks(runtimeExtensions.hooks),setActiveExtensionCommands(runtimeExtensions.commands),setActiveExtensionParsers(runtimeExtensions.parsers),setActiveExtensionPreflight(runtimeExtensions.preflight),setActiveExtensionServices(runtimeExtensions.services),setActiveExtensionRenderers(runtimeExtensions.renderers),setActiveExtensionRegistrations(runtimeExtensions.registrations);const extensionFlagDefinitions=collectExtensionFlagDefinitionsForInvocation(runtimeExtensions.registrations,commandPath,commandArgs);commandOptions=extractCommandScopedOptions(actionCommand,commandArgs,extensionFlagDefinitions),forwardReadOutputIncludeModes(actionCommand,commandPath,globalOptions,commandOptions);const parserOverride=await runActiveParserOverride({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:runtimeExtensions.pmRoot});globalOptions.profile&&parserOverride.warnings.length>0&&printError(`profile:extensions parser_warnings=${formatHookWarnings(parserOverride.warnings)}`),commandArgs=parserOverride.context.args,commandOptions=parserOverride.context.options,copyReadOutputInvocationProvenance(actionCommand,commandOptions),globalOptions=parserOverride.context.global,syncCommanderActionOptions(actionCommand,commandOptions);const preflightOverride=await runActivePreflightOverride({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:runtimeExtensions.pmRoot,decision:defaultPreflightDecision()});globalOptions.profile&&preflightOverride.warnings.length>0&&printError(`profile:extensions preflight_warnings=${formatHookWarnings(preflightOverride.warnings)}`),commandArgs=preflightOverride.context.args,commandOptions=preflightOverride.context.options,copyReadOutputInvocationProvenance(actionCommand,commandOptions),globalOptions=preflightOverride.context.global,syncCommanderActionOptions(actionCommand,commandOptions);const preflightDecision=preflightOverride.decision;await enforceItemFormatWriteGateAndPreflightMigration(commandPath,commandOptions,runtimeExtensions.pmRoot,preflightDecision),await enforceMutationGuardPreflight(commandPath,commandArgs,commandOptions,globalOptions,runtimeExtensions.pmRoot);const migrationWarnings=preflightDecision.run_extension_migrations?await runCommandPreparation(actionCommand,[],()=>executeRegisteredRuntimeMigrations(runtimeExtensions.registrations.migrations,runtimeExtensions.pmRoot)):[];globalOptions.profile&&migrationWarnings.length>0&&printError(`profile:extensions migration_warnings=${formatHookWarnings(migrationWarnings)}`);const migrationBlockers=collectMandatoryMigrationBlockers(runtimeExtensions.registrations.migrations);activeExtensionHookContext={hooks:runtimeExtensions.hooks,commandName:commandPath,commandArgs,commandOptions:{...commandOptions},globalOptions:{...globalOptions},pmRoot:runtimeExtensions.pmRoot,profileEnabled:!!globalOptions.profile,migrationBlockers},setActiveCommandResult(void 0),setActiveCommandContext({command:commandPath,args:commandArgs,options:{...commandOptions},global:{...globalOptions},pm_root:runtimeExtensions.pmRoot}),activeTelemetryCommandContext=await startTelemetryCommand({command:commandPath,pm_version:CLI_VERSION,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:runtimeExtensions.pmRoot}),await recordActiveDeprecatedAliasUsage(rootProgram),await startActiveSentryCommandTracing(commandPath,commandArgs,commandOptions);const hookWarnings=await runBeforeCommandHooks(runtimeExtensions.hooks,{command:commandPath,args:commandArgs,options:{...commandOptions},global:{...globalOptions},pm_root:runtimeExtensions.pmRoot});globalOptions.profile&&hookWarnings.length>0&&printError(`profile:extensions hook_warnings=${formatHookWarnings(hookWarnings)}`),preflightDecision.enforce_mandatory_migration_gate&&enforceMandatoryMigrationWriteGate(commandPath,commandOptions,migrationBlockers)}),rootProgram.hook("postAction",async()=>{const outcome=buildPostActionTelemetryOutcome();await finishActiveSentryCommandSpan(outcome.ok,outcome.error,{error_code:outcome.error_code,error_category:outcome.error_category,exit_code:outcome.exit_code,command_resolution:outcome.command_resolution,resolution_stage:outcome.resolution_stage}),await runAndClearAfterCommandHooks(outcome),await sentryFlush()}))}attachProgramLifecycleHooks(program);const IDEMPOTENT_TOP_LEVEL_REGISTRATION=Symbol("pmCliIdempotentTopLevelRegistration");function ensureIdempotentTopLevelCommandRegistration(rootProgram){const guarded=rootProgram;if(guarded[IDEMPOTENT_TOP_LEVEL_REGISTRATION])return;guarded[IDEMPOTENT_TOP_LEVEL_REGISTRATION]=!0;const registerOriginalCommand=rootProgram.command.bind(rootProgram);rootProgram.command=((nameAndArgs,...rest)=>{const commandName=nameAndArgs.split(/\s+/u)[0];return rootProgram.commands.some(existing=>existing.name()===commandName||existing.aliases().includes(commandName))?new Command(commandName):registerOriginalCommand(nameAndArgs,...rest)})}async function registerCoreCommandFamilies(rootProgram,selection){if(ensureIdempotentTopLevelCommandRegistration(rootProgram),selection.setup){const{registerSetupCommands}=await loadSetupRegistrationModule();registerSetupCommands(rootProgram)}if(selection.listQuery){const{registerListQueryCommands}=await loadListQueryRegistrationModule(),commandFilter=typeof selection.targetCommandName=="string"&&LIST_QUERY_COMMAND_NAMES.has(selection.targetCommandName)?new Set([selection.targetCommandName]):void 0;registerListQueryCommands(rootProgram,commandFilter?{commandFilter}:void 0)}if(selection.mutation){const{registerMutationCommands}=await loadMutationRegistrationModule();registerMutationCommands(rootProgram,{targetCommandName:selection.targetCommandName})}if(selection.operation){const{registerOperationCommands}=await loadOperationRegistrationModule();registerOperationCommands(rootProgram)}}function createTelemetryCommandErrorEmitter(params){return async event=>{const errorCategory=resolveTelemetryErrorCategory(event.errorCode),commandResolution=deriveTelemetryCommandResolution({ok:!1,errorCode:event.errorCode,errorCategory});return await emitTelemetryErrorEvent({command:event.command,args:params.invocationArgv,options:event.options,global:params.bootstrapGlobal,pm_version:CLI_VERSION,pm_root:params.bootstrapPmRoot,error_code:event.errorCode,error_message:event.errorMessage,exit_code:event.exitCode,error_category:errorCategory,command_resolution:commandResolution,resolution_stage:event.resolutionStage}),{errorCategory,commandResolution}}}async function prepareExtensionServicesForRunPmCliError(params){if(params.bootstrapGlobal.noExtensions||isStaticExtensionInventoryInvocation(params.invocationArgv))return;const bootstrapProbe=buildBootstrapActivationProbe(params.invocationArgv),discoverySnapshot=await loadRuntimeExtensionDiscoverySnapshot(params.bootstrapPmRoot);if(discoverySnapshot&&discoveryNeedsActivationForProbe(discoverySnapshot.discovery,bootstrapProbe)){const bootstrapSnapshot=await loadRuntimeExtensionSnapshot(params.bootstrapPmRoot,bootstrapProbe);setRecoveredExtensionServices(bootstrapSnapshot);return}discoverySnapshot&&emitExtensionSkippedProfile(bootstrapProfileEnabled(params.invocationArgv),discoverySnapshot,bootstrapProbe),setActiveExtensionServices({overrides:[]})}function setRecoveredExtensionServices(bootstrapSnapshot){if(!bootstrapSnapshot){setActiveExtensionServices({overrides:[]});return}setActiveExtensionServices(bootstrapSnapshot.services)}async function finishRunPmCliFailure(params){await finishActiveSentryCommandSpan(!1,params.errorMessage,{error_code:params.classificationCode,error_category:params.errorCategory,exit_code:params.exitCode,command_resolution:params.commandResolution,resolution_stage:params.resolutionStage}),await runAndClearAfterCommandHooks({ok:!1,error:params.errorMessage,exit_code:params.exitCode,error_code:params.classificationCode,error_category:params.errorCategory,command_resolution:params.commandResolution,resolution_stage:params.resolutionStage})}async function finishRunPmCliSuccessParse(){await finishActiveSentryCommandSpan(!0,void 0,{exit_code:EXIT_CODE.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),await runAndClearAfterCommandHooks({ok:!0,exit_code:EXIT_CODE.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),process.exitCode=EXIT_CODE.SUCCESS}async function handleRunPmCliKnownError(context,numericExitCode){const hasExplicitExitCode=typeof numericExitCode=="number"&&Number.isFinite(numericExitCode);if(!(context.error instanceof PmCliError)&&(isCommanderError(context.error)||!hasExplicitExitCode))return!1;const errorMessage=describeUnknownError(context.error),exitCode=context.error instanceof PmCliError?context.error.exitCode:normalizeThrownExitCode(numericExitCode),rawContext=context.error instanceof PmCliError||isPmCliExpectedError(context.error)?context.error.context:void 0,enrichedContext=buildPmCliRecoveryContext(rawContext,context.invocationArgv,errorMessage),classification=classifyPmCliError(errorMessage,enrichedContext),jsonErrorPayload=attachPreflightWarnings(context.bootstrapGlobal.lean?projectLeanErrorEnvelope(formatPmCliErrorForJson(errorMessage,exitCode,enrichedContext)):formatPmCliErrorForJson(errorMessage,exitCode,enrichedContext)),renderedError=context.jsonErrors?JSON.stringify(context.bootstrapGlobal.tokenAccounting?attachOutputTokenAccounting(jsonErrorPayload,value=>`${JSON.stringify(value,null,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]="f9a998a3-3543-57f1-954d-ac6d70320151")}catch{}})();import{attachPreflightWarnings,attachSerializedPreflightWarnings,emitPreflightWarning,runWithPreflightWarnings}from"./preflight-warnings.js";import{assertGuardedDispatchUnchanged,bindInvocationExpectedRevisions,invocationRewritten,parseWithInvocationRevisionScope,refuseInventoryExpectHash}from"./expected-revisions.js";import{Command,CommanderError}from"commander";import{PM_COMMAND_ALIAS_CONTRACTS,findPmNamespacedCommand,resolvePmCommandOperation}from"../sdk/cli-contracts/command-aliases.js";import{createPmCliProgram}from"../sdk/cli-program.js";import{runWithDiscoveredContextIntentContracts}from"../sdk/context-intent-runtime.js";import{createExtensionCommandError,describeUnknownError,isCommanderError,normalizeThrownExitCode,readThrownExitCode,wrapThrownErrorForSentry}from"../sdk/error-runtime.js";import{createExtensionCommandSdk}from"../sdk/extension-command-context.js";import{isPmCliExpectedError,snapshotPmCliErrorContext}from"../sdk/errors.js";import{runExtensionMigrations}from"../sdk/extension/migrations.js";import{repairProjectionRecovery}from"./runtime/projection-retry.js";import{repairSchemaFieldRecovery}from"./runtime/field-route-retry.js";import{applyInvocationAuthorOverride}from"../sdk/invocation-author.js";import{attachOutputTokenAccounting}from"../sdk/output-token-accounting.js";import{validateReadOutputOptions}from"../sdk/read-output-contracts.js";import{runWithReproducibleProcessEnvironment}from"../sdk/reproducibility/process.js";import{resolveTelemetrySourceAttribution,EXIT_CODE,PmCliError,activateExtensions,clearActiveExtensionHooks,consumeAfterCommandAffectedItems,createCoreCommandHookContext,createEmptyExtensionRegistrationRegistry,createLazyModule,deriveTelemetryCommandResolution,discoverExtensions,emitTelemetryErrorEvent,ensureSentryInit,ensureSentryCommandTracing,getActiveCommandResult,getActiveExtensionRegistrations,getSettingsPath,loadExtensions,maybeRunFirstUseTelemetryPrompt,pathExists,printError,printResult,readSettings,readSettingsWithMetadata,resetActiveExtensionRuntimeState,resolveGlobalPmRoot,resolveItemTypeRegistry,resolvePmCliVersion,resolvePmPackageRootFromModule,resolvePmRoot,resolveRuntimeFieldRegistry,resolveTelemetryErrorCategory,runActiveCommandHandler,runActiveParserOverride,runActivePreflightOverride,runAfterCommandHooks,runBeforeCommandHooks,runWithConfigurationOnlySettings,runWithHarnessDetectionSignals,runWithWorkspaceHarnessSignalDescriptors,sentryCaptureCliError,sentryDiscardCommandSpan,sentryFinishCommandSpan,sentryFlush,sentryLogCliUsageError,sentrySetCommandContext,sentryStartCommandSpan,setActiveCommandContext,setActiveCommandResult,setActiveExtensionCommands,setActiveExtensionHooks,setActiveExtensionParsers,setActiveExtensionPreflight,setActiveExtensionRegistrations,setActiveExtensionRenderers,setActiveExtensionServices,startTelemetryCommand,writeStderr}from"../sdk/runtime-primitives.js";import{PmClient}from"../sdk/runtime.js";import{recordDeprecatedAliasUsage}from"../sdk/telemetry.js";import{finishActiveTelemetryCommand,recordAfterCommandContextUsage}from"./after-command-context-usage.js";import{extractProvidedOptionFlags,normalizeLongOptionFlag,redactSensitiveCommandArgs,renderPmCommand}from"./argv-utils.js";import{applyBootstrapPagerPolicy,findBootstrapCommandTokenIndex,normalizeBootstrapInvocation,parseBootstrapCommandName,parseBootstrapGlobalOptions,parseBootstrapHelpRequest,stripGlobalBootstrapTokens}from"./bootstrap-args.js";import{installCommandNamespaces}from"./command-namespaces.js";import{appendCommanderExtensionFailures,formatCommanderUsageJson,formatCommanderUsageMessage,isKnownHelpCommandPath,resolveCommanderUsageContext,resolveUnknownCommanderToken}from"./commander-usage.js";import{loadContextIntentSnapshotForInvocation}from"./context-intent-invocation.js";import{classifyCommanderError,classifyPmCliError,classifyUnknownError,formatPmCliErrorForDisplay,formatPmCliErrorForJson,formatUnknownErrorForJson,projectLeanErrorEnvelope}from"./error-guidance.js";import{applyDynamicExtensionArguments,applyDynamicExtensionFlagOptions,buildCanonicalExtensionAliases,buildDynamicExtensionCommandMetadataHelp,buildResidualDynamicExtensionFlagHelp,collectDynamicExtensionFlagHelpByCommand,collectExtensionCommandHelpDescriptors,collectSafeExtensionCommandPaths,ensureCommandPath,extensionFlagTakesValueForInvocation,findCommandByPath,normalizeExtensionCommandPath,reportExtensionCommandCollision}from"./extension-command-help.js";import{collectLoosePositionalArgs,stripLooseCommandOptionTokens}from"./extension-command-options.js";import{loadExtensionRecoveryFailures,loadUnknownCommandRecoveryFailures}from"./extension-recovery.js";import{attachRichHelpText,isFullHelpDiscovery,setPmCommandHelpVisibilityTier}from"./help-content.js";import{attachCreateUpdatePolicyHelpText,maybeRenderBootstrapJsonHelp}from"./help-json-payload.js";import{collectMandatoryMigrationBlockers,enforceItemFormatWriteGateAndPreflightMigration,enforceMandatoryMigrationWriteGate,enforceMutationGuardPreflight}from"./migration-gates.js";import{applyDefaultOutputFormat,clearResolvedGlobalOptions,collect,formatHookWarnings,getCommandPath,getGlobalOptions,invalidateSearchCachesForMutation,setResolvedGlobalOptions,syncCommanderActionOptions}from"./registration-helpers.js";import{activationCommandMatchesProbe,buildBootstrapActivationProbe,buildRuntimeExtensionActivationScope,buildRuntimeExtensionFilterForProbe,collectActivationCommandCandidates,collectLeadingCommandArgs,collectParsedActivationCommandArgs,commandPathNeedsSearchExtensions,commandPathNeedsTemplateExtensions,discoveryNeedsActivationForProbe,extensionActivationCommands,extensionCapabilities,extensionNeedsActivationForProbe,extensionProvidesTemplatesRuntime,hasAnyCapability,hasGlobalExtensionContributions,matchesStaticExtensionCommand,probeUsesAnyFlag,resolveStaticExtensionActivationDecision}from"./runtime/activation.js";import{collectExtensionFlagDefinitionsForCommand,collectExtensionFlagDefinitionsForInvocation,copyReadOutputInvocationProvenance,dynamicCommandArguments,extractCommandScopedOptions,forwardReadOutputIncludeModes,isImporterOrExporterCommandPath,recordCliReadOutputInvocationProvenance,validateDynamicExtensionCommandArgs,validateDynamicExtensionCommandInvocation}from"./runtime/invocation-options.js";import{LIST_QUERY_COMMAND_NAMES,enforceExplicitRetryForFlagTypos,invocationRequestsVersion,isStaticExtensionInventoryInvocation,resolveStructuredMutationPreviewInvocation,resolveCoreCommandRegistrationSelection,shouldAttachRichHelpTextForInvocation,shouldRegisterDynamicExtensionPaths,shouldRegisterRuntimeSchemaFlags}from"./runtime/selection.js";import{buildPostActionTelemetryOutcome,inferPostActionErrorCode,inferPostActionFailureMessage,normalizeTelemetryCommandResolution,normalizeTelemetryErrorCategory,normalizeTelemetryResolutionStage,readRecordBoolean,readRecordNumber,readRecordString}from"./runtime/telemetry-outcome.js";const PM_PACKAGE_ROOT_ENV="PM_CLI_PACKAGE_ROOT",DEPRECATED_ALIAS_INVOCATION=Symbol("pm.deprecatedAliasInvocation"),COMMAND_ALIASES_BY_FIRST_TOKEN=new Map;for(const contract of PM_COMMAND_ALIAS_CONTRACTS){const firstToken=contract.alias.split(" ")[0],matches=COMMAND_ALIASES_BY_FIRST_TOKEN.get(firstToken)??[];matches.push(contract),COMMAND_ALIASES_BY_FIRST_TOKEN.set(firstToken,matches)}for(const matches of COMMAND_ALIASES_BY_FIRST_TOKEN.values())matches.sort((left,right)=>right.alias.split(" ").length-left.alias.split(" ").length);function resolvePmPackageRoot(){return resolvePmPackageRootFromModule(import.meta.url,["../.."])}(typeof process.env[PM_PACKAGE_ROOT_ENV]!="string"||process.env[PM_PACKAGE_ROOT_ENV]?.trim().length===0)&&(process.env[PM_PACKAGE_ROOT_ENV]=resolvePmPackageRoot());let activeExtensionHookContext=null,activeTelemetryCommandContext=null,activeSentryCommandContext=null;function setActiveExtensionHookContextForTest(context){activeExtensionHookContext=context}function setActiveRuntimeExtensionCommandDescriptorsForTest(descriptors){activeRuntimeExtensionCommandDescriptors=descriptors}let runtimeExtensionSnapshotCache=null,runtimeExtensionDiscoverySnapshotCache=null,activeRuntimeExtensionCommandDescriptors=new Map;const HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS=250,EXPECTED_HANDLED_ERROR_EXIT_CODES=new Set([EXIT_CODE.USAGE,EXIT_CODE.NOT_FOUND,EXIT_CODE.CONFLICT]),TRUE_LIKE_ENV_VALUES=new Set(["1","true","yes","on"]),loadSetupRegistrationModule=createLazyModule(()=>import("./register-setup.js")),loadListQueryRegistrationModule=createLazyModule(()=>import("./register-list-query.js")),loadMutationRegistrationModule=createLazyModule(()=>import("./register-mutation.js")),loadOperationRegistrationModule=createLazyModule(()=>import("./register-operations.js"));function renderAttemptedCommand(argv){return renderPmCommand(argv)}function inferMissingFieldsFromErrorMessage(message){const matches=message.match(/--[a-zA-Z0-9][a-zA-Z0-9_-]*/g);if(!matches||matches.length===0)return;const normalized=[...new Set(matches.map(entry=>normalizeLongOptionFlag(entry)??entry))];return normalized.length>0?normalized:void 0}function inferMissingFieldsForRecovery(rawMessage,invocationArgv,existingRecovery){if(existingRecovery?.suggested_retry||rawMessage.includes("failed in extension handler (")||!/\b(?:missing|required|requires)\b/i.test(rawMessage))return;const providedFields=extractProvidedOptionFlags(invocationArgv),providedSet=new Set(providedFields.map(flag=>normalizeLongOptionFlag(flag)??flag)),rawInferred=inferMissingFieldsFromErrorMessage(rawMessage),commandName=invocationArgv.find(token=>program.commands.some(candidate=>candidate.name()===token)),command=commandName?program.commands.find(candidate=>candidate.name()===commandName):void 0,declaredFlags=new Set([...program.options,...command?.options??[]].flatMap(option=>option.flags.split(/[ ,|]+/).map(flag=>normalizeLongOptionFlag(flag)).filter(flag=>flag!==void 0))),trulyMissing=rawInferred?.filter(flag=>{const normalized=normalizeLongOptionFlag(flag)??flag;return providedSet.has(normalized)?!1:declaredFlags.has(normalized)||extensionFlagTakesValueForInvocation(invocationArgv,commandName,normalized,activeRuntimeExtensionCommandDescriptors)!==void 0});return trulyMissing&&trulyMissing.length>0?trulyMissing:void 0}function resolveRecoverySuggestedRetry(invocationArgv,attemptedCommand,inferredMissing,existingRecovery){if(existingRecovery?.suggested_retry)return existingRecovery.suggested_retry;const missingFlag=inferredMissing?.[0],normalizedMissing=missingFlag?normalizeLongOptionFlag(missingFlag):void 0,commandName=invocationArgv.find(token=>program.commands.some(candidate=>candidate.name()===token)),command=commandName?program.commands.find(candidate=>candidate.name()===commandName):void 0,missingOption=normalizedMissing?command?.options.find(option=>option.flags.split(/[ ,|]+/).includes(normalizedMissing)):void 0,extensionFlagTakesValue=extensionFlagTakesValueForInvocation(invocationArgv,commandName,normalizedMissing,activeRuntimeExtensionCommandDescriptors),missingTokens=normalizedMissing?missingOption?.isBoolean()===!0||extensionFlagTakesValue===!1?[normalizedMissing]:[normalizedMissing,"<value>"]:[],suggestedRetry=normalizedMissing?renderAttemptedCommand([...invocationArgv,...missingTokens]):attemptedCommand;return suggestedRetry===attemptedCommand?void 0:suggestedRetry}function projectExistingRecoveryOptionalFields(existingRecovery){if(!existingRecovery)return{};const optionalFields=["recovery_mode","missing_required_fields","suggested_flags","suggested_retry_args","allowed_values","candidate_commands","candidate_commands_total","candidate_commands_truncated","fallback_candidates","next_best_command"],projected={};for(const field of optionalFields){const value=existingRecovery[field];value!=null&&(projected[field]=value)}return projected}function buildRecoveryPayload(params){const existingRecovery=params.existingRecovery;return{attempted_command:existingRecovery?.attempted_command??params.attemptedCommand,normalized_args:existingRecovery?.normalized_args??[...params.invocationArgv],provided_fields:existingRecovery?.provided_fields??(params.providedFields.length>0?params.providedFields:void 0),missing:existingRecovery?.missing??params.inferredMissing,...projectExistingRecoveryOptionalFields(existingRecovery),...params.suggestedRetry?{suggested_retry:params.suggestedRetry}:{}}}function withContextRecovery(context,recovery){return{...context,recovery}}function repairInvocationRecovery(argv,context){if(context!==void 0)return repairSchemaFieldRecovery(argv,context.code,context.field,repairProjectionRecovery(argv,context.code,context.recovery))}function buildPmCliRecoveryContext(context,invocationArgv,rawMessage){const safeInvocationArgv=redactSensitiveCommandArgs(invocationArgv),commandArgs=stripGlobalBootstrapTokens(safeInvocationArgv),commandIndex=findBootstrapCommandTokenIndex(commandArgs),[rootCommand,subcommand]=commandIndex===void 0?[]:commandArgs.slice(commandIndex,commandIndex+2),explainRequested=safeInvocationArgv.includes("--explain");context=context===void 0?void 0:snapshotPmCliErrorContext(context);const rawExistingRecovery=repairInvocationRecovery(safeInvocationArgv,context),existingRecovery=rawExistingRecovery&&(rootCommand==="history-redact"||rootCommand==="history"&&subcommand==="redact")?{...rawExistingRecovery,...rawExistingRecovery.attempted_command?{attempted_command:renderAttemptedCommand(safeInvocationArgv)}:{},...rawExistingRecovery.normalized_args?{normalized_args:[...safeInvocationArgv]}:{},...rawExistingRecovery.suggested_retry?{suggested_retry:renderAttemptedCommand(safeInvocationArgv)}:{},...rawExistingRecovery.suggested_retry_args?{suggested_retry_args:[...safeInvocationArgv]}:{}}:rawExistingRecovery;if(existingRecovery?.recovery_mode==="compact"&&!explainRequested)return withContextRecovery(context,existingRecovery);const attemptedCommand=renderAttemptedCommand(safeInvocationArgv),providedFields=extractProvidedOptionFlags(safeInvocationArgv),inferredMissing=inferMissingFieldsForRecovery(rawMessage,safeInvocationArgv,existingRecovery),suggestedRetry=resolveRecoverySuggestedRetry(safeInvocationArgv,attemptedCommand,inferredMissing,existingRecovery),recovery=buildRecoveryPayload({invocationArgv:safeInvocationArgv,attemptedCommand,providedFields,inferredMissing,suggestedRetry,existingRecovery});return withContextRecovery(context,recovery)}async function runAndClearAfterCommandHooks(outcome){const telemetryRuntime=activeTelemetryCommandContext;activeTelemetryCommandContext=null,await finishActiveTelemetryCommand(telemetryRuntime,outcome);const runtime=activeExtensionHookContext;if(activeExtensionHookContext=null,!runtime){clearActiveExtensionHooks();return}let hookWarnings=[];const affected=consumeAfterCommandAffectedItems();try{await recordAfterCommandContextUsage({pmRoot:runtime.pmRoot,author:runtime.globalOptions.author,itemIds:outcome.ok?affected?.map(item=>item.id)??[]:[],intent:runtime.commandName})}catch{hookWarnings.push("context_usage_feedback_write_failed")}try{hookWarnings.push(...await runAfterCommandHooks(runtime.hooks,{command:runtime.commandName,args:runtime.commandArgs,options:{...runtime.commandOptions},global:{...runtime.globalOptions},pm_root:runtime.pmRoot,ok:outcome.ok,error:outcome.error,result:getActiveCommandResult(),affected}))}catch(error){hookWarnings=[`afterCommand hooks failed: ${error instanceof Error?error.message:String(error)}`]}finally{clearActiveExtensionHooks()}!runtime.globalOptions.json&&hookWarnings.length>0&&printError(`[pm] warning: afterCommand hook_warnings=${formatHookWarnings(hookWarnings)}`),runtime.profileEnabled&&hookWarnings.length>0&&printError(`profile:extensions hook_warnings=${formatHookWarnings(hookWarnings)}`)}async function ensureSentryForErrorReporting(attemptedCommand,bootstrapGlobal){await ensureSentryInit();const runtime=activeTelemetryCommandContext,hook=activeExtensionHookContext,command=runtime?.command??hook?.commandName??attemptedCommand,attribution=runtime??resolveTelemetrySourceAttribution(hook?.globalOptions??bootstrapGlobal),source=activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(command))?.source;sentrySetCommandContext(command,hook?.commandArgs??[],{...hook?.commandOptions,...hook?.globalOptions},{source_context:attribution.source_context,source_context_source:attribution.source_context_source,pm_version:runtime?.pm_version??CLI_VERSION,extension:source})}function envFlagEnabled(key){return TRUE_LIKE_ENV_VALUES.has((process.env[key]??"").trim().toLowerCase())}function shouldLogHandledErrorToSentry(exitCode){return envFlagEnabled("PM_SENTRY_CAPTURE_EXPECTED_ERRORS")?!0:!EXPECTED_HANDLED_ERROR_EXIT_CODES.has(Math.trunc(exitCode))}async function maybeLogHandledCliErrorToSentry(params,bootstrapGlobal){return shouldLogHandledErrorToSentry(params.exit_code)?(await ensureSentryForErrorReporting(params.command,bootstrapGlobal),sentryLogCliUsageError({...params,source_context:params.source_context??resolveTelemetrySourceAttribution(bootstrapGlobal).source_context}),!0):!1}async function handleGenericRunPmCliError(params){const message=describeUnknownError(params.error),classification=classifyUnknownError(message);params.bootstrapGlobal.json?printError(JSON.stringify(attachPreflightWarnings(formatUnknownErrorForJson(message,EXIT_CODE.GENERIC_FAILURE)),null,2)):printError(message),process.exitCode=EXIT_CODE.GENERIC_FAILURE;let errorCategory="runtime",commandResolution="runtime_failed";try{await ensureSentryForErrorReporting(params.attemptedCommand,params.bootstrapGlobal),sentryCaptureCliError(params.error);const telemetry=await params.emitTelemetryCommandError({command:params.attemptedCommand,errorCode:classification.code,errorMessage:classification.detail,exitCode:EXIT_CODE.GENERIC_FAILURE,options:{bootstrap_global_options:params.bootstrapGlobal},resolutionStage:"execute"});errorCategory=telemetry.errorCategory,commandResolution=telemetry.commandResolution,await finishActiveSentryCommandSpan(!1,message,{error_code:classification.code,error_category:errorCategory,exit_code:EXIT_CODE.GENERIC_FAILURE,command_resolution:commandResolution,resolution_stage:"execute"})}catch(reportingError){params.bootstrapGlobal.json||printError(`Failed to report error: ${describeUnknownError(reportingError)}`)}try{await runAndClearAfterCommandHooks({ok:!1,error:message,exit_code:EXIT_CODE.GENERIC_FAILURE,error_code:classification.code,error_category:errorCategory,command_resolution:commandResolution,resolution_stage:"execute"})}catch(hookError){params.bootstrapGlobal.json||printError(`Failed to run error hooks: ${describeUnknownError(hookError)}`)}try{await sentryFlush()}catch(flushError){params.bootstrapGlobal.json||printError(`Failed to flush error reporting: ${describeUnknownError(flushError)}`)}}const RUNTIME_FIELD_COMMAND_BY_COMMAND_PATH={create:"create",update:"update","update-many":"update_many",list:"list","list-all":"list","list-draft":"list","list-open":"list","list-in-progress":"list","list-blocked":"list","list-closed":"list","list-canceled":"list",search:"search",calendar:"calendar",context:"context","templates save":"create"},runtimeFieldLooseFlagDefinitionCache=new Map;function toLooseFieldDefinitionType(fieldType){return fieldType==="number"?"number":fieldType==="boolean"?"boolean":"string"}function commandHasLongOption(command,longFlag){return command.options.some(option=>option.long===longFlag)}function commandHasShortOption(command,shortFlag){return command.options.some(option=>option.short===shortFlag)}function addRuntimeFieldOption(command,flagToken,description,repeatable){const normalizedToken=flagToken.trim();if(!normalizedToken)return;const helpText=description.length>0?description:`Runtime schema field (${flagToken})`;if(normalizedToken.startsWith("-")&&!normalizedToken.startsWith("--")){if(commandHasShortOption(command,normalizedToken))return;if(repeatable){command.option(`${normalizedToken} <value>`,`${helpText} (repeatable)`,collect);return}command.option(`${normalizedToken} <value>`,helpText);return}const longFlag=normalizedToken.startsWith("--")?normalizedToken:`--${normalizedToken}`;if(!commandHasLongOption(command,longFlag)){if(repeatable){command.option(`${longFlag} <value>`,`${helpText} (repeatable)`,collect);return}command.option(`${longFlag} <value>`,helpText)}}async function collectRuntimeFieldLooseFlagDefinitionsForCommand(commandPath,pmRoot){const runtimeCommand=RUNTIME_FIELD_COMMAND_BY_COMMAND_PATH[commandPath];if(!runtimeCommand)return[];const cacheKey=`${pmRoot}:${runtimeCommand}`,cached=runtimeFieldLooseFlagDefinitionCache.get(cacheKey);if(cached)return cached;if(!await pathExists(getSettingsPath(pmRoot)))return runtimeFieldLooseFlagDefinitionCache.set(cacheKey,[]),[];const settings=await readSettings(pmRoot),definitions=(resolveRuntimeFieldRegistry(settings.schema).command_to_fields.get(runtimeCommand)??[]).flatMap(field=>[field.cli_flag,...field.cli_aliases].map(token=>({long:`--${token}`,type:toLooseFieldDefinitionType(field.type),value_type:toLooseFieldDefinitionType(field.type)})));return runtimeFieldLooseFlagDefinitionCache.set(cacheKey,definitions),definitions}async function registerRuntimeSchemaFieldFlags(rootProgram,invocationArgv){const bootstrapGlobalOptions=parseBootstrapGlobalOptions(invocationArgv),pmRoot=resolvePmRoot(process.cwd(),bootstrapGlobalOptions.path);if(!await pathExists(getSettingsPath(pmRoot)))return;const cachedDiscovery=runtimeExtensionDiscoverySnapshotCache?.key===buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot)?runtimeExtensionDiscoverySnapshotCache.snapshot:null,settings=cachedDiscovery===null?await readSettings(pmRoot):cachedDiscovery.settings,fieldRegistry=resolveRuntimeFieldRegistry(settings.schema),mappings=[{path:"create",command:"create"},{path:"update",command:"update"},{path:"update-many",command:"update_many"},{path:"list",command:"list"},{path:"list-all",command:"list"},{path:"list-draft",command:"list"},{path:"list-open",command:"list"},{path:"list-in-progress",command:"list"},{path:"list-blocked",command:"list"},{path:"list-closed",command:"list"},{path:"list-canceled",command:"list"},{path:"search",command:"search"},{path:"calendar",command:"calendar"},{path:"context",command:"context"},{path:"templates save",command:"create"}];for(const mapping of mappings){const command=findCommandByPath(rootProgram,mapping.path.split(" "));if(command)for(const field of fieldRegistry.command_to_fields.get(mapping.command)??[]){const description=field.description??"";addRuntimeFieldOption(command,field.cli_flag,description,field.repeatable);for(const alias of field.cli_aliases)addRuntimeFieldOption(command,alias,`Alias for --${field.cli_flag}`,field.repeatable)}}}async function maybeAttachCreateUpdatePolicyHelpText(rootProgram,pmRoot,invocationArgv,registrations,settings){const bootstrapCommand=parseBootstrapCommandName(invocationArgv);if(!(bootstrapCommand!=="create"&&bootstrapCommand!=="update"))try{const resolvedSettings=settings??await readSettings(pmRoot),typeRegistry=resolveItemTypeRegistry(resolvedSettings,registrations);attachCreateUpdatePolicyHelpText(rootProgram,typeRegistry,invocationArgv)}catch{}}function defaultPreflightDecision(){return{enforce_item_format_gate:!0,run_preflight_item_format_sync:!0,run_extension_migrations:!0,enforce_mandatory_migration_gate:!0}}function buildRuntimeExtensionSnapshotCacheKey(pmRoot,activationScope="all"){return activationScope==="all"?`pm-root:${pmRoot}`:`pm-root:${pmRoot}:activation:${activationScope}`}function bootstrapProfileEnabled(invocationArgv){return invocationArgv.some(token=>token==="--profile")}function buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot){return`pm-root:${pmRoot}`}function emitSettingsReadWarnings(warnings){for(const warning of warnings)warning.startsWith("settings_read_")&&emitPreflightWarning(warning,`[pm] warning: ${warning} \u2014 settings.json could not be loaded and pm fell back to defaults; run pm health for remediation.`)}function emitExtensionProfile(globalOptions,snapshot){globalOptions.profile&&(printError(`profile:extensions loaded=${snapshot.loadedCount} failed=${snapshot.loadFailedCount} warnings=${snapshot.loadWarnings.length} activation_failed=${snapshot.activationFailedCount} hook_counts=before:${snapshot.hooks.beforeCommand.length}|after:${snapshot.hooks.afterCommand.length}|write:${snapshot.hooks.onWrite.length}|read:${snapshot.hooks.onRead.length}|index:${snapshot.hooks.onIndex.length} command_overrides=${snapshot.commands.overrides.length} command_handlers=${snapshot.commands.handlers.length} parser_overrides=${snapshot.parsers.overrides.length} preflight_overrides=${snapshot.preflight.overrides.length} service_overrides=${snapshot.services.overrides.length} renderer_overrides=${snapshot.renderers.overrides.length}`),snapshot.activationWarnings.length>0&&printError(`profile:extensions activation_warnings=${formatHookWarnings(snapshot.activationWarnings)}`))}function emitExtensionSkippedProfile(profileEnabled,snapshot,probe){if(!profileEnabled)return;const command=normalizeExtensionCommandPath(probe.commandPath??"")||"<none>";printError(`profile:extensions activation=skipped command=${command} effective=${snapshot.discovery.effective.length} warnings=${snapshot.discovery.warnings.length} discovery_ms=${snapshot.discoveryMs}`)}async function loadRuntimeExtensionDiscoverySnapshot(pmRoot,readSettingsWithMetadataFn=readSettingsWithMetadata){const cacheKey=buildRuntimeExtensionDiscoverySnapshotCacheKey(pmRoot);if(runtimeExtensionDiscoverySnapshotCache?.key===cacheKey)return runtimeExtensionDiscoverySnapshotCache.snapshot;try{const startedAt=Date.now(),{settings,warnings:settingsReadWarnings}=await readSettingsWithMetadataFn(pmRoot),discovery=await discoverExtensions({pmRoot,settings,cwd:process.cwd(),noExtensions:!1}),snapshot={pmRoot,settings,discovery,discoveryMs:Date.now()-startedAt,settingsReadWarnings:[...settingsReadWarnings]};return runtimeExtensionDiscoverySnapshotCache={key:cacheKey,snapshot},snapshot}catch{return runtimeExtensionDiscoverySnapshotCache={key:cacheKey,snapshot:null},null}}async function loadRuntimeExtensionSnapshot(pmRoot,probe,readSettingsFn=readSettings){const activationScope=probe?buildRuntimeExtensionActivationScope(probe):"all",cacheKey=buildRuntimeExtensionSnapshotCacheKey(pmRoot,activationScope);if(runtimeExtensionSnapshotCache?.key===cacheKey)return runtimeExtensionSnapshotCache.snapshot;try{const settings=await readSettingsFn(pmRoot),loadResult=await loadExtensions({pmRoot,settings,cwd:process.cwd(),noExtensions:!1,extensionFilter:probe?buildRuntimeExtensionFilterForProbe(probe):void 0}),activationResult=await activateExtensions({...loadResult,loaded:loadResult.loaded}),commandHandlers=[...new Set(activationResult.commands.handlers.map(entry=>normalizeExtensionCommandPath(entry.command)))].filter(entry=>entry.length>0).sort((left,right)=>left.localeCompare(right)),commandFlagHelp=collectDynamicExtensionFlagHelpByCommand(activationResult.registrations.flags),canonicalAliases=buildCanonicalExtensionAliases(activationResult.commands.handlers,activationResult.registrations.commands),commandDescriptors=collectExtensionCommandHelpDescriptors(commandHandlers,activationResult.registrations.commands,activationResult.registrations.flags,canonicalAliases),snapshot={hooks:activationResult.hooks,commands:activationResult.commands,parsers:activationResult.parsers,preflight:activationResult.preflight,services:activationResult.services,renderers:activationResult.renderers,registrations:activationResult.registrations,pmRoot,settings,commandHandlers,commandFlagHelp,commandDescriptors,commandAliases:canonicalAliases,loadWarnings:[...loadResult.warnings],activationWarnings:[...activationResult.warnings],loadedCount:loadResult.loaded.length,loadFailedCount:loadResult.failed.length,activationFailedCount:activationResult.failed.length,contextIntentPackages:loadResult.loaded.map(({name,module})=>({name,module}))};return runtimeExtensionSnapshotCache={key:cacheKey,snapshot},snapshot}catch{return runtimeExtensionSnapshotCache={key:cacheKey,snapshot:null},null}}async function maybeLoadRuntimeExtensions(command){const globalOptions=getGlobalOptions(command);if(globalOptions.noExtensions){const noExtPmRoot=resolvePmRoot(process.cwd(),globalOptions.path);return await pathExists(getSettingsPath(noExtPmRoot))&&emitSettingsReadWarnings((await readSettingsWithMetadata(noExtPmRoot)).warnings),null}const pmRoot=resolvePmRoot(process.cwd(),globalOptions.path),discoverySnapshot=await loadRuntimeExtensionDiscoverySnapshot(pmRoot);if(!discoverySnapshot)return null;emitSettingsReadWarnings(discoverySnapshot.settingsReadWarnings);const probe={commandPath:getCommandPath(command),commandArgs:collectParsedActivationCommandArgs(command)};if(!discoveryNeedsActivationForProbe(discoverySnapshot.discovery,probe))return emitExtensionSkippedProfile(globalOptions.profile,discoverySnapshot,probe),null;const snapshot=await loadRuntimeExtensionSnapshot(pmRoot,probe);return snapshot?(emitExtensionProfile(globalOptions,snapshot),{hooks:snapshot.hooks,commands:snapshot.commands,parsers:snapshot.parsers,preflight:snapshot.preflight,services:snapshot.services,renderers:snapshot.renderers,registrations:snapshot.registrations,pmRoot}):null}async function loadRuntimeExtensionCommandDescriptorsForRecovery(pmRoot){const snapshot=await loadRuntimeExtensionSnapshot(pmRoot);return snapshot?new Map(snapshot.commandDescriptors):activeRuntimeExtensionCommandDescriptors}async function resolveHelpRecoveryDescriptors(helpRequest,bootstrapGlobal){return!helpRequest.requested||bootstrapGlobal.noExtensions||isKnownHelpCommandPath(program,helpRequest.commandPathTokens)?activeRuntimeExtensionCommandDescriptors:loadRuntimeExtensionCommandDescriptorsForRecovery(resolvePmRoot(process.cwd(),bootstrapGlobal.path))}async function executeRegisteredRuntimeMigrations(migrations,pmRoot){return(await runExtensionMigrations({pmRoot,migrations,author:"pm-extension-migration"})).migrations.filter(migration=>migration.outcome==="failed").map(migration=>`extension_migration_failed:${migration.layer}:${migration.extension}:${migration.id}`)}function buildExtensionCommandSdk(pmRoot,global2,commandPath){const author=global2.author;return createExtensionCommandSdk(pmRoot,PmClient.forActiveExtensionHost({pmRoot,author}),author,normalizeExtensionCommandPath(commandPath))}async function runRequiredExtensionCommand(command,options,globalOptions,extensionFlagDefinitions=[]){const commandPath=getCommandPath(command);let commandArgs=stripLooseCommandOptionTokens(command.args.map(String),extensionFlagDefinitions),commandOptions={...options};delete commandOptions.author;let resolvedGlobalOptions={...globalOptions};const pmRoot=resolvePmRoot(process.cwd(),globalOptions.path),dispatchInput={args:[...commandArgs],path:globalOptions.path},parserOverride=await runActiveParserOverride({command:commandPath,args:commandArgs,options:commandOptions,global:resolvedGlobalOptions,pm_root:pmRoot});globalOptions.profile&&parserOverride.warnings.length>0&&printError(`profile:extensions parser_warnings=${formatHookWarnings(parserOverride.warnings)}`),commandArgs=parserOverride.context.args,commandOptions=parserOverride.context.options,resolvedGlobalOptions=parserOverride.context.global,assertGuardedDispatchUnchanged(dispatchInput,{args:commandArgs,path:resolvedGlobalOptions.path},commandOptions),validateDynamicExtensionCommandInvocation(activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(commandPath)),commandArgs,commandOptions,extensionFlagDefinitions),setActiveCommandResult(void 0),setActiveCommandContext({command:commandPath,args:commandArgs,options:{...commandOptions},global:{...resolvedGlobalOptions},pm_root:pmRoot});const extensionCommandResult=await runActiveCommandHandler({command:commandPath,args:commandArgs,options:commandOptions,global:resolvedGlobalOptions,pm_root:pmRoot,sdk:buildExtensionCommandSdk(pmRoot,resolvedGlobalOptions,commandPath)});if(resolvedGlobalOptions.profile&&extensionCommandResult.warnings.length>0&&printError(`profile:extensions command_handler_warnings=${formatHookWarnings(extensionCommandResult.warnings)}`),!extensionCommandResult.handled)throw extensionCommandResult.warnings.length>0?createExtensionCommandError(commandPath,extensionCommandResult):new PmCliError(`Command "${commandPath}" is provided by extensions and is not currently available.`,EXIT_CODE.NOT_FOUND);return extensionCommandResult.exitCode!==void 0&&(process.exitCode=extensionCommandResult.exitCode),setActiveCommandResult(extensionCommandResult.result),extensionCommandResult.result}const WRAPPED_ACTION_HANDLER=Symbol("pm.wrappedActionHandler");function resolveActionCommand(actionArgs,fallback){const possibleCommand=actionArgs[actionArgs.length-1];return possibleCommand instanceof Command?possibleCommand:fallback}function maybePrintExtensionProfileWarnings(enabled,label,warnings){enabled&&warnings.length>0&&printError(`profile:extensions ${label}=${formatHookWarnings(warnings)}`)}function validateDynamicInvocationArgs(params){const dynamicDescriptor=activeRuntimeExtensionCommandDescriptors.get(normalizeExtensionCommandPath(params.commandPath));if(!dynamicDescriptor||!isImporterOrExporterCommandPath(params.activeRegistrations,params.commandPath))return;const positionalArgs=dynamicCommandArguments(dynamicDescriptor).length===0?collectLoosePositionalArgs(params.commandArgs):stripLooseCommandOptionTokens(params.commandArgs,params.extensionFlagDefinitions);validateDynamicExtensionCommandArgs(dynamicDescriptor,positionalArgs)}function syncCommanderActionArgs(actionCommand,actionArgs,commandArgs){actionCommand.args=[...commandArgs],"_processArguments"in actionCommand&&typeof actionCommand._processArguments=="function"&&actionCommand._processArguments(),actionArgs.length>0&&Array.isArray(actionArgs[0])&&(actionArgs[0]=[...actionCommand.processedArgs])}function wrapProgramActionsForExtensionHandlers(rootProgram){const visit=entry=>{const actionEntry=entry;if(typeof actionEntry._actionHandler=="function"&&actionEntry[WRAPPED_ACTION_HANDLER]!==!0){const originalAction=actionEntry._actionHandler;actionEntry._actionHandler=async function(...actionArgs){const actionCommand=resolveActionCommand(actionArgs,entry),startedAt=Date.now();clearResolvedGlobalOptions(actionCommand);let globalOptions=getGlobalOptions(actionCommand);const commandPath=resolvePmCommandOperation(getCommandPath(actionCommand));if(["package inventory","packages inventory","extension inventory"].includes(commandPath))return refuseInventoryExpectHash(commandPath,globalOptions.expectHash),await originalAction.apply(this,actionArgs);const pmRoot=resolvePmRoot(process.cwd(),globalOptions.path);let commandArgs=actionCommand.args.map(String);const activeRegistrations=getActiveExtensionRegistrations(),extensionFlagDefinitions=activeRegistrations?collectExtensionFlagDefinitionsForInvocation(activeRegistrations,commandPath,commandArgs):[],runtimeFieldFlagDefinitions=await collectRuntimeFieldLooseFlagDefinitionsForCommand(commandPath,pmRoot);let commandOptions=extractCommandScopedOptions(actionCommand,commandArgs,[...extensionFlagDefinitions,...runtimeFieldFlagDefinitions]);activeRuntimeExtensionCommandDescriptors.has(normalizeExtensionCommandPath(commandPath))&&delete commandOptions.author;const dispatchInput={args:[...commandArgs],path:globalOptions.path},parserOverride=await runActiveParserOverride({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:pmRoot});maybePrintExtensionProfileWarnings(globalOptions.profile,"parser_warnings",parserOverride.warnings),commandArgs=parserOverride.context.args,commandOptions=parserOverride.context.options,copyReadOutputInvocationProvenance(actionCommand,commandOptions),globalOptions=parserOverride.context.global,assertGuardedDispatchUnchanged(dispatchInput,{args:commandArgs,path:globalOptions.path},commandOptions),validateDynamicInvocationArgs({activeRegistrations,commandPath,commandArgs,extensionFlagDefinitions}),globalOptions=await applyDefaultOutputFormat(globalOptions),setResolvedGlobalOptions(actionCommand,globalOptions),syncCommanderActionArgs(actionCommand,actionArgs,commandArgs),syncCommanderActionOptions(actionCommand,commandOptions),setActiveCommandResult(void 0),setActiveCommandContext({command:commandPath,args:commandArgs,options:{...commandOptions},global:{...globalOptions},pm_root:pmRoot});const extensionCommandResult=await runActiveCommandHandler({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:pmRoot,sdk:buildExtensionCommandSdk(pmRoot,globalOptions,commandPath)});if(maybePrintExtensionProfileWarnings(globalOptions.profile,"command_handler_warnings",extensionCommandResult.warnings),extensionCommandResult.handled){setActiveCommandResult(extensionCommandResult.result),printResult(extensionCommandResult.result,{...globalOptions,command:commandPath,commandArgs,commandOptions,pmRoot}),globalOptions.profile&&printError(`profile:command=${commandPath} took_ms=${Date.now()-startedAt}`);return}return await originalAction.apply(this,actionArgs)},actionEntry[WRAPPED_ACTION_HANDLER]=!0}for(const child of entry.commands)visit(child)};visit(rootProgram)}async function clearDynamicExtensionCommandState(params){activeRuntimeExtensionCommandDescriptors=new Map,setActiveExtensionServices({overrides:[]}),params&&await maybeAttachCreateUpdatePolicyHelpText(params.rootProgram,params.pmRoot,params.invocationArgv,createEmptyExtensionRegistrationRegistry(),params.settings)}function attachDynamicExtensionHelp(command,descriptor,flagHelp,metadataHelp){if(descriptor?.flags&&descriptor.flags.length>0){applyDynamicExtensionFlagOptions(command,descriptor.flags);const residualFlagHelp=buildResidualDynamicExtensionFlagHelp(command,descriptor.flags);residualFlagHelp&&command.addHelpText("after",residualFlagHelp)}else flagHelp&&command.addHelpText("after",flagHelp);metadataHelp&&command.addHelpText("after",metadataHelp)}function applyDynamicExtensionRootHelpVisibility(rootProgram,preexistingTopLevelCommands,descriptors){const tierRank={core:0,standard:1,full:2,internal:3},applyVisibility=(command,pathParts)=>{const commandPath=pathParts.join(" "),matchingDescriptors=[...descriptors.entries()].filter(([path])=>path===commandPath||path.startsWith(`${commandPath} `)).map(([,descriptor])=>descriptor),tier=matchingDescriptors.length===0?"standard":matchingDescriptors.reduce((selected,descriptor)=>tierRank[descriptor.tier]<tierRank[selected]?descriptor.tier:selected,"internal");setPmCommandHelpVisibilityTier(command,tier);for(const child of command.commands)applyVisibility(child,[...pathParts,child.name()])};for(const command of rootProgram.commands)preexistingTopLevelCommands.has(command.name())||applyVisibility(command,[command.name()])}async function registerDynamicExtensionCommandPaths(rootProgram,invocationArgv){const bootstrapGlobalOptions=parseBootstrapGlobalOptions(invocationArgv),pmRoot=resolvePmRoot(process.cwd(),bootstrapGlobalOptions.path);if(bootstrapGlobalOptions.noExtensions){await clearDynamicExtensionCommandState({rootProgram,pmRoot,invocationArgv});return}const discoverySnapshot=await loadRuntimeExtensionDiscoverySnapshot(pmRoot),probe=buildBootstrapActivationProbe(invocationArgv);if(!discoverySnapshot){await clearDynamicExtensionCommandState();return}if(!discoveryNeedsActivationForProbe(discoverySnapshot.discovery,probe)){await clearDynamicExtensionCommandState({rootProgram,pmRoot,invocationArgv,settings:discoverySnapshot.settings}),emitExtensionSkippedProfile(bootstrapProfileEnabled(invocationArgv),discoverySnapshot,probe);return}const snapshot=await loadRuntimeExtensionSnapshot(pmRoot,probe);if(!snapshot){await clearDynamicExtensionCommandState({rootProgram,pmRoot,invocationArgv,settings:discoverySnapshot.settings});return}setActiveExtensionServices(snapshot.services),activeRuntimeExtensionCommandDescriptors=new Map(snapshot.commandDescriptors),await maybeAttachCreateUpdatePolicyHelpText(rootProgram,pmRoot,invocationArgv,snapshot.registrations,snapshot.settings);const commandPaths=collectSafeExtensionCommandPaths(rootProgram,snapshot.commandHandlers,snapshot.commandDescriptors,snapshot.commandAliases,warning=>reportExtensionCommandCollision(snapshot.activationWarnings,printError,warning)),preexistingTopLevelCommands=new Set(rootProgram.commands.map(command=>command.name())),registerCommandPath=commandPath=>{const pathParts=commandPath.split(" ").filter(part=>part.length>0),descriptor=snapshot.commandDescriptors.get(commandPath),existingCommand=findCommandByPath(rootProgram,pathParts),flagHelp=snapshot.commandFlagHelp.get(commandPath),metadataHelp=descriptor?buildDynamicExtensionCommandMetadataHelp(descriptor):null;if(existingCommand){attachDynamicExtensionHelp(existingCommand,descriptor,flagHelp,metadataHelp);return}const dynamicCommand=ensureCommandPath(rootProgram,pathParts);descriptor?.description&&dynamicCommand.description(descriptor.description);let residualDynamicFlagHelp=flagHelp;descriptor&&(applyDynamicExtensionArguments(dynamicCommand,descriptor),descriptor.flags.length>0&&(applyDynamicExtensionFlagOptions(dynamicCommand,descriptor.flags),residualDynamicFlagHelp=buildResidualDynamicExtensionFlagHelp(dynamicCommand,descriptor.flags)??void 0)),residualDynamicFlagHelp&&dynamicCommand.addHelpText("after",residualDynamicFlagHelp),metadataHelp&&dynamicCommand.addHelpText("after",metadataHelp),dynamicCommand.allowUnknownOption(!0).allowExcessArguments(!0).action(async(...actionArgs)=>{const maybeCommand=actionArgs[actionArgs.length-1],command=maybeCommand instanceof Command?maybeCommand:dynamicCommand,globalOptions=getGlobalOptions(command),startedAt=Date.now(),extensionFlagDefinitions=collectExtensionFlagDefinitionsForInvocation(snapshot.registrations,commandPath,command.args.map(String)),scopedOptions=extractCommandScopedOptions(command,command.args.map(String),extensionFlagDefinitions),result=await runRequiredExtensionCommand(command,scopedOptions,globalOptions,extensionFlagDefinitions);await invalidateSearchCachesForMutation(globalOptions,result),printResult(result,{...globalOptions,command:commandPath,commandArgs:command.args.map(String),commandOptions:scopedOptions,pmRoot}),globalOptions.profile&&printError(`profile:command=${commandPath} took_ms=${Date.now()-startedAt}`)})};for(const commandPath of commandPaths)registerCommandPath(commandPath);applyDynamicExtensionRootHelpVisibility(rootProgram,preexistingTopLevelCommands,snapshot.commandDescriptors)}const CLI_VERSION=resolvePmCliVersion(import.meta.url,["../.."])??"0.0.0";let program=createPmCliProgram(CLI_VERSION);async function recordActiveDeprecatedAliasUsage(rootProgram){if(!activeTelemetryCommandContext)return;const alias=Reflect.get(rootProgram,DEPRECATED_ALIAS_INVOCATION);typeof alias=="string"&&await recordDeprecatedAliasUsage(alias)}async function runCommandPreparation(actionCommand,skipped,run){const commandPath=getCommandPath(actionCommand);return["item mutate","item complete"].includes(commandPath)&&actionCommand.optsWithGlobals().dryRun===!0?skipped:run()}async function startActiveSentryCommandTracing(command,args,options){!activeTelemetryCommandContext||!await ensureSentryCommandTracing(!0)||(sentrySetCommandContext(command,args,options,{source_context:activeTelemetryCommandContext.source_context,source_context_source:activeTelemetryCommandContext.source_context_source}),sentryStartCommandSpan(command),activeSentryCommandContext=activeTelemetryCommandContext)}async function finishActiveSentryCommandSpan(ok,error,metadata){const runtime=activeSentryCommandContext;if(!runtime)return;activeSentryCommandContext=null;let consent=!1;try{const settings=await readSettings(runtime.global_pm_root);consent=settings.telemetry.enabled&&settings.telemetry.installation_id===runtime.installation_id}catch{}await ensureSentryCommandTracing(consent)?sentryFinishCommandSpan(ok,error,metadata):sentryDiscardCommandSpan()}async function loadRuntimeReadDeclarations(actionCommand){const snapshot=await maybeLoadRuntimeExtensions(actionCommand);return setActiveExtensionRegistrations(snapshot?.registrations??null),snapshot}function attachProgramLifecycleHooks(rootProgram,invocationArgv){invocationArgv&&isStaticExtensionInventoryInvocation(invocationArgv)||(rootProgram.hook("preAction",async(_thisCommand,actionCommand)=>{activeExtensionHookContext=null,activeTelemetryCommandContext=null,activeSentryCommandContext=null,clearActiveExtensionHooks(),clearResolvedGlobalOptions(actionCommand);const rawGlobalOptions=actionCommand.optsWithGlobals(),bootstrapGlobalOptions=getGlobalOptions(actionCommand),commandPath=resolvePmCommandOperation(getCommandPath(actionCommand));let commandArgs=actionCommand.args.map(String);const invocationStage={args:[...commandArgs],path:bootstrapGlobalOptions.path};let commandOptions=extractCommandScopedOptions(actionCommand,commandArgs),globalOptions={...bootstrapGlobalOptions};const fallbackPmRoot=resolvePmRoot(process.cwd(),bootstrapGlobalOptions.path),runtimeExtensions=await loadRuntimeReadDeclarations(actionCommand);if(validateReadOutputOptions(commandPath,{...commandOptions,outputInclude:rawGlobalOptions.outputInclude,outputLimit:rawGlobalOptions.outputLimit,outputBudget:rawGlobalOptions.outputBudget,outputFormat:rawGlobalOptions.outputFormat,outputSession:rawGlobalOptions.outputSession,outputCursor:rawGlobalOptions.outputCursor}),forwardReadOutputIncludeModes(actionCommand,commandPath,globalOptions,commandOptions),await runCommandPreparation(actionCommand,void 0,()=>maybeRunFirstUseTelemetryPrompt(commandPath,globalOptions)),!runtimeExtensions){activeExtensionHookContext=createCoreCommandHookContext({commandName:commandPath,commandArgs,commandOptions,globalOptions,pmRoot:fallbackPmRoot}),activeTelemetryCommandContext=await startTelemetryCommand({command:commandPath,pm_version:CLI_VERSION,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:fallbackPmRoot}),await recordActiveDeprecatedAliasUsage(rootProgram),await startActiveSentryCommandTracing(commandPath,commandArgs,commandOptions),await enforceItemFormatWriteGateAndPreflightMigration(commandPath,commandOptions,fallbackPmRoot,defaultPreflightDecision()),await enforceMutationGuardPreflight(commandPath,commandArgs,commandOptions,globalOptions,fallbackPmRoot),await bindInvocationExpectedRevisions({command:actionCommand,commandPath,commandArgs,commandOptions,expectHash:bootstrapGlobalOptions.expectHash,pmRoot:fallbackPmRoot});return}setActiveExtensionHooks(runtimeExtensions.hooks),setActiveExtensionCommands(runtimeExtensions.commands),setActiveExtensionParsers(runtimeExtensions.parsers),setActiveExtensionPreflight(runtimeExtensions.preflight),setActiveExtensionServices(runtimeExtensions.services),setActiveExtensionRenderers(runtimeExtensions.renderers),setActiveExtensionRegistrations(runtimeExtensions.registrations);const extensionFlagDefinitions=collectExtensionFlagDefinitionsForInvocation(runtimeExtensions.registrations,commandPath,commandArgs);commandOptions=extractCommandScopedOptions(actionCommand,commandArgs,extensionFlagDefinitions),forwardReadOutputIncludeModes(actionCommand,commandPath,globalOptions,commandOptions);const parserOverride=await runActiveParserOverride({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:runtimeExtensions.pmRoot});globalOptions.profile&&parserOverride.warnings.length>0&&printError(`profile:extensions parser_warnings=${formatHookWarnings(parserOverride.warnings)}`),commandArgs=parserOverride.context.args,commandOptions=parserOverride.context.options,copyReadOutputInvocationProvenance(actionCommand,commandOptions),globalOptions=parserOverride.context.global;const parserStage={args:[...commandArgs],path:globalOptions.path};syncCommanderActionOptions(actionCommand,commandOptions);const preflightOverride=await runActivePreflightOverride({command:commandPath,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:runtimeExtensions.pmRoot,decision:defaultPreflightDecision()});globalOptions.profile&&preflightOverride.warnings.length>0&&printError(`profile:extensions preflight_warnings=${formatHookWarnings(preflightOverride.warnings)}`),commandArgs=preflightOverride.context.args,commandOptions=preflightOverride.context.options,copyReadOutputInvocationProvenance(actionCommand,commandOptions),globalOptions=preflightOverride.context.global,syncCommanderActionOptions(actionCommand,commandOptions);const preflightDecision=preflightOverride.decision;await enforceItemFormatWriteGateAndPreflightMigration(commandPath,commandOptions,runtimeExtensions.pmRoot,preflightDecision),await enforceMutationGuardPreflight(commandPath,commandArgs,commandOptions,globalOptions,runtimeExtensions.pmRoot),await bindInvocationExpectedRevisions({command:actionCommand,commandPath,commandArgs:invocationStage.args,commandOptions,expectHash:bootstrapGlobalOptions.expectHash,pmRoot:runtimeExtensions.pmRoot,rewritten:invocationRewritten(invocationStage,[parserStage,{args:commandArgs,path:globalOptions.path}])});const migrationWarnings=preflightDecision.run_extension_migrations?await runCommandPreparation(actionCommand,[],()=>executeRegisteredRuntimeMigrations(runtimeExtensions.registrations.migrations,runtimeExtensions.pmRoot)):[];globalOptions.profile&&migrationWarnings.length>0&&printError(`profile:extensions migration_warnings=${formatHookWarnings(migrationWarnings)}`);const migrationBlockers=collectMandatoryMigrationBlockers(runtimeExtensions.registrations.migrations);activeExtensionHookContext={hooks:runtimeExtensions.hooks,commandName:commandPath,commandArgs,commandOptions:{...commandOptions},globalOptions:{...globalOptions},pmRoot:runtimeExtensions.pmRoot,profileEnabled:!!globalOptions.profile,migrationBlockers},setActiveCommandResult(void 0),setActiveCommandContext({command:commandPath,args:commandArgs,options:{...commandOptions},global:{...globalOptions},pm_root:runtimeExtensions.pmRoot}),activeTelemetryCommandContext=await startTelemetryCommand({command:commandPath,pm_version:CLI_VERSION,args:commandArgs,options:commandOptions,global:globalOptions,pm_root:runtimeExtensions.pmRoot}),await recordActiveDeprecatedAliasUsage(rootProgram),await startActiveSentryCommandTracing(commandPath,commandArgs,commandOptions);const hookWarnings=await runBeforeCommandHooks(runtimeExtensions.hooks,{command:commandPath,args:commandArgs,options:{...commandOptions},global:{...globalOptions},pm_root:runtimeExtensions.pmRoot});globalOptions.profile&&hookWarnings.length>0&&printError(`profile:extensions hook_warnings=${formatHookWarnings(hookWarnings)}`),preflightDecision.enforce_mandatory_migration_gate&&enforceMandatoryMigrationWriteGate(commandPath,commandOptions,migrationBlockers)}),rootProgram.hook("postAction",async()=>{const outcome=buildPostActionTelemetryOutcome();await finishActiveSentryCommandSpan(outcome.ok,outcome.error,{error_code:outcome.error_code,error_category:outcome.error_category,exit_code:outcome.exit_code,command_resolution:outcome.command_resolution,resolution_stage:outcome.resolution_stage}),await runAndClearAfterCommandHooks(outcome),await sentryFlush()}))}attachProgramLifecycleHooks(program);const IDEMPOTENT_TOP_LEVEL_REGISTRATION=Symbol("pmCliIdempotentTopLevelRegistration");function ensureIdempotentTopLevelCommandRegistration(rootProgram){const guarded=rootProgram;if(guarded[IDEMPOTENT_TOP_LEVEL_REGISTRATION])return;guarded[IDEMPOTENT_TOP_LEVEL_REGISTRATION]=!0;const registerOriginalCommand=rootProgram.command.bind(rootProgram);rootProgram.command=((nameAndArgs,...rest)=>{const commandName=nameAndArgs.split(/\s+/u)[0];return rootProgram.commands.some(existing=>existing.name()===commandName||existing.aliases().includes(commandName))?new Command(commandName):registerOriginalCommand(nameAndArgs,...rest)})}async function registerCoreCommandFamilies(rootProgram,selection){if(ensureIdempotentTopLevelCommandRegistration(rootProgram),selection.setup){const{registerSetupCommands}=await loadSetupRegistrationModule();registerSetupCommands(rootProgram)}if(selection.listQuery){const{registerListQueryCommands}=await loadListQueryRegistrationModule(),commandFilter=typeof selection.targetCommandName=="string"&&LIST_QUERY_COMMAND_NAMES.has(selection.targetCommandName)?new Set([selection.targetCommandName]):void 0;registerListQueryCommands(rootProgram,commandFilter?{commandFilter}:void 0)}if(selection.mutation){const{registerMutationCommands}=await loadMutationRegistrationModule();registerMutationCommands(rootProgram,{targetCommandName:selection.targetCommandName})}if(selection.operation){const{registerOperationCommands}=await loadOperationRegistrationModule();registerOperationCommands(rootProgram)}}function createTelemetryCommandErrorEmitter(params){return async event=>{const errorCategory=resolveTelemetryErrorCategory(event.errorCode),commandResolution=deriveTelemetryCommandResolution({ok:!1,errorCode:event.errorCode,errorCategory});return await emitTelemetryErrorEvent({command:event.command,args:params.invocationArgv,options:event.options,global:params.bootstrapGlobal,pm_version:CLI_VERSION,pm_root:params.bootstrapPmRoot,error_code:event.errorCode,error_message:event.errorMessage,exit_code:event.exitCode,error_category:errorCategory,command_resolution:commandResolution,resolution_stage:event.resolutionStage}),{errorCategory,commandResolution}}}async function prepareExtensionServicesForRunPmCliError(params){if(params.bootstrapGlobal.noExtensions||isStaticExtensionInventoryInvocation(params.invocationArgv))return;const bootstrapProbe=buildBootstrapActivationProbe(params.invocationArgv),discoverySnapshot=await loadRuntimeExtensionDiscoverySnapshot(params.bootstrapPmRoot);if(discoverySnapshot&&discoveryNeedsActivationForProbe(discoverySnapshot.discovery,bootstrapProbe)){const bootstrapSnapshot=await loadRuntimeExtensionSnapshot(params.bootstrapPmRoot,bootstrapProbe);setRecoveredExtensionServices(bootstrapSnapshot);return}discoverySnapshot&&emitExtensionSkippedProfile(bootstrapProfileEnabled(params.invocationArgv),discoverySnapshot,bootstrapProbe),setActiveExtensionServices({overrides:[]})}function setRecoveredExtensionServices(bootstrapSnapshot){if(!bootstrapSnapshot){setActiveExtensionServices({overrides:[]});return}setActiveExtensionServices(bootstrapSnapshot.services)}async function finishRunPmCliFailure(params){await finishActiveSentryCommandSpan(!1,params.errorMessage,{error_code:params.classificationCode,error_category:params.errorCategory,exit_code:params.exitCode,command_resolution:params.commandResolution,resolution_stage:params.resolutionStage}),await runAndClearAfterCommandHooks({ok:!1,error:params.errorMessage,exit_code:params.exitCode,error_code:params.classificationCode,error_category:params.errorCategory,command_resolution:params.commandResolution,resolution_stage:params.resolutionStage})}async function finishRunPmCliSuccessParse(){await finishActiveSentryCommandSpan(!0,void 0,{exit_code:EXIT_CODE.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),await runAndClearAfterCommandHooks({ok:!0,exit_code:EXIT_CODE.SUCCESS,command_resolution:"success",resolution_stage:"parse"}),process.exitCode=EXIT_CODE.SUCCESS}async function handleRunPmCliKnownError(context,numericExitCode){const hasExplicitExitCode=typeof numericExitCode=="number"&&Number.isFinite(numericExitCode);if(!(context.error instanceof PmCliError)&&(isCommanderError(context.error)||!hasExplicitExitCode))return!1;const errorMessage=describeUnknownError(context.error),exitCode=context.error instanceof PmCliError?context.error.exitCode:normalizeThrownExitCode(numericExitCode),rawContext=context.error instanceof PmCliError||isPmCliExpectedError(context.error)?context.error.context:void 0,enrichedContext=buildPmCliRecoveryContext(rawContext,context.invocationArgv,errorMessage),classification=classifyPmCliError(errorMessage,enrichedContext),jsonErrorPayload=attachPreflightWarnings(context.bootstrapGlobal.lean?projectLeanErrorEnvelope(formatPmCliErrorForJson(errorMessage,exitCode,enrichedContext)):formatPmCliErrorForJson(errorMessage,exitCode,enrichedContext)),renderedError=context.jsonErrors?JSON.stringify(context.bootstrapGlobal.tokenAccounting?attachOutputTokenAccounting(jsonErrorPayload,value=>`${JSON.stringify(value,null,2)}
|
|
2
2
|
`):jsonErrorPayload,null,2):formatPmCliErrorForDisplay(errorMessage,enrichedContext,{lean:context.bootstrapGlobal.lean===!0});context.jsonErrors?writeStderr(`${renderedError}
|
|
3
3
|
`):printError(renderedError);const{errorCategory,commandResolution}=await context.emitTelemetryCommandError({command:context.attemptedCommand,errorCode:classification.code,errorMessage:classification.detail,exitCode,options:{bootstrap_global_options:context.bootstrapGlobal},resolutionStage:"execute"}),loggedHandledErrorToSentry=await maybeLogHandledCliErrorToSentry({command:context.attemptedCommand,error_code:classification.code,error_category:errorCategory,exit_code:exitCode,error_message:classification.detail,command_resolution:commandResolution,resolution_stage:"execute",source_context:activeTelemetryCommandContext?.source_context},context.bootstrapGlobal);return await finishRunPmCliFailure({errorMessage,exitCode,classificationCode:classification.code,errorCategory,commandResolution,resolutionStage:"execute"}),loggedHandledErrorToSentry&&(sentryCaptureCliError(wrapThrownErrorForSentry(context.error,errorMessage)),await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS)),process.exitCode=exitCode,!0}async function handleUnknownHelpCommandError(context,code){const unknownPath=parseBootstrapHelpRequest(context.invocationArgv).commandPathTokens.join(" ")||resolveUnknownCommanderToken(context.invocationArgv),unknownToken=resolvePmCommandOperation(unknownPath),unknownMessage=`unknown command '${unknownPath}'`,pmRoot=resolvePmRoot(process.cwd(),context.bootstrapGlobal.path),recoveryCommandDescriptors=context.bootstrapGlobal.noExtensions?activeRuntimeExtensionCommandDescriptors:await loadRuntimeExtensionCommandDescriptorsForRecovery(pmRoot),recoveryProbe=buildBootstrapActivationProbe(context.invocationArgv),failedExtensions=context.bootstrapGlobal.noExtensions?[]:await loadExtensionRecoveryFailures(pmRoot,{},collectActivationCommandCandidates(recoveryProbe)),usageContext=await resolveCommanderUsageContext({message:unknownMessage},program,recoveryCommandDescriptors,{failedExtensions},context.invocationArgv),classification=classifyCommanderError(usageContext.message,usageContext.commandName,usageContext.allowedTypes,{unknownCommandExamples:usageContext.unknownCommandExamples,unknownCommandNextSteps:usageContext.unknownCommandNextSteps,attemptedCommand:usageContext.attemptedCommand,normalizedInvocationArgs:usageContext.normalizedInvocationArgs,providedOptionFlags:usageContext.providedOptionFlags,unknownOptionSuggestions:usageContext.unknownOptionSuggestions,suggestedRetryCommand:usageContext.suggestedRetryCommand,failedExtensions}),{errorCategory,commandResolution}=await context.emitTelemetryCommandError({command:unknownToken,errorCode:classification.code,errorMessage:classification.detail,exitCode:EXIT_CODE.USAGE,options:{bootstrap_global_options:context.bootstrapGlobal,commander_code:code??"commander.helpDisplayed"},resolutionStage:"parse"}),loggedHandledErrorToSentry=await maybeLogHandledCliErrorToSentry({command:unknownToken,error_code:classification.code,error_category:errorCategory,exit_code:EXIT_CODE.USAGE,error_message:classification.detail,command_resolution:commandResolution,resolution_stage:"parse"},context.bootstrapGlobal),baseRenderedUsage=context.jsonErrors?await formatCommanderUsageJson({message:unknownMessage},program,recoveryCommandDescriptors,context.bootstrapGlobal.lean===!0,{failedExtensions},context.invocationArgv):await formatCommanderUsageMessage({message:unknownMessage},program,recoveryCommandDescriptors,{failedExtensions},context.invocationArgv),renderedUsage=appendCommanderExtensionFailures(baseRenderedUsage,context.jsonErrors,failedExtensions);await finishRunPmCliFailure({errorMessage:unknownMessage,exitCode:EXIT_CODE.USAGE,classificationCode:classification.code,errorCategory,commandResolution,resolutionStage:"parse"}),context.jsonErrors?writeStderr(`${attachSerializedPreflightWarnings(renderedUsage)}
|
|
4
4
|
`):printError(renderedUsage),loggedHandledErrorToSentry&&await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS),process.exitCode=EXIT_CODE.USAGE}async function handleRunPmCliHelpDisplayError(context,code,rawMessage){if(!(code==="commander.helpDisplayed"||code==="commander.help"||code==="commander.helpCommand")&&!rawMessage.includes("(outputHelp)"))return!1;const helpRequest=parseBootstrapHelpRequest(context.invocationArgv);return helpRequest.requested&&!isKnownHelpCommandPath(program,helpRequest.commandPathTokens)?(await handleUnknownHelpCommandError(context,code),!0):(await finishRunPmCliSuccessParse(),!0)}async function handleRunPmCliCommanderUsageError(context,code){const usageContext=await resolveCommanderUsageContext(context.error,program,activeRuntimeExtensionCommandDescriptors,{},context.invocationArgv),classification=classifyCommanderError(usageContext.message,usageContext.commandName,usageContext.allowedTypes,{unknownCommandExamples:usageContext.unknownCommandExamples,unknownCommandNextSteps:usageContext.unknownCommandNextSteps,attemptedCommand:usageContext.attemptedCommand,normalizedInvocationArgs:usageContext.normalizedInvocationArgs,providedOptionFlags:usageContext.providedOptionFlags,unknownOptionSuggestions:usageContext.unknownOptionSuggestions,suggestedRetryCommand:usageContext.suggestedRetryCommand}),{errorCategory,commandResolution}=await context.emitTelemetryCommandError({command:context.attemptedCommand,errorCode:classification.code,errorMessage:classification.detail,exitCode:EXIT_CODE.USAGE,options:{bootstrap_global_options:context.bootstrapGlobal,commander_code:code},resolutionStage:"parse"}),loggedHandledErrorToSentry=await maybeLogHandledCliErrorToSentry({command:context.attemptedCommand,error_code:classification.code,error_category:errorCategory,exit_code:EXIT_CODE.USAGE,error_message:classification.detail,command_resolution:commandResolution,resolution_stage:"parse",source_context:activeTelemetryCommandContext?.source_context},context.bootstrapGlobal),baseRenderedUsage=context.jsonErrors?await formatCommanderUsageJson(context.error,program,activeRuntimeExtensionCommandDescriptors,context.bootstrapGlobal.lean===!0,{},context.invocationArgv):await formatCommanderUsageMessage(context.error,program,activeRuntimeExtensionCommandDescriptors,{},context.invocationArgv),recoveryFailures=await loadUnknownCommandRecoveryFailures(classification.code,context.bootstrapPmRoot,{},collectActivationCommandCandidates(buildBootstrapActivationProbe(context.invocationArgv))),renderedUsage=appendCommanderExtensionFailures(baseRenderedUsage,context.jsonErrors,recoveryFailures);await finishRunPmCliFailure({errorMessage:usageContext.message,exitCode:EXIT_CODE.USAGE,classificationCode:classification.code,errorCategory,commandResolution,resolutionStage:"parse"}),context.jsonErrors?writeStderr(`${attachSerializedPreflightWarnings(renderedUsage)}
|
|
5
|
-
`):printError(renderedUsage),loggedHandledErrorToSentry&&await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS),process.exitCode=EXIT_CODE.USAGE}function shouldHandleRunPmCliCommanderError(error){if(typeof error!="object"||error===null||!("code"in error))return!1;const code=error.code;return typeof code=="string"&&(code==="commander.version"||code.startsWith("commander."))?!0:String(error.message??"").includes("(outputHelp)")}async function handleRunPmCliCommanderError(context){const code=context.error.code,rawMessage=String(context.error.message??"");if(!await handleRunPmCliHelpDisplayError(context,code,rawMessage)){if(code==="commander.version"){await finishRunPmCliSuccessParse();return}await handleRunPmCliCommanderUsageError(context,code)}}async function handleRunPmCliError(params){const bootstrapGlobal=parseBootstrapGlobalOptions(params.invocationArgv),bootstrapPmRoot=resolvePmRoot(process.cwd(),bootstrapGlobal.path),context={error:params.error,invocationArgv:params.invocationArgv,bootstrapGlobal,jsonErrors:bootstrapGlobal.json,bootstrapPmRoot,attemptedCommand:parseBootstrapCommandName(params.invocationArgv)??"<unknown>",emitTelemetryCommandError:createTelemetryCommandErrorEmitter({invocationArgv:params.invocationArgv,bootstrapGlobal,bootstrapPmRoot})};if(await prepareExtensionServicesForRunPmCliError({invocationArgv:params.invocationArgv,bootstrapGlobal,bootstrapPmRoot}),!await handleRunPmCliKnownError(context,readThrownExitCode(params.error))){if(shouldHandleRunPmCliCommanderError(params.error)){await handleRunPmCliCommanderError(context);return}await handleGenericRunPmCliError({error:params.error,attemptedCommand:context.attemptedCommand,bootstrapGlobal,emitTelemetryCommandError:context.emitTelemetryCommandError})}}function assertRequestedNamespaceAvailable(program2,invocationArgv,helpRequest){const tokens=helpRequest.requested?helpRequest.commandPathTokens:stripGlobalBootstrapTokens(invocationArgv),requestedNamespace=findPmNamespacedCommand(tokens);if(requestedNamespace&&!findCommandByPath(program2,[...requestedNamespace.canonical_argv]))throw new CommanderError(EXIT_CODE.USAGE,"commander.unknownCommand",`unknown command '${requestedNamespace.alias}'`)}function captureInvokedDeprecatedAlias(rootProgram,rawArgv){let commandIndex=findBootstrapCommandTokenIndex(rawArgv);if(commandIndex===void 0)return;if(["pm","pm-cli"].includes(rawArgv[commandIndex]?.trim().toLowerCase())){const offset=findBootstrapCommandTokenIndex(rawArgv.slice(commandIndex+1));if(offset===void 0)return;commandIndex+=offset+1}const candidates=COMMAND_ALIASES_BY_FIRST_TOKEN.get(rawArgv[commandIndex]),tokens=rawArgv.slice(commandIndex).filter(token=>!["--global","--project","--local"].includes(token)),resolved=candidates?.find(contract=>contract.alias.split(" ").every((token,index)=>tokens[index]===token));resolved?.lifecycle==="deprecated"&&Reflect.set(rootProgram,DEPRECATED_ALIAS_INVOCATION,resolved.alias)}function buildInvocationProcessArgv(invocationArgv){return[process.argv[0],process.argv[1]??"pm",...invocationArgv]}async function runPmCliInReproducibleContext(rawArgv,settingsPolicy){program=createPmCliProgram(CLI_VERSION),program.hook("preAction",(_thisCommand,actionCommand)=>{settingsPolicy.configurationOnly=["item mutate","item complete"].includes(getCommandPath(actionCommand))&&actionCommand.optsWithGlobals().dryRun===!0}),attachProgramLifecycleHooks(program,rawArgv),runtimeExtensionSnapshotCache=null,runtimeExtensionDiscoverySnapshotCache=null,activeRuntimeExtensionCommandDescriptors=new Map,resetActiveExtensionRuntimeState();let invocationArgv=[...rawArgv],restorePmAuthor,restorePagerPolicy;try{const bootstrapInvocation=normalizeBootstrapInvocation(rawArgv);invocationArgv=bootstrapInvocation.argv,captureInvokedDeprecatedAlias(program,rawArgv);const invocationProcessArgv=buildInvocationProcessArgv(invocationArgv),isBareInvocation=invocationArgv.length===0,bootstrapGlobal=parseBootstrapGlobalOptions(invocationArgv);if(bootstrapGlobal.authorMissingValue)throw new PmCliError("--author requires a non-empty value.",EXIT_CODE.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});restorePmAuthor=applyInvocationAuthorOverride(bootstrapGlobal.author),enforceExplicitRetryForFlagTypos(bootstrapInvocation),restorePagerPolicy=applyBootstrapPagerPolicy(invocationArgv);const registrationSelection=resolveCoreCommandRegistrationSelection(invocationArgv);await registerCoreCommandFamilies(program,registrationSelection),installCommandNamespaces(program,!0),shouldRegisterDynamicExtensionPaths(program,invocationArgv)?await registerDynamicExtensionCommandPaths(program,invocationArgv):(activeRuntimeExtensionCommandDescriptors=new Map,setActiveExtensionServices({overrides:[]})),shouldRegisterRuntimeSchemaFlags(invocationArgv)&&await registerRuntimeSchemaFieldFlags(program,invocationArgv),installCommandNamespaces(program);const helpRequest=parseBootstrapHelpRequest(invocationArgv);assertRequestedNamespaceAvailable(program,invocationArgv,helpRequest),shouldAttachRichHelpTextForInvocation(invocationArgv)&&attachRichHelpText(program,invocationArgv),wrapProgramActionsForExtensionHandlers(program);const recoveryHelpDescriptors=await resolveHelpRecoveryDescriptors(helpRequest,bootstrapGlobal);if(await maybeRenderBootstrapJsonHelp(program,invocationArgv,recoveryHelpDescriptors,rawArgv))return;if(helpRequest.requested&&!isKnownHelpCommandPath(program,helpRequest.commandPathTokens))throw new CommanderError(EXIT_CODE.USAGE,"commander.helpDisplayed","(outputHelp)");if(isBareInvocation||isFullHelpDiscovery(invocationArgv)&&parseBootstrapCommandName(invocationArgv)===void 0){program.outputHelp();return}if(isStaticExtensionInventoryInvocation(invocationArgv)){await program.parseAsync(invocationProcessArgv);return}const invocationPmRoot=resolvePmRoot(process.cwd(),bootstrapGlobal.path),invocationSettings=await readSettings(invocationPmRoot),intentSnapshot=await loadContextIntentSnapshotForInvocation(invocationArgv,invocationPmRoot,bootstrapGlobal.noExtensions,loadRuntimeExtensionSnapshot);await runWithDiscoveredContextIntentContracts({pmRoot:invocationPmRoot,packages:intentSnapshot?.contextIntentPackages},()=>runWithHarnessDetectionSignals({env:{...process.env,PM_PATH:invocationPmRoot},argv:invocationProcessArgv,cwd:process.cwd()},()=>runWithWorkspaceHarnessSignalDescriptors(invocationSettings.agent_identity.harness_signals,()=>program.parseAsync(invocationProcessArgv),{probesEnabled:invocationSettings.agent_identity?.probes_enabled})))}catch(error){await handleRunPmCliError({error,invocationArgv})}finally{restorePagerPolicy?.(),restorePmAuthor?.()}}async function runPmCli(rawArgv=process.argv.slice(2)){let invocationArgv=rawArgv;try{invocationArgv=normalizeBootstrapInvocation(rawArgv).argv}catch{}const preview=resolveStructuredMutationPreviewInvocation(invocationArgv),settingsPolicy={configurationOnly:preview!==void 0},isConfigurationOnly=()=>settingsPolicy.configurationOnly,runInvocation=()=>runWithPreflightWarnings(parseBootstrapGlobalOptions(invocationArgv).json,async()=>{try{await runWithReproducibleProcessEnvironment(process.env,()=>runPmCliInReproducibleContext(rawArgv,settingsPolicy))}catch(error){await handleRunPmCliError({error,invocationArgv:[...rawArgv]})}});if(preview!==void 0){const bootstrapRoot=resolvePmRoot(process.cwd(),parseBootstrapGlobalOptions(invocationArgv).path),actionRoot=resolvePmRoot(process.cwd(),preview.path),globalRoot=resolveGlobalPmRoot(process.cwd());await runWithConfigurationOnlySettings(bootstrapRoot,()=>runWithConfigurationOnlySettings(actionRoot,()=>runWithConfigurationOnlySettings(globalRoot,runInvocation,isConfigurationOnly),isConfigurationOnly),isConfigurationOnly)}else await runInvocation()}const _testOnly={activationCommandMatchesProbe,applyDynamicExtensionRootHelpVisibility,bootstrapProfileEnabled,buildBootstrapActivationProbe,buildPostActionTelemetryOutcome,buildPmCliRecoveryContext,buildRuntimeExtensionDiscoverySnapshotCacheKey,buildRuntimeExtensionActivationScope,buildRuntimeExtensionSnapshotCacheKey,buildRuntimeExtensionFilterForProbe,addRuntimeFieldOption,collectActivationCommandCandidates,collectExtensionFlagDefinitionsForCommand,collectExtensionFlagDefinitionsForInvocation,collectLeadingCommandArgs,collectParsedActivationCommandArgs,collectRuntimeFieldLooseFlagDefinitionsForCommand,commandHasLongOption,commandHasShortOption,commandPathNeedsSearchExtensions,commandPathNeedsTemplateExtensions,describeUnknownError,defaultPreflightDecision,discoveryNeedsActivationForProbe,emitExtensionProfile,emitExtensionSkippedProfile,emitSettingsReadWarnings,ensureIdempotentTopLevelCommandRegistration,enforceExplicitRetryForFlagTypos,envFlagEnabled,executeRegisteredRuntimeMigrations,extractCommandScopedOptions,extensionActivationCommands,extensionCapabilities,extensionNeedsActivationForProbe,extensionProvidesTemplatesRuntime,hasAnyCapability,hasGlobalExtensionContributions,handleGenericRunPmCliError,handleRunPmCliCommanderError,handleRunPmCliError,handleRunPmCliHelpDisplayError,handleRunPmCliKnownError,handleRunPmCliCommanderUsageError,handleUnknownHelpCommandError,inferMissingFieldsFromErrorMessage,inferPostActionErrorCode,inferPostActionFailureMessage,invocationRequestsVersion,isCommanderError,loadRuntimeExtensionCommandDescriptorsForRecovery,loadRuntimeExtensionDiscoverySnapshot,loadRuntimeExtensionSnapshot,maybeLoadRuntimeExtensions,maybeAttachCreateUpdatePolicyHelpText,maybeLogHandledCliErrorToSentry,matchesStaticExtensionCommand,normalizeTelemetryCommandResolution,normalizeTelemetryErrorCategory,normalizeTelemetryResolutionStage,normalizeThrownExitCode,probeUsesAnyFlag,prepareExtensionServicesForRunPmCliError,readRecordBoolean,readRecordNumber,readRecordString,recordCliReadOutputInvocationProvenance,registerDynamicExtensionCommandPaths,registerRuntimeSchemaFieldFlags,resolveCoreCommandRegistrationSelection,resolveStaticExtensionActivationDecision,resolveUnknownHelpToken:resolveUnknownCommanderToken,readThrownExitCode,runAndClearAfterCommandHooks,runRequiredExtensionCommand,shouldAttachRichHelpTextForInvocation,shouldLogHandledErrorToSentry,shouldRegisterDynamicExtensionPaths,shouldRegisterRuntimeSchemaFlags,shouldHandleRunPmCliCommanderError,setActiveExtensionHookContextForTest,setActiveRuntimeExtensionCommandDescriptorsForTest,setRecoveredExtensionServices,toLooseFieldDefinitionType,isImporterOrExporterCommandPath,validateDynamicExtensionCommandInvocation,wrapProgramActionsForExtensionHandlers,wrapThrownErrorForSentry};export{_testOnly,runPmCli};
|
|
5
|
+
`):printError(renderedUsage),loggedHandledErrorToSentry&&await sentryFlush(HANDLED_ERROR_SENTRY_FLUSH_TIMEOUT_MS),process.exitCode=EXIT_CODE.USAGE}function shouldHandleRunPmCliCommanderError(error){if(typeof error!="object"||error===null||!("code"in error))return!1;const code=error.code;return typeof code=="string"&&(code==="commander.version"||code.startsWith("commander."))?!0:String(error.message??"").includes("(outputHelp)")}async function handleRunPmCliCommanderError(context){const code=context.error.code,rawMessage=String(context.error.message??"");if(!await handleRunPmCliHelpDisplayError(context,code,rawMessage)){if(code==="commander.version"){await finishRunPmCliSuccessParse();return}await handleRunPmCliCommanderUsageError(context,code)}}async function handleRunPmCliError(params){const bootstrapGlobal=parseBootstrapGlobalOptions(params.invocationArgv),bootstrapPmRoot=resolvePmRoot(process.cwd(),bootstrapGlobal.path),context={error:params.error,invocationArgv:params.invocationArgv,bootstrapGlobal,jsonErrors:bootstrapGlobal.json,bootstrapPmRoot,attemptedCommand:parseBootstrapCommandName(params.invocationArgv)??"<unknown>",emitTelemetryCommandError:createTelemetryCommandErrorEmitter({invocationArgv:params.invocationArgv,bootstrapGlobal,bootstrapPmRoot})};if(await prepareExtensionServicesForRunPmCliError({invocationArgv:params.invocationArgv,bootstrapGlobal,bootstrapPmRoot}),!await handleRunPmCliKnownError(context,readThrownExitCode(params.error))){if(shouldHandleRunPmCliCommanderError(params.error)){await handleRunPmCliCommanderError(context);return}await handleGenericRunPmCliError({error:params.error,attemptedCommand:context.attemptedCommand,bootstrapGlobal,emitTelemetryCommandError:context.emitTelemetryCommandError})}}function assertRequestedNamespaceAvailable(program2,invocationArgv,helpRequest){const tokens=helpRequest.requested?helpRequest.commandPathTokens:stripGlobalBootstrapTokens(invocationArgv),requestedNamespace=findPmNamespacedCommand(tokens);if(requestedNamespace&&!findCommandByPath(program2,[...requestedNamespace.canonical_argv]))throw new CommanderError(EXIT_CODE.USAGE,"commander.unknownCommand",`unknown command '${requestedNamespace.alias}'`)}function captureInvokedDeprecatedAlias(rootProgram,rawArgv){let commandIndex=findBootstrapCommandTokenIndex(rawArgv);if(commandIndex===void 0)return;if(["pm","pm-cli"].includes(rawArgv[commandIndex]?.trim().toLowerCase())){const offset=findBootstrapCommandTokenIndex(rawArgv.slice(commandIndex+1));if(offset===void 0)return;commandIndex+=offset+1}const candidates=COMMAND_ALIASES_BY_FIRST_TOKEN.get(rawArgv[commandIndex]),tokens=rawArgv.slice(commandIndex).filter(token=>!["--global","--project","--local"].includes(token)),resolved=candidates?.find(contract=>contract.alias.split(" ").every((token,index)=>tokens[index]===token));resolved?.lifecycle==="deprecated"&&Reflect.set(rootProgram,DEPRECATED_ALIAS_INVOCATION,resolved.alias)}function buildInvocationProcessArgv(invocationArgv){return[process.argv[0],process.argv[1]??"pm",...invocationArgv]}async function runPmCliInReproducibleContext(rawArgv,settingsPolicy){program=createPmCliProgram(CLI_VERSION),program.hook("preAction",(_thisCommand,actionCommand)=>{settingsPolicy.configurationOnly=["item mutate","item complete"].includes(getCommandPath(actionCommand))&&actionCommand.optsWithGlobals().dryRun===!0}),attachProgramLifecycleHooks(program,rawArgv),runtimeExtensionSnapshotCache=null,runtimeExtensionDiscoverySnapshotCache=null,activeRuntimeExtensionCommandDescriptors=new Map,resetActiveExtensionRuntimeState();let invocationArgv=[...rawArgv],restorePmAuthor,restorePagerPolicy;try{const bootstrapInvocation=normalizeBootstrapInvocation(rawArgv);invocationArgv=bootstrapInvocation.argv,captureInvokedDeprecatedAlias(program,rawArgv);const invocationProcessArgv=buildInvocationProcessArgv(invocationArgv),isBareInvocation=invocationArgv.length===0,bootstrapGlobal=parseBootstrapGlobalOptions(invocationArgv);if(bootstrapGlobal.authorMissingValue)throw new PmCliError("--author requires a non-empty value.",EXIT_CODE.USAGE,{code:"missing_required_argument",nextSteps:["Pass an explicit author identifier with --author <id>."]});restorePmAuthor=applyInvocationAuthorOverride(bootstrapGlobal.author),enforceExplicitRetryForFlagTypos(bootstrapInvocation),restorePagerPolicy=applyBootstrapPagerPolicy(invocationArgv);const registrationSelection=resolveCoreCommandRegistrationSelection(invocationArgv);await registerCoreCommandFamilies(program,registrationSelection),installCommandNamespaces(program,!0),shouldRegisterDynamicExtensionPaths(program,invocationArgv)?await registerDynamicExtensionCommandPaths(program,invocationArgv):(activeRuntimeExtensionCommandDescriptors=new Map,setActiveExtensionServices({overrides:[]})),shouldRegisterRuntimeSchemaFlags(invocationArgv)&&await registerRuntimeSchemaFieldFlags(program,invocationArgv),installCommandNamespaces(program);const helpRequest=parseBootstrapHelpRequest(invocationArgv);assertRequestedNamespaceAvailable(program,invocationArgv,helpRequest),shouldAttachRichHelpTextForInvocation(invocationArgv)&&attachRichHelpText(program,invocationArgv),wrapProgramActionsForExtensionHandlers(program);const recoveryHelpDescriptors=await resolveHelpRecoveryDescriptors(helpRequest,bootstrapGlobal);if(await maybeRenderBootstrapJsonHelp(program,invocationArgv,recoveryHelpDescriptors,rawArgv))return;if(helpRequest.requested&&!isKnownHelpCommandPath(program,helpRequest.commandPathTokens))throw new CommanderError(EXIT_CODE.USAGE,"commander.helpDisplayed","(outputHelp)");if(isBareInvocation||isFullHelpDiscovery(invocationArgv)&&parseBootstrapCommandName(invocationArgv)===void 0){program.outputHelp();return}if(isStaticExtensionInventoryInvocation(invocationArgv)){await program.parseAsync(invocationProcessArgv);return}const invocationPmRoot=resolvePmRoot(process.cwd(),bootstrapGlobal.path),invocationSettings=await readSettings(invocationPmRoot),intentSnapshot=await loadContextIntentSnapshotForInvocation(invocationArgv,invocationPmRoot,bootstrapGlobal.noExtensions,loadRuntimeExtensionSnapshot);await parseWithInvocationRevisionScope(parse=>runWithDiscoveredContextIntentContracts({pmRoot:invocationPmRoot,packages:intentSnapshot?.contextIntentPackages},()=>runWithHarnessDetectionSignals({env:{...process.env,PM_PATH:invocationPmRoot},argv:invocationProcessArgv,cwd:process.cwd()},()=>runWithWorkspaceHarnessSignalDescriptors(invocationSettings.agent_identity.harness_signals,()=>parse(()=>program.parseAsync(invocationProcessArgv)),{probesEnabled:invocationSettings.agent_identity?.probes_enabled}))))}catch(error){await handleRunPmCliError({error,invocationArgv})}finally{restorePagerPolicy?.(),restorePmAuthor?.()}}async function runPmCli(rawArgv=process.argv.slice(2)){let invocationArgv=rawArgv;try{invocationArgv=normalizeBootstrapInvocation(rawArgv).argv}catch{}const preview=resolveStructuredMutationPreviewInvocation(invocationArgv),settingsPolicy={configurationOnly:preview!==void 0},isConfigurationOnly=()=>settingsPolicy.configurationOnly,runInvocation=()=>runWithPreflightWarnings(parseBootstrapGlobalOptions(invocationArgv).json,async()=>{try{await runWithReproducibleProcessEnvironment(process.env,()=>runPmCliInReproducibleContext(rawArgv,settingsPolicy))}catch(error){await handleRunPmCliError({error,invocationArgv:[...rawArgv]})}});if(preview!==void 0){const bootstrapRoot=resolvePmRoot(process.cwd(),parseBootstrapGlobalOptions(invocationArgv).path),actionRoot=resolvePmRoot(process.cwd(),preview.path),globalRoot=resolveGlobalPmRoot(process.cwd());await runWithConfigurationOnlySettings(bootstrapRoot,()=>runWithConfigurationOnlySettings(actionRoot,()=>runWithConfigurationOnlySettings(globalRoot,runInvocation,isConfigurationOnly),isConfigurationOnly),isConfigurationOnly)}else await runInvocation()}const _testOnly={activationCommandMatchesProbe,applyDynamicExtensionRootHelpVisibility,bootstrapProfileEnabled,buildBootstrapActivationProbe,buildPostActionTelemetryOutcome,buildPmCliRecoveryContext,buildRuntimeExtensionDiscoverySnapshotCacheKey,buildRuntimeExtensionActivationScope,buildRuntimeExtensionSnapshotCacheKey,buildRuntimeExtensionFilterForProbe,addRuntimeFieldOption,collectActivationCommandCandidates,collectExtensionFlagDefinitionsForCommand,collectExtensionFlagDefinitionsForInvocation,collectLeadingCommandArgs,collectParsedActivationCommandArgs,collectRuntimeFieldLooseFlagDefinitionsForCommand,commandHasLongOption,commandHasShortOption,commandPathNeedsSearchExtensions,commandPathNeedsTemplateExtensions,describeUnknownError,defaultPreflightDecision,discoveryNeedsActivationForProbe,emitExtensionProfile,emitExtensionSkippedProfile,emitSettingsReadWarnings,ensureIdempotentTopLevelCommandRegistration,enforceExplicitRetryForFlagTypos,envFlagEnabled,executeRegisteredRuntimeMigrations,extractCommandScopedOptions,extensionActivationCommands,extensionCapabilities,extensionNeedsActivationForProbe,extensionProvidesTemplatesRuntime,hasAnyCapability,hasGlobalExtensionContributions,handleGenericRunPmCliError,handleRunPmCliCommanderError,handleRunPmCliError,handleRunPmCliHelpDisplayError,handleRunPmCliKnownError,handleRunPmCliCommanderUsageError,handleUnknownHelpCommandError,inferMissingFieldsFromErrorMessage,inferPostActionErrorCode,inferPostActionFailureMessage,invocationRequestsVersion,isCommanderError,loadRuntimeExtensionCommandDescriptorsForRecovery,loadRuntimeExtensionDiscoverySnapshot,loadRuntimeExtensionSnapshot,maybeLoadRuntimeExtensions,maybeAttachCreateUpdatePolicyHelpText,maybeLogHandledCliErrorToSentry,matchesStaticExtensionCommand,normalizeTelemetryCommandResolution,normalizeTelemetryErrorCategory,normalizeTelemetryResolutionStage,normalizeThrownExitCode,probeUsesAnyFlag,prepareExtensionServicesForRunPmCliError,readRecordBoolean,readRecordNumber,readRecordString,recordCliReadOutputInvocationProvenance,registerDynamicExtensionCommandPaths,registerRuntimeSchemaFieldFlags,resolveCoreCommandRegistrationSelection,resolveStaticExtensionActivationDecision,resolveUnknownHelpToken:resolveUnknownCommanderToken,readThrownExitCode,runAndClearAfterCommandHooks,runRequiredExtensionCommand,shouldAttachRichHelpTextForInvocation,shouldLogHandledErrorToSentry,shouldRegisterDynamicExtensionPaths,shouldRegisterRuntimeSchemaFlags,shouldHandleRunPmCliCommanderError,setActiveExtensionHookContextForTest,setActiveRuntimeExtensionCommandDescriptorsForTest,setRecoveredExtensionServices,toLooseFieldDefinitionType,isImporterOrExporterCommandPath,validateDynamicExtensionCommandInvocation,wrapProgramActionsForExtensionHandlers,wrapThrownErrorForSentry};export{_testOnly,runPmCli};
|
|
6
6
|
//# sourceMappingURL=main.js.map
|
|
@@ -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]="
|
|
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]="b22eeb4f-45e8-597f-b28e-5f175722b968")}catch{}})();import{resolveSubcommandFlagContractsForCommand}from"../../sdk/cli-contracts.js";import{resolvePmCommandOperation}from"../../sdk/cli-contracts/command-aliases.js";import{PM_READ_OUTPUT_SURFACE_CONTRACTS,applyReadOutputIncludeModes,readOutputIncludeModeOptions,resolveReadOutputSurface}from"../../sdk/read-output-contracts.js";import{EXIT_CODE,PmCliError}from"../../sdk/runtime-primitives.js";import{extractProvidedOptionFlags}from"../argv-utils.js";import{normalizeExtensionCommandPath}from"../extension-command-help.js";import{coerceLooseCommandOptionsWithFlagDefinitions,collectLooseCommandOptionKeysForDefinitions,parseLooseCommandOptions,validateLooseCommandOptionsWithFlagDefinitions}from"../extension-command-options.js";import{getCommandPath,setResolvedGlobalOptions}from"../registration-helpers.js";const READ_OUTPUT_INVOCATION_PROVENANCE=Symbol.for("pm.readOutputInvocationProvenance");function copyReadOutputInvocationProvenance(source,target){const provenance=Reflect.get(source,READ_OUTPUT_INVOCATION_PROVENANCE);provenance!==void 0&&Reflect.set(target,READ_OUTPUT_INVOCATION_PROVENANCE,provenance)}function recordCliReadOutputInvocationProvenance(actionCommand,commandPath,commandOptions){const surface=resolveReadOutputSurface(commandPath,commandOptions);if(!surface)return;let rootCommand=actionCommand;for(;rootCommand.parent;)rootCommand=rootCommand.parent;const rawArgs=rootCommand.rawArgs,providedFlags=new Set(extractProvidedOptionFlags(rawArgs.slice(2))),contract=PM_READ_OUTPUT_SURFACE_CONTRACTS.find(candidate=>candidate.command===surface),explicitLegacyAliases=Object.values(contract?.dimensions??{}).flatMap(dimension=>dimension.legacy_aliases.flatMap(alias=>providedFlags.has(alias.flag)?[alias.flag]:[])),previous=Reflect.get(commandOptions,READ_OUTPUT_INVOCATION_PROVENANCE);Reflect.set(commandOptions,READ_OUTPUT_INVOCATION_PROVENANCE,{canonical_include_modes:previous?.canonical_include_modes??[],explicit_legacy_aliases:explicitLegacyAliases,cli_invocation_observed:!0}),copyReadOutputInvocationProvenance(commandOptions,actionCommand)}function collectCommandInvocationOptions(command){const allOptions=command.optsWithGlobals(),commandPath=getCommandPath(command);if(resolvePmCommandOperation(commandPath)===commandPath)return allOptions;const ownOptions=command.opts();for(let parent=command.parent;parent?.parent;parent=parent.parent)for(const option of parent.options){const key=option.attributeName(),suppliedOnParent=parent.getOptionValueSource(key)==="cli";if(suppliedOnParent&&!command.options.some(candidate=>candidate.long===option.long))throw new PmCliError(`Unknown option '${option.long}' for ${commandPath}`,EXIT_CODE.USAGE,{code:"unknown_option",flag:option.long,required:`Use options declared by pm ${commandPath} --help.`});if(suppliedOnParent&&command.getOptionValueSource(key)!=="cli"){const value=parent.getOptionValue(key);command.setOptionValueWithSource(key,value,"cli")}key in ownOptions?allOptions[key]=ownOptions[key]:delete allOptions[key]}return allOptions}function forwardReadOutputIncludeModes(actionCommand,commandPath,globalOptions,commandOptions){recordCliReadOutputInvocationProvenance(actionCommand,commandPath,commandOptions);const requested=globalOptions.outputInclude;if(requested===void 0)return;const{selectors,modes}=applyReadOutputIncludeModes(commandPath,requested,commandOptions);if(commandPath==="get"&&typeof commandOptions.fields=="string"&&actionCommand.setOptionValueWithSource("fields",commandOptions.fields,"cli"),modes.length===0)return;copyReadOutputInvocationProvenance(commandOptions,actionCommand);const modeOptions=readOutputIncludeModeOptions(commandPath);for(const mode of modes){const key=modeOptions.get(mode),value=commandOptions[key];actionCommand.setOptionValueWithSource(key,value,"cli")}const residual=selectors.length>0?selectors.join(","):void 0;residual===void 0?delete globalOptions.outputInclude:globalOptions.outputInclude=residual;for(let scope=actionCommand;scope;scope=scope.parent)scope.setOptionValueWithSource("outputInclude",residual,"cli");setResolvedGlobalOptions(actionCommand,globalOptions)}function extractCommandScopedOptions(command,commandArgs,extensionFlagDefinitions=[]){const scoped={...collectCommandInvocationOptions(command)};copyReadOutputInvocationProvenance(command,scoped),delete scoped.json,delete scoped.quiet,delete scoped.path,delete scoped.pmPath,delete scoped.noExtensions,delete scoped.extensions,delete scoped.profile,delete scoped.pager,delete scoped.changedFields,delete scoped.fullChangedFields,delete scoped.idOnly,delete scoped.lean,delete scoped.tokenAccounting,delete scoped.outputInclude,delete scoped.outputLimit,delete scoped.outputBudget,delete scoped.outputFormat,delete scoped.outputSession,delete scoped.expectHash;const looseOptions=parseLooseCommandOptions(commandArgs);for(const[key,value]of Object.entries(looseOptions))scoped[key]===void 0&&(scoped[key]=value);if(extensionFlagDefinitions.length>0){const extensionOptionKeys=collectLooseCommandOptionKeysForDefinitions(extensionFlagDefinitions),coreFlagDefinitions=resolveSubcommandFlagContractsForCommand(getCommandPath(command)).map(contract=>({long:contract.flag,short:contract.short,aliases:contract.aliases})),optionsToValidate={...looseOptions};for(const key of extensionOptionKeys)scoped[key]!==void 0&&(optionsToValidate[key]=scoped[key]);validateLooseCommandOptionsWithFlagDefinitions(optionsToValidate,[...coreFlagDefinitions,...extensionFlagDefinitions],getCommandPath(command));const coerced=coerceLooseCommandOptionsWithFlagDefinitions(scoped,extensionFlagDefinitions,looseOptions,getCommandPath(command));return copyReadOutputInvocationProvenance(scoped,coerced),coerced}return scoped}function collectExtensionFlagDefinitionsForCommand(registrations,commandPath){const normalizedCommandPath=normalizeExtensionCommandPath(commandPath);return normalizedCommandPath.length===0?[]:registrations.flags.filter(entry=>resolvePmCommandOperation(normalizeExtensionCommandPath(entry.target_command))===resolvePmCommandOperation(normalizedCommandPath)).flatMap(entry=>entry.flags)}function collectExtensionFlagDefinitionsForInvocation(registrations,commandPath,commandArgs){const exact=collectExtensionFlagDefinitionsForCommand(registrations,commandPath),pathParts=[commandPath];let nestedMatch=[];for(const arg of commandArgs){if(arg.startsWith("-"))break;pathParts.push(arg);const nested=collectExtensionFlagDefinitionsForCommand(registrations,pathParts.join(" "));nested.length>0&&(nestedMatch=nested)}return nestedMatch.length>0?nestedMatch:exact}function dynamicCommandArguments(descriptor){return descriptor.arguments??[]}function formatDynamicCommandUsage(descriptor){const argumentSuffix=dynamicCommandArguments(descriptor).map(argument=>{const label=argument.variadic?`${argument.name}...`:argument.name;return argument.required?`<${label}>`:`[${label}]`}).join(" ");return`pm ${descriptor.command}${argumentSuffix?` ${argumentSuffix}`:""}`}function isImporterOrExporterCommandPath(registrations,commandPath){if(!registrations)return!1;const normalized=normalizeExtensionCommandPath(commandPath);return registrations.importers.some(entry=>normalizeExtensionCommandPath(`${entry.importer} import`)===normalized)||registrations.exporters.some(entry=>normalizeExtensionCommandPath(`${entry.exporter} export`)===normalized)}function validateDynamicExtensionCommandArgs(descriptor,args){const descriptorArguments=dynamicCommandArguments(descriptor),requiredCount=descriptorArguments.filter(argument=>argument.required).length,maxCount=descriptorArguments.some(argument=>argument.variadic)?Number.POSITIVE_INFINITY:descriptorArguments.length,failureHints=descriptor.failure_hints??[],hintSuffix=failureHints.length>0?` ${failureHints.join(" ")}`:"";if(args.length<requiredCount)throw new PmCliError(`Missing required argument for extension command '${descriptor.command}'. Usage: ${formatDynamicCommandUsage(descriptor)}${hintSuffix}`,EXIT_CODE.USAGE);if(args.length>maxCount){const extra=args.slice(maxCount).join(" ");throw new PmCliError(`Too many arguments for extension command '${descriptor.command}': ${extra}. Usage: ${formatDynamicCommandUsage(descriptor)}${hintSuffix}`,EXIT_CODE.USAGE)}}function formatDynamicOptionFlag(optionKey){return`--${optionKey.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()}`}function validateDynamicExtensionCommandOptions(descriptor,options,extensionFlagDefinitions){if(extensionFlagDefinitions.length>0){validateLooseCommandOptionsWithFlagDefinitions(options,extensionFlagDefinitions,descriptor.command);return}const unknownOptions=Object.keys(options).filter(key=>options[key]!==void 0).sort();if(unknownOptions.length!==0)throw new PmCliError(`Unknown option '${unknownOptions.map(formatDynamicOptionFlag).join(", ")}' for extension command '${descriptor.command}'. This command does not define extension flags.`,EXIT_CODE.USAGE)}function validateDynamicExtensionCommandInvocation(descriptor,args,options,extensionFlagDefinitions){descriptor&&(validateDynamicExtensionCommandArgs(descriptor,args),validateDynamicExtensionCommandOptions(descriptor,options,extensionFlagDefinitions))}export{collectExtensionFlagDefinitionsForCommand,collectExtensionFlagDefinitionsForInvocation,copyReadOutputInvocationProvenance,dynamicCommandArguments,extractCommandScopedOptions,forwardReadOutputIncludeModes,isImporterOrExporterCommandPath,recordCliReadOutputInvocationProvenance,validateDynamicExtensionCommandArgs,validateDynamicExtensionCommandInvocation};
|
|
2
2
|
//# sourceMappingURL=invocation-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schema_version":1,"generation":"1cf0395b1a3ac07d04da96a5f250372a71d55c010efcf6454d33a9db0144c22f","files":[{"path":"chunks/chunk-2CBHQXYJ.js","sha256":"7ecd210410d5461583a096d57ec8a1b0d0c23868e9fcffdb3926c8e98870d0b4"},{"path":"chunks/chunk-2CBHQXYJ.js.map","sha256":"6891e9179042addffd88d12c8e1e02a0598c5b577cc5857271cf485b72077c46"},{"path":"chunks/chunk-32BCU6HN.js","sha256":"2fadcd9ba2960f38b8a08dacfca2a7f4bfdd4ca58173c2919c405ee28209d605"},{"path":"chunks/chunk-32BCU6HN.js.map","sha256":"7d975de5d612ffa674af6bc480c619cf611bd7cdef2ca6ebd2c5d42b6d4fa50d"},{"path":"chunks/chunk-5IPXDZKU.js","sha256":"a04e0c25fdb0aaf5de9b0e25fe3381afaf45d6540f2865eb0d7b1f9365cb552a"},{"path":"chunks/chunk-5IPXDZKU.js.map","sha256":"837976b14db661640c6cd1a451b6157e9fdaa4592fddfcd699ea098326240b2a"},{"path":"chunks/chunk-5JZMF4M5.js","sha256":"06e44c8ee9c623fe4a8a38d80eca5f1af29cb4ad9a87b9a386d4c6ed0ab3e137"},{"path":"chunks/chunk-5JZMF4M5.js.map","sha256":"962aeeab1815bccee8dffa040c671affb8cce2a4667002d017b43afc593a1882"},{"path":"chunks/chunk-7ZEFHFAU.js","sha256":"973b70696c89658aef36e46a6b12b737420cbe887de395e3be192439fed99fe6"},{"path":"chunks/chunk-7ZEFHFAU.js.map","sha256":"abfdeb1099e59d3d493387be6fe57c984478bdd07aa6ba441ea06942034ae843"},{"path":"chunks/chunk-B6UTLYLM.js","sha256":"65429bf9748e1cddfac00db4ace45d4e5079f5d2568c6cb8c605966c1fcb95a7"},{"path":"chunks/chunk-B6UTLYLM.js.map","sha256":"8a182dc3fc4cc0b30d8d73fb52a933325d3e9d350f85d920a2a2010781905441"},{"path":"chunks/chunk-DEJHTFEF.js","sha256":"4731b41d39cdecff862d86cec563179ba8f6fd80a0874bc601810cacfb374488"},{"path":"chunks/chunk-DEJHTFEF.js.map","sha256":"4a5ca6e764c15fb0d450a503ccc2a44ed842607387bdd8736d4173063f5da2be"},{"path":"chunks/chunk-DEZPZOQ7.js","sha256":"ef11ddab9ecc9533cac75ccc8ca41058a59382dfbe3262033fa21c7264d73b0d"},{"path":"chunks/chunk-DEZPZOQ7.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/chunk-HBKD5HZB.js","sha256":"3ff2cd75540c79c6ba90eddee50986e50e4a66f22af3a5df93b07cf842b71d13"},{"path":"chunks/chunk-HBKD5HZB.js.map","sha256":"56703820ed8260aaae617bfd55b38da2ed58272d296d0df44f708569ec2205be"},{"path":"chunks/chunk-IB7UB5TE.js","sha256":"158940f663a676247075395b646afbce49c7b88138d677699bdabf9add9776df"},{"path":"chunks/chunk-IB7UB5TE.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/chunk-JPKIUWLG.js","sha256":"904fe7f8d388aed99fe6b31367e08d84639cc0f1873ccaab2520f356f9d27131"},{"path":"chunks/chunk-JPKIUWLG.js.map","sha256":"0e169da43af38b44ce993da2a96cb273329370f9c4a073c7a852826e0a7ebf11"},{"path":"chunks/chunk-L6LCLC37.js","sha256":"4b13ffec37d5d8aa340f7b4c0bc2236b35592e5618edaa83aef0a553d6547339"},{"path":"chunks/chunk-L6LCLC37.js.map","sha256":"7c4ae61287228d93ee6ab373b8c0f52e961d4eb850e12b448f8720384277a290"},{"path":"chunks/chunk-MQJXZX3Q.js","sha256":"4a2c0cc23c6e3db6bdda5a788cf3c71210a6e6e30b40fc2f53e5a4397aac9965"},{"path":"chunks/chunk-MQJXZX3Q.js.map","sha256":"febffbb426f68b982e7f31b30f83e9b9e0c878fd4fa8bd9b50dfd395dd71ba57"},{"path":"chunks/chunk-NR4KABHC.js","sha256":"7fa4281e9606cd6c949d28f63b4a4cead4f6eb5d83c8b8af8a749d81a47f1347"},{"path":"chunks/chunk-NR4KABHC.js.map","sha256":"b663df880686167d3bcacc19010d5862ccb9bdbde4a7e1aaec464590abc923b2"},{"path":"chunks/chunk-O4ZLEN4T.js","sha256":"c840a800fd85b0a9078b28e5cbc51b048ca15f14179bf5865e6840105093a8a6"},{"path":"chunks/chunk-O4ZLEN4T.js.map","sha256":"ac003ffbf6bca2076ea011786e029b165d5626153de1f2ad73053bbf3517b243"},{"path":"chunks/chunk-PWD5RY2D.js","sha256":"859e52c60c0753ec3d11afb05b35bba3cb82bf1f9091a439a4439c7c20f878bb"},{"path":"chunks/chunk-PWD5RY2D.js.map","sha256":"1a00d42a88c5aba6aaf99ed7eaab3ac31d53fdef26c673ec0e1b1a9da62b001a"},{"path":"chunks/chunk-RSAN2YUU.js","sha256":"6d761ffb0fd8a6f76a78205e18eb54dc93cd51bfc24e17162a4731a2351399f2"},{"path":"chunks/chunk-RSAN2YUU.js.map","sha256":"f295630c5dc63081c1891c29b55fd197bac98d6452e29c09eaf97fdbc35554a0"},{"path":"chunks/chunk-SPPHDVZE.js","sha256":"ba82130f93656299c39dc713ba1f03fc47bec7a39fac6594c72e10ba398f04d3"},{"path":"chunks/chunk-SPPHDVZE.js.map","sha256":"3a5501d6ab3f711b0aaa21285ea5fba97feaf79460619089e0e6010785e3ad7e"},{"path":"chunks/chunk-TZ3D3DPQ.js","sha256":"d600f662229c406e78d53ba6e2529e81d26ea7b9cd738d79ba03f6e701c97dcc"},{"path":"chunks/chunk-TZ3D3DPQ.js.map","sha256":"a293fc0d94c56a7f11857fdc95a5355cf5ceca2329c9a17dd21416824f947b0b"},{"path":"chunks/chunk-UJMQP2HP.js","sha256":"33d8da387462b3150d10560acf8d13d63ab2fbb654f247cd777e7cc45c5ab19c"},{"path":"chunks/chunk-UJMQP2HP.js.map","sha256":"26c92ca1dcf896743cae73cdf47c47a8133e4e9cff4590b313c02d7094087305"},{"path":"chunks/chunk-UYNMKUGA.js","sha256":"76e51b0a2be66846b403a0b8451159527e5942d10532ca7f8dd4bae02f0b1271"},{"path":"chunks/chunk-UYNMKUGA.js.map","sha256":"9af7c3720f9837d7a21bf4bb789678c1823e514731aebbad8fc11bdd36801d6f"},{"path":"chunks/chunk-VS565KBX.js","sha256":"f66d92e0d59add33123dc44938a2cf76a749b262d5c044d8bbccce24861f9351"},{"path":"chunks/chunk-VS565KBX.js.map","sha256":"562c753aa39adbfdbeefaf390e68fdadd1fe986bcb6e82f9355315e8d6a16ec9"},{"path":"chunks/chunk-XAWE4EAK.js","sha256":"9ec1c5760661739327050e0bfc643cdfb827f8f501fe1a57c28be01371f89128"},{"path":"chunks/chunk-XAWE4EAK.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/chunk-XRMYA4R7.js","sha256":"a2afb3b6f631e8752566c6117d0c7da0911632c51f6f6580973edf449ce78ead"},{"path":"chunks/chunk-XRMYA4R7.js.map","sha256":"f2cf826b47133df2b954d1730ad6602ddf5f7ace4adfdca75329d80e48619f79"},{"path":"chunks/chunk-Y7H55PCY.js","sha256":"39057dd4ec3622118cee82dd5bc570eac3da3a498391e81c8d6887da4ee3eb46"},{"path":"chunks/chunk-Y7H55PCY.js.map","sha256":"3ef6aaaab9d223b065b678a7eb29cc8fb1a241156372d5809b00812dd5a84afb"},{"path":"chunks/chunk-YWS4XV4I.js","sha256":"3afe9e04ec457962031aecc7711fa6eb7f82c8889d5a1a6d5cf5dda46e7c7f75"},{"path":"chunks/chunk-YWS4XV4I.js.map","sha256":"3a205925a78794f41f28149573ebe587e22f11fde71260806e92c04246b68903"},{"path":"chunks/chunk-ZOAJNPBL.js","sha256":"66ec6d887404129093f2878981c4c3a8595e3d99fe6cef958a68d47d0c58371f"},{"path":"chunks/chunk-ZOAJNPBL.js.map","sha256":"7ab164be1748b18587ce1b562b3814d8a7208f5df1870a6171c4dd40eafb3ba1"},{"path":"chunks/context-budget-recovery-L2WP5S26.js","sha256":"94308a0c40cb90380fb5f3c00c105b04df651eb699452e4a1eff4392936bad3e"},{"path":"chunks/context-budget-recovery-L2WP5S26.js.map","sha256":"bdec4d79334c795b8b4fdcf03f3820adac1f8a3a220767d3cf0de29c4d3a79e2"},{"path":"chunks/indexed-receipt-blobs-I6RQGD6Y.js","sha256":"6a9e5f49b8c0212d359d9a148334403e1ece480b71fe9056780a686ca49a4e06"},{"path":"chunks/indexed-receipt-blobs-I6RQGD6Y.js.map","sha256":"cd38ac9e4b9beec9644d2629c41c46fef0179d7fcd36a1df7cafd1cdf5f22489"},{"path":"chunks/item-transaction-ZHLJTBD7.js","sha256":"2d1c417389d4617851df57d22d0ab6bdf7abbeac5dcd46cfa35213dd057f0738"},{"path":"chunks/item-transaction-ZHLJTBD7.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/mutation-admission-ZQMRMGIB.js","sha256":"3e3d10418a10d5a2e5bdb47f21c1161b6def3acecaa20ac48ace071e2662feec"},{"path":"chunks/mutation-admission-ZQMRMGIB.js.map","sha256":"e380f366c43aaf591b023222423a57578d104ed97f2684f4b52037aa9f548eb1"},{"path":"chunks/register-list-query-I6AZA3IX.js","sha256":"cd74e1677f72f690849fad1b4a005d6c62a547fa79b71ffa909230e37096be76"},{"path":"chunks/register-list-query-I6AZA3IX.js.map","sha256":"68451647bf9019154e8f7e8605d7863f095ae6fce9e2c8d726674f61364c70f8"},{"path":"chunks/register-mutation-3DAXCLXR.js","sha256":"5df790b34e751b47fe0923d76da4dc304ee7611deb19d0372005006de6f9b97e"},{"path":"chunks/register-mutation-3DAXCLXR.js.map","sha256":"0458a16aa4baf71d2b2cfb8e0b7de0ecf81efb916f23bac7fa7e6419cc306c78"},{"path":"chunks/register-operations-G3QGGQ5Z.js","sha256":"eb329c01615fb16310c816305d529edc3852cc714307f684cce149adaf58c617"},{"path":"chunks/register-operations-G3QGGQ5Z.js.map","sha256":"3a782f404d69f1189d313ea2e6dde6407a8e68a29dbd14111aad432de4266bb8"},{"path":"chunks/register-setup-LDXHMNOT.js","sha256":"e997c6c50182645befef6b5f215274e5f30078b17c221c8a1720a9f26ec7a646"},{"path":"chunks/register-setup-LDXHMNOT.js.map","sha256":"b323d344776471d1ba98d57233da41b2f0ceeb634519e85552b10ce0243c3485"},{"path":"chunks/settlement-hook-JHXLUBEN.js","sha256":"60574b6f2502b42ca6797b76a0a41d2ebfe8f4cd1087d19c9648ad7ed01cbf46"},{"path":"chunks/settlement-hook-JHXLUBEN.js.map","sha256":"6e0577b035532efe4968d1a3bbaf491e0d790074b735ff94448143e5a700c747"},{"path":"chunks/stage-7H36OTDJ.js","sha256":"4af4084d16fa1145ca9fcc161052f62edcf3593d45cbc18dd1e77bd9f0ae07b5"},{"path":"chunks/stage-7H36OTDJ.js.map","sha256":"1cfaef9f0b1890e2dfed29ad9121a25281e2f074e8183edc9163c214e4b00437"},{"path":"focused-chunks/chunk-3XGKBVJ3.js","sha256":"9a781fa1adeaa7ca0d44cd1dd97ef073092c9b5c9f226675fd985df3f502dd81"},{"path":"focused-chunks/chunk-3XGKBVJ3.js.map","sha256":"acb52c55ea66017cb956517ff23b5d11719059a53324ad12190647574350f52e"},{"path":"focused-chunks/chunk-4HY6EGPB.js","sha256":"1ac082eb9eecfd96672e46b7a097cf536462690ba7d3a2cd1660dca34c16c204"},{"path":"focused-chunks/chunk-4HY6EGPB.js.map","sha256":"af537ec28248a8025311da1cd3c45d464718f3b26df17e69ed079dd0740ea3c1"},{"path":"focused-chunks/chunk-4PW5XWVI.js","sha256":"65b448ac1f0a9f5762d7c5f6583931e8ef3206c476779e14e54fec8fd50ed5d8"},{"path":"focused-chunks/chunk-4PW5XWVI.js.map","sha256":"04b985eb18e7adee37e3001428efcb74fa570e7fc56596504b2e2d40bae6ff5b"},{"path":"focused-chunks/chunk-AK2CI2GI.js","sha256":"8a40e489e22d02a4d6c0e02a3ff847d93b633d662cd952e4023079ffb4a3fdc5"},{"path":"focused-chunks/chunk-AK2CI2GI.js.map","sha256":"70aa5aa38f1d2f486c5e165db51939b7777df85572706d3bb4165e55f8614488"},{"path":"focused-chunks/chunk-D4XQOMG4.js","sha256":"b4a2b626098482e48b08d93fbe51bed248fd3b7c83ffba9569f0bfcc7ec6efda"},{"path":"focused-chunks/chunk-D4XQOMG4.js.map","sha256":"26caacaf2e6171056f04695cb09bdf2f914364ad5fbf957b1f20a58e94579dde"},{"path":"focused-chunks/chunk-EGN2HFRU.js","sha256":"60ca3c4b0c5584d8866c75892f5c5224db858ef11328a0d99265b2c94eb3815d"},{"path":"focused-chunks/chunk-EGN2HFRU.js.map","sha256":"3a5501d6ab3f711b0aaa21285ea5fba97feaf79460619089e0e6010785e3ad7e"},{"path":"focused-chunks/chunk-F3X6UWMI.js","sha256":"a6cca27288611ba8c703545c71ab596a91fb32c0ccdd43d36dd3af965ca0f14b"},{"path":"focused-chunks/chunk-F3X6UWMI.js.map","sha256":"42c9ad936e5602f3632900659c35e42aa05a0cfd8f3f09eaaebef035071ec38e"},{"path":"focused-chunks/chunk-FOA7XKWP.js","sha256":"3e57188628de10dafcc17048ef3dcc5b9061c29ff4f34620a4d62de45ee606fa"},{"path":"focused-chunks/chunk-FOA7XKWP.js.map","sha256":"562c753aa39adbfdbeefaf390e68fdadd1fe986bcb6e82f9355315e8d6a16ec9"},{"path":"focused-chunks/chunk-G6ERMFJ5.js","sha256":"2b65658ea244174c234a3190965d9bdc6fec1f625cf7d34d019ee53ac89fdd52"},{"path":"focused-chunks/chunk-G6ERMFJ5.js.map","sha256":"22c39dcfda645869aaf1242d3287de74ff3e9b6186967a7cd17e9aafc7e26822"},{"path":"focused-chunks/chunk-GHQVM6K6.js","sha256":"79ea412a6b8b7c176f75f19aaaabf6fbbfbc826c4362254c90183003f4b8f1d6"},{"path":"focused-chunks/chunk-GHQVM6K6.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"focused-chunks/chunk-HJ27QLZV.js","sha256":"58cc27f2ed9a917d09b33913ba48ae91e15274830554df3169026dc34fc6ba1e"},{"path":"focused-chunks/chunk-HJ27QLZV.js.map","sha256":"28917f3c4d14ec223f7c49f5abb15afcf8cd5f8339ef2fbb163231386522d0e5"},{"path":"focused-chunks/chunk-HOXIIZEO.js","sha256":"999fc6095c89e58fc5907f6ac1c891ebc389aeb2bb403bf049fca4cd664428ad"},{"path":"focused-chunks/chunk-HOXIIZEO.js.map","sha256":"94f80694f796bef09b9007858c22de0e3869fb1c0ddc70c46e763e53a11d4094"},{"path":"focused-chunks/chunk-HUXZCPWT.js","sha256":"576c5e66caaf14c4ba45a25887fa89bb81890851c26f79e1e5618807d79d1cd5"},{"path":"focused-chunks/chunk-HUXZCPWT.js.map","sha256":"a0aaaa0c97153bdb1b48f4e100d3001bc08cc79876fb5f07a43c00bd96d795dd"},{"path":"focused-chunks/chunk-I5FODKYB.js","sha256":"1229af257c49f3ac97b2300a704a64eb9840bea117b22aa0d59cd5ef9eff6939"},{"path":"focused-chunks/chunk-I5FODKYB.js.map","sha256":"e27692e5f33d7d892f44ef51f07249e209463d941ba29599482b794019759709"},{"path":"focused-chunks/chunk-IDAYTYNN.js","sha256":"4cf4b10a5600acff248e6fa45a40bfb028cce8d4def56901dcccca778f9e8058"},{"path":"focused-chunks/chunk-IDAYTYNN.js.map","sha256":"f295630c5dc63081c1891c29b55fd197bac98d6452e29c09eaf97fdbc35554a0"},{"path":"focused-chunks/chunk-IKXJ57XA.js","sha256":"3ae897b3f091ee6e724bd5b6c38942ae248b4d63dabbe64a914f316d8a79a39f"},{"path":"focused-chunks/chunk-IKXJ57XA.js.map","sha256":"55cc43f1df0c83cb8ead390bd23156dd886a5df20019102f1b097a510ac89cef"},{"path":"focused-chunks/chunk-LKN2WGGB.js","sha256":"1727b33a69f0bf32a70a7d8336250bdf67f5ab44a0e097a19ed87d607d9ae642"},{"path":"focused-chunks/chunk-LKN2WGGB.js.map","sha256":"237e554f344bb13eec7fe223fbda45da2a5e2ebfe08a138830df554217244be5"},{"path":"focused-chunks/chunk-MOY6KZGJ.js","sha256":"745b0d19107ec65a1491883c4d86ee44ad6801c814fd55c63483b04076c38039"},{"path":"focused-chunks/chunk-MOY6KZGJ.js.map","sha256":"e7e8149cc5790a151dae9a3f1ae52d8530269e5e1c006565eed27414622fcaba"},{"path":"focused-chunks/chunk-PWUTFKSI.js","sha256":"b08fe290aef3069b7c372100d577c9137b33bbc8410d4582b061630d593db339"},{"path":"focused-chunks/chunk-PWUTFKSI.js.map","sha256":"6f4307159c63436401b13e8e5654653e370a78ecb1ab1457c5b33d8d6589780a"},{"path":"focused-chunks/chunk-PZRB7IXH.js","sha256":"f7dd1c6c29e62dbcb2fa9283f19f4b745fe474c362be07775addd966392c56d0"},{"path":"focused-chunks/chunk-PZRB7IXH.js.map","sha256":"c9e9f11b51f0aca1b834d88ffe30fe3bbff7f6175a72c14d0ae044bb2d33b991"},{"path":"focused-chunks/chunk-RY4QEMAE.js","sha256":"25497c8257fcccc97e908d97567c5cf984ffdaba459024c9bdfe16161de05c84"},{"path":"focused-chunks/chunk-RY4QEMAE.js.map","sha256":"92710cfcd66c620ed23f4cc10a23232503b9e8fbf772df8c8bc44f12df36d6af"},{"path":"focused-chunks/chunk-SVOOGGAK.js","sha256":"cf84553a8001feee7147d6941274dc00cf8644ded0da1e4b611b542c02f6dcb5"},{"path":"focused-chunks/chunk-SVOOGGAK.js.map","sha256":"c6941ba9e7060fcb63add9bb1b246052f16f530b85845320f23076a4db57f341"},{"path":"focused-chunks/chunk-TYHDZUL4.js","sha256":"39a5906cb8af97f1b7e97e5bb37e0820ad1b8a06b46e22b4661af53f37d07e0c"},{"path":"focused-chunks/chunk-TYHDZUL4.js.map","sha256":"80f6c87b0f5dc75681ed748b40ba004822e36fc904f28ba9d01bfa21c5880772"},{"path":"focused-chunks/chunk-WSYPVBKS.js","sha256":"440069fa243b6dcfe62c5b556d8d5cc8d0c1554bdf1bf7dbc6fbda5d1e461b87"},{"path":"focused-chunks/chunk-WSYPVBKS.js.map","sha256":"035010a9d0fdf4ae2df52fba3d8a3e86f7898de53b46cf5c291d48714731cf45"},{"path":"focused-chunks/chunk-WXLG7HZ5.js","sha256":"d42e4ad37fb6c63c0a118e3539b94138021130f7fd1773742009485bd0d580bb"},{"path":"focused-chunks/chunk-WXLG7HZ5.js.map","sha256":"6218c80c72b2b4b5a7910f868a611da6226548ae2ad796082d9d0cd4d2a51a18"},{"path":"focused-chunks/chunk-WZDFCVLX.js","sha256":"de09cc38161c145663f7904aefdd61a4ea20ad95863b23a7430f85e33705fe56"},{"path":"focused-chunks/chunk-WZDFCVLX.js.map","sha256":"a493323168af3569f74fbf2433753f0d6ab990493e25626d003cf943a759d76e"},{"path":"focused-chunks/chunk-YGO3FWA2.js","sha256":"00a188942183358e66e244702794494902e5bc2a9c1361682c56b1a02cbc9f11"},{"path":"focused-chunks/chunk-YGO3FWA2.js.map","sha256":"64ddee936d43e684273d7d32a25708f938da912434f3776265c359883ce66558"},{"path":"focused-chunks/chunk-YVLAP3BL.js","sha256":"2306f1ce34e32768f8bcda3653abf692e1aa6da840c87678acf9028bac0819dc"},{"path":"focused-chunks/chunk-YVLAP3BL.js.map","sha256":"8b2db884ea5ba121730dff40b55bde932c77142a2b59f52bd8539b43dd817856"},{"path":"focused-chunks/chunk-ZQRCVRGS.js","sha256":"db21cd4ee019292bc91cee91466fa02f72080ccdd80c80d694d2b4cc9c7f1207"},{"path":"focused-chunks/chunk-ZQRCVRGS.js.map","sha256":"465ad04e111ad587eccb210911c6be082d2f05e33793acaa6af6a188ab9cc53f"},{"path":"focused-chunks/chunk-ZYXQACPB.js","sha256":"33797f2b77e6de08cfe1d2a64522b29942575adeb8fc59fbb5ac8bf433b24fa9"},{"path":"focused-chunks/chunk-ZYXQACPB.js.map","sha256":"6d80fc75705c021e7bcaa2fbed4f8661878befb56755aa8c085596c47f073abe"},{"path":"focused-chunks/context-budget-recovery-5MKOCGY5.js","sha256":"1f103ba5015f9f0dabbb93e2fa2cd59078036e68b9b1f3da2bd265025dbd44f1"},{"path":"focused-chunks/context-budget-recovery-5MKOCGY5.js.map","sha256":"3e209028283d24aafcd47b35e66acb6297ef80f0f13f6bf0e7e393a9f15d4317"},{"path":"focused-chunks/indexed-receipt-blobs-7XGVHYAO.js","sha256":"dcfeb93e2ae577f5dd834ff0b159b39faa05ba516cd1364f734206dcaf818860"},{"path":"focused-chunks/indexed-receipt-blobs-7XGVHYAO.js.map","sha256":"82230162c7538ff401bdb67dd28a671f3bb6c8e0c874fb375bd3f303db03e1cc"},{"path":"focused-chunks/item-transaction-PZ2FQ6B2.js","sha256":"00eb6a67b8d8b5d82c585b9247c472ecb78100c6acbdcdfa3116f25e89480f6d"},{"path":"focused-chunks/item-transaction-PZ2FQ6B2.js.map","sha256":"58f06420dfb50a6bcb363e2d72e450b94bacd22cc978891532397b10ac32de8a"},{"path":"focused-chunks/mutation-admission-XOOK6XFH.js","sha256":"0bf652c8e1f03a39f304650f6c4545e6ab43c217c81d079039da313823e4afdc"},{"path":"focused-chunks/mutation-admission-XOOK6XFH.js.map","sha256":"3d37817bd6aa0a3c99f04b5c040d4f91ee0efc042c2fc5dad392d46db5b8fc5a"},{"path":"focused-chunks/settlement-hook-H56537UV.js","sha256":"1cf7677ed2a857da74d12353bed01a3aa5d5b99c94368f191424325873587c18"},{"path":"focused-chunks/settlement-hook-H56537UV.js.map","sha256":"d49b55f7df2dff3c6287f163f6a2bb801dca8caf522412c0b328eb9f74be5c7f"},{"path":"focused-chunks/stage-4SQHVI3O.js","sha256":"08e571a9f01370300af69ed9ff06232896fe36d0fbb6f02dc0965387e1e695c8"},{"path":"focused-chunks/stage-4SQHVI3O.js.map","sha256":"53384e77cf51a5eaf3292f99c9375c57e284c0a07762ec49ce3c5eb59ae38f28"},{"path":"main.js","sha256":"2ee68ffcc8681aad8bc3f2b97503653d5bfbfba8a313e816bb88be338b8ac889"},{"path":"main.js.map","sha256":"119dd4fb4f9a36ce09baf5ebe80b7d8f8aa1a204a8f4cdd45eabb166a3ea7eef"},{"path":"sdk-authoring.js","sha256":"637582da6c9c2e802480baaf12e132eb98ba6415aad727fbfcff90662e488358"},{"path":"sdk-authoring.js.map","sha256":"b6d5ccbd2349ec776bbf56ee1c075d1254f0829c34402ba35d3af055dc7e8777"},{"path":"sdk-contracts.js","sha256":"bc092c2170f2486977c41ef763cc345964d55febb5097e3ff2163faa84e36189"},{"path":"sdk-contracts.js.map","sha256":"e7cec7bb35033854db606051f9448891cad70cc2d2798cb28c66ca0938cd6eba"},{"path":"sdk-core.js","sha256":"91214024c02ebaebba028bc00aa383acadb619ff16534ab64866fbd4086b8ea5"},{"path":"sdk-core.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"sdk-governance.js","sha256":"d47c67c5586d1385ccf6423ed144dd49425bd9c13b15124c0159899d07fd1401"},{"path":"sdk-governance.js.map","sha256":"774f7be41fe8e7db070ba13c7879e220ef5ac651e97abb47afab2230c0a9bce9"},{"path":"sdk-graph.js","sha256":"504405ffdf4a7069cdf9071911ea66807f8a30cb15c1f73d89b92b91efd0d366"},{"path":"sdk-graph.js.map","sha256":"efa166700ff746731db3675b94e7cba11af2828f29b74e91c00ca4214f4220d0"},{"path":"sdk-merge.js","sha256":"e4745392831c070bffb0a84d65459e0ac1dfc18a00a915c67e4698178c6e2a78"},{"path":"sdk-merge.js.map","sha256":"f1b82ad17246ce5b909241a73f40f44b3465624b6b973ab38b626fdf63757bff"},{"path":"sdk-query.js","sha256":"d61e550ba87f2bbbd6dd9f224aa00fc55326f70ab0c088fb3864fcf1ff46ad05"},{"path":"sdk-query.js.map","sha256":"acc76084165883a89aae4872a3814aa1b9fac5fb7b2b28d4000a3c5736c1ec7a"},{"path":"sdk-runtime.js","sha256":"0de35c2718041f3e8742a05bdb736edd7ffca2f788cb5758d565f0e9c7ac0153"},{"path":"sdk-runtime.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"sdk-testing.js","sha256":"775801af83661c09d1b4867f909ab2b6d85cee0401394ead912216e05cd928aa"},{"path":"sdk-testing.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"sdk.js","sha256":"48e4e7ec8fccdd0ef0fe9847f7088d33069a1ed3b39c3482aef09709c9c85488"},{"path":"sdk.js.map","sha256":"cc4e3cc9b4824eb917962b6a674b892afa2186c3e578680855c063dbb1ec7377"}]}
|
|
1
|
+
{"schema_version":1,"generation":"2ce7da23e3814750e3a7e8579e577228d5d8a34cc1c7f94c541f0ca64b1d9570","files":[{"path":"chunks/chunk-2GW662DP.js","sha256":"4d561de49ddbaf8a0fcb0b4f440342caf966b54407c92b2a42ccf4ba03386965"},{"path":"chunks/chunk-2GW662DP.js.map","sha256":"9af7c3720f9837d7a21bf4bb789678c1823e514731aebbad8fc11bdd36801d6f"},{"path":"chunks/chunk-3OXQGGRD.js","sha256":"185477c11b84771bbd36c2bc8354bc89bdd699f0b3b2a00a96da43293a426b16"},{"path":"chunks/chunk-3OXQGGRD.js.map","sha256":"24b72b6f82aa11c8ede784c1e428e73b97241b9d0f460cf187d26f431f1257a2"},{"path":"chunks/chunk-5BVZ32G7.js","sha256":"0f6c4af5601bf27a23226c0b30fcf3952fc96ac671500455890ad6da261d95a0"},{"path":"chunks/chunk-5BVZ32G7.js.map","sha256":"cb3599b08e31263e24a58443321712f9de9edfb61280744beb7beca07028cdaa"},{"path":"chunks/chunk-5S6RT5LX.js","sha256":"1924051860286b997bf385e0d9d63dae577ebe2926d8a5c2d8b9da61fc28fa84"},{"path":"chunks/chunk-5S6RT5LX.js.map","sha256":"599e0cd138087ee8d270876b2c29731d1dc2c059e412b2b3a53aaebef1f91e6f"},{"path":"chunks/chunk-5Z6LWFDL.js","sha256":"346c8fc77da851b004f2a20e76028d4ce7d451e3872e92cc5d8c358528bb2495"},{"path":"chunks/chunk-5Z6LWFDL.js.map","sha256":"ed8ad4402c90c448d59dea460271296eb685a748c592481ae35fa814b7bed09d"},{"path":"chunks/chunk-6T2V3UIK.js","sha256":"a5d01013f768d4f29d6c7ab97443b39960ef42d6cb7b305cde12c4bb8079dd9b"},{"path":"chunks/chunk-6T2V3UIK.js.map","sha256":"a3182f7da5dcb2521a0a2bf436948315e93924766a5783edf345110a775c0d3b"},{"path":"chunks/chunk-7PGNAHNW.js","sha256":"c86a6936a6e4f556b047bd1dbeae379f614d9096e00bee03e3d3bb1cc6526161"},{"path":"chunks/chunk-7PGNAHNW.js.map","sha256":"24ada1e26322c4eb55f10c5fb5bebb5eac8ab58579a565fd6a1e2d937e143480"},{"path":"chunks/chunk-7RCI7AAA.js","sha256":"1153504f1d24e10fd4fe106871ae7c0cf52d314a6d6175846e46290df517db7e"},{"path":"chunks/chunk-7RCI7AAA.js.map","sha256":"0ed964d8bf07da7f217ac3a9b8dcd37e5f0efb3a0957ef79c46b98a8df6e110b"},{"path":"chunks/chunk-AQ5UHHQS.js","sha256":"129c4034a4c79f5417b2e88c02d80aa2200f075b31fbe6315a198e8de32855bc"},{"path":"chunks/chunk-AQ5UHHQS.js.map","sha256":"28a454c63b7b0f56502f9f039a994cc8d71e668e5430039fa7e666fc328d9baf"},{"path":"chunks/chunk-BK2XAQVC.js","sha256":"7b1adb3f3498b7736f22a891ec6dabde29a6d2dfc5212cf38883e2e06cbd8695"},{"path":"chunks/chunk-BK2XAQVC.js.map","sha256":"a825a13fa2fffd1a1fb2f09aedaadbfde813be6be0570c74adefa421f37f03dd"},{"path":"chunks/chunk-BRIPGUAO.js","sha256":"23e1a86275a73f16cbc9fadf055a9af912d74b20a58e125d74954751d12810cd"},{"path":"chunks/chunk-BRIPGUAO.js.map","sha256":"a293fc0d94c56a7f11857fdc95a5355cf5ceca2329c9a17dd21416824f947b0b"},{"path":"chunks/chunk-BWAXA6S4.js","sha256":"062e00e88dcef7257c2f5154367c1d2e44675f693a8179caef9f33b21287c189"},{"path":"chunks/chunk-BWAXA6S4.js.map","sha256":"db5ccddc2b06713a22329db8e969841b847a311fdbe9c86804f88f97b8ad53af"},{"path":"chunks/chunk-CERNIZLB.js","sha256":"06b5d9ab51b37b2f4132c96f1605a39406ab57d87316d5d7595f4753c9318267"},{"path":"chunks/chunk-CERNIZLB.js.map","sha256":"487ac95552b2de62a193964778a20a77584e23050ab2105b7b025d048fef2a26"},{"path":"chunks/chunk-DEZPZOQ7.js","sha256":"ef11ddab9ecc9533cac75ccc8ca41058a59382dfbe3262033fa21c7264d73b0d"},{"path":"chunks/chunk-DEZPZOQ7.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/chunk-DSCFJTHB.js","sha256":"f9b33ba97ccbd289a73218e3d5ca0d00dbe0a590142daa4467c76dc470b84365"},{"path":"chunks/chunk-DSCFJTHB.js.map","sha256":"5a12521e5075ed030a6d4689a6f5e20284bc3b50e265d65e5930e5d9c8745a4c"},{"path":"chunks/chunk-IB7UB5TE.js","sha256":"158940f663a676247075395b646afbce49c7b88138d677699bdabf9add9776df"},{"path":"chunks/chunk-IB7UB5TE.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/chunk-L4BKTPJ6.js","sha256":"ac0b48ca76dc327f40efe6479730268ba94cd2f102f68557e2c19050ab429519"},{"path":"chunks/chunk-L4BKTPJ6.js.map","sha256":"0e169da43af38b44ce993da2a96cb273329370f9c4a073c7a852826e0a7ebf11"},{"path":"chunks/chunk-NPEDFOVQ.js","sha256":"73a1869898e127c3e8dd4143a0e8edb293757c0dd78cebcddc3fa616c95119ad"},{"path":"chunks/chunk-NPEDFOVQ.js.map","sha256":"3ef6aaaab9d223b065b678a7eb29cc8fb1a241156372d5809b00812dd5a84afb"},{"path":"chunks/chunk-O4ZLEN4T.js","sha256":"c840a800fd85b0a9078b28e5cbc51b048ca15f14179bf5865e6840105093a8a6"},{"path":"chunks/chunk-O4ZLEN4T.js.map","sha256":"ac003ffbf6bca2076ea011786e029b165d5626153de1f2ad73053bbf3517b243"},{"path":"chunks/chunk-ODMJ3HIB.js","sha256":"01cff5dc18e6c75fc42a5d553e28bd379b0709db7da236286931349eed034d24"},{"path":"chunks/chunk-ODMJ3HIB.js.map","sha256":"6891e9179042addffd88d12c8e1e02a0598c5b577cc5857271cf485b72077c46"},{"path":"chunks/chunk-QN7VCOUU.js","sha256":"ca6bed5ba0117bd551f47b6c2b49f97c8ac0677971a92f16107ea12613a59f0c"},{"path":"chunks/chunk-QN7VCOUU.js.map","sha256":"4a5ca6e764c15fb0d450a503ccc2a44ed842607387bdd8736d4173063f5da2be"},{"path":"chunks/chunk-QQHMNUZT.js","sha256":"26e626bb31cd007997e28e2990cb2522c4978a3f5113e4d4d225b0670dca2e54"},{"path":"chunks/chunk-QQHMNUZT.js.map","sha256":"136dd19f47626f64e19c2fc97a19880c25ab18947b967286d9ef9d787c755352"},{"path":"chunks/chunk-RSAN2YUU.js","sha256":"6d761ffb0fd8a6f76a78205e18eb54dc93cd51bfc24e17162a4731a2351399f2"},{"path":"chunks/chunk-RSAN2YUU.js.map","sha256":"f295630c5dc63081c1891c29b55fd197bac98d6452e29c09eaf97fdbc35554a0"},{"path":"chunks/chunk-SPPHDVZE.js","sha256":"ba82130f93656299c39dc713ba1f03fc47bec7a39fac6594c72e10ba398f04d3"},{"path":"chunks/chunk-SPPHDVZE.js.map","sha256":"3a5501d6ab3f711b0aaa21285ea5fba97feaf79460619089e0e6010785e3ad7e"},{"path":"chunks/chunk-SRDO2NJU.js","sha256":"6814e222b16b67791e7de834e76d0ef8d05a667899dfdc17a42f5d68ee312d21"},{"path":"chunks/chunk-SRDO2NJU.js.map","sha256":"06f8a84c461139c0a93e783f480151ad3adc15f37f541867d5fdf662099c53e4"},{"path":"chunks/chunk-T56MB6SF.js","sha256":"98f466555b1bc5fcba1337ccf7a69f320155c7f941750b1c21d6d064086476d5"},{"path":"chunks/chunk-T56MB6SF.js.map","sha256":"bba546ba957a9ea77502b0172a9edef70c8bc3ea1997065770079e53b4942c06"},{"path":"chunks/chunk-TX2W6G37.js","sha256":"809913025b9ae88fc4982b96cb9f99b6079c2605538d470821dd06ed8d71708c"},{"path":"chunks/chunk-TX2W6G37.js.map","sha256":"1563d8b9f021fef19067c657e966e304485e3d21d7bcb3e1ea4ca6f211d30cd9"},{"path":"chunks/chunk-UJMQP2HP.js","sha256":"33d8da387462b3150d10560acf8d13d63ab2fbb654f247cd777e7cc45c5ab19c"},{"path":"chunks/chunk-UJMQP2HP.js.map","sha256":"26c92ca1dcf896743cae73cdf47c47a8133e4e9cff4590b313c02d7094087305"},{"path":"chunks/chunk-VS565KBX.js","sha256":"f66d92e0d59add33123dc44938a2cf76a749b262d5c044d8bbccce24861f9351"},{"path":"chunks/chunk-VS565KBX.js.map","sha256":"562c753aa39adbfdbeefaf390e68fdadd1fe986bcb6e82f9355315e8d6a16ec9"},{"path":"chunks/chunk-XAWE4EAK.js","sha256":"9ec1c5760661739327050e0bfc643cdfb827f8f501fe1a57c28be01371f89128"},{"path":"chunks/chunk-XAWE4EAK.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/context-budget-recovery-L2WP5S26.js","sha256":"94308a0c40cb90380fb5f3c00c105b04df651eb699452e4a1eff4392936bad3e"},{"path":"chunks/context-budget-recovery-L2WP5S26.js.map","sha256":"bdec4d79334c795b8b4fdcf03f3820adac1f8a3a220767d3cf0de29c4d3a79e2"},{"path":"chunks/indexed-receipt-blobs-I6RQGD6Y.js","sha256":"6a9e5f49b8c0212d359d9a148334403e1ece480b71fe9056780a686ca49a4e06"},{"path":"chunks/indexed-receipt-blobs-I6RQGD6Y.js.map","sha256":"cd38ac9e4b9beec9644d2629c41c46fef0179d7fcd36a1df7cafd1cdf5f22489"},{"path":"chunks/item-revision-UAZOBP2Q.js","sha256":"9f0a070f9041a64f370d7fe1ed7f7a8b64c912fa4d6f35ee9aaf855373cb69f9"},{"path":"chunks/item-revision-UAZOBP2Q.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/item-transaction-N5F4LXYV.js","sha256":"79be38aa56f8fc0423eaa7b2ed7c589cf4c323a58d3280f8d36dcc27be138a9c"},{"path":"chunks/item-transaction-N5F4LXYV.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"chunks/mutation-admission-QZQI2NN5.js","sha256":"00cf817a32ac5b64c51341dd79b7e82ea6a803b1d614fbb794df2a90a5ccc6bd"},{"path":"chunks/mutation-admission-QZQI2NN5.js.map","sha256":"442edc3e0ad6c8e614c4729e5af935f14e79902c0af0c9779e3fe68fbc7248ea"},{"path":"chunks/register-list-query-P3NOKQUA.js","sha256":"739c9ac2982d75a165d74333a36a9176049ecc5e08d0817c1ab5b9dcb9b2b8a3"},{"path":"chunks/register-list-query-P3NOKQUA.js.map","sha256":"e0d14400528b46772b025d3059ea5c9ffe1b7d5a176e14a18fff05e07a25a789"},{"path":"chunks/register-mutation-A6I5K5N6.js","sha256":"202c32cce5fcc52b62c847a7cba0911ca38d29cf0ae87270bd6c4734766887e5"},{"path":"chunks/register-mutation-A6I5K5N6.js.map","sha256":"6faab76df172727c5211d6a5c80dba8de3773a0c4df42fd5bc1734bfc8347156"},{"path":"chunks/register-operations-SPKB3TNM.js","sha256":"6de2f5347aa1e63b6a640a57599775b7066454edd11ec6777438f5388472378c"},{"path":"chunks/register-operations-SPKB3TNM.js.map","sha256":"50bd4630ef72caa8d6adb2f2fb61b454e3883eaddb2c32d3e89b410168bb7c47"},{"path":"chunks/register-setup-ZZRHJ4IS.js","sha256":"86853a4ef4b07f1ad761390611212f709a0d4ce94ce8c8ab4d48b3c0fb89c0c3"},{"path":"chunks/register-setup-ZZRHJ4IS.js.map","sha256":"f3276202011844ffe76913b5846d73f06c893450c3bcaf27f0b535ec0b6c8352"},{"path":"chunks/settlement-hook-JHXLUBEN.js","sha256":"60574b6f2502b42ca6797b76a0a41d2ebfe8f4cd1087d19c9648ad7ed01cbf46"},{"path":"chunks/settlement-hook-JHXLUBEN.js.map","sha256":"6e0577b035532efe4968d1a3bbaf491e0d790074b735ff94448143e5a700c747"},{"path":"chunks/stage-L3T725DS.js","sha256":"dec8b1634041c4d7cb3e9300f33cd87ec5180b4d55b8912bb73f696890a7c87b"},{"path":"chunks/stage-L3T725DS.js.map","sha256":"1cfaef9f0b1890e2dfed29ad9121a25281e2f074e8183edc9163c214e4b00437"},{"path":"focused-chunks/chunk-4PW5XWVI.js","sha256":"65b448ac1f0a9f5762d7c5f6583931e8ef3206c476779e14e54fec8fd50ed5d8"},{"path":"focused-chunks/chunk-4PW5XWVI.js.map","sha256":"04b985eb18e7adee37e3001428efcb74fa570e7fc56596504b2e2d40bae6ff5b"},{"path":"focused-chunks/chunk-5NGNO54M.js","sha256":"2a3e573acc945257ae408bd06eeaf34ed7931428087309a2cba6a3e54de83680"},{"path":"focused-chunks/chunk-5NGNO54M.js.map","sha256":"06ac0720d9cfe8589bce53594586293d31816ecf15e6c550a48ff0be4f262bfc"},{"path":"focused-chunks/chunk-A2246ZM7.js","sha256":"6b4550095f49a27eb10d6cfd167249c28b88bf6dcab8a961ae7ce6b2bc491e9b"},{"path":"focused-chunks/chunk-A2246ZM7.js.map","sha256":"7861fcb54b1aed6b2656b76c88c7d004b12f97f17597074f51eb54ecee16d834"},{"path":"focused-chunks/chunk-B6U44WPW.js","sha256":"44c8744371a6b0b9c3b13798e056d6a48a5e84820faeaea74f809b8c6f766337"},{"path":"focused-chunks/chunk-B6U44WPW.js.map","sha256":"9f8f301c375c0cba227803dad692a8e31746786883932e16658f43cc54d63bc4"},{"path":"focused-chunks/chunk-BAW3DGQO.js","sha256":"b54995c4494b257ffe119478d080ce714f286672e03653f504436dac746871b7"},{"path":"focused-chunks/chunk-BAW3DGQO.js.map","sha256":"ce5241dc670cc0140e944c70a0a8d147ee6f1314cb88f573bee48873b133c087"},{"path":"focused-chunks/chunk-BHNY3KPJ.js","sha256":"4240ef9964c396778e0d5f25de8c3aa4564849af1036faa4e8accb531bbc90e5"},{"path":"focused-chunks/chunk-BHNY3KPJ.js.map","sha256":"8c2aa7e45db21bf0a8a01c4d1b7fed23b77def0225512ff26ffab21b6461f77f"},{"path":"focused-chunks/chunk-C3O6JJPO.js","sha256":"1f495890523f3550ee1050149240e68e386d729f0278be125ee51c337c2952c4"},{"path":"focused-chunks/chunk-C3O6JJPO.js.map","sha256":"7222eba51724ce2de54f854d9e01ca89dd73272e6407cdd8b9211be1cf9675c1"},{"path":"focused-chunks/chunk-C7UX2ZI3.js","sha256":"3113f25c7702e7012327df083107cefe8eea763d6946aa61abeaab7c6aa7de6f"},{"path":"focused-chunks/chunk-C7UX2ZI3.js.map","sha256":"237e554f344bb13eec7fe223fbda45da2a5e2ebfe08a138830df554217244be5"},{"path":"focused-chunks/chunk-CBG67HUP.js","sha256":"40ee04e2a772fe443eaf5f827ccf78a02685961c6af7652cfc7ab7e842746792"},{"path":"focused-chunks/chunk-CBG67HUP.js.map","sha256":"57561c1dd651fc071fa0503ecffcea49b3b4a1187753096fcba5f648021a48f0"},{"path":"focused-chunks/chunk-CO2DNPH7.js","sha256":"75f0f2786dd83c415e6fb244dcbfe69fc7748edbf572349f6f41dd599db36ad1"},{"path":"focused-chunks/chunk-CO2DNPH7.js.map","sha256":"80f6c87b0f5dc75681ed748b40ba004822e36fc904f28ba9d01bfa21c5880772"},{"path":"focused-chunks/chunk-CXTDEQ3N.js","sha256":"870d9256d6bf71a47d689f0f3f547572a58693638ca3cd714762c1b146b874d0"},{"path":"focused-chunks/chunk-CXTDEQ3N.js.map","sha256":"8cceb2f21b2b0df0e9645fb6c151c8ec033af2023f755ed788c75efcf58fee54"},{"path":"focused-chunks/chunk-EGN2HFRU.js","sha256":"60ca3c4b0c5584d8866c75892f5c5224db858ef11328a0d99265b2c94eb3815d"},{"path":"focused-chunks/chunk-EGN2HFRU.js.map","sha256":"3a5501d6ab3f711b0aaa21285ea5fba97feaf79460619089e0e6010785e3ad7e"},{"path":"focused-chunks/chunk-FEPE2CE4.js","sha256":"c043dfdcc136bb2fd6a05a5cd706e31c836d65de8ac6b63ac780301f4acaa513"},{"path":"focused-chunks/chunk-FEPE2CE4.js.map","sha256":"521f1986abad81175cf70813dad9cd5c7a3022058c1b14df033d96b4db7aa3f0"},{"path":"focused-chunks/chunk-FFO7RBLN.js","sha256":"4343798d7483e72431251dab861e9508962ca834c61a59e852637d9df3f13b95"},{"path":"focused-chunks/chunk-FFO7RBLN.js.map","sha256":"92710cfcd66c620ed23f4cc10a23232503b9e8fbf772df8c8bc44f12df36d6af"},{"path":"focused-chunks/chunk-FOA7XKWP.js","sha256":"3e57188628de10dafcc17048ef3dcc5b9061c29ff4f34620a4d62de45ee606fa"},{"path":"focused-chunks/chunk-FOA7XKWP.js.map","sha256":"562c753aa39adbfdbeefaf390e68fdadd1fe986bcb6e82f9355315e8d6a16ec9"},{"path":"focused-chunks/chunk-FXFDVM5O.js","sha256":"24d3ea252b2eebcf30a44845bda4c048f246a1e5f7714fb2ac9381f00322066f"},{"path":"focused-chunks/chunk-FXFDVM5O.js.map","sha256":"e27692e5f33d7d892f44ef51f07249e209463d941ba29599482b794019759709"},{"path":"focused-chunks/chunk-G6ERMFJ5.js","sha256":"2b65658ea244174c234a3190965d9bdc6fec1f625cf7d34d019ee53ac89fdd52"},{"path":"focused-chunks/chunk-G6ERMFJ5.js.map","sha256":"22c39dcfda645869aaf1242d3287de74ff3e9b6186967a7cd17e9aafc7e26822"},{"path":"focused-chunks/chunk-GHQVM6K6.js","sha256":"79ea412a6b8b7c176f75f19aaaabf6fbbfbc826c4362254c90183003f4b8f1d6"},{"path":"focused-chunks/chunk-GHQVM6K6.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"focused-chunks/chunk-I5LGPUWH.js","sha256":"f2289c3bdd0121277e0e06133743ab4633ccb4384d70ba302df15b53ce1be45d"},{"path":"focused-chunks/chunk-I5LGPUWH.js.map","sha256":"5372543aa2680b9ab13778a97bd74f239974c09fdbc238233d00006a6c16021a"},{"path":"focused-chunks/chunk-IDAYTYNN.js","sha256":"4cf4b10a5600acff248e6fa45a40bfb028cce8d4def56901dcccca778f9e8058"},{"path":"focused-chunks/chunk-IDAYTYNN.js.map","sha256":"f295630c5dc63081c1891c29b55fd197bac98d6452e29c09eaf97fdbc35554a0"},{"path":"focused-chunks/chunk-J3YOATXR.js","sha256":"57139bfeb91b89d0734c19801b0403d7283aa6638c7f398489c3d908622ec057"},{"path":"focused-chunks/chunk-J3YOATXR.js.map","sha256":"973a60570ef6719194a4a630e5767a46d1ad506f6dbedb53824a671079b66181"},{"path":"focused-chunks/chunk-J6FDCAMH.js","sha256":"a43351a1ad2ca2aea2e239d7081b3da09fb6129f3417d403446c7b54a5bac3d4"},{"path":"focused-chunks/chunk-J6FDCAMH.js.map","sha256":"94f80694f796bef09b9007858c22de0e3869fb1c0ddc70c46e763e53a11d4094"},{"path":"focused-chunks/chunk-J7M52SCZ.js","sha256":"e5fd0b718f0aa5a04c168c18f75780bdc95b8ccd8bb38d5f5a6e57e3634351ef"},{"path":"focused-chunks/chunk-J7M52SCZ.js.map","sha256":"a133db99c13155e80c2a8ca817aec4861da27ca804a44e84bd7292a85fad186e"},{"path":"focused-chunks/chunk-JQS7TYQ6.js","sha256":"faf5f0f450b008ceddab7a2fc11038825c81d24eebbc641a0acd929e5e9f4c34"},{"path":"focused-chunks/chunk-JQS7TYQ6.js.map","sha256":"eefba2d6e4be358eecefe33bc40cf353b261d552ce0981cad07a6b4bbaa2ec93"},{"path":"focused-chunks/chunk-MEJKELWC.js","sha256":"1f45322f9471d772c8665d11c1e4abb23f6fde89998ea17c554b193d828744eb"},{"path":"focused-chunks/chunk-MEJKELWC.js.map","sha256":"e5d15c94cd13d6eddcca2a6ee680d271e93ccd6fd1693a6a1eef9005fff0e637"},{"path":"focused-chunks/chunk-PMKR4MJI.js","sha256":"61cb8034779f8d87b267a843e7b75966467e26ede9fb78f03b7075591625bb82"},{"path":"focused-chunks/chunk-PMKR4MJI.js.map","sha256":"e330b6fd277006e879d561f52b1c0cfc3eb1c4798c605fdd4c4955b74278b322"},{"path":"focused-chunks/chunk-PNPYQDHU.js","sha256":"3c0bcc64564080b82aecd44fa6b183d7fe8d3e11e62d505599606737e2ba5ad6"},{"path":"focused-chunks/chunk-PNPYQDHU.js.map","sha256":"0b169761c94dc10556613f88606a760aab80151424b8e71441583655b22a13e4"},{"path":"focused-chunks/chunk-Q4OIRSKL.js","sha256":"b781b43c8d283c289d3d52a7c63d24137a1069a21577e7c1cb5e272da5f673ed"},{"path":"focused-chunks/chunk-Q4OIRSKL.js.map","sha256":"b9a0c7337133c0c9c51a8d73716354272737729af8d9789f2736f9cc4ad44778"},{"path":"focused-chunks/chunk-QEVJ3Y67.js","sha256":"569378318dd8bc072095f2949f2cb61ce3d9b2ca815966f175501083c9a1ca50"},{"path":"focused-chunks/chunk-QEVJ3Y67.js.map","sha256":"42c9ad936e5602f3632900659c35e42aa05a0cfd8f3f09eaaebef035071ec38e"},{"path":"focused-chunks/chunk-SDLIUZEL.js","sha256":"ec6932ec46422b8b8bfa55191f67d66e6a703b2de12f20b0fd27cce91d892ee0"},{"path":"focused-chunks/chunk-SDLIUZEL.js.map","sha256":"28917f3c4d14ec223f7c49f5abb15afcf8cd5f8339ef2fbb163231386522d0e5"},{"path":"focused-chunks/chunk-SVOOGGAK.js","sha256":"cf84553a8001feee7147d6941274dc00cf8644ded0da1e4b611b542c02f6dcb5"},{"path":"focused-chunks/chunk-SVOOGGAK.js.map","sha256":"c6941ba9e7060fcb63add9bb1b246052f16f530b85845320f23076a4db57f341"},{"path":"focused-chunks/chunk-TFYTTDAK.js","sha256":"6d69848239f67f84562e79e11d998668f0a6e138ad7e2d1f7207205fdc0edd00"},{"path":"focused-chunks/chunk-TFYTTDAK.js.map","sha256":"863073db0139bc67f4fdfcdd83f80ac9fff85f85127388cfd6c87807074699f2"},{"path":"focused-chunks/chunk-W3CSX6GI.js","sha256":"111037078769c7fd9de06ff86b76ead00d43cfbc218fd7e053ffb44d08d04176"},{"path":"focused-chunks/chunk-W3CSX6GI.js.map","sha256":"6d0f96eb93e23f2b308ac773e954064297c8b830a25c6463d98eff4fb4ef32ce"},{"path":"focused-chunks/chunk-Y5GOUUYJ.js","sha256":"a235170139a8b211da0d97a6218c96abe7c6639b86eb91e8fb92663dde718a0c"},{"path":"focused-chunks/chunk-Y5GOUUYJ.js.map","sha256":"26caacaf2e6171056f04695cb09bdf2f914364ad5fbf957b1f20a58e94579dde"},{"path":"focused-chunks/context-budget-recovery-5MKOCGY5.js","sha256":"1f103ba5015f9f0dabbb93e2fa2cd59078036e68b9b1f3da2bd265025dbd44f1"},{"path":"focused-chunks/context-budget-recovery-5MKOCGY5.js.map","sha256":"3e209028283d24aafcd47b35e66acb6297ef80f0f13f6bf0e7e393a9f15d4317"},{"path":"focused-chunks/indexed-receipt-blobs-7XGVHYAO.js","sha256":"dcfeb93e2ae577f5dd834ff0b159b39faa05ba516cd1364f734206dcaf818860"},{"path":"focused-chunks/indexed-receipt-blobs-7XGVHYAO.js.map","sha256":"82230162c7538ff401bdb67dd28a671f3bb6c8e0c874fb375bd3f303db03e1cc"},{"path":"focused-chunks/item-revision-L6GVT42D.js","sha256":"585501d92c2a919d46b54f1f5edf22c400dd19b47dffd6789148b96c7a0a24bf"},{"path":"focused-chunks/item-revision-L6GVT42D.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"focused-chunks/item-transaction-GYGP264N.js","sha256":"1d7c5cae2a146f04c8686c35030b376dced42ad71fcd9bf0d6790f5ea0cb324d"},{"path":"focused-chunks/item-transaction-GYGP264N.js.map","sha256":"c546d40a7db3d75ed01d9913ecd9de70890b56d4e094e863c3f6bd57f12910b8"},{"path":"focused-chunks/mutation-admission-UWTH56OD.js","sha256":"12344c00af3079172e9242d847d37ea340d9b02a32080d8c2da6d07ef285a548"},{"path":"focused-chunks/mutation-admission-UWTH56OD.js.map","sha256":"a793662de64c7c8ecbd0ce97cd4b50070ac2bc67ffa9b77510c7b433dd7ed3df"},{"path":"focused-chunks/settlement-hook-H56537UV.js","sha256":"1cf7677ed2a857da74d12353bed01a3aa5d5b99c94368f191424325873587c18"},{"path":"focused-chunks/settlement-hook-H56537UV.js.map","sha256":"d49b55f7df2dff3c6287f163f6a2bb801dca8caf522412c0b328eb9f74be5c7f"},{"path":"focused-chunks/stage-WRSNJ7VI.js","sha256":"eec74ccb0bbfcad7e3a6fa355f228fb7b1f2861e1149160d53308fe259be4a37"},{"path":"focused-chunks/stage-WRSNJ7VI.js.map","sha256":"53384e77cf51a5eaf3292f99c9375c57e284c0a07762ec49ce3c5eb59ae38f28"},{"path":"main.js","sha256":"769ee8d7a64fa228cfc05cb8e76b7931728f23d7f8b57d4d0914a429f9d44bc4"},{"path":"main.js.map","sha256":"1ac6deb240f59e3d252f8787ad3bc140d1a323a11bfec75a18a7fe1437cbc0f1"},{"path":"sdk-authoring.js","sha256":"14385264ea4a2049223997636c998410cc93ec497cab05171f6d4efda0288b09"},{"path":"sdk-authoring.js.map","sha256":"6267dc5a90d121ed26fedd8f961b4112a89dbbd7c650f9d363c894f27a9e6763"},{"path":"sdk-contracts.js","sha256":"091ac6c29f2822a3aa85f75039b8d8e8ff198fe3e2f5ed847f25bb5e38d68758"},{"path":"sdk-contracts.js.map","sha256":"8f83894853a84c9c93d543aaf914a53d38973ff517151281bb438b36214bcc0d"},{"path":"sdk-core.js","sha256":"23635eae914da12d3a55c49b85fd9a3193b7d765159af70fddb3bf49b5d0e581"},{"path":"sdk-core.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"sdk-governance.js","sha256":"eb074d64cbbc79c3d839d6a3aa7684cb34e22a6549c0c557a432fd809b0f91e2"},{"path":"sdk-governance.js.map","sha256":"f1896cd990ec0e5a31dfac3e1e75b7d225a861e4585f8aad6ba5200426bbd56d"},{"path":"sdk-graph.js","sha256":"45546a1fab740fdd048aea3bc793fb1f25f3bc26cbdbbc3cc12dbf29aeffae04"},{"path":"sdk-graph.js.map","sha256":"1136e6a3e817ebbdb724152310e9738709e8b82921e2c3c3ea691060b53670a4"},{"path":"sdk-merge.js","sha256":"d6d749966be4268312533caf021602bc1535e94cfbc462d9fa9e31b4a711be82"},{"path":"sdk-merge.js.map","sha256":"6d0b73a4dd6435cfc0d9f8d916fcd9962899ecc1645339b0199ee5b6feae444d"},{"path":"sdk-query.js","sha256":"abb309c82af5fcdf7c6cf4f5e1106be8b8e3b400760ff6820f122a7842b8469a"},{"path":"sdk-query.js.map","sha256":"15eac56a6e70b51d9b5bffdd254398f62dfc6c3ab0bad9ab8593a6a20b2839e0"},{"path":"sdk-runtime.js","sha256":"ef5a3d6ee56ecbc40966ed446bf0ae5b3145d6b7fbda84674783d2061151356e"},{"path":"sdk-runtime.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"sdk-testing.js","sha256":"a8fd988368f6a53e7c28ced14b16b2089a079267fcad6034b601eafd42d761a6"},{"path":"sdk-testing.js.map","sha256":"ed562b0bba7ee7214e56ac7f728054b3496bec4597c94a4eb7b4179e6f5cb1c9"},{"path":"sdk.js","sha256":"7c55a98c6b9285744fb39a8a6ec7fe3169b684dfa8600e6b934bd207ffeb0860"},{"path":"sdk.js.map","sha256":"6b37045cb5a9a4c33015ea4aba9b5e6656e7258bbfd1f51b6aad83f6de52a692"}]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Dh as c,Eh as f,Ih as _,Kh as p,oh as d}from"./chunk-3OXQGGRD.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8467eccc-684d-56cc-8b18-5f2e940abb42")}catch{}})();var m="not-a-declared-intent",i="not-a-declared-field";function g(){let e={get:["pm-domain"],search:["Domain query"]},r=[...new Set(d.map(({command:o})=>o))].map(o=>{let a=d.filter(n=>n.command===o),s=a[0],u=e[s.command]??[];return{probe_id:`${s.command}-invalid-intent`,command:s.command,flag:"--for",rejected_value:m,refusal_args:[s.command,...u,"--for",m],allowed_values:a.map(({intent:n})=>n).sort(),suggested_retry_args:[s.command,...u,"--for",s.intent],error_code:"unknown_context_intent"}}),t=f(),l=Object.keys(c).map(o=>({probe_id:`${o}-invalid-field`,command:o,flag:"--fields",rejected_value:i,refusal_args:[o,"--fields",i],allowed_values:t,suggested_retry_args:[o,"--fields","id,title,status"],error_code:"unknown_field_projection"}));return[...r,...l,{probe_id:"get-invalid-field",command:"get",flag:"--fields",rejected_value:i,refusal_args:["get","pm-domain","--fields",i],allowed_values:_(),suggested_retry_args:["get","pm-domain","--fields","id,title,status"],error_code:"unknown_field_projection"},{probe_id:"list-mutually-exclusive-projection",command:"list",flag:"--projection",rejected_value:"--brief+--full",refusal_args:["list","--brief","--full"],allowed_values:[],suggested_retry_args:["list","--brief"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"get-mutually-exclusive-projection",command:"get",flag:"--projection",rejected_value:"--full+--fields",refusal_args:["get","pm-domain","--full","--fields","id"],allowed_values:[],suggested_retry_args:["get","pm-domain","--full"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"search-mutually-exclusive-projection",command:"search",flag:"--projection",rejected_value:"--full+--fields",refusal_args:["search","Domain query","--full","--fields","id"],allowed_values:[],suggested_retry_args:["search","Domain query","--full"],error_code:"projection_options_mutually_exclusive",allowed_values_required:!1},{probe_id:"package-upgrade-mutually-exclusive-modes",command:"package upgrade",flag:"--cli-only/--packages-only",rejected_value:"--cli-only+--packages-only",refusal_args:["package","upgrade","--cli-only","--packages-only","--dry-run"],allowed_values:[],suggested_retry_args:["package","upgrade","--packages-only","--dry-run"],error_code:"package_upgrade_modes_mutually_exclusive",allowed_values_required:!1},{probe_id:"search-invalid-field",command:"search",flag:"--fields",rejected_value:i,refusal_args:["search","Domain query","--fields",i],allowed_values:p(),suggested_retry_args:["search","Domain query","--fields","id,title,status,score"],error_code:"unknown_field_projection"}].sort((o,a)=>o.probe_id.localeCompare(a.probe_id))}function v(e,r){let t=g().find(a=>a.command===e&&a.flag===r);if(!t)return"No stable core values are declared.";let l=t.allowed_values.filter(a=>!a.startsWith("item.")),o=r==="--fields"?" item.<field> aliases and configured runtime metadata fields are also accepted.":" Configured package and workspace intents may extend this domain.";return`Allowed core values: ${l.join("|")}.${o}`}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="9febe44f-931d-5442-95e6-2793cb571972")}catch{}})();function y(e){return e.map((r,t)=>{if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`NDJSON row ${t} must be a non-null object.`);let l=JSON.stringify(r);if(l===void 0)throw new TypeError(`NDJSON row ${t} must serialize to a non-null object.`);let o=JSON.parse(l);if(typeof o!="object"||o===null||Array.isArray(o))throw new TypeError(`NDJSON row ${t} must serialize to a non-null object.`);return l}).join(`
|
|
2
2
|
`)}function R(e,r){if(r.count!==e.length)throw new TypeError(`NDJSON trailer count ${r.count} does not match ${e.length} ${e.length===1?"row":"rows"}.`);for(let[t,l]of e.entries())if(typeof l=="object"&&l!==null&&!Array.isArray(l)&&Reflect.get(l,"record_type")==="pm.stream.trailer")throw new TypeError(`NDJSON row ${t} uses reserved record_type pm.stream.trailer`);return y([...e,{...r,record_type:"pm.stream.trailer"}])}export{g as a,v as b,y as c,R as d};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-2GW662DP.js.map
|