@unbrained/pm-cli 2026.10.3 → 2026.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +17 -2
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli/runtime/selection.js +1 -1
- package/dist/cli/runtime-compatibility-boundary.d.ts +1 -1
- package/dist/cli/runtime-compatibility-boundary.js +3 -3
- package/dist/cli-bundle/bundle-manifest.json +154 -154
- package/dist/cli-bundle/chunks/{chunk-YCBGZF3T.js → chunk-7CE2DJMA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6ST3SCQ6.js → chunk-7UVXKI7K.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-H2DZW6I6.js → chunk-D7Z2ZMJL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-44UGMMQ6.js → chunk-GZMWISWW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KP7NBQK3.js → chunk-J52QIRRZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3AF2R3Y6.js → chunk-JDKD3WGG.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-JQ7DW663.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-MKXBCBAN.js → chunk-QXIDOOWT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5XKF5SQV.js → chunk-SMKHR6BM.js} +49 -49
- package/dist/cli-bundle/chunks/{chunk-FW5LJXQY.js → chunk-V3U77H3V.js} +28 -28
- package/dist/cli-bundle/chunks/{chunk-YDWKGUQU.js → chunk-XZDWAYJC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QPKQKSQU.js → chunk-Y6VRBTP3.js} +71 -71
- package/dist/cli-bundle/chunks/{chunk-6Z4IV2MC.js → chunk-YAAFYFS4.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-DYCGUQEW.js → register-list-query-QBGXO5JJ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-5PT3NW3A.js → register-mutation-53ZLT4RX.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-QDDQOAAV.js → register-operations-OBK2FXUU.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-BBX67YMA.js → register-setup-HM3OCBH2.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FKK2HI3S.js → chunk-2JFYR56O.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UTRSM3ZK.js → chunk-32EVUSS4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-DBD4W4QP.js → chunk-467EW5RL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-WAJNX4RN.js → chunk-5GUSO2P4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-GMYUNHST.js → chunk-6XBRADQQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-EJN7DY3B.js → chunk-7O4NUJVO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-E754JDLY.js → chunk-CURTIIQT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4FFPGNCJ.js → chunk-IJUWEEEB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-XRSCIYHR.js → chunk-JCVMOSWQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZIXFMIUL.js → chunk-JMJK2L4Z.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-WCY6HRZO.js → chunk-KG3H4UZZ.js} +14 -14
- package/dist/cli-bundle/focused-chunks/{chunk-VVWYI2X7.js → chunk-MHQ2XICU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-3BIYG72P.js → chunk-Q6DJ5DFQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-73DA7ISY.js → chunk-RJV6QVJE.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-HIA2ZF64.js → chunk-ZE2JZ7R6.js} +11 -11
- package/dist/cli-bundle/focused-chunks/chunk-ZLEN4HZD.js +165 -0
- package/dist/cli-bundle/main.js +22 -22
- 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 +22 -22
- 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 +11 -11
- 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 +1 -1
- package/dist/core/extensions/extension-types.d.ts +8 -1
- package/dist/core/extensions/extension-types.js +1 -1
- package/dist/core/shared/time.js +1 -1
- package/dist/core/store/settings.d.ts +11 -2
- package/dist/core/store/settings.js +2 -2
- package/dist/sdk/agent/subcommand-recovery.js +1 -1
- package/dist/sdk/cli-bootstrap.js +1 -1
- package/dist/sdk/context-intent-contracts.js +1 -1
- package/dist/sdk/extension-command-context.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/item-transaction.js +1 -1
- package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
- package/dist/sdk/lifecycle/task-composition.js +1 -1
- package/dist/sdk/output-projection.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/get.js +1 -1
- package/dist/sdk/query/search-pagination.d.ts +1 -1
- package/dist/sdk/query/search-pagination.js +1 -1
- package/dist/sdk/test/workspace-snapshot.js +1 -1
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +25 -0
- package/docs/OUTPUT_PROJECTION_CONTRACTS.md +23 -0
- package/docs/SDK_AUDITED_MUTATIONS.md +35 -0
- package/docs/TESTING.md +8 -0
- package/docs/ecosystem-review-2026-09-28.json +2864 -3157
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +2 -2
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +2 -2
- package/plugins/pm-codex/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-H7CXQBGQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-YC32ZSLS.js +0 -165
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as W}from"./chunk-6ST3SCQ6.js";import{g as T,i as P}from"./chunk-YDWKGUQU.js";import{$a as C,Pa as U,Sa as O,eb as L,gb as j}from"./chunk-KP7NBQK3.js";import"./chunk-DEZPZOQ7.js";import{Jf as D,Mf as b,Nf as h,Qo as y,To as x,ab as I,l as $,m as S,na as d,pa as m,pi as R}from"./chunk-QPKQKSQU.js";import A from"node:fs/promises";import F from"node:path";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="26ea7f42-d5f7-5ada-afd9-389dadc4d138")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0b0e08e0-f6e7-59c4-ac96-9f47b172727a")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d975120a-964e-5b19-ae10-8ba011ba9bf8")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="108609fa-51fc-5bd0-ac54-de2ad14a66c6")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="b36466e6-5574-5509-909a-e8599f11664c")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="e5e1e242-6864-5a72-adb9-0eda4c65a0c3")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1261f2a8-b56d-5108-a130-abb46bbab3ac")}catch{}})();var M={extension:"extension",package:void 0};async function E(t,e){if(!t)return;let o=$(t),a=y(e);await R(I(process.cwd(),a.path)).then(r=>r.ux.deprecation_hints)&&h(S(o))}var X={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function Y(t){let e=t.capability,o=typeof e=="string"?[e]:Array.isArray(e)?e.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new m(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function G(t,e,o="extension"){let a={...t};e!==void 0&&(a[X[e]]=!0);let i=(...c)=>c.some(s=>a[s]===!0),r=(...c)=>{for(let s of c)if(typeof a[s]=="string")return a[s]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:Y(t),declarative:i("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function J(t){let e=(await A.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...t].sort((a,i)=>a.localeCompare(i));return e.length===o.length&&e.every((a,i)=>a===o[i])}async function Q(t){let e=(t??[]).map(o=>o.trim()).filter(o=>o.length>0);return e.length<=1?e.length===0?void 0:e:await J(e)?["*"]:e}function z(t,e,o){let a=t.markdown===!0;if(o!==void 0&&o==="")throw new m("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new m("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(e.json)throw new m("Cannot combine --json with --markdown.",d.USAGE);if(t.describe!==!0)throw new m("--markdown is only supported by the describe action.",d.USAGE)}}async function Z(t){let e=O(t.result.details,t.vocabulary);if(t.outputPath!==void 0){let o=F.resolve(t.outputPath);await A.mkdir(F.dirname(o),{recursive:!0}),await A.writeFile(o,e,"utf8")}if(!t.globalOptions.quiet){for(let o of t.result.warnings)h(`warning: ${o}`);t.outputPath===void 0&&D(e)}}function tt(t,e){let o=!!e.strictExit||!!e.failOnWarn;if(t.action!=="doctor"||!o)return;let a=t.details!==null&&typeof t.details=="object"?t.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,r=i&&typeof i.status=="string"?i.status:void 0;(t.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function f(t,e,o,a,i="extension"){let r=y(o),c=Date.now(),s=i==="extension"?"package":i;await E(M[i],o);let n=G(e,a,s),p=(typeof n.output=="string"?n.output:void 0)?.trim();z(n,r,p);let g=await C(t,n,r);n.markdown===!0?await Z({result:g,vocabulary:s,outputPath:p,globalOptions:r}):b(g,r),tt(g,n),g.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&h(`profile:command=extension took_ms=${Date.now()-c}`)}function et(t){return t.details!==null&&typeof t.details=="object"?t.details:{}}function ot(t){return t instanceof m?{message:t.message,exit_code:t.exitCode,...t.context}:{message:t instanceof Error?t.message:String(t),exit_code:d.GENERIC_FAILURE}}async function at(t,e,o){let a=[],i=[],r=d.GENERIC_FAILURE;for(let c of t)try{let s=await C(c,e,o),n=et(s),l=Array.isArray(s.warnings)?s.warnings:[];i.push(...l);let p=s.ok===!0;a.push({target:c,ok:p,extension:n.extension,source:n.source,install_plan:n.install_plan,dry_run:n.dry_run,destination_path:n.destination_path,activated:n.activated,settings_changed:n.settings_changed,command_paths:n.command_paths,action_paths:n.action_paths,runtime_activation_status:n.runtime_activation_status,activation_diagnostics:n.activation_diagnostics,command_discovery:n.command_discovery,verification:n.verification,warnings:l,...p?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(s){let n=ot(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),a.push({target:c,ok:!1,error:n})}return{rows:a,warnings:i,failureExitCode:r}}async function N(t,e,o,a){let i=a==="extension"?"package":a;await E(M[a],o);let r=await Q(t);if(r===void 0||r.length<=1){await f(r?.[0],e,o,"install",i);return}let c=y(o),s=Date.now(),n=G(e,"install",i);if(z(n,c,void 0),[n.gh,n.github].some(v=>typeof v=="string"&&v.trim().length>0))throw new m("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let{rows:p,warnings:g,failureExitCode:w}=await at(r,n,c),k=p.filter(v=>v.ok!==!0).length,B={ok:k===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:p.length-k,...n.dryRun===!0?{dry_run:!0,planned_count:p.length-k}:{},failed_count:k,targets:p,warnings:[...new Set(g)].sort((v,V)=>v.localeCompare(V))};b(B,c),k>0&&(process.exitCode=w),c.profile&&h(`profile:command=extension took_ms=${Date.now()-s}`)}function it(t){return t.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function _(t){return t.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(t,e){return e==="package"?_(t):it(t)}function q(t){return t.option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing")}async function K(t,e,o){let a=y(e),i=Date.now();o&&await E("upgrade",e);let r=await P(t,e.optsWithGlobals(),a);b(r,a),r.ok||(process.exitCode=d.GENERIC_FAILURE),a.profile&&h(`profile:command=package-upgrade took_ms=${Date.now()-i}`)}function H(t,e){let o=e==="package"?"package":"extension",a=e==="package"?"packages":"extensions",i=e,r=t.command(i,{hidden:e==="extension"}).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source, name, or scaffold path`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>","Starter capability for --init (default: commands)",x).option("--install",`Install a ${o} source`).option("--dry-run","Preview install without writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} and updates`).option("--describe",`Show surfaces registered by a loaded ${o}`).option("--markdown","Render describe as Markdown").option("--output <path>","Write Markdown to a file").option("--reload",`Reload ${a} without import cache`).option("--watch","Use watch mode with --reload").option("--doctor",`Run ${o} diagnostics`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt unmanaged ${o}`).option("--adopt-all",`Adopt all unmanaged ${a}`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(e==="package"?"Manage package lifecycle in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,void 0,e)});e==="package"&&(r.alias("packages"),r.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=r.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${U.join("|")}; default commands)`,x).description(e==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");e==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"init",e)}),u(r.command("install").option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),e).action(async(s,n,l)=>{await N(s,l.optsWithGlobals(),l,e)}),u(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"uninstall",e)}),u(r.command("explore").description(`List discovered ${a} in selected scope.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"explore",e)}),u(r.command("inventory").argument("[name]",`${o[0].toUpperCase()}${o.slice(1)} name or directory to inspect`).description(`Read configured ${o} install and enablement state without activating extension code.`),e).action(async(s,n,l)=>{let p=y(l),g=l.optsWithGlobals();if(g.global===!0&&(g.project===!0||g.local===!0))throw new m("--global and --project/--local are mutually exclusive.",d.USAGE);let w=await W({pmRoot:I(process.cwd(),p.path),scope:g.global===!0?"global":"project",name:s});b(w,p),w.complete||(process.exitCode=d.GENERIC_FAILURE)}),u(r.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"manage",e)}),u(r.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"describe",e)}),u(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"reload",e)}),u(r.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"doctor",e)}),u(r.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"catalog",e)}),u(r.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"adopt",e)}),u(r.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"adopt-all",e)}),u(r.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"migrate",e)}),u(r.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"activate",e)}),u(r.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"deactivate",e)}),e==="package"&&q(_(r.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(s,n,l)=>{await K(s,l,!1)})}async function nt(t,e,o){let a=y(o),i=Date.now(),r=await j(t,a,{idPrefix:typeof e.idPrefix=="string"?e.idPrefix:void 0,preset:typeof e.preset=="string"?e.preset:void 0,defaults:e.defaults===!0||e.yes===!0,author:typeof e.author=="string"?e.author:void 0,agentGuidance:typeof e.agentGuidance=="string"?e.agentGuidance:void 0,typePreset:typeof e.typePreset=="string"?e.typePreset:void 0,withPackages:e.withPackages===!0,mergeFence:e.mergeFence!==!1,force:e.force===!0,workspace:typeof e.workspace=="string"?e.workspace:void 0}),s=e.verbose===!0||a.json===!0;b(s?r:L(r,!0),a),a.profile&&h(`profile:command=init took_ms=${Date.now()-i}`)}function rt(t,e,o,a){let r=t!==void 0&&new Set(["get","set","list","export"]).has(t);return{resolvedScope:r?"project":t??"project",resolvedAction:r?t:e??"list",resolvedKey:r?e:o,resolvedValue:r?o:a}}function st(t){return{criterion:Array.isArray(t.criterion)?t.criterion:[],format:typeof t.format=="string"?t.format:void 0,policy:typeof t.policy=="string"?t.policy:void 0,value:typeof t.value=="string"?t.value:void 0,clearCriteria:t.clearCriteria===!0,defaultDepth:typeof t.defaultDepth=="string"?t.defaultDepth:void 0,activityLimit:typeof t.activityLimit=="string"?t.activityLimit:void 0,staleThresholdDays:typeof t.staleThresholdDays=="string"?t.staleThresholdDays:void 0,sectionHierarchy:typeof t.sectionHierarchy=="string"?t.sectionHierarchy:void 0,sectionActivity:typeof t.sectionActivity=="string"?t.sectionActivity:void 0,sectionProgress:typeof t.sectionProgress=="string"?t.sectionProgress:void 0,sectionBlockers:typeof t.sectionBlockers=="string"?t.sectionBlockers:void 0,sectionFiles:typeof t.sectionFiles=="string"?t.sectionFiles:void 0,sectionWorkload:typeof t.sectionWorkload=="string"?t.sectionWorkload:void 0,sectionStaleness:typeof t.sectionStaleness=="string"?t.sectionStaleness:void 0,sectionTests:typeof t.sectionTests=="string"?t.sectionTests:void 0}}async function lt(t,e,o,a,i,r){let c=y(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:p,resolvedValue:g}=rt(t,e,o,a),w=await T(n,l,p,st(i),c,typeof g=="string"?g:void 0);b(w,c),c.profile&&h(`profile:command=config took_ms=${Date.now()-s}`)}var Ut={normalizeExtensionOptions:G};function Ot(t){t.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(e,o,a)=>{await nt(e,o,a)}),t.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",x).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; untrusted-linked-test-execution=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(e,o,a,i,r,c)=>{await lt(e,o,a,i,r,c)}),H(t,"extension"),H(t,"package"),_(t.command("install",{hidden:!0}).option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(e,o,a)=>{await E("install",a),await N(e,a.optsWithGlobals(),a,"package")}),q(_(t.command("upgrade",{hidden:!0}).argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(e,o,a)=>{await K(e,a,!0)})}export{Ut as _testOnlyRegisterSetup,Ot as registerSetupCommands};
|
|
2
|
-
//# sourceMappingURL=register-setup-
|
|
1
|
+
import{a as W}from"./chunk-7UVXKI7K.js";import{g as T,i as P}from"./chunk-XZDWAYJC.js";import{$a as C,Pa as U,Sa as O,eb as L,gb as j}from"./chunk-J52QIRRZ.js";import"./chunk-DEZPZOQ7.js";import{Jf as D,Mf as b,Nf as h,Ro as y,Uo as x,ab as I,l as $,m as S,na as d,pa as m,qi as R}from"./chunk-Y6VRBTP3.js";import A from"node:fs/promises";import F from"node:path";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="26ea7f42-d5f7-5ada-afd9-389dadc4d138")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0b0e08e0-f6e7-59c4-ac96-9f47b172727a")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d975120a-964e-5b19-ae10-8ba011ba9bf8")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="108609fa-51fc-5bd0-ac54-de2ad14a66c6")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="b36466e6-5574-5509-909a-e8599f11664c")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="e5e1e242-6864-5a72-adb9-0eda4c65a0c3")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="1261f2a8-b56d-5108-a130-abb46bbab3ac")}catch{}})();var M={extension:"extension",package:void 0};async function E(t,e){if(!t)return;let o=$(t),a=y(e);await R(I(process.cwd(),a.path)).then(r=>r.ux.deprecation_hints)&&h(S(o))}var X={init:"init",install:"install",uninstall:"uninstall",explore:"explore",manage:"manage",describe:"describe",reload:"reload",doctor:"doctor",catalog:"catalog",adopt:"adopt","adopt-all":"adoptAll",activate:"activate",deactivate:"deactivate",migrate:"migrate"};function Y(t){let e=t.capability,o=typeof e=="string"?[e]:Array.isArray(e)?e.filter(i=>typeof i=="string"):[],a=[...new Set(o.map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))];if(a.length>1)throw new m(`Multiple scaffold capabilities cannot be combined yet: ${a.join(", ")}. Choose one capability per scaffold.`,d.USAGE);return a[0]}function G(t,e,o="extension"){let a={...t};e!==void 0&&(a[X[e]]=!0);let i=(...c)=>c.some(s=>a[s]===!0),r=(...c)=>{for(let s of c)if(typeof a[s]=="string")return a[s]};return{init:i("init"),scaffold:i("scaffold"),install:i("install"),uninstall:i("uninstall"),explore:i("explore","list"),manage:i("manage"),describe:i("describe"),markdown:i("markdown"),reload:i("reload"),doctor:i("doctor"),catalog:i("catalog"),adopt:i("adopt"),adoptAll:i("adoptAll","adopt_all","adopt-all"),activate:i("activate"),deactivate:i("deactivate"),migrate:i("migrate"),project:i("project"),local:i("local"),global:i("global"),gh:r("gh"),github:r("github"),ref:r("ref"),capability:Y(t),declarative:i("declarative"),fields:r("fields"),detail:r("detail"),output:r("output"),trace:i("trace"),watch:i("watch"),runtimeProbe:i("runtimeProbe","runtime_probe","runtime-probe"),fixManagedState:i("fixManagedState","fix_managed_state","fix-managed-state"),isolated:i("isolated"),ignoreGlobal:i("ignoreGlobal","ignore_global","ignore-global"),strictExit:i("strictExit","strict_exit","strict-exit"),failOnWarn:i("failOnWarn","fail_on_warn","fail-on-warn"),dryRun:i("dryRun","dry_run","dry-run"),vocabulary:o}}async function J(t){let e=(await A.readdir(process.cwd())).filter(a=>!a.startsWith(".")).sort((a,i)=>a.localeCompare(i)),o=[...t].sort((a,i)=>a.localeCompare(i));return e.length===o.length&&e.every((a,i)=>a===o[i])}async function Q(t){let e=(t??[]).map(o=>o.trim()).filter(o=>o.length>0);return e.length<=1?e.length===0?void 0:e:await J(e)?["*"]:e}function z(t,e,o){let a=t.markdown===!0;if(o!==void 0&&o==="")throw new m("--output requires a non-empty file path.",d.USAGE);if(o!==void 0&&!a)throw new m("--output is only supported with --markdown describe output.",d.USAGE);if(a){if(e.json)throw new m("Cannot combine --json with --markdown.",d.USAGE);if(t.describe!==!0)throw new m("--markdown is only supported by the describe action.",d.USAGE)}}async function Z(t){let e=O(t.result.details,t.vocabulary);if(t.outputPath!==void 0){let o=F.resolve(t.outputPath);await A.mkdir(F.dirname(o),{recursive:!0}),await A.writeFile(o,e,"utf8")}if(!t.globalOptions.quiet){for(let o of t.result.warnings)h(`warning: ${o}`);t.outputPath===void 0&&D(e)}}function tt(t,e){let o=!!e.strictExit||!!e.failOnWarn;if(t.action!=="doctor"||!o)return;let a=t.details!==null&&typeof t.details=="object"?t.details:{},i=a.summary!==null&&typeof a.summary=="object"?a.summary:null,r=i&&typeof i.status=="string"?i.status:void 0;(t.warnings.length>0||r!==void 0&&r!=="ok")&&(process.exitCode=d.GENERIC_FAILURE)}async function f(t,e,o,a,i="extension"){let r=y(o),c=Date.now(),s=i==="extension"?"package":i;await E(M[i],o);let n=G(e,a,s),p=(typeof n.output=="string"?n.output:void 0)?.trim();z(n,r,p);let g=await C(t,n,r);n.markdown===!0?await Z({result:g,vocabulary:s,outputPath:p,globalOptions:r}):b(g,r),tt(g,n),g.ok===!1&&(process.exitCode=d.GENERIC_FAILURE),r.profile&&h(`profile:command=extension took_ms=${Date.now()-c}`)}function et(t){return t.details!==null&&typeof t.details=="object"?t.details:{}}function ot(t){return t instanceof m?{message:t.message,exit_code:t.exitCode,...t.context}:{message:t instanceof Error?t.message:String(t),exit_code:d.GENERIC_FAILURE}}async function at(t,e,o){let a=[],i=[],r=d.GENERIC_FAILURE;for(let c of t)try{let s=await C(c,e,o),n=et(s),l=Array.isArray(s.warnings)?s.warnings:[];i.push(...l);let p=s.ok===!0;a.push({target:c,ok:p,extension:n.extension,source:n.source,install_plan:n.install_plan,dry_run:n.dry_run,destination_path:n.destination_path,activated:n.activated,settings_changed:n.settings_changed,command_paths:n.command_paths,action_paths:n.action_paths,runtime_activation_status:n.runtime_activation_status,activation_diagnostics:n.activation_diagnostics,command_discovery:n.command_discovery,verification:n.verification,warnings:l,...p?{}:{error:{message:"Extension install returned ok=false without throwing an error.",exit_code:d.GENERIC_FAILURE,code:"extension_install_soft_failed"}}})}catch(s){let n=ot(s),l=n.exit_code;typeof l=="number"&&r===d.GENERIC_FAILURE&&l!==d.GENERIC_FAILURE&&(r=l),a.push({target:c,ok:!1,error:n})}return{rows:a,warnings:i,failureExitCode:r}}async function N(t,e,o,a){let i=a==="extension"?"package":a;await E(M[a],o);let r=await Q(t);if(r===void 0||r.length<=1){await f(r?.[0],e,o,"install",i);return}let c=y(o),s=Date.now(),n=G(e,"install",i);if(z(n,c,void 0),[n.gh,n.github].some(v=>typeof v=="string"&&v.trim().length>0))throw new m("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.",d.USAGE,{code:"multi_target_github_install_ambiguous",required:"Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",examples:["pm install --gh owner/repo","pm install npm:pm-guide-shell pm-todos"]});let{rows:p,warnings:g,failureExitCode:w}=await at(r,n,c),k=p.filter(v=>v.ok!==!0).length,B={ok:k===0,action:"install",scope:n.global===!0?"global":"project",installed_count:n.dryRun===!0?0:p.length-k,...n.dryRun===!0?{dry_run:!0,planned_count:p.length-k}:{},failed_count:k,targets:p,warnings:[...new Set(g)].sort((v,V)=>v.localeCompare(V))};b(B,c),k>0&&(process.exitCode=w),c.profile&&h(`profile:command=extension took_ms=${Date.now()-s}`)}function it(t){return t.option("--project","Use project extension scope (default)").option("--local","Alias for --project").option("--global","Use global extension scope")}function _(t){return t.option("--project","Use project package scope (default)").option("--local","Alias for --project").option("--global","Use global package scope")}function u(t,e){return e==="package"?_(t):it(t)}function q(t){return t.option("--dry-run","Plan CLI/package upgrades without running npm or reinstalling packages").option("--cli-only","Upgrade only the pm CLI/SDK npm package").option("--packages-only","Upgrade only managed pm packages").option("--repair","Force npm global reinstall when upgrading the pm CLI/SDK").option("--tag <value>","npm dist-tag/version for CLI and registry package upgrades").option("--package-name <value>","Override the CLI package name for self-upgrade testing")}async function K(t,e,o){let a=y(e),i=Date.now();o&&await E("upgrade",e);let r=await P(t,e.optsWithGlobals(),a);b(r,a),r.ok||(process.exitCode=d.GENERIC_FAILURE),a.profile&&h(`profile:command=package-upgrade took_ms=${Date.now()-i}`)}function H(t,e){let o=e==="package"?"package":"extension",a=e==="package"?"packages":"extensions",i=e,r=t.command(i,{hidden:e==="extension"}).argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} source, name, or scaffold path`).option("--init",`Generate a starter ${o} scaffold at target path`).option("--scaffold","Alias for --init").option("--capability <kind>","Starter capability for --init (default: commands)",x).option("--install",`Install a ${o} source`).option("--dry-run","Preview install without writes or activation").option("--uninstall",`Uninstall an installed ${o}`).option("--explore",`List discovered ${a} in selected scope`).option("--list","Alias for --explore").option("--manage",`List managed ${a} and updates`).option("--describe",`Show surfaces registered by a loaded ${o}`).option("--markdown","Render describe as Markdown").option("--output <path>","Write Markdown to a file").option("--reload",`Reload ${a} without import cache`).option("--watch","Use watch mode with --reload").option("--doctor",`Run ${o} diagnostics`).option("--catalog",`List bundled first-party ${o} catalog metadata`).option("--adopt",`Adopt unmanaged ${o}`).option("--adopt-all",`Adopt all unmanaged ${a}`).option("--activate",`Activate a ${o} in selected scope settings`).option("--deactivate",`Deactivate a ${o} in selected scope settings`).option("--project",`Use project ${o} scope (default)`).option("--local","Alias for --project").option("--global",`Use global ${o} scope`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").option("--detail <mode>",`${o[0].toUpperCase()}${o.slice(1)} diagnostics detail mode (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(e==="package"?"Manage package lifecycle in project or global scope.":"Manage extension lifecycle in project or global scope.").action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,void 0,e)});e==="package"&&(r.alias("packages"),r.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"));let c=r.command("init").alias("scaffold").argument("<target>","Scaffold target directory path").option("--capability <kind>",`Capability the starter targets (${U.join("|")}; default commands)`,x).description(e==="package"?"Generate a starter package scaffold with package metadata, manifest, and entrypoint.":"Generate a starter extension scaffold with manifest and entrypoint.");e==="package"&&c.option("--declarative","Scaffold the composeExtension blueprint starter (any capability)"),u(c,e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"init",e)}),u(r.command("install").option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]",`${o[0].toUpperCase()}${o.slice(1)} source (local path, bundled alias, npm: source, wildcard, or GitHub source)`).option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description(`Install ${o} from local path, bundled alias, npm: source, wildcard, or GitHub source.`),e).action(async(s,n,l)=>{await N(s,l.optsWithGlobals(),l,e)}),u(r.command("uninstall").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Uninstall an installed ${o}.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"uninstall",e)}),u(r.command("explore").description(`List discovered ${a} in selected scope.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"explore",e)}),u(r.command("inventory").argument("[name]",`${o[0].toUpperCase()}${o.slice(1)} name or directory to inspect`).description(`Read configured ${o} install and enablement state without activating extension code.`),e).action(async(s,n,l)=>{let p=y(l),g=l.optsWithGlobals();if(g.global===!0&&(g.project===!0||g.local===!0))throw new m("--global and --project/--local are mutually exclusive.",d.USAGE);let w=await W({pmRoot:I(process.cwd(),p.path),scope:g.global===!0?"global":"project",name:s});b(w,p),w.complete||(process.exitCode=d.GENERIC_FAILURE)}),u(r.command("manage").option("--runtime-probe","Opt-in runtime activation probe for manage output parity").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).description(`List managed ${a} with update-check metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"manage",e)}),u(r.command("describe").argument("[target]",`${o[0].toUpperCase()}${o.slice(1)} name to describe (omit for every loaded ${o})`).option("--markdown","Render the surface map as a Markdown reference document instead of toon/json").option("--output <path>","Write Markdown output to a file (requires --markdown)").description(`Map every surface a loaded ${o} registers (commands, hooks, item types, providers, overrides, ...).`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"describe",e)}),u(r.command("reload").option("--watch","Use watch mode for repeated reload checks").description(`Reload ${a} with cache-busted module imports.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"reload",e)}),u(r.command("doctor").option("--detail <mode>",`Detail mode for ${o} diagnostics (summary|deep)`).option("--trace","Include actionable registration traces in doctor deep diagnostics").option("--fix-managed-state",`Adopt unmanaged ${a} before diagnostics/update checks`).option("--isolated",`Run doctor against project-scope ${a} only, ignoring global registrations`).option("--ignore-global","Alias for --isolated").option("--strict-exit","Return non-zero exit when doctor warnings are present (ok=false)").option("--fail-on-warn","Alias for --strict-exit (doctor)").description(`Run consolidated ${o} diagnostics (summary/deep modes).`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"doctor",e)}),u(r.command("catalog").alias("list").option("--fields <value>","Render compact comma-separated catalog fields, for example: alias,installed,install_command").description(`List bundled first-party ${o} catalog metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"catalog",e)}),u(r.command("adopt").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).option("--gh <owner/repo[/path]>",`GitHub provenance shorthand for adopted ${o}`).option("--github <owner/repo[/path]>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub shorthand source").description(`Adopt an existing unmanaged ${o} into managed metadata.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"adopt",e)}),u(r.command("adopt-all").description(`Adopt all unmanaged ${a} into managed metadata.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"adopt-all",e)}),u(r.command("migrate").option("--dry-run","Plan active migrations without invoking extension code").description(`Plan or apply active ${o} migrations with durable receipts.`),e).action(async(s,n)=>{await f(void 0,n.optsWithGlobals(),n,"migrate",e)}),u(r.command("activate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Activate a ${o} in selected scope settings.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"activate",e)}),u(r.command("deactivate").argument("<target>",`${o[0].toUpperCase()}${o.slice(1)} name`).description(`Deactivate a ${o} in selected scope settings.`),e).action(async(s,n,l)=>{await f(s,l.optsWithGlobals(),l,"deactivate",e)}),e==="package"&&q(_(r.command("upgrade").argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(s,n,l)=>{await K(s,l,!1)})}async function nt(t,e,o){let a=y(o),i=Date.now(),r=await j(t,a,{idPrefix:typeof e.idPrefix=="string"?e.idPrefix:void 0,preset:typeof e.preset=="string"?e.preset:void 0,defaults:e.defaults===!0||e.yes===!0,author:typeof e.author=="string"?e.author:void 0,agentGuidance:typeof e.agentGuidance=="string"?e.agentGuidance:void 0,typePreset:typeof e.typePreset=="string"?e.typePreset:void 0,withPackages:e.withPackages===!0,mergeFence:e.mergeFence!==!1,force:e.force===!0,workspace:typeof e.workspace=="string"?e.workspace:void 0}),s=e.verbose===!0||a.json===!0;b(s?r:L(r,!0),a),a.profile&&h(`profile:command=init took_ms=${Date.now()-i}`)}function rt(t,e,o,a){let r=t!==void 0&&new Set(["get","set","list","export"]).has(t);return{resolvedScope:r?"project":t??"project",resolvedAction:r?t:e??"list",resolvedKey:r?e:o,resolvedValue:r?o:a}}function st(t){return{criterion:Array.isArray(t.criterion)?t.criterion:[],format:typeof t.format=="string"?t.format:void 0,policy:typeof t.policy=="string"?t.policy:void 0,value:typeof t.value=="string"?t.value:void 0,clearCriteria:t.clearCriteria===!0,defaultDepth:typeof t.defaultDepth=="string"?t.defaultDepth:void 0,activityLimit:typeof t.activityLimit=="string"?t.activityLimit:void 0,staleThresholdDays:typeof t.staleThresholdDays=="string"?t.staleThresholdDays:void 0,sectionHierarchy:typeof t.sectionHierarchy=="string"?t.sectionHierarchy:void 0,sectionActivity:typeof t.sectionActivity=="string"?t.sectionActivity:void 0,sectionProgress:typeof t.sectionProgress=="string"?t.sectionProgress:void 0,sectionBlockers:typeof t.sectionBlockers=="string"?t.sectionBlockers:void 0,sectionFiles:typeof t.sectionFiles=="string"?t.sectionFiles:void 0,sectionWorkload:typeof t.sectionWorkload=="string"?t.sectionWorkload:void 0,sectionStaleness:typeof t.sectionStaleness=="string"?t.sectionStaleness:void 0,sectionTests:typeof t.sectionTests=="string"?t.sectionTests:void 0}}async function lt(t,e,o,a,i,r){let c=y(r),s=Date.now(),{resolvedScope:n,resolvedAction:l,resolvedKey:p,resolvedValue:g}=rt(t,e,o,a),w=await T(n,l,p,st(i),c,typeof g=="string"?g:void 0);b(w,c),c.profile&&h(`profile:command=config took_ms=${Date.now()-s}`)}var Ut={normalizeExtensionOptions:G};function Ot(t){t.command("init").argument("[prefix-or-path]","Optional id prefix, or path-like tracker target such as ./pm-sandbox").option("--prefix, --id-prefix <value>","Set the item ID prefix (alias for the positional prefix)").option("--preset <value>","Governance preset for new setups: minimal|default|strict").option("--defaults","Use non-interactive setup defaults without opening the wizard").option("-y, --yes","Alias for --defaults (non-interactive setup)").option("--author <value>","Set the default mutation author for this project").option("--agent-guidance <mode>","Agent guidance mode: ask|add|skip|status").option("--type-preset <name>","Register domain item types during init: agile|ops|research").option("--with-packages","Install all bundled first-party packages during initialization").option("--no-merge-fence","Skip automatic merge-driver installation for a fresh Git-backed tracker").option("--workspace <dir>","Initialize repository-local tracker storage at <dir>/.agents/pm").option("--force","Allow initializing tracker files directly in a directory that looks like a workspace root").option("--verbose","Include the full resolved settings tree in the output (default output is a concise summary)").description("Initialize pm storage and defaults for the current workspace or a path-like tracker target.").action(async(e,o,a)=>{await nt(e,o,a)}),t.command("config").argument("[scope]","Config scope: project|global, or action shorthand list|export|get|set for project scope").argument("[action]","Config action: get|set|list|export").argument("[key]","Config key for get|set; use `pm config project list` for the complete typed inventory, including mutation-guard-* policies").argument("[value]",'Optional value for set: routed to the right typed flag by key (e.g. config set telemetry-tracking off, config set item-format toon, config set definition-of-done "Tests pass"). Equivalent to --policy/--format/--criterion. context keys still require --default-depth/--section-* flags.').option("--criterion <text>","Criteria value for definition-of-done, metadata-required-fields, or lifecycle pattern keys (repeatable for set)",x).option("--clear-criteria","Clear criteria-list keys for config set operations").option("--format <value>","Item format for item-format key: toon").option("--policy <value>","Policy key values: history-missing-stream-policy=auto_create|strict_error; sprint-release-format-policy=warn|strict_error; parent-reference-policy=warn|strict_error; governance-preset=minimal|default|strict|custom; governance-ownership-enforcement=none|warn|strict; governance-create-mode-default=progressive|strict; governance-close-validation-default=off|warn|strict; governance-require-close-reason=enabled|disabled; governance-parent-reference-policy=warn|strict_error; governance-metadata-validation-profile=core|strict|custom; governance-force-required-for-stale-lock=enabled|disabled; governance-duplicate-detection-mode=off|advisory|strict; test-result-tracking=enabled|disabled; untrusted-linked-test-execution=enabled|disabled; telemetry-tracking=enabled|disabled").option("--value <value>","Typed nested setting value. Mutation guards: require-attributed-author=true|false, secret-guard=off|advise|block, stale-in-progress-hours=integer>=1. Kebab-case is preferred; underscore aliases remain accepted.").option("--default-depth <value>","Context default depth: brief|standard|deep").option("--activity-limit <n>","Context default activity limit").option("--stale-threshold-days <n>","Context staleness cutoff in days").option("--section-hierarchy <value>","Enable/disable context hierarchy section (true|false)").option("--section-activity <value>","Enable/disable context activity section (true|false)").option("--section-progress <value>","Enable/disable context progress section (true|false)").option("--section-blockers <value>","Enable/disable context blockers section (true|false)").option("--section-files <value>","Enable/disable context files section (true|false)").option("--section-workload <value>","Enable/disable context workload section (true|false)").option("--section-staleness <value>","Enable/disable context staleness section (true|false)").option("--section-tests <value>","Enable/disable context tests section (true|false)").description("Read or update pm settings for the current workspace or global profile.").action(async(e,o,a,i,r,c)=>{await lt(e,o,a,i,r,c)}),H(t,"extension"),H(t,"package"),_(t.command("install",{hidden:!0}).option("--dry-run","Resolve sources and estimate copying without destination writes or activation").argument("[targets...]","Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)").option("--gh <github-source>","Install from GitHub shorthand source (owner/repo[/path])").option("--github <github-source>","Alias for --gh").option("--ref <ref>","Git ref/branch/tag for GitHub install sources").description("Install a pm package into the project package scope by default.")).action(async(e,o,a)=>{await E("install",a),await N(e,a.optsWithGlobals(),a,"package")}),q(_(t.command("upgrade",{hidden:!0}).argument("[target]","Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages").description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async(e,o,a)=>{await K(e,a,!0)})}export{Ut as _testOnlyRegisterSetup,Ot as registerSetupCommands};
|
|
2
|
+
//# sourceMappingURL=register-setup-HM3OCBH2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{P as i}from"./chunk-KG3H4UZZ.js";(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]="261c726f-338d-5618-8f6b-051b41a38c99")}catch{}})();var u=["id","title","status","type","priority","parent","updated_at"],E=["id","status","type","title"],p={list:"brief","list-all":"full","list-draft":"full","list-open":"brief","list-in-progress":"brief","list-blocked":"brief","list-closed":"brief","list-canceled":"full"},o=["tree_depth","tree_parent","tree_children","tree_title"];function f(e=[]){return[...new Set([...i,"body",...o,...e])].flatMap(t=>[t,`item.${t}`]).sort()}var m=["brief","standard","deep"],r=["body","linked","claim_state","children","schedule"],l=["linked.files","linked.tests","linked.docs"],c=["claim_state.claimed","claim_state.assignee","claim_state.last_claim","claim_state.last_release"],a=["schedule.deadline","schedule.start_at","schedule.end_at","schedule.location","schedule.reminders","schedule.events"];function T(e=[]){return[...[...new Set([...i,...e,"notes_count","tests_count","collection_counts"])].flatMap(s=>[s,`item.${s}`]),...r,...l,...c,...a].sort()}var I=["id","title","status","type","priority","updated_at","score","matched_fields"],d=["score","matched_fields","highlights"],n=["id","title","description","type","status","priority","tags","created_at","updated_at","deadline","assignee","author","estimated_minutes","acceptance_criteria","dependencies","comments","notes","learnings","reminders","events","files","tests","docs","close_reason","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result","affected_version","fixed_version","component","regression","customer_impact","definition_of_ready","order","rank","goal","objective","value","impact","outcome","why_now","plan"];function S(e=[]){let t=[...new Set(e)];return[...d,...n,...n.map(s=>`item.${s}`),...t,...t.map(s=>`item.${s}`)].sort()}export{u as a,E as b,p as c,f as d,m as e,T as f,I as g,S as h};
|
|
2
|
+
//# sourceMappingURL=chunk-2JFYR56O.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as D,s as q}from"./chunk-
|
|
1
|
+
import{r as D,s as q}from"./chunk-MHQ2XICU.js";import{Yb as N,cc as z,ec as _}from"./chunk-ZLEN4HZD.js";import{dd as C,de as x,gd as L,jd as j,ka as k,pa as m,rb as O,ua as b,xa as S}from"./chunk-KG3H4UZZ.js";import{constants as p}from"node:fs";import{lstat as M,mkdir as $,open as F}from"node:fs/promises";import h 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]="e57a9bca-1190-5ffd-bb7d-d76a22fc9e57")}catch{}})();function E(n,e){if(typeof n!="string"||n.trim().length===0)throw new TypeError(`Relationship event ${e} must be non-empty`);return n.trim()}function I(n,e){let t=e.require(n.kind),i=t.direction==="undirected"?[n.source,n.target].sort().join("\0"):`${n.source}\0${n.target}`;return`${t.kind}\0${i}`}function H(n){return Object.freeze({...n,...n.payload===void 0?{}:{payload:Object.freeze(structuredClone(n.payload))}})}function J(n,e,t,i){let r=t.require(n.kind),o=i.outgoingOne.get(`${r.kind}\0${n.source}`);if(o!==void 0&&o!==e)throw new TypeError(`Relationship outgoing cardinality exceeded for ${r.kind}`);let s=i.incomingOne.get(`${r.kind}\0${n.target}`);if(s!==void 0&&s!==e)throw new TypeError(`Relationship incoming cardinality exceeded for ${r.kind}`);let c=I(n,t),d=i.identities.get(c);if(d!==void 0&&d!==e)throw new TypeError(`Relationship edge already active: ${c}`)}function K(n){let e=new Map;for(let t of n)t.action==="remove"?e.delete(t.relationshipId):e.set(t.relationshipId,t.edge);return e}function G(n,e,t){if(n.expectedVersion!==void 0&&n.expectedVersion!==e)throw new TypeError(`Relationship event version conflict: expected ${n.expectedVersion}, current ${e}`);let i=E(n.eventId,"eventId");if(t.has(i))throw new TypeError(`Relationship event already exists: ${i}`);if(n.action!=="add"&&n.action!=="remove"&&n.action!=="supersede")throw new TypeError(`Unknown relationship event action: ${n.action}`);if(!Number.isFinite(Date.parse(n.timestamp)))throw new TypeError("Relationship event timestamp must be valid");return{eventId:i,relationshipId:E(n.relationshipId,"relationshipId"),author:E(n.author,"author"),timestamp:new Date(n.timestamp).toISOString()}}function Q(n,e,t,i,r,o){let s=t.has(e);if(n.action==="add"&&s)throw new TypeError(`Relationship is already active: ${e}`);if(n.action!=="add"&&!s)throw new TypeError(`Relationship is not active: ${e}`);if(n.action==="remove")return;if(!n.edge)throw new TypeError(`Relationship ${n.action} event requires an edge`);let c=typeof n.edge.source=="string"?n.edge.source.trim():"",d=typeof n.edge.target=="string"?n.edge.target.trim():"";if(!i.has(c)||!i.has(d))throw new TypeError(`Relationship endpoint not found: ${c} -> ${d}`);let a=new m([c,d],[n.edge],r).edges()[0];return J(a,e,r,o),H(a)}var T=class{#t;#i;#n=[];#o=new Set;#e=new Map;#r={identities:new Map,outgoingOne:new Map,incomingOne:new Map};constructor(e,t={}){this.#t=new Set([...e].filter(i=>typeof i=="string").map(i=>i.trim()).filter(Boolean)),this.#i=t.registry??k()}get version(){return this.#n.length}events(){return Object.freeze([...this.#n])}*stream(e={}){let t=e.fromVersion??1,i=e.toVersion??this.version,r=e.batchSize??100;if(!Number.isInteger(t)||t<1)throw new TypeError("Relationship event stream fromVersion must be positive");if(!Number.isInteger(i)||i<0||i>this.version)throw new TypeError(`Relationship event stream toVersion out of range: ${i}`);if(!Number.isInteger(r)||r<1)throw new TypeError("Relationship event stream batchSize must be positive");if(t>i+1)throw new TypeError("Relationship event stream fromVersion exceeds the selected prefix");for(let o=t-1;o<i;o+=r)yield Object.freeze(this.#n.slice(o,Math.min(o+r,i)))}project(e,t,i={}){if(typeof t!="function")throw new TypeError("Relationship event projection requires a reducer");let r=e,o=0,s;for(let c of this.stream({...i,batchSize:256}))for(let d of c)r=t(r,d),o+=1,s=d;return Object.freeze({state:r,version:s?.sequence??Math.max(0,(i.fromVersion??1)-1),processed:o,...s===void 0?{}:{asOf:s.timestamp}})}#s(e,t){let i=this.#i.require(t.kind);this.#r.identities.set(I(t,this.#i),e),i.outgoing==="one"&&this.#r.outgoingOne.set(`${i.kind}\0${t.source}`,e),i.incoming==="one"&&this.#r.incomingOne.set(`${i.kind}\0${t.target}`,e)}#a(e){let t=this.#i.require(e.kind);this.#r.identities.delete(I(e,this.#i)),t.outgoing==="one"&&this.#r.outgoingOne.delete(`${t.kind}\0${e.source}`),t.incoming==="one"&&this.#r.incomingOne.delete(`${t.kind}\0${e.target}`)}append(e){let t=G(e,this.version,this.#o),i=this.#e.get(t.relationshipId),r=Q(e,t.relationshipId,this.#e,this.#t,this.#i,this.#r),o=Object.freeze({eventId:t.eventId,relationshipId:t.relationshipId,action:e.action,...r===void 0?{}:{edge:r},author:t.author,timestamp:t.timestamp,...e.reason?.trim()?{reason:e.reason.trim()}:{},sequence:this.version+1});return this.#n.push(o),this.#o.add(t.eventId),i&&this.#a(i),e.action==="remove"?this.#e.delete(t.relationshipId):(this.#e.set(t.relationshipId,r),this.#s(t.relationshipId,r)),o}snapshot(e={}){if(e.atVersion!==void 0&&e.atTimestamp!==void 0)throw new TypeError("Relationship snapshot accepts one target");let t;if(e.atTimestamp!==void 0){let o=Date.parse(e.atTimestamp);if(!Number.isFinite(o))throw new TypeError("Relationship snapshot timestamp must be valid");t=this.#n.filter(s=>Date.parse(s.timestamp)<=o)}else{let o=e.atVersion??this.version;if(!Number.isInteger(o)||o<0||o>this.version)throw new TypeError(`Relationship snapshot version out of range: ${o}`);t=this.#n.slice(0,o)}let i=K(t),r=new m(this.#t,i.values(),this.#i);return Object.freeze({version:t.at(-1)?.sequence??0,...t.at(-1)?{asOf:t.at(-1).timestamp}:{},edges:r.edges(),graph:r})}page(e){if(!Number.isInteger(e.limit)||e.limit<1)throw new TypeError("Relationship event page limit must be positive");let t=C("relationship-events",{order:"append-sequence"}),i=e.cursor===void 0?this.version:Number(L(e.cursor,t).snapshot);if(!Number.isSafeInteger(i)||i<0||i>this.version)throw new TypeError("Relationship event cursor snapshot version is invalid");let r=j(this.#n.slice(0,i),{cursor:e.cursor,fingerprint:t,limit:e.limit,readId:o=>o.eventId,snapshot:String(i)});return{version:i,events:r.rows,hasMore:r.has_more,...r.next_cursor?{nextCursor:r.next_cursor}:{}}}},Y="relationship-event-store",A=p.O_NOFOLLOW;function g(n){return x(n,Y,30,`relationship-store:${process.pid}`,!1,!1,3e3)}async function f(n,e="relationships/events.jsonl"){let t=h.resolve(n),i=h.resolve(t,e),r=h.relative(t,i);if(r.length===0)throw new TypeError("Relationship event path must name a file within the tracker root");if(r===".."||r.startsWith(`..${h.sep}`)||h.isAbsolute(r))throw new TypeError("Relationship event path must stay within the tracker root");if(await $(t,{recursive:!0}),(await M(t)).isSymbolicLink())throw new TypeError("Relationship event tracker root must not be a symbolic link");let s=t;for(let c of r.split(h.sep)){s=h.join(s,c);try{if((await M(s)).isSymbolicLink())throw new TypeError("Relationship event path must not contain symbolic links")}catch(d){if(b(d))break;throw d}}return i}async function w(n,e,t){let i=new T(e,{registry:t}),r,o;try{o=await F(n,p.O_RDONLY|A),r=await o.readFile("utf8")}catch(c){if(b(c))return{log:i,raw:""};throw c}finally{await o?.close()}let s=r.split(`
|
|
2
2
|
`);for(let c=0;c<s.length;c+=1){let d=s[c].trim();if(!d)continue;let a;try{a=JSON.parse(d)}catch{throw new TypeError(`Invalid relationship event JSONL at line ${c+1}`)}if(a.sequence!==i.version+1)throw new TypeError(`Invalid relationship event sequence at line ${c+1}`);i.append({eventId:a.eventId,relationshipId:a.relationshipId,action:a.action,...a.edge===void 0?{}:{edge:a.edge},author:a.author,timestamp:a.timestamp,...a.reason===void 0?{}:{reason:a.reason},expectedVersion:i.version})}return{log:i,raw:r}}function U(n,e,t,i){let r=Date.parse(e.timestamp),o;return e.action!=="remove"&&e.edge!==void 0&&(o=new m(t,[e.edge],i).edges()[0]),n.eventId===e.eventId.trim()&&n.relationshipId===e.relationshipId.trim()&&n.action===e.action&&n.author===e.author.trim()&&Number.isFinite(r)&&n.timestamp===new Date(r).toISOString()&&n.reason===(e.reason?.trim()||void 0)&&O(n.edge)===O(o)}var V=class n{#t;#i;#n;#o;#e;constructor(e,t,i,r){this.#t=e.pmRoot,this.#i=t,this.#n=e.registry,this.#o=i,this.#e=r}static async open(e){let t=Object.freeze([...e.nodes]),i=await f(e.pmRoot,e.relativePath),r=await g(e.pmRoot);try{await f(e.pmRoot,i);let{log:o}=await w(i,t,e.registry);return new n(e,t,i,o)}finally{await r()}}get path(){return this.#o}async currentVersion(){return this.#e=await this.#r(),this.#e.version}async append(e){let t=await g(this.#t);try{let i=await f(this.#t,this.#o),{log:r}=await w(i,this.#i,this.#n),o=r.append(e);await $(h.dirname(i),{recursive:!0}),await f(this.#t,i);let s=await F(i,p.O_APPEND|p.O_CREAT|p.O_WRONLY|A);try{await s.appendFile(`${JSON.stringify(o)}
|
|
3
3
|
`,"utf8")}finally{await s.close()}return this.#e=r,o}finally{await t()}}async appendBatch(e,t={}){let i=await g(this.#t);try{let r=await f(this.#t,this.#o),{log:o,raw:s}=await w(r,this.#i,this.#n),c=o.version,d=new Map(o.events().map(l=>[l.eventId,l])),a=[],R=[];for(let l of e){let u=l.eventId.trim(),v=d.get(u);if(v!==void 0){if(t.existingEventPolicy==="skip_identical"&&U(v,l,this.#i,this.#n)){R.push(v.eventId);continue}if(t.existingEventPolicy==="skip_identical")throw new TypeError(`Relationship event id collision with different content: ${u}`)}let y=o.append(l);d.set(y.eventId,y),a.push(y)}if(a.length>0){let l=s.length===0||s.endsWith(`
|
|
4
4
|
`)?s:`${s}
|
|
5
5
|
`;await $(h.dirname(r),{recursive:!0}),await f(this.#t,r),await S(r,`${l}${a.map(u=>JSON.stringify(u)).join(`
|
|
6
6
|
`)}
|
|
7
7
|
`)}return this.#e=o,Object.freeze({version_before:c,version_after:o.version,appended:Object.freeze(a),skipped_event_ids:Object.freeze(R)})}finally{await i()}}async snapshot(e={}){return this.#e=await this.#r(),this.#e.snapshot(e)}async page(e){return this.#e=await this.#r(),this.#e.page(e)}async*stream(e={}){this.#e=await this.#r(),yield*this.#e.stream(e)}async project(e,t,i={}){return this.#e=await this.#r(),this.#e.project(e,t,i)}async#r(){let e=await g(this.#t);try{let t=await f(this.#t,this.#o);return(await w(t,this.#i,this.#n)).log}finally{await e()}}};(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]="874a21db-ed3b-5b4f-a913-bf87103172e7")}catch{}})();function P(n){return[...n].sort().join("\0")}function X(n,e,t){let i=n.successors.get(e);i?i.push(t):n.successors.set(e,[t]);let r=n.predecessors.get(t);r?r.push(e):n.predecessors.set(t,[e])}function W(n,e,t,i,r){let o=e.resolve(r);if(o?.ordering!==!0)return;let s=z(i),c=s===void 0?void 0:n.canonicalIds.get(s.toLowerCase());if(c===void 0)return;let d=(o.precedence??"source_before_target")==="source_before_target";X(n,d?t:c,d?c:t)}function Z(n,e){let t={successors:new Map,predecessors:new Map,canonicalIds:new Map},i=n.filter(r=>typeof r?.id=="string"&&r.id.trim().length>0);for(let r of i){let o=r.id.trim();t.canonicalIds.set(o.toLowerCase(),o)}for(let r of i){let o=r.id.trim();W(t,e,o,r.blocked_by,"blocked_by");for(let s of r.dependencies??[])typeof s!="object"||s===null||W(t,e,o,s.id,typeof s.kind=="string"?s.kind:"related")}for(let r of[t.successors,t.predecessors])for(let o of r.values())o.sort();return t}function ee(n,e){let t=new Set([e]),i=[e];for(;i.length>0;){let r=i.pop();for(let o of[n.successors,n.predecessors])for(let s of o.get(r)??[])t.has(s)||(t.add(s),i.push(s))}return t}function te(n,e){let t=new Map;for(let i of e){let r=(n.successors.get(i)??[]).filter(o=>e.has(o));r.length>0&&t.set(i,r)}return t}function B(n,e,t){let i=Z(n,e),r=i.canonicalIds.get(t.trim().toLowerCase());if(r===void 0)return{cycles:[],successors:new Map,canonical:t};let o=te(i,ee(i,r));return{cycles:D(o).filter(s=>s.includes(r)),successors:o,canonical:r}}function ie(n,e,t){let i=new Set(e),r=i.has(t)?t:e[0];if(n.get(r)?.includes(r))return[r,r];for(let o of n.get(r)??[]){if(!i.has(o))continue;let s=ne(n,i,r,o);if(s)return s}return[...e,e[0]]}function ne(n,e,t,i){let r=[[i]],o=new Set([t,i]);for(;r.length>0;){let s=r.shift(),c=s.at(-1);for(let d of n.get(c)??[]){if(d===t)return[t,...s,t];!e.has(d)||o.has(d)||(o.add(d),r.push([...s,d]))}}}function me(n,e,t){let i=N(),r=B(n,i,t),o=B(e,i,t),s=new Set(r.cycles.map(P)),c=new Set(_(n,void 0,i).map(a=>`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`));return[..._(e,void 0,i).filter(a=>a.holder_id.toLowerCase()===t.trim().toLowerCase()&&!c.has(`${a.holder_id.toLowerCase()}\0${a.target_id.toLowerCase()}\0${a.dependency_kind}`)).map(a=>`ordering_storage_contradiction_created:${q(a)}:remove_contradicting_dependency_row:run_pm_graph_audit`),...o.cycles.filter(a=>!s.has(P(a))).map(a=>`ordering_cycle_created:${ie(o.successors,a,o.canonical).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`)]}export{T as a,V as b,me as c};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-32EVUSS4.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as w,i as y,j,k as B,l as U,o as f,p as X,q as W,r as Y}from"./chunk-
|
|
1
|
+
import{f as w,i as y,j,k as B,l as U,o as f,p as X,q as W,r as Y}from"./chunk-IJUWEEEB.js";import{M as H,a as $,b as D}from"./chunk-7O4NUJVO.js";import{c as p,f as M,g as z,i as q}from"./chunk-JMJK2L4Z.js";import{Va as F,q as L,t as R}from"./chunk-JCVMOSWQ.js";import{e as g,h as K}from"./chunk-6XBRADQQ.js";import{Ha as k,a as N,e as O,f as A,g as x,h as C,o as P}from"./chunk-KG3H4UZZ.js";(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]="cde4f476-6821-53be-b70e-62794fa2ae52")}catch{}})();var Ce=N,Pe=O,$e=C,De=A,Le=x;function G(e,t,n,r){let s=e.flag.slice(2).replace(/[-_]([a-z])/gu,(i,a)=>a.toUpperCase()),o=n.has(s);return{long:t,...r?{short:r}:{},description:e.description??`Standard pm ${e.flag} option.`,...e.required===!0?{required:!0}:{},...e.list===!0?{list:!0}:{},...e.repeatable===!0?{repeatable:!0}:{},value_type:o?"string":"boolean",...o?{value_name:e.value_name??"value"}:{}}}function Q(e,t=[]){let n=new Set(t.flatMap(s=>s.keys)),r=[];for(let s of L(e.map(o=>({...o})))){r.push(G(s,s.flag,n,s.short));for(let o of s.aliases??[])r.push(G(s,o,n))}return r}var Re=Q(R,$),Fe=Q(F,D);(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]="ddcc068c-6727-5508-baa3-e089bcd0a0a9")}catch{}})();var _=["agile","ops","research"],I={agile:{name:"agile",title:"Agile delivery",summary:"Story/Spike delivery with a review stage, story points, and acceptance ownership.",types:w.agile,statuses:[{id:"review",roles:["active"],aliases:["in-review"],description:"Work is implementation-complete and awaiting peer review."}],fields:[{key:"story_points",type:"number",commands:["create","update","list"],description:"Relative estimation size for a story or spike.",aliases:["points"]},{key:"acceptance_owner",type:"string",commands:["create","update","list"],description:"Stakeholder accountable for accepting the delivered story.",aliases:["acceptor"]}],workflows:[{type:"Story",allowed_transitions:[["open","in_progress"],["in_progress","review"],["review","in_progress"],["review","closed"],["in_progress","blocked"],["blocked","in_progress"]]}],config:[{key:"search_provider",value:"bm25",summary:"Offline BM25 lexical search works without an embedding service."},{key:"search_max_results",value:"20",summary:"Sprint-sized result cap for quick triage."}],templates:[{name:"story",options:{type:"Story",priority:"2",tags:"story",acceptanceCriteria:"Story delivers the stated user outcome with tests and docs updated.",body:`## As a
|
|
2
2
|
|
|
3
3
|
## I want
|
|
4
4
|
|
|
@@ -23,4 +23,4 @@ import{f as w,i as y,j,k as B,l as U,o as f,p as X,q as W,r as Y}from"./chunk-4F
|
|
|
23
23
|
|
|
24
24
|
## Conclusion
|
|
25
25
|
`}}],packages:[{spec:"search-advanced",reason:"Semantic retrieval over experiments and findings."},{spec:"templates",reason:"Consistent experiment and hypothesis scaffolds."},{spec:"beads",reason:"Import structured prior work into the tracker."}]}};function ne(e){if(e===void 0)return;let t=u(e);if(t.length===0)throw new Error("Profile name must not be empty.");if(_.includes(t))return t;throw new Error(`Invalid profile "${e}". Allowed: ${_.join(", ")}.`)}function qe(e){let t=ne(e);if(t===void 0)throw new Error(`Profile name is required. Allowed: ${_.join(", ")}.`);return I[t]}function je(){return _.map(e=>I[e])}function u(e){return e.trim().toLowerCase().replaceAll("-","_")}function J(e){return e.map(t=>t.definition.name).join(", ")}function re(e=[]){let t=_.map(o=>({definition:I[o],source:"builtin"})),n=new Set(_.map(o=>u(o))),r=new Set(n),s=[];for(let o of e){let i=u(o.profile.name);if(n.has(i)){s.push(`Extension "${o.name}" profile "${o.profile.name}" uses a name reserved by a built-in archetype and was ignored.`);continue}if(r.has(i)){s.push(`Profile "${o.profile.name}" from extension "${o.name}" duplicates an already-registered profile and was ignored.`);continue}r.add(i),t.push({definition:o.profile,source:"extension",package:o.name})}return{profiles:t,warnings:s}}function Be(e,t=[]){let{profiles:n,warnings:r}=re(t);if(typeof e!="string"||e.trim().length===0)throw new Error(`Profile name is required. Allowed: ${J(n)}.`);let s=u(e),o=n.find(i=>u(i.definition.name)===s);if(o===void 0)throw new Error(`Invalid profile "${e}". Allowed: ${J(n)}.`);return{resolved:o,warnings:r}}(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]="ab26bcb3-fb2a-5f2f-96e7-7965787b924e")}catch{}})();function se(e){return{types:e.types.length,statuses:e.statuses.length,fields:e.fields.length,workflows:e.workflows.length,config:e.config.length,templates:e.templates.length,packages:e.packages.length}}function Ye(e){return{name:e.name,title:e.title,summary:e.summary,composition:se(e),types:e.types.map(t=>S(()=>p(t).name,()=>String(t.name??""))),statuses:e.statuses.map(t=>S(()=>f(t).id,()=>String(t.id??""))),fields:e.fields.map(t=>S(()=>y(t).key,()=>String(t.key??""))),workflows:e.workflows.map(t=>t.type),config:e.config.map(t=>`${t.key}=${t.value}`),templates:e.templates.map(t=>t.name),packages:e.packages.map(t=>({spec:t.spec,reason:t.reason}))}}function S(e,t){try{return e()}catch{return 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]="2d4017d7-771b-53a1-ae56-71df7e1a0ac4")}catch{}})();var oe=[{key:"search_provider",path:"search.provider",kind:"string",summary:"Search embedding provider name (e.g. openai, ollama, or an extension provider)."},{key:"search_default_mode",path:"search.default_mode",kind:"string",choices:["auto","keyword","semantic","hybrid"],summary:"Mode a bare pm search runs in: auto (hybrid when semantic search is explicitly configured and runnable, else keyword), or a pinned keyword, semantic, or hybrid."},{key:"search_mutation_refresh_policy",path:"search.mutation_refresh_policy",kind:"string",choices:["cache_only","semantic_configured","semantic_auto"],summary:"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto."},{key:"search_query_expansion_enabled",path:"search.query_expansion.enabled",kind:"boolean",summary:"Enable or disable query expansion for semantic/hybrid search."},{key:"search_query_expansion_provider",path:"search.query_expansion.provider",kind:"string",summary:"Query expansion provider name (built-in openai/ollama or extension provider)."},{key:"search_rerank_enabled",path:"search.rerank.enabled",kind:"boolean",summary:"Enable or disable post-retrieval reranking for hybrid search."},{key:"search_rerank_model",path:"search.rerank.model",kind:"string",summary:"Rerank model name override used by built-in providers."},{key:"search_rerank_top_k",path:"search.rerank.top_k",kind:"integer",min:1,summary:"Number of top hybrid candidates to rerank when rerank is enabled."},{key:"search_embedding_model",path:"search.embedding_model",kind:"string",summary:"Default embedding model name (overrides provider-specific model when set)."},{key:"search_embedding_corpus_max_characters",path:"search.embedding_corpus_max_characters",kind:"integer",min:1,summary:"Maximum semantic corpus characters per item before truncation."},{key:"search_embedding_batch_size",path:"search.embedding_batch_size",kind:"integer",min:1,summary:"Number of items embedded per request batch."},{key:"search_embedding_timeout_ms",path:"search.embedding_timeout_ms",kind:"integer",min:1,summary:"Per-request embedding timeout in milliseconds."},{key:"search_score_threshold",path:"search.score_threshold",kind:"number",summary:"Minimum score for a hit to be returned (0 keeps all matches)."},{key:"search_hybrid_semantic_weight",path:"search.hybrid_semantic_weight",kind:"ratio",summary:"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword)."},{key:"search_max_results",path:"search.max_results",kind:"integer",min:1,summary:"Default upper bound on search hits when --limit is not supplied."},{key:"search_bm25_k1",path:"search.bm25.k1",kind:"number",min:0,summary:"Offline BM25 term-frequency saturation (k1); higher saturates repeated terms slower (default 1.2)."},{key:"search_bm25_b",path:"search.bm25.b",kind:"ratio",summary:"Offline BM25 document-length normalization (b) in [0, 1]; 0 disables, 1 fully normalizes (default 0.75)."},{key:"openai_base_url",path:"providers.openai.base_url",kind:"string",summary:"OpenAI-compatible API base URL (LM Studio/vLLM also use this)."},{key:"openai_api_key",path:"providers.openai.api_key",kind:"string",summary:"OpenAI-compatible API key."},{key:"openai_model",path:"providers.openai.model",kind:"string",summary:"OpenAI-compatible embedding model name."},{key:"ollama_base_url",path:"providers.ollama.base_url",kind:"string",summary:"Ollama API base URL (typically http://localhost:11434)."},{key:"ollama_model",path:"providers.ollama.model",kind:"string",summary:"Ollama embedding model name (e.g. nomic-embed-text)."},{key:"vector_store_adapter",path:"vector_store.adapter",kind:"string",summary:"Vector store adapter name (lancedb, qdrant, or an extension adapter)."},{key:"vector_store_collection_name",path:"vector_store.collection_name",kind:"string",non_empty:!0,summary:"Vector collection/table name shared by Qdrant and LanceDB adapters."},{key:"qdrant_url",path:"vector_store.qdrant.url",kind:"string",summary:"Qdrant HTTP API URL."},{key:"qdrant_api_key",path:"vector_store.qdrant.api_key",kind:"string",summary:"Qdrant API key (empty if running unauthenticated)."},{key:"lancedb_path",path:"vector_store.lancedb.path",kind:"string",summary:"LanceDB storage path (relative to pm root or absolute)."},{key:"id_prefix",path:"id_prefix",kind:"string",non_empty:!0,summary:'Prefix for generated item IDs (e.g. "pm" produces pm-xxxx).'},{key:"author_default",path:"author_default",kind:"string",non_empty:!0,summary:"Default author recorded on mutations when --author is not supplied."},{key:"agent_identity_probes_enabled",path:"agent_identity.probes_enabled",kind:"boolean",summary:"Allow privacy-bounded local harness provenance probes; no network or subprocess access is permitted."},{key:"mutation_guard_require_attributed_author",path:"mutation_guard.require_attributed_author",kind:"boolean",summary:"Reject mutations whose effective author resolves to unknown."},{key:"mutation_guard_secret_guard",path:"mutation_guard.secret_guard",kind:"string",choices:["off","advise","block"],summary:"Detect credential-shaped mutation content: off, advise, or block."},{key:"mutation_guard_stale_in_progress_hours",path:"mutation_guard.stale_in_progress_hours",kind:"integer",min:1,summary:"Age threshold for unclaimed in-progress work surfaced by health."},{key:"governance_duplicate_detection_mode",path:"governance.duplicate_detection_mode",kind:"string",choices:["off","advisory","strict"],summary:"Create/copy duplicate governance: off, advisory, or strict explicit-bypass enforcement."},{key:"governance_duplicate_detection_threshold",path:"governance.duplicate_detection_threshold",kind:"ratio",summary:"Minimum shared similarity score in [0, 1] for create/copy duplicate governance."},{key:"governance_duplicate_detection_limit",path:"governance.duplicate_detection_limit",kind:"integer",min:0,max:20,summary:"Maximum likely duplicates returned by create/copy governance (0-20)."},{key:"output_default_format",path:"output.default_format",kind:"string",choices:["toon","json"],summary:"Default output format for commands that support it: toon or json."},{key:"ux_deprecation_hints",path:"ux.deprecation_hints",kind:"boolean",summary:"Emit one stderr migration hint for deprecated command aliases."},{key:"locks_ttl_seconds",path:"locks.ttl_seconds",kind:"integer",min:1,summary:"Claim/lock time-to-live in seconds before a stale lock can be reclaimed."},{key:"locks_wait_ms",path:"locks.wait_ms",kind:"integer",min:0,summary:"Bounded jittered wait in milliseconds before a contended item mutation fails with lock_conflict; 0 fails fast. PM_LOCK_WAIT_MS overrides per invocation."},{key:"ids_token_length",path:"ids.token_length",kind:"integer",min:4,max:12,summary:"Random base36 token length for newly minted item ids (4-12, default 4). Raise it to shrink cross-branch id collision odds in concurrent multi-agent workflows (pm-pibw)."},{key:"checkpoints_retention_days",path:"checkpoints.retention_days",kind:"integer",min:1,summary:"Age in days above which pm gc --scope checkpoints prunes bulk-mutation rollback checkpoints."},{key:"schema_unknown_field_policy",path:"schema.unknown_field_policy",kind:"string",choices:["allow","warn","reject"],summary:"How item I/O handles metadata keys not in the field registry: allow, warn, or reject."},{key:"history_compact_policy_enabled",path:"history.compact_policy.enabled",kind:"boolean",summary:"Enable the history-compaction advisory: pm health warns on over-threshold streams."},{key:"history_compact_policy_max_entries",path:"history.compact_policy.max_entries",kind:"integer",min:1,summary:"Entry count above which a history stream is flagged (and the default pm history-compact --all-over threshold)."},{key:"history_compact_policy_trigger",path:"history.compact_policy.trigger",kind:"string",choices:["health_warn","auto"],summary:"History-compaction policy intent: health_warn (advisory only) or auto (scheduled sweeps expected)."}],ie=new Map(oe.flatMap(e=>[[e.key,e],[e.path.toLowerCase().replaceAll("-","_"),e]]));function b(e){if(typeof e!="string")return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length!==0)return ie.get(t)}function ae(e,t){let n=t.trim().toLowerCase();return n==="true"||n==="1"||n==="yes"||n==="on"?{ok:!0,parsed:{descriptor:e,value:!0}}:n==="false"||n==="0"||n==="no"||n==="off"?{ok:!0,parsed:{descriptor:e,value:!1}}:{ok:!1,error:{message:`Config set ${e.key} requires a boolean value (true|false), got "${t}"`}}}function le(e,t,n){return e.non_empty===!0&&n.length===0?{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}}:e.choices&&!e.choices.includes(n)?{ok:!1,error:{message:`Config set ${e.key} must be one of ${e.choices.join("|")}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function ce(e,t,n){if(n.length===0)return{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}};let r=Number(n);return Number.isFinite(r)?{ok:!0,value:r}:{ok:!1,error:{message:`Config set ${e.key} requires a finite number, got "${t}"`}}}function de(e,t,n){return!Number.isInteger(n)||n<0?{ok:!1,error:{message:`Config set ${e.key} requires a non-negative integer, got "${t}"`}}:e.min!==void 0&&n<e.min?{ok:!1,error:{message:`Config set ${e.key} requires an integer >= ${e.min}, got "${t}" (the runtime silently ignores 0 here and falls back to the default)`}}:e.max!==void 0&&n>e.max?{ok:!1,error:{message:`Config set ${e.key} requires an integer <= ${e.max}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function me(e,t,n){return n<0||n>1?{ok:!1,error:{message:`Config set ${e.key} requires a number in [0, 1], got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function ue(e,t,n){return e.min!==void 0&&n<e.min?{ok:!1,error:{message:`Config set ${e.key} requires a number >= ${e.min}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:n}}}function v(e,t){if(typeof t!="string")return{ok:!1,error:{message:`Config set ${e.key} requires a string value`}};let n=t.trim();if(e.kind==="boolean")return ae(e,t);if(e.kind==="string")return le(e,t,n);let r=ce(e,t,n);return r.ok?e.kind==="integer"?de(e,t,r.value):e.kind==="ratio"?me(e,t,r.value):ue(e,t,r.value):{ok:!1,error:r.error}}function V(e,t){let n=t.path.split("."),r=e;for(let s of n){if(typeof r!="object"||r===null)return null;let o=Object.getOwnPropertyDescriptor(r,s);if(!o||!Object.hasOwn(o,"value"))return null;r=o.value}return typeof r=="string"||typeof r=="number"||typeof r=="boolean"?r:null}function Ge(e,t,n){let r=t.path.split(".");if(r.some(a=>a.length===0||["__proto__","constructor","prototype"].includes(a)))throw new Error("Unsafe settings path");let s=e;for(let a=0;a<r.length-1;a+=1){let d=r[a],c=Object.getOwnPropertyDescriptor(s,d)?.value;if(typeof c!="object"||c===null||Array.isArray(c)){let l={};Object.defineProperty(s,d,{value:l,writable:!0,enumerable:!0,configurable:!0}),s=l}else s=c}let o=r[r.length-1];return Object.getOwnPropertyDescriptor(s,o)?.value===n?!1:(Object.defineProperty(s,o,{value:n,writable:!0,enumerable:!0,configurable:!0}),!0)}(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]="38902c61-3d4d-52ad-a95c-fbac9102a041")}catch{}})();var at=["profile","types","statuses","fields","workflows","config","templates","packages"],lt=["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"],pe=new Set(K.flatMap(e=>[g(e.id),...(e.aliases??[]).map(t=>g(t))]).filter(e=>e.length>0)),Z=new Set(P.map(e=>e.toLowerCase()));function ye(e,t){e.name.trim().length===0?t.push({severity:"error",code:"profile_name_empty",dimension:"profile",message:"Profile name must not be empty; profile resolution requires a non-blank name."}):e.name!==u(e.name)&&t.push({severity:"warning",code:"profile_name_not_normalized",dimension:"profile",target:e.name,message:`Profile name "${e.name}" is not in canonical form; resolution folds it to "${u(e.name)}" (lowercase, hyphens as underscores).`}),e.title.trim().length===0&&t.push({severity:"warning",code:"profile_title_empty",dimension:"profile",message:"Profile title is empty; list and show surfaces will render a blank title."}),e.summary.trim().length===0&&t.push({severity:"warning",code:"profile_summary_empty",dimension:"profile",message:"Profile summary is empty; list and show surfaces will render a blank archetype description."})}function fe(e,t){let n=new Set,r=new Set;for(let[s,o]of e.types.entries()){let i;try{i=p(o).name}catch(d){t.push({severity:"error",code:"type_invalid",dimension:"types",target:typeof o.name=="string"?o.name:`#${s}`,message:k(d)});continue}let a=i.toLowerCase();if(r.has(a)){t.push({severity:"error",code:"type_duplicate",dimension:"types",target:i,message:`Item type "${i}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}r.add(a),n.add(a)}return n}function he(e,t){let n=new Set,r=new Set;for(let[s,o]of e.statuses.entries()){let i;try{i=f(o)}catch(a){t.push({severity:"error",code:"status_invalid",dimension:"statuses",target:typeof o.id=="string"?o.id:`#${s}`,message:k(a)});continue}if(r.has(i.id)){t.push({severity:"error",code:"status_duplicate",dimension:"statuses",target:i.id,message:`Status "${i.id}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}r.add(i.id),n.add(i.id);for(let a of i.aliases??[])n.add(g(a))}return n}function ge(e,t){let n=new Set;for(let[r,s]of e.fields.entries()){let o;try{o=y(s).key}catch(a){t.push({severity:"error",code:"field_invalid",dimension:"fields",target:typeof s.key=="string"?s.key:`#${r}`,message:k(a)});continue}if(n.has(o)){t.push({severity:"error",code:"field_duplicate",dimension:"fields",target:o,message:`Field "${o}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}n.add(o);let i=H(o);i&&t.push({severity:"warning",code:"field_mcp_input_collision",dimension:"fields",target:o,message:`Field "${o}" collides with canonical MCP property "${i.property}" owned by ${i.owner}; callers must pass the custom value through ${i.nested_path}.`})}}function _e(e,t,n,r){let s=new Set;for(let[o,i]of e.workflows.entries()){let a=i.type.trim().toLowerCase();if(a.length===0){r.push({severity:"error",code:"workflow_type_empty",dimension:"workflows",target:`#${o}`,message:"Workflow has an empty type; the workflow resolver drops entries without a type."});continue}let d=s.has(a);s.add(a),d?r.push({severity:"warning",code:"workflow_duplicate_type",dimension:"workflows",target:i.type,message:`Workflow type "${i.type}" is declared more than once; the later transition set wins.`}):!Z.has(a)&&!t.has(a)&&r.push({severity:"warning",code:"workflow_type_unknown",dimension:"workflows",target:i.type,message:`Workflow governs type "${i.type}" which is neither a built-in type nor declared by this profile; it has no effect unless that type already exists.`});let c=new Set;for(let l of i.allowed_transitions){let m=g(l[0]),T=g(l[1]);if(m.length===0||T.length===0){r.push({severity:"error",code:"workflow_transition_malformed",dimension:"workflows",target:i.type,message:`Workflow "${i.type}" has a transition with an empty status; the workflow resolver silently drops it.`});continue}for(let h of[m,T])pe.has(h)||n.has(h)||c.has(h)||(c.add(h),r.push({severity:"warning",code:"workflow_status_unknown",dimension:"workflows",target:h,message:`Workflow "${i.type}" references status "${h}" which is neither a built-in status nor declared by this profile; transitions to or from it are unreachable.`}))}}}function ke(e,t){let n=new Set;for(let r of e.config){let s=b(r.key);if(s===void 0){t.push({severity:"error",code:"config_key_unknown",dimension:"config",target:r.key,message:`Config knob "${r.key}" is not a recognized setting; apply rejects it with a usage error.`});continue}n.has(s.key)?t.push({severity:"error",code:"config_duplicate",dimension:"config",target:s.key,message:`Config knob "${s.key}" is set more than once; the later value silently overwrites the earlier one.`}):n.add(s.key);let o=v(s,r.value);o.ok||t.push({severity:"error",code:"config_value_invalid",dimension:"config",target:r.key,message:o.error.message})}}function we(e,t,n){for(let r of e.templates){let s=r.options.type;if(typeof s!="string"||s.trim().length===0)continue;let o=s.trim().toLowerCase();!Z.has(o)&&!t.has(o)&&n.push({severity:"warning",code:"template_type_unknown",dimension:"templates",target:r.name,message:`Template "${r.name}" creates type "${s}" which is neither a built-in type nor declared by this profile.`})}}function be(e,t){for(let[n,r]of e.packages.entries())r.spec.trim().length===0&&t.push({severity:"warning",code:"package_spec_empty",dimension:"packages",target:`#${n}`,message:"Package recommendation has an empty spec; it cannot be surfaced as an install hint."})}function ct(e){let t=[];ye(e,t);let n=fe(e,t),r=he(e,t);ge(e,t),_e(e,n,r,t),ke(e,t),we(e,n,t),be(e,t);let s=t.filter(i=>i.severity==="error").length,o=t.length-s;return{profile:e.name,ok:s===0,findings:t,errorCount:s,warningCount:o}}(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]="9b9004b5-2446-539c-9adc-75aeaa3acbba")}catch{}})();function E(e,t,n,r,s){let o=e,i=[];for(let a of t){let d=r(o),c=s(o,a),l=r(c.file);o=c.file;let m=d===l?"unchanged":c.replaced?"update":"add";i.push({key:n(a),status:m})}return{file:o,changes:i,changed:i.some(a=>a.status!=="unchanged")}}function ee(e){return JSON.stringify(e.map(t=>t.join("\0")).sort())}function ve(e,t){let n=e.map(s=>({...s})),r=[];for(let s of t){let o=n.findIndex(a=>a.type===s.type),i={type:s.type,allowed_transitions:s.allowed_transitions};o<0?(n.push(i),r.push({type:s.type,status:"add"})):ee(n[o].allowed_transitions)===ee(s.allowed_transitions)?r.push({type:s.type,status:"unchanged"}):(n[o]=i,r.push({type:s.type,status:"update"}))}return{changes:r,result:n,changed:r.some(s=>s.status!=="unchanged")}}function Ie(e,t){let n=[];for(let r of e.config){let s=b(r.key);if(s===void 0)throw new Error(`Profile "${e.name}" references unknown config key "${r.key}".`);let o=v(s,r.value);if(!o.ok)throw new Error(`Profile "${e.name}" config ${r.key}: ${o.error.message}`);let i=V(t,s),a=i===null?"add":i===o.parsed.value?"unchanged":"update";n.push({key:s.key,path:s.path,value:o.parsed.value,status:a})}return{changes:n,changed:n.some(r=>r.status!=="unchanged")}}function te(e){let t=Object.entries(e).sort(([n],[r])=>n.localeCompare(r));return JSON.stringify(t)}function Se(e,t){let n=[];for(let r of e.templates){let s=t.get(r.name),o;s===void 0?o="add":te(s)===te(r.options)?o="unchanged":o="update",n.push({name:r.name,options:r.options,status:o})}return{changes:n,changed:n.some(r=>r.status!=="unchanged")}}function ft(e,t){let n=E(M(t.typesRaw),e.types,l=>p(l).name,q,(l,m)=>z(l,p(m))),r=E(X(t.statusesRaw),e.statuses,l=>f(l).id,W,(l,m)=>Y(l,f(m))),s=E(j(t.fieldsRaw),e.fields,l=>y(l).key,B,(l,m)=>U(l,y(m))),o=ve(t.workflows,e.workflows),i=Ie(e,t.settings),a=Se(e,t.templates),d=e.packages.map(l=>({spec:l.spec,reason:l.reason,status:t.installedPackages.has(l.spec)?"installed":"recommended"})),c=n.changed||r.changed||s.changed||o.changed||i.changed||a.changed;return{profile:{name:e.name,title:e.title,summary:e.summary},types:n,statuses:r,fields:s,workflows:o,config:i,templates:a,packages:d,changed:c}}export{Ce as a,Pe as b,$e as c,De as d,Le as e,Q as f,Re as g,Fe as h,_ as i,I as j,ne as k,qe as l,je as m,re as n,Be as o,se as p,Ye as q,oe as r,b as s,v as t,V as u,Ge as v,at as w,lt as x,ct as y,ft as z};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-467EW5RL.js.map
|