@unbrained/pm-cli 2026.10.26 → 2026.10.28

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 (159) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +39 -1
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/error-guidance.js +2 -2
  5. package/dist/cli/register-list-query.js +5 -5
  6. package/dist/cli-bundle/bundle-manifest.json +1 -1
  7. package/dist/cli-bundle/chunks/chunk-2J7I54MQ.js +2 -0
  8. package/dist/cli-bundle/chunks/{chunk-25MTQAHX.js → chunk-3KMYHYJV.js} +2 -2
  9. package/dist/cli-bundle/chunks/chunk-7V37RC2L.js +114 -0
  10. package/dist/cli-bundle/chunks/chunk-AHVN4GHF.js +31 -0
  11. package/dist/cli-bundle/chunks/{chunk-VS2IIV3F.js → chunk-CS7QDSUX.js} +28 -28
  12. package/dist/cli-bundle/chunks/{chunk-T7T4WLUY.js → chunk-CXUQEZDX.js} +3 -3
  13. package/dist/cli-bundle/chunks/{chunk-ZT64RDMF.js → chunk-D3AIQZXF.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-7UDQAINZ.js → chunk-D6P6IBPN.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-TGOG5BFM.js → chunk-DKLEDWVW.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-MWCG25PO.js → chunk-DM3PICGU.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-Y42DYMZX.js → chunk-E5QBZ4HI.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-XAIR53QZ.js → chunk-JESLOJD7.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-57YPOOED.js → chunk-LWW4F4G2.js} +2 -2
  20. package/dist/cli-bundle/chunks/chunk-PQLRKFPZ.js +20 -0
  21. package/dist/cli-bundle/chunks/{chunk-ONC4BBQP.js → chunk-RZQNFHXO.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +2 -0
  23. package/dist/cli-bundle/chunks/{chunk-ER7RLJW5.js → chunk-TH5KPAN4.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-OCDRHIVQ.js → chunk-XHONSCLJ.js} +6 -6
  25. package/dist/cli-bundle/chunks/{chunk-NGKTROAO.js → chunk-YUBUNECD.js} +42 -42
  26. package/dist/cli-bundle/chunks/{chunk-Z35XAHUN.js → chunk-YYD5MNAV.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-UF6EXZSP.js → chunk-ZX3XMTZG.js} +2 -2
  28. package/dist/cli-bundle/chunks/indexed-receipt-blobs-LHLE7PSG.js +4 -0
  29. package/dist/cli-bundle/chunks/{mutation-admission-VTNV6JV2.js → mutation-admission-GKDKHRTZ.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-list-query-LZDWUZS4.js → register-list-query-MHJJUM6M.js} +9 -9
  31. package/dist/cli-bundle/chunks/{register-mutation-M2A7PH42.js → register-mutation-SN425O3R.js} +2 -2
  32. package/dist/cli-bundle/chunks/{register-operations-E7P2JTXM.js → register-operations-EYUIUGPW.js} +2 -2
  33. package/dist/cli-bundle/chunks/{register-setup-DOV7KGSH.js → register-setup-WUZ2ZSMY.js} +2 -2
  34. package/dist/cli-bundle/chunks/{settlement-hook-SVD6CO7U.js → settlement-hook-MN3Y7LVX.js} +2 -2
  35. package/dist/cli-bundle/chunks/{stage-LYLEOAQB.js → stage-2FYJGGG3.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-3EHVI673.js +2 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-46WLWK73.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-E5C24MCV.js → chunk-4GN2ZPT5.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-NLZUI234.js → chunk-6L4KKRK7.js} +18 -18
  40. package/dist/cli-bundle/focused-chunks/{chunk-D5YQ4KAE.js → chunk-6VDRAJYX.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-KTXU5WU6.js → chunk-7SZPZOIC.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-YQKLKRMW.js → chunk-B4ZQJEMT.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-NE27VCU7.js → chunk-BZSACRVX.js} +3 -3
  44. package/dist/cli-bundle/focused-chunks/{chunk-ADSBGYLW.js → chunk-C2GLO7HU.js} +55 -55
  45. package/dist/cli-bundle/focused-chunks/{chunk-UP765R2V.js → chunk-DRN4W3YJ.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-CSCZYSNZ.js → chunk-F6UQJJYB.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-I7H3XF25.js → chunk-I4X6AKOO.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-IQKLJFJE.js +79 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-KERJNFXY.js → chunk-JTCGDODH.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-IF6C43IP.js → chunk-L5GX2FGZ.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-PK5FJIVA.js → chunk-LPWZERVD.js} +11 -11
  53. package/dist/cli-bundle/focused-chunks/{chunk-YW5GHQN2.js → chunk-ML5JIUM6.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-BL77VCRB.js → chunk-OASYSUOH.js} +16 -16
  55. package/dist/cli-bundle/focused-chunks/{chunk-BH7RE2ZY.js → chunk-ON5WFDCG.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-WDWHUJQW.js → chunk-QUPGBO2L.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-226XKW3W.js → chunk-R3EA3SDW.js} +3 -3
  58. package/dist/cli-bundle/focused-chunks/{chunk-B266DDBJ.js → chunk-TUN4M757.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-YTEC2EPM.js → chunk-Z26ZPQH6.js} +3 -3
  60. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-5H6RMRTK.js +4 -0
  61. package/dist/cli-bundle/focused-chunks/{mutation-admission-L42E3U5U.js → mutation-admission-TM3SVU2O.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{settlement-hook-3CADO4XZ.js → settlement-hook-LBVWWSCF.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{stage-TUQHWU7N.js → stage-7ZBRX2Q2.js} +2 -2
  64. package/dist/cli-bundle/main.js +21 -21
  65. package/dist/cli-bundle/sdk-authoring.js +1 -1
  66. package/dist/cli-bundle/sdk-contracts.js +2 -2
  67. package/dist/cli-bundle/sdk-core.js +34 -33
  68. package/dist/cli-bundle/sdk-governance.js +1 -1
  69. package/dist/cli-bundle/sdk-graph.js +1 -1
  70. package/dist/cli-bundle/sdk-merge.js +57 -57
  71. package/dist/cli-bundle/sdk-query.js +1 -1
  72. package/dist/cli-bundle/sdk-runtime.js +1 -1
  73. package/dist/cli-bundle/sdk-testing.js +1 -1
  74. package/dist/cli-bundle/sdk.js +11 -11
  75. package/dist/core/history/event-index.d.ts +6 -0
  76. package/dist/core/history/event-index.js +7 -6
  77. package/dist/core/history/read.d.ts +3 -1
  78. package/dist/core/history/read.js +1 -1
  79. package/dist/core/item/priority.js +1 -1
  80. package/dist/core/shared/errors.d.ts +2 -0
  81. package/dist/core/shared/errors.js +1 -1
  82. package/dist/core/store/item-store.js +1 -1
  83. package/dist/mcp/tool-definitions.js +1 -1
  84. package/dist/sdk/agent/command-recovery.d.ts +5 -0
  85. package/dist/sdk/agent/command-recovery.js +1 -1
  86. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  87. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  88. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  89. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  90. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  91. package/dist/sdk/command-line.d.ts +6 -0
  92. package/dist/sdk/command-line.js +1 -1
  93. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  94. package/dist/sdk/index.d.ts +1 -1
  95. package/dist/sdk/index.js +1 -1
  96. package/dist/sdk/lifecycle/close.js +1 -1
  97. package/dist/sdk/lifecycle/create.js +1 -1
  98. package/dist/sdk/lifecycle/update-many.js +1 -1
  99. package/dist/sdk/lifecycle/update.js +1 -1
  100. package/dist/sdk/merge/indexed-receipt-blobs.d.ts +3 -1
  101. package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
  102. package/dist/sdk/merge/receipt-file-boundary.d.ts +2 -0
  103. package/dist/sdk/merge/receipt-file-boundary.js +1 -1
  104. package/dist/sdk/merge/receipts.js +2 -2
  105. package/dist/sdk/mutation-events.d.ts +6 -0
  106. package/dist/sdk/mutation-events.js +1 -1
  107. package/dist/sdk/public-surface.json +1 -1
  108. package/dist/sdk/query/history.d.ts +4 -0
  109. package/dist/sdk/query/history.js +1 -1
  110. package/dist/sdk/runtime/actions.js +1 -1
  111. package/dist/sdk/runtime-extended-actions.js +1 -1
  112. package/dist/sdk/runtime.js +1 -1
  113. package/dist/sdk/test/command-resolution.d.ts +5 -0
  114. package/dist/sdk/test/command-resolution.js +3 -0
  115. package/dist/sdk/test/execution.js +3 -3
  116. package/dist/sdk/test/receipt-index-snapshot.d.ts +2 -0
  117. package/dist/sdk/test/receipt-index-snapshot.js +2 -0
  118. package/dist/sdk/test/workspace-snapshot.d.ts +1 -1
  119. package/dist/sdk/test/workspace-snapshot.js +1 -1
  120. package/docs/COMMANDS.md +28 -1
  121. package/docs/PERFORMANCE.md +21 -6
  122. package/docs/RELEASING.md +11 -0
  123. package/docs/SDK.md +40 -0
  124. package/docs/SDK_CONTEXT_COORDINATION.md +35 -4
  125. package/docs/TESTING.md +42 -3
  126. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  127. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
  128. package/marketplace.json +1 -1
  129. package/package.json +1 -1
  130. package/packages/pm-beads/package.json +1 -1
  131. package/packages/pm-calendar/package.json +1 -1
  132. package/packages/pm-command-kit/package.json +1 -1
  133. package/packages/pm-digital-twin/package.json +1 -1
  134. package/packages/pm-governance-audit/package.json +1 -1
  135. package/packages/pm-guide-shell/package.json +1 -1
  136. package/packages/pm-kanban/package.json +1 -1
  137. package/packages/pm-lifecycle-hooks/package.json +1 -1
  138. package/packages/pm-linked-test-adapters/package.json +1 -1
  139. package/packages/pm-search-advanced/package.json +1 -1
  140. package/packages/pm-templates/package.json +1 -1
  141. package/packages/pm-todos/package.json +1 -1
  142. package/packages/pm-vcs/package.json +1 -1
  143. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  144. package/plugins/pm-claude/package.json +1 -1
  145. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  146. package/plugins/pm-codex/package.json +1 -1
  147. package/plugins/pm-codex/plugin.json +1 -1
  148. package/runtime-dependencies.json +1 -1
  149. package/dist/cli-bundle/chunks/chunk-N6FTEILW.js +0 -20
  150. package/dist/cli-bundle/chunks/chunk-OUDR2HWR.js +0 -113
  151. package/dist/cli-bundle/chunks/chunk-RUKSEZE7.js +0 -2
  152. package/dist/cli-bundle/chunks/chunk-YJBIPNDL.js +0 -2
  153. package/dist/cli-bundle/chunks/chunk-ZLVFUZI4.js +0 -30
  154. package/dist/cli-bundle/chunks/indexed-receipt-blobs-NWQIDTH7.js +0 -4
  155. package/dist/cli-bundle/focused-chunks/chunk-ABMNYWV6.js +0 -2
  156. package/dist/cli-bundle/focused-chunks/chunk-NFN2P4TW.js +0 -2
  157. package/dist/cli-bundle/focused-chunks/chunk-UHWTPOM4.js +0 -78
  158. package/dist/cli-bundle/focused-chunks/chunk-VVRXF4JO.js +0 -2
  159. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-YFDNGHCM.js +0 -4
@@ -1,3 +1,3 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e3d7a4d0-05dc-548e-aeb8-410638ce734a")}catch{}})();var b=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],F=2,v=Object.freeze({migration:"schema",validation:"schema"}),M=Object.freeze({version:2,capabilities:[...b],legacy_aliases:{...v}}),P=["off","warn","enforce"],U=["off","warn","enforce"],Y=["none","restricted","strict"],q=["block","warn"],W=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],X=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function m(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3d6df465-e82e-57d8-a687-6c2e720c99c1")}catch{}})();var E=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],T=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...E,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],k=T;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a92abe3-1900-5a69-a35d-6aa592c83da0")}catch{}})();var I=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),O=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),z=".agents/pm",$="settings.json",V="Closed at creation via pm create",N=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],A=["decisions","events","reminders","milestones","meetings","plans"],J=[...N,...A],Q={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},D={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},S=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],f={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function h(e){return e?[...e]:void 0}var Z={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...S],lifecycle_closure_like_blocked_reason_patterns:[...f.blocked_reason],lifecycle_closure_like_resolution_patterns:[...f.resolution],lifecycle_closure_like_actual_result_patterns:[...f.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...D.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:I.map(e=>({...e,aliases:h(e.aliases),roles:h(e.roles)})),fields:[],workflow:{...O},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:m()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",default_mode:"auto",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},H={metadata:{},body:""},w={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},R=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});function ee(e){let t=(e??"").trim().toLowerCase();if(t.length===0)return"unknown";let o=R[t];return typeof o=="string"?o:t.includes("conflict")||t.includes("locked")?"conflict":t.startsWith("unknown_")||t.startsWith("missing_required_")?"usage":t.startsWith("invalid_")||t.endsWith("_not_found")||t.includes("validation")?"validation":t.endsWith("_error")||t.endsWith("_failed")?"runtime":"unknown"}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="85f8d656-86eb-52a9-8160-70b60b9da511")}catch{}})();var u=class extends Error{exitCode;code;context;constructor(t,o,i={}){super(t),this.name="PmCliError",this.exitCode=o,this.context=i,this.code=i.code}};import*as r from"node:fs/promises";import{constants as p}from"node:fs";import c from"node:path";import C from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3792f1fd-ed9d-5252-887d-e4517a55fb9c")}catch{}})();var L=[10,25,50,100];async function y(e){await r.mkdir(e,{recursive:!0})}async function le(e){try{return await r.access(e),!0}catch{return!1}}function g(e){return x(e)||l(e,"ENOTDIR")}function x(e){return l(e,"ENOENT")}async function ce(e){try{return await r.readFile(e,"utf8")}catch(t){if(g(t))return null;throw t}}async function de(e,t){let o=await r.open(e,p.O_RDONLY|p.O_NOFOLLOW|p.O_NONBLOCK);try{if(!(await o.stat()).isFile())throw t;return await o.readFile("utf8")}finally{await o.close()}}function _e(e){let t=e?.replaceAll(c.sep,"/"),o=t!==void 0&&!c.posix.isAbsolute(t)&&!c.win32.isAbsolute(t)&&!t.split("/").includes(".."),i=o?t.split("/")[0]:void 0,s={"settings.json":"settings",runtime:"runtime",schema:"schema",history:"history",transactions:"transactions"},n=i===void 0?"tracker_storage":Object.hasOwn(s,i)?s[i]:"tracker_storage",d=o&&t.length>0&&t.length<=160&&t.split("/").every(a=>a!=="."&&/^[a-zA-Z0-9_.-]+$/u.test(a)),_=d?t:`${n} (entry name redacted)`;return new u(`Transaction preview requires regular files and directories. Inspect ${_} relative to the selected tracker root.`,w.USAGE,{code:"transaction_preview_non_regular_file",preview_storage:{storage_area:n,...d?{relative_entry:t}:{},entry_redacted:!d},required:"regular files and directories within the configured tracker storage",why:"Preview does not follow linked entries or read special files.",nextSteps:[`Inspect ${_} within the selected tracker for links, directories used as files, or special files; do not follow link targets.`,"Restore the intended regular files and directories, then retry the original dry-run command."]})}async function ue(e,t,o={}){let i=c.dirname(e);o.createParentDirectories!==!1&&await y(i);let s=c.join(i,`.${c.basename(e)}.${process.pid}.${Date.now()}.${C.randomBytes(4).toString("hex")}.tmp`);await r.writeFile(s,t,"utf8");try{await r.rename(s,e)}catch(n){if(process.platform==="win32"&&(l(n,"EPERM")||l(n,"EBUSY"))){let d=n;for(let _ of L){await new Promise(a=>setTimeout(a,_));try{await r.rename(s,e);return}catch(a){if(d=a,!l(a,"EPERM")&&!l(a,"EBUSY"))break}}try{await r.unlink(s)}catch{}throw d}if(l(n,"EXDEV")){try{await r.copyFile(s,e)}finally{try{await r.unlink(s)}catch{}}return}try{await r.unlink(s)}catch{}throw n}}async function fe(e,t){let o=c.dirname(e);await y(o);let i=await r.open(e,"a");try{await i.writeFile(`${t}
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e3d7a4d0-05dc-548e-aeb8-410638ce734a")}catch{}})();var b=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],F=2,v=Object.freeze({migration:"schema",validation:"schema"}),M=Object.freeze({version:2,capabilities:[...b],legacy_aliases:{...v}}),P=["off","warn","enforce"],U=["off","warn","enforce"],Y=["none","restricted","strict"],q=["block","warn"],W=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],X=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function m(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3d6df465-e82e-57d8-a687-6c2e720c99c1")}catch{}})();var E=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],T=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...E,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],k=T;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a92abe3-1900-5a69-a35d-6aa592c83da0")}catch{}})();var I=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),O=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),z=".agents/pm",$="settings.json",V="Closed at creation via pm create",N=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],A=["decisions","events","reminders","milestones","meetings","plans"],J=[...N,...A],Q={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},D={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},S=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],f={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function h(e){return e?[...e]:void 0}var Z={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...S],lifecycle_closure_like_blocked_reason_patterns:[...f.blocked_reason],lifecycle_closure_like_resolution_patterns:[...f.resolution],lifecycle_closure_like_actual_result_patterns:[...f.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...D.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:I.map(e=>({...e,aliases:h(e.aliases),roles:h(e.roles)})),fields:[],workflow:{...O},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:m()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",default_mode:"auto",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},H={metadata:{},body:""},w={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},R=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});function ee(e){let t=(e??"").trim().toLowerCase();if(t.length===0)return"unknown";let o=R[t];return typeof o=="string"?o:t.includes("conflict")||t.includes("locked")?"conflict":t.startsWith("unknown_")||t.startsWith("missing_required_")?"usage":t.startsWith("invalid_")||t.endsWith("_not_found")||t.includes("validation")?"validation":t.endsWith("_error")||t.endsWith("_failed")?"runtime":"unknown"}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48da67d7-53a6-5b8e-a73f-58e67cdb9c22")}catch{}})();var u=class extends Error{exitCode;code;context;constructor(t,o,i={}){super(t),this.name="PmCliError",this.exitCode=o,this.context=i,this.code=i.code}};import*as r from"node:fs/promises";import{constants as p}from"node:fs";import c from"node:path";import C from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3792f1fd-ed9d-5252-887d-e4517a55fb9c")}catch{}})();var L=[10,25,50,100];async function y(e){await r.mkdir(e,{recursive:!0})}async function le(e){try{return await r.access(e),!0}catch{return!1}}function g(e){return x(e)||l(e,"ENOTDIR")}function x(e){return l(e,"ENOENT")}async function ce(e){try{return await r.readFile(e,"utf8")}catch(t){if(g(t))return null;throw t}}async function de(e,t){let o=await r.open(e,p.O_RDONLY|p.O_NOFOLLOW|p.O_NONBLOCK);try{if(!(await o.stat()).isFile())throw t;return await o.readFile("utf8")}finally{await o.close()}}function _e(e){let t=e?.replaceAll(c.sep,"/"),o=t!==void 0&&!c.posix.isAbsolute(t)&&!c.win32.isAbsolute(t)&&!t.split("/").includes(".."),i=o?t.split("/")[0]:void 0,s={"settings.json":"settings",runtime:"runtime",schema:"schema",history:"history",transactions:"transactions"},n=i===void 0?"tracker_storage":Object.hasOwn(s,i)?s[i]:"tracker_storage",d=o&&t.length>0&&t.length<=160&&t.split("/").every(a=>a!=="."&&/^[a-zA-Z0-9_.-]+$/u.test(a)),_=d?t:`${n} (entry name redacted)`;return new u(`Transaction preview requires regular files and directories. Inspect ${_} relative to the selected tracker root.`,w.USAGE,{code:"transaction_preview_non_regular_file",preview_storage:{storage_area:n,...d?{relative_entry:t}:{},entry_redacted:!d},required:"regular files and directories within the configured tracker storage",why:"Preview does not follow linked entries or read special files.",nextSteps:[`Inspect ${_} within the selected tracker for links, directories used as files, or special files; do not follow link targets.`,"Restore the intended regular files and directories, then retry the original dry-run command."]})}async function ue(e,t,o={}){let i=c.dirname(e);o.createParentDirectories!==!1&&await y(i);let s=c.join(i,`.${c.basename(e)}.${process.pid}.${Date.now()}.${C.randomBytes(4).toString("hex")}.tmp`);await r.writeFile(s,t,"utf8");try{await r.rename(s,e)}catch(n){if(process.platform==="win32"&&(l(n,"EPERM")||l(n,"EBUSY"))){let d=n;for(let _ of L){await new Promise(a=>setTimeout(a,_));try{await r.rename(s,e);return}catch(a){if(d=a,!l(a,"EPERM")&&!l(a,"EBUSY"))break}}try{await r.unlink(s)}catch{}throw d}if(l(n,"EXDEV")){try{await r.copyFile(s,e)}finally{try{await r.unlink(s)}catch{}}return}try{await r.unlink(s)}catch{}throw n}}async function fe(e,t){let o=c.dirname(e);await y(o);let i=await r.open(e,"a");try{await i.writeFile(`${t}
2
2
  `,"utf8")}finally{await i.close()}}async function pe(e){try{await r.unlink(e)}catch(t){if(!g(t))throw t}}function l(e,t){return typeof e=="object"&&e!==null&&"code"in e&&e.code===t}export{b as a,F as b,v as c,M as d,P as e,U as f,Y as g,q as h,W as i,X as j,m as k,E as l,k as m,I as n,O as o,z as p,$ as q,V as r,N as s,J as t,Q as u,D as v,S as w,f as x,Z as y,H as z,w as A,ee as B,u as C,y as D,le as E,g as F,x as G,ce as H,de as I,_e as J,ue as K,fe as L,pe as M};
