@unbrained/pm-cli 2026.10.17 → 2026.10.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +35 -0
- package/dist/cli/help-content.js +2 -2
- package/dist/cli/register-list-query.js +2 -2
- package/dist/cli/register-mutation.js +2 -2
- package/dist/cli/register-setup.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/chunk-4CXQSRSP.js +126 -0
- package/dist/cli-bundle/chunks/{chunk-EA2CG7UM.js → chunk-4ICKT4GH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-W3KZ22DW.js → chunk-4MJ6WBMA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-4XFVAXA4.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-6ZDKKOKM.js → chunk-5GZSX5HU.js} +72 -66
- package/dist/cli-bundle/chunks/{chunk-3QKI3XNX.js → chunk-6DS5CAN2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-B5QVGCZX.js → chunk-D3EDNAN7.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-DMFM5R4G.js +3 -0
- package/dist/cli-bundle/chunks/chunk-H3XYP24A.js +70 -0
- package/dist/cli-bundle/chunks/chunk-LBEMB3BW.js +6 -0
- package/dist/cli-bundle/chunks/chunk-NX7Q4LGN.js +8 -0
- package/dist/cli-bundle/chunks/chunk-O2ZRRLAP.js +8 -0
- package/dist/cli-bundle/chunks/chunk-OEJ3G7XT.js +20 -0
- package/dist/cli-bundle/chunks/{chunk-O4YBC3OM.js → chunk-QBNEZII5.js} +30 -30
- package/dist/cli-bundle/chunks/chunk-QG4LMU7A.js +112 -0
- package/dist/cli-bundle/chunks/chunk-QKAAZWGC.js +3 -0
- package/dist/cli-bundle/chunks/chunk-RUKSEZE7.js +2 -0
- package/dist/cli-bundle/chunks/chunk-TK3G3GAP.js +2 -0
- package/dist/cli-bundle/chunks/chunk-VS565KBX.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-JS3B2M4D.js → chunk-XH7C3A5N.js} +2 -2
- package/dist/cli-bundle/chunks/indexed-receipt-blobs-BVSHK4WQ.js +4 -0
- package/dist/cli-bundle/chunks/{register-list-query-RU3QZSAQ.js → register-list-query-WQUVDJIH.js} +7 -7
- package/dist/cli-bundle/chunks/register-mutation-IWIBQIO3.js +20 -0
- package/dist/cli-bundle/chunks/register-operations-SUWOZNDU.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-QGM5YJW7.js +2 -0
- package/dist/cli-bundle/chunks/settlement-hook-UNFMCKKQ.js +7 -0
- package/dist/cli-bundle/chunks/stage-7DELI4Z5.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-LDKX4KYJ.js → chunk-2IEWB6MB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3TEIACFU.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-5YTOYBTZ.js +65 -0
- package/dist/cli-bundle/focused-chunks/chunk-AK2CI2GI.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-BJMPRB7A.js +91 -0
- package/dist/cli-bundle/focused-chunks/chunk-ENZMATOY.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-EOQ6W25I.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FTUZ3JF2.js → chunk-FEN7WOOP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-FOA7XKWP.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-GWTV45SB.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-SIGIGZCG.js → chunk-H6BVQ63U.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-RBLSY6ML.js → chunk-HYMYAGSY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-JBJJW2WL.js +6 -0
- package/dist/cli-bundle/focused-chunks/chunk-JCLC6HKT.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2IOHHNRT.js → chunk-JDBO7SMR.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UNTQE37U.js → chunk-KLJN44VY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-L4PL3GZR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OV2WVLUR.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-PXDR77TO.js +78 -0
- package/dist/cli-bundle/focused-chunks/chunk-RLRMNFLF.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-E33QA7PK.js → chunk-SKYLOPU2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-VVRXF4JO.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-WZTEFFQI.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-Y54ONBEX.js +25 -0
- package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-QW2VWWJE.js +4 -0
- package/dist/cli-bundle/focused-chunks/settlement-hook-X4FNHTOD.js +7 -0
- package/dist/cli-bundle/focused-chunks/stage-MZSVQYO4.js +2 -0
- package/dist/cli-bundle/main.js +3 -3
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +29 -23
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +66 -52
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +2 -2
- package/dist/core/history/event-index.d.ts +8 -1
- package/dist/core/history/event-index.js +19 -18
- package/dist/core/item/item-format.js +1 -1
- package/dist/core/lock/lock.d.ts +8 -1
- package/dist/core/lock/lock.js +3 -3
- package/dist/core/output/output.js +2 -2
- package/dist/core/store/paths.js +1 -1
- package/dist/core/telemetry/policy.d.ts +2 -0
- package/dist/core/telemetry/policy.js +1 -1
- package/dist/core/telemetry/runtime.d.ts +5 -3
- package/dist/core/telemetry/runtime.js +3 -3
- package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
- package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +1 -1
- package/dist/sdk/extension/install-sources.js +3 -3
- package/dist/sdk/extension/shared.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/health/projection.d.ts +37 -0
- package/dist/sdk/governance/health/projection.js +2 -0
- package/dist/sdk/governance/health.d.ts +7 -18
- package/dist/sdk/governance/health.js +2 -2
- package/dist/sdk/history-repair.js +1 -1
- package/dist/sdk/merge/driver.js +7 -1
- package/dist/sdk/merge/indexed-receipt-blobs.d.ts +2 -0
- package/dist/sdk/merge/indexed-receipt-blobs.js +4 -0
- package/dist/sdk/merge/install.d.ts +8 -0
- package/dist/sdk/merge/install.js +3 -3
- package/dist/sdk/merge/receipts.d.ts +6 -0
- package/dist/sdk/merge/receipts.js +2 -2
- package/dist/sdk/merge/reconcile.d.ts +6 -0
- package/dist/sdk/merge/reconcile.js +1 -1
- package/dist/sdk/merge/settlement-hook.d.ts +12 -0
- package/dist/sdk/merge/settlement-hook.js +7 -0
- package/dist/sdk/merge/stage.d.ts +13 -0
- package/dist/sdk/merge/stage.js +2 -0
- package/dist/sdk/mutation-events.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/list.d.ts +2 -0
- package/dist/sdk/query/list.js +1 -1
- package/dist/sdk/runtime-extended-actions.js +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/docs/COMMANDS.md +39 -0
- package/docs/CONFIGURATION.md +36 -1
- package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +22 -3
- package/docs/MERGE_SAFETY.md +88 -5
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +10 -0
- package/docs/RELEASING.md +8 -1
- package/docs/SDK.md +26 -0
- package/docs/SDK_CONTEXT_COORDINATION.md +71 -7
- package/docs/SDK_STORAGE_LIFECYCLE.md +24 -2
- package/docs/TESTING.md +15 -0
- package/docs/examples/ci/github-actions-pm-extension-gate.yml +1 -1
- package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +1 -1
- package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +1 -1
- package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +6 -3
- package/marketplace.json +1 -1
- package/node_modules/@opentelemetry/core/package.json +2 -1
- package/node_modules/@opentelemetry/instrumentation/package.json +2 -1
- package/node_modules/@opentelemetry/resources/package.json +2 -1
- package/node_modules/@opentelemetry/sdk-trace/package.json +2 -1
- package/node_modules/@opentelemetry/sdk-trace-base/package.json +2 -1
- package/node_modules/@sentry/core/build/cjs/client.js +5 -4
- package/node_modules/@sentry/core/build/cjs/tracing/ai/gen-ai-attributes.js +0 -4
- package/node_modules/@sentry/core/build/cjs/tracing/ai/utils.js +33 -23
- package/node_modules/@sentry/core/build/cjs/tracing/anthropic-ai/index.js +7 -6
- package/node_modules/@sentry/core/build/cjs/tracing/anthropic-ai/streaming.js +3 -1
- package/node_modules/@sentry/core/build/cjs/tracing/google-genai/index.js +13 -14
- package/node_modules/@sentry/core/build/cjs/tracing/google-genai/streaming.js +6 -1
- package/node_modules/@sentry/core/build/cjs/tracing/langchain/utils.js +71 -21
- package/node_modules/@sentry/core/build/cjs/tracing/langgraph/utils.js +23 -33
- package/node_modules/@sentry/core/build/cjs/tracing/openai/streaming.js +6 -0
- package/node_modules/@sentry/core/build/cjs/tracing/openai/utils.js +11 -0
- package/node_modules/@sentry/core/build/cjs/tracing/workers-ai/utils.js +1 -1
- package/node_modules/@sentry/core/build/cjs/utils/eventUtils.js +4 -0
- package/node_modules/@sentry/core/build/cjs/utils/prepareEvent.js +2 -2
- package/node_modules/@sentry/core/build/cjs/utils/version.js +1 -1
- package/node_modules/@sentry/core/build/esm/client.js +6 -5
- package/node_modules/@sentry/core/build/esm/package.json +1 -1
- package/node_modules/@sentry/core/build/esm/tracing/ai/gen-ai-attributes.js +1 -3
- package/node_modules/@sentry/core/build/esm/tracing/ai/utils.js +34 -24
- package/node_modules/@sentry/core/build/esm/tracing/anthropic-ai/index.js +8 -7
- package/node_modules/@sentry/core/build/esm/tracing/anthropic-ai/streaming.js +3 -1
- package/node_modules/@sentry/core/build/esm/tracing/google-genai/index.js +15 -16
- package/node_modules/@sentry/core/build/esm/tracing/google-genai/streaming.js +6 -1
- package/node_modules/@sentry/core/build/esm/tracing/langchain/utils.js +73 -24
- package/node_modules/@sentry/core/build/esm/tracing/langgraph/utils.js +24 -34
- package/node_modules/@sentry/core/build/esm/tracing/openai/streaming.js +6 -0
- package/node_modules/@sentry/core/build/esm/tracing/openai/utils.js +11 -0
- package/node_modules/@sentry/core/build/esm/tracing/workers-ai/utils.js +2 -2
- package/node_modules/@sentry/core/build/esm/utils/eventUtils.js +4 -1
- package/node_modules/@sentry/core/build/esm/utils/prepareEvent.js +2 -2
- package/node_modules/@sentry/core/build/esm/utils/version.js +1 -1
- package/node_modules/@sentry/core/build/types/tracing/ai/utils.d.ts +3 -7
- package/node_modules/@sentry/core/build/types/tracing/anthropic-ai/types.d.ts +2 -2
- package/node_modules/@sentry/core/build/types/tracing/langchain/types.d.ts +15 -0
- package/node_modules/@sentry/core/build/types/tracing/langchain/utils.d.ts +1 -0
- package/node_modules/@sentry/core/build/types/tracing/langgraph/utils.d.ts +2 -0
- package/node_modules/@sentry/core/build/types/tracing/openai/types.d.ts +2 -0
- package/node_modules/@sentry/core/build/types/utils/eventUtils.d.ts +2 -1
- package/node_modules/@sentry/core/build/types-ts3.8/tracing/ai/utils.d.ts +3 -7
- package/node_modules/@sentry/core/build/types-ts3.8/tracing/anthropic-ai/types.d.ts +2 -2
- package/node_modules/@sentry/core/build/types-ts3.8/tracing/langchain/types.d.ts +15 -0
- package/node_modules/@sentry/core/build/types-ts3.8/tracing/langchain/utils.d.ts +1 -0
- package/node_modules/@sentry/core/build/types-ts3.8/tracing/langgraph/utils.d.ts +2 -0
- package/node_modules/@sentry/core/build/types-ts3.8/tracing/openai/types.d.ts +2 -0
- package/node_modules/@sentry/core/build/types-ts3.8/utils/eventUtils.d.ts +2 -1
- package/node_modules/@sentry/core/package.json +1 -1
- package/node_modules/@sentry/node/build/esm/package.json +1 -1
- package/node_modules/@sentry/node/package.json +5 -5
- package/node_modules/@sentry/node-core/build/cjs/integrations/anr/index.js +1 -1
- package/node_modules/@sentry/node-core/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/integrations/anr/index.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/integrations/anr/worker-script.js +2 -2
- package/node_modules/@sentry/node-core/build/esm/integrations/local-variables/local-variables-async.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/integrations/local-variables/worker-script.js +1 -1
- package/node_modules/@sentry/node-core/build/esm/package.json +1 -1
- package/node_modules/@sentry/node-core/package.json +10 -4
- package/node_modules/@sentry/opentelemetry/build/esm/package.json +1 -1
- package/node_modules/@sentry/opentelemetry/package.json +5 -2
- package/node_modules/@sentry/server-utils/build/THIRD-PARTY-LICENSES.txt +55 -55
- package/node_modules/@sentry/server-utils/build/esm/package.json +1 -1
- package/node_modules/@sentry/server-utils/package.json +2 -2
- package/node_modules/@toon-format/toon/README.md +10 -41
- package/node_modules/@toon-format/toon/dist/index.d.mts +12 -36
- package/node_modules/@toon-format/toon/dist/index.mjs +134 -202
- package/node_modules/@toon-format/toon/package.json +2 -2
- package/node_modules/debug/package.json +3 -0
- package/node_modules/fdir/package.json +3 -0
- package/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +46 -0
- package/node_modules/has-flag/readme.md +89 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +135 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +53 -0
- package/node_modules/supports-color/readme.md +76 -0
- package/package.json +4 -4
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-4PNPDT2N.js +0 -236
- package/dist/cli-bundle/chunks/chunk-HY7FQ7QX.js +0 -2
- package/dist/cli-bundle/chunks/chunk-J4LPQCET.js +0 -8
- package/dist/cli-bundle/chunks/chunk-OZCSXX4D.js +0 -80
- package/dist/cli-bundle/chunks/chunk-VMCSTFSO.js +0 -2
- package/dist/cli-bundle/chunks/chunk-X2ONXFBP.js +0 -3
- package/dist/cli-bundle/chunks/chunk-X53HM753.js +0 -20
- package/dist/cli-bundle/chunks/register-mutation-EQYMT32A.js +0 -20
- package/dist/cli-bundle/chunks/register-operations-VXBGE4XI.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-UUDEGFRO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-5JEFDEL3.js +0 -166
- package/dist/cli-bundle/focused-chunks/chunk-AH6NX6GM.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-JXR6UKFM.js +0 -3
- package/dist/cli-bundle/focused-chunks/chunk-MBQF6HT6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-NZO7GOXD.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-PYC7BF6Z.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-QOSVJDOO.js +0 -75
- package/dist/cli-bundle/focused-chunks/chunk-RHTH5ILM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-TRFVAWF2.js +0 -26
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as g}from"./chunk-JBJJW2WL.js";import{b as m}from"./chunk-FOA7XKWP.js";import"./chunk-3TEIACFU.js";import{execFile as T}from"node:child_process";import{realpath as E}from"node:fs/promises";import I from"node:path";import{promisify as D}from"node:util";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new n.Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="a29ee03b-9955-56c6-a72e-1e93182e5de8")}catch{}})();var h=D(T),_="[a-f0-9]{40}(?:[a-f0-9]{24})?",$=new RegExp(`^100(?:644|755) (${_}) 0$`,"u"),M=new RegExp(`^(${_}) blob (\\d+)$`,"u");async function y(n,r,s){let t=h("git",n,{...s,encoding:"buffer"}),e=t.child.stdin;return e!==null&&(e.on("error",()=>{t.child.kill()}),e.end(`${r.join(`
|
|
2
|
+
`)}
|
|
3
|
+
`)),(await t).stdout}function N(n,r){let s=new Map;for(let t of n.split("\0")){let e=t.indexOf(" "),i=t.slice(e+1),o=$.exec(t.slice(0,e));o!==null&&r.has(i)&&s.set(i,o[1])}return s}function B(n,r,s){let t=[],e=[],i=0;for(let o of n.trimEnd().split(/\r?\n/u)){let c=M.exec(o);if(c===null||!r.has(c[1]))continue;let l=Number(c[2]);!Number.isSafeInteger(l)||l>s||(e.length>0&&i+l+128>s&&(t.push(e),e=[],i=0),e.push({id:c[1],size:l}),i+=l+128)}return e.length>0&&t.push(e),t}function O(n,r,s){let t=0;for(let{id:e,size:i}of r){let o=n.indexOf(10,t)+1;if(o===0||n.subarray(t,o-1).toString("ascii")!==`${e} blob ${i}`||n[o+i]!==10)throw new Error("Invalid indexed receipt batch framing");s.set(e,n.subarray(o,o+i).toString("utf8")),t=o+i+1}if(t!==n.length)throw new Error("Unexpected indexed receipt batch data")}async function z(n,r,s,t){let e=m();e.GIT_NO_REPLACE_OBJECTS="1",process.env.GIT_INDEX_FILE!==void 0&&(e.GIT_INDEX_FILE=I.resolve(process.env.GIT_INDEX_FILE));let i={cwd:n,env:e,windowsHide:!0,timeout:1e4,maxBuffer:t+256};try{let o=(await h("git",["rev-parse","--show-toplevel"],{...i,encoding:"utf8"})).stdout.trim(),[c,l]=await Promise.all([E(o),E(r)]),f=I.relative(c,l).replaceAll("\\","/");if(g(f))return new Map;i.cwd=c;let b=new Map(s.map(a=>[`${f}/${a}`,a])),v=(await h("git",["ls-files","--stage","-z","--",`:(literal)${f}/`],{...i,encoding:"utf8"})).stdout,d=N(v,new Set(b.keys()));if(d.size===0)return new Map;let w=new Set(d.values()),x=(await y(["cat-file","--batch-check"],[...w],i)).toString("utf8"),p=new Map;for(let a of B(x,w,t))O(await y(["cat-file","--batch"],a.map(u=>u.id),i),a,p);return new Map([...d].filter(([,a])=>p.has(a)).map(([a,u])=>[b.get(a),p.get(u)]))}catch{return new Map}}export{z as readIndexedReceiptBlobs};
|
|
4
|
+
//# sourceMappingURL=indexed-receipt-blobs-QW2VWWJE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as d}from"./chunk-VVRXF4JO.js";import{b as l}from"./chunk-FOA7XKWP.js";import{D as c,H as p,y as s,z as m}from"./chunk-3TEIACFU.js";import{execFile as f}from"node:child_process";import{chmod as h,lstat as u}from"node:fs/promises";import{promisify as w}from"node:util";(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]="5b6eab08-f707-586f-bb05-484bd9160551")}catch{}})();var y=w(f),g=`#!/bin/sh
|
|
2
|
+
# pm-cli:lossless-merge-settlement:v1
|
|
3
|
+
`;async function I(e,t){let r=(await y("git",["rev-parse","--path-format=absolute","--git-path","hooks/pre-commit"],{cwd:e,env:l(),timeout:1e4})).stdout.trim(),o,i=!1;try{o=await d(r,65536)??"",i=process.platform==="win32"||((await u(r)).mode&73)!==0}catch(a){if(!c(a))throw a}if(o!==void 0&&!o.startsWith(g))throw new m("The pre-commit hook already exists and is not owned by pm; it was preserved.",s.CONFLICT,{code:"merge_settlement_hook_conflict",recovery:{suggested_retry:"pm merge install --dry-run"},nextSteps:["Integrate pm merge reconcile --stage into your existing hook after reviewing its policy, or keep manual settlement. pm never replaces an existing unowned hook."]});let n=`${g}merge_head=$(git rev-parse --git-path MERGE_HEAD) || exit 1
|
|
4
|
+
[ -f "$merge_head" ] || exit 0
|
|
5
|
+
exec ${t} merge reconcile --stage
|
|
6
|
+
`;return{path:r,changed:o!==n||!i,content:n}}async function H(e){e.changed&&(await p(e.path,e.content),await h(e.path,493))}export{I as prepareMergeSettlementHook,H as writeMergeSettlementHook};
|
|
7
|
+
//# sourceMappingURL=settlement-hook-X4FNHTOD.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as w}from"./chunk-JCLC6HKT.js";import"./chunk-PXDR77TO.js";import"./chunk-RLRMNFLF.js";import"./chunk-YLVHHWHN.js";import{wa as h}from"./chunk-Y54ONBEX.js";import{b as u}from"./chunk-JBJJW2WL.js";import{b as g}from"./chunk-FOA7XKWP.js";import{y as m,z as f}from"./chunk-3TEIACFU.js";import{execFile as y}from"node:child_process";import{realpath as v}from"node:fs/promises";import l from"node:path";import{promisify as _}from"node:util";(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]="fe5937fc-def3-5ed4-9663-70a6e9d258a1")}catch{}})();var b=_(y);function c(e){return new f(`Automatic merge settlement refused: ${e}`,m.CONFLICT,{code:"merge_settlement_review_required",recovery:{suggested_retry:"pm merge reconcile --dry-run"},nextSteps:["Inspect receipts, repair streams and Git changes. Resolve competing values or unrelated drift explicitly, then run pm merge reconcile and stage the reviewed artifacts manually."]})}async function x(e){let t=process.env.GIT_INDEX_FILE;if(t===void 0)return;let s=(await e(["rev-parse","--path-format=absolute","--git-path","index"])).stdout.trim();if(l.resolve(t)!==l.resolve(s))throw c("an alternate Git index requires explicit manual settlement")}async function R(e,t){if(t.length===0)return[];let s=t.map(a=>`:(literal)${a}`),o=new Set((await e(["ls-files","--cached","-z","--",...s])).stdout.split("\0")),r=t.filter(a=>!o.has(a)).map(a=>`:(literal)${a}`);if(r.length>0&&(await e(["diff","--cached","--name-only","--diff-filter=D","-z","--",...r])).stdout.length>0)throw c("a receipt has a staged deletion that requires explicit review");return r}async function k(e){let{git:t,preview:s,paths:o,newReceiptPathspecs:r}=e,a=!1;try{r.length>0&&(await t(["add","--",...r]),a=!0);let n=await e.apply();if(!n.ok||JSON.stringify(n.receipts.summaries)!==JSON.stringify(s.receipts.summaries)||n.repair.streams.some(p=>!s.repair.streams.some(d=>d.id===p.id)))throw c("reconciliation changed or did not finish; inspect the audit artifacts before staging");return o.length>0&&await t(["add","--",...o.map(p=>`:(literal)${p}`)]),{...n,staged_paths:o,guidance:["Lossless reconciliation artifacts are staged for the merge commit. Review git diff --cached before committing."]}}catch(n){throw a&&await t(["reset","--quiet","--",...r]),n}}function G(e){if(e.repair.totals.failed>0||e.receipts.missing_history_references_after>0||e.receipts.summaries.some(t=>t.conflict_fields.length>0)||e.repair.streams.some(t=>t.merge_receipt_proof?.trusted!==!0)||e.validation.checks.some(t=>t.name!=="history_drift"&&t.status!=="ok"))throw c("only fully authenticated receipt-backed repairs without discarded values can be staged")}async function I(e){try{return{...e,path:await v(h(process.cwd(),e.path))}}catch{throw c("the tracker root cannot be resolved")}}async function N(e){let{preview:t}=e;G(t);let{path:s}=await I(e.global),o=await w(s);if(o===null)throw c("a Git workspace is required");let r=i=>b("git",i,{cwd:o,env:g(),timeout:1e4});if(await x(r),(await r(["ls-files","--unmerged","-z"])).stdout.length>0)throw c("Git still has unresolved paths");let a=[...new Set([...[...new Set([...t.repair.streams.map(i=>i.id),...t.receipts.summaries.map(i=>i.item_id)])].map(i=>l.join(s,"history",`${i}.jsonl`)),...t.receipts.summaries.map(i=>l.join(s,"merge-receipts",`${i.receipt_id}.json`))])].map(i=>l.relative(o,i).replaceAll("\\","/"));if(a.some(u))throw c("reconciliation artifacts must belong to this Git workspace");let n=a.map(i=>`:(literal)${i}`),p=t.receipts.summaries.map(i=>l.relative(o,l.join(s,"merge-receipts",`${i.receipt_id}.json`)).replaceAll("\\","/"));if(n.length>0)try{await r(["diff","--quiet","--",...n])}catch{throw c("reconciliation paths have unstaged edits or Git cannot verify their index state")}let d=await R(r,p);return e.dryRun?{...t,staged_paths:[]}:k({...e,git:r,paths:a,newReceiptPathspecs:d})}export{I as resolveMergeSettlementGlobal,N as stageLosslessMergeReconciliation};
|
|
2
|
+
//# sourceMappingURL=stage-MZSVQYO4.js.map
|