@unbrained/pm-cli 2026.11.23 → 2026.11.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/dist/cli/main.js +5 -5
- package/dist/cli/register-annotations.js +1 -1
- package/dist/cli/runtime/invocation-options.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +1 -1
- package/dist/cli-bundle/chunks/{chunk-2UQU7HRR.js → chunk-23K6DQQY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-O7JHS64G.js → chunk-37UDIJ2K.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7IROAPWI.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-KZHIBEJL.js → chunk-7VRFEURZ.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-7X253M6Z.js +3 -0
- package/dist/cli-bundle/chunks/chunk-AWB5KBJS.js +2 -0
- package/dist/cli-bundle/chunks/chunk-DQDRA3SW.js +2 -0
- package/dist/cli-bundle/chunks/chunk-FXJYZBWV.js +113 -0
- package/dist/cli-bundle/chunks/{chunk-BSRIVYTM.js → chunk-HNKK2UG6.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-I2OJ5B4A.js +2 -0
- package/dist/cli-bundle/chunks/chunk-I3BFCKZR.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-ENKXRSFZ.js → chunk-MXUSC5RS.js} +31 -31
- package/dist/cli-bundle/chunks/chunk-PLIUU37C.js +3 -0
- package/dist/cli-bundle/chunks/chunk-PQUBVRV5.js +2 -0
- package/dist/cli-bundle/chunks/chunk-PW7U7WCE.js +3 -0
- package/dist/cli-bundle/chunks/chunk-SSALO4DB.js +2 -0
- package/dist/cli-bundle/chunks/chunk-STOOTHZZ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-TKRY22SO.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-AEOHUSUI.js → chunk-TVIJ2VCU.js} +68 -68
- package/dist/cli-bundle/chunks/{chunk-F2Z6XLZB.js → chunk-VJSGUXGU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-H7JEXRIN.js → chunk-WWTPNIC2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J2PDAVBC.js → chunk-XFADNMGD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZY5MVJF.js → chunk-YOPTAIBD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CFWLQFJM.js → chunk-YW2HBHRO.js} +50 -51
- package/dist/cli-bundle/chunks/chunk-Z7MFVRDV.js +2 -0
- package/dist/cli-bundle/chunks/chunk-ZOX4SWRL.js +8 -0
- package/dist/cli-bundle/chunks/chunk-ZYCOM4MS.js +9 -0
- package/dist/cli-bundle/chunks/field-option-collisions-W66HSWMK.js +2 -0
- package/dist/cli-bundle/{focused-chunks/item-revision-YDACCDVY.js → chunks/item-revision-D3LSBNIR.js} +2 -2
- package/dist/cli-bundle/chunks/item-transaction-M6NTBYH3.js +2 -0
- package/dist/cli-bundle/chunks/mutation-actor-OKL3CQVX.js +2 -0
- package/dist/cli-bundle/chunks/mutation-admission-EKPEOZMF.js +2 -0
- package/dist/cli-bundle/chunks/{register-list-query-L4IBU64P.js → register-list-query-3LBV6CS2.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-72AGTMNE.js +21 -0
- package/dist/cli-bundle/chunks/register-operations-XERFG2SH.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-W22L34Z4.js +2 -0
- package/dist/cli-bundle/chunks/runtime-schema-JP2KBHBY.js +2 -0
- package/dist/cli-bundle/chunks/stage-T2LKWN7C.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-24VRBNKE.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-3ELVASVA.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-XRS3VNC6.js → chunk-3GT4A3ZN.js} +23 -23
- package/dist/cli-bundle/focused-chunks/{chunk-IROZDIDX.js → chunk-3OCDKITJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3Z7MCUJM.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-46MP7IZN.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OTMMOKPM.js → chunk-5LDBS6MS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZHWPCVQL.js → chunk-B6BNHKUW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-C7WHWI7K.js +3 -0
- package/dist/cli-bundle/focused-chunks/chunk-EUQGZPGO.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-UFTUNBMY.js → chunk-FDZPRJXJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-GXP7Q4XM.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-HL47UQZJ.js +8 -0
- package/dist/cli-bundle/focused-chunks/chunk-LMFIAQ2V.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-LMU7DDOA.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-OZOCEB2Q.js +8 -0
- package/dist/cli-bundle/focused-chunks/{chunk-NQTEE66P.js → chunk-Q2HY44LV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-REFMQY47.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-RIQUIHYU.js +3 -0
- package/dist/cli-bundle/focused-chunks/{chunk-QQIIMMFU.js → chunk-RLO2HCZT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-SMMOZ3H3.js +100 -0
- package/dist/cli-bundle/focused-chunks/chunk-UVTUX54T.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-Y2ESLKCF.js → chunk-XDBHD4CY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-YD66IRSL.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z7W2RQIB.js +2 -0
- package/dist/cli-bundle/focused-chunks/field-option-collisions-UODPSV6W.js +2 -0
- package/dist/cli-bundle/focused-chunks/item-revision-QH7RNBX4.js +2 -0
- package/dist/cli-bundle/focused-chunks/item-transaction-ZO72OINF.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-actor-PHVLKG4I.js +2 -0
- package/dist/cli-bundle/focused-chunks/mutation-admission-ZSG5OECH.js +2 -0
- package/dist/cli-bundle/focused-chunks/runtime-schema-6RQMIDTN.js +2 -0
- package/dist/cli-bundle/focused-chunks/stage-AQMKRVX4.js +2 -0
- package/dist/cli-bundle/main.js +26 -26
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +4 -4
- package/dist/cli-bundle/sdk-core.js +1 -1
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +63 -63
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +11 -11
- package/dist/core/profile/profile-lint.d.ts +1 -1
- package/dist/core/profile/profile-lint.js +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/runtime-field-values.js +1 -1
- package/dist/core/schema/runtime-schema.d.ts +2 -0
- package/dist/core/schema/runtime-schema.js +1 -1
- package/dist/sdk/extension/command-options.d.ts +26 -1
- package/dist/sdk/extension/command-options.js +1 -1
- package/dist/sdk/extension-command-context.js +2 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/read-output-contracts.d.ts +11 -0
- package/dist/sdk/read-output-contracts.js +1 -1
- package/dist/sdk/schema/field-flag-spelling.d.ts +22 -0
- package/dist/sdk/schema/field-flag-spelling.js +2 -0
- package/dist/sdk/schema/field-option-collisions.js +1 -1
- package/docs/COMMANDS.md +1 -1
- package/docs/EXTENSIONS.md +1 -1
- package/docs/READ_OUTPUT_CONTRACTS.md +2 -0
- package/docs/SDK.md +20 -1
- package/docs/SDK_AUDITED_MUTATIONS.md +11 -0
- package/marketplace.json +1 -1
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/package.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/package.json +1 -1
- package/plugins/pm-codex/plugin.json +1 -1
- package/runtime-dependencies.json +1 -1
- package/dist/cli-bundle/chunks/chunk-5WZZ5XEN.js +0 -3
- package/dist/cli-bundle/chunks/chunk-6MYJLOSG.js +0 -2
- package/dist/cli-bundle/chunks/chunk-FJOEL75F.js +0 -2
- package/dist/cli-bundle/chunks/chunk-GDXCAC52.js +0 -2
- package/dist/cli-bundle/chunks/chunk-KE7HMBEW.js +0 -2
- package/dist/cli-bundle/chunks/chunk-NGJ5ERBF.js +0 -115
- package/dist/cli-bundle/chunks/chunk-NQ54T7T2.js +0 -2
- package/dist/cli-bundle/chunks/chunk-OKEZF7HU.js +0 -2
- package/dist/cli-bundle/chunks/chunk-OKIKF4FD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-OPJF254V.js +0 -9
- package/dist/cli-bundle/chunks/chunk-RWA5YZ5X.js +0 -2
- package/dist/cli-bundle/chunks/chunk-S32NGRQM.js +0 -2
- package/dist/cli-bundle/chunks/chunk-ZPS4B6SI.js +0 -8
- package/dist/cli-bundle/chunks/item-revision-FMD4KWBB.js +0 -2
- package/dist/cli-bundle/chunks/item-transaction-SEHTH7N2.js +0 -2
- package/dist/cli-bundle/chunks/mutation-actor-SFGYIRPW.js +0 -2
- package/dist/cli-bundle/chunks/mutation-admission-57LBSKQI.js +0 -2
- package/dist/cli-bundle/chunks/register-mutation-6NUOPHZ3.js +0 -21
- package/dist/cli-bundle/chunks/register-operations-JGYVORNN.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-C44SIXEH.js +0 -2
- package/dist/cli-bundle/chunks/stage-PQ7AB63N.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-6LKTEKHS.js +0 -6
- package/dist/cli-bundle/focused-chunks/chunk-6LPXMFLM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HMDQDRV2.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-I66IKYKP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-IR2J3NOT.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ITKDHSBR.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-LQYYPXUK.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-O7Z73ALG.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-OXOCZJC6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-QLAHEDT6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-TD544C74.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-XYPEZGTR.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-YSJKQLFR.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-Z2X7HH3C.js +0 -102
- package/dist/cli-bundle/focused-chunks/item-transaction-UKEQCTKB.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-actor-AS465LRX.js +0 -2
- package/dist/cli-bundle/focused-chunks/mutation-admission-E5UHJZFE.js +0 -2
- package/dist/cli-bundle/focused-chunks/stage-36J7YLGI.js +0 -2
|
@@ -236,10 +236,21 @@ export declare const PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS:readonly["--output-
|
|
|
236
236
|
export declare const PM_READ_OUTPUT_SURFACE_CONTRACTS:readonly PmReadOutputSurfaceContract[];
|
|
237
237
|
/** Resolve a command or list/context alias to its canonical read-output surface. */
|
|
238
238
|
export declare function resolveReadOutputSurface(command:string,options?:Record<string,unknown>):PmReadOutputSurface|undefined;
|
|
239
|
+
/** Stable code of the refusal for universal output controls given to a command that is not a read surface (pm-gh1769). */
|
|
240
|
+
export declare const READ_OUTPUT_SURFACE_UNSUPPORTED_CODE="read_output_surface_unsupported";
|
|
239
241
|
/** Stable code of the refusal for a hybrid read-and-mutate command given universal output controls (pm-rrwh2o). */
|
|
240
242
|
export declare const READ_OUTPUT_MUTATION_CONFLICT_CODE="read_output_mutation_conflict";
|
|
241
243
|
/** CLI flags of the universal output controls that shape a read, which a mutation retry must drop. */
|
|
242
244
|
export declare const READ_OUTPUT_SHAPING_CONTROL_FLAGS:readonly string[];
|
|
245
|
+
/**
|
|
246
|
+
* Expose positional annotation text as the `add` mutation key that read-output
|
|
247
|
+
* validation checks, so `pm learnings <id> "text" --output-budget 1` is refused
|
|
248
|
+
* before it writes, as `--add` already is, instead of appending and then
|
|
249
|
+
* failing the output budget. CLI dispatch and the extension test harness both
|
|
250
|
+
* apply it (pm-gh1769), so a package that handles an annotation command sees
|
|
251
|
+
* the native refusal in its tests.
|
|
252
|
+
*/
|
|
253
|
+
export declare function annotationPositionalMutationOptions(commandPath:string,processedArgs:readonly unknown[]):{add?:string;};
|
|
243
254
|
/** Reject malformed or mutation-scoped universal output controls before command execution. */
|
|
244
255
|
export declare function validateReadOutputOptions(command:string,options:Record<string,unknown>):void;
|
|
245
256
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{READ_OUTPUT_DIMENSION_FLAGS as ht,READ_OUTPUT_COMPOSITION_FLAGS as yt,PM_READ_OUTPUT_SURFACES as wt}from"./read-output/options.js";import{resolvePmHistoryOperation as Rt}from"./cli-contracts/command-aliases.js";import{resolveExtensionOutputCommand as bt}from"./read-output/extension.js";import{BEHAVIOR_PRESERVING_MIGRATION_HINTS as L,LEGACY_FLAGS_BY_COMMAND as At,VALUE_BEARING_INCLUDE_ALIASES as Ct,flagSelector as G,optionKey as kt,readOutputIncludeModeOptionsForSurface as $,resolveNativeReadOutputSurface as Et}from"./read-output/surfaces.js";import{EXIT_CODE as w}from"../core/shared/constants.js";import{PmCliError as R}from"../core/shared/errors.js";import{compactReadOutputToBudget as St,estimateReadOutputTokens as Tt,readOutputMeasurementFormat as q,projectReadOutputItemToBrief as xt,preserveReadOutputRowContract as E,mirrorReadOutputReceiptEstimate as It,resolveReadOutputPassHooks as V,resolveReadOutputRecoveryBudget as jt,updateReadOutputReceiptEstimate as S}from"./read-output-budget.js";import{resolveReadOutputRecoveryBudget as Xe}from"./read-output-budget.js";import{resolvePmCommandOutputBudget as vt}from"./cli-contracts/agent-output-contracts.js";import{boundReadOutputRows as Pt,countReadOutputRows as z,mapReadOutputRows as K,readOutputBudgetCollections as H,readOutputContinuationRowCollections as v,readOutputRowPaths as Ut,readOutputRowCollections as Nt,refreshReadOutputDeliveredCounts as P}from"./read-output-rows.js";import{applyReadOutputContinuation as Mt,decodeReadOutputContinuationCursor as Dt,encodeReadOutputContinuationCursor as Bt,prioritizeAssuranceAssertions as Ft,readOutputCollectionFingerprint as Lt,refreshReadOutputDeliveredRowCounters as Gt}from"./read-output/continuation.js";import{PM_READ_OUTPUT_TAIL_RETENTION_POLICIES as T,readOutputRetainsTail as x}from"./read-output/tail-retention.js";import{decodeReadOutputContinuationCursor as tn,encodeReadOutputContinuationCursor as en,PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES as nn,readOutputCollectionFingerprint as on}from"./read-output/continuation.js";import{PM_READ_OUTPUT_TAIL_RETENTION_POLICIES as rn,readOutputRetainsTail as sn}from"./read-output/tail-retention.js";import{applyReadOutputSessionReferences as $t,attachReadOutputSessionReceipt as Y,parseReadOutputSession as U,readOutputSessionRemainingTokens as qt}from"./read-output-session.js";import{decodeQueryCursorEnvelope as Vt,encodeQueryCursor as zt}from"./pagination.js";import{READ_OUTPUT_INVOCATION_PROVENANCE as N}from"./read-output/provenance.js";const b=["include","amount","cost","encoding"];import{PM_READ_OUTPUT_SURFACES as cn}from"./read-output/options.js";const W=["canonical","legacy","intent","default"],C=ht,$e=Object.freeze(b.map(t=>C[t])),qe=yt;function Kt(t,e){const n=L[t];if(n!==void 0)return n;const o=e==="include"?Ct.has(t)?"<csv>":G(t):e==="amount"?"<n>":e==="cost"?"<tokens>":"<toon|json>";return`${t} is a compatibility alias; prefer ${C[e]} ${o}.`}function J(t){const e=At[t]??{},n=Object.freeze(Object.fromEntries(b.map(o=>[o,Object.freeze({dimension:o,canonical_option:C[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((e[o]??[]).map(u=>Object.freeze({flag:u,semantics:L[u]===void 0?"replacement":"behavior_preserving",migration_hint:Kt(u,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:t,dimensions:n,precedence:W,budget_retention_policy:t==="assurance"?"verdict_priority":Object.hasOwn(T,t)?"ordered_suffix":"ordered_prefix",projection_modes:Object.freeze([...$(t).keys()])})}const Ht=Object.freeze(wt.map(J)),Yt=new Map(Ht.map(t=>[t.command,t]));function I(t,e={}){const n=Rt(t.trim().toLowerCase()),o=bt(n);return o!==void 0?o.read_output===void 0?void 0:`extension:${o.command}`:Et(n,e)}const Wt=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],Q={comments:["add","body","comment","text","stdin","file","edit","delete"],notes:["add","note","text","addJson","stdin","file","edit","delete"],learnings:["add","learning","text","stdin","file","edit","delete"],files:["add","addGlob","remove","migrate","apply","note"],docs:["add","addGlob","remove","migrate","note"],"package-catalog":["activate","adopt","adoptAll","deactivate","doctor","init","install","manage","migrate","reload","scaffold","uninstall"]};function Jt(t){return Wt.some(e=>e!=="outputFormat"&&e!=="output_format"&&t[e]!==void 0)}const Qt=[{keys:["outputInclude","output_include"],valid:t=>k(t)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:t=>t==="unbounded"||A(t)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:t=>t==="unbounded"||A(t)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputSession","output_session"],valid:t=>(U(t),!0),message:"--output-session must be a valid session-state object."},{keys:["outputCursor","output_cursor"],valid:t=>typeof t=="string"&&t.trim().length>0,message:"--output-cursor requires a non-empty continuation cursor."}],Ve="read_output_mutation_conflict",X=[{flag:"--output-include",keys:["outputInclude","output_include"]},{flag:"--output-limit",keys:["outputLimit","output_limit"]},{flag:"--output-budget",keys:["outputBudget","output_budget"]},{flag:"--output-session",keys:["outputSession","output_session"]},{flag:"--output-cursor",keys:["outputCursor","output_cursor"]},{flag:"--output-row-contract",keys:["outputRowContract","output_row_contract"]}],ze=X.map(({flag:t})=>t);function Xt(t,e,n){const o=X.filter(({keys:s})=>s.some(d=>e[d]!==void 0)),u=o.map(({flag:s})=>s),i=o.flatMap(({keys:s})=>s.filter(d=>e[d]!==void 0)),r=u.join(", ");return new R(`Universal output controls (${r}) cannot be combined with a ${t} mutation; nothing was written.`,w.USAGE,{code:"read_output_mutation_conflict",field:u[0],details:{surface:t,output_controls:u,output_option_keys:i,mutation_options:[...n]},required:`Retry the ${t} mutation without ${r}. To bound or page the result, read it with those controls in a separate call after the write.`,why:"Universal output controls shape a read. A mutation returns its own bounded receipt, so the controls have nothing to shape and the write is refused before it runs.",examples:[...Zt[t]]})}const Zt={comments:['pm comments <id> --add "<text>"',"pm comments <id> --output-limit 5"],notes:['pm notes <id> --add "<text>"',"pm notes <id> --output-limit 5"],learnings:['pm learnings <id> --add "<text>"',"pm learnings <id> --output-limit 5"],files:["pm files <id> --add path=<path>","pm files <id> --output-limit 5"],docs:["pm docs <id> --add path=<path>","pm docs <id> --output-limit 5"],"package-catalog":["pm package install <source> --project","pm package catalog --output-limit 5"]};function Ke(t,e){const n=e.outputFormat??e.output_format;if(n!==void 0&&n!=="json"&&n!=="toon")throw new R("--output-format must be toon or json.",w.USAGE);if(!Jt(e))return;const o=I(t,e);if(!o)throw new R(`Universal output controls apply only to read commands; ${t||"this command"} is not a read surface.`,w.USAGE);if(Object.hasOwn(Q,o)){const u=o,i=Q[u].filter(r=>e[r]!==void 0&&e[r]!==!1);if(i.length>0)throw Xt(u,e,i)}for(const u of Qt){const i=u.keys.map(r=>e[r]).find(r=>r!==void 0);if(i!==void 0&&!u.valid(i))throw new R(u.message,w.USAGE)}}function Z(t){const e=I(t);return e?$(e):new Map}function te(t,e,n){const o=k(e)??[],u=Z(t),i=[],r=[],s=n,d=s[N],f=new Set(d?.canonical_include_modes??[]),l=new Set(d?.explicit_legacy_aliases??[]);for(const c of o){const _=u.get(c);if(_===void 0){i.push(c);continue}const O=`--${c.replaceAll("_","-")}`;D(M(n,O))&&l.add(O),n[_]=!0,r.push(c),f.add(c)}const a=I(t)==="get"?i.filter(c=>c!=="item"):[],p=a.length>0;return p&&(n.fields=[...new Set([...k(n.fields)??[],...a])].join(","),f.add("fields")),(r.length>0||p)&&(s[N]={canonical_include_modes:[...f],explicit_legacy_aliases:[...l],...d?.cli_invocation_observed===!0?{cli_invocation_observed:!0}:{}}),{selectors:i,modes:r}}function He(t,e){const n=e.outputInclude??e.output_include;if(n===void 0)return;const{selectors:o,modes:u}=te(t,n,e);if(u.length===0)return;const i=o.length>0?o.join(","):void 0;e.outputInclude=i,Object.hasOwn(e,"output_include")&&(e.output_include=i)}function M(t,e){const n=kt(e);if(Object.hasOwn(t,n))return t[n];const o=e.slice(2).replaceAll("-","_");if(Object.hasOwn(t,o))return t[o];if(e==="--no-truncate"&&t.truncate===!1)return!0}function D(t){return t!==void 0&&t!==!1&&t!==null}function k(t){const n=(Array.isArray(t)?t:[t]).flatMap(o=>typeof o=="string"?o.split(","):[]).map(o=>o.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function A(t){const e=typeof t=="number"?t:typeof t=="string"&&/^\d+$/u.test(t.trim())?Number(t):Number.NaN;return Number.isSafeInteger(e)&&e>0?e:void 0}function ee(t,e,n,o){for(const u of t.legacy_aliases){if(o(u.flag))continue;const i=M(e,u.flag),r={value:i,flag:u.flag};if(D(i)&&n(r))return r}}function tt(t,e){const n=k(t);if(n)return{source:"canonical",value:n};if(e)return{source:"legacy",value:k(e.value)??[G(e.flag)]}}function et(t,e){if(t==="unbounded")return{source:"canonical",value:"unbounded"};const n=A(t);if(n!==void 0)return{source:"canonical",value:n};if(!e)return;if(e.flag==="--no-truncate"||e.flag==="--unbounded")return{source:"legacy",value:"unbounded"};const o=A(e.value);return o===void 0?void 0:{source:"legacy",value:o}}function nt(t,e){if(t==="unbounded")return{source:"canonical",value:"unbounded"};const n=A(t);if(n!==void 0)return{source:"canonical",value:n};if(!e)return;const o=A(e.value);return o===void 0?void 0:{source:"legacy",value:o}}function ot(t,e){if(t==="json"||t==="toon")return{source:"canonical",value:t};if(e)return e.flag==="--stream"||e.flag==="--follow"?{source:"legacy",value:"stream"}:e.value==="json"||e.value==="toon"?{source:"legacy",value:e.value}:void 0}function ut(t,e,n){if(!t)return!1;const o=new Set(t.explicit_legacy_aliases);if(t.cli_invocation_observed===!0||t.sdk_invocation_observed===!0)return!o.has(n);const u=new Set(t.canonical_include_modes.map(i=>`--${i.replaceAll("_","-")}`));return e==="include"&&u.has(n)&&!o.has(n)}function ne(t,e,n,o){return t.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||D(M(o,"--no-truncate"))&&!ut(n,"amount","--no-truncate")||e.amount?.flag==="--no-truncate"||e.include?.flag==="--full"||n?.canonical_include_modes.includes("full")===!0}function oe(t,e){return b.flatMap(n=>t[n]?.source==="canonical"||n==="include"&&(e?.canonical_include_modes.length??0)>0?[C[n]]:[])}function it(t,e){const n=I(t,e);if(!n)return;const o=Yt.get(n)??J(n),u=e[N],i={include:g=>tt(void 0,g),amount:g=>et(void 0,g),cost:g=>nt(void 0,g),encoding:g=>ot(void 0,g)},r=Object.fromEntries(b.map(g=>[g,ee(o.dimensions[g],e,y=>i[g](y)!==void 0,y=>ut(u,g,y))])),s=b.flatMap(g=>{const y=r[g];return y?[y.flag]:[]}),d=b.flatMap(g=>{const y=r[g];return y?[o.dimensions[g].legacy_aliases.find(Ot=>Ot.flag===y.flag).migration_hint]:[]}),f=ot(e.outputFormat??e.output_format,r.encoding),l=tt(e.outputInclude??e.output_include,r.include),a=et(e.outputLimit??e.output_limit,r.amount),p=nt(e.outputBudget??e.output_budget,r.cost),c=ne(t,r,u,e),_=vt(t,{generateFallback:!0}),O=f?.value==="json"||e.resolvedOutputFormat==="json"?"json":"toon",h=p??(c?{source:"intent",value:"unbounded"}:{source:"default",value:_.default_max_estimated_tokens_by_format[O]});return{command:n,include:l,amount:a,cost:h,encoding:f,canonical_options_used:oe({include:l,amount:a,cost:h,encoding:f},u),legacy_aliases_used:s,migration_hints:d,precedence:W}}function m(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const B=new Set(["applied_bound","applied_limit","completeness","continuation_kind","continuation_path","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","budget_retention_policy","row_contract","sorting","total","truncated"]),ue=["collection_counts","notes_count","tests_count"];function rt(t,e){const n=new Set(e.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(t).filter(([o])=>n.has(o)))}function ie(t){const e=m(t.item)?t.item:{},n=[...new Set([...Object.keys(e),...ue.filter(u=>Object.hasOwn(e,u))])].sort((u,i)=>u.localeCompare(i)),o=Object.keys(t).filter(u=>u!=="item"&&u!=="read_output"&&!B.has(u)).sort((u,i)=>u.localeCompare(i));return{item:e,itemFields:n,sections:o,valid:[...n,"item",...n.map(u=>`item.${u}`),...o]}}function re(t,e){const n=ie(t),o=e.filter(a=>!n.valid.includes(a));if(o.length>0)throw new R(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,w.USAGE);const u=e.includes("item"),i=e.flatMap(a=>a.startsWith("item.")?[a.slice(5)]:n.itemFields.includes(a)?[a]:[]).filter((a,p,c)=>c.indexOf(a)===p);if(u&&i.length>0)throw new R("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",w.USAGE);const r=new Set(e.filter(a=>n.sections.includes(a))),s=Object.fromEntries(Object.entries(t).filter(([a])=>B.has(a)||r.has(a)));u?s.item=n.item:i.length>0&&(s.item=rt(n.item,i));const d=[...u?[]:i.length>0?n.itemFields.filter(a=>!i.includes(a)).map(a=>({name:`item.${a}`,restore_with:`--output-include item.${a}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(a=>!r.has(a)).map(a=>({name:a,restore_with:`--output-include ${a}`}))],l=[...m(s.omission_receipt)&&Array.isArray(s.omission_receipt.omitted_field_groups)?s.omission_receipt.omitted_field_groups:[],...d];return s.omission_receipt={has_omissions:l.length>0,omitted_field_group_count:l.length,omitted_field_groups:l},s}function st(t){let e=0;return K({...t},n=>(m(n)&&Object.keys(n).length>0&&(e+=1),n)),e}function se(t,e,n,o){if(st(e)===0||st(n)>0)return;const u=[...Z(t).keys()],i=u.length>0?` Declared ${t} projection modes: ${u.join(", ")}.`:` The ${t} surface declares no projection modes; name row fields instead.`;throw new R(`Unknown --output-include selector(s) for ${t}: ${o.join(", ")}. No selector matched any returned row field.${i}`,w.USAGE)}function ae(t,e,n){if(t==="get")return re(e,n);const o=Ut(e),u=n.flatMap(r=>o.flatMap(s=>r.startsWith(`${s}.`)?[r.slice(s.length+1)]:[])),i=n.some(r=>Object.hasOwn(e,r.split(".")[0])&&!o.some(s=>r.startsWith(`${s}.`)));if(o.length>0&&(!i||u.length>0)){const r={...e},s=u.length>0?u:n,d=K(r,f=>m(f)?rt(f,s):f);return se(t,e,d,s),d}return Object.fromEntries(Object.entries(e).filter(([r])=>n.some(s=>s.split(".")[0]===r)||B.has(r)))}function ce(t,e,n,o){if(e==="unbounded")return t;const{result:u,truncated:i}=Pt(t,e,r=>x(n,r));if(!i)return u;if(u.has_more=!0,u.truncated=!0,pt(u,n,[...o.entries()].flatMap(([r,s])=>s.rows>e?[{path:r,total_rows:s.totalRows}]:[])),typeof u.count=="number"){const r=m(u.projection)?u.projection.row_key:void 0;u.count=typeof r=="string"&&Array.isArray(u[r])?u[r].length:z(u)}return typeof u.returned_count=="number"&&(u.returned_count=z(u)),u.applied_bound={kind:"output_limit",source:"explicit",value:e},u}function de(t){return b.filter(e=>t[e]!==void 0&&t[e]?.source!=="default"||t.canonical_options_used.includes(C[e]))}function j(t,e,n,o){let u=Y(t,e,o);E(t,u);for(let i=0;i<8;i+=1){const r=n.estimated_tokens,s=u.read_session.spent_this_call_tokens;S(u,n,o);const d=u;u=Y(u,e,o),E(d,u);const f=u.read_session.spent_this_call_tokens;if(n.estimated_tokens===r&&f===s)return u}return u}function le(t,e){if(!m(t.read_output))return t;const n=q(e),o=t.read_output,u=U(e.outputSession??e.output_session);return u===void 0?(S(t,o,n),t):j(t,u,o,n)}function at(t,e){if(t!=="validate")return e;const n=m(e.projection)?e.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(a=>m(a)&&a.name==="diagnostic_rows"))return e;const u=[...new Set(H(e).map(({path:a})=>a).filter(a=>/^checks\.\d+\.details\./u.test(a)))],i=u.filter(a=>!u.some(p=>p!==a&&a.startsWith(`${p}.`)));if(i.length===0)return e;const r=m(e.row_contract)?e.row_contract:{},s=Array.isArray(r.row_keys)?r.row_keys.filter(a=>typeof a=="string"):[],d=Array.isArray(r.continuation_row_keys)?r.continuation_row_keys.filter(a=>typeof a=="string"):[],f=s.length>0?s:i,l=[...new Set(i)];return JSON.stringify(f)===JSON.stringify(s)&&JSON.stringify(l)===JSON.stringify(d)?e:{...e,row_contract:{...r,row_keys:f,continuation_row_keys:l,jq_selector:typeof r.jq_selector=="string"?r.jq_selector:".checks[].details"}}}function fe(t,e){return t.include?.source==="canonical"&&!F(e)}function ct(t,e){let n={...t};return fe(e,t)&&(n=ae(e.command,n,e.include.value)),e.command==="assurance"?Ft(n):n}function pe(t,e){const n=V(e)?.continuationBinding;if(n===void 0)return;const o=ct(at(t.command,n),t);return new Map(v(o).filter(u=>!x(t.command,u.path)).map(u=>[u.path,u]))}function _e(t,e,n,o,u){let i=ct(t,e);P(i,t);const r=pe(e,u);if(i=Mt(i,e.command,o,r),e.command==="history"&&o){const f=["compact_history","provenance_history","history","diff"];if(i=Object.fromEntries(Object.entries(i).filter(([l])=>!f.includes(l)||l===o.path)),m(i.projection)&&(i.projection={...i.projection,row_key:o.path}),m(i.row_contract)){const l=i.row_contract;i.row_contract={...l,row_keys:[o.path],...Array.isArray(l.continuation_row_keys)?{continuation_row_keys:[o.path]}:{}}}i.count=Object.keys(i[o.path]).length}const s=t.count_only===!0?{...i,count_only:!0,count:t.count}:i,d=be(i,t,e.command,o,u,r);return e.amount?.source==="canonical"&&(i=ce(i,e.amount.value,e.command,d.collectionsBeforeBudget),d.cursorContinuesExistingPage&&mt(i,d.originalItems,d.cursorSource,!0,d.originalItemOffset)),P(i,s),_t(i,e.command,d),{projected:n===void 0?i:$t(i,n),continuationState:d}}function me(t,e){return[...t.cost!==void 0&&t.cost.value!=="unbounded"&&(t.cost.source==="canonical"||t.cost.source==="default"||t.command==="context"&&t.cost.source==="legacy")?[{source:t.cost.source,tokens:t.cost.value}]:[],...e===void 0?[]:[{source:"session",tokens:qt(e)}]].sort((o,u)=>o.tokens-u.tokens)[0]}function dt(t){const e=t.canonical_options_used;return e&&e.length>0?{canonical_options_used:e}:{}}function lt(t,e){return m(t.context_intent)&&t.context_intent.command==="context"&&t.context_intent.token_budget===e&&t.context_intent.within_budget===!0}function ge(t,e,n){return t.command!=="next"||(e.tokenBudget??e.token_budget)===void 0?!1:!(m(n.context_intent)&&n.context_intent.command==="next"&&n.context_intent.within_budget===!0)}function ft(t,e={}){return t?.source==="default"||t?.source==="legacy"&&!lt(e,t.tokens)?{budget_source:t.source,budget_tokens:t.tokens}:{}}function Oe(t,e,n,o,u,i){const r={contract_version:1,command:t.command,requested_dimensions:e,...ft(o),precedence:t.precedence,...dt(t),legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0,...n===void 0?{omitted_result_estimated_tokens:u}:{}},s={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:r},d=n===void 0?s:j(s,n,r,i);if(n===void 0&&S(d,r,i),n!==void 0&&r.estimated_tokens>o.tokens)throw new R("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",w.USAGE);return d}function he(t,e,n){return t.command==="context"&&t.cost?.source==="legacy"&&!lt(n,t.cost.value)||ge(t,e,n)||e.outputRowContract===!0||e.output_row_contract===!0||t.canonical_options_used.includes("--output-include")||t.command==="list"&&t.canonical_options_used.length>0&&t.include?.value.includes("full")===!0}function ye(t,e,n,o,u){if(e!==void 0||F(n)||he(t,u,n))return!1;if(t.amount?.source==="canonical"&&t.amount.value!=="unbounded"){const i=t.amount.value;if(Nt(n).some(({value:r})=>(Array.isArray(r)?r.length:Object.keys(r).length)>i))return!1}return t.cost===void 0||t.cost.value==="unbounded"||t.cost.source==="legacy"&&t.command!=="context"||Tt(u.outputRowContract===!1?Object.fromEntries(Object.entries(n).filter(([i])=>i!=="row_contract")):n,o)<=t.cost.value}function pt(t,e,n){const o=Object.hasOwn(T,e)?T[e]:void 0,u=n.find(i=>o?.paths.includes(i.path));o!==void 0&&u!==void 0&&typeof t[o.total_key]!="number"&&(t[o.total_key]=u.total_rows)}function _t(t,e,n){const o=T[e]?.paths[0];o!==void 0&&Gt(t,e,n.producer,n.collectionsBeforeBudget.get(o)?.rows)}function we(t,e,n,o){const u=n.backward?n.rows-o:n.baseOffset+o;return{path:e,cursor:Bt({command:t,path:e,offset:u,total_rows:n.totalRows,fingerprint:n.fingerprint,...n.backward?{direction:"backward"}:{}}),retained_rows:o,remaining_rows:n.backward?u:n.totalRows-u,total_rows:n.totalRows}}function Re(t,e,n,o,u,i,r){if(!n.rows_compacted)return;const s=e.amount?.value==="unbounded"?["amount"]:[],d=new Map(v(t).map(_=>[_.path,Array.isArray(_.value)?_.value.length:Object.keys(_.value).length])),f=[...r.entries()].flatMap(([_,O])=>{const h=d.get(_);return h>=O.rows?[]:[we(e.command,_,O,h)]}),l=f[0];pt(t,e.command,f);const a=l?"; page --output-cursor":"",p=o.source==="session"?`Truncated by the remaining ${o.tokens}-token session budget; start a new output session with a larger token_budget${a}.`:`${o.tokens}-token: raise --output-budget${a}`;n.migration_hints=[p,...e.migration_hints];const c=jt({effective_budget_tokens:o.tokens,measured_result_tokens:i});l&&!u&&(typeof t.next_cursor!="string"||t.continuation_kind==="output_cursor")&&(t.next_cursor=l.cursor),t.continuation_kind=u?"producer_cursor":l?"output_cursor":"none",t.output_budget_truncation={reason:"output_budget_reached",budget_source:o.source,budget_tokens:o.tokens,overridden_dimensions:s,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:u,continuation_available:f.length>0,recovery_budget_multiplier:l?1:c.recovery_budget_multiplier,continuations:f,restore_with:l?"recovery":`Retry with --output-budget ${c.output_budget} because no declared row collection can be continued.`,recovery:l?{cursor:l.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:`--output-budget ${c.output_budget}`,sdk:{outputBudget:c.output_budget},mcp:{outputBudget:c.output_budget}}}}function mt(t,e,n,o,u){if(typeof n!="string"||!Array.isArray(t.items))return!1;const i=t.items.length,r=e.length;if(i===0||i>=r)return!1;let s;try{s=Vt(n)}catch{return!1}const d=s.after_index;if(d===void 0)return!1;const f=e[i-1];if(Object.prototype.toString.call(f)!=="[object Object]")return!1;const l=Reflect.get(f,"id");if(typeof l!="string"||l.length===0)return!1;const a=o?d-(r-i):d+u+i;return a<0?!1:(t.next_cursor=zt(s.fingerprint,l,a,s.snapshot),!0)}function gt(t){return Array.isArray(t)?t.length:Object.keys(t).length}function be(t,e,n,o,u,i){const r=new Map(v(t).map(f=>{const l=gt(f.value),a=o?.path===f.path,p=x(n,f.path),c=i?.get(f.path)??f;let _;return[f.path,{rows:l,totalRows:a?o.total_rows:gt(c.value),baseOffset:a&&!p?o.offset:0,backward:p,get fingerprint(){return _??=a?o.fingerprint:Lt(f.path,c.value,n),_}}]})),s=typeof t.next_cursor=="string",d=o?.path==="items"?o.offset:0;return{collectionsBeforeBudget:r,originalItems:Array.isArray(e.items)?d>0?e.items.slice(d):e.items:[],originalItemOffset:d,cursorContinuesExistingPage:s,cursorSource:s?t.next_cursor:u.after,producer:e}}function Ae(t,e,n,o,u,i,r,s,d,f){const l={...e,count_only:n},a=o.command==="assurance"&&Array.isArray(t.assertions)?t.assertions.filter(c=>m(c)&&c.verdict!=="pass").length:0,p=new Map;if(a>0&&p.set("assertions",a),o.command==="history"&&Array.isArray(t.diff))for(const c of H(t))c.path.startsWith("diff.")&&p.set(c.path,Object.keys(c.value).length);return St(t,u,i.tokens,p,f,c=>{P(c,l),_t(c,o.command,s);const _=mt(c,s.originalItems,s.cursorSource,s.cursorContinuesExistingPage,s.originalItemOffset);if(Re(c,o,u,i,_,d,s.collectionsBeforeBudget),o.command==="history"&&m(c.projection)){c.has_more=typeof c.next_cursor=="string"||c.applied_bound?.kind==="output_limit";const O=c.projection.row_key;typeof O=="string"&&Array.isArray(c[O])&&(c.count=c[O].length)}r!==void 0&&Object.assign(c,j(c,r,u,f))},o.command==="history"&&Array.isArray(t.diff),c=>x(o.command,c),o.command)}function Ye(t,e,n){const o=it(t,e);if(!o)return n;const u=q(e),i=U(e.outputSession??e.output_session),r=e.outputCursor??e.output_cursor,s=typeof r=="string"?Dt(r):void 0,d=de(o),f=at(o.command,n);if(s===void 0&&ye(o,i,f,u,e))return f;const l=me(o,i),a=_e(f,o,i,s,e);let p=a.projected;E(p,p,e.outputRowContract===!1);const c=F(p),_={contract_version:1,command:o.command,requested_dimensions:d,...ft(l,p),precedence:o.precedence,...dt(o),legacy_aliases_used:o.legacy_aliases_used,migration_hints:o.migration_hints,estimated_tokens:0,within_budget:!c,strings_compacted:!1,rows_compacted:!1,result_omitted:c};p.read_output=_;const O=V(e)?.mirrorEstimate;if(O!==void 0&&It(_,O),p=i===void 0?p:j(p,i,_,u),S(p,_,u),l!==void 0&&_.estimated_tokens>l.tokens){const h=xt(o.command,e,p);h!==void 0&&(_.applied_depth="brief",_.degradation_reason="output_budget_reached",E(p,h),p=le(h,e)),_.estimated_tokens>l.tokens&&(p=Ae(p,p,f.count_only===!0,o,_,l,i,a.continuationState,_.estimated_tokens,u))}return l!==void 0&&_.estimated_tokens>l.tokens?Oe(o,d,i,l,_.estimated_tokens,u):p}function Ce(t){return m(t)&&m(t.context_intent)&&t.context_intent.result_omitted===!0}function F(t){return ke(t)||Ce(t)}function ke(t){return m(t)&&m(t.output_budget_exceeded)&&t.output_budget_exceeded.omitted_result===!0&&t.output_budget_exceeded.reason==="requested_budget_infeasible"}function We(t,e){const n=e.outputFormat??e.output_format;if(n==="json"||n==="toon")return n;const o=it(t,e)?.encoding;return o?.value==="json"||o?.value==="toon"?o.value:void 0}export{qe as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,nn as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,b as PM_READ_OUTPUT_DIMENSIONS,$e as PM_READ_OUTPUT_OPTION_FLAGS,cn as PM_READ_OUTPUT_SURFACES,Ht as PM_READ_OUTPUT_SURFACE_CONTRACTS,rn as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,Ve as READ_OUTPUT_MUTATION_CONFLICT_CODE,ze as READ_OUTPUT_SHAPING_CONTROL_FLAGS,Ye as applyReadOutputDimensions,te as applyReadOutputIncludeModes,tn as decodeReadOutputContinuationCursor,en as encodeReadOutputContinuationCursor,ke as isReadOutputBudgetExceeded,F as isReadResultOmittedForBudget,He as normalizeReadOutputIncludeModeOptions,on as readOutputCollectionFingerprint,Z as readOutputIncludeModeOptions,sn as readOutputRetainsTail,it as resolveReadOutputDimensions,We as resolveReadOutputEncoding,Xe as resolveReadOutputRecoveryBudget,I as resolveReadOutputSurface,le as stabilizeReadOutputReceiptEstimates,Ke as validateReadOutputOptions};
|
|
1
|
+
import{READ_OUTPUT_DIMENSION_FLAGS as yt,READ_OUTPUT_COMPOSITION_FLAGS as wt,PM_READ_OUTPUT_SURFACES as Rt}from"./read-output/options.js";import{resolvePmHistoryOperation as bt}from"./cli-contracts/command-aliases.js";import{resolveExtensionOutputCommand as At}from"./read-output/extension.js";import{BEHAVIOR_PRESERVING_MIGRATION_HINTS as L,LEGACY_FLAGS_BY_COMMAND as Ct,VALUE_BEARING_INCLUDE_ALIASES as Et,flagSelector as G,optionKey as kt,readOutputIncludeModeOptionsForSurface as $,resolveNativeReadOutputSurface as Tt}from"./read-output/surfaces.js";import{EXIT_CODE as w}from"../core/shared/constants.js";import{PmCliError as R}from"../core/shared/errors.js";import{compactReadOutputToBudget as St,estimateReadOutputTokens as xt,readOutputMeasurementFormat as q,projectReadOutputItemToBrief as It,preserveReadOutputRowContract as k,mirrorReadOutputReceiptEstimate as jt,resolveReadOutputPassHooks as V,resolveReadOutputRecoveryBudget as vt,updateReadOutputReceiptEstimate as T}from"./read-output-budget.js";import{resolveReadOutputRecoveryBudget as en}from"./read-output-budget.js";import{resolvePmCommandOutputBudget as Ut}from"./cli-contracts/agent-output-contracts.js";import{boundReadOutputRows as Pt,countReadOutputRows as z,mapReadOutputRows as K,readOutputBudgetCollections as H,readOutputContinuationRowCollections as v,readOutputRowPaths as Nt,readOutputRowCollections as Mt,refreshReadOutputDeliveredCounts as U}from"./read-output-rows.js";import{applyReadOutputContinuation as Dt,decodeReadOutputContinuationCursor as Ft,encodeReadOutputContinuationCursor as Bt,prioritizeAssuranceAssertions as Lt,readOutputCollectionFingerprint as Gt,refreshReadOutputDeliveredRowCounters as $t}from"./read-output/continuation.js";import{PM_READ_OUTPUT_TAIL_RETENTION_POLICIES as S,readOutputRetainsTail as x}from"./read-output/tail-retention.js";import{decodeReadOutputContinuationCursor as on,encodeReadOutputContinuationCursor as un,PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES as rn,readOutputCollectionFingerprint as sn}from"./read-output/continuation.js";import{PM_READ_OUTPUT_TAIL_RETENTION_POLICIES as cn,readOutputRetainsTail as dn}from"./read-output/tail-retention.js";import{applyReadOutputSessionReferences as qt,attachReadOutputSessionReceipt as Y,parseReadOutputSession as P,readOutputSessionRemainingTokens as Vt}from"./read-output-session.js";import{decodeQueryCursorEnvelope as zt,encodeQueryCursor as Kt}from"./pagination.js";import{READ_OUTPUT_INVOCATION_PROVENANCE as N}from"./read-output/provenance.js";const b=["include","amount","cost","encoding"];import{PM_READ_OUTPUT_SURFACES as fn}from"./read-output/options.js";const W=["canonical","legacy","intent","default"],C=yt,qe=Object.freeze(b.map(t=>C[t])),Ve=wt;function Ht(t,e){const n=L[t];if(n!==void 0)return n;const o=e==="include"?Et.has(t)?"<csv>":G(t):e==="amount"?"<n>":e==="cost"?"<tokens>":"<toon|json>";return`${t} is a compatibility alias; prefer ${C[e]} ${o}.`}function J(t){const e=Ct[t]??{},n=Object.freeze(Object.fromEntries(b.map(o=>[o,Object.freeze({dimension:o,canonical_option:C[o],applicable:!0,inapplicable_reason:null,legacy_aliases:Object.freeze((e[o]??[]).map(u=>Object.freeze({flag:u,semantics:L[u]===void 0?"replacement":"behavior_preserving",migration_hint:Ht(u,o),visibility:"hidden_alias"})))})])));return Object.freeze({command:t,dimensions:n,precedence:W,budget_retention_policy:t==="assurance"?"verdict_priority":Object.hasOwn(S,t)?"ordered_suffix":"ordered_prefix",projection_modes:Object.freeze([...$(t).keys()])})}const Yt=Object.freeze(Rt.map(J)),Wt=new Map(Yt.map(t=>[t.command,t]));function I(t,e={}){const n=bt(t.trim().toLowerCase()),o=At(n);return o!==void 0?o.read_output===void 0?void 0:`extension:${o.command}`:Tt(n,e)}const X=["outputInclude","output_include","outputLimit","output_limit","outputBudget","output_budget","outputFormat","output_format","outputSession","output_session","outputCursor","output_cursor","outputRowContract","output_row_contract"],Q={comments:["add","body","comment","text","stdin","file","edit","delete"],notes:["add","note","text","addJson","stdin","file","edit","delete"],learnings:["add","learning","text","stdin","file","edit","delete"],files:["add","addGlob","remove","migrate","apply","note"],docs:["add","addGlob","remove","migrate","note"],"package-catalog":["activate","adopt","adoptAll","deactivate","doctor","init","install","manage","migrate","reload","scaffold","uninstall"]};function Jt(t){return X.some(e=>e!=="outputFormat"&&e!=="output_format"&&t[e]!==void 0)}const Xt=[{keys:["outputInclude","output_include"],valid:t=>E(t)!==void 0,message:"--output-include requires at least one comma-separated field or section."},{keys:["outputLimit","output_limit"],valid:t=>t==="unbounded"||A(t)!==void 0,message:"--output-limit must be a positive integer or unbounded."},{keys:["outputBudget","output_budget"],valid:t=>t==="unbounded"||A(t)!==void 0,message:"--output-budget must be a positive integer or unbounded."},{keys:["outputSession","output_session"],valid:t=>(P(t),!0),message:"--output-session must be a valid session-state object."},{keys:["outputCursor","output_cursor"],valid:t=>typeof t=="string"&&t.trim().length>0,message:"--output-cursor requires a non-empty continuation cursor."}],ze="read_output_surface_unsupported",Ke="read_output_mutation_conflict",Z=[{flag:"--output-include",keys:["outputInclude","output_include"]},{flag:"--output-limit",keys:["outputLimit","output_limit"]},{flag:"--output-budget",keys:["outputBudget","output_budget"]},{flag:"--output-session",keys:["outputSession","output_session"]},{flag:"--output-cursor",keys:["outputCursor","output_cursor"]},{flag:"--output-row-contract",keys:["outputRowContract","output_row_contract"]}],He=Z.map(({flag:t})=>t);function Qt(t,e,n){const o=Z.filter(({keys:s})=>s.some(d=>e[d]!==void 0)),u=o.map(({flag:s})=>s),i=o.flatMap(({keys:s})=>s.filter(d=>e[d]!==void 0)),r=u.join(", ");return new R(`Universal output controls (${r}) cannot be combined with a ${t} mutation; nothing was written.`,w.USAGE,{code:"read_output_mutation_conflict",field:u[0],details:{surface:t,output_controls:u,output_option_keys:i,mutation_options:[...n]},required:`Retry the ${t} mutation without ${r}. To bound or page the result, read it with those controls in a separate call after the write.`,why:"Universal output controls shape a read. A mutation returns its own bounded receipt, so the controls have nothing to shape and the write is refused before it runs.",examples:[...Zt[t]]})}const Zt={comments:['pm comments <id> --add "<text>"',"pm comments <id> --output-limit 5"],notes:['pm notes <id> --add "<text>"',"pm notes <id> --output-limit 5"],learnings:['pm learnings <id> --add "<text>"',"pm learnings <id> --output-limit 5"],files:["pm files <id> --add path=<path>","pm files <id> --output-limit 5"],docs:["pm docs <id> --add path=<path>","pm docs <id> --output-limit 5"],"package-catalog":["pm package install <source> --project","pm package catalog --output-limit 5"]},te=new Set(["comments","notes","learnings"]);function Ye(t,e){const n=e[1];return te.has(t)&&typeof n=="string"?{add:n}:{}}function We(t,e){const n=e.outputFormat??e.output_format;if(n!==void 0&&n!=="json"&&n!=="toon")throw new R("--output-format must be toon or json.",w.USAGE);if(!Jt(e))return;const o=I(t,e);if(!o){const u=X.filter(i=>e[i]!==void 0);throw new R(`Universal output controls apply only to read commands; ${t||"this command"} is not a read surface.`,w.USAGE,{code:"read_output_surface_unsupported",details:{command:t||null,output_option_keys:u},required:"Drop the universal output controls, or run a read command. An extension command accepts them only when it declares read_output.",why:"Universal output controls shape a read's rows; a command that is not a read surface has no rows for them to bound, page or project."})}if(Object.hasOwn(Q,o)){const u=o,i=Q[u].filter(r=>e[r]!==void 0&&e[r]!==!1);if(i.length>0)throw Qt(u,e,i)}for(const u of Xt){const i=u.keys.map(r=>e[r]).find(r=>r!==void 0);if(i!==void 0&&!u.valid(i))throw new R(u.message,w.USAGE)}}function tt(t){const e=I(t);return e?$(e):new Map}function ee(t,e,n){const o=E(e)??[],u=tt(t),i=[],r=[],s=n,d=s[N],f=new Set(d?.canonical_include_modes??[]),l=new Set(d?.explicit_legacy_aliases??[]);for(const c of o){const _=u.get(c);if(_===void 0){i.push(c);continue}const O=`--${c.replaceAll("_","-")}`;D(M(n,O))&&l.add(O),n[_]=!0,r.push(c),f.add(c)}const a=I(t)==="get"?i.filter(c=>c!=="item"):[],p=a.length>0;return p&&(n.fields=[...new Set([...E(n.fields)??[],...a])].join(","),f.add("fields")),(r.length>0||p)&&(s[N]={canonical_include_modes:[...f],explicit_legacy_aliases:[...l],...d?.cli_invocation_observed===!0?{cli_invocation_observed:!0}:{}}),{selectors:i,modes:r}}function Je(t,e){const n=e.outputInclude??e.output_include;if(n===void 0)return;const{selectors:o,modes:u}=ee(t,n,e);if(u.length===0)return;const i=o.length>0?o.join(","):void 0;e.outputInclude=i,Object.hasOwn(e,"output_include")&&(e.output_include=i)}function M(t,e){const n=kt(e);if(Object.hasOwn(t,n))return t[n];const o=e.slice(2).replaceAll("-","_");if(Object.hasOwn(t,o))return t[o];if(e==="--no-truncate"&&t.truncate===!1)return!0}function D(t){return t!==void 0&&t!==!1&&t!==null}function E(t){const n=(Array.isArray(t)?t:[t]).flatMap(o=>typeof o=="string"?o.split(","):[]).map(o=>o.trim()).filter(Boolean);return n.length>0?[...new Set(n)]:void 0}function A(t){const e=typeof t=="number"?t:typeof t=="string"&&/^\d+$/u.test(t.trim())?Number(t):Number.NaN;return Number.isSafeInteger(e)&&e>0?e:void 0}function ne(t,e,n,o){for(const u of t.legacy_aliases){if(o(u.flag))continue;const i=M(e,u.flag),r={value:i,flag:u.flag};if(D(i)&&n(r))return r}}function et(t,e){const n=E(t);if(n)return{source:"canonical",value:n};if(e)return{source:"legacy",value:E(e.value)??[G(e.flag)]}}function nt(t,e){if(t==="unbounded")return{source:"canonical",value:"unbounded"};const n=A(t);if(n!==void 0)return{source:"canonical",value:n};if(!e)return;if(e.flag==="--no-truncate"||e.flag==="--unbounded")return{source:"legacy",value:"unbounded"};const o=A(e.value);return o===void 0?void 0:{source:"legacy",value:o}}function ot(t,e){if(t==="unbounded")return{source:"canonical",value:"unbounded"};const n=A(t);if(n!==void 0)return{source:"canonical",value:n};if(!e)return;const o=A(e.value);return o===void 0?void 0:{source:"legacy",value:o}}function ut(t,e){if(t==="json"||t==="toon")return{source:"canonical",value:t};if(e)return e.flag==="--stream"||e.flag==="--follow"?{source:"legacy",value:"stream"}:e.value==="json"||e.value==="toon"?{source:"legacy",value:e.value}:void 0}function it(t,e,n){if(!t)return!1;const o=new Set(t.explicit_legacy_aliases);if(t.cli_invocation_observed===!0||t.sdk_invocation_observed===!0)return!o.has(n);const u=new Set(t.canonical_include_modes.map(i=>`--${i.replaceAll("_","-")}`));return e==="include"&&u.has(n)&&!o.has(n)}function oe(t,e,n,o){return t.trim().toLowerCase().replaceAll(/\s+/gu," ").split(" ")[0]==="list-all"||D(M(o,"--no-truncate"))&&!it(n,"amount","--no-truncate")||e.amount?.flag==="--no-truncate"||e.include?.flag==="--full"||n?.canonical_include_modes.includes("full")===!0}function ue(t,e){return b.flatMap(n=>t[n]?.source==="canonical"||n==="include"&&(e?.canonical_include_modes.length??0)>0?[C[n]]:[])}function rt(t,e){const n=I(t,e);if(!n)return;const o=Wt.get(n)??J(n),u=e[N],i={include:g=>et(void 0,g),amount:g=>nt(void 0,g),cost:g=>ot(void 0,g),encoding:g=>ut(void 0,g)},r=Object.fromEntries(b.map(g=>[g,ne(o.dimensions[g],e,y=>i[g](y)!==void 0,y=>it(u,g,y))])),s=b.flatMap(g=>{const y=r[g];return y?[y.flag]:[]}),d=b.flatMap(g=>{const y=r[g];return y?[o.dimensions[g].legacy_aliases.find(ht=>ht.flag===y.flag).migration_hint]:[]}),f=ut(e.outputFormat??e.output_format,r.encoding),l=et(e.outputInclude??e.output_include,r.include),a=nt(e.outputLimit??e.output_limit,r.amount),p=ot(e.outputBudget??e.output_budget,r.cost),c=oe(t,r,u,e),_=Ut(t,{generateFallback:!0}),O=f?.value==="json"||e.resolvedOutputFormat==="json"?"json":"toon",h=p??(c?{source:"intent",value:"unbounded"}:{source:"default",value:_.default_max_estimated_tokens_by_format[O]});return{command:n,include:l,amount:a,cost:h,encoding:f,canonical_options_used:ue({include:l,amount:a,cost:h,encoding:f},u),legacy_aliases_used:s,migration_hints:d,precedence:W}}function m(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const F=new Set(["applied_bound","applied_limit","completeness","continuation_kind","continuation_path","continuation_contract","count","filters","has_more","next_cursor","now","omission_receipt","projection","budget_retention_policy","row_contract","sorting","total","truncated"]),ie=["collection_counts","notes_count","tests_count"];function st(t,e){const n=new Set(e.map(o=>o.split(".")[0]));return Object.fromEntries(Object.entries(t).filter(([o])=>n.has(o)))}function re(t){const e=m(t.item)?t.item:{},n=[...new Set([...Object.keys(e),...ie.filter(u=>Object.hasOwn(e,u))])].sort((u,i)=>u.localeCompare(i)),o=Object.keys(t).filter(u=>u!=="item"&&u!=="read_output"&&!F.has(u)).sort((u,i)=>u.localeCompare(i));return{item:e,itemFields:n,sections:o,valid:[...n,"item",...n.map(u=>`item.${u}`),...o]}}function se(t,e){const n=re(t),o=e.filter(a=>!n.valid.includes(a));if(o.length>0)throw new R(`Unknown --output-include selector(s) for get: ${o.join(", ")}. Valid selectors: ${n.valid.join(", ")}.`,w.USAGE);const u=e.includes("item"),i=e.flatMap(a=>a.startsWith("item.")?[a.slice(5)]:n.itemFields.includes(a)?[a]:[]).filter((a,p,c)=>c.indexOf(a)===p);if(u&&i.length>0)throw new R("--output-include cannot mix a full item with projected item fields; use item or item.<field>, not both.",w.USAGE);const r=new Set(e.filter(a=>n.sections.includes(a))),s=Object.fromEntries(Object.entries(t).filter(([a])=>F.has(a)||r.has(a)));u?s.item=n.item:i.length>0&&(s.item=st(n.item,i));const d=[...u?[]:i.length>0?n.itemFields.filter(a=>!i.includes(a)).map(a=>({name:`item.${a}`,restore_with:`--output-include item.${a}`})):[{name:"item",restore_with:"--output-include item"}],...n.sections.filter(a=>!r.has(a)).map(a=>({name:a,restore_with:`--output-include ${a}`}))],l=[...m(s.omission_receipt)&&Array.isArray(s.omission_receipt.omitted_field_groups)?s.omission_receipt.omitted_field_groups:[],...d];return s.omission_receipt={has_omissions:l.length>0,omitted_field_group_count:l.length,omitted_field_groups:l},s}function at(t){let e=0;return K({...t},n=>(m(n)&&Object.keys(n).length>0&&(e+=1),n)),e}function ae(t,e,n,o){if(at(e)===0||at(n)>0)return;const u=[...tt(t).keys()],i=u.length>0?` Declared ${t} projection modes: ${u.join(", ")}.`:` The ${t} surface declares no projection modes; name row fields instead.`;throw new R(`Unknown --output-include selector(s) for ${t}: ${o.join(", ")}. No selector matched any returned row field.${i}`,w.USAGE)}function ce(t,e,n){if(t==="get")return se(e,n);const o=Nt(e),u=n.flatMap(r=>o.flatMap(s=>r.startsWith(`${s}.`)?[r.slice(s.length+1)]:[])),i=n.some(r=>Object.hasOwn(e,r.split(".")[0])&&!o.some(s=>r.startsWith(`${s}.`)));if(o.length>0&&(!i||u.length>0)){const r={...e},s=u.length>0?u:n,d=K(r,f=>m(f)?st(f,s):f);return ae(t,e,d,s),d}return Object.fromEntries(Object.entries(e).filter(([r])=>n.some(s=>s.split(".")[0]===r)||F.has(r)))}function de(t,e,n,o){if(e==="unbounded")return t;const{result:u,truncated:i}=Pt(t,e,r=>x(n,r));if(!i)return u;if(u.has_more=!0,u.truncated=!0,_t(u,n,[...o.entries()].flatMap(([r,s])=>s.rows>e?[{path:r,total_rows:s.totalRows}]:[])),typeof u.count=="number"){const r=m(u.projection)?u.projection.row_key:void 0;u.count=typeof r=="string"&&Array.isArray(u[r])?u[r].length:z(u)}return typeof u.returned_count=="number"&&(u.returned_count=z(u)),u.applied_bound={kind:"output_limit",source:"explicit",value:e},u}function le(t){return b.filter(e=>t[e]!==void 0&&t[e]?.source!=="default"||t.canonical_options_used.includes(C[e]))}function j(t,e,n,o){let u=Y(t,e,o);k(t,u);for(let i=0;i<8;i+=1){const r=n.estimated_tokens,s=u.read_session.spent_this_call_tokens;T(u,n,o);const d=u;u=Y(u,e,o),k(d,u);const f=u.read_session.spent_this_call_tokens;if(n.estimated_tokens===r&&f===s)return u}return u}function fe(t,e){if(!m(t.read_output))return t;const n=q(e),o=t.read_output,u=P(e.outputSession??e.output_session);return u===void 0?(T(t,o,n),t):j(t,u,o,n)}function ct(t,e){if(t!=="validate")return e;const n=m(e.projection)?e.projection:void 0;if(!(Array.isArray(n?.declared_field_groups)?n.declared_field_groups:[]).some(a=>m(a)&&a.name==="diagnostic_rows"))return e;const u=[...new Set(H(e).map(({path:a})=>a).filter(a=>/^checks\.\d+\.details\./u.test(a)))],i=u.filter(a=>!u.some(p=>p!==a&&a.startsWith(`${p}.`)));if(i.length===0)return e;const r=m(e.row_contract)?e.row_contract:{},s=Array.isArray(r.row_keys)?r.row_keys.filter(a=>typeof a=="string"):[],d=Array.isArray(r.continuation_row_keys)?r.continuation_row_keys.filter(a=>typeof a=="string"):[],f=s.length>0?s:i,l=[...new Set(i)];return JSON.stringify(f)===JSON.stringify(s)&&JSON.stringify(l)===JSON.stringify(d)?e:{...e,row_contract:{...r,row_keys:f,continuation_row_keys:l,jq_selector:typeof r.jq_selector=="string"?r.jq_selector:".checks[].details"}}}function pe(t,e){return t.include?.source==="canonical"&&!B(e)}function dt(t,e){let n={...t};return pe(e,t)&&(n=ce(e.command,n,e.include.value)),e.command==="assurance"?Lt(n):n}function _e(t,e){const n=V(e)?.continuationBinding;if(n===void 0)return;const o=dt(ct(t.command,n),t);return new Map(v(o).filter(u=>!x(t.command,u.path)).map(u=>[u.path,u]))}function me(t,e,n,o,u){let i=dt(t,e);U(i,t);const r=_e(e,u);if(i=Dt(i,e.command,o,r),e.command==="history"&&o){const f=["compact_history","provenance_history","history","diff"];if(i=Object.fromEntries(Object.entries(i).filter(([l])=>!f.includes(l)||l===o.path)),m(i.projection)&&(i.projection={...i.projection,row_key:o.path}),m(i.row_contract)){const l=i.row_contract;i.row_contract={...l,row_keys:[o.path],...Array.isArray(l.continuation_row_keys)?{continuation_row_keys:[o.path]}:{}}}i.count=Object.keys(i[o.path]).length}const s=t.count_only===!0?{...i,count_only:!0,count:t.count}:i,d=Ae(i,t,e.command,o,u,r);return e.amount?.source==="canonical"&&(i=de(i,e.amount.value,e.command,d.collectionsBeforeBudget),d.cursorContinuesExistingPage&>(i,d.originalItems,d.cursorSource,!0,d.originalItemOffset)),U(i,s),mt(i,e.command,d),{projected:n===void 0?i:qt(i,n),continuationState:d}}function ge(t,e){return[...t.cost!==void 0&&t.cost.value!=="unbounded"&&(t.cost.source==="canonical"||t.cost.source==="default"||t.command==="context"&&t.cost.source==="legacy")?[{source:t.cost.source,tokens:t.cost.value}]:[],...e===void 0?[]:[{source:"session",tokens:Vt(e)}]].sort((o,u)=>o.tokens-u.tokens)[0]}function lt(t){const e=t.canonical_options_used;return e&&e.length>0?{canonical_options_used:e}:{}}function ft(t,e){return m(t.context_intent)&&t.context_intent.command==="context"&&t.context_intent.token_budget===e&&t.context_intent.within_budget===!0}function Oe(t,e,n){return t.command!=="next"||(e.tokenBudget??e.token_budget)===void 0?!1:!(m(n.context_intent)&&n.context_intent.command==="next"&&n.context_intent.within_budget===!0)}function pt(t,e={}){return t?.source==="default"||t?.source==="legacy"&&!ft(e,t.tokens)?{budget_source:t.source,budget_tokens:t.tokens}:{}}function he(t,e,n,o,u,i){const r={contract_version:1,command:t.command,requested_dimensions:e,...pt(o),precedence:t.precedence,...lt(t),legacy_aliases_used:[],migration_hints:[],estimated_tokens:0,within_budget:!1,strings_compacted:!1,rows_compacted:!1,result_omitted:!0,...n===void 0?{omitted_result_estimated_tokens:u}:{}},s={output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},read_output:r},d=n===void 0?s:j(s,n,r,i);if(n===void 0&&T(d,r,i),n!==void 0&&r.estimated_tokens>o.tokens)throw new R("The remaining output-session budget cannot fit its mandatory receipts; start a new session with a larger token_budget.",w.USAGE);return d}function ye(t,e,n){return t.command==="context"&&t.cost?.source==="legacy"&&!ft(n,t.cost.value)||Oe(t,e,n)||e.outputRowContract===!0||e.output_row_contract===!0||t.canonical_options_used.includes("--output-include")||t.command==="list"&&t.canonical_options_used.length>0&&t.include?.value.includes("full")===!0}function we(t,e,n,o,u){if(e!==void 0||B(n)||ye(t,u,n))return!1;if(t.amount?.source==="canonical"&&t.amount.value!=="unbounded"){const i=t.amount.value;if(Mt(n).some(({value:r})=>(Array.isArray(r)?r.length:Object.keys(r).length)>i))return!1}return t.cost===void 0||t.cost.value==="unbounded"||t.cost.source==="legacy"&&t.command!=="context"||xt(u.outputRowContract===!1?Object.fromEntries(Object.entries(n).filter(([i])=>i!=="row_contract")):n,o)<=t.cost.value}function _t(t,e,n){const o=Object.hasOwn(S,e)?S[e]:void 0,u=n.find(i=>o?.paths.includes(i.path));o!==void 0&&u!==void 0&&typeof t[o.total_key]!="number"&&(t[o.total_key]=u.total_rows)}function mt(t,e,n){const o=S[e]?.paths[0];o!==void 0&&$t(t,e,n.producer,n.collectionsBeforeBudget.get(o)?.rows)}function Re(t,e,n,o){const u=n.backward?n.rows-o:n.baseOffset+o;return{path:e,cursor:Bt({command:t,path:e,offset:u,total_rows:n.totalRows,fingerprint:n.fingerprint,...n.backward?{direction:"backward"}:{}}),retained_rows:o,remaining_rows:n.backward?u:n.totalRows-u,total_rows:n.totalRows}}function be(t,e,n,o,u,i,r){if(!n.rows_compacted)return;const s=e.amount?.value==="unbounded"?["amount"]:[],d=new Map(v(t).map(_=>[_.path,Array.isArray(_.value)?_.value.length:Object.keys(_.value).length])),f=[...r.entries()].flatMap(([_,O])=>{const h=d.get(_);return h>=O.rows?[]:[Re(e.command,_,O,h)]}),l=f[0];_t(t,e.command,f);const a=l?"; page --output-cursor":"",p=o.source==="session"?`Truncated by the remaining ${o.tokens}-token session budget; start a new output session with a larger token_budget${a}.`:`${o.tokens}-token: raise --output-budget${a}`;n.migration_hints=[p,...e.migration_hints];const c=vt({effective_budget_tokens:o.tokens,measured_result_tokens:i});l&&!u&&(typeof t.next_cursor!="string"||t.continuation_kind==="output_cursor")&&(t.next_cursor=l.cursor),t.continuation_kind=u?"producer_cursor":l?"output_cursor":"none",t.output_budget_truncation={reason:"output_budget_reached",budget_source:o.source,budget_tokens:o.tokens,overridden_dimensions:s,compacted_row_paths:n.compacted_row_paths,continuation_cursor_rebased:u,continuation_available:f.length>0,recovery_budget_multiplier:l?1:c.recovery_budget_multiplier,continuations:f,restore_with:l?"recovery":`Retry with --output-budget ${c.output_budget} because no declared row collection can be continued.`,recovery:l?{cursor:l.cursor,cli:"--output-cursor",sdk:"outputCursor",mcp:"outputCursor"}:{cli:`--output-budget ${c.output_budget}`,sdk:{outputBudget:c.output_budget},mcp:{outputBudget:c.output_budget}}}}function gt(t,e,n,o,u){if(typeof n!="string"||!Array.isArray(t.items))return!1;const i=t.items.length,r=e.length;if(i===0||i>=r)return!1;let s;try{s=zt(n)}catch{return!1}const d=s.after_index;if(d===void 0)return!1;const f=e[i-1];if(Object.prototype.toString.call(f)!=="[object Object]")return!1;const l=Reflect.get(f,"id");if(typeof l!="string"||l.length===0)return!1;const a=o?d-(r-i):d+u+i;return a<0?!1:(t.next_cursor=Kt(s.fingerprint,l,a,s.snapshot),!0)}function Ot(t){return Array.isArray(t)?t.length:Object.keys(t).length}function Ae(t,e,n,o,u,i){const r=new Map(v(t).map(f=>{const l=Ot(f.value),a=o?.path===f.path,p=x(n,f.path),c=i?.get(f.path)??f;let _;return[f.path,{rows:l,totalRows:a?o.total_rows:Ot(c.value),baseOffset:a&&!p?o.offset:0,backward:p,get fingerprint(){return _??=a?o.fingerprint:Gt(f.path,c.value,n),_}}]})),s=typeof t.next_cursor=="string",d=o?.path==="items"?o.offset:0;return{collectionsBeforeBudget:r,originalItems:Array.isArray(e.items)?d>0?e.items.slice(d):e.items:[],originalItemOffset:d,cursorContinuesExistingPage:s,cursorSource:s?t.next_cursor:u.after,producer:e}}function Ce(t,e,n,o,u,i,r,s,d,f){const l={...e,count_only:n},a=o.command==="assurance"&&Array.isArray(t.assertions)?t.assertions.filter(c=>m(c)&&c.verdict!=="pass").length:0,p=new Map;if(a>0&&p.set("assertions",a),o.command==="history"&&Array.isArray(t.diff))for(const c of H(t))c.path.startsWith("diff.")&&p.set(c.path,Object.keys(c.value).length);return St(t,u,i.tokens,p,f,c=>{U(c,l),mt(c,o.command,s);const _=gt(c,s.originalItems,s.cursorSource,s.cursorContinuesExistingPage,s.originalItemOffset);if(be(c,o,u,i,_,d,s.collectionsBeforeBudget),o.command==="history"&&m(c.projection)){c.has_more=typeof c.next_cursor=="string"||c.applied_bound?.kind==="output_limit";const O=c.projection.row_key;typeof O=="string"&&Array.isArray(c[O])&&(c.count=c[O].length)}r!==void 0&&Object.assign(c,j(c,r,u,f))},o.command==="history"&&Array.isArray(t.diff),c=>x(o.command,c),o.command)}function Xe(t,e,n){const o=rt(t,e);if(!o)return n;const u=q(e),i=P(e.outputSession??e.output_session),r=e.outputCursor??e.output_cursor,s=typeof r=="string"?Ft(r):void 0,d=le(o),f=ct(o.command,n);if(s===void 0&&we(o,i,f,u,e))return f;const l=ge(o,i),a=me(f,o,i,s,e);let p=a.projected;k(p,p,e.outputRowContract===!1);const c=B(p),_={contract_version:1,command:o.command,requested_dimensions:d,...pt(l,p),precedence:o.precedence,...lt(o),legacy_aliases_used:o.legacy_aliases_used,migration_hints:o.migration_hints,estimated_tokens:0,within_budget:!c,strings_compacted:!1,rows_compacted:!1,result_omitted:c};p.read_output=_;const O=V(e)?.mirrorEstimate;if(O!==void 0&&jt(_,O),p=i===void 0?p:j(p,i,_,u),T(p,_,u),l!==void 0&&_.estimated_tokens>l.tokens){const h=It(o.command,e,p);h!==void 0&&(_.applied_depth="brief",_.degradation_reason="output_budget_reached",k(p,h),p=fe(h,e)),_.estimated_tokens>l.tokens&&(p=Ce(p,p,f.count_only===!0,o,_,l,i,a.continuationState,_.estimated_tokens,u))}return l!==void 0&&_.estimated_tokens>l.tokens?he(o,d,i,l,_.estimated_tokens,u):p}function Ee(t){return m(t)&&m(t.context_intent)&&t.context_intent.result_omitted===!0}function B(t){return ke(t)||Ee(t)}function ke(t){return m(t)&&m(t.output_budget_exceeded)&&t.output_budget_exceeded.omitted_result===!0&&t.output_budget_exceeded.reason==="requested_budget_infeasible"}function Qe(t,e){const n=e.outputFormat??e.output_format;if(n==="json"||n==="toon")return n;const o=rt(t,e)?.encoding;return o?.value==="json"||o?.value==="toon"?o.value:void 0}export{Ve as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,rn as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,b as PM_READ_OUTPUT_DIMENSIONS,qe as PM_READ_OUTPUT_OPTION_FLAGS,fn as PM_READ_OUTPUT_SURFACES,Yt as PM_READ_OUTPUT_SURFACE_CONTRACTS,cn as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,Ke as READ_OUTPUT_MUTATION_CONFLICT_CODE,He as READ_OUTPUT_SHAPING_CONTROL_FLAGS,ze as READ_OUTPUT_SURFACE_UNSUPPORTED_CODE,Ye as annotationPositionalMutationOptions,Xe as applyReadOutputDimensions,ee as applyReadOutputIncludeModes,on as decodeReadOutputContinuationCursor,un as encodeReadOutputContinuationCursor,ke as isReadOutputBudgetExceeded,B as isReadResultOmittedForBudget,Je as normalizeReadOutputIncludeModeOptions,sn as readOutputCollectionFingerprint,tt as readOutputIncludeModeOptions,dn as readOutputRetainsTail,rt as resolveReadOutputDimensions,Qe as resolveReadOutputEncoding,en as resolveReadOutputRecoveryBudget,I as resolveReadOutputSurface,fe as stabilizeReadOutputReceiptEstimates,We as validateReadOutputOptions};
|
|
2
2
|
//# sourceMappingURL=read-output-contracts.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Whether a stored custom field flag or alias is exactly one option
|
|
3
|
+
* spelling (pm-8patuh). Dependency-free, because CLI registration consults it
|
|
4
|
+
* on every invocation that registers runtime field options.
|
|
5
|
+
*/
|
|
6
|
+
/** A stored token with exactly one leading dash is a short flag (`-x`); stored long flags carry no dashes. */
|
|
7
|
+
export declare function isShortFieldFlagSpelling(token:string):boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Why a stored flag or alias token is not exactly one option spelling, or
|
|
10
|
+
* `undefined` when it is. Tokens are stored without their leading `--`; a
|
|
11
|
+
* token with one leading dash registers as a short flag, which the parser
|
|
12
|
+
* accepts only as one dash and one character. A token the parser would split
|
|
13
|
+
* (`full|detail`) registers a second option or fails the command before it
|
|
14
|
+
* starts.
|
|
15
|
+
*/
|
|
16
|
+
export declare function describeFieldFlagSpellingDefect(token:string):string|undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the CLI registers a stored field flag or alias as an option: it is
|
|
19
|
+
* one option spelling and not the implicit help option. Registration and
|
|
20
|
+
* recovery routes share this, so a retry never names a skipped spelling.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isRegistrableFieldFlagSpelling(token:string):boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function a(n){const e=n.trim();return e.startsWith("-")&&!e.startsWith("--")}const r=/[\s|,=<>[\]]/u;function i(n){const e=n.trim();if(a(e))return e.length===2&&!r.test(e[1])?void 0:"is not a short flag: a short flag is one dash and one character";const s=e.replace(/^--/u,"");if(s.length===0)return"is empty";if(s.startsWith("-"))return"starts with three dashes";if(s.endsWith("-")||s.includes("--"))return"has an empty segment between hyphens, which the option parser cannot turn into an option key";const t=r.exec(s)?.[0];if(t!==void 0)return/\s/u.test(t)?"contains whitespace, which the option parser reads as a break between two flags":`contains ${JSON.stringify(t)}, which the option parser reads as ${t==="|"||t===","?"a break between two flags":t==="="?"the start of an attached value":"a value placeholder"}`}const o=new Set(["-h","help"]);function h(n){const e=n.trim();return i(e)===void 0&&!o.has(e.replace(/^--/u,""))}export{i as describeFieldFlagSpellingDefect,h as isRegistrableFieldFlagSpelling,a as isShortFieldFlagSpelling};
|
|
2
|
+
//# sourceMappingURL=field-flag-spelling.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{GLOBAL_FLAG_CONTRACTS as
|
|
1
|
+
import{GLOBAL_FLAG_CONTRACTS as y,resolveSubcommandFlagContractsForCommand as k}from"../cli-contracts/flag-contracts.js";import{BUILTIN_FIELD_KEYS as w}from"../../core/schema/fields-file.js";import{EXIT_CODE as d,ITEM_METADATA_KEY_ORDER as A}from"../../core/shared/constants.js";import{PmCliError as m}from"../../core/shared/errors.js";import{commanderOptionAttribute as F,resolveCandidateOptionKeys as C}from"../../core/schema/runtime-field-values.js";import{normalizeCliToken as S,resolveRuntimeFieldRegistry as p}from"../../core/schema/runtime-schema.js";import{describeFieldFlagSpellingDefect as v,isShortFieldFlagSpelling as s}from"./field-flag-spelling.js";function g(e){return e.trim().toLowerCase().replace(/^-+/u,"")}function _(e){const o=g(e),i=C({key:o,cli_flag:o,cli_aliases:[]});return[...new Set([...i,F(o)])]}const E=new Set(A.filter(e=>!w.has(e))),O={flag:"--help",short:"-h"},h=new Map;function x(e){let o=h.get(e);if(o===void 0){const i=new Map,n=new Map;for(const l of[...k(e),...y,O]){for(const a of[l.flag,...l.aliases??[]].flatMap(_))i.has(a)||i.set(a,l.flag);l.short!==void 0&&!n.has(l.short)&&n.set(l.short,l.flag)}o={long:i,short:n},h.set(e,o)}return o}function $(e,o){return s(e)?o.short.get(e.trim()):_(e).map(i=>o.long.get(i)).find(i=>i!==void 0)}function r(e){const o=[];for(const i of e){const n=[...new Set([i.cli_flag,...i.cli_aliases,i.key].map(l=>s(l)?l.trim():g(l)))];for(const l of i.commands)o.push(...b(i.key,n,l.replaceAll("_","-")))}return o.sort((i,n)=>i.field.localeCompare(n.field)||i.command.localeCompare(n.command)||i.option.localeCompare(n.option))}function b(e,o,i){const n=x(i),l=new Map;for(const a of o){if(E.has(e)&&a.replaceAll("-","_")===e)continue;const t=$(a,n);t===void 0||l.has(t)||l.set(t,{field:e,command:i,field_flag:s(a)?a:`--${a.replaceAll("_","-")}`,option:t})}return[...l.values()]}function T(e){return r([{key:e.key,cli_flag:e.cliFlag??e.key.replaceAll("_","-"),cli_aliases:e.cliAliases,commands:e.commands}])}function c(e){return e.flatMap(o=>[...new Set([o.cli_flag,...o.cli_aliases])].flatMap(i=>{const n=v(i);return n===void 0?[]:[{field:o.key,spelling:i,reason:n}]}))}function D(e){return c([{key:e.key,cli_flag:e.cliFlag??e.key.replaceAll("_","-"),cli_aliases:e.cliAliases}])}function I(e){return`${JSON.stringify(e.spelling)} ${e.reason}`}function M(e){return`${e.field_flag} shadows built-in ${e.option} on pm ${e.command}`}function U(e,o){const i=p(e).definitions,n=r(i),l=c(i),a=l.length===0?{details:{},warnings:[]}:{details:{schema_field_flag_invalid_count:l.length,schema_field_flag_invalid:l.slice(0,o),schema_field_flag_invalid_truncated:l.length>o,schema_field_flag_invalid_fix_hint:"Re-register the field with one flag and one spelling per alias: pm schema add-field <key> --cli-flag <flag> --alias <alias>. A short alias is one dash and one character. Edit a field defined inline in settings.json there."},warnings:[`validate_schema_field_flag_invalid:${l.length}`]};return n.length===0?a:{details:{...a.details,schema_field_option_collision_count:n.length,schema_field_option_collisions:n.slice(0,o),schema_field_option_collisions_truncated:n.length>o,schema_field_option_collision_fix_hint:"Rename a file-backed field without losing item values: pm schema rename-field <key> --to <new-key>. For a colliding flag, alias or command list, re-register the same key: pm schema add-field <key> --cli-flag <flag> --commands <commands>. Edit a field defined inline in settings.json there."},warnings:[...a.warnings,`validate_schema_field_option_collision:${n.length}`]}}function Y(e){f(e.key,D(e)),u(e.key,e.commands,T(e))}function q(e){const o=[e.cli_flag,...Array.isArray(e.cli_aliases)?e.cli_aliases:[]].filter(n=>typeof n=="string");f(e.key,o.filter(n=>S(n).length===0).map(n=>({field:e.key,spelling:n,reason:"is empty"})));const i=p({fields:[e]}).definitions;f(e.key,c(i)),u(e.key,i.flatMap(n=>n.commands),r(i))}function f(e,o){if(o.length!==0)throw new m(`Cannot define custom field "${e}": flag ${o.map(I).join("; ")}. The command it is registered for could not register it as one option.`,d.USAGE,{code:"schema_field_flag_invalid",field:e,flag:o[0].spelling,required:"Each custom field flag and alias must be one option spelling: a long name without spaces, pipes, commas, '=' or brackets, or a short flag of one dash and one character.",nextSteps:[`Pass one spelling per --alias, for example pm schema add-field ${e} --alias <first> --alias <second>.`]})}function u(e,o,i){if(i.length===0)return;const n={key:e,commands:o},l=new Set(i.map(t=>t.command)),a=n.commands.filter(t=>!l.has(t.replaceAll("_","-")));throw new m(`Cannot define custom field "${n.key}": ${i.map(M).join("; ")}. The built-in option would stop working for that command.`,d.USAGE,{code:"schema_field_option_collision",field:n.key,flag:i[0].option,required:"A custom field's key, flag and aliases must differ from every built-in option of each command it is registered for.",nextSteps:[`Rename the field with a project-specific prefix, for example pm schema add-field project_${n.key}.`,...a.length>0?[`Or register "${n.key}" only where its option is free: --commands ${a.join(",")}.`]:[]]})}export{q as assertFieldDefinitionOptionsAvailable,Y as assertFieldOptionsAvailable,I as describeFieldFlagSpellingDefectLine,M as describeFieldOptionCollision,D as resolveAddFieldFlagSpellingDefects,T as resolveAddFieldOptionCollisions,c as resolveFieldFlagSpellingDefects,r as resolveFieldOptionCollisions,U as scanFieldOptionCollisions};
|
|
2
2
|
//# sourceMappingURL=field-option-collisions.js.map
|
package/docs/COMMANDS.md
CHANGED
|
@@ -1688,7 +1688,7 @@ pm create Spike "Investigate retry backoff"
|
|
|
1688
1688
|
- `add-status <id>` writes a custom lifecycle status (idempotent UPSERT keyed on the normalized id; re-adding sets `replaced: true`). Roles are validated against the runtime status roles: `draft`, `active`, `blocked`, `terminal`, `terminal_done`, `terminal_canceled`, `default_open`, `default_close`, `default_cancel`.
|
|
1689
1689
|
- `remove-status <id>` removes a custom status. The six built-in statuses (`open`, `in_progress`, `blocked`, `closed`, `canceled`, `draft`) are refused. It WARNS (non-blocking) with `items_using_status:<N>` when items currently use that status.
|
|
1690
1690
|
- Built-in types (Chore, Decision, Epic, Event, Feature, Issue, Meeting, Milestone, Plan, Reminder, Task) are reserved and cannot be redefined or removed.
|
|
1691
|
-
- `add-field <key>` registers a custom metadata field in `.agents/pm/schema/fields.json` (shape: `{ "fields": [RuntimeFieldDefinition...] }`). Each custom field dynamically registers a CLI flag on create/update (and any other commands you list) so projects can capture typed project-specific metadata without hand-editing JSON. It is an idempotent UPSERT keyed on the normalized key, and refuses keys that shadow a built-in field. It also refuses a field whose key, flag or alias equals a built-in option of a command it is registered for (`schema_field_option_collision`, exit 2): the parser keeps one option per name, so `pm schema add-field full --commands create,list` would make `pm list --full` read as a field filter. Names are compared as the option keys a value is read under, so punctuation counts as a word break (`token.budget` equals `--token-budget`). The refusal names each shadowed option per command and, when some requested commands are free, the narrower `--commands` list. `severity` is the one built-in a field may redefine. `pm profile apply` and `pm schema rename-field` (for the target name, dry run included) refuse the same way, `pm profile lint` reports `field_option_collision`, and `pm validate --check-metadata` reports fields already stored as `validate_schema_field_option_collision:<n>` with rows under `schema_field_option_collisions` ([pm-pta8um](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-pta8um.toon); repository-only tracker record excluded from npm). `list-fields` / `show-field <key>` inspect registered fields; `remove-field <key>` drops one and WARNS (non-blocking) with `items_using_field:<N>` when items still carry a value. See [CONFIGURATION.md](CONFIGURATION.md) for the full `schema/fields.json` format.
|
|
1691
|
+
- `add-field <key>` registers a custom metadata field in `.agents/pm/schema/fields.json` (shape: `{ "fields": [RuntimeFieldDefinition...] }`). Each custom field dynamically registers a CLI flag on create/update (and any other commands you list) so projects can capture typed project-specific metadata without hand-editing JSON. It is an idempotent UPSERT keyed on the normalized key, and refuses keys that shadow a built-in field. It also refuses a field whose key, flag or alias equals a built-in option of a command it is registered for (`schema_field_option_collision`, exit 2): the parser keeps one option per name, so `pm schema add-field full --commands create,list` would make `pm list --full` read as a field filter. Names are compared as the option keys a value is read under, so punctuation counts as a word break (`token.budget` equals `--token-budget`). The refusal names each shadowed option per command and, when some requested commands are free, the narrower `--commands` list. `severity` is the one built-in a field may redefine. `pm profile apply` and `pm schema rename-field` (for the target name, dry run included) refuse the same way, `pm profile lint` reports `field_option_collision`, and `pm validate --check-metadata` reports fields already stored as `validate_schema_field_option_collision:<n>` with rows under `schema_field_option_collisions` ([pm-pta8um](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-pta8um.toon); repository-only tracker record excluded from npm). Each flag and alias must also be one option spelling: a long name without spaces, pipes, commas, `=` or brackets, or a short flag of one dash and one character. A spelling the parser would split (`--alias 'full|deep'` registers a second `--full`) or a malformed short flag (`-xy`) is refused with `schema_field_flag_invalid` (exit 2) by `add-field`, `profile apply` and `rename-field`; `pm profile lint` reports `field_flag_invalid`. A short spelling is compared with the command's own short flags (`-p` is `--priority` on create and update), and `-h`/`--help` are reserved on every command. `pm validate --check-metadata` reports stored spellings as `validate_schema_field_flag_invalid:<n>` with rows under `schema_field_flag_invalid` (a stored definition the registry drops entirely, such as an empty flag, is not reported yet: [pm-x9r2h3](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-x9r2h3.toon), repository tracker record excluded from npm), and the CLI skips such a spelling when it registers field options, so a stored definition can no longer stop a command from starting or take over help; an SDK caller checks one spelling with `describeFieldFlagSpellingDefect` from `@unbrained/pm-cli/sdk`, which returns the reason or `undefined` ([pm-8patuh](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-8patuh.toon); repository tracker record, excluded from npm). `list-fields` / `show-field <key>` inspect registered fields; `remove-field <key>` drops one and WARNS (non-blocking) with `items_using_field:<N>` when items still carry a value. See [CONFIGURATION.md](CONFIGURATION.md) for the full `schema/fields.json` format.
|
|
1692
1692
|
- `apply-preset <agile|ops|research>` batch-registers a domain type preset into an already-initialized project (the same vocabulary `pm init --type-preset` seeds); it is idempotent (re-running reports `replaced` entries) and shares its definitions with init.
|
|
1693
1693
|
- `add-type --infer` scans existing item titles for stable `PREFIX-`/`PREFIX:` conventions and proposes them as custom types. It previews candidates by default (dry-run); pass `--apply` to register the non-shadowing candidates and `--min-count <n>` to tune the per-prefix threshold (default 10). Candidates whose name resolves to a built-in type are reported and skipped.
|
|
1694
1694
|
- `rename-type`, `rename-field`, and `remap-status` are lossless migration verbs. The runtime derives a deterministic workspace-and-request-bound migration id for resumable retries; `--migration-id` remains an optional authoritative override for external orchestration. Start with `--dry-run --json` to inspect the derived id, fingerprint, affected count, and ordered per-item changes without persisting a plan. Execution stages the target definition, writes immutable history on every affected item and the workspace stream, then retires the source. A field rename refuses any item that already has the target key; `--type <Type>` optionally restricts a field rename.
|
package/docs/EXTENSIONS.md
CHANGED
|
@@ -306,7 +306,7 @@ Use the public SDK barrel. Do not deep-import from `src/core` or `dist/core`.
|
|
|
306
306
|
- `api.extension` is a read-only identity (`name`, `layer`, `version`, `capabilities`, `pm_min_version?`, `pm_max_version?`, `source_package?`) for self-identifying logs and version gating without re-reading the manifest.
|
|
307
307
|
- `api.registerCommand(definition)` adds package-owned commands; `read_output` opts readers into the [SDK output contract](SDK.md#minimal-command-extension).
|
|
308
308
|
- `api.registerFlags(command, flags)` adds runtime command flags. A flag may declare `value_type` (canonical; the legacy `type` alias is honored only when `value_type` is absent), `list: true` to accumulate repeated/comma-joined values like core `--tags`, a `default` applied when the flag is omitted, and `value_validation: "strict"` to refuse malformed `number`/`boolean` tokens before the handler runs (the default `"coerce"` forwards the raw token). The handler reads each flag from `context.options` under its camel-case handler key (`--status-filter` → `statusFilter`), published as `sdk_option` by `pm contracts --command <command> --flags-only --json`; CLI, `PmClient.run`, MCP, and `runRegisteredCommandForTest` all deliver that key with the same defaults and coercion, and host flags such as `--json`, `--author`, and `--pm-path` arrive in `context.global` and are listed as `inherited_flags`. On the CLI, a command that declares flags refuses any other option with `unknown_option` before the handler runs (a command that declares none still receives undeclared options for now, see pm-4of199 in the SDK guide), and two spellings of one flag with different values (`--status-filter open -s closed`) are refused with `extension_option_spelling_conflict`, so declare every option a handler reads. See [Handler keys and ownership](SDK.md#handler-keys-and-ownership).
|
|
309
|
-
- `api.registerItemFields(fields)` adds custom metadata fields. Agents can set declared fields with repeatable `pm create --field name=value` and `pm update <id> --field name=value`; undeclared names are rejected. Extension declarations are matched first; a name that no active extension declares but the project schema does (for example `gate_evidence`) is refused with `project_schema_field_requires_declared_flag`, which names a CLI flag and an SDK option that each set only that field (each is omitted when every spelling is shared with another declared field or with an option of the command itself) and, on the CLI, an executable `suggested_retry_args` that rewrites only that assignment. The guidance follows the invoking scope (a bulk `update-many` row is routed under `update_many`, not `update`), and when the same invocation already sets that field through a declared flag, alias or option, no route or retry is offered, because the retry would carry two values for one field ([pm-wftvem](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-wftvem.toon); tracker record excluded from npm); reserved core keys keep `core_item_field_requires_dedicated_flag`. `SchemaFieldDefinition.type` is the same closed union used by `pm schema add-field`: `string | number | boolean | string_array | array | object`. Unsupported values fail at compile time for TypeScript authors and at activation for JavaScript packages, with a did-you-mean hint on typos. `string_array` is the repeatable string collection; `array` and `object` require JSON containers. Active fields support `get`, `list` and `search` projections with `--fields name` or `--fields item.name`, preserving declared value types through `PmClient` and CLI reads. Disabled packages do not contribute selectors. Tracked by [pm-gh1571](../.agents/pm/issues/pm-gh1571.toon).
|
|
309
|
+
- `api.registerItemFields(fields)` adds custom metadata fields. Agents can set declared fields with repeatable `pm create --field name=value` and `pm update <id> --field name=value`; undeclared names are rejected. Extension declarations are matched first; a name that no active extension declares but the project schema does (for example `gate_evidence`) is refused with `project_schema_field_requires_declared_flag`, which names a CLI flag and an SDK option that each set only that field (each is omitted when every spelling is shared with another declared field or with an option of the command itself) and, on the CLI, an executable `suggested_retry_args` that rewrites only that assignment. The guidance follows the invoking scope (a bulk `update-many` row is routed under `update_many`, not `update`), and when the same invocation already sets that field through a declared flag, alias or option, no route or retry is offered, because the retry would carry two values for one field ([pm-wftvem](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-wftvem.toon); tracker record excluded from npm); reserved core keys keep `core_item_field_requires_dedicated_flag`. `SchemaFieldDefinition.type` is the same closed union used by `pm schema add-field`: `string | number | boolean | string_array | array | object`. Unsupported values fail at compile time for TypeScript authors and at activation for JavaScript packages, with a did-you-mean hint on typos. `string_array` is the repeatable string collection; `array` and `object` require JSON containers. Active fields support `get`, `list` and `search` projections with `--fields name` or `--fields item.name`, preserving declared value types through `PmClient` and CLI reads. Disabled packages do not contribute selectors. Tracked by [pm-gh1571](../.agents/pm/issues/pm-gh1571.toon). Item fields an extension registers are set through the repeatable `--field name=value` assignment, not through a per-field option, so a name such as `full` or `limit` leaves `pm list --full`, `pm list --limit` and `pm search --full` working as before; the built-in option collision check that `pm schema add-field` applies does not apply to them. Such a name still meets the projection-mode vocabulary of `--output-include` (`full` there selects the full projection), so select it with `--fields <name>` ([pm-3s4jwl](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-3s4jwl.toon); tracker record excluded from npm).
|
|
310
310
|
- Custom fields whose camel-case option name is already owned by a canonical MCP input remain usable through `options.<name>`, but authoring surfaces report the collision instead of allowing silent top-level shadowing. `pm schema add-field`, `pm profile lint`, and `pm package doctor` name the field, canonical `mcp_tool_input` owner, and nested recovery path. SDK authors can preflight the same rule with `resolvePmToolCustomFieldCollision`. A separate, stricter rule covers CLI options: a field whose key, flag or alias equals a built-in option of a command it is registered for is refused by `pm schema add-field` and `pm profile apply` with `schema_field_option_collision`, because the built-in option would stop working there; give profile fields a project-specific prefix or list only commands where the name is free.
|
|
311
311
|
- `api.registerItemTypes(types)` adds custom item types.
|
|
312
312
|
- `api.registerRelationshipKinds(definitions)` adds validated graph semantics. Definitions declare direction, inverse spelling, ordering/precedence, hierarchy, cardinality, lifecycle, aliases, payload schema, compatibility version, and self-edge policy. Active definitions govern CLI, MCP, and SDK dependency mutation admission as well as workspace graph assembly; mutation aliases are stored canonically. Requires the `schema` capability and is governed by the `schema.relationshipkinds` policy surface. See [relationship mutation admission](RELATIONSHIP_GRAPH.md#contract), tracked by [pm-7dsolo](../.agents/pm/issues/pm-7dsolo.toon).
|
|
@@ -362,6 +362,8 @@ String compaction shortens an explanatory string longer than 240 UTF-16 code uni
|
|
|
362
362
|
|
|
363
363
|
When rows are dropped to satisfy a ceiling, the result also carries `output_budget_truncation`, naming the binding budget and its source, any explicitly requested dimension the budget overrode, every compacted collection path, and executable CLI/SDK/MCP recovery options — a default ceiling can override an explicit `--output-limit unbounded`, and that override is reported rather than silent. If a producer supplied an opaque item-page cursor, compaction rebases it to the last row actually returned and reports `continuation_cursor_rebased: true`; following the cursor therefore cannot skip rows removed from the middle of a producer page. If no useful content can fit, `PmReadOutputBudgetExceeded` provides a discriminated omission result, a compact `{ outputBudget: "unbounded" }` recovery object, and `omitted_result_estimated_tokens`, the last useful-result estimate before omission; use `isReadOutputBudgetExceeded` before accessing result-specific fields. The encoding control `--output-format <toon|json>` also applies to mutation envelopes, including the mutation modes of `comments`, `notes`, `files`, and `docs`. Other universal read controls remain rejected before mutation execution. `--json` remains supported.
|
|
364
364
|
|
|
365
|
+
A command that is not a read surface refuses every universal output control that shapes a read (`--output-include`, `--output-limit`, `--output-budget`, `--output-session`, `--output-cursor`, `--output-row-contract`) with `read_output_surface_unsupported` (exit 2) before it runs; a renderer-only `--output-format toon|json` stays accepted: "Universal output controls apply only to read commands; <command> is not a read surface." `details.output_option_keys` names the control keys the caller supplied. An extension command is a read surface only when it declares `read_output`. The CLI, `PmClient.run` and the extension test harness apply the same check, and `READ_OUTPUT_SURFACE_UNSUPPORTED_CODE` is exported ([pm-gh1769](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1769.toon); tracker record excluded from npm).
|
|
366
|
+
|
|
365
367
|
That rejection is typed ([pm-rrwh2o](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-rrwh2o.toon); tracker record excluded from npm). A `comments`, `notes`, `learnings`, `files`, `docs` or package-catalog mutation given `--output-include`, `--output-limit`, `--output-budget`, `--output-session`, `--output-cursor` or `--output-row-contract` exits 2 with `read_output_mutation_conflict` before anything is written. `details.output_controls` names the offending flags, `details.output_option_keys` names the option keys the SDK or MCP caller supplied, and `details.mutation_options` names the mutation that made the call a write. The CLI recovery's `suggested_retry_args` is the caller's own invocation without those controls and their values; tracker scope, operands and every other option stay where they were. The CLI withholds `suggested_retry_args` when it cannot rebuild the invocation safely: an option whose value arity is undeclared, a control that took a flag-like token as its value, a control right after a value-taking option, a tracker selection that cannot be bound, an enclosing SDK revision scope whose guards never reached argv, or a token that may carry URL credentials, meaning any token with both an `@` and a `:` (a package source such as `https://user:token@host/pkg.tgz`), so the recovery never repeats a secret in another field. That check is deliberately conservative: a scoped package name beside a colon also gets no retry. The refusal then still names the controls, and the caller rebuilds the retry from its own arguments. SDK and MCP callers drop the named keys. To bound or page the collection, read it with the controls in a separate call after the write. `READ_OUTPUT_MUTATION_CONFLICT_CODE` and `READ_OUTPUT_SHAPING_CONTROL_FLAGS` are exported for package authors.
|
|
366
368
|
|
|
367
369
|
Cursor recovery carries the opaque value once in `recovery.cursor` and declares
|
package/docs/SDK.md
CHANGED
|
@@ -3145,6 +3145,19 @@ mutation-receipt projection, command-result overrides, suppressed host
|
|
|
3145
3145
|
output, `output_format` services and encoding resolution apply as they do
|
|
3146
3146
|
natively, so a package test fails exactly where the native CLI would
|
|
3147
3147
|
([pm-gh1729](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1729.toon),
|
|
3148
|
+
tracker record excluded from npm). Before the handler runs, and before
|
|
3149
|
+
extension flags are normalized as native dispatch orders it, the harness also
|
|
3150
|
+
applies the native admission of universal output controls, read from
|
|
3151
|
+
`global` and from `options`, in any spelling a caller uses for a declared or
|
|
3152
|
+
host key: a command without `read_output` given a control that shapes a read
|
|
3153
|
+
is refused with `read_output_surface_unsupported` (exit 2, the native
|
|
3154
|
+
message) while a renderer-only `outputFormat` stays accepted, a malformed
|
|
3155
|
+
value such as `outputFormat: "yaml"` is refused, and a
|
|
3156
|
+
native hybrid surface an extension extends refuses a mutation combined with
|
|
3157
|
+
them as `read_output_mutation_conflict`, positional annotation text
|
|
3158
|
+
(`args: ["pm-x", "text"]` on `comments`, `notes` or `learnings`) included. A registry built by hand instead of
|
|
3159
|
+
through `activateExtensionForTest` carries no declarations and is not checked
|
|
3160
|
+
([pm-gh1769](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-gh1769.toon),
|
|
3148
3161
|
tracker record excluded from npm). Avoid
|
|
3149
3162
|
reserved metadata and prototype property names. The declaration promises a
|
|
3150
3163
|
read-only handler; writers and undeclared commands keep refusing read controls,
|
|
@@ -3480,7 +3493,13 @@ directly. An
|
|
|
3480
3493
|
extension action also keeps the caller's values as given: the native
|
|
3481
3494
|
`tags`-to-CSV and `dep`-to-array rewrites of core commands do not apply to it.
|
|
3482
3495
|
On the CLI, each bare occurrence of a repeatable boolean switch reaches the
|
|
3483
|
-
handler as `true` (`--many --many` is `[true, true]`)
|
|
3496
|
+
handler as `true` (`--many --many` is `[true, true]`), and bare and attached
|
|
3497
|
+
occurrences keep their argv order: `--many=false --many` is `[false, true]` and
|
|
3498
|
+
`--many --many=false` is `[true, false]`. The order comes from the same argv
|
|
3499
|
+
scan that resolves spelling conflicts, so a token another option consumed as
|
|
3500
|
+
its value (`--from-tracker --many`) is not a switch occurrence
|
|
3501
|
+
([pm-g2zzus](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-g2zzus.toon),
|
|
3502
|
+
tracker record excluded from npm). A direct caller's negated
|
|
3484
3503
|
spelling of a declared boolean (`no-many`, `--no-many`) inverts token by token
|
|
3485
3504
|
and is then judged exactly as the canonical spelling: on a `list` boolean,
|
|
3486
3505
|
`{ "no-many": "true,false" }` is `{ many: [false, true] }`, a blank segment is
|
|
@@ -70,6 +70,17 @@ The host applies the standard settings serializer, including legacy format
|
|
|
70
70
|
coercion and collection-name sanitization, and runs active `onWrite` hooks
|
|
71
71
|
after a changed write.
|
|
72
72
|
|
|
73
|
+
An inline custom field definition the callback adds or changes takes the
|
|
74
|
+
`pm schema add-field` admission before anything is written, dry run included:
|
|
75
|
+
a flag or alias the parser would split is refused with
|
|
76
|
+
`schema_field_flag_invalid`, and an option that shadows a built-in option of a
|
|
77
|
+
command the field is registered for with `schema_field_option_collision`. A
|
|
78
|
+
definition left exactly as stored is not judged again, so an unrelated write
|
|
79
|
+
keeps a legacy definition, which `pm validate --check-metadata` keeps reporting
|
|
80
|
+
unless the registry drops it entirely (pm-x9r2h3 tracks reporting those)
|
|
81
|
+
([pm-3s4jwl](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-3s4jwl.toon);
|
|
82
|
+
tracker record excluded from npm).
|
|
83
|
+
|
|
73
84
|
Request `includePreview: true` to receive an optional `preview` settings tree
|
|
74
85
|
alongside the receipt. The host resolves it from the exact serialized bytes
|
|
75
86
|
inside the audit lock, using the same defaults and governance presets as normal
|
package/marketplace.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.11.
|
|
1
|
+
{"name":"pm","owner":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"description":"Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.","version":"2026.11.24","plugins":[{"name":"pm-claude","source":"./plugins/pm-claude","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 workflow skills with slash invocations, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.","version":"2026.11.24","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"],"category":"productivity"}]}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-beads","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-beads","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for importing Beads JSONL records.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-beads"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","beads"],"pm":{"aliases":["beads"],"extensions":["extensions/beads"],"catalog":{"display_name":"Beads Import","category":"migration","summary":"Import Beads JSONL records into pm while preserving source IDs.","tags":["migration","beads","import"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-calendar","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-calendar","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for calendar and agenda views.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-calendar"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","calendar","agenda"],"pm":{"aliases":["calendar"],"extensions":["extensions/calendar"],"catalog":{"display_name":"Calendar Views","category":"workflow","summary":"Show agenda, day, week, and month views for deadlines, reminders, and scheduled events.","tags":["calendar","agenda","workflow"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-command-kit","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-command-kit","version":"2026.11.24","private":true,"type":"module","description":"First-party pm exemplar package for the commands capability: registerCommand, registerFlags, and registerParser.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-command-kit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","commands","exemplar"],"pm":{"aliases":["command-kit"],"extensions":["extensions/command-kit"],"catalog":{"display_name":"Command Kit Exemplar","category":"sdk","summary":"Copy-paste-able exemplar for registerCommand, registerFlags, and registerParser.","tags":["sdk","commands","parser","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-command-kit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-digital-twin","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-digital-twin","version":"2026.11.24","private":true,"type":"module","description":"Beyond-PM exemplar: a temporal production-facility digital twin built entirely on public pm SDK and extension primitives.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-digital-twin"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","sdk","digital-twin","event-sourcing","temporal-graph","exemplar"],"pm":{"aliases":["digital-twin","twin"],"extensions":["extensions/digital-twin"],"catalog":{"display_name":"Digital Twin SDK Exemplar","category":"sdk","summary":"Temporal facility graph proving event replay, point-in-time state, invariants, federation, checkpoints, and compact exports through public SDK contracts.","tags":["sdk","digital-twin","event-sourcing","graph","offline-first","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin","report":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-digital-twin/GAP_REPORT.md"}},"docs":["README.md","GAP_REPORT.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-governance-audit","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-governance-audit","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for governance audit and normalization workflows.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-governance-audit"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","governance","audit","normalize","hooks"],"pm":{"aliases":["governance-audit","audit"],"extensions":["extensions/governance-audit"],"catalog":{"display_name":"Governance Audit","category":"governance","summary":"Run dedupe audits, comments audits, and normalize sweeps as package-owned workflows.","tags":["governance","audit","normalize","hooks"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-governance-audit","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-guide-shell","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-guide-shell","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for guide and shell completion workflows.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-guide-shell"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","guide","completion","shell"],"pm":{"aliases":["guide-shell"],"extensions":["extensions/guide-shell"],"catalog":{"display_name":"Guide + Shell UX","category":"workflow","summary":"Restore guide documentation and shell completion commands as package-owned UX surfaces.","tags":["guide","completion","shell"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-guide-shell","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-kanban","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-kanban","version":"2026.11.24","private":true,"type":"module","description":"First-party pm archetype package: a complete Kanban continuous-flow profile built on public SDK primitives.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-kanban"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","sdk","profile","archetype","kanban","exemplar"],"pm":{"aliases":["kanban"],"extensions":["extensions/kanban"],"catalog":{"display_name":"Kanban Archetype","category":"sdk","summary":"Installable Kanban continuous-flow archetype: Card item type, flow fields, and a ProjectProfileDefinition built on public SDK primitives.","tags":["sdk","profile","archetype","kanban","schema","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-kanban","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-lifecycle-hooks","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-lifecycle-hooks","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package demonstrating safe lifecycle hook registration.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-lifecycle-hooks"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","hooks","lifecycle","sdk"],"pm":{"aliases":["lifecycle-hooks"],"extensions":["extensions/lifecycle-hooks"],"catalog":{"display_name":"Lifecycle Hooks","category":"sdk","summary":"Default-inert lifecycle hook exemplar for package authors.","tags":["hooks","lifecycle","sdk"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-lifecycle-hooks","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-linked-test-adapters","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-linked-test-adapters","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for optional linked-test run management adapters and reporters.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-linked-test-adapters"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","linked-tests","background-runs","test-runs"],"pm":{"aliases":["linked-test-adapters"],"extensions":["extensions/linked-test-adapters"],"catalog":{"display_name":"Linked Test Adapters","category":"testing","summary":"Restore optional linked-test run management/reporting command surfaces.","tags":["tests","linked-tests","background","reporting"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-linked-test-adapters","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-search-advanced","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-search-advanced","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for semantic, hybrid, and reindex search workflows.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-search-advanced#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-search-advanced"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","search","reindex","semantic","hybrid"],"pm":{"aliases":["search-advanced"],"extensions":["extensions/search-advanced"],"catalog":{"display_name":"Advanced Search","category":"search","summary":"Enable semantic/hybrid search modes and reindex workflows.","tags":["search","semantic","hybrid","reindex"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-search-advanced#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-search-advanced","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-templates","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-templates","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for reusable create templates.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-templates#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-templates"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","templates"],"pm":{"aliases":["templates"],"extensions":["extensions/templates"],"catalog":{"display_name":"Create Templates","category":"workflow","summary":"Save, list, show, and apply reusable pm create option templates.","tags":["templates","create","workflow"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-templates#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-templates","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-todos","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-todos","version":"2026.11.24","private":true,"type":"module","description":"First-party pm package for Todo markdown import and export.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-todos#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-todos"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","project-management","todos"],"pm":{"aliases":["todos"],"extensions":["extensions/todos"],"catalog":{"display_name":"Todos Import/Export","category":"migration","summary":"Import and export Todo markdown tasks through pm package commands.","tags":["migration","todos","import","export"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-todos#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-todos","report":"https://github.com/unbraind/pm-cli/issues"}},"docs":["README.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unbrained/pm-vcs-sdk-exemplar","version":"2026.11.
|
|
1
|
+
{"name":"@unbrained/pm-vcs-sdk-exemplar","version":"2026.11.24","private":true,"type":"module","description":"Beyond-PM exemplar: a VCS-style changeset workflow built entirely on public pm SDK and extension primitives.","homepage":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-vcs#readme","repository":{"type":"git","url":"git+https://github.com/unbraind/pm-cli.git","directory":"packages/pm-vcs"},"bugs":{"url":"https://github.com/unbraind/pm-cli/issues"},"keywords":["pm-package","sdk","vcs","event-sourcing","exemplar"],"pm":{"aliases":["vcs-exemplar"],"extensions":["extensions/vcs"],"catalog":{"display_name":"VCS SDK Exemplar","category":"sdk","summary":"Non-PM changeset/ref workflow proving custom schema, domain commands, hooks, history replay, and typed relationship events through public SDK contracts.","tags":["sdk","vcs","event-sourcing","graph","exemplar"],"links":{"docs":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-vcs#readme","repository":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-vcs","report":"https://github.com/unbraind/pm-cli/tree/main/packages/pm-vcs/GAP_REPORT.md"}},"docs":["README.md","GAP_REPORT.md"],"examples":["README.md"]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.schemastore.org/claude-code-plugin-manifest.json","name":"pm-claude","displayName":"pm CLI","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 skills with slash invocations, 4 subagents (coordinator, delivery-chain, triage, verification), hybrid TUI task tracking (pm as persistent store + Claude Code task panel as live view), session context injection, and full git-based project management without leaving Claude Code.","version":"2026.11.
|
|
1
|
+
{"$schema":"https://json.schemastore.org/claude-code-plugin-manifest.json","name":"pm-claude","displayName":"pm CLI","description":"Native pm CLI integration for Claude Code — 32 MCP tools, 14 skills with slash invocations, 4 subagents (coordinator, delivery-chain, triage, verification), hybrid TUI task tracking (pm as persistent store + Claude Code task panel as live view), session context injection, and full git-based project management without leaving Claude Code.","version":"2026.11.24","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","project-management","mcp","tasks","agents","workflows","git-native","task-tracker","ai"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"pm-claude-runtime","private":true,"type":"module","version":"2026.11.
|
|
1
|
+
{"name":"pm-claude-runtime","private":true,"type":"module","version":"2026.11.24","dependencies":{"@unbrained/pm-cli":"2026.11.24"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"pm-codex","version":"2026.11.
|
|
1
|
+
{"name":"pm-codex","version":"2026.11.24","description":"Native Codex integration for pm-cli with bundled MCP tools, skills, commands, and agent workflows.","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli/tree/main/plugins/pm-codex","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","codex","mcp","project-management","agents","tasks","workflows"],"skills":"./skills/","mcpServers":"./.mcp.json","interface":{"displayName":"pm CLI","shortDescription":"Native pm tracker tools and agent workflows","longDescription":"Use pm CLI from Codex through native MCP tools instead of shelling out to the pm command. The plugin bundles tracker operations, skills, command prompts, and subagent workflow guidance for planning, execution, validation, release, and audit work.","developerName":"unbrained","category":"Coding","capabilities":["Interactive","Read","Write"],"websiteURL":"https://github.com/unbraind/pm-cli","privacyPolicyURL":"https://github.com/unbraind/pm-cli/blob/main/SECURITY.md","termsOfServiceURL":"https://github.com/unbraind/pm-cli/blob/main/LICENSE","defaultPrompt":["Use pm CLI to orient, claim, track, verify, and close this repository task"],"composerIcon":"./assets/pm-cli-small.svg","logo":"./assets/pm-cli-small.svg","screenshots":[],"brandColor":"#2563EB"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"pm-codex-runtime","private":true,"type":"module","version":"2026.11.
|
|
1
|
+
{"name":"pm-codex-runtime","private":true,"type":"module","version":"2026.11.24","dependencies":{"@unbrained/pm-cli":"2026.11.24"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json","name":"pm-codex","version":"2026.11.
|
|
1
|
+
{"$schema":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json","name":"pm-codex","version":"2026.11.24","description":"Repository-native project context workflows and a version-pinned pm MCP server for Codex.","author":{"name":"unbrained","url":"https://github.com/unbraind/pm-cli"},"homepage":"https://github.com/unbraind/pm-cli/tree/main/plugins/pm-codex","repository":"https://github.com/unbraind/pm-cli","license":"MIT","keywords":["pm-cli","codex","mcp","project-management","agents"],"extensions":{"com.openai":{"interface":{"displayName":"pm CLI","shortDescription":"Track project context with pm","longDescription":"Orient, plan, implement, verify, and hand off work with repository-native pm records and a bundled MCP server.","developerName":"unbrained","category":"Coding","capabilities":["Interactive","Read","Write"],"websiteURL":"https://github.com/unbraind/pm-cli","privacyPolicyURL":"https://github.com/unbraind/pm-cli/blob/main/SECURITY.md","termsOfServiceURL":"https://github.com/unbraind/pm-cli/blob/main/LICENSE","defaultPrompt":["Use pm to orient, track, verify, and hand off this repository task."],"composerIcon":"./assets/pm-cli-small.svg","logo":"./assets/pm-cli-small.svg","brandColor":"#2563EB"}}}}
|