3
- //# sourceMappingURL=chunk-ONC4BBQP.js.map
3
+ //# sourceMappingURL=chunk-RZQNFHXO.js.map
@@ -0,0 +1,2 @@
1
+ import{constants as f}from"node:fs";import{lstat as d,open as u}from"node:fs/promises";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="1439aa83-2e99-5713-891d-92846e62a302")}catch{}})();var p=16*1024*1024,c={lstat:d,open:u};function g(t){return t.O_NOFOLLOW??0}async function y(t,n,i=c){let l=await i.lstat(t);if(l.isSymbolicLink()||!l.isFile()||l.size>n)return null;let o=await i.open(t,f.O_RDONLY|g(f));try{let s=await o.stat();if(!s.isFile()||s.size>n)return null;let a=Buffer.alloc(s.size),e=0;for(;e<a.length;){let{bytesRead:r}=await o.read(a,e,a.length-e,e);if(r===0)break;e+=r}return(await o.stat()).size===s.size&&e===s.size?a.toString("utf8",0,e):null}finally{await o.close()}}export{p as a,y as b};
2
+ //# sourceMappingURL=chunk-SPPHDVZE.js.map
@@ -1,4 +1,4 @@
1
- import{A as h,C as u,G as p}from"./chunk-ONC4BBQP.js";import{readFile as b,realpath as y,stat as _,writeFile as $}from"node:fs/promises";import l from"node:path";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="38df9536-d87a-52ac-958d-091a17c9da9c")}catch{}})();var d="# pm-cli:runtime-cache:start",f="# pm-cli:runtime-cache:end",E=".agents/pm";async function m(n){let e=l.resolve(n),t=[];for(;;)try{let i=await y(e);if(!(await _(i)).isDirectory())throw Object.assign(new Error("Initialization path ancestry must be a directory."),{code:"ENOTDIR"});return l.join(i,...t)}catch(i){if(!p(i)||l.dirname(e)===e)throw i;t.unshift(l.basename(e)),e=l.dirname(e)}}var R=["runtime/","search/","locks/","transactions/","checkpoints/"],T=["search/eval-queries.json"];async function w(n){try{return await n()}catch(e){throw e instanceof Error&&"code"in e&&typeof e.code=="string"&&["EACCES","EPERM","EROFS"].includes(e.code)?new u("The workspace .gitignore is not writable.",h.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:e.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):e}}function I(n){let e=n.split(l.sep).join("/").replace(/^\.\/+/,""),t=e.length;for(;t>0&&e[t-1]==="/";)t-=1;return e.slice(0,t)}function k(n){let e=n.replaceAll("\\","/");return l.isAbsolute(n)||e===".."||e.startsWith("../")}function G(n=E){let e=I(n);if(/[\r\n]/u.test(e))throw new u("A tracker path containing a line break cannot be represented safely in .gitignore.",h.USAGE,{code:"invalid_argument_value",required:"a tracker path without line breaks",nextSteps:["Choose a tracker path without carriage returns or newlines and rerun pm init."]});let t=e.replace(/[\\*?[\]#! \t]/gu,"\\$&");return[d,...R.map(i=>i==="search/"?`${t}/${i}*`:`${t}/${i}`),...T.map(i=>`!${t}/${i}`),f].join(`
1
+ import{A as h,C as u,G as p}from"./chunk-RZQNFHXO.js";import{readFile as b,realpath as y,stat as _,writeFile as $}from"node:fs/promises";import l from"node:path";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="38df9536-d87a-52ac-958d-091a17c9da9c")}catch{}})();var d="# pm-cli:runtime-cache:start",f="# pm-cli:runtime-cache:end",E=".agents/pm";async function m(n){let e=l.resolve(n),t=[];for(;;)try{let i=await y(e);if(!(await _(i)).isDirectory())throw Object.assign(new Error("Initialization path ancestry must be a directory."),{code:"ENOTDIR"});return l.join(i,...t)}catch(i){if(!p(i)||l.dirname(e)===e)throw i;t.unshift(l.basename(e)),e=l.dirname(e)}}var R=["runtime/","search/","locks/","transactions/","checkpoints/"],T=["search/eval-queries.json"];async function w(n){try{return await n()}catch(e){throw e instanceof Error&&"code"in e&&typeof e.code=="string"&&["EACCES","EPERM","EROFS"].includes(e.code)?new u("The workspace .gitignore is not writable.",h.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:e.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):e}}function I(n){let e=n.split(l.sep).join("/").replace(/^\.\/+/,""),t=e.length;for(;t>0&&e[t-1]==="/";)t-=1;return e.slice(0,t)}function k(n){let e=n.replaceAll("\\","/");return l.isAbsolute(n)||e===".."||e.startsWith("../")}function G(n=E){let e=I(n);if(/[\r\n]/u.test(e))throw new u("A tracker path containing a line break cannot be represented safely in .gitignore.",h.USAGE,{code:"invalid_argument_value",required:"a tracker path without line breaks",nextSteps:["Choose a tracker path without carriage returns or newlines and rerun pm init."]});let t=e.replace(/[\\*?[\]#! \t]/gu,"\\$&");return[d,...R.map(i=>i==="search/"?`${t}/${i}*`:`${t}/${i}`),...T.map(i=>`!${t}/${i}`),f].join(`
2
2
  `)}function O(n,e,t){let i=e.replace(/[\\*?[\]#! \t]/gu,"\\$&"),o=[...new Set([e,i])].flatMap(s=>R.flatMap(c=>[`${s}/${c}`,`!${s}/${c}`])),a=[],r=!1;for(let s of n)o.some(c=>s.startsWith(c))?(r||a.push(...t),r=!0):a.push(s);return r||a.push(...t),a}function P(n){let e=[],t=-1,i=0,o=0;for(let a of n.split(`
3
3
  `)){let r=a.endsWith("\r")?a.slice(0,-1):a;r===d?(t=o,i=o+a.length+1):r===f&&t>=0&&(e.push({index:t,end:o+r.length,lines:n.slice(i,o).split(/\r?\n/u).filter(s=>s.length>0)}),t=-1),o+=a.length+1}return e}function v(n,e){let t=n.includes(`\r
4
4
  `)?`\r
@@ -6,4 +6,4 @@ import{A as h,C as u,G as p}from"./chunk-ONC4BBQP.js";import{readFile as b,realp
6
6
  `,i=G(e).split(`
7
7
  `).slice(1,-1),o=P(n),a=o.flatMap(c=>c.lines),r=[d,...O(a,e,i),f].join(t);if(o.length===0){let c=n.length===0?"":n.endsWith(`
8
8
  `)?t:`${t}${t}`;return`${n}${c}${r}${t}`}let s=n;for(let[c,g]of[...o.entries()].reverse())s=`${s.slice(0,g.index)}${c===0?r:""}${s.slice(g.end)}`;return s}async function S(n,e={}){let t=l.join(n,".gitignore"),i=E;if(e.pmRoot!==void 0){let r=I(l.relative(await m(n),await m(e.pmRoot)));if(k(r))return{path:t,changed:!1};i=r}let o="";try{o=await w(()=>b(t,"utf8"))}catch(r){if(!(r instanceof Error&&"code"in r&&p(r)))throw r}let a=v(o,i);return a===o?{path:t,changed:!1}:(await w(()=>$(t,a,"utf8")),{path:t,changed:!0})}export{d as a,f as b,R as c,k as d,G as e,S as f};
9
- //# sourceMappingURL=chunk-ER7RLJW5.js.map
9
+ //# sourceMappingURL=chunk-TH5KPAN4.js.map