@unbrained/pm-cli 2026.11.29 → 2026.11.30

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.
Files changed (113) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli-bundle/bundle-manifest.json +1 -1
  3. package/dist/cli-bundle/chunks/{chunk-Q6GIFUCW.js → chunk-2SBTXR6C.js} +2 -2
  4. package/dist/cli-bundle/chunks/{chunk-PY6A7ULK.js → chunk-3TXEWHQX.js} +2 -2
  5. package/dist/cli-bundle/chunks/{chunk-K3MVVDLN.js → chunk-47ZS6RPL.js} +2 -2
  6. package/dist/cli-bundle/chunks/{chunk-WLZ5KVM2.js → chunk-5PNOVDVO.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-3TK2YOVB.js → chunk-AOTI76Q6.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-CV2B4JUB.js → chunk-CCKM5YQM.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-JQHLOSSS.js → chunk-DCWGM7CY.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-LQEB6GSY.js → chunk-FECZV72T.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-FRYNDVLN.js → chunk-FR7ULTM4.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-NLHNB2L3.js → chunk-HXQ3OHQR.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-JFPCL45G.js → chunk-IGEFPHV7.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-NRCGGNOE.js → chunk-JPJNJHQW.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-R6M5OGJH.js → chunk-KCVSSONY.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-3E53F7QY.js → chunk-KXTKLDKD.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-DBASKWBO.js → chunk-NHBG5ET3.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-CNZOC6JD.js → chunk-NVYDPNQP.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-3US5T6B2.js → chunk-NZSXWIX7.js} +5 -5
  20. package/dist/cli-bundle/chunks/{chunk-VI3A7UZ2.js → chunk-Q4VZSMUL.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-RWHS77ME.js → chunk-SJWIPGZW.js} +39 -39
  22. package/dist/cli-bundle/chunks/{chunk-EYEQC3L2.js → chunk-TX74QJ4W.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-WNB62BGK.js → chunk-TY55UX6M.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-4EBHZBM2.js → chunk-USBTXMKS.js} +2 -2
  25. package/dist/cli-bundle/chunks/chunk-VCXQ6A35.js +3 -0
  26. package/dist/cli-bundle/chunks/{chunk-L7HON3BE.js → chunk-WFYE34TO.js} +2 -2
  27. package/dist/cli-bundle/chunks/chunk-YPMNXG2C.js +2 -0
  28. package/dist/cli-bundle/chunks/{chunk-ZK4CY24V.js → chunk-YVTALIN3.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-ZSBPE36C.js → chunk-Z7YL2SUM.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-KCR4NF2A.js → chunk-ZA5NS3PL.js} +2 -2
  31. package/dist/cli-bundle/chunks/{field-option-collisions-OZE43TOH.js → field-option-collisions-2F2Z7R7B.js} +2 -2
  32. package/dist/cli-bundle/chunks/{item-revision-3WXNNFLP.js → item-revision-UAF6L47R.js} +2 -2
  33. package/dist/cli-bundle/chunks/item-transaction-RJECL53Y.js +2 -0
  34. package/dist/cli-bundle/chunks/{linked-resource-value-list-2655COY2.js → linked-resource-value-list-WXPPYUVQ.js} +2 -2
  35. package/dist/cli-bundle/chunks/{mutation-actor-QOKPDYM4.js → mutation-actor-UK3QNEEB.js} +2 -2
  36. package/dist/cli-bundle/chunks/{mutation-admission-JNJHB3E6.js → mutation-admission-UTDYPFWP.js} +2 -2
  37. package/dist/cli-bundle/chunks/{register-list-query-YGVUE4YZ.js → register-list-query-DRA3CWHI.js} +2 -2
  38. package/dist/cli-bundle/chunks/{register-mutation-3JVZQDHH.js → register-mutation-WO74VLEQ.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-operations-LCHUHKRA.js → register-operations-CRBKH7WN.js} +2 -2
  40. package/dist/cli-bundle/chunks/{register-setup-IJ7M3VUK.js → register-setup-6V6NQB5C.js} +2 -2
  41. package/dist/cli-bundle/chunks/{stage-7BD7U2BX.js → stage-DYEHGASU.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-WJAUHPXD.js → chunk-2UUBS4BG.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-KLOHZNJ4.js → chunk-4ER3VMST.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-BZ3PUUPG.js → chunk-4YBMHMBJ.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-ACTBMSCH.js → chunk-62AMZMR4.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-LSVRZ4KQ.js → chunk-7G7JIXLL.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-BPOU2S44.js → chunk-A3DORTXS.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-NNLENKU7.js → chunk-FM5WQ6ZU.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-BPBKHY6H.js → chunk-HXM7K6VH.js} +35 -35
  50. package/dist/cli-bundle/focused-chunks/{chunk-EUDAUT6T.js → chunk-IIVDBAJM.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-LKTRICZR.js → chunk-IJ3T3W4U.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-S5VG7RFY.js → chunk-L357ZAES.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-PPCBCPIZ.js → chunk-LWBZ7UGG.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-TSZVCALS.js → chunk-M57KDG7I.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-2CQFGJQ6.js → chunk-MZNV26XE.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/chunk-NGHT2LNG.js +3 -0
  57. package/dist/cli-bundle/focused-chunks/{chunk-GTUPHXKR.js → chunk-NJTKGBSK.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-5NSWNLFE.js → chunk-P55AZPFN.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-NO5MUY4I.js → chunk-RQYVX2T6.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-KWKPX36T.js → chunk-SXC3NVZI.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-QTV6UE2Q.js → chunk-TQQO42C2.js} +5 -5
  62. package/dist/cli-bundle/focused-chunks/{chunk-S4AC7OMI.js → chunk-U35K7FSE.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-42SU4LK3.js → chunk-UQJ4PY2Y.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{chunk-NZA2LP4Y.js → chunk-WAP3DF4B.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-MYWUMVCZ.js → chunk-XR745UGE.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{field-option-collisions-HABQYZMQ.js → field-option-collisions-7TG7STO7.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{item-revision-YH5R7YPW.js → item-revision-J7EUGCHR.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{item-transaction-YZ2PUPGM.js → item-transaction-2IC2MLML.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/{mutation-actor-DJ2VRLKG.js → mutation-actor-LJVF2HVD.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/{mutation-admission-3SECKVKY.js → mutation-admission-SLFAUONA.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{stage-FEJT2UCG.js → stage-MWR73LTZ.js} +2 -2
  72. package/dist/cli-bundle/main.js +3 -3
  73. package/dist/cli-bundle/sdk-authoring.js +1 -1
  74. package/dist/cli-bundle/sdk-contracts.js +1 -1
  75. package/dist/cli-bundle/sdk-core.js +1 -1
  76. package/dist/cli-bundle/sdk-governance.js +1 -1
  77. package/dist/cli-bundle/sdk-graph.js +1 -1
  78. package/dist/cli-bundle/sdk-merge.js +61 -61
  79. package/dist/cli-bundle/sdk-query.js +1 -1
  80. package/dist/cli-bundle/sdk-runtime.js +1 -1
  81. package/dist/cli-bundle/sdk-testing.js +1 -1
  82. package/dist/cli-bundle/sdk.js +1 -1
  83. package/dist/core/shared/url-credentials.d.ts +4 -2
  84. package/dist/core/shared/url-credentials.js +1 -1
  85. package/dist/sdk/context-intent-contracts.js +1 -1
  86. package/docs/CONFIGURATION.md +22 -3
  87. package/docs/READ_OUTPUT_CONTRACTS.md +5 -0
  88. package/docs/SDK.md +19 -3
  89. package/marketplace.json +1 -1
  90. package/package.json +1 -1
  91. package/packages/pm-beads/package.json +1 -1
  92. package/packages/pm-calendar/package.json +1 -1
  93. package/packages/pm-command-kit/package.json +1 -1
  94. package/packages/pm-digital-twin/package.json +1 -1
  95. package/packages/pm-governance-audit/package.json +1 -1
  96. package/packages/pm-guide-shell/package.json +1 -1
  97. package/packages/pm-kanban/package.json +1 -1
  98. package/packages/pm-lifecycle-hooks/package.json +1 -1
  99. package/packages/pm-linked-test-adapters/package.json +1 -1
  100. package/packages/pm-search-advanced/package.json +1 -1
  101. package/packages/pm-templates/package.json +1 -1
  102. package/packages/pm-todos/package.json +1 -1
  103. package/packages/pm-vcs/package.json +1 -1
  104. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  105. package/plugins/pm-claude/package.json +1 -1
  106. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  107. package/plugins/pm-codex/package.json +1 -1
  108. package/plugins/pm-codex/plugin.json +1 -1
  109. package/runtime-dependencies.json +1 -1
  110. package/dist/cli-bundle/chunks/chunk-JV7LREUF.js +0 -3
  111. package/dist/cli-bundle/chunks/chunk-SV27NNXQ.js +0 -2
  112. package/dist/cli-bundle/chunks/item-transaction-DJ5GAITL.js +0 -2
  113. package/dist/cli-bundle/focused-chunks/chunk-TX24L7RQ.js +0 -3
@@ -1,2 +1,2 @@
1
- import{$ as ge,$a as T,Aa as Me,Ba as Ae,C as t,Ca as he,D as x,Da as Pe,E as Ko,Ea as _e,F as Qo,Fa as be,G as Yo,Ga as Be,H as Zo,Ha as Oe,I as $o,Ia as Ue,J as oe,Ja as We,K as ee,Ka as je,L as re,La as we,M as te,Ma as De,N as xe,Na as Le,O as me,Oa as Ne,P as pe,Pa as Ve,Q as ae,Qa as ze,R as ne,Ra as Xe,S as fe,Sa as qe,T as se,Ta as Ge,U as ce,Ua as He,V as ie,Va as Je,W as Ce,Wa as Ke,X as ue,Xa as Qe,Y as le,Ya as Ye,Z as de,Za as R,_ as ye,_a as S,a as Uo,aa as ke,b as Wo,ba as Ee,c as jo,ca as Fe,d as wo,da as Ie,e as Do,ea as m,f as Lo,fa as p,g as No,ga as a,h as Vo,ha as n,i as zo,ia as f,ja as s,ka as c,la as i,ma as C,na as u,oa as l,pa as d,qa as y,ra as g,s as Xo,sa as k,t as qo,ta as E,u as Go,ua as F,v as Ho,va as I,w as Jo,wa as Re,xa as Se,ya as Te,za as ve}from"./focused-chunks/chunk-S5VG7RFY.js";import{W as r,a as ko,b as Eo,c as Fo,d as Io,e as Ro,f as So,g as To,p as vo,q as Mo,r as Ao,s as ho,t as Po,u as _o,v as bo,w as Bo,x as Oo}from"./focused-chunks/chunk-MYWUMVCZ.js";import"./focused-chunks/chunk-NO5MUY4I.js";import{Ja as e,ua as eo}from"./focused-chunks/chunk-NZA2LP4Y.js";import{b as v,c as M,d as A,e as h,g as P,h as _,j as b}from"./focused-chunks/chunk-KLOHZNJ4.js";import"./focused-chunks/chunk-42SU4LK3.js";import{a as fo,b as so,c as co,d as io,e as Co,f as uo,g as lo,h as yo,i as go}from"./focused-chunks/chunk-NNLENKU7.js";import"./focused-chunks/chunk-BKPUUW5O.js";import{A as ao,B as no,s as o,u as ro,v as to,w as xo,x as mo,z as po}from"./focused-chunks/chunk-TSZVCALS.js";import"./focused-chunks/chunk-2CQFGJQ6.js";import"./focused-chunks/chunk-CWQLW4ZO.js";import"./focused-chunks/chunk-BWOVFE5B.js";import"./focused-chunks/chunk-X6CXWWNB.js";import{Af as $,Bf as oo,Ic as O,if as U,jf as W,kf as j,lf as w,mf as D,nf as L,of as N,pf as V,qf as z,rf as X,sc as B,sf as q,tf as G,uf as H,vf as J,wf as K,xf as Q,yf as Y,zf as Z}from"./focused-chunks/chunk-BPBKHY6H.js";import"./focused-chunks/chunk-TX24L7RQ.js";import"./focused-chunks/chunk-26P6C6OO.js";import"./focused-chunks/chunk-JFICNN4T.js";import"./focused-chunks/chunk-IRYNVGKH.js";export{so as ACTIONABILITY_ORDERING_KINDS,M as BRIEF_LIST_FIELDS,ee as CONTEXT_EVALUATION_METRIC_NAMES,m as CONTEXT_OUTPUT_VALUES,pe as CONTEXT_PACKING_PROFILES,Yo as CONTEXT_RELEVANCE_SERVICE,Ko as CONTEXT_RELEVANCE_SIGNAL_NAMES,fe as CONTEXT_SIGNAL_SET_VERSION,ne as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,se as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,X as CONTEXT_USAGE_LIMITS,ue as ContextSignalStore,q as ContextUsageValidationError,be as DEFAULT_CHILD_SAMPLE_LIMIT,v as DEFAULT_COMPACT_LIST_FIELDS,mo as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,de as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,R as EVAL_METRIC_NAMES,_ as GET_DEPTH_INPUT_VALUES,P as GET_DEPTH_VALUES,Ce as JsonFileContextSignalStoreAdapter,A as LIST_COMMAND_DEFAULT_PROJECTIONS,Ao as LIST_SORT_FIELDS,ho as LIST_SORT_ORDER_VALUES,_e as MAX_CHILD_PROJECTION_ITEMS,Re as NEXT_OUTPUT_VALUES,Xo as NEXT_RANKING_POLICIES,Uo as OutputEnvelopeFitError,jo as PM_COMPLETE_LIST_FINDING_CODES,wo as PmCompleteListValidationError,z as QUERY_CURSOR_CONTRACT,Oo as _testOnly,Pe as _testOnlyAggregateCommand,Ue as _testOnlyGetCommand,Te as _testOnlyNextCommand,Qe as _testOnlySearchCommand,po as acquireItemMetadataDerivedIndexLock,r as analyzeDuplicateItems,F as applyContextTagProjection,Po as applyFilterValueEcho,Vo as assertCompleteListResult,G as attachContextUsageServingReceipt,y as buildChildrenByParent,Xe as buildCompactSearchFilterSummary,_o as buildContentFilterEcho,ie as buildContextSignalSnapshot,bo as buildGovernanceMissingFilterEcho,Be as buildItemChildrenRollup,Qo as buildItemContextRelevanceCandidates,qe as buildVerboseSearchFilters,ye as buildWorkspaceMemorySnapshot,No as certifyCompleteListResult,He as classifyImplicitSemanticFallbackReason,co as collectBlockedByIds,Co as collectBlockedByIdsFromCorpus,J as collectContextUsageDeliveredItemIds,lo as collectDependencyBlockedIds,Ge as collectErrorCauseCodes,i as collectSubtreeIds,C as compareCriticalItems,go as computeActionabilityReport,Do as createCompleteListOptions,W as createQueryFingerprint,Ve as createSearchCursorFingerprint,L as decodeQueryCursor,w as decodeQueryCursorEnvelope,D as decodeQueryCursorState,Zo as defaultScoreContextCandidates,j as encodeQueryCursor,re as evaluateContextRanking,T as evaluateMetricFloors,e as executeEmbeddingBatchesWithRetry,K as finalizeContextUsageDelivery,Wo as fitOutputEnvelope,Ke as formatVectorIndexRecoveryWarnings,io as indexBlockedByIds,Lo as inspectCompleteListResult,b as listGetProjectionFields,h as listListProjectionFields,o as measureItemMetadataReadWork,k as mergeSortedWarnings,ae as packContextCandidates,u as packRankedContextItems,V as paginateQueryRows,s as parseContextDepth,p as parseContextFocusFields,c as parseContextSections,ce as parseContextSignalSnapshot,S as parseEvalMetricFloors,ko as parseIntegerLimit,eo as parseLimit,Io as parseMultiValueFilter,Eo as parsePriority,To as parsePriorityFilterSet,Ro as parseStringFilterSet,Fo as parseType,So as parseTypeFilterSet,ve as partitionDecisionEntries,a as projectContextFocusRows,H as propagateContextUsageServingReceipt,ro as queryItemMetadataIndex,to as queryLinkedFileMetadataIndex,xo as querySimilarItemMetadataIndex,oo as readContextUsageAffinity,B as readHistoryEntries,ao as readItemMetadataDerivedIndexState,x as readRecentActivity,le as readWorkspaceContextSignals,ge as readWorkspaceMemory,Y as recordContextUsageDelivery,Q as recordContextUsageServing,Z as recordContextUsageTouch,$ as recordContextUsageTouches,no as refreshItemMetadataDerivedIndex,Go as renderCalendarMarkdown,Ho as renderCalendarToon,E as renderContextMarkdown,Ae as renderNextMarkdown,qo as resolveCalendarOutputFormat,Mo as resolveContentFieldFilters,n as resolveContextOutputFormat,f as resolveContextTokenBudget,we as resolveEffectiveSearchMode,Le as resolveHybridSemanticWeight,uo as resolveItemBlockers,fo as resolveItemExecutionRole,vo as resolveMissingMetadataFilters,Se as resolveNextOutputFormat,N as resolveQueryCursorStart,je as resolveSearchMaxResults,ze as resolveSearchPage,De as resolveSearchScoreThreshold,Ne as resolveSearchTuning,Je as resolveVectorIndexRecovery,t as runActivity,he as runAggregate,Jo as runCalendar,I as runContext,me as runContextEvaluationCorpus,te as runContextEvaluationScenario,zo as runDuplicates,Oe as runGet,We as runHistory,Bo as runList,Me as runNext,Ye as runSearch,$o as scoreContextCandidates,oe as scoreContextCandidatesWithActiveExtensions,Fe as searchWorkspaceMemory,Ie as searchWorkspaceMemoryReadResult,yo as selectActionableEntries,U as selectCursorSemanticOptions,Ee as selectWorkspaceMemory,ke as selectWorkspaceMemoryRollups,xe as summarizeContextEvaluationReports,g as toContextFocusItem,l as toContextPackingSummary,d as toContextRankingSummary,O as verifyHistoryChain};
1
+ import{$ as ge,$a as T,Aa as Me,Ba as Ae,C as t,Ca as he,D as x,Da as Pe,E as Ko,Ea as _e,F as Qo,Fa as be,G as Yo,Ga as Be,H as Zo,Ha as Oe,I as $o,Ia as Ue,J as oe,Ja as We,K as ee,Ka as je,L as re,La as we,M as te,Ma as De,N as xe,Na as Le,O as me,Oa as Ne,P as pe,Pa as Ve,Q as ae,Qa as ze,R as ne,Ra as Xe,S as fe,Sa as qe,T as se,Ta as Ge,U as ce,Ua as He,V as ie,Va as Je,W as Ce,Wa as Ke,X as ue,Xa as Qe,Y as le,Ya as Ye,Z as de,Za as R,_ as ye,_a as S,a as Uo,aa as ke,b as Wo,ba as Ee,c as jo,ca as Fe,d as wo,da as Ie,e as Do,ea as m,f as Lo,fa as p,g as No,ga as a,h as Vo,ha as n,i as zo,ia as f,ja as s,ka as c,la as i,ma as C,na as u,oa as l,pa as d,qa as y,ra as g,s as Xo,sa as k,t as qo,ta as E,u as Go,ua as F,v as Ho,va as I,w as Jo,wa as Re,xa as Se,ya as Te,za as ve}from"./focused-chunks/chunk-L357ZAES.js";import{W as r,a as ko,b as Eo,c as Fo,d as Io,e as Ro,f as So,g as To,p as vo,q as Mo,r as Ao,s as ho,t as Po,u as _o,v as bo,w as Bo,x as Oo}from"./focused-chunks/chunk-XR745UGE.js";import"./focused-chunks/chunk-RQYVX2T6.js";import{Ja as e,ua as eo}from"./focused-chunks/chunk-WAP3DF4B.js";import{b as v,c as M,d as A,e as h,g as P,h as _,j as b}from"./focused-chunks/chunk-4ER3VMST.js";import"./focused-chunks/chunk-UQJ4PY2Y.js";import{a as fo,b as so,c as co,d as io,e as Co,f as uo,g as lo,h as yo,i as go}from"./focused-chunks/chunk-FM5WQ6ZU.js";import"./focused-chunks/chunk-BKPUUW5O.js";import{A as ao,B as no,s as o,u as ro,v as to,w as xo,x as mo,z as po}from"./focused-chunks/chunk-M57KDG7I.js";import"./focused-chunks/chunk-MZNV26XE.js";import"./focused-chunks/chunk-CWQLW4ZO.js";import"./focused-chunks/chunk-BWOVFE5B.js";import"./focused-chunks/chunk-X6CXWWNB.js";import{Af as $,Bf as oo,Ic as O,if as U,jf as W,kf as j,lf as w,mf as D,nf as L,of as N,pf as V,qf as z,rf as X,sc as B,sf as q,tf as G,uf as H,vf as J,wf as K,xf as Q,yf as Y,zf as Z}from"./focused-chunks/chunk-HXM7K6VH.js";import"./focused-chunks/chunk-NGHT2LNG.js";import"./focused-chunks/chunk-26P6C6OO.js";import"./focused-chunks/chunk-JFICNN4T.js";import"./focused-chunks/chunk-IRYNVGKH.js";export{so as ACTIONABILITY_ORDERING_KINDS,M as BRIEF_LIST_FIELDS,ee as CONTEXT_EVALUATION_METRIC_NAMES,m as CONTEXT_OUTPUT_VALUES,pe as CONTEXT_PACKING_PROFILES,Yo as CONTEXT_RELEVANCE_SERVICE,Ko as CONTEXT_RELEVANCE_SIGNAL_NAMES,fe as CONTEXT_SIGNAL_SET_VERSION,ne as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,se as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,X as CONTEXT_USAGE_LIMITS,ue as ContextSignalStore,q as ContextUsageValidationError,be as DEFAULT_CHILD_SAMPLE_LIMIT,v as DEFAULT_COMPACT_LIST_FIELDS,mo as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,de as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,R as EVAL_METRIC_NAMES,_ as GET_DEPTH_INPUT_VALUES,P as GET_DEPTH_VALUES,Ce as JsonFileContextSignalStoreAdapter,A as LIST_COMMAND_DEFAULT_PROJECTIONS,Ao as LIST_SORT_FIELDS,ho as LIST_SORT_ORDER_VALUES,_e as MAX_CHILD_PROJECTION_ITEMS,Re as NEXT_OUTPUT_VALUES,Xo as NEXT_RANKING_POLICIES,Uo as OutputEnvelopeFitError,jo as PM_COMPLETE_LIST_FINDING_CODES,wo as PmCompleteListValidationError,z as QUERY_CURSOR_CONTRACT,Oo as _testOnly,Pe as _testOnlyAggregateCommand,Ue as _testOnlyGetCommand,Te as _testOnlyNextCommand,Qe as _testOnlySearchCommand,po as acquireItemMetadataDerivedIndexLock,r as analyzeDuplicateItems,F as applyContextTagProjection,Po as applyFilterValueEcho,Vo as assertCompleteListResult,G as attachContextUsageServingReceipt,y as buildChildrenByParent,Xe as buildCompactSearchFilterSummary,_o as buildContentFilterEcho,ie as buildContextSignalSnapshot,bo as buildGovernanceMissingFilterEcho,Be as buildItemChildrenRollup,Qo as buildItemContextRelevanceCandidates,qe as buildVerboseSearchFilters,ye as buildWorkspaceMemorySnapshot,No as certifyCompleteListResult,He as classifyImplicitSemanticFallbackReason,co as collectBlockedByIds,Co as collectBlockedByIdsFromCorpus,J as collectContextUsageDeliveredItemIds,lo as collectDependencyBlockedIds,Ge as collectErrorCauseCodes,i as collectSubtreeIds,C as compareCriticalItems,go as computeActionabilityReport,Do as createCompleteListOptions,W as createQueryFingerprint,Ve as createSearchCursorFingerprint,L as decodeQueryCursor,w as decodeQueryCursorEnvelope,D as decodeQueryCursorState,Zo as defaultScoreContextCandidates,j as encodeQueryCursor,re as evaluateContextRanking,T as evaluateMetricFloors,e as executeEmbeddingBatchesWithRetry,K as finalizeContextUsageDelivery,Wo as fitOutputEnvelope,Ke as formatVectorIndexRecoveryWarnings,io as indexBlockedByIds,Lo as inspectCompleteListResult,b as listGetProjectionFields,h as listListProjectionFields,o as measureItemMetadataReadWork,k as mergeSortedWarnings,ae as packContextCandidates,u as packRankedContextItems,V as paginateQueryRows,s as parseContextDepth,p as parseContextFocusFields,c as parseContextSections,ce as parseContextSignalSnapshot,S as parseEvalMetricFloors,ko as parseIntegerLimit,eo as parseLimit,Io as parseMultiValueFilter,Eo as parsePriority,To as parsePriorityFilterSet,Ro as parseStringFilterSet,Fo as parseType,So as parseTypeFilterSet,ve as partitionDecisionEntries,a as projectContextFocusRows,H as propagateContextUsageServingReceipt,ro as queryItemMetadataIndex,to as queryLinkedFileMetadataIndex,xo as querySimilarItemMetadataIndex,oo as readContextUsageAffinity,B as readHistoryEntries,ao as readItemMetadataDerivedIndexState,x as readRecentActivity,le as readWorkspaceContextSignals,ge as readWorkspaceMemory,Y as recordContextUsageDelivery,Q as recordContextUsageServing,Z as recordContextUsageTouch,$ as recordContextUsageTouches,no as refreshItemMetadataDerivedIndex,Go as renderCalendarMarkdown,Ho as renderCalendarToon,E as renderContextMarkdown,Ae as renderNextMarkdown,qo as resolveCalendarOutputFormat,Mo as resolveContentFieldFilters,n as resolveContextOutputFormat,f as resolveContextTokenBudget,we as resolveEffectiveSearchMode,Le as resolveHybridSemanticWeight,uo as resolveItemBlockers,fo as resolveItemExecutionRole,vo as resolveMissingMetadataFilters,Se as resolveNextOutputFormat,N as resolveQueryCursorStart,je as resolveSearchMaxResults,ze as resolveSearchPage,De as resolveSearchScoreThreshold,Ne as resolveSearchTuning,Je as resolveVectorIndexRecovery,t as runActivity,he as runAggregate,Jo as runCalendar,I as runContext,me as runContextEvaluationCorpus,te as runContextEvaluationScenario,zo as runDuplicates,Oe as runGet,We as runHistory,Bo as runList,Me as runNext,Ye as runSearch,$o as scoreContextCandidates,oe as scoreContextCandidatesWithActiveExtensions,Fe as searchWorkspaceMemory,Ie as searchWorkspaceMemoryReadResult,yo as selectActionableEntries,U as selectCursorSemanticOptions,Ee as selectWorkspaceMemory,ke as selectWorkspaceMemoryRollups,xe as summarizeContextEvaluationReports,g as toContextFocusItem,l as toContextPackingSummary,d as toContextRankingSummary,O as verifyHistoryChain};
2
2
  //# sourceMappingURL=sdk-query.js.map
@@ -1,2 +1,2 @@
1
- import{$a as Dc,$b as Dd,Aa as Zb,Ab as cd,Ac as ce,Ba as _b,Bb as dd,Ca as $b,Cb as ed,Da as ac,Db as fd,Ea as bc,Eb as gd,Fa as cc,Fb as hd,Ga as dc,Gb as id,Ha as ec,Hb as jd,Ia as fc,Ib as kd,Ja as gc,Jb as ld,Ka as hc,Kb as md,La as ic,Lb as nd,Ma as jc,Mb as od,Na as kc,Nb as pd,Oa as lc,Ob as qd,Pa as mc,Pb as rd,Qa as nc,Qb as sd,R as Gb,Ra as oc,Rb as td,S as Hb,Sa as pc,Sb as ud,T as Ib,Ta as qc,Tb as vd,U as Jb,Ua as rc,Ub as wd,Va as sc,Vb as xd,Wa as yc,Wb as yd,Xa as zc,Xb as zd,Ya as Ac,Yb as Ad,Za as Bc,Zb as Bd,_a as Cc,_b as Cd,ab as Ec,ac as Ed,bb as Fc,bc as Fd,cb as Gc,cc as Gd,db as Hc,dc as Hd,eb as Ic,ec as Id,fb as Jc,fc as Jd,gb as Kc,gc as Kd,hb as Lc,hc as Ld,ia as Ob,ib as Mc,ic as Md,ja as Pb,jb as Nc,jc as Nd,kb as Oc,kc as Od,lb as Pc,lc as Pd,mb as Qc,mc as Qd,n as db,nb as Rc,nc as Rd,o as eb,ob as Sc,oc as Sd,p as fb,pb as Tc,pc as Td,q as gb,qb as Uc,qc as Ud,r as hb,ra as Qb,rb as Vc,rc as Vd,sa as Rb,sb as Wc,sc as Wd,ta as Sb,tb as Xc,tc as Xd,ua as Tb,ub as Yc,uc as Yd,va as Ub,vb as Zc,vc as Zd,w as pb,wa as Vb,wb as _c,wc as _d,x as qb,xa as Wb,xb as $c,xc as $d,y as rb,ya as Xb,yb as ad,yc as ae,z as tb,za as Yb,zb as bd,zc as be}from"./chunks/chunk-3US5T6B2.js";import"./chunks/chunk-CV2B4JUB.js";import{L as Mb,m as Fb,n as Kb,u as Lb}from"./chunks/chunk-Q6GIFUCW.js";import{$c as uc,Nb as jb,Ob as kb,Pb as lb,Rb as mb,Tb as nb,Ub as ob,Uc as Nb,Xa as ib,_c as tc,ad as vc,bd as wc,cd as xc,jc as sb,rc as Cb,sc as Db,tc as Eb}from"./chunks/chunk-L7HON3BE.js";import{Ab as ub,Bb as vb,Cb as wb,Db as xb,Jc as zb,Kc as Ab,Oc as Bb,U as Va,sc as yb}from"./chunks/chunk-KCR4NF2A.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import"./chunks/chunk-VI3A7UZ2.js";import"./chunks/chunk-WNB62BGK.js";import{s as _a,t as $a,v as ab,w as bb,x as cb}from"./chunks/chunk-JFPCL45G.js";import"./chunks/chunk-JQHLOSSS.js";import"./chunks/chunk-6H36ZHMI.js";import"./chunks/chunk-3TK2YOVB.js";import{a as Wa,b as Xa,e as Ya,f as Za}from"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import"./chunks/chunk-R6M5OGJH.js";import"./chunks/chunk-4EBHZBM2.js";import"./chunks/chunk-WLZ5KVM2.js";import"./chunks/chunk-PZA7QECY.js";import{Mc as Sa,Nc as Ta,Pc as Ua,Za as Fa,bc as Ka,cc as La,dc as Ma,ec as Na,fa as za,ga as Aa,gc as Oa,ha as Ba,i as n,ic as Pa,kc as Qa,lc as Ra,mb as Ga,nb as Ha,oa as Ca,pa as Da,pb as Ia,qb as Ja}from"./chunks/chunk-PY6A7ULK.js";import{u as Ea}from"./chunks/chunk-3E53F7QY.js";import"./chunks/chunk-3AZOATC2.js";import{Aa as L,Ba as M,Ca as N,Da as O,Ea as P,Ga as Q,Sa as R,Ta as S,Va as T,Wa as U,a as c,ah as wa,b as d,bd as aa,c as e,cd as ba,d as f,dd as ca,e as g,ed as da,f as h,fb as V,fd as ea,g as i,gb as W,gd as fa,h as j,hd as ga,i as k,id as ha,j as l,jc as X,jd as ia,k as m,kc as Y,kd as ja,lc as Z,ld as ka,lh as xa,mc as _,md as la,mf as ua,nd as ma,nf as va,od as na,pd as oa,ph as ya,qd as pa,rd as qa,sd as ra,td as sa,ud as ta,xa as J,ya as K,yc as $}from"./chunks/chunk-RWHS77ME.js";import{g as z,m as A,o as B,r as C,s as D,u as E}from"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-CNZOC6JD.js";import"./chunks/chunk-NRCGGNOE.js";import{Q as F,R as G}from"./chunks/chunk-JV7LREUF.js";import{a as s,b as t,ba as H,c as u,da as I,h as v,j as w,k as x,l as y}from"./chunks/chunk-TE6FBDHP.js";import{A as a,C as b,E as o,H as p,L as q,N as r}from"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";export{J as BASELINE_ITEM_FORMAT_VERSION,s as BUILTIN_ITEM_TYPE_VALUES,y as CONFIDENCE_TEXT_VALUES,yb as CONTEXT_OUTPUT_VALUES,K as CURRENT_ITEM_FORMAT_VERSION,jb as DEFAULT_TERMINAL_TRANSITION_POLICY,v as DEPENDENCY_KIND_VALUES,a as EXIT_CODE,X as HISTORY_EVENT_CLASSIFICATION_VERSION,x as ISSUE_SEVERITY_VALUES,t as ITEM_TYPE_VALUES,Y as MAINTENANCE_HISTORY_OPERATIONS,d as MAX_WORKFLOW_POLICIES,e as MAX_WORKFLOW_POLICY_TERMS,Ab as NEXT_OUTPUT_VALUES,Ka as PM_CLI_ERROR_DETAILS_LIMITS,Pa as PM_CLI_EXPECTED_ERROR_NAME,ia as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,da as PM_DIAGNOSTIC_DEGRADATION_STEPS,ea as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,ca as PM_DIAGNOSTIC_OUTPUT_CLASSES,oa as PM_GENERIC_REFUSAL_GUIDANCE,Xa as PM_GITIGNORE_END,Wa as PM_GITIGNORE_START,ba as PM_OUTPUT_BUDGET_CLASSES,aa as PM_OUTPUT_DEGRADATION_STEPS,sa as PM_RECOVERY_ECHO_FIELDS,b as PmCliError,yc as PmClient,db as PmCompleteListValidationError,w as RISK_VALUES,Qb as SEARCH_EXTENSION_FLAG_DEFINITIONS,u as STATUS_VALUES,Z as SUBSTANTIVE_HISTORY_OPERATIONS,c as WORKFLOW_POLICY_ACTIONS,$a as WORKFLOW_POLICY_DOCUMENT_SCHEMA,_a as WORKFLOW_POLICY_SCHEMA,V as acquireLock,W as acquireLockLease,Fc as aggregate,ce as analyzeSdkActionCoverage,Rc as append,va as appendHistoryEntry,mb as applyTerminalOrderingPolicy,hb as assertCompleteListResult,ab as buildWorkflowCompletenessCheck,U as canonicalDocument,gb as certifyCompleteListResult,Ad as claim,Bd as claimNext,_ as classifyHistoryEvent,N as classifyItemFormatVersion,Pb as clearWorkspaceContractsCache,zd as close,nb as closeItem,Jd as closeTask,Ic as comments,nc as commitImportedItem,Tc as config,zc as context,Dd as copy,wd as create,eb as createCompleteListOptions,ua as createHistoryEntry,bb as createLifecycleCompletenessPolicies,Qa as createPmCliExpectedError,ga as createPmCommandOutputBudget,m as createWorkflowPolicyEvaluator,ha as definePmCommandOutputBudget,Ed as deleteItem,Pc as deps,Oc as docs,Hc as duplicates,L as effectiveItemFormatVersion,mc as emptyImportedDocument,Za as ensurePmGitignore,lc as ensureTrackerInitialized,ka as estimatePmOutputTokens,l as evaluateWorkflowPolicies,Kd as extension,Md as extensionActivate,Nd as extensionDeactivate,Ld as extensionList,Lc as files,Mc as filesDiscover,Nc as filesLookup,Gd as focus,qd as gc,Ba as generateItemId,Dc as get,wa as getActiveExtensionRegistrations,_d as getContracts,E as getHistoryPath,D as getItemPath,Ya as getPmGitignoreBlock,C as getSettingsPath,Rb as getWorkspaceContracts,Qc as graph,pd as health,ud as historyCompact,vd as historyCompactBulk,rd as historyRedact,sd as historyRepair,td as historyRepairAll,fa as inferPmOutputBudgetClass,Sc as init,fb as inspectCompleteListResult,pa as isGenericRefusalRequired,qa as isGenericRefusalWhy,La as isPmCliErrorDetails,Ra as isPmCliExpectedError,Q as isTerminalStatus,G as isTimestampLiteral,$ as jaccardSimilarity,Kc as learnings,Ac as list,Bc as listAllComplete,Ia as listAllItemMetadata,Ja as listAllItemMetadataLight,Gb as loadCreateTemplateOptions,Ga as locateItem,Ec as next,M as normalizeItemFormatVersion,Aa as normalizeItemId,R as normalizeItemMetadata,za as normalizeRawItemId,Sa as normalizeSimilarityText,P as normalizeStatusInput,Jc as notes,F as nowIso,Xd as packageActivate,Wd as packageCatalog,Yd as packageDeactivate,Ud as packageDescribe,Sd as packageDoctor,Qd as packageInstall,Od as packageLifecycle,Pd as packageList,Td as packageManage,Vd as packageReload,Rd as packageUninstall,n as parseTags,f as parseWorkflowPolicy,g as parseWorkflowPolicyDocument,o as pathExists,Id as pauseTask,jd as profile,md as profileApply,nd as profileLint,kd as profileList,ld as profileShow,ta as projectLeanRecoveryPayload,Oa as projectPmCliErrorContextDetails,Ma as projectPmCliErrorDetails,ma as projectPmDiagnosticOutput,na as projectPmDiagnosticText,Tb as readBooleanOption,Ub as readCsvListOption,p as readFileIfExists,Ha as readLocatedItem,Ob as readRequiredString,Ea as readSettings,Sb as readStringOption,Fa as readWorkflowPolicies,h as readWorkflowPolicyField,Cd as release,r as removeFileIfExists,vb as renderCalendarMarkdown,wb as renderCalendarToon,qc as renderGuideMarkdown,yd as reopen,lb as requireTerminalReason,ub as resolveCalendarOutputFormat,oc as resolveGuideOutputFormat,A as resolveImplicitPmRoot,z as resolveItemTypeRegistry,ja as resolvePmCommandOutputBudget,la as resolvePmDiagnosticOutputBudget,B as resolvePmRoot,I as resolveRuntimeFieldRegistry,H as resolveRuntimeStatusRegistry,kb as resolveTerminalReason,Fd as restore,be as runAction,ya as runActiveOnReadHooks,xa as runActiveOnWriteHooks,Kb as runAggregate,xb as runCalendar,ob as runClose,Eb as runCloseTask,rc as runCompletion,zb as runContext,pb as runCopy,qb as runDelete,ib as runDuplicates,rb as runFocus,Lb as runGet,pc as runGuide,ae as runInActiveExtensionScope,Va as runList,Bb as runNext,Db as runPauseTask,sc as runReindex,tb as runReopen,Fb as runRestore,Mb as runSearch,Cb as runStartTask,Nb as runStats,Ib as runTemplatesList,Hb as runTemplatesSave,Jb as runTemplatesShow,tc as runTestRunsList,vc as runTestRunsLogs,xc as runTestRunsResume,uc as runTestRunsStatus,wc as runTestRunsStop,sb as runUpdate,$d as runWithActiveExtensions,cb as runWorkflowPolicyAction,O as scanItemFormatVersions,Uc as schema,$c as schemaAddField,Zc as schemaAddStatus,Xc as schemaAddType,dd as schemaApplyPreset,ed as schemaInferTypes,Vc as schemaList,bd as schemaListFields,hd as schemaRemapStatus,ad as schemaRemoveField,_c as schemaRemoveStatus,Yc as schemaRemoveType,gd as schemaRenameField,fd as schemaRenameType,Wc as schemaShow,cd as schemaShowField,id as schemaShowStatus,Ua as scoreItemSimilarity,Cc as search,kc as selectImportAuthor,T as serializeItemDocument,Na as snapshotPmCliErrorContext,S as splitFrontMatter,Hd as startTask,Gc as stats,Wb as toEstimatedMinutesValue,$b as toImportBoolean,dc as toImportConfidence,ic as toImportDeferredFields,_b as toImportInteger,hc as toImportLinkedDocs,gc as toImportLinkedFiles,jc as toImportLinkedTests,fc as toImportLogEntries,ec as toImportNormalizedEnum,cc as toImportNumberMap,Xb as toImportPriority,Zb as toImportStatus,ac as toImportStringList,bc as toImportStringMap,Yb as toImportTags,Vb as toNonEmptyImportString,Ta as tokenizeSimilarityText,xd as update,Zd as upgrade,od as validate,Ca as withCliMutationInput,Da as withLiteralMutationInput,ra as withoutGenericRefusalExamples,j as workflowApprovalFingerprint,k as workflowPolicyApplies,i as workflowPolicyFingerprint,q as writeFileAtomic};
1
+ import{$a as Dc,$b as Dd,Aa as Zb,Ab as cd,Ac as ce,Ba as _b,Bb as dd,Ca as $b,Cb as ed,Da as ac,Db as fd,Ea as bc,Eb as gd,Fa as cc,Fb as hd,Ga as dc,Gb as id,Ha as ec,Hb as jd,Ia as fc,Ib as kd,Ja as gc,Jb as ld,Ka as hc,Kb as md,La as ic,Lb as nd,Ma as jc,Mb as od,Na as kc,Nb as pd,Oa as lc,Ob as qd,Pa as mc,Pb as rd,Qa as nc,Qb as sd,R as Gb,Ra as oc,Rb as td,S as Hb,Sa as pc,Sb as ud,T as Ib,Ta as qc,Tb as vd,U as Jb,Ua as rc,Ub as wd,Va as sc,Vb as xd,Wa as yc,Wb as yd,Xa as zc,Xb as zd,Ya as Ac,Yb as Ad,Za as Bc,Zb as Bd,_a as Cc,_b as Cd,ab as Ec,ac as Ed,bb as Fc,bc as Fd,cb as Gc,cc as Gd,db as Hc,dc as Hd,eb as Ic,ec as Id,fb as Jc,fc as Jd,gb as Kc,gc as Kd,hb as Lc,hc as Ld,ia as Ob,ib as Mc,ic as Md,ja as Pb,jb as Nc,jc as Nd,kb as Oc,kc as Od,lb as Pc,lc as Pd,mb as Qc,mc as Qd,n as db,nb as Rc,nc as Rd,o as eb,ob as Sc,oc as Sd,p as fb,pb as Tc,pc as Td,q as gb,qb as Uc,qc as Ud,r as hb,ra as Qb,rb as Vc,rc as Vd,sa as Rb,sb as Wc,sc as Wd,ta as Sb,tb as Xc,tc as Xd,ua as Tb,ub as Yc,uc as Yd,va as Ub,vb as Zc,vc as Zd,w as pb,wa as Vb,wb as _c,wc as _d,x as qb,xa as Wb,xb as $c,xc as $d,y as rb,ya as Xb,yb as ad,yc as ae,z as tb,za as Yb,zb as bd,zc as be}from"./chunks/chunk-NZSXWIX7.js";import"./chunks/chunk-CCKM5YQM.js";import{L as Mb,m as Fb,n as Kb,u as Lb}from"./chunks/chunk-2SBTXR6C.js";import{$c as uc,Nb as jb,Ob as kb,Pb as lb,Rb as mb,Tb as nb,Ub as ob,Uc as Nb,Xa as ib,_c as tc,ad as vc,bd as wc,cd as xc,jc as sb,rc as Cb,sc as Db,tc as Eb}from"./chunks/chunk-WFYE34TO.js";import{Ab as ub,Bb as vb,Cb as wb,Db as xb,Jc as zb,Kc as Ab,Oc as Bb,U as Va,sc as yb}from"./chunks/chunk-ZA5NS3PL.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import"./chunks/chunk-Q4VZSMUL.js";import"./chunks/chunk-TY55UX6M.js";import{s as _a,t as $a,v as ab,w as bb,x as cb}from"./chunks/chunk-IGEFPHV7.js";import"./chunks/chunk-DCWGM7CY.js";import"./chunks/chunk-6H36ZHMI.js";import"./chunks/chunk-AOTI76Q6.js";import{a as Wa,b as Xa,e as Ya,f as Za}from"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import"./chunks/chunk-KCVSSONY.js";import"./chunks/chunk-USBTXMKS.js";import"./chunks/chunk-5PNOVDVO.js";import"./chunks/chunk-PZA7QECY.js";import{Mc as Sa,Nc as Ta,Pc as Ua,Za as Fa,bc as Ka,cc as La,dc as Ma,ec as Na,fa as za,ga as Aa,gc as Oa,ha as Ba,i as n,ic as Pa,kc as Qa,lc as Ra,mb as Ga,nb as Ha,oa as Ca,pa as Da,pb as Ia,qb as Ja}from"./chunks/chunk-3TXEWHQX.js";import{u as Ea}from"./chunks/chunk-KXTKLDKD.js";import"./chunks/chunk-3AZOATC2.js";import{Aa as L,Ba as M,Ca as N,Da as O,Ea as P,Ga as Q,Sa as R,Ta as S,Va as T,Wa as U,a as c,ah as wa,b as d,bd as aa,c as e,cd as ba,d as f,dd as ca,e as g,ed as da,f as h,fb as V,fd as ea,g as i,gb as W,gd as fa,h as j,hd as ga,i as k,id as ha,j as l,jc as X,jd as ia,k as m,kc as Y,kd as ja,lc as Z,ld as ka,lh as xa,mc as _,md as la,mf as ua,nd as ma,nf as va,od as na,pd as oa,ph as ya,qd as pa,rd as qa,sd as ra,td as sa,ud as ta,xa as J,ya as K,yc as $}from"./chunks/chunk-SJWIPGZW.js";import{g as z,m as A,o as B,r as C,s as D,u as E}from"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-NVYDPNQP.js";import"./chunks/chunk-JPJNJHQW.js";import{Q as F,R as G}from"./chunks/chunk-VCXQ6A35.js";import{a as s,b as t,ba as H,c as u,da as I,h as v,j as w,k as x,l as y}from"./chunks/chunk-TE6FBDHP.js";import{A as a,C as b,E as o,H as p,L as q,N as r}from"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";export{J as BASELINE_ITEM_FORMAT_VERSION,s as BUILTIN_ITEM_TYPE_VALUES,y as CONFIDENCE_TEXT_VALUES,yb as CONTEXT_OUTPUT_VALUES,K as CURRENT_ITEM_FORMAT_VERSION,jb as DEFAULT_TERMINAL_TRANSITION_POLICY,v as DEPENDENCY_KIND_VALUES,a as EXIT_CODE,X as HISTORY_EVENT_CLASSIFICATION_VERSION,x as ISSUE_SEVERITY_VALUES,t as ITEM_TYPE_VALUES,Y as MAINTENANCE_HISTORY_OPERATIONS,d as MAX_WORKFLOW_POLICIES,e as MAX_WORKFLOW_POLICY_TERMS,Ab as NEXT_OUTPUT_VALUES,Ka as PM_CLI_ERROR_DETAILS_LIMITS,Pa as PM_CLI_EXPECTED_ERROR_NAME,ia as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,da as PM_DIAGNOSTIC_DEGRADATION_STEPS,ea as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,ca as PM_DIAGNOSTIC_OUTPUT_CLASSES,oa as PM_GENERIC_REFUSAL_GUIDANCE,Xa as PM_GITIGNORE_END,Wa as PM_GITIGNORE_START,ba as PM_OUTPUT_BUDGET_CLASSES,aa as PM_OUTPUT_DEGRADATION_STEPS,sa as PM_RECOVERY_ECHO_FIELDS,b as PmCliError,yc as PmClient,db as PmCompleteListValidationError,w as RISK_VALUES,Qb as SEARCH_EXTENSION_FLAG_DEFINITIONS,u as STATUS_VALUES,Z as SUBSTANTIVE_HISTORY_OPERATIONS,c as WORKFLOW_POLICY_ACTIONS,$a as WORKFLOW_POLICY_DOCUMENT_SCHEMA,_a as WORKFLOW_POLICY_SCHEMA,V as acquireLock,W as acquireLockLease,Fc as aggregate,ce as analyzeSdkActionCoverage,Rc as append,va as appendHistoryEntry,mb as applyTerminalOrderingPolicy,hb as assertCompleteListResult,ab as buildWorkflowCompletenessCheck,U as canonicalDocument,gb as certifyCompleteListResult,Ad as claim,Bd as claimNext,_ as classifyHistoryEvent,N as classifyItemFormatVersion,Pb as clearWorkspaceContractsCache,zd as close,nb as closeItem,Jd as closeTask,Ic as comments,nc as commitImportedItem,Tc as config,zc as context,Dd as copy,wd as create,eb as createCompleteListOptions,ua as createHistoryEntry,bb as createLifecycleCompletenessPolicies,Qa as createPmCliExpectedError,ga as createPmCommandOutputBudget,m as createWorkflowPolicyEvaluator,ha as definePmCommandOutputBudget,Ed as deleteItem,Pc as deps,Oc as docs,Hc as duplicates,L as effectiveItemFormatVersion,mc as emptyImportedDocument,Za as ensurePmGitignore,lc as ensureTrackerInitialized,ka as estimatePmOutputTokens,l as evaluateWorkflowPolicies,Kd as extension,Md as extensionActivate,Nd as extensionDeactivate,Ld as extensionList,Lc as files,Mc as filesDiscover,Nc as filesLookup,Gd as focus,qd as gc,Ba as generateItemId,Dc as get,wa as getActiveExtensionRegistrations,_d as getContracts,E as getHistoryPath,D as getItemPath,Ya as getPmGitignoreBlock,C as getSettingsPath,Rb as getWorkspaceContracts,Qc as graph,pd as health,ud as historyCompact,vd as historyCompactBulk,rd as historyRedact,sd as historyRepair,td as historyRepairAll,fa as inferPmOutputBudgetClass,Sc as init,fb as inspectCompleteListResult,pa as isGenericRefusalRequired,qa as isGenericRefusalWhy,La as isPmCliErrorDetails,Ra as isPmCliExpectedError,Q as isTerminalStatus,G as isTimestampLiteral,$ as jaccardSimilarity,Kc as learnings,Ac as list,Bc as listAllComplete,Ia as listAllItemMetadata,Ja as listAllItemMetadataLight,Gb as loadCreateTemplateOptions,Ga as locateItem,Ec as next,M as normalizeItemFormatVersion,Aa as normalizeItemId,R as normalizeItemMetadata,za as normalizeRawItemId,Sa as normalizeSimilarityText,P as normalizeStatusInput,Jc as notes,F as nowIso,Xd as packageActivate,Wd as packageCatalog,Yd as packageDeactivate,Ud as packageDescribe,Sd as packageDoctor,Qd as packageInstall,Od as packageLifecycle,Pd as packageList,Td as packageManage,Vd as packageReload,Rd as packageUninstall,n as parseTags,f as parseWorkflowPolicy,g as parseWorkflowPolicyDocument,o as pathExists,Id as pauseTask,jd as profile,md as profileApply,nd as profileLint,kd as profileList,ld as profileShow,ta as projectLeanRecoveryPayload,Oa as projectPmCliErrorContextDetails,Ma as projectPmCliErrorDetails,ma as projectPmDiagnosticOutput,na as projectPmDiagnosticText,Tb as readBooleanOption,Ub as readCsvListOption,p as readFileIfExists,Ha as readLocatedItem,Ob as readRequiredString,Ea as readSettings,Sb as readStringOption,Fa as readWorkflowPolicies,h as readWorkflowPolicyField,Cd as release,r as removeFileIfExists,vb as renderCalendarMarkdown,wb as renderCalendarToon,qc as renderGuideMarkdown,yd as reopen,lb as requireTerminalReason,ub as resolveCalendarOutputFormat,oc as resolveGuideOutputFormat,A as resolveImplicitPmRoot,z as resolveItemTypeRegistry,ja as resolvePmCommandOutputBudget,la as resolvePmDiagnosticOutputBudget,B as resolvePmRoot,I as resolveRuntimeFieldRegistry,H as resolveRuntimeStatusRegistry,kb as resolveTerminalReason,Fd as restore,be as runAction,ya as runActiveOnReadHooks,xa as runActiveOnWriteHooks,Kb as runAggregate,xb as runCalendar,ob as runClose,Eb as runCloseTask,rc as runCompletion,zb as runContext,pb as runCopy,qb as runDelete,ib as runDuplicates,rb as runFocus,Lb as runGet,pc as runGuide,ae as runInActiveExtensionScope,Va as runList,Bb as runNext,Db as runPauseTask,sc as runReindex,tb as runReopen,Fb as runRestore,Mb as runSearch,Cb as runStartTask,Nb as runStats,Ib as runTemplatesList,Hb as runTemplatesSave,Jb as runTemplatesShow,tc as runTestRunsList,vc as runTestRunsLogs,xc as runTestRunsResume,uc as runTestRunsStatus,wc as runTestRunsStop,sb as runUpdate,$d as runWithActiveExtensions,cb as runWorkflowPolicyAction,O as scanItemFormatVersions,Uc as schema,$c as schemaAddField,Zc as schemaAddStatus,Xc as schemaAddType,dd as schemaApplyPreset,ed as schemaInferTypes,Vc as schemaList,bd as schemaListFields,hd as schemaRemapStatus,ad as schemaRemoveField,_c as schemaRemoveStatus,Yc as schemaRemoveType,gd as schemaRenameField,fd as schemaRenameType,Wc as schemaShow,cd as schemaShowField,id as schemaShowStatus,Ua as scoreItemSimilarity,Cc as search,kc as selectImportAuthor,T as serializeItemDocument,Na as snapshotPmCliErrorContext,S as splitFrontMatter,Hd as startTask,Gc as stats,Wb as toEstimatedMinutesValue,$b as toImportBoolean,dc as toImportConfidence,ic as toImportDeferredFields,_b as toImportInteger,hc as toImportLinkedDocs,gc as toImportLinkedFiles,jc as toImportLinkedTests,fc as toImportLogEntries,ec as toImportNormalizedEnum,cc as toImportNumberMap,Xb as toImportPriority,Zb as toImportStatus,ac as toImportStringList,bc as toImportStringMap,Yb as toImportTags,Vb as toNonEmptyImportString,Ta as tokenizeSimilarityText,xd as update,Zd as upgrade,od as validate,Ca as withCliMutationInput,Da as withLiteralMutationInput,ra as withoutGenericRefusalExamples,j as workflowApprovalFingerprint,k as workflowPolicyApplies,i as workflowPolicyFingerprint,q as writeFileAtomic};
2
2
  //# sourceMappingURL=sdk-runtime.js.map
@@ -1,2 +1,2 @@
1
- import{A as t,B as u,C as v,D as w,E as x,F as y,G as z,H as A,I as B,J as C,K as D,L as E,M as F,N as G,O as H,P as I,Q as J,R as K,S as L,T as M,U as N,V as O,W as P,X as Q,Y as R,Z as S,_ as T,f as c,g as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m,u as n,v as o,w as p,x as q,y as r,z as s}from"./chunks/chunk-FRYNDVLN.js";import"./chunks/chunk-3US5T6B2.js";import"./chunks/chunk-CV2B4JUB.js";import"./chunks/chunk-Q6GIFUCW.js";import"./chunks/chunk-L7HON3BE.js";import"./chunks/chunk-KCR4NF2A.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import"./chunks/chunk-VI3A7UZ2.js";import"./chunks/chunk-WNB62BGK.js";import{la as b,n as a}from"./chunks/chunk-JFPCL45G.js";import"./chunks/chunk-JQHLOSSS.js";import"./chunks/chunk-6H36ZHMI.js";import"./chunks/chunk-3TK2YOVB.js";import"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import"./chunks/chunk-R6M5OGJH.js";import"./chunks/chunk-4EBHZBM2.js";import"./chunks/chunk-WLZ5KVM2.js";import"./chunks/chunk-PZA7QECY.js";import"./chunks/chunk-PY6A7ULK.js";import"./chunks/chunk-3E53F7QY.js";import"./chunks/chunk-3AZOATC2.js";import"./chunks/chunk-RWHS77ME.js";import"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-CNZOC6JD.js";import"./chunks/chunk-NRCGGNOE.js";import"./chunks/chunk-JV7LREUF.js";import"./chunks/chunk-TE6FBDHP.js";import"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";export{e as activateExtensionForTest,M as assertExtensionBlueprint,L as assertExtensionCapabilityUsage,t as assertExtensionDeactivated,P as assertExtensionManifestCompatible,O as assertExtensionManifestMatchesBlueprint,Q as assertExtensionPreflight,u as assertPackageManifest,N as assertProjectProfile,v as assertRegisteredCommandContract,F as assertRegisteredCommandOverride,B as assertRegisteredExporter,w as assertRegisteredFlags,x as assertRegisteredHook,A as assertRegisteredImporter,C as assertRegisteredItemField,D as assertRegisteredItemType,K as assertRegisteredMigration,G as assertRegisteredParserOverride,H as assertRegisteredPreflightOverride,E as assertRegisteredProfile,I as assertRegisteredRendererOverride,y as assertRegisteredSearchProvider,J as assertRegisteredServiceOverride,z as assertRegisteredVectorStoreAdapter,R as createExtensionTestHarness,f as deactivateExtensionForTest,S as decodeToon,a as describeExtensionActivation,c as describeExtensionBlueprint,T as encodeToon,d as lintExtensionBlueprint,b as renderExtensionSurfaceMarkdown,g as runRegisteredCommandForTest,l as runRegisteredCommandOverrideForTest,s as runRegisteredExporterForTest,i as runRegisteredHookForTest,r as runRegisteredImporterForTest,q as runRegisteredMigrationForTest,h as runRegisteredMutationGuardForTest,j as runRegisteredParserOverrideForTest,k as runRegisteredPreflightOverrideForTest,m as runRegisteredRendererOverrideForTest,o as runRegisteredSearchProviderForTest,n as runRegisteredServiceOverrideForTest,p as runRegisteredVectorStoreAdapterForTest};
1
+ import{A as t,B as u,C as v,D as w,E as x,F as y,G as z,H as A,I as B,J as C,K as D,L as E,M as F,N as G,O as H,P as I,Q as J,R as K,S as L,T as M,U as N,V as O,W as P,X as Q,Y as R,Z as S,_ as T,f as c,g as d,l as e,m as f,n as g,o as h,p as i,q as j,r as k,s as l,t as m,u as n,v as o,w as p,x as q,y as r,z as s}from"./chunks/chunk-FR7ULTM4.js";import"./chunks/chunk-NZSXWIX7.js";import"./chunks/chunk-CCKM5YQM.js";import"./chunks/chunk-2SBTXR6C.js";import"./chunks/chunk-WFYE34TO.js";import"./chunks/chunk-ZA5NS3PL.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import"./chunks/chunk-Q4VZSMUL.js";import"./chunks/chunk-TY55UX6M.js";import{la as b,n as a}from"./chunks/chunk-IGEFPHV7.js";import"./chunks/chunk-DCWGM7CY.js";import"./chunks/chunk-6H36ZHMI.js";import"./chunks/chunk-AOTI76Q6.js";import"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import"./chunks/chunk-KCVSSONY.js";import"./chunks/chunk-USBTXMKS.js";import"./chunks/chunk-5PNOVDVO.js";import"./chunks/chunk-PZA7QECY.js";import"./chunks/chunk-3TXEWHQX.js";import"./chunks/chunk-KXTKLDKD.js";import"./chunks/chunk-3AZOATC2.js";import"./chunks/chunk-SJWIPGZW.js";import"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-NVYDPNQP.js";import"./chunks/chunk-JPJNJHQW.js";import"./chunks/chunk-VCXQ6A35.js";import"./chunks/chunk-TE6FBDHP.js";import"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";export{e as activateExtensionForTest,M as assertExtensionBlueprint,L as assertExtensionCapabilityUsage,t as assertExtensionDeactivated,P as assertExtensionManifestCompatible,O as assertExtensionManifestMatchesBlueprint,Q as assertExtensionPreflight,u as assertPackageManifest,N as assertProjectProfile,v as assertRegisteredCommandContract,F as assertRegisteredCommandOverride,B as assertRegisteredExporter,w as assertRegisteredFlags,x as assertRegisteredHook,A as assertRegisteredImporter,C as assertRegisteredItemField,D as assertRegisteredItemType,K as assertRegisteredMigration,G as assertRegisteredParserOverride,H as assertRegisteredPreflightOverride,E as assertRegisteredProfile,I as assertRegisteredRendererOverride,y as assertRegisteredSearchProvider,J as assertRegisteredServiceOverride,z as assertRegisteredVectorStoreAdapter,R as createExtensionTestHarness,f as deactivateExtensionForTest,S as decodeToon,a as describeExtensionActivation,c as describeExtensionBlueprint,T as encodeToon,d as lintExtensionBlueprint,b as renderExtensionSurfaceMarkdown,g as runRegisteredCommandForTest,l as runRegisteredCommandOverrideForTest,s as runRegisteredExporterForTest,i as runRegisteredHookForTest,r as runRegisteredImporterForTest,q as runRegisteredMigrationForTest,h as runRegisteredMutationGuardForTest,j as runRegisteredParserOverrideForTest,k as runRegisteredPreflightOverrideForTest,m as runRegisteredRendererOverrideForTest,o as runRegisteredSearchProviderForTest,n as runRegisteredServiceOverrideForTest,p as runRegisteredVectorStoreAdapterForTest};
2
2
  //# sourceMappingURL=sdk-testing.js.map
@@ -1,4 +1,4 @@
1
- import{f as Bg}from"./chunks/chunk-ZSBPE36C.js";import{a as vN,b as kN,c as NN,d as LN}from"./chunks/chunk-EYEQC3L2.js";import{a as $N,b as DN}from"./chunks/chunk-K3MVVDLN.js";import{b as rN,c as nN,d as oN,e as iN,f as sN,g as aN,h as cN,i as dN,j as pN,k as lN,l as uN,m as mN,n as fN,o as _N,p as hN,q as gN,r as CN}from"./chunks/chunk-LQEB6GSY.js";import{a as Ys,b as _d,c as hd,d as gd,e as Cd,f as yd,g as yN,h as SN,i as TN,j as EN,k as AN,l as xN,m as bN,n as wN,o as ON,p as RN,q as PN,r as MN,s as IN}from"./chunks/chunk-ZK4CY24V.js";import{a as aP,b as cP,c as Uc,d as jc,e as Bc,g as qc,h as zc,i as Hc,j as Vc,k as Kc,l as Wc,m as Yc,p as Xc}from"./chunks/chunk-DBASKWBO.js";import{A as p0,B as l0,C as u0,D as m0,E as f0,F as _0,G as h0,H as g0,I as C0,J as y0,K as S0,L as T0,M as E0,N as A0,O as x0,P as b0,Q as w0,R as O0,S as R0,T as P0,U as M0,V as I0,W as v0,X as k0,Y as N0,Z as L0,_ as $0,a as FN,b as GN,c as UN,d as jN,e as BN,f as qN,g as zN,h as HN,i as VN,j as KN,k as WN,l as YN,m as XN,n as JN,o as QN,p as ZN,q as e0,r as t0,s as r0,t as n0,u as o0,v as i0,w as s0,x as a0,y as c0,z as d0}from"./chunks/chunk-FRYNDVLN.js";import{$ as Af,$a as fh,$b as fg,A as Ke,Aa as $_,Ab as jh,Ac as jg,B as cf,Ba as D_,Bb as Bh,C as df,Ca as F_,Cb as qh,D as lf,Da as G_,Db as zh,E as uf,Ea as U_,Eb as Hh,F as Ht,Fa as j_,Fb as Vh,G as Vt,Ga as B_,Gb as Kh,H as Kt,Ha as q_,Hb as Wh,I as Wt,Ia as z_,Ib as Yh,J as Yt,Ja as H_,Jb as Xh,K as Xt,Ka as V_,Kb as Jh,L as Jt,La as K_,Lb as Qh,M as Qt,Ma as W_,Mb as Zh,N as Zt,Na as Y_,Nb as eg,O as er,Oa as X_,Ob as tg,P as tr,Pa as J_,Pb as rg,Q as mf,Qa as Q_,Qb as ng,R as ff,Ra as Z_,Rb as og,S as _f,Sa as eh,Sb as ig,T as hf,Ta as th,Tb as sg,U as gf,Ua as rh,Ub as ag,V as We,Va as rr,Vb as cg,W as Cf,Wa as _e,Wb as dg,X as yf,Xa as ph,Xb as pg,Y as Sf,Ya as lh,Yb as lg,Z as Tf,Za as uh,Zb as ug,_ as Ef,_a as mh,_b as mg,a as SR,aa as xf,ab as _h,ac as _g,b as TR,ba as bf,bb as hh,bc as hg,c as ER,ca as Dk,cb as gh,cc as gg,d as AR,da as Fk,db as Ch,dc as Cg,e as xR,ea as Gk,eb as yh,ec as yg,f as bR,fa as Ff,fb as Sh,fc as Sg,g as RR,ga as Gf,gb as Th,gc as Tg,h as PR,ha as Uf,hb as Eh,hc as Eg,i as MR,ia as w_,ib as Ah,ic as Ag,j as IR,ja as O_,jb as xh,jc as xg,k as Nc,ka as Wk,kb as bh,kc as bg,la as Yk,lb as wh,lc as wg,m as VM,ma as Xk,mb as Oh,mc as Og,n as KM,na as Jk,nb as Rh,nc as Rg,o as WM,oa as Qk,ob as Ph,oc as Pg,p as YM,pa as Zk,pb as Mh,pc as Mg,q as XM,qa as eN,qb as Ih,qc as Ig,r as JM,ra as tN,rb as vh,rc as vg,s as ol,sa as R_,sb as kh,sc as kg,t as Gu,ta as P_,tb as Nh,tc as Ng,u as Uu,ua as M_,ub as Lh,uc as Lg,v as qu,va as I_,vb as $h,vc as $g,w as zu,wa as v_,wb as Dh,wc as Dg,x as pm,xa as k_,xb as Fh,xc as Fg,y as gm,ya as N_,yb as Gh,yc as Gg,z as xv,za as L_,zb as Uh,zc as Ug}from"./chunks/chunk-3US5T6B2.js";import{e as eI,f as tI,g as il,h as sl,i as Bt}from"./chunks/chunk-CV2B4JUB.js";import{A as wk,B as Ok,C as Rk,D as Pk,E as Mk,F as Ik,G as vk,H as kk,I as Nk,J as Lk,K as $k,L as Rf,M as Pf,N as Mf,O as If,P as vf,Q as kf,R as Nf,S as Lf,T as $f,U as Df,a as av,b as cv,c as dv,d as pv,e as lv,f as Fu,g as uv,h as mv,i as fv,j as _v,k as hv,m as pf,n as wf,o as _k,p as hk,q as gk,r as Ck,s as yk,t as Sk,u as Of,v as Tk,w as Ek,x as Ak,y as xk,z as bk}from"./chunks/chunk-Q6GIFUCW.js";import{$ as rM,$a as jl,$b as dm,$c as ih,Aa as OM,Ab as QI,Ac as Kf,Ba as RM,Bb as Nu,Bc as Wf,C as ze,Ca as PM,Cb as Lu,Cc as Yf,D as ee,Da as MM,Db as $u,Dc as Hk,E as fp,Ea as IM,Eb as ZI,Ec as Vk,Fb as ev,Fc as Kk,Gb as tv,Gc as Xf,H as He,Ha as QM,Hb as rv,Hc as Jf,I as _p,Ia as ZM,Ib as nv,Ic as Qf,J as hp,Ja as Jp,Jb as ov,Jc as Zf,Ka as Qp,Kb as iv,Kc as e_,L as fe,La as Zp,Lb as sv,Lc as t_,M as gp,Ma as el,Mb as Du,Mc as r_,N as Cp,Na as tl,Nb as gv,Nc as n_,O as yp,Oa as rl,Ob as Cv,Oc as o_,P as Sp,Pa as nl,Pb as yv,Pc as i_,Q as KP,Qa as vl,Qb as Sv,Qc as s_,R as WP,Ra as kl,Rb as Tv,Rc as a_,S as YP,Sa as oI,Sc as c_,T as XP,Ta as Nl,Tb as ju,Tc as d_,U as JP,Ua as Ll,Ub as Bu,Uc as f_,V as Nt,Va as $l,Vb as Hu,Vc as __,W as QP,Wa as Dl,Wb as Vu,X as ZP,Xa as iI,Xc as h_,Y as Lt,Ya as Fl,Yc as b_,Z as eM,Za as Gl,Zb as Ev,Zc as nh,_ as tM,_a as Ul,_b as Av,_c as oh,a as dP,aa as nM,ab as Bl,ac as Cm,ad as sh,b as Mt,ba as oM,bb as sI,bc as ym,bd as ah,c as pP,ca as Ve,cb as aI,cc as Sm,cd as ch,d as sd,da as iM,db as cI,dc as Tm,dd as dh,e as ad,ea as $t,eb as dI,ec as Em,f as cd,fa as sM,fb as pI,g as dd,ga as aM,gb as lI,h as pd,ha as cM,hb as uI,ia as dM,ib as hI,j as ld,ja as pM,jb as Eu,jc as Am,k as ud,ka as lM,kb as gI,la as uM,lb as NI,lc as Zm,ma as mM,mb as LI,mc as ef,na as fM,nb as $I,nc as tf,o as md,oa as _M,ob as DI,p as fd,pa as hM,pb as FI,pc as rf,qa as gM,qb as GI,qc as nf,ra as CM,rb as UI,rc as of,sa as yM,sb as VI,sc as sf,ta as SM,tb as KI,tc as af,ua as TM,ub as Au,uc as jf,va as EM,vb as xu,vc as Bf,w as vt,wa as AM,wb as WI,wc as qf,xa as xM,xb as YI,xc as zf,y as kt,ya as bM,yb as XI,yc as Hf,za as wM,zb as JI,zc as Vf}from"./chunks/chunk-L7HON3BE.js";import{$a as RI,$b as Vv,A as GP,Aa as fu,Ab as Pm,Ac as Bm,B as rp,Ba as _u,Bb as Mm,Bc as qm,C as np,Ca as hu,Cb as Im,Cc as zm,D as op,Da as gu,Db as vm,Dc as Hm,E as ip,Ea as Cu,Eb as wv,Ec as Vm,F as sp,Fa as yu,Fb as Ov,Fc as Km,G as ap,Ga as Su,Gb as Rv,Gc as Wm,H as cp,Ha as Tu,Hb as Pv,Hc as Ym,I as dp,Ib as Mv,Ic as Xm,J as pp,Jb as Iv,Jc as zt,K as lp,Kb as vv,Kc as Jm,L as up,La as mI,Lc as lk,M as qe,Ma as fI,Mb as km,Mc as uk,N as UP,Na as _I,Nb as Nm,Nc as mk,O as jP,Oa as CI,Ob as kv,Oc as Qm,P as BP,Pa as yI,Pb as Nv,Pc as fk,Q as qP,Qa as SI,Qb as Lv,Qc as Uk,R as zP,Ra as TI,Rb as $v,Rc as jk,S as HP,Sa as EI,Sb as Dv,Sc as Bk,T as VP,Ta as AI,Tb as Fv,Tc as qk,U as mp,Ua as xI,Ub as Gv,Uc as zk,V as al,Va as bI,Vb as Uv,W as cl,Wa as wI,Wb as jv,X as dl,Xa as OI,Xb as Bv,Y as pl,Yb as qv,Z as rI,Zb as zv,_ as nI,_b as Hv,a as vR,aa as ll,ac as Kv,b as kR,ba as ql,bb as PI,bc as Wv,c as NR,ca as zl,cb as MI,cc as Yv,d as LR,da as Hl,dc as Xv,e as bP,ea as Vl,ec as Jv,f as wP,fa as Kl,fb as II,fc as Qv,g as OP,ga as Wl,gb as vI,gc as Zv,h as RP,ha as Yl,hb as kI,hc as ek,i as PP,ia as Xl,ic as tk,j as MP,ja as Jl,jb as jI,jc as rk,k as IP,ka as Ql,kb as BI,kc as nk,la as Zl,lb as qI,lc as ok,ma as eu,mb as zI,mc as ik,na as tu,nb as HI,nc as sk,oa as ru,ob as lm,oc as ak,pa as nu,pb as um,pc as ck,qa as ou,qb as mm,qc as dk,ra as iu,rb as fm,rc as pk,sa as su,sb as _m,sc as qt,t as vP,ta as au,tb as hm,tc as Lm,u as kP,ua as cu,ub as xm,uc as $m,v as NP,va as du,vb as bm,vc as Dm,w as LP,wa as pu,wb as wm,wc as Fm,x as $P,xa as lu,xb as Om,xc as Gm,y as DP,ya as uu,yb as Rm,yc as Um,z as FP,za as mu,zb as bv,zc as jm}from"./chunks/chunk-KCR4NF2A.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import{x as tp}from"./chunks/chunk-VI3A7UZ2.js";import{$ as m_,A as Mu,B as Iu,C as vu,D as ku,I as Ku,J as Wu,K as Yu,L as Xu,M as Ju,N as Qu,O as Zu,P as em,Q as tm,R as rm,S as nm,T as om,U as im,V as sm,W as am,X as cm,Y as p_,Z as l_,_ as u_,b as ul,ba as g_,c as ml,ca as C_,d as fl,da as y_,e as _l,ea as S_,f as hl,g as gl,ga as T_,h as Cl,ha as E_,i as yl,ia as A_,j as Sl,ja as x_,k as Tl,l as El,m as Al,n as xl,o as bl,p as wl,q as Ol,r as Rl,s as Pl,t as Ml,u as Il,v as bu,w as wu,x as Ou,y as Ru,z as Pu}from"./chunks/chunk-WNB62BGK.js";import{A as Lp,Aa as Kp,B as $p,C as Dt,Ca as Wp,Da as Yp,Ea as Xp,b as $R,c as DR,d as FR,da as Ft,e as GR,ea as Gt,f as UR,fa as Ut,g as jR,ga as jt,h as Lc,i as $c,j as Dc,ja as Dp,k as Fc,l as Gc,la as Fp,ma as Gp,n as vM,na as Up,s as jM,t as BM,ta as jp,ua as Bp,v as qM,w as zM,wa as qp,x as HM,xa as zp,y as kp,ya as Hp,z as Np,za as Vp}from"./chunks/chunk-JFPCL45G.js";import{a as wR,b as OR}from"./chunks/chunk-JQHLOSSS.js";import"./chunks/chunk-6H36ZHMI.js";import{a as kM,b as NM,c as LM,d as $M,e as DM,f as FM,g as GM,h as bp,i as wp,j as Op,k as Rp,l as Pp,m as UM,n as Mp,o as Ip,p as vp}from"./chunks/chunk-3TK2YOVB.js";import{a as Tp,b as Ep,e as Ap,f as xp}from"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import{$ as Vd,A as Dd,B as Fd,C as Gd,D as Ud,E as jd,F as Bd,G as qd,H as lP,I as uP,J as mP,K as fP,L as _P,M as hP,Q as gP,R as CP,S as yP,T as SP,U as TP,V as EP,W as AP,X as xP,Z as zd,_ as Hd,a as Jc,aa as Kd,b as Qc,ba as Wd,c as Zc,ca as Yd,d as ed,da as Xd,e as td,ea as Jd,f as rd,fa as Qd,g as nd,ga as Zd,h as od,ha as ep,i as id,ia as It,j as Sd,k as Td,l as Ed,m as Ad,n as xd,o as bd,p as wd,q as Od,r as Rd,s as Pd,t as Md,u as Id,v as vd,w as kd,x as Nd,y as Ld,z as $d}from"./chunks/chunk-R6M5OGJH.js";import{a as lR,b as uR,c as mR,d as fR,e as _R,f as hR,g as gR,h as CR,i as yR,j as Us,k as js,l as Bs,m as qs,n as zs,o as Hs,q as Vs,s as Ks,y as Ws}from"./chunks/chunk-4EBHZBM2.js";import{b as cR}from"./chunks/chunk-WLZ5KVM2.js";import"./chunks/chunk-PZA7QECY.js";import{$ as jb,$c as BO,A as ST,Ac as NO,Ad as pR,B as TT,Bb as nO,Bc as LO,C as ET,Cc as $O,Dc as Ss,Ec as Ts,Fb as oO,Fc as Es,Gb as iO,Gc as As,Ha as fw,Hb as sO,Hc as xs,Ia as _w,Ib as ds,Ic as bs,Ja as hw,Jb as aO,Jc as ws,K as vT,Ka as gw,Kc as Os,La as Cw,Lb as cO,Lc as Rs,M as jT,Ma as yw,Mb as dO,Mc as Ps,N as BT,Na as bw,Nb as pO,Nc as Ms,O as qT,Oa as ww,Ob as lO,Oc as Is,P as zT,Pa as Ow,Pb as uO,Pc as vs,Q as XT,Qa as wt,Qb as mO,Qc as ks,R as JT,Rb as fO,Sa as Rw,Sb as _O,Sc as Ns,T as Lb,Ta as Pw,Tb as hO,Tc as DO,Ua as Mw,Ub as gO,Uc as FO,V as $b,Va as Iw,Vb as Ot,Vc as Ls,W as Db,Wa as vw,Wb as CO,Wc as GO,Xb as yO,Xc as UO,Y as Fb,Yc as $s,Z as Gb,Za as kw,Zc as Ds,_ as Ub,_c as jO,a as aT,aa as Bb,ad as qO,ba as qb,bb as rs,bc as ps,bd as zO,ca as zb,cc as ls,cd as HO,da as ew,db as qw,dc as us,dd as VO,eb as zw,ec as ms,ed as KO,fa as Qi,fb as Hw,fd as Fs,ga as Zi,gb as Vw,gc as fs,gd as Gs,ha as es,hc as _s,hd as WO,i as io,ib as Kw,ic as hs,id as YO,j as cT,ja as tw,jb as Ww,jc as gs,jd as XO,k as dT,ka as rw,kb as Yw,kc as Cs,kd as JO,l as pT,la as nw,lb as Xw,lc as ys,ld as QO,m as lT,ma as ow,mb as ss,mc as SO,md as ZO,na as iw,nb as as,nc as TO,nd as eR,o as uT,oa as sw,oc as EO,od as tR,p as mT,pa as aw,pb as cs,pc as AO,pd as rR,qb as Jw,qc as xO,qd as nR,r as fT,ra as cw,rc as bO,rd as oR,sb as Qw,sc as wO,t as _T,ta as dw,tb as Zw,tc as OO,u as hT,ua as pw,ub as eO,uc as RO,v as gT,va as lw,vc as PO,vd as Rt,wa as uw,wb as tO,wc as MO,wd as iR,x as CT,xa as mw,xc as IO,xd as sR,y as yT,yc as vO,yd as aR,zb as rO,zc as kO,zd as dR}from"./chunks/chunk-PY6A7ULK.js";import{A as Fw,B as Gw,C as Uw,D as jw,E as Bw,F as ns,G as os,H as is,a as Hb,b as Vb,c as Kb,d as Wb,e as Yb,f as Xb,g as Jb,h as Qb,i as Zb,l as Sw,o as Tw,p as Ew,t as Aw,u as ts,v as xw,w as Nw,x as Lw,y as $w,z as Dw}from"./chunks/chunk-3E53F7QY.js";import"./chunks/chunk-3AZOATC2.js";import{$a as Zo,$c as aA,$d as FA,$e as Ix,$g as Sb,A as Qn,Aa as Bo,Ab as li,Ad as mA,Ae as lx,B as Zn,Ba as qo,Bb as ui,Bd as fA,Be as ux,C as eo,Ca as zo,Cb as mi,Cc as FE,Cd as _A,Ce as mx,D as to,Da as Ho,Db as fi,Dc as GE,Dd as hA,De as fx,E as ro,Ea as Vo,Eb as _i,Ec as UE,Ee as _x,F as no,Fa as gE,Fc as jE,Fe as hx,G as oo,Ga as CE,Gc as BE,Gd as gA,Ge as gx,Hb as xE,Hc as qE,Hd as CA,Hg as cb,Ib as bE,Ic as zE,Id as yA,If as Bx,Ig as db,Jb as hi,Jc as HE,Jd as SA,Je as Cx,Jf as Ge,Jg as pb,Kc as VE,Kd as TA,Ke as yx,Kf as xt,Lc as KE,Ld as EA,Le as Sx,Lf as qx,Lg as lb,M as Ct,Mc as WE,Md as AA,Me as Tx,Mf as zx,Mg as ub,N as yt,Nb as wE,Nc as YE,Nd as xA,Ne as Ex,Nf as Hx,Ob as OE,Od as bA,Oe as Ax,Of as Vx,Og as mb,Pd as wA,Pe as xx,Pf as q,Pg as Vi,Q as No,Qc as XE,Qd as OA,Qe as bx,Qf as Kx,Rc as JE,Rd as RA,Rf as Wx,Rg as Ki,S as kT,Sa as Ko,Sc as QE,Sd as PA,Sf as Yx,Sg as Wi,T as NT,Ta as Wo,Tc as ZE,Td as MA,Tf as Xx,Ua as yE,Uc as eA,Ud as IA,Ue as wx,Va as Yo,Vc as tA,Vd as vA,Ve as Ox,Vf as zi,Vg as fb,Wa as Xo,Wc as rA,Wd as kA,Wf as Hi,Wg as _b,X as LT,Xa as SE,Xb as RE,Xc as nA,Xd as NA,Xg as hb,Ya as Jo,Yb as PE,Yc as oA,Yd as LA,Ye as Rx,Yg as gb,Za as Qo,Zb as ME,Zc as iA,Zd as $A,Ze as Px,Zg as Cb,_ as $T,_a as L,_b as IE,_c as sA,_d as DA,_e as Mx,_g as yb,a as XS,ac as vE,ae as GA,af as vx,ah as Yi,b as JS,ba as DT,bc as kE,bd as Ei,be as UA,bf as kx,bh as Tb,c as QS,cd as Ai,ce as jA,cf as Nx,ch as Eb,d as ZS,dd as xi,de as BA,df as Lx,e as eT,ea as FT,ed as bi,ee as qA,f as tT,fa as HT,fb as Fe,fd as wi,fe as zA,ff as $x,fg as Jx,fh as Ab,g as rT,ga as VT,gb as ei,gd as Oi,ge as HA,gf as Dx,gg as bt,gh as xb,h as nT,ha as KT,hc as NE,hd as Ri,he as VA,hf as Fx,hg as Qx,hh as bb,i as oT,ia as WT,id as Pi,ie as KA,if as Gx,ig as Zx,ih as wb,j as iT,ja as YT,jc as gi,jd as Mi,je as WA,jf as Ux,jg as eb,jh as Ob,k as sT,ka as QT,kc as Ci,kd as Ii,ke as YA,kh as Rb,l as Gn,la as ZT,lc as yi,ld as vi,le as XA,lf as jx,lh as Xi,m as Un,ma as eE,mc as Si,md as ki,me as JA,mf as Bi,mg as tb,n as jn,na as tE,nb as TE,nd as Ni,ne as QA,nf as qi,ng as rb,o as Bn,oa as rE,ob as EE,od as Li,oe as ZA,og as nb,oh as Pb,p as qn,pa as nE,pb as AE,pd as $i,pe as ex,pg as ob,ph as Ji,q as zn,qa as oE,qb as ti,qd as Di,qe as tx,qg as ib,r as Hn,ra as iE,rb as ri,rd as Fi,re as rx,s as Ne,sa as sE,sb as ni,sc as LE,sd as Gi,se as nx,sh as Mb,t as Le,ta as aE,tb as oi,tc as $E,td as Ui,te as ox,tg as sb,th as Ib,u as Vn,ua as cE,ub as ii,uc as DE,ud as ji,ue as ix,uh as vb,v as Kn,va as dE,vb as si,vd as cA,ve as sx,vg as ab,vh as kb,w as Wn,wa as pE,wb as ai,wd as dA,we as ax,wh as Nb,x as Yn,xa as Uo,xb as ci,xd as pA,xe as cx,y as Xn,ya as jo,yb as di,yc as Ti,yd as lA,ye as dx,z as Jn,zb as pi,zd as uA,ze as px}from"./chunks/chunk-RWHS77ME.js";import{b as AT,c as xT,d as bT,g as go,h as wT,i as OT,j as RT,k as PT,m as Co,n as yo,o as De,p as MT,q as IT,r as So,s as To,u as Eo}from"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-CNZOC6JD.js";import{$ as Ta,$a as Tc,A as sP,Aa as Wa,B as Js,Ba as Ya,C as Qs,Ca as Xa,D as Zs,Da as Ja,Ea as Qa,F as ea,Fa as Za,G as ta,Ga as ec,H as ra,Ha as tc,I as na,Ia as rc,J as oa,Ja as nc,K as ia,Ka as oc,L as sa,La as ic,M as aa,Ma as sc,N as ca,Na as ac,O as da,Oa as cc,P as pa,Pa as dc,Q as la,Qa as pc,R as ua,Ra as lc,S as ma,Sa as uc,Ta as mc,U as fa,Ua as fc,V as _a,Va as _c,W as ha,Wa as hc,X as ga,Xa as gc,Y as Ca,Ya as Cc,Z as ya,Za as yc,_ as Sa,_a as Sc,aa as Ea,ab as Ec,b as BR,ba as Aa,bb as Ac,c as qR,ca as xa,cb as xc,d as zR,da as ba,db as bc,e as HR,ea as wa,eb as wc,f as VR,fa as Oa,fb as Oc,ga as Ra,gb as Rc,h as KR,ha as Pa,hb as Pc,i as WR,ia as Ma,ib as Mc,j as Xs,ja as Ia,jb as Ic,k as YR,ka as va,kb as vc,la as ka,ma as Na,mb as Be,n as XR,na as La,nb as Z,o as JR,oa as $a,ob as kc,p as Ue,pa as Da,q as QR,qa as Fa,r as ZR,ra as Ga,s as eP,sa as Ua,t as Pt,ta as ja,u as je,ua as Ba,v as tP,va as qa,w as rP,wa as za,x as nP,xa as Ha,y as oP,ya as Va,z as iP,za as Ka}from"./chunks/chunk-NRCGGNOE.js";import{I as ko,L as Tt,N as Et,Q as Lo,R as $o,S as At,U as GT,W as UT,Y as Go,a as R,b as YS,c as gt,da as fE,e as Mn,f as In,g as vn,ga as _E,h as kn,ha as hE,i as ve,j as Nn,k as N,l as ke,m as Ln,n as $n,o as Dn,p as Fn,q as Ao,r as xo,s as bo,t as wo,u as Oo,v as Ro,w as Po,x as Mo,y as Io,z as vo}from"./chunks/chunk-JV7LREUF.js";import{_ as lE,a as po,b as lo,ba as Do,c as uo,ca as uE,da as Fo,fa as mE,h as mo,j as fo,k as _o,l as ho}from"./chunks/chunk-TE6FBDHP.js";import{A as ue,B as WS,C as S,E as so,F as St,G as me,H as ao,L as $e,N as co,b as jS,c as BS,d as qS,m as zS,r as HS,u as VS,y as KS}from"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function zg(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=qg(t[x.clientInfo]),i=zg(t[x.logLevel]);return{protocolVersion:z,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function D0(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function F0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function G0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function Hg(e,t){return Xe({...e,resultType:"complete"},t)}function U0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Hg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function j0(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}var Vg=new Set(["--help","-h","--version","-V"]);function Kg(e,t){let n=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&n.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),n.join(`
1
+ import{f as Bg}from"./chunks/chunk-Z7YL2SUM.js";import{a as vN,b as kN,c as NN,d as LN}from"./chunks/chunk-TX74QJ4W.js";import{a as $N,b as DN}from"./chunks/chunk-47ZS6RPL.js";import{b as rN,c as nN,d as oN,e as iN,f as sN,g as aN,h as cN,i as dN,j as pN,k as lN,l as uN,m as mN,n as fN,o as _N,p as hN,q as gN,r as CN}from"./chunks/chunk-FECZV72T.js";import{a as Ys,b as _d,c as hd,d as gd,e as Cd,f as yd,g as yN,h as SN,i as TN,j as EN,k as AN,l as xN,m as bN,n as wN,o as ON,p as RN,q as PN,r as MN,s as IN}from"./chunks/chunk-YVTALIN3.js";import{a as aP,b as cP,c as Uc,d as jc,e as Bc,g as qc,h as zc,i as Hc,j as Vc,k as Kc,l as Wc,m as Yc,p as Xc}from"./chunks/chunk-NHBG5ET3.js";import{A as p0,B as l0,C as u0,D as m0,E as f0,F as _0,G as h0,H as g0,I as C0,J as y0,K as S0,L as T0,M as E0,N as A0,O as x0,P as b0,Q as w0,R as O0,S as R0,T as P0,U as M0,V as I0,W as v0,X as k0,Y as N0,Z as L0,_ as $0,a as FN,b as GN,c as UN,d as jN,e as BN,f as qN,g as zN,h as HN,i as VN,j as KN,k as WN,l as YN,m as XN,n as JN,o as QN,p as ZN,q as e0,r as t0,s as r0,t as n0,u as o0,v as i0,w as s0,x as a0,y as c0,z as d0}from"./chunks/chunk-FR7ULTM4.js";import{$ as Af,$a as fh,$b as fg,A as Ke,Aa as $_,Ab as jh,Ac as jg,B as cf,Ba as D_,Bb as Bh,C as df,Ca as F_,Cb as qh,D as lf,Da as G_,Db as zh,E as uf,Ea as U_,Eb as Hh,F as Ht,Fa as j_,Fb as Vh,G as Vt,Ga as B_,Gb as Kh,H as Kt,Ha as q_,Hb as Wh,I as Wt,Ia as z_,Ib as Yh,J as Yt,Ja as H_,Jb as Xh,K as Xt,Ka as V_,Kb as Jh,L as Jt,La as K_,Lb as Qh,M as Qt,Ma as W_,Mb as Zh,N as Zt,Na as Y_,Nb as eg,O as er,Oa as X_,Ob as tg,P as tr,Pa as J_,Pb as rg,Q as mf,Qa as Q_,Qb as ng,R as ff,Ra as Z_,Rb as og,S as _f,Sa as eh,Sb as ig,T as hf,Ta as th,Tb as sg,U as gf,Ua as rh,Ub as ag,V as We,Va as rr,Vb as cg,W as Cf,Wa as _e,Wb as dg,X as yf,Xa as ph,Xb as pg,Y as Sf,Ya as lh,Yb as lg,Z as Tf,Za as uh,Zb as ug,_ as Ef,_a as mh,_b as mg,a as SR,aa as xf,ab as _h,ac as _g,b as TR,ba as bf,bb as hh,bc as hg,c as ER,ca as Dk,cb as gh,cc as gg,d as AR,da as Fk,db as Ch,dc as Cg,e as xR,ea as Gk,eb as yh,ec as yg,f as bR,fa as Ff,fb as Sh,fc as Sg,g as RR,ga as Gf,gb as Th,gc as Tg,h as PR,ha as Uf,hb as Eh,hc as Eg,i as MR,ia as w_,ib as Ah,ic as Ag,j as IR,ja as O_,jb as xh,jc as xg,k as Nc,ka as Wk,kb as bh,kc as bg,la as Yk,lb as wh,lc as wg,m as VM,ma as Xk,mb as Oh,mc as Og,n as KM,na as Jk,nb as Rh,nc as Rg,o as WM,oa as Qk,ob as Ph,oc as Pg,p as YM,pa as Zk,pb as Mh,pc as Mg,q as XM,qa as eN,qb as Ih,qc as Ig,r as JM,ra as tN,rb as vh,rc as vg,s as ol,sa as R_,sb as kh,sc as kg,t as Gu,ta as P_,tb as Nh,tc as Ng,u as Uu,ua as M_,ub as Lh,uc as Lg,v as qu,va as I_,vb as $h,vc as $g,w as zu,wa as v_,wb as Dh,wc as Dg,x as pm,xa as k_,xb as Fh,xc as Fg,y as gm,ya as N_,yb as Gh,yc as Gg,z as xv,za as L_,zb as Uh,zc as Ug}from"./chunks/chunk-NZSXWIX7.js";import{e as eI,f as tI,g as il,h as sl,i as Bt}from"./chunks/chunk-CCKM5YQM.js";import{A as wk,B as Ok,C as Rk,D as Pk,E as Mk,F as Ik,G as vk,H as kk,I as Nk,J as Lk,K as $k,L as Rf,M as Pf,N as Mf,O as If,P as vf,Q as kf,R as Nf,S as Lf,T as $f,U as Df,a as av,b as cv,c as dv,d as pv,e as lv,f as Fu,g as uv,h as mv,i as fv,j as _v,k as hv,m as pf,n as wf,o as _k,p as hk,q as gk,r as Ck,s as yk,t as Sk,u as Of,v as Tk,w as Ek,x as Ak,y as xk,z as bk}from"./chunks/chunk-2SBTXR6C.js";import{$ as rM,$a as jl,$b as dm,$c as ih,Aa as OM,Ab as QI,Ac as Kf,Ba as RM,Bb as Nu,Bc as Wf,C as ze,Ca as PM,Cb as Lu,Cc as Yf,D as ee,Da as MM,Db as $u,Dc as Hk,E as fp,Ea as IM,Eb as ZI,Ec as Vk,Fb as ev,Fc as Kk,Gb as tv,Gc as Xf,H as He,Ha as QM,Hb as rv,Hc as Jf,I as _p,Ia as ZM,Ib as nv,Ic as Qf,J as hp,Ja as Jp,Jb as ov,Jc as Zf,Ka as Qp,Kb as iv,Kc as e_,L as fe,La as Zp,Lb as sv,Lc as t_,M as gp,Ma as el,Mb as Du,Mc as r_,N as Cp,Na as tl,Nb as gv,Nc as n_,O as yp,Oa as rl,Ob as Cv,Oc as o_,P as Sp,Pa as nl,Pb as yv,Pc as i_,Q as KP,Qa as vl,Qb as Sv,Qc as s_,R as WP,Ra as kl,Rb as Tv,Rc as a_,S as YP,Sa as oI,Sc as c_,T as XP,Ta as Nl,Tb as ju,Tc as d_,U as JP,Ua as Ll,Ub as Bu,Uc as f_,V as Nt,Va as $l,Vb as Hu,Vc as __,W as QP,Wa as Dl,Wb as Vu,X as ZP,Xa as iI,Xc as h_,Y as Lt,Ya as Fl,Yc as b_,Z as eM,Za as Gl,Zb as Ev,Zc as nh,_ as tM,_a as Ul,_b as Av,_c as oh,a as dP,aa as nM,ab as Bl,ac as Cm,ad as sh,b as Mt,ba as oM,bb as sI,bc as ym,bd as ah,c as pP,ca as Ve,cb as aI,cc as Sm,cd as ch,d as sd,da as iM,db as cI,dc as Tm,dd as dh,e as ad,ea as $t,eb as dI,ec as Em,f as cd,fa as sM,fb as pI,g as dd,ga as aM,gb as lI,h as pd,ha as cM,hb as uI,ia as dM,ib as hI,j as ld,ja as pM,jb as Eu,jc as Am,k as ud,ka as lM,kb as gI,la as uM,lb as NI,lc as Zm,ma as mM,mb as LI,mc as ef,na as fM,nb as $I,nc as tf,o as md,oa as _M,ob as DI,p as fd,pa as hM,pb as FI,pc as rf,qa as gM,qb as GI,qc as nf,ra as CM,rb as UI,rc as of,sa as yM,sb as VI,sc as sf,ta as SM,tb as KI,tc as af,ua as TM,ub as Au,uc as jf,va as EM,vb as xu,vc as Bf,w as vt,wa as AM,wb as WI,wc as qf,xa as xM,xb as YI,xc as zf,y as kt,ya as bM,yb as XI,yc as Hf,za as wM,zb as JI,zc as Vf}from"./chunks/chunk-WFYE34TO.js";import{$a as RI,$b as Vv,A as GP,Aa as fu,Ab as Pm,Ac as Bm,B as rp,Ba as _u,Bb as Mm,Bc as qm,C as np,Ca as hu,Cb as Im,Cc as zm,D as op,Da as gu,Db as vm,Dc as Hm,E as ip,Ea as Cu,Eb as wv,Ec as Vm,F as sp,Fa as yu,Fb as Ov,Fc as Km,G as ap,Ga as Su,Gb as Rv,Gc as Wm,H as cp,Ha as Tu,Hb as Pv,Hc as Ym,I as dp,Ib as Mv,Ic as Xm,J as pp,Jb as Iv,Jc as zt,K as lp,Kb as vv,Kc as Jm,L as up,La as mI,Lc as lk,M as qe,Ma as fI,Mb as km,Mc as uk,N as UP,Na as _I,Nb as Nm,Nc as mk,O as jP,Oa as CI,Ob as kv,Oc as Qm,P as BP,Pa as yI,Pb as Nv,Pc as fk,Q as qP,Qa as SI,Qb as Lv,Qc as Uk,R as zP,Ra as TI,Rb as $v,Rc as jk,S as HP,Sa as EI,Sb as Dv,Sc as Bk,T as VP,Ta as AI,Tb as Fv,Tc as qk,U as mp,Ua as xI,Ub as Gv,Uc as zk,V as al,Va as bI,Vb as Uv,W as cl,Wa as wI,Wb as jv,X as dl,Xa as OI,Xb as Bv,Y as pl,Yb as qv,Z as rI,Zb as zv,_ as nI,_b as Hv,a as vR,aa as ll,ac as Kv,b as kR,ba as ql,bb as PI,bc as Wv,c as NR,ca as zl,cb as MI,cc as Yv,d as LR,da as Hl,dc as Xv,e as bP,ea as Vl,ec as Jv,f as wP,fa as Kl,fb as II,fc as Qv,g as OP,ga as Wl,gb as vI,gc as Zv,h as RP,ha as Yl,hb as kI,hc as ek,i as PP,ia as Xl,ic as tk,j as MP,ja as Jl,jb as jI,jc as rk,k as IP,ka as Ql,kb as BI,kc as nk,la as Zl,lb as qI,lc as ok,ma as eu,mb as zI,mc as ik,na as tu,nb as HI,nc as sk,oa as ru,ob as lm,oc as ak,pa as nu,pb as um,pc as ck,qa as ou,qb as mm,qc as dk,ra as iu,rb as fm,rc as pk,sa as su,sb as _m,sc as qt,t as vP,ta as au,tb as hm,tc as Lm,u as kP,ua as cu,ub as xm,uc as $m,v as NP,va as du,vb as bm,vc as Dm,w as LP,wa as pu,wb as wm,wc as Fm,x as $P,xa as lu,xb as Om,xc as Gm,y as DP,ya as uu,yb as Rm,yc as Um,z as FP,za as mu,zb as bv,zc as jm}from"./chunks/chunk-ZA5NS3PL.js";import"./chunks/chunk-X5D5YUHR.js";import"./chunks/chunk-4QA5O64H.js";import{x as tp}from"./chunks/chunk-Q4VZSMUL.js";import{$ as m_,A as Mu,B as Iu,C as vu,D as ku,I as Ku,J as Wu,K as Yu,L as Xu,M as Ju,N as Qu,O as Zu,P as em,Q as tm,R as rm,S as nm,T as om,U as im,V as sm,W as am,X as cm,Y as p_,Z as l_,_ as u_,b as ul,ba as g_,c as ml,ca as C_,d as fl,da as y_,e as _l,ea as S_,f as hl,g as gl,ga as T_,h as Cl,ha as E_,i as yl,ia as A_,j as Sl,ja as x_,k as Tl,l as El,m as Al,n as xl,o as bl,p as wl,q as Ol,r as Rl,s as Pl,t as Ml,u as Il,v as bu,w as wu,x as Ou,y as Ru,z as Pu}from"./chunks/chunk-TY55UX6M.js";import{A as Lp,Aa as Kp,B as $p,C as Dt,Ca as Wp,Da as Yp,Ea as Xp,b as $R,c as DR,d as FR,da as Ft,e as GR,ea as Gt,f as UR,fa as Ut,g as jR,ga as jt,h as Lc,i as $c,j as Dc,ja as Dp,k as Fc,l as Gc,la as Fp,ma as Gp,n as vM,na as Up,s as jM,t as BM,ta as jp,ua as Bp,v as qM,w as zM,wa as qp,x as HM,xa as zp,y as kp,ya as Hp,z as Np,za as Vp}from"./chunks/chunk-IGEFPHV7.js";import{a as wR,b as OR}from"./chunks/chunk-DCWGM7CY.js";import"./chunks/chunk-6H36ZHMI.js";import{a as kM,b as NM,c as LM,d as $M,e as DM,f as FM,g as GM,h as bp,i as wp,j as Op,k as Rp,l as Pp,m as UM,n as Mp,o as Ip,p as vp}from"./chunks/chunk-AOTI76Q6.js";import{a as Tp,b as Ep,e as Ap,f as xp}from"./chunks/chunk-OGVSGXQX.js";import"./chunks/chunk-AA52P34H.js";import{$ as Vd,A as Dd,B as Fd,C as Gd,D as Ud,E as jd,F as Bd,G as qd,H as lP,I as uP,J as mP,K as fP,L as _P,M as hP,Q as gP,R as CP,S as yP,T as SP,U as TP,V as EP,W as AP,X as xP,Z as zd,_ as Hd,a as Jc,aa as Kd,b as Qc,ba as Wd,c as Zc,ca as Yd,d as ed,da as Xd,e as td,ea as Jd,f as rd,fa as Qd,g as nd,ga as Zd,h as od,ha as ep,i as id,ia as It,j as Sd,k as Td,l as Ed,m as Ad,n as xd,o as bd,p as wd,q as Od,r as Rd,s as Pd,t as Md,u as Id,v as vd,w as kd,x as Nd,y as Ld,z as $d}from"./chunks/chunk-KCVSSONY.js";import{a as lR,b as uR,c as mR,d as fR,e as _R,f as hR,g as gR,h as CR,i as yR,j as Us,k as js,l as Bs,m as qs,n as zs,o as Hs,q as Vs,s as Ks,y as Ws}from"./chunks/chunk-USBTXMKS.js";import{b as cR}from"./chunks/chunk-5PNOVDVO.js";import"./chunks/chunk-PZA7QECY.js";import{$ as jb,$c as BO,A as ST,Ac as NO,Ad as pR,B as TT,Bb as nO,Bc as LO,C as ET,Cc as $O,Dc as Ss,Ec as Ts,Fb as oO,Fc as Es,Gb as iO,Gc as As,Ha as fw,Hb as sO,Hc as xs,Ia as _w,Ib as ds,Ic as bs,Ja as hw,Jb as aO,Jc as ws,K as vT,Ka as gw,Kc as Os,La as Cw,Lb as cO,Lc as Rs,M as jT,Ma as yw,Mb as dO,Mc as Ps,N as BT,Na as bw,Nb as pO,Nc as Ms,O as qT,Oa as ww,Ob as lO,Oc as Is,P as zT,Pa as Ow,Pb as uO,Pc as vs,Q as XT,Qa as wt,Qb as mO,Qc as ks,R as JT,Rb as fO,Sa as Rw,Sb as _O,Sc as Ns,T as Lb,Ta as Pw,Tb as hO,Tc as DO,Ua as Mw,Ub as gO,Uc as FO,V as $b,Va as Iw,Vb as Ot,Vc as Ls,W as Db,Wa as vw,Wb as CO,Wc as GO,Xb as yO,Xc as UO,Y as Fb,Yc as $s,Z as Gb,Za as kw,Zc as Ds,_ as Ub,_c as jO,a as aT,aa as Bb,ad as qO,ba as qb,bb as rs,bc as ps,bd as zO,ca as zb,cc as ls,cd as HO,da as ew,db as qw,dc as us,dd as VO,eb as zw,ec as ms,ed as KO,fa as Qi,fb as Hw,fd as Fs,ga as Zi,gb as Vw,gc as fs,gd as Gs,ha as es,hc as _s,hd as WO,i as io,ib as Kw,ic as hs,id as YO,j as cT,ja as tw,jb as Ww,jc as gs,jd as XO,k as dT,ka as rw,kb as Yw,kc as Cs,kd as JO,l as pT,la as nw,lb as Xw,lc as ys,ld as QO,m as lT,ma as ow,mb as ss,mc as SO,md as ZO,na as iw,nb as as,nc as TO,nd as eR,o as uT,oa as sw,oc as EO,od as tR,p as mT,pa as aw,pb as cs,pc as AO,pd as rR,qb as Jw,qc as xO,qd as nR,r as fT,ra as cw,rc as bO,rd as oR,sb as Qw,sc as wO,t as _T,ta as dw,tb as Zw,tc as OO,u as hT,ua as pw,ub as eO,uc as RO,v as gT,va as lw,vc as PO,vd as Rt,wa as uw,wb as tO,wc as MO,wd as iR,x as CT,xa as mw,xc as IO,xd as sR,y as yT,yc as vO,yd as aR,zb as rO,zc as kO,zd as dR}from"./chunks/chunk-3TXEWHQX.js";import{A as Fw,B as Gw,C as Uw,D as jw,E as Bw,F as ns,G as os,H as is,a as Hb,b as Vb,c as Kb,d as Wb,e as Yb,f as Xb,g as Jb,h as Qb,i as Zb,l as Sw,o as Tw,p as Ew,t as Aw,u as ts,v as xw,w as Nw,x as Lw,y as $w,z as Dw}from"./chunks/chunk-KXTKLDKD.js";import"./chunks/chunk-3AZOATC2.js";import{$a as Zo,$c as aA,$d as FA,$e as Ix,$g as Sb,A as Qn,Aa as Bo,Ab as li,Ad as mA,Ae as lx,B as Zn,Ba as qo,Bb as ui,Bd as fA,Be as ux,C as eo,Ca as zo,Cb as mi,Cc as FE,Cd as _A,Ce as mx,D as to,Da as Ho,Db as fi,Dc as GE,Dd as hA,De as fx,E as ro,Ea as Vo,Eb as _i,Ec as UE,Ee as _x,F as no,Fa as gE,Fc as jE,Fe as hx,G as oo,Ga as CE,Gc as BE,Gd as gA,Ge as gx,Hb as xE,Hc as qE,Hd as CA,Hg as cb,Ib as bE,Ic as zE,Id as yA,If as Bx,Ig as db,Jb as hi,Jc as HE,Jd as SA,Je as Cx,Jf as Ge,Jg as pb,Kc as VE,Kd as TA,Ke as yx,Kf as xt,Lc as KE,Ld as EA,Le as Sx,Lf as qx,Lg as lb,M as Ct,Mc as WE,Md as AA,Me as Tx,Mf as zx,Mg as ub,N as yt,Nb as wE,Nc as YE,Nd as xA,Ne as Ex,Nf as Hx,Ob as OE,Od as bA,Oe as Ax,Of as Vx,Og as mb,Pd as wA,Pe as xx,Pf as q,Pg as Vi,Q as No,Qc as XE,Qd as OA,Qe as bx,Qf as Kx,Rc as JE,Rd as RA,Rf as Wx,Rg as Ki,S as kT,Sa as Ko,Sc as QE,Sd as PA,Sf as Yx,Sg as Wi,T as NT,Ta as Wo,Tc as ZE,Td as MA,Tf as Xx,Ua as yE,Uc as eA,Ud as IA,Ue as wx,Va as Yo,Vc as tA,Vd as vA,Ve as Ox,Vf as zi,Vg as fb,Wa as Xo,Wc as rA,Wd as kA,Wf as Hi,Wg as _b,X as LT,Xa as SE,Xb as RE,Xc as nA,Xd as NA,Xg as hb,Ya as Jo,Yb as PE,Yc as oA,Yd as LA,Ye as Rx,Yg as gb,Za as Qo,Zb as ME,Zc as iA,Zd as $A,Ze as Px,Zg as Cb,_ as $T,_a as L,_b as IE,_c as sA,_d as DA,_e as Mx,_g as yb,a as XS,ac as vE,ae as GA,af as vx,ah as Yi,b as JS,ba as DT,bc as kE,bd as Ei,be as UA,bf as kx,bh as Tb,c as QS,cd as Ai,ce as jA,cf as Nx,ch as Eb,d as ZS,dd as xi,de as BA,df as Lx,e as eT,ea as FT,ed as bi,ee as qA,f as tT,fa as HT,fb as Fe,fd as wi,fe as zA,ff as $x,fg as Jx,fh as Ab,g as rT,ga as VT,gb as ei,gd as Oi,ge as HA,gf as Dx,gg as bt,gh as xb,h as nT,ha as KT,hc as NE,hd as Ri,he as VA,hf as Fx,hg as Qx,hh as bb,i as oT,ia as WT,id as Pi,ie as KA,if as Gx,ig as Zx,ih as wb,j as iT,ja as YT,jc as gi,jd as Mi,je as WA,jf as Ux,jg as eb,jh as Ob,k as sT,ka as QT,kc as Ci,kd as Ii,ke as YA,kh as Rb,l as Gn,la as ZT,lc as yi,ld as vi,le as XA,lf as jx,lh as Xi,m as Un,ma as eE,mc as Si,md as ki,me as JA,mf as Bi,mg as tb,n as jn,na as tE,nb as TE,nd as Ni,ne as QA,nf as qi,ng as rb,o as Bn,oa as rE,ob as EE,od as Li,oe as ZA,og as nb,oh as Pb,p as qn,pa as nE,pb as AE,pd as $i,pe as ex,pg as ob,ph as Ji,q as zn,qa as oE,qb as ti,qd as Di,qe as tx,qg as ib,r as Hn,ra as iE,rb as ri,rd as Fi,re as rx,s as Ne,sa as sE,sb as ni,sc as LE,sd as Gi,se as nx,sh as Mb,t as Le,ta as aE,tb as oi,tc as $E,td as Ui,te as ox,tg as sb,th as Ib,u as Vn,ua as cE,ub as ii,uc as DE,ud as ji,ue as ix,uh as vb,v as Kn,va as dE,vb as si,vd as cA,ve as sx,vg as ab,vh as kb,w as Wn,wa as pE,wb as ai,wd as dA,we as ax,wh as Nb,x as Yn,xa as Uo,xb as ci,xd as pA,xe as cx,y as Xn,ya as jo,yb as di,yc as Ti,yd as lA,ye as dx,z as Jn,zb as pi,zd as uA,ze as px}from"./chunks/chunk-SJWIPGZW.js";import{b as AT,c as xT,d as bT,g as go,h as wT,i as OT,j as RT,k as PT,m as Co,n as yo,o as De,p as MT,q as IT,r as So,s as To,u as Eo}from"./chunks/chunk-GSLOAEY2.js";import"./chunks/chunk-NVYDPNQP.js";import{$ as Ta,$a as Tc,A as sP,Aa as Wa,B as Js,Ba as Ya,C as Qs,Ca as Xa,D as Zs,Da as Ja,Ea as Qa,F as ea,Fa as Za,G as ta,Ga as ec,H as ra,Ha as tc,I as na,Ia as rc,J as oa,Ja as nc,K as ia,Ka as oc,L as sa,La as ic,M as aa,Ma as sc,N as ca,Na as ac,O as da,Oa as cc,P as pa,Pa as dc,Q as la,Qa as pc,R as ua,Ra as lc,S as ma,Sa as uc,Ta as mc,U as fa,Ua as fc,V as _a,Va as _c,W as ha,Wa as hc,X as ga,Xa as gc,Y as Ca,Ya as Cc,Z as ya,Za as yc,_ as Sa,_a as Sc,aa as Ea,ab as Ec,b as BR,ba as Aa,bb as Ac,c as qR,ca as xa,cb as xc,d as zR,da as ba,db as bc,e as HR,ea as wa,eb as wc,f as VR,fa as Oa,fb as Oc,ga as Ra,gb as Rc,h as KR,ha as Pa,hb as Pc,i as WR,ia as Ma,ib as Mc,j as Xs,ja as Ia,jb as Ic,k as YR,ka as va,kb as vc,la as ka,ma as Na,mb as Be,n as XR,na as La,nb as Z,o as JR,oa as $a,ob as kc,p as Ue,pa as Da,q as QR,qa as Fa,r as ZR,ra as Ga,s as eP,sa as Ua,t as Pt,ta as ja,u as je,ua as Ba,v as tP,va as qa,w as rP,wa as za,x as nP,xa as Ha,y as oP,ya as Va,z as iP,za as Ka}from"./chunks/chunk-JPJNJHQW.js";import{I as ko,L as Tt,N as Et,Q as Lo,R as $o,S as At,U as GT,W as UT,Y as Go,a as R,b as YS,c as gt,da as fE,e as Mn,f as In,g as vn,ga as _E,h as kn,ha as hE,i as ve,j as Nn,k as N,l as ke,m as Ln,n as $n,o as Dn,p as Fn,q as Ao,r as xo,s as bo,t as wo,u as Oo,v as Ro,w as Po,x as Mo,y as Io,z as vo}from"./chunks/chunk-VCXQ6A35.js";import{_ as lE,a as po,b as lo,ba as Do,c as uo,ca as uE,da as Fo,fa as mE,h as mo,j as fo,k as _o,l as ho}from"./chunks/chunk-TE6FBDHP.js";import{A as ue,B as WS,C as S,E as so,F as St,G as me,H as ao,L as $e,N as co,b as jS,c as BS,d as qS,m as zS,r as HS,u as VS,y as KS}from"./chunks/chunk-K672XXGQ.js";import"./chunks/chunk-XAWE4EAK.js";var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function zg(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=qg(t[x.clientInfo]),i=zg(t[x.logLevel]);return{protocolVersion:z,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function D0(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function F0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function G0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function Hg(e,t){return Xe({...e,resultType:"complete"},t)}function U0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Hg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function j0(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}var Vg=new Set(["--help","-h","--version","-V"]);function Kg(e,t){let n=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&n.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),n.join(`
2
2
  `)}function z0(e,t,r){if(e.length===0)return{kind:"serve"};let n=e.find(i=>!Vg.has(i));if(n!==void 0){let i=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(n)}. Run ${i} --help.
3
3
  `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Kg(t,r):`${r}
4
4
  `,stderr:""}}import{createHash as ar,createHmac as cr,timingSafeEqual as Wg}from"node:crypto";var Yg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},dr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Xg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Ce(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let n={};for(let[o,i]of r){if(!dr.test(o)||!h(i))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!Yg.includes(s))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Xg(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(i.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Ce(n,Qe,"inputRequests"),n}function pr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[n,o]of t){if(!dr.test(n)||!h(o))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Ce(r,Qe,"inputResponses"),r}function W0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[x.serverInfo]:{...e.serverInfo}}}}function lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function Y0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let n=r.toString("base64url"),o=cr("sha256",lr(t)).update(n).digest("base64url");return`${n}.${o}`}function Jg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function X0(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=cr("sha256",lr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Wg(s,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=Jg(c),{expiresAt:p,method:l,parameterDigest:f,principal:g}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:p});if(l!==r.method||f!==r.parameterDigest||g!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function J0(e){return Ce(e,Qe,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ar("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function Qg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function Q0(e,t){return{...e,...Qg(t)}}function Zg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function eC(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Zg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function tC(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,n=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function rC(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function nC(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&eC(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function Z0(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=tC(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Ce(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:n,maximumNodes:o});nC(e,a.value),rC(a,i)}return structuredClone(e)}import{randomUUID as oC}from"node:crypto";import{readFile as iC}from"node:fs/promises";import ur from"node:path";var aL="io.modelcontextprotocol/tasks",sC=["working","input_required","completed","failed","cancelled"],aC=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,cC=3600*1e3,dC=1e3,Se=1024,pC=30,lC=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!aC.test(t))throw et("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function fr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function uC(e){if(!sC.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function mC(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function fC(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function _C(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function hC(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function gC(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function CC(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=uC(e.status),n=mC(e.principal),o=fC(e.workerPid),i=_C(e.ttlMs),s=hC(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:gC(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=fr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function re(e){return e==="completed"||e==="failed"||e==="cancelled"}function yC(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${oC()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return CC(JSON.parse(await iC(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
@@ -3,11 +3,13 @@ export declare const URL_CREDENTIAL_PLACEHOLDER="[redacted]";
3
3
  /**
4
4
  * Remove every span of one token that could be URL userinfo. Any URL a parser
5
5
  * accepts has a `:` after its scheme, and userinfo always ends at an `@`, so
6
- * userinfo lies inside the span between the token's first `:` and its last
6
+ * a URL's userinfo lies inside the span between its first `:` and its last
7
7
  * `@`. Replacing that whole span (after any scheme slashes) is complete for
8
8
  * every spelling a parser normalizes: backslash authorities, tabs inside a
9
9
  * scheme, wrapper chains such as `git+https:` or `npm:`, inline `--flag=value`
10
- * tokens and single-label or `host:port` authorities. Only a token that
10
+ * tokens and single-label or `host:port` authorities. In a token with blanks
11
+ * the span starts after its longest provably public prefix ({@link urlStarts}),
12
+ * so a public URL before a separate credential URL survives (pm-gh1799). Only a URL that
11
13
  * provably holds no userinfo is left alone, such as a scoped-package or blob
12
14
  * URL. The remaining cost is deliberate: prose such as `Reminder: ping @bob`
13
15
  * or `alias@npm:@scope/pkg@1.0.0` is treated as possible userinfo. Such a
@@ -1,2 +1,2 @@
1
- import{AsyncLocalStorage as H}from"node:async_hooks";import{escapeCmdMetacharacters as F,escapePowerShellSingleQuotes as j,quoteWindowsCommandArg as z}from"./command-line.js";import{EXIT_CODE as B}from"./constants.js";import{PmCliError as G}from"./errors.js";const y="[redacted]",X=/%\^?40/giu,g=/@|%\^?40/iu;function C(e,t=e.length){let n=-1;for(const r of e.matchAll(X)){if(r.index>t)break;n=r.index}return n}function v(e,t){if(/[\t\n\r]/u.test(e)||!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;const r=e.indexOf("/",n)-n;if(r<0)return!1;const s=n+r;return!/[:@%]/u.test(e.slice(n,s))&&!/[:%]|[/\\][/\\]/u.test(e.slice(s))}function S(e){const t=Math.max(e.lastIndexOf("@"),C(e)),n=e.indexOf(":");if(t<0||n<0||n>t)return;let r=n+1;for(;r<t&&r<n+3&&(e[r]==="/"||e[r]==="\\");)r+=1;return r===t||v(e,n)?void 0:[r,t]}function _(e){const t=S(e);return t?`${e.slice(0,t[0])}${y}${e.slice(t[1])}`:e}function I(e){return _(e)}const T=["author","assignee","claim_principal"];function ye(e){const t={...e};for(const n of T)typeof t[n]=="string"&&(t[n]=I(t[n]));return t}function w(e,t){if(!(typeof e!="string"||S(e.trim())===void 0))throw new G(`${t} must not carry URL credentials: an identity is a name, never a credential.`,B.USAGE,{code:"invalid_argument_value",field:t,required:`Set ${t} to a plain name such as agent-a, with no URL userinfo (no user, password or token before the host).`,nextSteps:[`Rerun with ${t} set to a plain name.`],url_credentials_rejected:{source:t}})}function Ce(e,t){return w(e,t),e}const Z=[["comments","author"],["notes","author"],["learnings","author"],["dependencies","author"],["plan_decisions","author"],["plan_discoveries","author"],["plan_steps","owner"],["tests","provenance","author"],["tests","updated_by"]],x=4;function m(e,t,n=0){if(typeof e=="string"){w(e,t);return}if(!(n>=x||typeof e!="object"||e===null))for(const r of Object.values(e))m(r,t,n+1)}function Q(e,t){let n=e;for(const r of t){if(typeof n!="object"||n===null||Array.isArray(n))return;n=n[r]}return n}function Ie(e){const t=e;for(const n of T)m(t[n],n);for(const[n,...r]of Z){const s=t[n];Array.isArray(s)&&s.forEach((i,o)=>{m(Q(i,r),`${n}[${o}].${r.join(".")}`)})}}function Te(e){return typeof e=="string"?I(e):e}const h=6,q=65536,P={carried:!1,fragments:new Set,fragmentLength:h,shortSpellings:[]},A=new H;function R(e){const t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(const r of e){const s=r.toLowerCase();n+=s.length===r.length?s:r}return n}function k(e){const t=z(`${e}@`),n=[e,e.replaceAll(/(["\\$`])/gu,"\\$1"),e.replaceAll("'","'\\''"),t.slice(1,-2),F(t).slice(2,-3),j(e)];return[...n,...n.map(r=>JSON.stringify(r).slice(1,-1))]}function V(e){const t=e.indexOf(":");return t>=0&&t<e.length-1?e.slice(t+1):e}function Y(e){const t=new Set;let n=!1;for(const u of e){const c=S(u);if(c){n=!0;for(const f of k(V(u.slice(c[0],c[1]))))t.add(R(f))}}const r=[...t],s=r.reduce((u,c)=>u+Math.max(0,c.length-h+1)+1,0),i=Math.max(1,Math.ceil(s/q)),o=Math.max(h,i),l=new Set,a=new Set;for(const u of r){if(u.length<o){(u.length>=h||/\s/u.test(u))&&a.add(u);continue}for(let c=0;c+o<=u.length;c+=i)l.add(u.slice(c,c+o));l.add(u.slice(-o))}return{carried:n,fragments:l,fragmentLength:o,shortSpellings:[...a]}}function J(e,t){const n=R(e),r=new Uint8Array(e.length);let s=!1;const i=t.fragmentLength;for(let l=0;l+i<=n.length;l+=1)t.fragments.has(n.slice(l,l+i))&&(r.fill(1,l,l+i),s=!0);for(const l of t.shortSpellings)for(let a=n.indexOf(l);a>=0;a=n.indexOf(l,a+1))r.fill(1,a,a+l.length),s=!0;if(!s)return e;let o="";for(let l=0;l<e.length;l+=1)r[l]?(l===0||!r[l-1])&&(o+=y):o+=e[l];return o}function we(e,t){return A.run(Y(e),t)}function Pe(){return(A.getStore()??P).carried}const K=16,U=512,ee=/^(?:(?:[A-Za-z0-9-]+\.)+[A-Za-z0-9-]+|localhost):\d+$/iu,ne=260,te={'"':'"',"'":"'","`":"`","<":">","(":")","[":"]"},re=new Set(["http","https","ws","wss","ftp","file"]);function $(e,t=!1){const n=ae(e);if(n<0)return;const r=O(e,n);if(n-r<2)return;const s=te[e[r-1]??""],i=re.has(e.slice(r,n).toLowerCase());let o=n+1;for(;o<e.length&&(e[o]==="/"||e[o]==="\\");)o+=1;if(o===e.length)return{kind:"pending",closer:s,special:i};const l=p(e.slice(o),s);if(l.startsWith("[")||i&&/[/\\?#]/u.test(l)||E(l,s)>=0)return;const a=ue(l,t);return a===void 0?void 0:{kind:a,closer:s,special:i}}const se=new Set([")","]"]),ie="'\\''",oe="'\\\\''";function p(e,t){return t==="'"?D(e.replaceAll(oe,"_____").replaceAll(ie,"____")):t==='"'?D(e):e}function L(e,t){let n=t;for(;e[n]==="\\";)n+=1;return n}function le(e,t,n){const r=(n-t)%2===1;if(e[n]==='"')return r?n:-1;if(e[n]!=="^")return-1;if(e[n+1]==='"')return r?n+1:-1;const s=L(e,n+1);return e[s]==='"'&&(s-n-1)%2===1?s:-1}function D(e){const t=[];let n=0;for(let r=e.indexOf("\\");r>=0;r=e.indexOf("\\",r)){const s=L(e,r),i=le(e,r,s);i>=0&&(t.push(e.slice(n,r),"_".repeat(i+1-r)),n=i+1),r=i>=0?i+1:s}return n===0?e:`${t.join("")}${e.slice(n)}`}function E(e,t){if(t===void 0)return-1;if(!se.has(t))return ce(e,t);let n=e.length;for(;n>0&&/[.,;:!?*_~`]/u.test(e[n-1]);)n-=1;return n>0&&e[n-1]===t?n-1:-1}function ce(e,t){for(let n=e.indexOf(t);n>=0;n=e.indexOf(t,n+1)){if(t==="'"&&e[n+1]==="'"){n+=1;continue}let r=0;for(;n-r>0&&e[n-r-1]==="\\";)r+=1;if(r%2===0)return n}return-1}function ae(e){let t=-1;for(let n=e.length-2;n>=0;n-=1){if(e[n]!==":"||e[n+1]!=="/"&&e[n+1]!=="\\")continue;const r=O(e,n);if(r===0||/[=?&#"'`(<[{,]/u.test(e[r-1]))return n;t=n}return t}function O(e,t){let n=t;for(;n>0&&/[A-Za-z0-9+.-]/u.test(e[n-1]);)n-=1;return n}function ue(e,t){return e.includes(":")?!t&&e.length<=ne&&ee.test(e)?void 0:"user":g.test(e)?void 0:"label"}function fe(e,t,n,r=-1){const s=Math.min(e.length,t+U);let i=t,o=r,l=n.kind==="user",a=!1;for(let u=0;u<K&&i<s;u+=1){const c=M(e,i,s);if(c===void 0)break;const f=pe(e.slice(c[0],Math.min(c[1],s+3)),s-c[0],n);if(f.startsUrl)break;de(f,l,a)&&(o=c[1]);const d=/[\t\r\n]/u.test(e[c[1]]??"");if(l||=f.colon||f.trailingColon&&d,a||=f.trailingColon,f.endsAuthority)break;i=c[1]}return o}function de(e,t,n){return e.separator?t||e.colonBeforeSeparator||n&&(e.hasPath||e.closedByOpener):!1}function M(e,t,n){let r=t;for(;r<n&&/\s/u.test(e[r]);)r+=1;if(r===n)return;let s=r;for(;s<e.length&&!/\s/u.test(e[s]);)s+=1;return[r,s]}function N(e){const t=e.indexOf(":");return t>=0&&t<e.length-1&&!he.test(e)}const he=/^\d{1,2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[AaPp][Mm])?[.,;:!?)]*$/u;function pe(e,t,n){const r=p(e,n.closer),s=n.special?r.search(/[/\\?#]/u):-1,i=s<0?r:r.slice(0,s),o=E(i,n.closer),l=r.search(/:[/\\]/u),a=o<0?i:i.slice(0,o),u=Math.min(a.length,t)-1,c=u<0?-1:Math.max(a.lastIndexOf("@",u),C(a,u));return{startsUrl:l>=0&&o<0&&ge(r.slice(0,l+1)),separator:c>=0,colonBeforeSeparator:c>0&&(N(a.slice(0,c))||a[c-1]===":"),colon:N(a),trailingColon:a.endsWith(":"),hasPath:o<0&&c>=0&&/[/\\]/u.test(r.slice(c+1)),closedByOpener:o>=0,endsAuthority:s>=0||o>=0}}function ge(e){const t=O(e,e.length-1);return t<e.length-2&&/[A-Za-z]/u.test(e[t])&&(t===0||t===1&&/["'`(<[]/u.test(e[0]))}function Se(e,t,n){const r=$(t,/[\t\r\n]/u.test(e.charAt(n)));if(r?.kind!=="pending")return r===void 0?void 0:{opening:r,from:n,seed:-1,final:!1};const s=M(e,n,Math.min(e.length,n+U));if(s===void 0)return;const i=p(e.slice(s[0],s[1]),r.closer),o=/^[/\\]*/u.exec(i)[0],l=i.slice(o.length),a=r.special?l.split(/[/\\?#]/u,1)[0]:l,u=E(a,r.closer),c=`${o}${u<0?a:a.slice(0,u)}`,f=g.test(c),d=f?{...r,kind:"user"}:$(`${t}${c}`);if(d===void 0||d.kind==="pending")return;const W=f?s[1]:-1;return{opening:d,from:s[1],seed:W,final:c.length<i.length}}function _e(e){if(!/:[/\\]/u.test(e))return e;const t=/\S+/gu;let n="",r=0;for(let s=t.exec(e);s!==null;s=t.exec(e)){const i=Se(e,s[0],s.index+s[0].length);if(i===void 0)continue;const o=i.final?i.seed:fe(e,i.from,i.opening,i.seed);o!==-1&&(n+=`${e.slice(r,s.index)}${_(e.slice(s.index,o))}`,r=o,t.lastIndex=o)}return r===0?e:`${n}${e.slice(r)}`}function Re(e){const t=A.getStore()??P,n=b(e);return t.carried?b(J(n,t)):n}function b(e){return g.test(e)?_e(e).replaceAll(/\S+/gu,_):e}const Ue={neutralizeEscapedQuotes:p};export{y as URL_CREDENTIAL_PLACEHOLDER,Ie as assertIdentityFieldsWithoutUrlCredentials,w as assertIdentityWithoutUrlCredentials,Pe as invocationCarriesUrlCredentials,Ce as parseIdentityOption,I as redactIdentityCredentials,ye as redactIdentityFields,Te as redactOptionalIdentityCredentials,Re as redactUrlCredentialsInText,_ as redactUrlCredentialsInToken,we as runWithUrlCredentialInvocation,Ue as urlCredentialsTestOnly};
1
+ import{AsyncLocalStorage as z}from"node:async_hooks";import{escapeCmdMetacharacters as F,escapePowerShellSingleQuotes as B,quoteWindowsCommandArg as G}from"./command-line.js";import{EXIT_CODE as X}from"./constants.js";import{PmCliError as Z}from"./errors.js";const y="[redacted]",Q=/%\^?40/giu,h=/@|%\^?40/iu;function C(e,t=e.length){let n=-1;for(const r of e.matchAll(Q)){if(r.index>t)break;n=r.index}return n}function q(e,t){if(/[\t\n\r]/u.test(e)||!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;const r=e.indexOf("/",n)-n;if(r<0)return!1;const s=n+r;return!/[:@%]/u.test(e.slice(n,s))&&!/[:%]|[/\\][/\\]/u.test(e.slice(s))}function I(e){const t=Math.max(e.lastIndexOf("@"),C(e)),n=e.indexOf(":");if(t<0||n<0||n>t)return;let r=n+1;for(;r<t&&r<n+3&&(e[r]==="/"||e[r]==="\\");)r+=1;return r===t||q(e,n)?void 0:[r,t]}function V(e){return e.length<=D&&L.test(e)&&Number(e.slice(e.lastIndexOf(":")+1))<=65535}function Y(e){const t=e.indexOf(":");if(t<0)return!0;if(!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;const r=e.indexOf("/",n);if(r<0)return!1;const s=e.slice(n,r);return/[@%]/u.test(s)||s.includes(":")&&!V(s)?!1:!/[:%]|[/\\][/\\]/u.test(e.slice(r))}function J(e){const t=[0];if(!/\s/u.test(e))return t;let n=!0,r=0;for(const s of e.matchAll(/\S+/gu)){const i=s[0];/[\t\r\n]/u.test(e.slice(r,s.index))&&(n=!1),n&&s.index>0&&Ie(i)&&(I(e.slice(t.at(-1),s.index))===void 0?t.push(s.index):n=!1),n&&=Y(i),r=s.index+i.length}return t}function S(e){if(!h.test(e))return[];const t=J(e),n=[];return t.forEach((r,s)=>{const i=I(e.slice(r,t[s+1]));i&&n.push([r+i[0],r+i[1]])}),n}function _(e){const t=[];let n=0;for(const[r,s]of S(e))t.push(e.slice(n,r),y),n=s;return n===0?e:`${t.join("")}${e.slice(n)}`}function T(e){return _(e)}const P=["author","assignee","claim_principal"];function Re(e){const t={...e};for(const n of P)typeof t[n]=="string"&&(t[n]=T(t[n]));return t}function U(e,t){if(!(typeof e!="string"||S(e.trim()).length===0))throw new Z(`${t} must not carry URL credentials: an identity is a name, never a credential.`,X.USAGE,{code:"invalid_argument_value",field:t,required:`Set ${t} to a plain name such as agent-a, with no URL userinfo (no user, password or token before the host).`,nextSteps:[`Rerun with ${t} set to a plain name.`],url_credentials_rejected:{source:t}})}function $e(e,t){return U(e,t),e}const K=[["comments","author"],["notes","author"],["learnings","author"],["dependencies","author"],["plan_decisions","author"],["plan_discoveries","author"],["plan_steps","owner"],["tests","provenance","author"],["tests","updated_by"]],k=4;function m(e,t,n=0){if(typeof e=="string"){U(e,t);return}if(!(n>=k||typeof e!="object"||e===null))for(const r of Object.values(e))m(r,t,n+1)}function ee(e,t){let n=e;for(const r of t){if(typeof n!="object"||n===null||Array.isArray(n))return;n=n[r]}return n}function Le(e){const t=e;for(const n of P)m(t[n],n);for(const[n,...r]of K){const s=t[n];Array.isArray(s)&&s.forEach((i,o)=>{m(ee(i,r),`${n}[${o}].${r.join(".")}`)})}}function De(e){return typeof e=="string"?T(e):e}const p=6,ne=65536,w={carried:!1,fragments:new Set,fragmentLength:p,shortSpellings:[]},A=new z;function R(e){const t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(const r of e){const s=r.toLowerCase();n+=s.length===r.length?s:r}return n}function te(e){const t=G(`${e}@`),n=[e,e.replaceAll(/(["\\$`])/gu,"\\$1"),e.replaceAll("'","'\\''"),t.slice(1,-2),F(t).slice(2,-3),B(e)];return[...n,...n.map(r=>JSON.stringify(r).slice(1,-1))]}function re(e){const t=e.indexOf(":");return t>=0&&t<e.length-1?t+1:0}function se(e,t){return e.slice(t[0]+re(e.slice(t[0],t[1])),t[1])}function ie(e){const t=new Set;let n=!1;for(const r of e)for(const[s,i]of S(r)){n=!0;for(const o of te(se(r,[s,i])))t.add(R(o))}return{carried:n,spellings:[...t]}}function oe(e){const{carried:t,spellings:n}=ie(e),r=n.reduce((c,f)=>c+Math.max(0,f.length-p+1)+1,0),s=Math.max(1,Math.ceil(r/ne)),i=Math.max(p,s),o=new Set,l=new Set;for(const c of n){if(c.length<i){(c.length>=p||/\s/u.test(c))&&l.add(c);continue}for(let f=0;f+i<=c.length;f+=s)o.add(c.slice(f,f+i));o.add(c.slice(-i))}return{carried:t,fragments:o,fragmentLength:i,shortSpellings:[...l]}}function le(e,t){const n=R(e),r=new Uint8Array(e.length);let s=!1;const i=t.fragmentLength;for(let l=0;l+i<=n.length;l+=1)t.fragments.has(n.slice(l,l+i))&&(r.fill(1,l,l+i),s=!0);for(const l of t.shortSpellings)for(let c=n.indexOf(l);c>=0;c=n.indexOf(l,c+1))r.fill(1,c,c+l.length),s=!0;if(!s)return e;let o="";for(let l=0;l<e.length;l+=1)r[l]?(l===0||!r[l-1])&&(o+=y):o+=e[l];return o}function Ne(e,t){return A.run(oe(e),t)}function Me(){return(A.getStore()??w).carried}const ce=16,$=512,L=/^(?:(?:[A-Za-z0-9-]+\.)+[A-Za-z0-9-]+|localhost):\d+$/iu,D=260,ue={'"':'"',"'":"'","`":"`","<":">","(":")","[":"]"},fe=new Set(["http","https","ws","wss","ftp","file"]);function N(e,t=!1){const n=Se(e);if(n<0)return;const r=O(e,n);if(n-r<2)return;const s=ue[e[r-1]??""],i=fe.has(e.slice(r,n).toLowerCase());let o=n+1;for(;o<e.length&&(e[o]==="/"||e[o]==="\\");)o+=1;if(o===e.length)return{kind:"pending",closer:s,special:i};const l=g(e.slice(o),s);if(l.startsWith("[")||i&&/[/\\?#]/u.test(l)||E(l,s)>=0)return;const c=_e(l,t);return c===void 0?void 0:{kind:c,closer:s,special:i}}const ae=new Set([")","]"]),de="'\\''",he="'\\\\''";function g(e,t){return t==="'"?b(e.replaceAll(he,"_____").replaceAll(de,"____")):t==='"'?b(e):e}function M(e,t){let n=t;for(;e[n]==="\\";)n+=1;return n}function pe(e,t,n){const r=(n-t)%2===1;if(e[n]==='"')return r?n:-1;if(e[n]!=="^")return-1;if(e[n+1]==='"')return r?n+1:-1;const s=M(e,n+1);return e[s]==='"'&&(s-n-1)%2===1?s:-1}function b(e){const t=[];let n=0;for(let r=e.indexOf("\\");r>=0;r=e.indexOf("\\",r)){const s=M(e,r),i=pe(e,r,s);i>=0&&(t.push(e.slice(n,r),"_".repeat(i+1-r)),n=i+1),r=i>=0?i+1:s}return n===0?e:`${t.join("")}${e.slice(n)}`}function E(e,t){if(t===void 0)return-1;if(!ae.has(t))return ge(e,t);let n=e.length;for(;n>0&&/[.,;:!?*_~`]/u.test(e[n-1]);)n-=1;return n>0&&e[n-1]===t?n-1:-1}function ge(e,t){for(let n=e.indexOf(t);n>=0;n=e.indexOf(t,n+1)){if(t==="'"&&e[n+1]==="'"){n+=1;continue}let r=0;for(;n-r>0&&e[n-r-1]==="\\";)r+=1;if(r%2===0)return n}return-1}function Se(e){let t=-1;for(let n=e.length-2;n>=0;n-=1){if(e[n]!==":"||e[n+1]!=="/"&&e[n+1]!=="\\")continue;const r=O(e,n);if(r===0||/[=?&#"'`(<[{,]/u.test(e[r-1]))return n;t=n}return t}function O(e,t){let n=t;for(;n>0&&/[A-Za-z0-9+.-]/u.test(e[n-1]);)n-=1;return n}function _e(e,t){return e.includes(":")?!t&&e.length<=D&&L.test(e)?void 0:"user":h.test(e)?void 0:"label"}function me(e,t,n,r=-1){const s=Math.min(e.length,t+$);let i=t,o=r,l=n.kind==="user",c=!1;for(let f=0;f<ce&&i<s;f+=1){const u=W(e,i,s);if(u===void 0)break;const a=Oe(e.slice(u[0],Math.min(u[1],s+3)),s-u[0],n);if(a.startsUrl)break;Ae(a,l,c)&&(o=u[1]);const d=/[\t\r\n]/u.test(e[u[1]]??"");if(l||=a.colon||a.trailingColon&&d,c||=a.trailingColon,a.endsAuthority)break;i=u[1]}return o}function Ae(e,t,n){return e.separator?t||e.colonBeforeSeparator||n&&(e.hasPath||e.closedByOpener):!1}function W(e,t,n){let r=t;for(;r<n&&/\s/u.test(e[r]);)r+=1;if(r===n)return;let s=r;for(;s<e.length&&!/\s/u.test(e[s]);)s+=1;return[r,s]}function H(e){const t=e.indexOf(":");return t>=0&&t<e.length-1&&!Ee.test(e)}const Ee=/^\d{1,2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[AaPp][Mm])?[.,;:!?)]*$/u;function Oe(e,t,n){const r=g(e,n.closer),s=n.special?r.search(/[/\\?#]/u):-1,i=s<0?r:r.slice(0,s),o=E(i,n.closer),l=r.search(/:[/\\]/u),c=o<0?i:i.slice(0,o),f=Math.min(c.length,t)-1,u=f<0?-1:Math.max(c.lastIndexOf("@",f),C(c,f));return{startsUrl:l>=0&&o<0&&x(r.slice(0,l+1)),separator:u>=0,colonBeforeSeparator:u>0&&(H(c.slice(0,u))||c[u-1]===":"),colon:H(c),trailingColon:c.endsWith(":"),hasPath:o<0&&u>=0&&/[/\\]/u.test(r.slice(u+1)),closedByOpener:o>=0,endsAuthority:s>=0||o>=0}}function x(e){const t=O(e,e.length-1);return t<e.length-2&&/[A-Za-z]/u.test(e[t])&&(t===0||t===1&&/["'`(<[]/u.test(e[0]))}function ye(e,t,n){const r=N(t,/[\t\r\n]/u.test(e.charAt(n)));if(r?.kind!=="pending")return r===void 0?void 0:{opening:r,from:n,seed:-1,final:!1};const s=W(e,n,Math.min(e.length,n+$));if(s===void 0)return;const i=g(e.slice(s[0],s[1]),r.closer),o=/^[/\\]*/u.exec(i)[0],l=i.slice(o.length),c=r.special?l.split(/[/\\?#]/u,1)[0]:l,f=E(c,r.closer),u=`${o}${f<0?c:c.slice(0,f)}`,a=h.test(u),d=a?{...r,kind:"user"}:N(`${t}${u}`);if(d===void 0||d.kind==="pending")return;const v=a?s[1]:-1;return{opening:d,from:s[1],seed:v,final:u.length<i.length}}function Ce(e){if(!/:[/\\]/u.test(e))return e;const t=/\S+/gu;let n="",r=0;for(let s=t.exec(e);s!==null;s=t.exec(e)){const i=ye(e,s[0],s.index+s[0].length);if(i===void 0)continue;const o=i.final?i.seed:me(e,i.from,i.opening,i.seed);o!==-1&&(n+=`${e.slice(r,s.index)}${_(e.slice(s.index,o))}`,r=o,t.lastIndex=o)}return r===0?e:`${n}${e.slice(r)}`}function Ie(e){const t=e.search(/:[/\\]/u);return t>=0&&x(e.slice(0,t+1))}function be(e){const t=A.getStore()??w,n=j(e);return t.carried?j(le(n,t)):n}function j(e){return h.test(e)?Ce(e).replaceAll(/\S+/gu,_):e}const We={neutralizeEscapedQuotes:g};export{y as URL_CREDENTIAL_PLACEHOLDER,Le as assertIdentityFieldsWithoutUrlCredentials,U as assertIdentityWithoutUrlCredentials,Me as invocationCarriesUrlCredentials,$e as parseIdentityOption,T as redactIdentityCredentials,Re as redactIdentityFields,De as redactOptionalIdentityCredentials,be as redactUrlCredentialsInText,_ as redactUrlCredentialsInToken,Ne as runWithUrlCredentialInvocation,We as urlCredentialsTestOnly};
2
2
  //# sourceMappingURL=url-credentials.js.map
@@ -1,2 +1,2 @@
1
- import{AsyncLocalStorage as tt}from"node:async_hooks";import{attachExtensionReadOutputRows as et}from"./read-output/extension.js";import{quoteCommandArg as I,renderPmCommand as q}from"./command-line.js";import{attachOutputOmissionReceipt as nt}from"./output-projection.js";import{encodeQueryCursor as rt}from"./pagination.js";import{applyReadOutputDimensions as ot,decodeReadOutputContinuationCursor as it,isReadResultOmittedForBudget as z,resolveReadOutputSurface as dt,stabilizeReadOutputReceiptEstimates as ut}from"./read-output-contracts.js";import{estimateReadOutputTokens as T,MAX_ESTIMATE_ITERATIONS as st,readOutputMeasurementFormat as E,registerReadOutputPassHooks as at,resolveReadOutputRecoveryBudget as ct}from"./read-output-budget.js";import{propagateContextUsageServingReceipt as R}from"./context-usage.js";import{readOutputContinuationRowCollections as ft}from"./read-output-rows.js";import{EXIT_CODE as B}from"../core/shared/constants.js";import{PmCliError as A}from"../core/shared/errors.js";import{compactExplanatoryString as lt,isContinuationTokenKey as _t,isTrackerItemDocumentKey as gt}from"../core/shared/text-normalization.js";const mt="limit_overridden_by_intent",U=Object.freeze([{command:"context",intent:"orient",description:"Bounded active hierarchy, ownership, blockers, and recent progress.",included_field_groups:["summary","focus","hierarchy","blockers","activity"],token_budget:3e3,source:"core"},{command:"context",intent:"handoff",description:"Active ownership, evidence, decisions, and immediate continuation context.",included_field_groups:["summary","focus","in_progress","decisions","activity"],token_budget:2200,source:"core"},{command:"get",intent:"inspect",description:"Standard-depth item metadata, relationships, evidence, and lifecycle state.",included_field_groups:["item","children","claim_state","linked"],token_budget:3200,source:"core"},{command:"list",intent:"triage",description:"A budget-derived page of compact governance, ownership, priority, and blocker rows for triage.",included_field_groups:["identity","governance","ownership","dependencies"],token_budget:3200,source:"core"},{command:"next",intent:"execute",description:"The highest-ranked actionable work with concise ranking evidence.",included_field_groups:["recommended"],token_budget:1200,source:"core"},{command:"search",intent:"discover",description:"A budget-derived page of ranked canonical lineage candidates with compact match evidence.",included_field_groups:["identity","status","lineage","match"],token_budget:1800,source:"core"}]),G=new tt;function bt(){return G.getStore()??U}function Ht(t,e){return G.run(kt(t.workspaceContracts,t.packageContracts),e)}function ht(t,e){const n=t.command.trim().toLowerCase(),r=t.intent.trim().toLowerCase(),i=`${n}:${r}`;if(!/^[a-z0-9][a-z0-9-]*$/.test(n)||!/^[a-z0-9][a-z0-9-]*$/.test(r))throw new TypeError(`Invalid context intent command or name: ${i}`);if(t.description.trim().length===0)throw new TypeError(`Context intent ${i} requires a non-empty description`);if(!Number.isSafeInteger(t.token_budget)||t.token_budget<=0)throw new TypeError(`Context intent ${i} requires a positive integer token_budget`);const o=[...new Set(t.included_field_groups.map(d=>d.trim()).filter(Boolean))];if(o.length===0)throw new TypeError(`Context intent ${i} requires included_field_groups`);return{command:n,intent:r,description:t.description.trim(),included_field_groups:o,token_budget:t.token_budget,source:e}}function kt(t=[],e=[]){const n=[{source:"core",contracts:U,allowOverride:!1},{source:"package",contracts:e,allowOverride:!1},{source:"workspace",contracts:t,allowOverride:!0}],r=new Map,i=new Set;for(const o of n){i.clear();for(const d of o.contracts){const s=ht(d,o.source),u=`${s.command}:${s.intent}`;if(i.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);if(i.add(u),!o.allowOverride&&r.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);r.set(u,s)}}return[...r.values()].sort((o,d)=>o.command.localeCompare(d.command)||o.intent.localeCompare(d.intent))}function X(t,e,n=bt(),r=[]){const i=t.trim().toLowerCase(),o=e.trim().toLowerCase(),d=n.find(a=>a.command===i&&a.intent===o);if(d)return{...d,source:d.source??"core"};const s=n.filter(a=>a.command===i).map(a=>a.intent);if(s.length===0)return;const u=s.map(a=>{const f=Array.from({length:o.length+1},(b,g)=>g);for(let b=1;b<=a.length;b+=1){let g=f[0];f[0]=b;for(let h=1;h<=o.length;h+=1){const j=f[h];f[h]=Math.min(f[h]+1,f[h-1]+1,g+(a[b-1]===o[h-1]?0:1)),g=j}}return{candidate:a,distance:f[o.length]}}).sort((a,f)=>a.distance-f.distance||a.candidate.localeCompare(f.candidate))[0].candidate,c=[i,...r,"--for",o],l=[i,...r,"--for",u],_=q(l);throw new A(`Unknown context intent "${o}" for ${i}. Did you mean "${u}"?`,B.USAGE,{code:"unknown_context_intent",reason:"unknown_intent",field:"for",flag:"--for",value:o,required:`Use a declared ${i} intent.`,why:"Intent names are command-local contracts and cannot be inferred from output section names.",nextSteps:[_],recovery:{recovery_mode:"compact",attempted_command:q(c),allowed_values:[...s].sort(),suggested_retry:_,suggested_retry_args:l}})}function N(t,e){const n=k(t.limit),r=String(n===void 0?e:Math.min(n,e));return(t.limit===void 0||n!==void 0)&&(t.limit=r),r}const W={context:(t,e,n,r)=>{t.section===void 0&&t.depth===void 0&&(t.section=e.intent==="handoff"?["activity","progress","blockers"]:["hierarchy","blockers","activity"]),t.depth===void 0&&(t.depth=e.intent==="handoff"?"deep":"standard");const i=C(r,t.tokenBudget,e.token_budget),o=v("context",e.intent,i,n),d=N(t,o);t.activityLimit===void 0&&(t.activityLimit=d)},get:t=>{t.depth===void 0&&t.fields===void 0&&(t.depth="standard")},list:(t,e,n,r)=>{t.brief===void 0&&t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.fields="id,title,status,type,priority,parent,assignee,risk,blocked_by");const i=C(r,t.tokenBudget,e.token_budget),o=v("list",e.intent,i,n);N(t,o)},next:t=>{t.readyOnly===void 0&&(t.readyOnly=!0)},search:(t,e,n,r)=>{t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.compact=!0);const i=C(r,t.tokenBudget,e.token_budget),o=v("search",e.intent,i,n);N(t,o)}};function Qt(t,e,n=[]){const r=e.tokenBudget??e.token_budget;if(typeof e.for!="string"){if(r!==void 0&&(t==="get"||t==="list"||t==="search"))throw new A("--token-budget requires a declared context intent selected with --for",B.USAGE,{code:"missing_required_option",field:"for",required:"Select a context intent with --for when setting --token-budget.",why:"A token-budget override has no projection contract to constrain without a selected intent.",nextSteps:["Retry with --for <intent> --token-budget <n>, or omit --token-budget."]});if(e.tokenBudget!==void 0||e.token_budget===void 0)return e;const u={...e,tokenBudget:r};return delete u.token_budget,u}const i=X(t,e.for,void 0,n),o=w(e),d=k(r)!==void 0||typeof o=="number",s={...e};return s.tokenBudget===void 0&&r!==void 0&&(s.tokenBudget=r),delete s.token_budget,typeof o=="number"?s.tokenBudget=String(o):s.tokenBudget===void 0&&(s.tokenBudget=String(i.token_budget)),W[t](s,i,d,o),s}const pt={context:"bounded_sections",get:"standard_item",list:"bounded_fields_and_rows",next:"bounded_ranked_rows",search:"bounded_ranked_rows"},x=256;function S(t,e,n=!0,r=!0){return Array.isArray(t)?t.map(i=>S(i,e,n,!1)):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([i,o])=>[i,n&&typeof o=="string"&&_t(i)?o:S(o,e,n&&!(r&&gt(e,i)),!1)])):typeof t=="string"?lt(t):t}function k(t){const e=typeof t=="number"?t:typeof t=="string"&&/^\d+$/u.test(t.trim())?Number(t):Number.NaN;return Number.isSafeInteger(e)&&e>0?e:void 0}function w(t){const e=t.outputBudget??t.output_budget;return e==="unbounded"?e:k(e)}function yt(t){return w(t)===void 0?"--token-budget":"--output-budget"}function C(t,e,n){return typeof t=="number"?t:wt(e,n)}function wt(t,e){const n=k(t);if(n===void 0)return e;if(n<x)throw new A(`Context intent token budget must be at least ${x}`,B.USAGE,{code:"invalid_argument_value",reason:"below_minimum",field:"tokenBudget",value:String(t),required:`Use an integer token budget of at least ${x}.`,why:"Smaller ceilings cannot contain the minimum machine-readable intent receipt.",nextSteps:[`Retry with --token-budget ${x} or omit the override.`]});return n}function F(t,e){const n=t==="context"&&e==="orient";return t==="context"?n?{overhead:1200,rowCost:600}:{overhead:800,rowCost:500}:{overhead:t==="list"?520:480,rowCost:16}}function v(t,e,n,r){if(t==="get"||t==="next")return;const{overhead:i,rowCost:o}=F(t,e),d=Math.max(t==="context"?1:2,Math.floor((n-i)/o));return r?d:Math.min(t==="context"?20:100,d)}function p(t,e,n){const r=E(n),i=n.outputRowContract===!0||n.output_row_contract===!0;let o=e.estimated_tokens,d=o;for(let s=0;s<st;s+=1){e.estimated_tokens=o;const u=T(i||!Object.hasOwn(t,"row_contract")?t:Object.fromEntries(Object.entries(t).filter(([c])=>c!=="row_contract")),r);if(u===o)return;o=u,d=Math.max(d,o)}e.estimated_tokens=d}const K={context:["high_level","low_level","blocked_fallback","recently_created","unparented","hierarchy","activity","blockers"],get:["children"],list:["items"],next:["ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items"]};function J(t){try{const e=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return typeof e.fingerprint!="string"||!Number.isSafeInteger(e.after_index)?void 0:{fingerprint:e.fingerprint,after_index:e.after_index,...typeof e.snapshot=="string"?{snapshot:e.snapshot}:{}}}catch{return}}function xt(t){if(t===null||typeof t!="object")return;if(typeof t.id=="string")return t.id;const e=t.item?.id;return typeof e=="string"?e:void 0}function Ct(t,e,n,r){let i=!1;for(;;){if(p(t,e,r),e.estimated_tokens<=e.token_budget||n.length<=1)return i;const o=Buffer.byteLength(JSON.stringify(n),"utf8"),d=(e.estimated_tokens-e.token_budget)*4;n.splice(-Math.min(n.length-1,Math.max(1,Math.ceil(d/Math.max(1,Math.ceil(o/n.length)))))),i=!0}}function vt(t,e,n){const r=t.items,i=typeof t.next_cursor=="string",o=i?t.next_cursor:n.after;if(!Array.isArray(r)||typeof o!="string")return!1;const d=J(o);if(d===void 0)return!1;const s=r.length,u=[...r];let c=!1;for(;;){if(c=Ct(t,e,r,n)||c,!c)return!1;const l=xt(r.at(-1));if(l===void 0)return r.splice(0,r.length,...u),p(t,e,n),!1;if(t.next_cursor=rt(d.fingerprint,l,i?d.after_index-(s-r.length):d.after_index+r.length,d.snapshot),p(t,e,n),e.estimated_tokens<=e.token_budget||r.length<=1)break}return typeof t.count=="number"&&(t.count=r.length),typeof t.applied_limit=="number"&&(t.applied_limit=r.length),!0}function Ot(t,e,n,r){if(t==="list"||t==="search")return vt(e,n,r);if(t!=="next"||typeof e.next_cursor=="string")return!1;let i=!1;for(;;){if(p(e,n,r),n.estimated_tokens<=n.token_budget)return i;const o=K[t].map(a=>({key:a,rows:Array.isArray(e[a])?e[a]:[]})).filter(({rows:a})=>a.length>0).sort((a,f)=>f.rows.length-a.rows.length||a.key.localeCompare(f.key))[0];if(o===void 0)return i;const d=K[t].reduce((a,f)=>a+(Array.isArray(e[f])?e[f].length:0),0);if(d<=1)return i;const s=Math.min(o.rows.length,d-1),u=Buffer.byteLength(JSON.stringify(o.rows),"utf8"),c=Math.max(1,Math.ceil(u/o.rows.length)),l=(n.estimated_tokens-n.token_budget)*4,_=Math.min(s,Math.max(1,Math.ceil(l/c)));o.rows.splice(-_,_),i=!0}}function $(t,e,n){if(typeof e.for!="string")return n;const r=t.startsWith("list-")?"list":t;if(!(r in W))return n;const i=r,o=X(i,e.for),d=w(e),s=C(d,e.tokenBudget??e.token_budget,o.token_budget),u={command:i,intent:o.intent,source:o.source,included_field_groups:[...o.included_field_groups],token_budget:s,declared_token_budget:o.token_budget,token_budget_override:s-o.token_budget,estimated_tokens:0,within_budget:!0,degradation:pt[i],declaration_feasible:!0,result_omitted:!1},c={...n},l=v(i,o.intent,u.token_budget,k(e.tokenBudget??e.token_budget)!==void 0||typeof d=="number");if(l!==void 0){const g=k(e.limit),h=g!==void 0&&g<l;u.budget_derived_limit=l,u.binding_constraint=h?"explicit_limit":"token_budget",u.limit_reason=h?"The caller supplied a smaller row limit than the budget-derived ceiling.":"The selected intent token budget constrains the effective row ceiling.",c.budget_derived_limit=l,Bt({builtInCommand:i,intent:o.intent},u,c,e)}const _=L.get(e)??0,a=u.token_budget;u.token_budget=a-_;const f=d==="unbounded"?M(c,u,e):It(i,c,u,e,dt(t,e));u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget;const b=V(d,u,f,()=>H(t,i,o.intent,{...u,token_budget:a,estimated_tokens:u.estimated_tokens+_},c,e));return u.result_omitted&&(u.estimated_tokens+=_,u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget),u.token_budget=a,b}function M(t,e,n){const r={...t,context_intent:e};return p(r,e,n),r}function It(t,e,n,r,i){let o=M(e,n,r);return n.estimated_tokens>n.token_budget&&(n.degradation="recursive_budget_compaction",o=M(S(e,i),n,r)),n.estimated_tokens>n.token_budget&&Ot(t,o,n,r)&&(n.degradation="budget_row_compaction",p(o,n,r)),o}const L=new WeakMap;function V(t,e,n,r){return e.estimated_tokens<=e.token_budget||(e.within_budget=!1,t==="unbounded")?n:(e.degradation="budget_receipt_only",e.result_omitted=!0,typeof t=="number"?{output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},context_intent:e}:{budget_exceeded:{omitted_result:!0,reason:e.token_budget_override===0?"declared_budget_infeasible":"effective_budget_infeasible",restore_with:r()},context_intent:e})}const Tt=["applied_limit","completeness","context_intent","count","filters","has_more","now","omission_receipt","projection","row_contract","sorting","total","truncated"];function Y(t,e){if(typeof t.after!="string"||t.after.length===0||z(e))return e;const n=J(t.after)?.fingerprint??"opaque_cursor",r={...e};for(const i of Tt)delete r[i];return r.continuation_contract={fingerprint:n,metadata:"reference",restore_with:"omit --after"},r}function m(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Et(t,e){const n=t==="get"&&m(e.item)&&typeof e.item.id=="string"?e.item.id:t==="search"&&typeof e.query=="string"?e.query:void 0;return n===void 0?"":` ${I(n)}`}function Rt(t){return typeof t.fields=="string"&&t.fields.trim()!==""?` --fields ${I(t.fields)}`:""}function Bt(t,e,n,r){const i=k(r.limit),o=e.budget_derived_limit;if(i===void 0||i<=o)return;const{overhead:d,rowCost:s}=F(t.builtInCommand,t.intent),u=Math.max(e.token_budget,d+s*i);e.limit_reason=`The ${e.token_budget}-token ${t.intent} budget carries ${o} rows, so it reduced the caller's --limit ${i}.`,e.limit_override={flag:"--limit",requested:i,effective:o,...Number.isSafeInteger(u)?{token_budget_for_requested:u,restore_with:`${yt(r)} ${u}`}:{}};const c=`${mt}:--limit ${i}->${o}`;n.warnings=Array.isArray(n.warnings)?[...n.warnings,c]:[c],m(n.filters)&&(n.filters={...n.filters,requested_limit:String(i)})}function H(t,e,n,r,i,o){const d=Et(e,i),s=e==="get"?"":` --limit ${r.budget_derived_limit??1}`,{output_budget:u}=ct({effective_budget_tokens:r.token_budget,measured_result_tokens:r.estimated_tokens});return`pm ${t}${d}${Rt(o)} --for ${I(n)} --token-budget ${u}${s}`}function y(t,e){if(m(t))return typeof t[e]=="number"?t[e]:void 0}function Q(t,e){let n=t;for(let r=0;r<8;r+=1){At(n);const i=y(n.context_intent,"estimated_tokens"),o=y(n.read_output,"estimated_tokens"),d=y(n.read_session,"spent_this_call_tokens");if(m(n.context_intent)&&n.context_intent.result_omitted!==!0&&p(n,n.context_intent,e),n=ut(n,e),y(n.context_intent,"estimated_tokens")===i&&y(n.read_output,"estimated_tokens")===o&&y(n.read_session,"spent_this_call_tokens")===d)break}return n}function At(t){const e=t.context_intent;m(e)&&Number(e.estimated_tokens)>Number(e.token_budget)&&(e.within_budget=!1)}function Nt(t,e){const n=e.context_intent;if(!m(n)||n.result_omitted===!0)return;const r=n.degradation==="recursive_budget_compaction"||n.degradation==="budget_row_compaction",i={...e};for(const o of ft(t)){const d=e[o.path];if(Array.isArray(d)&&Array.isArray(o.value)&&d.length<=o.value.length){const s=o.value.slice(0,d.length);i[o.path]=r?s.map(D):s}}return i}function D(t){return Array.isArray(t)?t.map(D):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,D(n)])):t}function Zt(t,e,n){const r=nt(t,et(t??"",n));if(typeof r!="object"||r===null||Array.isArray(r))return R(n,r),r;const i=t??"",o=r,d=$(i,e,o),s=y(d.context_intent,"estimated_tokens"),u=Nt(o,d),c=O(i,e,n,d,u),l=P(e,c,d.context_intent);if(l===void 0)return St(e,c,d)?Mt(i,e,n,o,d,Number(s),u,c):c;const _={...e};L.set(_,l.estimated-Number(s));const a=$(i,_,o),f=Z(i,e,_,n,a,u),b=f===void 0?l:P(e,f,a.context_intent);if(b===void 0)return f;const g={...b.receipt,estimated_tokens:b.estimated};return O(i,{...e,outputCursor:void 0,output_cursor:void 0},n,V(w(e),g,f??c,()=>H(i,g.command,g.intent,g,o,e)))}function St(t,e,n){const r=n.context_intent;return Object.hasOwn(e,"output_budget_exceeded")&&m(r)&&r.result_omitted!==!0&&$t.has(String(r.command))&&(t.outputInclude??t.output_include)===void 0&&(t.outputSession??t.output_session)===void 0}const $t=new Set(["list","search"]);function Mt(t,e,n,r,i,o,d,s){const u=O(t,{...e,outputBudget:"unbounded"},n,{...i,context_intent:{...i.context_intent}},d),c={...e};L.set(c,T(u,E(e))-o);const l=$(t,c,r),_=Z(t,e,c,n,l,d);return _===void 0||Object.hasOwn(_,"output_budget_exceeded")||P(e,_,l.context_intent)!==void 0?s:_}function Z(t,e,n,r,i,o){return z(i)||Lt(e,i)?void 0:O(t,n,r,i,o)}function Lt(t,e){const n=t.outputCursor??t.output_cursor;if(typeof n!="string")return!1;const r=it(n),i=e[r.path];return Array.isArray(i)&&i.length<=r.offset}function P(t,e,n){const r=m(e.context_intent),i=r?e.context_intent:n;if(!m(i)||i.result_omitted===!0||Object.hasOwn(e,"output_budget_exceeded"))return;const o=i,d=r?o.estimated_tokens:T(e,E(t));return w(t)==="unbounded"||d<=o.token_budget?void 0:{receipt:o,estimated:d}}function Dt(t){return!m(t)||t.result_omitted===!0?{}:{mirrorEstimate:(e,n)=>{m(e.context_intent)&&(e.context_intent.estimated_tokens=n)}}}function O(t,e,n,r,i){const o={...e,outputRowContract:e.outputRowContract===!0||e.output_row_contract===!0};at(o,{...i===void 0?{}:{continuationBinding:Y(e,i)},...Dt(r.context_intent)});const d=ot(t,o,Y(e,r));if(R(n,d),e.outputRowContract===!0||e.output_row_contract===!0||!Object.hasOwn(d,"row_contract"))return m(d.context_intent)?Q(d,e):d;const s=Object.fromEntries(Object.entries(d).filter(([c])=>c!=="row_contract"));Object.defineProperty(s,"row_contract",{value:d.row_contract,enumerable:!1,configurable:!0});const u=Q(s,e);return delete u.row_contract,R(d,u),u}export{mt as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,U as PM_CONTEXT_INTENT_CONTRACTS,Qt as applyContextIntentProjection,$ as attachContextIntentReceipt,Zt as attachReadOutputContracts,kt as composeContextIntentContracts,xt as contextIntentRowId,J as decodeContextIntentCursor,bt as getActiveContextIntentContracts,X as resolveContextIntentContract,Ht as runWithContextIntentContracts};
1
+ import{AsyncLocalStorage as tt}from"node:async_hooks";import{attachExtensionReadOutputRows as et,resolveExtensionOutputCommand as nt}from"./read-output/extension.js";import{quoteCommandArg as I,renderPmCommand as q}from"./command-line.js";import{attachOutputOmissionReceipt as rt}from"./output-projection.js";import{decodeQueryCursorEnvelope as ot,encodeQueryCursor as it}from"./pagination.js";import{applyReadOutputDimensions as dt,decodeReadOutputContinuationCursor as ut,isReadResultOmittedForBudget as z,resolveReadOutputSurface as st,stabilizeReadOutputReceiptEstimates as ct}from"./read-output-contracts.js";import{estimateReadOutputTokens as E,MAX_ESTIMATE_ITERATIONS as at,readOutputMeasurementFormat as T,registerReadOutputPassHooks as ft,resolveReadOutputRecoveryBudget as lt}from"./read-output-budget.js";import{propagateContextUsageServingReceipt as R}from"./context-usage.js";import{readOutputContinuationRowCollections as _t}from"./read-output-rows.js";import{EXIT_CODE as B}from"../core/shared/constants.js";import{PmCliError as A}from"../core/shared/errors.js";import{compactExplanatoryString as gt,isContinuationTokenKey as mt,isTrackerItemDocumentKey as bt}from"../core/shared/text-normalization.js";const ht="limit_overridden_by_intent",U=Object.freeze([{command:"context",intent:"orient",description:"Bounded active hierarchy, ownership, blockers, and recent progress.",included_field_groups:["summary","focus","hierarchy","blockers","activity"],token_budget:3e3,source:"core"},{command:"context",intent:"handoff",description:"Active ownership, evidence, decisions, and immediate continuation context.",included_field_groups:["summary","focus","in_progress","decisions","activity"],token_budget:2200,source:"core"},{command:"get",intent:"inspect",description:"Standard-depth item metadata, relationships, evidence, and lifecycle state.",included_field_groups:["item","children","claim_state","linked"],token_budget:3200,source:"core"},{command:"list",intent:"triage",description:"A budget-derived page of compact governance, ownership, priority, and blocker rows for triage.",included_field_groups:["identity","governance","ownership","dependencies"],token_budget:3200,source:"core"},{command:"next",intent:"execute",description:"The highest-ranked actionable work with concise ranking evidence.",included_field_groups:["recommended"],token_budget:1200,source:"core"},{command:"search",intent:"discover",description:"A budget-derived page of ranked canonical lineage candidates with compact match evidence.",included_field_groups:["identity","status","lineage","match"],token_budget:1800,source:"core"}]),G=new tt;function kt(){return G.getStore()??U}function jt(t,e){return G.run(yt(t.workspaceContracts,t.packageContracts),e)}function pt(t,e){const n=t.command.trim().toLowerCase(),o=t.intent.trim().toLowerCase(),i=`${n}:${o}`;if(!/^[a-z0-9][a-z0-9-]*$/.test(n)||!/^[a-z0-9][a-z0-9-]*$/.test(o))throw new TypeError(`Invalid context intent command or name: ${i}`);if(t.description.trim().length===0)throw new TypeError(`Context intent ${i} requires a non-empty description`);if(!Number.isSafeInteger(t.token_budget)||t.token_budget<=0)throw new TypeError(`Context intent ${i} requires a positive integer token_budget`);const r=[...new Set(t.included_field_groups.map(d=>d.trim()).filter(Boolean))];if(r.length===0)throw new TypeError(`Context intent ${i} requires included_field_groups`);return{command:n,intent:o,description:t.description.trim(),included_field_groups:r,token_budget:t.token_budget,source:e}}function yt(t=[],e=[]){const n=[{source:"core",contracts:U,allowOverride:!1},{source:"package",contracts:e,allowOverride:!1},{source:"workspace",contracts:t,allowOverride:!0}],o=new Map,i=new Set;for(const r of n){i.clear();for(const d of r.contracts){const s=pt(d,r.source),u=`${s.command}:${s.intent}`;if(i.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);if(i.add(u),!r.allowOverride&&o.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);o.set(u,s)}}return[...o.values()].sort((r,d)=>r.command.localeCompare(d.command)||r.intent.localeCompare(d.intent))}function X(t,e,n=kt(),o=[]){const i=t.trim().toLowerCase(),r=e.trim().toLowerCase(),d=n.find(c=>c.command===i&&c.intent===r);if(d)return{...d,source:d.source??"core"};const s=n.filter(c=>c.command===i).map(c=>c.intent);if(s.length===0)return;const u=s.map(c=>{const f=Array.from({length:r.length+1},(b,g)=>g);for(let b=1;b<=c.length;b+=1){let g=f[0];f[0]=b;for(let h=1;h<=r.length;h+=1){const j=f[h];f[h]=Math.min(f[h]+1,f[h-1]+1,g+(c[b-1]===r[h-1]?0:1)),g=j}}return{candidate:c,distance:f[r.length]}}).sort((c,f)=>c.distance-f.distance||c.candidate.localeCompare(f.candidate))[0].candidate,a=[i,...o,"--for",r],l=[i,...o,"--for",u],_=q(l);throw new A(`Unknown context intent "${r}" for ${i}. Did you mean "${u}"?`,B.USAGE,{code:"unknown_context_intent",reason:"unknown_intent",field:"for",flag:"--for",value:r,required:`Use a declared ${i} intent.`,why:"Intent names are command-local contracts and cannot be inferred from output section names.",nextSteps:[_],recovery:{recovery_mode:"compact",attempted_command:q(a),allowed_values:[...s].sort(),suggested_retry:_,suggested_retry_args:l}})}function N(t,e){const n=k(t.limit),o=String(n===void 0?e:Math.min(n,e));return(t.limit===void 0||n!==void 0)&&(t.limit=o),o}const W={context:(t,e,n,o)=>{t.section===void 0&&t.depth===void 0&&(t.section=e.intent==="handoff"?["activity","progress","blockers"]:["hierarchy","blockers","activity"]),t.depth===void 0&&(t.depth=e.intent==="handoff"?"deep":"standard");const i=C(o,t.tokenBudget,e.token_budget),r=v("context",e.intent,i,n),d=N(t,r);t.activityLimit===void 0&&(t.activityLimit=d)},get:t=>{t.depth===void 0&&t.fields===void 0&&(t.depth="standard")},list:(t,e,n,o)=>{t.brief===void 0&&t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.fields="id,title,status,type,priority,parent,assignee,risk,blocked_by");const i=C(o,t.tokenBudget,e.token_budget),r=v("list",e.intent,i,n);N(t,r)},next:t=>{t.readyOnly===void 0&&(t.readyOnly=!0)},search:(t,e,n,o)=>{t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.compact=!0);const i=C(o,t.tokenBudget,e.token_budget),r=v("search",e.intent,i,n);N(t,r)}};function te(t,e,n=[]){const o=e.tokenBudget??e.token_budget;if(typeof e.for!="string"){if(o!==void 0&&(t==="get"||t==="list"||t==="search"))throw new A("--token-budget requires a declared context intent selected with --for",B.USAGE,{code:"missing_required_option",field:"for",required:"Select a context intent with --for when setting --token-budget.",why:"A token-budget override has no projection contract to constrain without a selected intent.",nextSteps:["Retry with --for <intent> --token-budget <n>, or omit --token-budget."]});if(e.tokenBudget!==void 0||e.token_budget===void 0)return e;const u={...e,tokenBudget:o};return delete u.token_budget,u}const i=X(t,e.for,void 0,n),r=w(e),d=k(o)!==void 0||typeof r=="number",s={...e};return s.tokenBudget===void 0&&o!==void 0&&(s.tokenBudget=o),delete s.token_budget,typeof r=="number"?s.tokenBudget=String(r):s.tokenBudget===void 0&&(s.tokenBudget=String(i.token_budget)),W[t](s,i,d,r),s}const wt={context:"bounded_sections",get:"standard_item",list:"bounded_fields_and_rows",next:"bounded_ranked_rows",search:"bounded_ranked_rows"},x=256;function S(t,e,n=!0,o=!0){return Array.isArray(t)?t.map(i=>S(i,e,n,!1)):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([i,r])=>[i,n&&typeof r=="string"&&mt(i)?r:S(r,e,n&&!(o&&bt(e,i)),!1)])):typeof t=="string"?gt(t):t}function k(t){const e=typeof t=="number"?t:typeof t=="string"&&/^\d+$/u.test(t.trim())?Number(t):Number.NaN;return Number.isSafeInteger(e)&&e>0?e:void 0}function w(t){const e=t.outputBudget??t.output_budget;return e==="unbounded"?e:k(e)}function xt(t){return w(t)===void 0?"--token-budget":"--output-budget"}function C(t,e,n){return typeof t=="number"?t:Ct(e,n)}function Ct(t,e){const n=k(t);if(n===void 0)return e;if(n<x)throw new A(`Context intent token budget must be at least ${x}`,B.USAGE,{code:"invalid_argument_value",reason:"below_minimum",field:"tokenBudget",value:String(t),required:`Use an integer token budget of at least ${x}.`,why:"Smaller ceilings cannot contain the minimum machine-readable intent receipt.",nextSteps:[`Retry with --token-budget ${x} or omit the override.`]});return n}function F(t,e){const n=t==="context"&&e==="orient";return t==="context"?n?{overhead:1200,rowCost:600}:{overhead:800,rowCost:500}:{overhead:t==="list"?520:480,rowCost:16}}function v(t,e,n,o){if(t==="get"||t==="next")return;const{overhead:i,rowCost:r}=F(t,e),d=Math.max(t==="context"?1:2,Math.floor((n-i)/r));return o?d:Math.min(t==="context"?20:100,d)}function p(t,e,n){const o=T(n),i=n.outputRowContract===!0||n.output_row_contract===!0;let r=e.estimated_tokens,d=r;for(let s=0;s<at;s+=1){e.estimated_tokens=r;const u=E(i||!Object.hasOwn(t,"row_contract")?t:Object.fromEntries(Object.entries(t).filter(([a])=>a!=="row_contract")),o);if(u===r)return;r=u,d=Math.max(d,r)}e.estimated_tokens=d}const K={context:["high_level","low_level","blocked_fallback","recently_created","unparented","hierarchy","activity","blockers"],get:["children"],list:["items"],next:["ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items"]};function J(t){try{const e=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return typeof e.fingerprint!="string"||!Number.isSafeInteger(e.after_index)?void 0:{fingerprint:e.fingerprint,after_index:e.after_index,...typeof e.snapshot=="string"?{snapshot:e.snapshot}:{}}}catch{return}}function vt(t){if(t===null||typeof t!="object")return;if(typeof t.id=="string")return t.id;const e=t.item?.id;return typeof e=="string"?e:void 0}function Ot(t,e,n,o){let i=!1;for(;;){if(p(t,e,o),e.estimated_tokens<=e.token_budget||n.length<=1)return i;const r=Buffer.byteLength(JSON.stringify(n),"utf8"),d=(e.estimated_tokens-e.token_budget)*4;n.splice(-Math.min(n.length-1,Math.max(1,Math.ceil(d/Math.max(1,Math.ceil(r/n.length)))))),i=!0}}function It(t,e,n){const o=t.items,i=typeof t.next_cursor=="string",r=i?t.next_cursor:n.after;if(!Array.isArray(o)||typeof r!="string")return!1;const d=J(r);if(d===void 0)return!1;const s=o.length,u=[...o];let a=!1;for(;;){if(a=Ot(t,e,o,n)||a,!a)return!1;const l=vt(o.at(-1));if(l===void 0)return o.splice(0,o.length,...u),p(t,e,n),!1;if(t.next_cursor=it(d.fingerprint,l,i?d.after_index-(s-o.length):d.after_index+o.length,d.snapshot),p(t,e,n),e.estimated_tokens<=e.token_budget||o.length<=1)break}return typeof t.count=="number"&&(t.count=o.length),typeof t.applied_limit=="number"&&(t.applied_limit=o.length),!0}function Et(t,e,n,o){if(t==="list"||t==="search")return It(e,n,o);if(t!=="next"||typeof e.next_cursor=="string")return!1;let i=!1;for(;;){if(p(e,n,o),n.estimated_tokens<=n.token_budget)return i;const r=K[t].map(c=>({key:c,rows:Array.isArray(e[c])?e[c]:[]})).filter(({rows:c})=>c.length>0).sort((c,f)=>f.rows.length-c.rows.length||c.key.localeCompare(f.key))[0];if(r===void 0)return i;const d=K[t].reduce((c,f)=>c+(Array.isArray(e[f])?e[f].length:0),0);if(d<=1)return i;const s=Math.min(r.rows.length,d-1),u=Buffer.byteLength(JSON.stringify(r.rows),"utf8"),a=Math.max(1,Math.ceil(u/r.rows.length)),l=(n.estimated_tokens-n.token_budget)*4,_=Math.min(s,Math.max(1,Math.ceil(l/a)));r.rows.splice(-_,_),i=!0}}function $(t,e,n){if(typeof e.for!="string")return n;const o=t.startsWith("list-")?"list":t;if(!(o in W))return n;const i=o,r=X(i,e.for),d=w(e),s=C(d,e.tokenBudget??e.token_budget,r.token_budget),u={command:i,intent:r.intent,source:r.source,included_field_groups:[...r.included_field_groups],token_budget:s,declared_token_budget:r.token_budget,token_budget_override:s-r.token_budget,estimated_tokens:0,within_budget:!0,degradation:wt[i],declaration_feasible:!0,result_omitted:!1},a={...n},l=v(i,r.intent,u.token_budget,k(e.tokenBudget??e.token_budget)!==void 0||typeof d=="number");if(l!==void 0){const g=k(e.limit),h=g!==void 0&&g<l;u.budget_derived_limit=l,u.binding_constraint=h?"explicit_limit":"token_budget",u.limit_reason=h?"The caller supplied a smaller row limit than the budget-derived ceiling.":"The selected intent token budget constrains the effective row ceiling.",a.budget_derived_limit=l,St({builtInCommand:i,intent:r.intent},u,a,e)}const _=L.get(e)??0,c=u.token_budget;u.token_budget=c-_;const f=d==="unbounded"?M(a,u,e):Tt(i,a,u,e,st(t,e));u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget;const b=V(d,u,f,()=>Y(t,i,r.intent,{...u,token_budget:c,estimated_tokens:u.estimated_tokens+_},a,e));return u.result_omitted&&(u.estimated_tokens+=_,u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget),u.token_budget=c,b}function M(t,e,n){const o={...t,context_intent:e};return p(o,e,n),o}function Tt(t,e,n,o,i){let r=M(e,n,o);return n.estimated_tokens>n.token_budget&&(n.degradation="recursive_budget_compaction",r=M(S(e,i),n,o)),n.estimated_tokens>n.token_budget&&Et(t,r,n,o)&&(n.degradation="budget_row_compaction",p(r,n,o)),r}const L=new WeakMap;function V(t,e,n,o){return e.estimated_tokens<=e.token_budget||(e.within_budget=!1,t==="unbounded")?n:(e.degradation="budget_receipt_only",e.result_omitted=!0,typeof t=="number"?{output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},context_intent:e}:{budget_exceeded:{omitted_result:!0,reason:e.token_budget_override===0?"declared_budget_infeasible":"effective_budget_infeasible",restore_with:o()},context_intent:e})}const Rt=["applied_limit","completeness","context_intent","count","filters","has_more","now","omission_receipt","projection","row_contract","sorting","total","truncated"];function Bt(t,e){if(typeof e!="string"||e.length===0)return!1;if(nt(t)===void 0)return!0;try{return ot(e),!0}catch{return!1}}function Q(t,e,n){if(!Bt(t,e.after)||z(n))return n;const o=J(e.after)?.fingerprint??"opaque_cursor",i={...n};for(const r of Rt)delete i[r];return i.continuation_contract={fingerprint:o,metadata:"reference",restore_with:"omit --after"},i}function m(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function At(t,e){const n=t==="get"&&m(e.item)&&typeof e.item.id=="string"?e.item.id:t==="search"&&typeof e.query=="string"?e.query:void 0;return n===void 0?"":` ${I(n)}`}function Nt(t){return typeof t.fields=="string"&&t.fields.trim()!==""?` --fields ${I(t.fields)}`:""}function St(t,e,n,o){const i=k(o.limit),r=e.budget_derived_limit;if(i===void 0||i<=r)return;const{overhead:d,rowCost:s}=F(t.builtInCommand,t.intent),u=Math.max(e.token_budget,d+s*i);e.limit_reason=`The ${e.token_budget}-token ${t.intent} budget carries ${r} rows, so it reduced the caller's --limit ${i}.`,e.limit_override={flag:"--limit",requested:i,effective:r,...Number.isSafeInteger(u)?{token_budget_for_requested:u,restore_with:`${xt(o)} ${u}`}:{}};const a=`${ht}:--limit ${i}->${r}`;n.warnings=Array.isArray(n.warnings)?[...n.warnings,a]:[a],m(n.filters)&&(n.filters={...n.filters,requested_limit:String(i)})}function Y(t,e,n,o,i,r){const d=At(e,i),s=e==="get"?"":` --limit ${o.budget_derived_limit??1}`,{output_budget:u}=lt({effective_budget_tokens:o.token_budget,measured_result_tokens:o.estimated_tokens});return`pm ${t}${d}${Nt(r)} --for ${I(n)} --token-budget ${u}${s}`}function y(t,e){if(m(t))return typeof t[e]=="number"?t[e]:void 0}function H(t,e){let n=t;for(let o=0;o<8;o+=1){$t(n);const i=y(n.context_intent,"estimated_tokens"),r=y(n.read_output,"estimated_tokens"),d=y(n.read_session,"spent_this_call_tokens");if(m(n.context_intent)&&n.context_intent.result_omitted!==!0&&p(n,n.context_intent,e),n=ct(n,e),y(n.context_intent,"estimated_tokens")===i&&y(n.read_output,"estimated_tokens")===r&&y(n.read_session,"spent_this_call_tokens")===d)break}return n}function $t(t){const e=t.context_intent;m(e)&&Number(e.estimated_tokens)>Number(e.token_budget)&&(e.within_budget=!1)}function Mt(t,e){const n=e.context_intent;if(!m(n)||n.result_omitted===!0)return;const o=n.degradation==="recursive_budget_compaction"||n.degradation==="budget_row_compaction",i={...e};for(const r of _t(t)){const d=e[r.path];if(Array.isArray(d)&&Array.isArray(r.value)&&d.length<=r.value.length){const s=r.value.slice(0,d.length);i[r.path]=o?s.map(D):s}}return i}function D(t){return Array.isArray(t)?t.map(D):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,D(n)])):t}function ee(t,e,n){const o=rt(t,et(t??"",n));if(typeof o!="object"||o===null||Array.isArray(o))return R(n,o),o;const i=t??"",r=o,d=$(i,e,r),s=y(d.context_intent,"estimated_tokens"),u=Mt(r,d),a=O(i,e,n,d,u),l=P(e,a,d.context_intent);if(l===void 0)return Lt(e,a,d)?Pt(i,e,n,r,d,Number(s),u,a):a;const _={...e};L.set(_,l.estimated-Number(s));const c=$(i,_,r),f=Z(i,e,_,n,c,u),b=f===void 0?l:P(e,f,c.context_intent);if(b===void 0)return f;const g={...b.receipt,estimated_tokens:b.estimated};return O(i,{...e,outputCursor:void 0,output_cursor:void 0},n,V(w(e),g,f??a,()=>Y(i,g.command,g.intent,g,r,e)))}function Lt(t,e,n){const o=n.context_intent;return Object.hasOwn(e,"output_budget_exceeded")&&m(o)&&o.result_omitted!==!0&&Dt.has(String(o.command))&&(t.outputInclude??t.output_include)===void 0&&(t.outputSession??t.output_session)===void 0}const Dt=new Set(["list","search"]);function Pt(t,e,n,o,i,r,d,s){const u=O(t,{...e,outputBudget:"unbounded"},n,{...i,context_intent:{...i.context_intent}},d),a={...e};L.set(a,E(u,T(e))-r);const l=$(t,a,o),_=Z(t,e,a,n,l,d);return _===void 0||Object.hasOwn(_,"output_budget_exceeded")||P(e,_,l.context_intent)!==void 0?s:_}function Z(t,e,n,o,i,r){return z(i)||qt(e,i)?void 0:O(t,n,o,i,r)}function qt(t,e){const n=t.outputCursor??t.output_cursor;if(typeof n!="string")return!1;const o=ut(n),i=e[o.path];return Array.isArray(i)&&i.length<=o.offset}function P(t,e,n){const o=m(e.context_intent),i=o?e.context_intent:n;if(!m(i)||i.result_omitted===!0||Object.hasOwn(e,"output_budget_exceeded"))return;const r=i,d=o?r.estimated_tokens:E(e,T(t));return w(t)==="unbounded"||d<=r.token_budget?void 0:{receipt:r,estimated:d}}function zt(t){return!m(t)||t.result_omitted===!0?{}:{mirrorEstimate:(e,n)=>{m(e.context_intent)&&(e.context_intent.estimated_tokens=n)}}}function O(t,e,n,o,i){const r={...e,outputRowContract:e.outputRowContract===!0||e.output_row_contract===!0};ft(r,{...i===void 0?{}:{continuationBinding:Q(t,e,i)},...zt(o.context_intent)});const d=dt(t,r,Q(t,e,o));if(R(n,d),e.outputRowContract===!0||e.output_row_contract===!0||!Object.hasOwn(d,"row_contract"))return m(d.context_intent)?H(d,e):d;const s=Object.fromEntries(Object.entries(d).filter(([a])=>a!=="row_contract"));Object.defineProperty(s,"row_contract",{value:d.row_contract,enumerable:!1,configurable:!0});const u=H(s,e);return delete u.row_contract,R(d,u),u}export{ht as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,U as PM_CONTEXT_INTENT_CONTRACTS,te as applyContextIntentProjection,$ as attachContextIntentReceipt,ee as attachReadOutputContracts,yt as composeContextIntentContracts,vt as contextIntentRowId,J as decodeContextIntentCursor,kt as getActiveContextIntentContracts,X as resolveContextIntentContract,jt as runWithContextIntentContracts};
2
2
  //# sourceMappingURL=context-intent-contracts.js.map
@@ -448,15 +448,34 @@ URL credentials never reach telemetry or Sentry, whatever the host looks like
448
448
  tracker record excluded from npm). Before any other sanitizer runs, each
449
449
  command argument is treated as one token and each other string as
450
450
  whitespace-delimited words. In every such token, the span between the first
451
- `:` and the last `@` is replaced with `[redacted]`, and any scheme slashes
452
- are kept. The rule is conservative so that it is complete: a single-label
451
+ `:` and the last `@` is replaced with `[redacted]`, and any scheme slashes are
452
+ kept. An argument with blanks keeps that one span, but it starts after the
453
+ longest provably public prefix that ends before a word that starts a URL. A
454
+ word starts a URL with a scheme of two or more characters, then a colon and a
455
+ slash or backslash. A slashless URL such as `https:u:p@h` keeps the one span. A
456
+ provably public prefix holds only words without a `:` or special-scheme URLs
457
+ whose host (with at most a numeric port) a `/` ends inside the word. It holds no
458
+ tab or line break, and the token rule finds no possible userinfo in it. So a
459
+ public URL before a separate credential URL survives, while
460
+ `https://user:secret value://tail@host` or `https://u:pa/ss value://tail@host`
461
+ loses its whole userinfo
462
+ ([pm-gh1799](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1799.toon);
463
+ tracker record excluded from npm). The rule is conservative so that it is complete: a single-label
453
464
  host, `host:port`, a backslash authority or a password with any characters is
454
465
  covered. A scoped package name after a colon is hidden too. The CLI also
455
466
  registers each secret of the running invocation, including its shell and
456
467
  JSON escaping. Any echoed run that shares a six-character fragment with one
457
468
  of them is removed, so a split, truncated or re-cased echo exposes at most
458
469
  five consecutive characters (more only for a secret beyond the 65,536-fragment
459
- budget). The command taxonomy of an unknown
470
+ budget). Every secret of one invocation shares that budget, so secrets that
471
+ together exceed it widen the bound for all of them. Below it, the five-character
472
+ bound holds for each URL. One exception is case folding: a capital sigma
473
+ lower-cases to a final sigma at the end of a word, so a truncated or re-cased
474
+ echo that moves a sigma to a word end can keep more. When a public prefix is
475
+ split off an argument, the
476
+ later URL's secret is registered exactly as when that URL is given alone.
477
+ The public prefix is never registered, so text that only the prefix shares is
478
+ not removed. The command taxonomy of an unknown
460
479
  command is derived from the already-redacted token.
461
480
 
462
481
  The separate local event and OTLP queues retain their existing formats. Turning
@@ -163,6 +163,11 @@ certificate. Subsequent pages carry `continuation_contract` with
163
163
  `metadata: "reference"` and `restore_with: "omit --after"`; repeated metadata
164
164
  is optional in `PmReadOutputProducerContinuation<Result>`. Follow `next_cursor`
165
165
  until it is empty, rather than relying on the optional `has_more` field.
166
+ An extension command's `--after` continues a page only when its value carries
167
+ the SDK query-cursor envelope. A package operand that happens to be named
168
+ `--after` keeps its first-page metadata
169
+ ([pm-gh1798](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1798.toon);
170
+ tracker record excluded from npm).
166
171
 
167
172
  Calls whose options contain no producer cursor retain their first-page types.
168
173
  Omitting the options argument has the same precise type as passing `{}` for
package/docs/SDK.md CHANGED
@@ -3185,7 +3185,14 @@ cannot shadow native dispatch; choose a distinct package action.
3185
3185
 
3186
3186
  Receipts and continuation cursors identify the canonical extension command.
3187
3187
  Resume with the returned cursor and the same semantic inputs; changed rows
3188
- refuse stale continuation. A budget that cannot fit useful content returns the
3188
+ refuse stale continuation. A command may own an ordinary `--after` operand,
3189
+ such as a second snapshot file. The host treats that value as a producer
3190
+ cursor only when it carries the SDK query-cursor envelope that
3191
+ `paginateQueryRows` and `encodeQueryCursor` issue. Only then does the page get
3192
+ the sparse `continuation_contract` envelope. Any other value keeps the requested
3193
+ row contract and every first-page field
3194
+ ([pm-gh1798](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1798.toon);
3195
+ tracker record excluded from npm). A budget that cannot fit useful content returns the
3189
3196
  shared `output_budget_exceeded` branch, and CLI exits 2. SDK consumers should
3190
3197
  check `isReadOutputBudgetExceeded` before treating the payload as their result.
3191
3198
  Packages can describe their own omitted groups with the existing
@@ -3685,9 +3692,18 @@ should remove URL credentials with the rule that the CLI and telemetry use
3685
3692
  ([pm-nhauur](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-nhauur.toon); tracker record excluded from npm).
3686
3693
  Apply `redactUrlCredentialsInToken(token)` to each argv token. Apply
3687
3694
  `redactUrlCredentialsInText(text)` to free text. Both replace the span between
3688
- a token's first `:` and its last `@` with `URL_CREDENTIAL_PLACEHOLDER`
3695
+ a URL's first `:` and its last `@` with `URL_CREDENTIAL_PLACEHOLDER`
3689
3696
  (`[redacted]`). The token rule is complete for every spelling a URL parser
3690
- normalizes, and it is idempotent. The text rule judges whitespace-delimited
3697
+ normalizes, and it is idempotent. A token with blanks keeps that one span, but
3698
+ it starts after the longest provably public prefix that ends before a word that
3699
+ starts a URL. Such a word has a scheme of two or more characters, then a colon
3700
+ and a slash or backslash. A slashless URL such as `https:u:p@h` keeps the one
3701
+ span. That prefix holds only words without a `:` or special-scheme URLs
3702
+ whose host, with at most a numeric port, a `/` ends inside the word, no tab or
3703
+ line break, and no possible userinfo of its own. So a public URL before a
3704
+ separate credential URL is kept
3705
+ ([pm-gh1799](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1799.toon);
3706
+ tracker record excluded from npm). The text rule judges whitespace-delimited
3691
3707
  words. It first joins a URL whose authority opens with a `user:` prefix, or
3692
3708
  with a single-label username, across whitespace through the word that holds
3693
3709
  its last `@` or `%40`
package/marketplace.json CHANGED
@@ -1 +1 @@
1
- {"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.11.29","plugins":[{"name":"pm-claude","source":"./plugins/pm-claude","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.","version":"2026.11.29","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"],"category":"productivity"}]}
1
+ {"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.11.30","plugins":[{"name":"pm-claude","source":"./plugins/pm-claude","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.","version":"2026.11.30","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"],"category":"productivity"}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unbrained/pm-cli",
3
- "version": "2026.11.29",
3
+ "version": "2026.11.30",
4
4
  "description": "Git-native project management CLI for humans and agents.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.28.5",
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-beads","version":"2026.11.29","private":true,"type":"module","description":"First-party pm package for importing Beads JSONL records.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-beads"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","beads"],"pm":{"aliases":["beads"],"extensions":["extensions/beads"],"catalog":{"display_name":"Beads Import","category":"migration","summary":"Import Beads JSONL records into pm while preserving source IDs.","tags":["migration","beads","import"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-beads","version":"2026.11.30","private":true,"type":"module","description":"First-party pm package for importing Beads JSONL records.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-beads"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","beads"],"pm":{"aliases":["beads"],"extensions":["extensions/beads"],"catalog":{"display_name":"Beads Import","category":"migration","summary":"Import Beads JSONL records into pm while preserving source IDs.","tags":["migration","beads","import"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-calendar","version":"2026.11.29","private":true,"type":"module","description":"First-party pm package for calendar and agenda views.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-calendar"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","calendar","agenda"],"pm":{"aliases":["calendar"],"extensions":["extensions/calendar"],"catalog":{"display_name":"Calendar Views","category":"workflow","summary":"Show agenda, day, week, and month views for deadlines, reminders, and scheduled events.","tags":["calendar","agenda","workflow"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-calendar","version":"2026.11.30","private":true,"type":"module","description":"First-party pm package for calendar and agenda views.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-calendar"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","calendar","agenda"],"pm":{"aliases":["calendar"],"extensions":["extensions/calendar"],"catalog":{"display_name":"Calendar Views","category":"workflow","summary":"Show agenda, day, week, and month views for deadlines, reminders, and scheduled events.","tags":["calendar","agenda","workflow"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
@@ -1 +1 @@
1
- {"name":"@unbrained/pm-command-kit","version":"2026.11.29","private":true,"type":"module","description":"First-party pm exemplar package for the commands capability: registerCommand, registerFlags, and registerParser.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-command-kit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","commands","exemplar"],"pm":{"aliases":["command-kit"],"extensions":["extensions/command-kit"],"catalog":{"display_name":"Command Kit Exemplar","category":"sdk","summary":"Copy-paste-able exemplar for registerCommand, registerFlags, and registerParser.","tags":["sdk","commands","parser","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
1
+ {"name":"@unbrained/pm-command-kit","version":"2026.11.30","private":true,"type":"module","description":"First-party pm exemplar package for the commands capability: registerCommand, registerFlags, and registerParser.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-command-kit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","commands","exemplar"],"pm":{"aliases":["command-kit"],"extensions":["extensions/command-kit"],"catalog":{"display_name":"Command Kit Exemplar","category":"sdk","summary":"Copy-paste-able exemplar for registerCommand, registerFlags, and registerParser.","tags":["sdk","commands","parser","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}