@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
|
@@ -6,7 +6,7 @@ export declare const PROFILE_LINT_DIMENSIONS:readonly["profile","types","statuse
|
|
|
6
6
|
/** Restricts profile lint dimension values accepted by command, SDK, and storage contracts. */
|
|
7
7
|
export type ProfileLintDimension=(typeof PROFILE_LINT_DIMENSIONS)[number];
|
|
8
8
|
/** Stable machine-readable codes every {@link ProjectProfileLintFinding} carries. */
|
|
9
|
-
export declare const PROFILE_LINT_CODES:readonly["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","field_option_collision","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"];
|
|
9
|
+
export declare const PROFILE_LINT_CODES:readonly["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","field_option_collision","field_flag_invalid","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"];
|
|
10
10
|
/** Restricts profile lint code values accepted by command, SDK, and storage contracts. */
|
|
11
11
|
export type ProfileLintCode=(typeof PROFILE_LINT_CODES)[number];
|
|
12
12
|
/** A single graded consistency finding produced by {@link lintProjectProfile}. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{BUILTIN_ITEM_TYPE_VALUES as _}from"../../types/index.js";import{parseNestedSettingValue as g,resolveNestedSettingDescriptor as k}from"../config/nested-settings.js";import{normalizeAddFieldInput as v}from"../schema/fields-file.js";import{normalizeAddStatusInput as S}from"../schema/status-defs-file.js";import{normalizeAddTypeInput as $}from"../schema/item-types-file.js";import{normalizeStatusToken as
|
|
1
|
+
import{BUILTIN_ITEM_TYPE_VALUES as _}from"../../types/index.js";import{parseNestedSettingValue as g,resolveNestedSettingDescriptor as k}from"../config/nested-settings.js";import{normalizeAddFieldInput as v}from"../schema/fields-file.js";import{normalizeAddStatusInput as S}from"../schema/status-defs-file.js";import{normalizeAddTypeInput as $}from"../schema/item-types-file.js";import{normalizeStatusToken as p}from"../schema/type-workflows.js";import{DEFAULT_RUNTIME_STATUS_DEFINITIONS as T}from"../schema/runtime-schema.js";import{toErrorMessage as f}from"../shared/primitives.js";import{resolvePmToolCustomFieldCollision as I}from"../../sdk/cli-contracts/tool-schema.js";import{describeFieldFlagSpellingDefectLine as b,describeFieldOptionCollision as F,resolveAddFieldFlagSpellingDefects as P,resolveAddFieldOptionCollisions as C}from"../../sdk/schema/field-option-collisions.js";import{normalizeProfileLookupKey as h}from"./profile-presets.js";const J=["profile","types","statuses","fields","workflows","config","templates","packages"],Q=["profile_name_empty","profile_name_not_normalized","profile_title_empty","profile_summary_empty","type_invalid","type_duplicate","status_invalid","status_duplicate","field_invalid","field_duplicate","field_mcp_input_collision","field_option_collision","field_flag_invalid","workflow_type_empty","workflow_type_unknown","workflow_duplicate_type","workflow_transition_malformed","workflow_status_unknown","config_key_unknown","config_value_invalid","config_duplicate","template_type_unknown","package_spec_empty"],L=new Set(T.flatMap(t=>[p(t.id),...(t.aliases??[]).map(e=>p(e))]).filter(t=>t.length>0)),w=new Set(_.map(t=>t.toLowerCase()));function E(t,e){t.name.trim().length===0?e.push({severity:"error",code:"profile_name_empty",dimension:"profile",message:"Profile name must not be empty; profile resolution requires a non-blank name."}):t.name!==h(t.name)&&e.push({severity:"warning",code:"profile_name_not_normalized",dimension:"profile",target:t.name,message:`Profile name "${t.name}" is not in canonical form; resolution folds it to "${h(t.name)}" (lowercase, hyphens as underscores).`}),t.title.trim().length===0&&e.push({severity:"warning",code:"profile_title_empty",dimension:"profile",message:"Profile title is empty; list and show surfaces will render a blank title."}),t.summary.trim().length===0&&e.push({severity:"warning",code:"profile_summary_empty",dimension:"profile",message:"Profile summary is empty; list and show surfaces will render a blank archetype description."})}function N(t,e){const r=new Set,i=new Set;for(const[s,o]of t.types.entries()){let n;try{n=$(o).name}catch(d){e.push({severity:"error",code:"type_invalid",dimension:"types",target:typeof o.name=="string"?o.name:`#${s}`,message:f(d)});continue}const a=n.toLowerCase();if(i.has(a)){e.push({severity:"error",code:"type_duplicate",dimension:"types",target:n,message:`Item type "${n}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}i.add(a),r.add(a)}return r}function z(t,e){const r=new Set,i=new Set;for(const[s,o]of t.statuses.entries()){let n;try{n=S(o)}catch(a){e.push({severity:"error",code:"status_invalid",dimension:"statuses",target:typeof o.id=="string"?o.id:`#${s}`,message:f(a)});continue}if(i.has(n.id)){e.push({severity:"error",code:"status_duplicate",dimension:"statuses",target:n.id,message:`Status "${n.id}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}i.add(n.id),r.add(n.id);for(const a of n.aliases??[])r.add(p(a))}return r}function x(t,e){const r=new Set;for(const[i,s]of t.fields.entries()){let o,n;try{n=v(s),o=n.key}catch(m){e.push({severity:"error",code:"field_invalid",dimension:"fields",target:typeof s.key=="string"?s.key:`#${i}`,message:f(m)});continue}if(r.has(o)){e.push({severity:"error",code:"field_duplicate",dimension:"fields",target:o,message:`Field "${o}" is declared more than once; the later definition silently overwrites the earlier upsert.`});continue}r.add(o);const a=P(n);a.length>0&&e.push({severity:"error",code:"field_flag_invalid",dimension:"fields",target:o,message:`Field "${o}" declares a flag that is not one option spelling: ${a.map(b).join("; ")}. Pass one spelling per alias.`});const d=C(n);d.length>0&&e.push({severity:"error",code:"field_option_collision",dimension:"fields",target:o,message:`Field "${o}" would disable a built-in option: ${d.map(F).join("; ")}. Rename the field or narrow its commands.`});const l=I(o);l&&e.push({severity:"warning",code:"field_mcp_input_collision",dimension:"fields",target:o,message:`Field "${o}" collides with canonical MCP property "${l.property}" owned by ${l.owner}; callers must pass the custom value through ${l.nested_path}.`})}}function A(t,e,r,i){const s=new Set;for(const[o,n]of t.workflows.entries()){const a=n.type.trim().toLowerCase();if(a.length===0){i.push({severity:"error",code:"workflow_type_empty",dimension:"workflows",target:`#${o}`,message:"Workflow has an empty type; the workflow resolver drops entries without a type."});continue}const d=s.has(a);s.add(a),d?i.push({severity:"warning",code:"workflow_duplicate_type",dimension:"workflows",target:n.type,message:`Workflow type "${n.type}" is declared more than once; the later transition set wins.`}):!w.has(a)&&!e.has(a)&&i.push({severity:"warning",code:"workflow_type_unknown",dimension:"workflows",target:n.type,message:`Workflow governs type "${n.type}" which is neither a built-in type nor declared by this profile; it has no effect unless that type already exists.`});const l=new Set;for(const m of n.allowed_transitions){const u=p(m[0]),y=p(m[1]);if(u.length===0||y.length===0){i.push({severity:"error",code:"workflow_transition_malformed",dimension:"workflows",target:n.type,message:`Workflow "${n.type}" has a transition with an empty status; the workflow resolver silently drops it.`});continue}for(const c of[u,y])L.has(c)||r.has(c)||l.has(c)||(l.add(c),i.push({severity:"warning",code:"workflow_status_unknown",dimension:"workflows",target:c,message:`Workflow "${n.type}" references status "${c}" which is neither a built-in status nor declared by this profile; transitions to or from it are unreachable.`}))}}}function O(t,e){const r=new Set;for(const i of t.config){const s=k(i.key);if(s===void 0){e.push({severity:"error",code:"config_key_unknown",dimension:"config",target:i.key,message:`Config knob "${i.key}" is not a recognized setting; apply rejects it with a usage error.`});continue}r.has(s.key)?e.push({severity:"error",code:"config_duplicate",dimension:"config",target:s.key,message:`Config knob "${s.key}" is set more than once; the later value silently overwrites the earlier one.`}):r.add(s.key);const o=g(s,i.value);o.ok||e.push({severity:"error",code:"config_value_invalid",dimension:"config",target:i.key,message:o.error.message})}}function U(t,e,r){for(const i of t.templates){const s=i.options.type;if(typeof s!="string"||s.trim().length===0)continue;const o=s.trim().toLowerCase();!w.has(o)&&!e.has(o)&&r.push({severity:"warning",code:"template_type_unknown",dimension:"templates",target:i.name,message:`Template "${i.name}" creates type "${s}" which is neither a built-in type nor declared by this profile.`})}}function D(t,e){for(const[r,i]of t.packages.entries())i.spec.trim().length===0&&e.push({severity:"warning",code:"package_spec_empty",dimension:"packages",target:`#${r}`,message:"Package recommendation has an empty spec; it cannot be surfaced as an install hint."})}function X(t){const e=[];E(t,e);const r=N(t,e),i=z(t,e);x(t,e),A(t,r,i,e),O(t,e),U(t,r,e),D(t,e);const s=e.filter(n=>n.severity==="error").length,o=e.length-s;return{profile:t.name,ok:s===0,findings:e,errorCount:s,warningCount:o}}export{Q as PROFILE_LINT_CODES,J as PROFILE_LINT_DIMENSIONS,X as lintProjectProfile};
|
|
2
2
|
//# sourceMappingURL=profile-lint.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{RUNTIME_FIELD_COMMAND_VALUES as
|
|
2
|
-
`}function
|
|
1
|
+
import{RUNTIME_FIELD_COMMAND_VALUES as a,RUNTIME_FIELD_TYPE_VALUES as f}from"../../types/index.js";import{ITEM_METADATA_KEY_ORDER as F}from"../shared/constants.js";import{normalizeStatusToken as l}from"./status-token.js";import{normalizeStatusToken as R}from"./status-token.js";const A=new Set(f),T=new Set(a),u=new Set([...F.filter(t=>t!=="severity"),"id","title","type","status","priority","tags","assignee","parent","description","body","created_at","updated_at","closed_at","completed_at","author","deadline","estimate","sprint","release","risk","confidence","reviewer","resolution","expected","actual"]),k=["create","update"];function m(t){if(typeof t!="string")return"";const e=t.trim().toLowerCase().replaceAll(/[\s_]+/g,"-");return e.startsWith("--")?e.slice(2):e}function y(t){return t.replaceAll("_","-")}function C(t,e){const i=new Set;for(const n of t){const r=m(n);r.length>0&&r!==e&&i.add(r)}return[...i].sort((n,r)=>n.localeCompare(r))}function S(t){const e=new Set;for(const i of t??[]){const n=i.trim();n.length>0&&e.add(n)}return[...e].sort((i,n)=>i.localeCompare(n))}function w(t){const e=new Set,i=[];for(const n of t??[]){const r=n.trim().toLowerCase();if(r.length!==0){if(!T.has(r))throw new Error(`Invalid field command "${n}". Allowed: ${a.join(", ")}.`);e.has(r)||(e.add(r),i.push(r))}}return t===void 0||i.length===0?[...k]:i}function M(t){const e=l(t.key);if(e.length===0)throw new Error("Field key must not be empty.");if(e.includes(","))throw new Error(`Field key "${e}" must not contain commas: commas separate field names in list flags such as --unset and --fields.`);if(u.has(e))throw new Error(`Cannot define custom field "${e}": custom schema field "${e}" collides with built-in item metadata "${e}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...u].sort((_,E)=>_.localeCompare(E)).join(", ")}.`);const i=typeof t.type=="string"&&t.type.trim().length>0?t.type.trim().toLowerCase():"string";if(!A.has(i))throw new Error(`Invalid field type "${t.type}". Allowed: ${f.join(", ")}.`);const n=i,r=w(t.commands),o=m(t.cliFlag),s=o.length>0&&o!==y(e)?o:void 0,d=s??y(e),g=C(t.aliases??[],d),c=t.description?.trim();return{key:e,type:n,commands:r,description:c&&c.length>0?c:void 0,cliFlag:s,cliAliases:g,required:t.required===!0,requiredOnCreate:t.requiredOnCreate===!0,allowUnset:t.allowUnset!==!1,requiredTypes:S(t.requiredTypes)}}function I(t){if(Array.isArray(t))return t;if(typeof t!="object"||t===null)return;const e=t;if(Array.isArray(e.fields))return e.fields;if(Array.isArray(e.definitions))return e.definitions}function q(t){const e=I(t);if(!e)return[];const i=[];for(const n of e){if(typeof n!="object"||n===null||Array.isArray(n))continue;const r=n;typeof r.key!="string"||r.key.trim().length===0||i.push(r)}return i}function N(t){if(t==null||t.trim().length===0)return{fields:[]};let e;try{e=JSON.parse(t)}catch{throw new Error("schema/fields.json contains invalid JSON.")}return{fields:q(e)}}function O(t){return`${JSON.stringify({fields:t.fields},null,2)}
|
|
2
|
+
`}function U(t,e){const i=t.fields.find(s=>l(s.key)===e.key),n=i!==void 0,r=t.fields.filter(s=>l(s.key)!==e.key),o={...i,key:e.key,type:e.type,commands:[...e.commands]};return p(o,"description",e.description),p(o,"cli_flag",e.cliFlag),e.cliAliases.length>0?o.cli_aliases=[...e.cliAliases]:delete o.cli_aliases,h(o,"required",e.required),h(o,"required_on_create",e.requiredOnCreate),e.allowUnset===!1?o.allow_unset=!1:delete o.allow_unset,e.requiredTypes.length>0?o.required_types=[...e.requiredTypes]:delete o.required_types,r.push(o),r.sort((s,d)=>l(s.key).localeCompare(l(d.key))),{file:{fields:r},definition:o,replaced:n}}function v(t,e){const i=l(e);if(i.length===0)throw new Error("Field key must not be empty.");const n=[],r=t.fields.filter(o=>l(o.key)===i?(n.push(o),!1):!0);return n.length===0?{file:{fields:r},removed:!1}:{file:{fields:r},removed:!0,definition:n[0]}}function p(t,e,i){const n=t;i!==void 0&&i.length>0?n[e]=i:delete n[e]}function h(t,e,i){const n=t;i?n[e]=!0:delete n[e]}export{u as BUILTIN_FIELD_KEYS,M as normalizeAddFieldInput,R as normalizeFieldKey,N as parseFieldsFile,v as removeField,O as serializeFieldsFile,U as upsertField};
|
|
3
3
|
//# sourceMappingURL=fields-file.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{EXIT_CODE as l}from"../shared/constants.js";import{PmCliError as d}from"../shared/errors.js";import{stableStringify as a}from"../shared/serialization.js";import{isRfc3339DateTime as E}from"../shared/time.js";import{runtimeFieldOptionTarget as
|
|
1
|
+
import{EXIT_CODE as l}from"../shared/constants.js";import{PmCliError as d}from"../shared/errors.js";import{stableStringify as a}from"../shared/serialization.js";import{isRfc3339DateTime as E}from"../shared/time.js";import{runtimeFieldOptionTarget as R}from"./runtime-schema.js";import{assertIdentityFieldsWithoutUrlCredentials as h}from"../shared/url-credentials.js";import{isRegistrableFieldFlagSpelling as j}from"../../sdk/schema/field-flag-spelling.js";const x=16;function m(e){const r=e.trim().replaceAll(/[^A-Za-z0-9]+/g," ").split(/\s+/).filter(i=>i.length>0).map(i=>i.toLowerCase());if(r.length===0)return e;const[t,...n]=r;return`${t}${n.map(i=>`${i.slice(0,1).toUpperCase()}${i.slice(1)}`).join("")}`}function H(e,r,t=new Set,n){if(_(e,r,n))return;const i=$(e,r,t,n),o=p(e);return[m(e.cli_flag),...o].find(s=>!i.has(s)&&g(s,o,i))}function g(e,r,t){for(const n of r){if(n===e)break;if(t.has(n))return!1}return!0}function _(e,r,t){return r.definitions.some(n=>n!==e&&n.metadata_key===e.metadata_key&&(t===void 0||n.commands.includes(t)))}function $(e,r,t,n){return new Set([...t,...r.definitions.filter(i=>i!==e&&(n===void 0||i.commands.includes(n))).flatMap(i=>p(i))])}function b(e){return e.replace(/^-+/u,"").startsWith("no-")}function q(e){return e.startsWith("-")?e:`--${e}`}function I(e,r,t,n){if(_(e,r,n))return;const i=$(e,r,t.options,n),o=p(e);return[e.cli_flag,...e.cli_aliases].find(u=>{if(!j(u))return!1;const s=A(u);return b(u)||t.flags.has(q(u))||i.has(s)?!1:g(s,o,i)})}function A(e){return e.replace(/^-+/u,"").replace(/^no-/u,"").split("-").reduce((r,t)=>`${r}${t.charAt(0).toUpperCase()}${t.slice(1)}`)}function p(e){return[...new Set([R(e),m(e.key),m(e.cli_flag),...e.cli_aliases.map(r=>m(r)),...[e.cli_flag,...e.cli_aliases].filter(r=>!b(r)).map(r=>A(r))])]}function S(e,r){for(const t of p(r)){if(!Object.hasOwn(e,t))continue;const n=e[t];if(n!==void 0)return n}}function F(e){return Array.isArray(e)?e.flatMap(r=>F(r)).map(r=>r.trim()).filter(r=>r.length>0):typeof e=="string"?e.split(/[,\n|]/).map(r=>r.trim()).filter(r=>r.length>0):e==null?[]:[String(e).trim()].filter(r=>r.length>0)}function C(e,r){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e=="string"){const t=e.trim().toLowerCase();if(t==="true"||t==="1"||t==="yes")return!0;if(t==="false"||t==="0"||t==="no")return!1}throw new d(`${r} must be one of true|false|1|0|yes|no`,l.USAGE)}function O(e,r){if(typeof e=="number"&&Number.isFinite(e))return e;const t=typeof e=="string"?e.trim():String(e),n=Number(t);if(!Number.isFinite(n))throw new d(`${r} must be a number`,l.USAGE);return n}function U(e,r,t){const n=typeof e=="string"?(()=>{try{return JSON.parse(e)}catch{return}})():e;if(t==="array"&&Array.isArray(n)||t==="object"&&typeof n=="object"&&n!==null&&!Array.isArray(n))return n;throw new d(`${r} must be valid JSON ${t}`,l.USAGE)}function N(e,r){return r===void 0?!0:r==="array"?Array.isArray(e):r==="object"?typeof e=="object"&&e!==null&&!Array.isArray(e):typeof e===r}function M(e,r,t){if(r.const!==void 0&&a(e)!==a(r.const))return`${t} must equal ${a(r.const)}`;if(r.enum!==void 0&&!r.enum.some(n=>a(n)===a(e)))return`${t} must be one of ${r.enum.map(n=>a(n)).join("|")}`;if(!N(e,r.type))return`${t} must match configured type ${String(r.type)}`;if(typeof e=="string"){if(r.min_length!==void 0&&e.length<r.min_length)return`${t} must contain at least ${r.min_length} characters`;if(r.format==="date-time"&&!E(e))return`${t} must be an RFC 3339 date-time`}}function L(e,r,t,n){if(Array.isArray(e)){if(r.min_items!==void 0&&e.length<r.min_items)return`${t} must contain at least ${r.min_items} items`;if(r.items)for(const[i,o]of e.entries()){const u=y(o,r.items,`${t}[${i}]`,n+1);if(u)return u}}}function T(e,r,t,n){if(typeof e!="object"||e===null||Array.isArray(e))return;const i=e;for(const o of r.required??[])if(!Object.hasOwn(i,o))return`${t}.${o} is required`;for(const[o,u]of Object.entries(i)){const s=r.properties?.[o];if(!s){if(r.additional_properties===!1)return`${t}.${o} is not allowed`;continue}const c=y(u,s,`${t}.${o}`,n+1);if(c)return c}}function y(e,r,t,n=0){if(n>x)return`${t} value schema exceeds maximum depth`;const i=M(e,r,t);if(i)return i;const o=L(e,r,t,n);if(o)return o;const u=T(e,r,t,n);if(u)return u;if(!r.one_of)return;let s=0;for(const c of r.one_of)if(y(e,c,t,n+1)===void 0&&(s+=1,s>1))break;return s===1?void 0:`${t} must match exactly one configured schema variant`}function f(e,r,t){if(!e.value_schema||r===void 0)return r;const n=y(r,e.value_schema,t);if(n)throw new d(n,l.USAGE);return r}function V(e,r,t,n){const i=n==="option"&&Array.isArray(r)?r[r.length-1]:r;if(i!==void 0)return f(e,U(i,t,e.type),t)}function k(e,r,t,n="option"){const i=t??`--${e.cli_flag}`;if(e.type==="array"||e.type==="object")return V(e,r,i,n);if(e.repeatable||e.type==="string_array"){const u=F(r);return e.type==="number"?f(e,u.map(s=>O(s,i)),i):e.type==="boolean"?f(e,u.map(s=>C(s,i)),i):f(e,u,i)}const o=Array.isArray(r)?r[r.length-1]:r;if(o!==void 0)return e.type==="number"?f(e,O(o,i),i):e.type==="boolean"?f(e,C(o,i),i):f(e,typeof o=="string"?o:String(o),i)}function w(e,r){return!e.required&&!e.required_on_create?!1:e.required_types.length===0?!0:r?e.required_types.map(t=>t.toLowerCase()).includes(r.trim().toLowerCase()):!1}function X(e,r,t){const n={},i=[];for(const o of r.command_to_fields.get("create")??[]){const u=S(e,o);if(u===void 0){w(o,t)&&i.push(`--${o.cli_flag}`);continue}n[o.metadata_key]=k(o,u)}return{values:n,missing_required_flags:[...new Set(i)].sort((o,u)=>o.localeCompare(u))}}function B(e,r,t=["update"]){const n={},i=(t??["update"]).flatMap(u=>r.command_to_fields.get(u)??[]),o=new Set;for(const u of i){const s=S(e,u);s!==void 0&&(o.has(u.metadata_key)||(o.add(u.metadata_key),n[u.metadata_key]=k(u,s)))}return h(n),n}export{k as coerceRuntimeFieldValue,X as collectRuntimeCreateFieldValues,B as collectRuntimeUpdateFieldValues,A as commanderOptionAttribute,S as readRuntimeFieldOptionValue,p as resolveCandidateOptionKeys,I as runtimeFieldCliFlagRoute,q as runtimeFieldFlagToken,H as runtimeFieldSdkOptionName,w as shouldRequireFieldOnCreate};
|
|
2
2
|
//# sourceMappingURL=runtime-field-values.js.map
|
|
@@ -99,6 +99,8 @@ type_definitions_from_file:ItemTypeDefinition[]|undefined;
|
|
|
99
99
|
warnings:string[];
|
|
100
100
|
/** Value that configures or reports created paths for this contract. */
|
|
101
101
|
created_paths:string[];}
|
|
102
|
+
/** Normalize a stored field flag token as the registry reads it: trimmed, lower-cased, separators as hyphens, leading dashes removed. */
|
|
103
|
+
export declare function normalizeCliToken(value:unknown):string;
|
|
102
104
|
/** Implements normalize runtime schema settings for the public runtime surface of this module. */
|
|
103
105
|
export declare function normalizeRuntimeSchemaSettings(schema:Partial<RuntimeSchemaSettings>|undefined):RuntimeSchemaSettings;
|
|
104
106
|
/** Implements file path for schema section for the public runtime surface of this module. */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import U from"node:path";import{pathExists as W,readFileIfExists as v}from"../fs/fs-utils.js";import{createFileAtomic as K}from"../fs/atomic-create.js";import{DEFAULT_STATUS_DEFINITIONS as V,DEFAULT_WORKFLOW_DEFINITION as H}from"../shared/constants.js";import{RUNTIME_FIELD_COMMAND_VALUES as Y,RUNTIME_FIELD_TYPE_VALUES as $,RUNTIME_STATUS_ROLE_VALUES as J,RUNTIME_UNKNOWN_FIELD_POLICY_VALUES as B,STATUS_VALUES as X}from"../../types/index.js";import{normalizeStatusToken as k}from"./status-token.js";const m=Object.freeze({types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"}),O=H,D=V,Z=["create","update"],G=new Set(J),Q=new Set($),ee=new Set(Y),te=new Set(B),ne=new Set(["string","number","boolean","array","object"]),re=16;function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const se=[e=>e.type===void 0||typeof e.type=="string"&&ne.has(e.type),e=>!Object.hasOwn(e,"const")||E(e.const),e=>e.enum===void 0||Array.isArray(e.enum)&&e.enum.every(t=>E(t)),e=>e.min_length===void 0||Number.isInteger(e.min_length)&&e.min_length>=0,e=>e.min_items===void 0||Number.isInteger(e.min_items)&&e.min_items>=0,e=>e.format===void 0||e.format==="date-time",e=>e.required===void 0||Array.isArray(e.required)&&e.required.every(t=>typeof t=="string"&&t.length>0),e=>e.additional_properties===void 0||typeof e.additional_properties=="boolean",e=>e.properties===void 0||R(e.properties),e=>e.one_of===void 0||Array.isArray(e.one_of)&&e.one_of.length>0];function E(e,t=new Set){if(e===null||typeof e=="string"||typeof e=="boolean")return!0;if(typeof e=="number")return Number.isFinite(e);if(typeof e!="object"||t.has(e))return!1;t.add(e);const n=Array.isArray(e)?e.every(r=>E(r,t)):Object.values(e).every(r=>E(r,t));return t.delete(e),n}function I(e,t=0,n=new Set){if(!R(e)||t>re||n.has(e))return;n.add(e);const r=e,s=r.type,o=r.enum,u=r.one_of,a=r.properties,i=r.items,d=r.required,c=r.min_length,l=r.min_items,p=r.format,w=r.additional_properties;if(!se.every(_=>_(r))){n.delete(e);return}const h=a===void 0?void 0:Object.fromEntries(Object.entries(a).map(([_,z])=>[_,I(z,t+1,n)])),A=i===void 0?void 0:I(i,t+1,n),g=u===void 0?void 0:u.map(_=>I(_,t+1,n));if([...Object.values(h??{}),...i===void 0?[]:[A],...g??[]].some(_=>_===void 0)){n.delete(e);return}return n.delete(e),Object.fromEntries(Object.entries({type:s,const:Object.hasOwn(r,"const")?r.const:void 0,enum:o,min_length:c,min_items:l,format:p,properties:h,required:d===void 0?void 0:[...new Set(d)],additional_properties:w,items:A,one_of:g}).filter(([,_])=>_!==void 0))}function T(e){const t=Array.isArray(e)?e:[];return[...new Set(t.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0))].sort((n,r)=>n.localeCompare(r))}function f(e){if(typeof e!="string"||e.length===0)return;const t=k(e);return t.length>0?t:void 0}function ie(e){return e.startsWith("--")?e.slice(2):e}function M(e){return typeof e=="string"?ie(e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-")):""}function j(e){return e.replaceAll("_","-")}function oe(e){const t=e.replaceAll(/[^A-Za-z0-9]+/g," ").trim().split(/\s+/).filter(s=>s.length>0).map(s=>s.toLowerCase());if(t.length===0)return e;const[n,...r]=t;return`${n}${r.map(s=>`${s.slice(0,1).toUpperCase()}${s.slice(1)}`).join("")}`}function L(e,t){const n=f(e.id);if(!n)return null;const r=[...new Set(T(e.aliases).map(k).filter(a=>a.length>0))].sort((a,i)=>a.localeCompare(i)),s=T(e.roles).filter(a=>G.has(a)),o=e.description?.trim(),u=typeof e.order=="number"&&Number.isFinite(e.order)?e.order:t;return{id:n,aliases:r,roles:s,description:o&&o.length>0?o:void 0,order:u}}function ae(e){return{draft_status:f(e?.draft_status),open_status:f(e?.open_status),in_progress_status:f(e?.in_progress_status),blocked_status:f(e?.blocked_status),close_status:f(e?.close_status),canceled_status:f(e?.canceled_status)}}function C(e,t){if(!Array.isArray(t)||t.length!==2)return;const n=k(t[0]),r=k(t[1]);n.length===0||r.length===0||e.pairs.some(s=>s[0]===n&&s[1]===r)||e.pairs.push([n,r])}function le(e){const t=typeof e?.type=="string"?e.type.trim():"";if(t.length===0||!Array.isArray(e?.allowed_transitions))return null;const n={type:t,pairs:[],denyAll:e.allowed_transitions.length===0};for(const r of e.allowed_transitions)C(n,r);return{typeKey:t.toLowerCase(),record:n}}function ue(e){if(!Array.isArray(e)||e.length===0)return;const t=new Map;for(const r of e){const s=le(r);if(s===null)continue;const o=t.get(s.typeKey)??s.record;o.denyAll||=s.record.denyAll;for(const u of s.record.pairs)C(o,u);t.set(s.typeKey,o)}const n=[];for(const r of t.values())(r.pairs.length>0||r.denyAll)&&n.push({type:r.type,allowed_transitions:r.pairs});return n.sort((r,s)=>r.type.localeCompare(s.type)),n.length>0?n:void 0}function P(e){const t=k(e.key??"");if(!t)return null;const n=k(e.metadata_key??e.front_matter_key??t),r=M(e.cli_flag??j(t));if(!r)return null;const s=T(e.cli_aliases).map(l=>M(l)).filter(l=>l.length>0&&l!==r),o=typeof e.type=="string"?e.type.trim().toLowerCase():"string",u=Q.has(o)?o:"string",a=(()=>{const l=T(e.commands).filter(p=>ee.has(p));return l.length>0?l:[...Z]})(),i=e.description?.trim(),d=T(e.required_types),c=e.value_schema===void 0?void 0:I(e.value_schema);return e.value_schema!==void 0&&c===void 0?null:{key:t,metadata_key:n,cli_flag:r,cli_aliases:s,description:i&&i.length>0?i:void 0,type:u,commands:a,repeatable:[e.repeatable===!0,u==="string_array"].includes(!0),required:e.required===!0,required_on_create:e.required_on_create===!0,required_types:d,allow_unset:e.allow_unset!==!1,value_schema:c}}function de(e){const t=new Map;for(const[r,s]of e.entries()){const o=L(s,r);o&&t.set(o.id,o)}const n=q([...t.values()]);return n.length>0?n:q(D.map((r,s)=>L(r,s)).filter(r=>r!==null))}function q(e){return e.sort((t,n)=>t.order===n.order?t.id.localeCompare(n.id):t.order-n.order)}function ce(e){const t=new Map;for(const n of e??[]){const r=P(n);r&&t.set(r.key,r)}return[...t.values()].sort((n,r)=>n.key.localeCompare(r.key))}function fe(e){return{id:e.id,aliases:e.aliases.length>0?[...e.aliases]:void 0,roles:e.roles.length>0?[...e.roles]:void 0,description:e.description,order:e.order}}function _e(e){return{key:e.key,metadata_key:e.metadata_key!==e.key?e.metadata_key:void 0,cli_flag:e.cli_flag!==j(e.key)?e.cli_flag:void 0,cli_aliases:e.cli_aliases.length>0?[...e.cli_aliases]:void 0,description:e.description,type:e.type,commands:[...e.commands],repeatable:e.repeatable===!0?!0:void 0,required:e.required===!0?!0:void 0,required_on_create:e.required_on_create===!0?!0:void 0,required_types:e.required_types.length>0?[...e.required_types]:void 0,allow_unset:e.allow_unset===!1?!1:void 0,value_schema:e.value_schema}}function me(e){const t=typeof e=="string"?e.trim().toLowerCase():"allow";return te.has(t)?t:"allow"}function F(e){const t={...m,...e?.files},n=e?.statuses&&e.statuses.length>0?e.statuses:D,r=de(n),s=ce(e?.fields);return{version:typeof e?.version=="number"&&Number.isFinite(e.version)?Math.floor(e.version):1,files:t,statuses:r.map(fe),fields:s.map(_e),workflow:{...O,...ae(e?.workflow)},type_workflows:ue(e?.type_workflows),unknown_field_policy:me(e?.unknown_field_policy)}}function pe(e,t,n){try{return JSON.parse(e)}catch{n.push(t);return}}function ye(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;const t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){const n=t.item_types;if(Array.isArray(n.definitions))return n.definitions}}function we(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;const t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function Se(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;const t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function he(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e;return typeof t.workflow=="object"&&t.workflow!==null&&!Array.isArray(t.workflow)?t.workflow:typeof t.workflows=="object"&&t.workflows!==null&&!Array.isArray(t.workflows)?t.workflows:t}function Ae(e){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e;if(Array.isArray(t.type_workflows))return t.type_workflows}function y(e,t,n){const r=t?.trim()||n;return U.isAbsolute(r)?r:U.join(e,r)}function Le(e,t){return y(e,t.files.types,m.types)}async function Ne(e,t){const n=F(t),r=[{path:y(e,n.files.types,m.types),seed:{definitions:[]}},{path:y(e,n.files.statuses,m.statuses),seed:{statuses:D}},{path:y(e,n.files.fields,m.fields),seed:{fields:[]}},{path:y(e,n.files.workflows,m.workflows),seed:{workflow:O}}],s=[];for(const o of r)await W(o.path)||await K(o.path,`${JSON.stringify(o.seed,null,2)}
|
|
2
|
-
`)&&s.push(o.path);return{created_paths:s}}async function Ue(e,t){const n=F(t),r=[],s=y(e,n.files.types,m.types),o=y(e,n.files.statuses,m.statuses),u=y(e,n.files.fields,m.fields),a=y(e,n.files.workflows,m.workflows);let i,d,c,l,p;const w=async(z,x)=>{const N=await v(z);if(N!==null)return pe(N,x,r)},h=await w(s,"runtime_schema_types_invalid_json");h!==void 0&&(i=ye(h),i===void 0&&r.push("runtime_schema_types_invalid_shape"));const A=await w(o,"runtime_schema_statuses_invalid_json");A!==void 0&&(d=we(A),d===void 0&&r.push("runtime_schema_statuses_invalid_shape"));const g=await w(u,"runtime_schema_fields_invalid_json");g!==void 0&&(c=Se(g),c===void 0&&r.push("runtime_schema_fields_invalid_shape"));const S=await w(a,"runtime_schema_workflows_invalid_json");return S!==void 0&&(l=he(S),l===void 0&&r.push("runtime_schema_workflows_invalid_shape"),p=Ae(S)),{schema:F({...n,statuses:[...n.statuses,...d??[]],fields:[...n.fields,...c??[]],workflow:{...n.workflow,...l},type_workflows:[...n.type_workflows??[],...p??[]]}),type_definitions_from_file:i,warnings:r,created_paths:[]}}function b(e,t,n,r=!1){const o=n.map(a=>f(a)).filter(a=>typeof a=="string").find(a=>e.some(i=>i.id===a));if(r&&o!==void 0)return o;const u=e.find(a=>a.roles.includes(t));return u!==void 0?u.id:o??e[0]?.id}function ge(e){const t=new Map,n=new Map;for(const r of e){n.set(r.id,r),t.set(r.id,r.id),t.set(r.id.replaceAll("_","-"),r.id),t.set(r.id.replaceAll("_"," "),r.id);for(const s of r.aliases)t.set(s,r.id),t.set(s.replaceAll("_","-"),r.id),t.set(s.replaceAll("_"," "),r.id)}return{aliasToId:t,byId:n}}function ke(e){const t={activeStatuses:new Set,blockedStatuses:new Set,draftStatuses:new Set,terminalCanceledStatuses:new Set,terminalDoneStatuses:new Set,terminalStatuses:new Set};for(const n of e){const r=new Set(n.roles);(r.has("terminal")||r.has("terminal_done")||r.has("terminal_canceled"))&&t.terminalStatuses.add(n.id),r.has("terminal_done")&&t.terminalDoneStatuses.add(n.id),r.has("terminal_canceled")&&t.terminalCanceledStatuses.add(n.id),r.has("active")&&t.activeStatuses.add(n.id),r.has("blocked")&&t.blockedStatuses.add(n.id),r.has("draft")&&t.draftStatuses.add(n.id)}return t}function Oe(e){const t=F(e),n=t.statuses.map((S,_)=>L(S,_)).filter(S=>S!==null),{aliasToId:r,byId:s}=ge(n),{activeStatuses:o,blockedStatuses:u,draftStatuses:a,terminalCanceledStatuses:i,terminalDoneStatuses:d,terminalStatuses:c}=ke(n),l=t.workflow,p=f(l.open_status)??b(n,"default_open",["open","in_progress",X[0]]),w=f(l.in_progress_status)??b(n,"active",["in_progress","in-progress",p],!0),h=f(l.blocked_status)??b(n,"blocked",["blocked"]),A=f(l.close_status)??b(n,"default_close",["closed","done","complete"]),g=f(l.canceled_status)??b(n,"default_cancel",["canceled","cancelled"]);return{definitions:n,by_id:s,alias_to_id:r,terminal_statuses:c,terminal_done_statuses:d,terminal_canceled_statuses:i,active_statuses:o,blocked_statuses:u,draft_statuses:a,open_status:p,in_progress_status:w,blocked_status:h,close_status:A,canceled_status:g}}function Te(e,t){const n=k(e);if(n)return t.alias_to_id.get(n)}function Re(e){const t=F(e),n=new Map,r=t.fields.map(i=>P(i)).filter(i=>i!==null);for(const i of r)n.set(i.key,i);const s=[...n.values()].sort((i,d)=>i.key.localeCompare(d.key)),o=new Map,u=new Map,a=new Map;for(const i of s){o.set(i.key,i),u.set(i.cli_flag,i);for(const d of i.cli_aliases)u.set(d,i);for(const d of i.commands){const c=a.get(d)??[];c.push(i),a.set(d,c)}}for(const[i,d]of a.entries())d.sort((c,l)=>c.key.localeCompare(l.key)),a.set(i,d);return{definitions:s,by_key:o,by_cli_token:u,command_to_fields:a}}function Me(e){return oe(e.key)}function je(e,t){const n=Te(e,t);return n?t.terminal_statuses.has(n):!1}export{m as DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,D as DEFAULT_RUNTIME_STATUS_DEFINITIONS,O as DEFAULT_RUNTIME_WORKFLOW,Ne as ensureRuntimeSchemaFileScaffold,y as filePathForSchemaSection,Ue as loadRuntimeSchemaFromOptionalFiles,F as normalizeRuntimeSchemaSettings,Te as normalizeStatusInputWithRegistry,Le as resolveItemTypesFilePath,Re as resolveRuntimeFieldRegistry,Oe as resolveRuntimeStatusRegistry,Me as runtimeFieldOptionTarget,je as statusIsTerminal};
|
|
2
|
+
`)&&s.push(o.path);return{created_paths:s}}async function Ue(e,t){const n=F(t),r=[],s=y(e,n.files.types,m.types),o=y(e,n.files.statuses,m.statuses),u=y(e,n.files.fields,m.fields),a=y(e,n.files.workflows,m.workflows);let i,d,c,l,p;const w=async(z,x)=>{const N=await v(z);if(N!==null)return pe(N,x,r)},h=await w(s,"runtime_schema_types_invalid_json");h!==void 0&&(i=ye(h),i===void 0&&r.push("runtime_schema_types_invalid_shape"));const A=await w(o,"runtime_schema_statuses_invalid_json");A!==void 0&&(d=we(A),d===void 0&&r.push("runtime_schema_statuses_invalid_shape"));const g=await w(u,"runtime_schema_fields_invalid_json");g!==void 0&&(c=Se(g),c===void 0&&r.push("runtime_schema_fields_invalid_shape"));const S=await w(a,"runtime_schema_workflows_invalid_json");return S!==void 0&&(l=he(S),l===void 0&&r.push("runtime_schema_workflows_invalid_shape"),p=Ae(S)),{schema:F({...n,statuses:[...n.statuses,...d??[]],fields:[...n.fields,...c??[]],workflow:{...n.workflow,...l},type_workflows:[...n.type_workflows??[],...p??[]]}),type_definitions_from_file:i,warnings:r,created_paths:[]}}function b(e,t,n,r=!1){const o=n.map(a=>f(a)).filter(a=>typeof a=="string").find(a=>e.some(i=>i.id===a));if(r&&o!==void 0)return o;const u=e.find(a=>a.roles.includes(t));return u!==void 0?u.id:o??e[0]?.id}function ge(e){const t=new Map,n=new Map;for(const r of e){n.set(r.id,r),t.set(r.id,r.id),t.set(r.id.replaceAll("_","-"),r.id),t.set(r.id.replaceAll("_"," "),r.id);for(const s of r.aliases)t.set(s,r.id),t.set(s.replaceAll("_","-"),r.id),t.set(s.replaceAll("_"," "),r.id)}return{aliasToId:t,byId:n}}function ke(e){const t={activeStatuses:new Set,blockedStatuses:new Set,draftStatuses:new Set,terminalCanceledStatuses:new Set,terminalDoneStatuses:new Set,terminalStatuses:new Set};for(const n of e){const r=new Set(n.roles);(r.has("terminal")||r.has("terminal_done")||r.has("terminal_canceled"))&&t.terminalStatuses.add(n.id),r.has("terminal_done")&&t.terminalDoneStatuses.add(n.id),r.has("terminal_canceled")&&t.terminalCanceledStatuses.add(n.id),r.has("active")&&t.activeStatuses.add(n.id),r.has("blocked")&&t.blockedStatuses.add(n.id),r.has("draft")&&t.draftStatuses.add(n.id)}return t}function Oe(e){const t=F(e),n=t.statuses.map((S,_)=>L(S,_)).filter(S=>S!==null),{aliasToId:r,byId:s}=ge(n),{activeStatuses:o,blockedStatuses:u,draftStatuses:a,terminalCanceledStatuses:i,terminalDoneStatuses:d,terminalStatuses:c}=ke(n),l=t.workflow,p=f(l.open_status)??b(n,"default_open",["open","in_progress",X[0]]),w=f(l.in_progress_status)??b(n,"active",["in_progress","in-progress",p],!0),h=f(l.blocked_status)??b(n,"blocked",["blocked"]),A=f(l.close_status)??b(n,"default_close",["closed","done","complete"]),g=f(l.canceled_status)??b(n,"default_cancel",["canceled","cancelled"]);return{definitions:n,by_id:s,alias_to_id:r,terminal_statuses:c,terminal_done_statuses:d,terminal_canceled_statuses:i,active_statuses:o,blocked_statuses:u,draft_statuses:a,open_status:p,in_progress_status:w,blocked_status:h,close_status:A,canceled_status:g}}function Te(e,t){const n=k(e);if(n)return t.alias_to_id.get(n)}function Re(e){const t=F(e),n=new Map,r=t.fields.map(i=>P(i)).filter(i=>i!==null);for(const i of r)n.set(i.key,i);const s=[...n.values()].sort((i,d)=>i.key.localeCompare(d.key)),o=new Map,u=new Map,a=new Map;for(const i of s){o.set(i.key,i),u.set(i.cli_flag,i);for(const d of i.cli_aliases)u.set(d,i);for(const d of i.commands){const c=a.get(d)??[];c.push(i),a.set(d,c)}}for(const[i,d]of a.entries())d.sort((c,l)=>c.key.localeCompare(l.key)),a.set(i,d);return{definitions:s,by_key:o,by_cli_token:u,command_to_fields:a}}function Me(e){return oe(e.key)}function je(e,t){const n=Te(e,t);return n?t.terminal_statuses.has(n):!1}export{m as DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,D as DEFAULT_RUNTIME_STATUS_DEFINITIONS,O as DEFAULT_RUNTIME_WORKFLOW,Ne as ensureRuntimeSchemaFileScaffold,y as filePathForSchemaSection,Ue as loadRuntimeSchemaFromOptionalFiles,M as normalizeCliToken,F as normalizeRuntimeSchemaSettings,Te as normalizeStatusInputWithRegistry,Le as resolveItemTypesFilePath,Re as resolveRuntimeFieldRegistry,Oe as resolveRuntimeStatusRegistry,Me as runtimeFieldOptionTarget,je as statusIsTerminal};
|
|
3
3
|
//# sourceMappingURL=runtime-schema.js.map
|
|
@@ -23,6 +23,9 @@ repeatable?:boolean;
|
|
|
23
23
|
default?:unknown;
|
|
24
24
|
/** `strict` refuses malformed number/boolean tokens before dispatch; `coerce` (default) forwards them. */
|
|
25
25
|
value_validation?:string;}
|
|
26
|
+
type LooseOptionCoercionKind="string"|"number"|"boolean";
|
|
27
|
+
/** The value kind a declared flag coerces to (`bool` and other supported spellings included), or null when untyped. */
|
|
28
|
+
export declare function resolveLooseOptionCoercionKind(definition:LooseCommandFlagDefinition):LooseOptionCoercionKind|null;
|
|
26
29
|
/** Collect every option key the declared flags answer to: each long flag's camel-case key and each short letter. */
|
|
27
30
|
export declare function collectLooseCommandOptionKeysForDefinitions(definitions:ReadonlyArray<LooseCommandFlagDefinition>):Set<string>;
|
|
28
31
|
/**
|
|
@@ -127,4 +130,26 @@ stop?:{atSubcommand:(token:string)=> boolean;atFirstUnrecognized:boolean;};}
|
|
|
127
130
|
* Values compare after the declared coercion, so `--count 1 -c 1` is
|
|
128
131
|
* accepted; repeats of one spelling and list flags are not checked.
|
|
129
132
|
*/
|
|
130
|
-
export declare function refuseConflictingArgvOptionSpellings(scopes:readonly ArgvOptionScope[],definitions:ReadonlyArray<LooseCommandFlagDefinition>,commandPath:string):void;
|
|
133
|
+
export declare function refuseConflictingArgvOptionSpellings(scopes:readonly ArgvOptionScope[],definitions:ReadonlyArray<LooseCommandFlagDefinition>,commandPath:string):void;
|
|
134
|
+
/**
|
|
135
|
+
* Reorder the recorded occurrences of every declared repeatable boolean switch
|
|
136
|
+
* into argv order (pm-g2zzus). Commander registers such a switch without a
|
|
137
|
+
* value, so it accumulates each bare `--many` while `--many=false` and
|
|
138
|
+
* `--no-many` reach only the loose parser; the coercer used to keep the loose
|
|
139
|
+
* occurrences alone whenever any existed, dropping the bare ones. The scan
|
|
140
|
+
* that resolves spelling conflicts walks each scope's tokens with Commander's
|
|
141
|
+
* grammar and reports, in argv order, which occurrences Commander consumed and
|
|
142
|
+
* where a loose occurrence sits; a token another option consumed is never
|
|
143
|
+
* counted. Values stay with their reader: Commander's bare occurrences come
|
|
144
|
+
* from the scan, and every loose occurrence keeps the loose parser's own
|
|
145
|
+
* value, which reads the leftover tokens after Commander removed its own (so
|
|
146
|
+
* `--Many --source x false` keeps `false`) and folds spellings Commander did
|
|
147
|
+
* not register (`--Many=false` is `many`). Only the keys the coercer reads for
|
|
148
|
+
* a switch move, so another declaration's key (`--s` beside a switch aliased
|
|
149
|
+
* `-S`) keeps its occurrences. When the scan and the loose parser disagree on
|
|
150
|
+
* how many loose occurrences there are, every value is kept, loose ones first.
|
|
151
|
+
* A switch with no loose occurrence keeps Commander's accumulated value, which
|
|
152
|
+
* a preflight override may have rewritten. Returns `occurrenceSource`
|
|
153
|
+
* unchanged when Commander consumed no repeatable switch occurrence.
|
|
154
|
+
*/
|
|
155
|
+
export declare function orderArgvRepeatableSwitchOccurrences(occurrenceSource:Record<string,unknown>,scopes:readonly ArgvOptionScope[],definitions:ReadonlyArray<LooseCommandFlagDefinition>):Record<string,unknown>;export{};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isDeepStrictEqual as V}from"node:util";import{resolvePmCommandOperation as F}from"../cli-contracts/command-aliases.js";import{describeFlagScalarValueFailure as $,resolveExtensionFlagValueContract as x,resolveExtensionLongFlagName as b,EXIT_CODE as p,PmCliError as g,flattenFlagListValue as D,resolveFlagValueKind as ee}from"../runtime-primitives.js";import{RESERVED_EXTENSION_HOST_FLAG_NAMES as ne}from"../../core/extensions/reserved-host-flags.js";const te=new Set(["__proto__","prototype","constructor"]),A=Symbol("looseOptionOccurrences");function d(e){return e.trim().toLowerCase().replaceAll(/-([a-z0-9])/g,(t,o)=>o.toUpperCase())}function re(e,n,t){const o=e[n];if(o===void 0){e[n]=t;return}if(Array.isArray(o)){o.push(t),e[n]=o;return}e[n]=[o,t]}function _(e,n){const t=e[n];if(!t.startsWith("-")||t==="-"||t==="--")return null;if(!t.startsWith("--")){const i=t.indexOf("=");if(i>=0)return{consumed:1,key:t.slice(1,i).trim(),value:t.slice(i+1),attached:!0};const a=t.slice(1).trim(),u=e[n+1];return typeof u=="string"&&!u.startsWith("-")?{consumed:2,key:a,value:u}:{consumed:1,key:a,value:!0}}const o=t.indexOf("=");if(o>=0)return{consumed:1,key:t.slice(2,o).trim(),value:t.slice(o+1),attached:!0};if(t.startsWith("--no-"))return{consumed:1,key:t.slice(5).trim(),value:!1};const r=t.slice(2).trim(),s=e[n+1];return typeof s=="string"&&!s.startsWith("-")?{consumed:2,key:r,value:s}:{consumed:1,key:r,value:!0}}function S(e){return te.has(e)}function w(e){const n=(typeof e.value_type=="string"?e.value_type:void 0)??(typeof e.type=="string"?e.type:void 0);return ee(n)}function O(e){const n=[],t=b(e.long)??"",o=typeof e.short=="string"?e.short.trim():"";if(t.startsWith("--")){const r=d(t.slice(2));r.length>0&&!S(r)&&n.push(r)}if(o.startsWith("-")&&!o.startsWith("--")){const r=d(o.slice(1));r.length>0&&!S(r)&&n.push(r)}return[...new Set(n)]}function We(e){const n=new Set;for(const t of e)for(const o of O(t))n.add(o);return n}function m(e){const n=b(e.long)??"";if(n.startsWith("--")){const t=d(n.slice(2));if(t.length>0&&!S(t))return t}return O(e)[0]??null}function y(e){const n=b(e.long)??"";if(n.startsWith("--")&&n.length>2)return n;const t=typeof e.short=="string"?e.short.trim():"";return t.startsWith("-")&&!t.startsWith("--")&&t.length>1?t:null}function W(e,n){return[...(n.definitions??e).map(o=>y(o)).filter(o=>o!==null),...n.inheritedFlags??[]]}function Te(e,n,t,o={}){if(n.length===0)return;const r=new Set,s=new Map,i=[],a=W(n,o);for(const u of n){const l=O(u),c=y(u);for(const f of l)r.add(f),u.enabled===!1&&s.set(f,c);u.required===!0&&u.enabled!==!1&&l.length>0&&i.push({keys:l,label:c,definition:u})}for(const u of Object.keys(e)){r.has(u)||T(`--${u}`,`--${u}`,t,a);const l=s.get(u);l&&q(l,t)}for(const u of i){const l=c=>Object.hasOwn(e,c)&&(u.definition.list!==!0||z(u.definition,e[c]));u.keys.some(l)||R(u.definition,u.keys[0],u.label,t)}}function T(e,n,t,o){const r=o.length>0?` Expected one of: ${[...new Set(o)].join(", ")}.`:"";throw new g(`Unknown option '${e}' for extension command '${t}'.${r}`,p.USAGE,{code:"unknown_option",flag:n,required:`Use a flag the command accepts; run pm contracts --command ${t} --flags-only --json to list them.`})}function q(e,n){throw new g(`Option '${e}' is disabled for extension command '${n}'.`,p.USAGE,{code:"extension_option_disabled",flag:e,required:`Remove ${e}; the command declares it with enabled: false.`,why:"A disabled declaration keeps the flag in the contract while refusing every value for it.",examples:[`pm ${n} --help`],nextSteps:[`Run pm contracts --command ${n} --flags-only --json to list the flags this command accepts.`]})}function R(e,n,t,o){const r=x(e),s=r.value_arity==="none"?t:r.value_arity==="optional"?`${t} [${r.value_name}]`:`${t} <${r.value_name}>`;throw new g(`Missing required option '${t}' for extension command '${o}'.`,p.USAGE,{code:"missing_required_option",flag:t,field:n,required:`Pass ${s}.`,why:"The command declares this flag as required, so pm refuses the invocation before the extension handler runs.",examples:[`pm ${o} ${s}`],nextSteps:[`Run pm contracts --command ${o} --flags-only --json to read each flag's sdk_option key.`],recovery:{missing:[t]}})}function oe(e){return typeof e=="string"||e==null?e:String(e)}function se(e){if(typeof e=="number")return e;if(typeof e=="string"&&e.trim().length>0){const n=Number(e);return Number.isFinite(n)?n:e}return e}function M(e){if(typeof e=="boolean")return e;if(typeof e=="string"){const n=e.trim().toLowerCase();if(n==="true"||n==="1")return!0;if(n==="false"||n==="0")return!1}return e}const ie={string:oe,number:se,boolean:M};function h(e,n){return Array.isArray(e)?e.map(t=>h(t,n)):ie[n](e)}function E(e,n,t){const o=t?(Array.isArray(e)?e.flat(1/0):[e]).filter(r=>r!=null&&r!==""):D(e);return n?o.map(r=>h(r,n)):o}function z(e,n){return E(n,null,e.repeatable===!0).length>0}function ae(e,n,t,o){return t?E(e,n,o):n?h(e,n):e}function ue(e,n,t){const o=U(e,n);return o.length===0?t:o.map(r=>r.value)}function k(e){return x(e).value_arity==="none"}function L(e,n,t,o,r){const s=y(e),i=r?` for extension command '${r}'`:"",a=t===!0?"no value":JSON.stringify(t);throw new g(`Option '${s}'${i} expects ${o}; received ${a}.`,p.USAGE,{code:"extension_flag_value_invalid",flag:s,required:`Pass ${s} ${n==="number"?"<number>":"<true|false|1|0>"}.`,why:`The flag declares value_type ${n} with value_validation strict, so a malformed token is refused before the extension handler runs.`,nextSteps:[`Re-run with a valid ${n} value for ${s}.`,`Run pm ${r??"<command>"} --help to review the declared flag contract.`]})}function C(e,n){return e.value_validation==="strict"&&n!=="string"}function U(e,n){const t=e[A];if(!t)return[];const o=new Set(n);return t.filter(r=>o.has(r.key))}function le(e,n,t,o){if(k(e))for(const r of U(t,n)){if(r.attached!==!0)continue;const s=e.list===!0&&e.repeatable!==!0?D(r.value):[r.value];for(const i of s){const a=$(h(i,"boolean"),"boolean");a!==null&&L(e,"boolean",i,a.expected,o)}}}function ce(e,n,t,o,r){const s=Array.isArray(t)?t.flat(1/0):[t],i=o?s:s.flatMap(a=>typeof a=="string"?a.split(","):[a]);for(const a of i)if(typeof a=="string"&&a.trim().length===0){const u=$(a,n);L(e,n,a,u.expected,r)}}function K(e,n,t,o){if(!C(e,t))return n;const r=t==="boolean"&&k(e),s=i=>{const a=$(i,t);return a===null?i:r&&typeof i=="string"?!0:L(e,t,i,a.expected,o)};return Array.isArray(n)?n.map(s):s(n)}function fe(e,n,t,o){for(const r of t)if(!(r===n||!Object.hasOwn(e,r))){if(Object.hasOwn(e,n)){if(o){const s=e[n],i=e[r];e[n]=[...Array.isArray(s)?s:[s],...Array.isArray(i)?i:[i]].filter(a=>a!=null)}delete e[r];continue}e[n]=e[r],delete e[r]}}function B(e,n,t=e,o){if(n.length===0)return e;const r=Object.create(null);for(const[i,a]of Object.entries(e))r[i]=a;const s=new Set(n.map(i=>m(i)).filter(i=>i!==null));for(const i of n){const a=m(i);if(a){const u=O(i).filter(l=>l===a||!s.has(l));de(r,i,a,u,t,o)}}return r}function de(e,n,t,o,r,s){const i=n.list===!0,a=w(n);a&&!i&&pe(e,n,t,o,a,s),fe(e,t,o,i);const u=n.repeatable===!0;if(!Object.hasOwn(e,t)){n.default!==void 0&&(e[t]=ae(n.default,a,i,u));return}if(a==="boolean"&&C(n,a)&&le(n,o,r,s),i){e[t]=ge(n,o,r,e[t],a,u,s);return}a&&(e[t]=K(n,h(e[t],a),a,s))}function pe(e,n,t,o,r,s){for(const i of o)i!==t&&Object.hasOwn(e,i)&&K(n,h(e[i],r),r,s)}function ge(e,n,t,o,r,s,i){const a=ue(t,n,o);r&&C(e,r)&&ce(e,r,a,s,i);const u=E(a,r,s);return r?K(e,u,r,i):u}function qe(e){const n=Object.create(null),t=[];Object.defineProperty(n,A,{value:t});let o=0;for(;o<e.length;){const r=_(e,o);if(!r){o+=1;continue}const s=d(r.key);if(s.length===0||S(s)){o+=r.consumed;continue}re(n,s,r.value),t.push({...r,key:s}),o+=r.consumed}return n}function Re(e){const n=[];let t=0;for(;t<e.length;){if(e[t]==="--"){n.push(...e.slice(t+1));break}const o=_(e,t);if(o){t+=Math.max(1,o.consumed);continue}n.push(e[t]),t+=1}return n}function Me(e,n){if(n.length===0)return[...e];const t=new Set,o=new Set;for(const i of n){const a=w(i);for(const u of O(i))t.add(u),a==="boolean"&&o.add(u)}if(t.size===0)return[...e];const r=[];let s=0;for(;s<e.length;){if(e[s]==="--"){r.push(...e.slice(s+1));break}const i=_(e,s);if(i){const a=d(i.key);if(t.has(a)){const u=e[s],l=o.has(a)&&!u.includes("=")?1:i.consumed;s+=l;continue}}r.push(e[s]),s+=1}return r}function ze(e){return m(e)}function I(e){return e.trim().toLowerCase().split(/\s+/u).filter(n=>n.length>0).join(" ")}function ke(e,n){const t=I(n);if(t.length===0)return[];const o=F(t);return e.flags.filter(r=>F(I(r.target_command))===o).flatMap(r=>[...r.flags])}function G(e,n,t,o){const r=y(e),[s,i]=t;throw new g(`Options '${s}' and '${i}' both set ${r} for extension command '${o}' with different values.`,p.USAGE,{code:"extension_option_spelling_conflict",required:`Pass ${r} once, under the handler key '${n}'.`,why:`'${s}' and '${i}' are spellings of the same declared flag, and pm refuses to choose between two different values.`,nextSteps:[`Remove '${s}' or '${i}' and pass one value as '${n}'.`,`Run pm contracts --command ${o} --flags-only --json to read each flag's sdk_option key.`]})}function Ue(e,n,t,o={}){if(n.length===0)return e;const r=n.map(c=>c.repeatable===!0&&c.list!==!0?{...c,list:!0}:c),s=Oe(r),i=we(e,s,t),a=new Set([...s.long.values()].map(({handlerKey:c})=>c)),u=Object.create(null),l=Object.create(null);for(const[c,f]of Object.entries(i))a.has(c)?u[c]=f:f===void 0||o.undeclaredKeys==="pass"||me(c)?l[c]=f:T(c,ye(c),t,W(r,{}));return J(u,r,t),Object.assign(l,B(u,r,H(u,s),t))}function H(e,n){const t=new Set([...n.long.values()].map(({handlerKey:s})=>s)),o=Object.entries(e).filter(([s])=>t.has(s)).flatMap(([s,i])=>(Array.isArray(i)?i.flat(1/0):[i]).map(a=>({consumed:1,key:s,value:a,attached:!0}))),r=Object.create(null);return Object.defineProperty(r,A,{value:o}),r}function J(e,n,t){for(const o of n){const r=m(o);if(r===null)continue;const s=y(o),i=e[r],a=Object.hasOwn(e,r);o.enabled===!1&&a&&q(s,t);const u=a&&(o.list!==!0||z(o,i));o.required===!0&&o.enabled!==!1&&!u&&R(o,r,s,t),o.list!==!0&&Array.isArray(i)&&he(s,t)}}function he(e,n){throw new g(`Option '${e}' for extension command '${n}' takes one value; received an array.`,p.USAGE,{code:"extension_flag_value_invalid",flag:e,required:`Pass one value for ${e}, or ask the package to declare it with list: true or repeatable: true.`,why:"The flag is not declared list or repeatable, so pm refuses an array before the extension handler runs instead of handing it a value of the wrong shape.",nextSteps:[`Run pm contracts --command ${n} --flags-only --json to read each flag's value contract.`]})}const X=new Set([...[...ne].flatMap(e=>{const n=e.replace(/^--/u,"");return[n,...n.startsWith("no-")?[n.slice(3)]:[]].flatMap(o=>[d(o),o.replaceAll("-","_")])}),"force","subcommand","inputResponses","requestState"]);function me(e){return X.has(e)||X.has(d(e.replace(/^-{1,2}/u,"")))}function ye(e){return`--${e.replace(/^-+/u,"").replace(/([a-z0-9])([A-Z])/gu,"$1-$2").replaceAll("_","-").toLowerCase()}`}function Oe(e){const n={long:new Map,short:new Map},t=(o,r,s)=>{r.length>0&&!o.has(r)&&o.set(r,s)};for(const o of e){const r=m(o);if(r===null)continue;const s={handlerKey:r,definition:o};t(n.long,r,s);const i=typeof o.short=="string"?o.short.trim():"";i.startsWith("-")&&!i.startsWith("--")&&t(n.short,i.slice(1),s)}return n}function j(e,n){return e.long.get(n)??e.short.get(n.replace(/^-(?!-)/u,""))??e.long.get(d(n.replace(/^-{1,2}/u,"")))}function be(e,n,t,o){const r=/^(?:--)?no-(.+)$/u.exec(n)?.[1];if(r===void 0||j(e,n)!==void 0)return{spelling:n,value:t};const s=j(e,r);return s===void 0||w(s.definition)!=="boolean"?{spelling:n,value:t}:(s.definition.list===!0||s.definition.repeatable===!0)&&Array.isArray(t)?{spelling:r,value:t.flat(1/0).map(i=>Y(n,s.definition,i,o))}:s.definition.list===!0&&t!==void 0?{spelling:r,value:Y(n,s.definition,t,o)}:{spelling:r,value:t===void 0?t:v(n,s.definition,t,o)}}function Y(e,n,t,o){const r=s=>s.trim().length===0?s:String(v(e,n,s.trim(),o));return t==null?t:typeof t!="string"?v(e,n,t,o):t.trim().length===0?t:n.repeatable===!0||!t.includes(",")?v(e,n,t,o):t.split(",").map(r).join(",")}function v(e,n,t,o){const r=M(t);return typeof r=="boolean"?!r:Se(e,n,t,o)}function Se(e,n,t,o){const r=y(n);throw new g(`Option '${e}' for extension command '${o}' negates ${r} and expects true, false, 1, or 0; received ${JSON.stringify(t)}.`,p.USAGE,{code:"extension_flag_value_invalid",flag:r,required:`Pass ${r} as true or false, or '${e}' as true.`,why:`'${e}' is the negated spelling of the boolean ${r}, so only a boolean value can be inverted before the extension handler runs.`,nextSteps:[`Run pm contracts --command ${o} --flags-only --json to read each flag's value contract.`]})}function we(e,n,t){const o=Object.create(null),r=new Map;for(const[s,i]of Object.entries(e)){const{spelling:a,value:u}=be(n,s,i,t),l=j(n,a);if(l===void 0)o[a]=u;else if(u!==void 0){const c=r.get(l.handlerKey);c===void 0?(r.set(l.handlerKey,a),o[l.handlerKey]=u):V(Z(l.definition,l.handlerKey,o[l.handlerKey],n,t),Z(l.definition,l.handlerKey,u,n,t))||G(l.definition,l.handlerKey,[c,a],t)}}return o}function Z(e,n,t,o,r){const s={[n]:t};return J(s,[e],r),B(s,[e],H(s,o),r)[n]}function ve(e){const n=new Map;for(const t of e){const o=m(t);if(o===null)continue;const r={definition:t,handlerKey:o,kind:w(t),arity:x(t).value_arity,scalar:t.list!==!0},s=[b(t.long),typeof t.short=="string"?t.short.trim():""];for(const i of s.filter(a=>a?.startsWith("-")===!0))n.has(i)||n.set(i,r)}return n}function $e(e,n,t){const o=e.optionOf(t),r=n.get(t),s=r?.scalar===!0?r:void 0;if(o!==void 0){const i={arity:o.arity,...o.variadic===!0?{variadic:!0}:{}};if(s?.handlerKey===o.key)return{...i,declared:s};const a=r===void 0&&t.startsWith("--no-")?n.get(`--${t.slice(5)}`):void 0;return a?.scalar===!0&&a.kind==="boolean"&&a.handlerKey===o.key?{...i,declared:a,negates:!0}:i}if(!(!e.includesLooseFlags||r===void 0))return s===void 0?{arity:r.arity,loose:!0}:{arity:r.arity,declared:s,loose:!0}}function N(e){return e.length>1&&e.startsWith("-")}const Q=/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/u;function xe(e,n,t){const{tokens:o}=e;let r=0,s,i=!1,a=!1;for(;r<o.length||s!==void 0;){const u=s??o[r++];if(u==="--")return;if(a&&s===void 0&&Ae(e,u))continue;const l=N(u)?Ee(e,u,o[r],n,t):{consumedByCommander:!1,consumed:0};if(r+=l.consumed,s=l.group,a=l.variadic===!0,!l.consumedByCommander){if(_e(e.stop,u,i))return;i=!0}}}function Ae(e,n){return!N(n)||e.negativeNumbersAreValues&&Q.test(n)}function _e(e,n,t){return e!==void 0&&(e.atFirstUnrecognized||!t&&e.atSubcommand(n))}function Ee(e,n,t,o,r){const s=Le(n,t,o);if(s!==void 0)return r(s.spelling,s.entry,s.value),{consumedByCommander:!1,consumed:s.consumed};const i=o(n);if(i!==void 0){const a=i.arity==="required"||i.arity==="optional"&&t!==void 0&&(!N(t)||e.negativeNumbersAreValues&&Q.test(t));return r(n,i,i.negates===!0?!1:a?t:!0),{consumedByCommander:!0,consumed:a?1:0,variadic:i.variadic===!0}}return n[1]!=="-"?{consumed:0,...Ce(n,o,r)}:{consumedByCommander:Ke(n,o,r,e.includesLooseFlags?r:()=>{}),consumed:0}}function Le(e,n,t){const o=e.indexOf("="),r=o>1?e.slice(0,o):e,s=t(r);if(s?.loose===!0)return o>1?{spelling:r,entry:s,value:e.slice(o+1),consumed:0}:n!==void 0&&!n.startsWith("-")?{spelling:r,entry:s,value:n,consumed:1}:{spelling:r,entry:s,value:!0,consumed:0};const i=o<0&&e.startsWith("--no-")?t(`--${e.slice(5)}`):void 0;return i?.loose===!0&&i.declared?.kind==="boolean"?{spelling:e,entry:i,value:!1,consumed:0}:void 0}function Ce(e,n,t){const o=e.slice(0,2),r=e.length>2?n(o):void 0;return r===void 0||r.loose===!0?{consumedByCommander:!1}:r.arity!=="none"?(t(o,r,e.slice(2)),{consumedByCommander:!0}):(t(o,r,!0),{consumedByCommander:!0,group:`-${e.slice(2)}`})}function Ke(e,n,t,o){const r=e.indexOf("=");if(r>2){const i=e.slice(0,r),a=n(i);return a!==void 0&&a.arity!=="none"?(t(i,a,e.slice(r+1)),!0):(a?.declared?.kind==="boolean"&&o(i,a,e.slice(r+1)),!1)}const s=e.startsWith("--no-")?n(`--${e.slice(5)}`):void 0;return s?.declared?.kind==="boolean"&&o(e,s,!1),!1}function Be(e,n,t){const o=ve(n),r=new Map;for(const s of e)xe(s,i=>$e(s,o,i),(i,a,u)=>{a.declared!==void 0&&je(r,a.declared,i,u,t)})}function je(e,n,t,o,r){const{definition:s,handlerKey:i,kind:a}=n,u=a?h(o,a):o,l=e.get(i)??new Map,c=[...l].find(([f,P])=>f!==t&&!V(P,u));c!==void 0&&G(s,i,[c[0],t],r),l.set(t,u),e.set(i,l)}export{B as coerceLooseCommandOptionsWithFlagDefinitions,ke as collectExtensionFlagDefinitionsForCommand,We as collectLooseCommandOptionKeysForDefinitions,Re as collectLoosePositionalArgs,Ue as normalizeDirectExtensionCommandOptions,qe as parseLooseCommandOptions,Be as refuseConflictingArgvOptionSpellings,ze as resolveExtensionFlagOptionKey,Me as stripLooseCommandOptionTokens,Te as validateLooseCommandOptionsWithFlagDefinitions};
|
|
1
|
+
import{isDeepStrictEqual as T}from"node:util";import{resolvePmCommandOperation as k}from"../cli-contracts/command-aliases.js";import{describeFlagScalarValueFailure as j,resolveExtensionFlagValueContract as F,resolveExtensionLongFlagName as L,EXIT_CODE as m,PmCliError as y,flattenFlagListValue as z,resolveFlagValueKind as fe}from"../runtime-primitives.js";import{RESERVED_EXTENSION_HOST_FLAG_NAMES as de}from"../../core/extensions/reserved-host-flags.js";const pe=new Set(["__proto__","prototype","constructor"]),x=Symbol("looseOptionOccurrences");function h(e){return e.trim().toLowerCase().replaceAll(/-([a-z0-9])/g,(t,o)=>o.toUpperCase())}function ge(e,n,t){const o=e[n];if(o===void 0){e[n]=t;return}if(Array.isArray(o)){o.push(t),e[n]=o;return}e[n]=[o,t]}function N(e,n){const t=e[n];if(!t.startsWith("-")||t==="-"||t==="--")return null;if(!t.startsWith("--")){const i=t.indexOf("=");if(i>=0)return{consumed:1,key:t.slice(1,i).trim(),value:t.slice(i+1),attached:!0};const a=t.slice(1).trim(),l=e[n+1];return typeof l=="string"&&!l.startsWith("-")?{consumed:2,key:a,value:l}:{consumed:1,key:a,value:!0}}const o=t.indexOf("=");if(o>=0)return{consumed:1,key:t.slice(2,o).trim(),value:t.slice(o+1),attached:!0};if(t.startsWith("--no-"))return{consumed:1,key:t.slice(5).trim(),value:!1};const r=t.slice(2).trim(),s=e[n+1];return typeof s=="string"&&!s.startsWith("-")?{consumed:2,key:r,value:s}:{consumed:1,key:r,value:!0}}function E(e){return pe.has(e)}function C(e){const n=(typeof e.value_type=="string"?e.value_type:void 0)??(typeof e.type=="string"?e.type:void 0);return fe(n)}function v(e){const n=[],t=L(e.long)??"",o=typeof e.short=="string"?e.short.trim():"";if(t.startsWith("--")){const r=h(t.slice(2));r.length>0&&!E(r)&&n.push(r)}if(o.startsWith("-")&&!o.startsWith("--")){const r=h(o.slice(1));r.length>0&&!E(r)&&n.push(r)}return[...new Set(n)]}function He(e){const n=new Set;for(const t of e)for(const o of v(t))n.add(o);return n}function O(e){const n=L(e.long)??"";if(n.startsWith("--")){const t=h(n.slice(2));if(t.length>0&&!E(t))return t}return v(e)[0]??null}function $(e){const n=L(e.long)??"";if(n.startsWith("--")&&n.length>2)return n;const t=typeof e.short=="string"?e.short.trim():"";return t.startsWith("-")&&!t.startsWith("--")&&t.length>1?t:null}function U(e,n){return[...(n.definitions??e).map(o=>$(o)).filter(o=>o!==null),...n.inheritedFlags??[]]}function Je(e,n,t,o={}){if(n.length===0)return;const r=new Set,s=new Map,i=[],a=U(n,o);for(const l of n){const u=v(l),c=$(l);for(const g of u)r.add(g),l.enabled===!1&&s.set(g,c);l.required===!0&&l.enabled!==!1&&u.length>0&&i.push({keys:u,label:c,definition:l})}for(const l of Object.keys(e)){r.has(l)||B(`--${l}`,`--${l}`,t,a);const u=s.get(l);u&&I(u,t)}for(const l of i){const u=c=>Object.hasOwn(e,c)&&(l.definition.list!==!0||J(l.definition,e[c]));l.keys.some(u)||G(l.definition,l.keys[0],l.label,t)}}function B(e,n,t,o){const r=o.length>0?` Expected one of: ${[...new Set(o)].join(", ")}.`:"";throw new y(`Unknown option '${e}' for extension command '${t}'.${r}`,m.USAGE,{code:"unknown_option",flag:n,required:`Use a flag the command accepts; run pm contracts --command ${t} --flags-only --json to list them.`})}function I(e,n){throw new y(`Option '${e}' is disabled for extension command '${n}'.`,m.USAGE,{code:"extension_option_disabled",flag:e,required:`Remove ${e}; the command declares it with enabled: false.`,why:"A disabled declaration keeps the flag in the contract while refusing every value for it.",examples:[`pm ${n} --help`],nextSteps:[`Run pm contracts --command ${n} --flags-only --json to list the flags this command accepts.`]})}function G(e,n,t,o){const r=F(e),s=r.value_arity==="none"?t:r.value_arity==="optional"?`${t} [${r.value_name}]`:`${t} <${r.value_name}>`;throw new y(`Missing required option '${t}' for extension command '${o}'.`,m.USAGE,{code:"missing_required_option",flag:t,field:n,required:`Pass ${s}.`,why:"The command declares this flag as required, so pm refuses the invocation before the extension handler runs.",examples:[`pm ${o} ${s}`],nextSteps:[`Run pm contracts --command ${o} --flags-only --json to read each flag's sdk_option key.`],recovery:{missing:[t]}})}function he(e){return typeof e=="string"||e==null?e:String(e)}function me(e){if(typeof e=="number")return e;if(typeof e=="string"&&e.trim().length>0){const n=Number(e);return Number.isFinite(n)?n:e}return e}function H(e){if(typeof e=="boolean")return e;if(typeof e=="string"){const n=e.trim().toLowerCase();if(n==="true"||n==="1")return!0;if(n==="false"||n==="0")return!1}return e}const ye={string:he,number:me,boolean:H};function b(e,n){return Array.isArray(e)?e.map(t=>b(t,n)):ye[n](e)}function V(e,n,t){const o=t?(Array.isArray(e)?e.flat(1/0):[e]).filter(r=>r!=null&&r!==""):z(e);return n?o.map(r=>b(r,n)):o}function J(e,n){return V(n,null,e.repeatable===!0).length>0}function Oe(e,n,t,o){return t?V(e,n,o):n?b(e,n):e}function be(e,n,t){const o=Y(e,n);return o.length===0?t:o.map(r=>r.value)}function X(e){return F(e).value_arity==="none"}function q(e,n,t,o,r){const s=$(e),i=r?` for extension command '${r}'`:"",a=t===!0?"no value":JSON.stringify(t);throw new y(`Option '${s}'${i} expects ${o}; received ${a}.`,m.USAGE,{code:"extension_flag_value_invalid",flag:s,required:`Pass ${s} ${n==="number"?"<number>":"<true|false|1|0>"}.`,why:`The flag declares value_type ${n} with value_validation strict, so a malformed token is refused before the extension handler runs.`,nextSteps:[`Re-run with a valid ${n} value for ${s}.`,`Run pm ${r??"<command>"} --help to review the declared flag contract.`]})}function D(e,n){return e.value_validation==="strict"&&n!=="string"}function Y(e,n){const t=e[x];if(!t)return[];const o=new Set(n);return t.filter(r=>o.has(r.key))}function we(e,n,t,o){if(X(e))for(const r of Y(t,n)){if(r.attached!==!0)continue;const s=e.list===!0&&e.repeatable!==!0?z(r.value):[r.value];for(const i of s){const a=j(b(i,"boolean"),"boolean");a!==null&&q(e,"boolean",i,a.expected,o)}}}function Se(e,n,t,o,r){const s=Array.isArray(t)?t.flat(1/0):[t],i=o?s:s.flatMap(a=>typeof a=="string"?a.split(","):[a]);for(const a of i)if(typeof a=="string"&&a.trim().length===0){const l=j(a,n);q(e,n,a,l.expected,r)}}function R(e,n,t,o){if(!D(e,t))return n;const r=t==="boolean"&&X(e),s=i=>{const a=j(i,t);return a===null?i:r&&typeof i=="string"?!0:q(e,t,i,a.expected,o)};return Array.isArray(n)?n.map(s):s(n)}function ve(e,n,t,o){for(const r of t)if(!(r===n||!Object.hasOwn(e,r))){if(Object.hasOwn(e,n)){if(o){const s=e[n],i=e[r];e[n]=[...Array.isArray(s)?s:[s],...Array.isArray(i)?i:[i]].filter(a=>a!=null)}delete e[r];continue}e[n]=e[r],delete e[r]}}function Z(e,n,t=e,o){if(n.length===0)return e;const r=Object.create(null);for(const[i,a]of Object.entries(e))r[i]=a;const s=new Set(n.map(i=>O(i)).filter(i=>i!==null));for(const i of n){const a=O(i);if(a){const l=v(i).filter(u=>u===a||!s.has(u));$e(r,i,a,l,t,o)}}return r}function $e(e,n,t,o,r,s){const i=n.list===!0,a=C(n);a&&!i&&xe(e,n,t,o,a,s),ve(e,t,o,i);const l=n.repeatable===!0;if(!Object.hasOwn(e,t)){n.default!==void 0&&(e[t]=Oe(n.default,a,i,l));return}if(a==="boolean"&&D(n,a)&&we(n,o,r,s),i){e[t]=Ae(n,o,r,e[t],a,l,s);return}a&&(e[t]=R(n,b(e[t],a),a,s))}function xe(e,n,t,o,r,s){for(const i of o)i!==t&&Object.hasOwn(e,i)&&R(n,b(e[i],r),r,s)}function Ae(e,n,t,o,r,s,i){const a=be(t,n,o);r&&D(e,r)&&Se(e,r,a,s,i);const l=V(a,r,s);return r?R(e,l,r,i):l}function Xe(e){const n=Object.create(null),t=[];Object.defineProperty(n,x,{value:t});let o=0;for(;o<e.length;){const r=N(e,o);if(!r){o+=1;continue}const s=h(r.key);if(s.length===0||E(s)){o+=r.consumed;continue}ge(n,s,r.value),t.push({...r,key:s}),o+=r.consumed}return n}function Ye(e){const n=[];let t=0;for(;t<e.length;){if(e[t]==="--"){n.push(...e.slice(t+1));break}const o=N(e,t);if(o){t+=Math.max(1,o.consumed);continue}n.push(e[t]),t+=1}return n}function Ze(e,n){if(n.length===0)return[...e];const t=new Set,o=new Set;for(const i of n){const a=C(i);for(const l of v(i))t.add(l),a==="boolean"&&o.add(l)}if(t.size===0)return[...e];const r=[];let s=0;for(;s<e.length;){if(e[s]==="--"){r.push(...e.slice(s+1));break}const i=N(e,s);if(i){const a=h(i.key);if(t.has(a)){const l=e[s],u=o.has(a)&&!l.includes("=")?1:i.consumed;s+=u;continue}}r.push(e[s]),s+=1}return r}function Qe(e){return O(e)}function Q(e){return e.trim().toLowerCase().split(/\s+/u).filter(n=>n.length>0).join(" ")}function Pe(e,n){const t=Q(n);if(t.length===0)return[];const o=k(t);return e.flags.filter(r=>k(Q(r.target_command))===o).flatMap(r=>[...r.flags])}function P(e,n,t,o){const r=$(e),[s,i]=t;throw new y(`Options '${s}' and '${i}' both set ${r} for extension command '${o}' with different values.`,m.USAGE,{code:"extension_option_spelling_conflict",required:`Pass ${r} once, under the handler key '${n}'.`,why:`'${s}' and '${i}' are spellings of the same declared flag, and pm refuses to choose between two different values.`,nextSteps:[`Remove '${s}' or '${i}' and pass one value as '${n}'.`,`Run pm contracts --command ${o} --flags-only --json to read each flag's sdk_option key.`]})}function en(e,n,t,o={}){if(n.length===0)return e;const r=n.map(c=>c.repeatable===!0&&c.list!==!0?{...c,list:!0}:c),s=Ce(r),i=Fe(e,s,t),a=new Set([...s.long.values()].map(({handlerKey:c})=>c)),l=Object.create(null),u=Object.create(null);for(const[c,g]of Object.entries(i))a.has(c)?l[c]=g:g===void 0||o.undeclaredKeys==="pass"||Le(c)?u[c]=g:B(c,Ee(c),t,U(r,{}));return ne(l,r,t),Object.assign(u,Z(l,r,ee(l,s),t))}function ee(e,n){const t=new Set([...n.long.values()].map(({handlerKey:s})=>s)),o=Object.entries(e).filter(([s])=>t.has(s)).flatMap(([s,i])=>(Array.isArray(i)?i.flat(1/0):[i]).map(a=>({consumed:1,key:s,value:a,attached:!0}))),r=Object.create(null);return Object.defineProperty(r,x,{value:o}),r}function ne(e,n,t){for(const o of n){const r=O(o);if(r===null)continue;const s=$(o),i=e[r],a=Object.hasOwn(e,r);o.enabled===!1&&a&&I(s,t);const l=a&&(o.list!==!0||J(o,i));o.required===!0&&o.enabled!==!1&&!l&&G(o,r,s,t),o.list!==!0&&Array.isArray(i)&&_e(s,t)}}function _e(e,n){throw new y(`Option '${e}' for extension command '${n}' takes one value; received an array.`,m.USAGE,{code:"extension_flag_value_invalid",flag:e,required:`Pass one value for ${e}, or ask the package to declare it with list: true or repeatable: true.`,why:"The flag is not declared list or repeatable, so pm refuses an array before the extension handler runs instead of handing it a value of the wrong shape.",nextSteps:[`Run pm contracts --command ${n} --flags-only --json to read each flag's value contract.`]})}const te=new Set([...[...de].flatMap(e=>{const n=e.replace(/^--/u,"");return[n,...n.startsWith("no-")?[n.slice(3)]:[]].flatMap(o=>[h(o),o.replaceAll("-","_")])}),"force","subcommand","inputResponses","requestState"]);function Le(e){return te.has(e)||te.has(h(e.replace(/^-{1,2}/u,"")))}function Ee(e){return`--${e.replace(/^-+/u,"").replace(/([a-z0-9])([A-Z])/gu,"$1-$2").replaceAll("_","-").toLowerCase()}`}function Ce(e){const n={long:new Map,short:new Map},t=(o,r,s)=>{r.length>0&&!o.has(r)&&o.set(r,s)};for(const o of e){const r=O(o);if(r===null)continue;const s={handlerKey:r,definition:o};t(n.long,r,s);const i=typeof o.short=="string"?o.short.trim():"";i.startsWith("-")&&!i.startsWith("--")&&t(n.short,i.slice(1),s)}return n}function W(e,n){return e.long.get(n)??e.short.get(n.replace(/^-(?!-)/u,""))??e.long.get(h(n.replace(/^-{1,2}/u,"")))}function Ke(e,n,t,o){const r=/^(?:--)?no-(.+)$/u.exec(n)?.[1];if(r===void 0||W(e,n)!==void 0)return{spelling:n,value:t};const s=W(e,r);return s===void 0||C(s.definition)!=="boolean"?{spelling:n,value:t}:(s.definition.list===!0||s.definition.repeatable===!0)&&Array.isArray(t)?{spelling:r,value:t.flat(1/0).map(i=>re(n,s.definition,i,o))}:s.definition.list===!0&&t!==void 0?{spelling:r,value:re(n,s.definition,t,o)}:{spelling:r,value:t===void 0?t:K(n,s.definition,t,o)}}function re(e,n,t,o){const r=s=>s.trim().length===0?s:String(K(e,n,s.trim(),o));return t==null?t:typeof t!="string"?K(e,n,t,o):t.trim().length===0?t:n.repeatable===!0||!t.includes(",")?K(e,n,t,o):t.split(",").map(r).join(",")}function K(e,n,t,o){const r=H(t);return typeof r=="boolean"?!r:je(e,n,t,o)}function je(e,n,t,o){const r=$(n);throw new y(`Option '${e}' for extension command '${o}' negates ${r} and expects true, false, 1, or 0; received ${JSON.stringify(t)}.`,m.USAGE,{code:"extension_flag_value_invalid",flag:r,required:`Pass ${r} as true or false, or '${e}' as true.`,why:`'${e}' is the negated spelling of the boolean ${r}, so only a boolean value can be inverted before the extension handler runs.`,nextSteps:[`Run pm contracts --command ${o} --flags-only --json to read each flag's value contract.`]})}function Fe(e,n,t){const o=Object.create(null),r=new Map;for(const[s,i]of Object.entries(e)){const{spelling:a,value:l}=Ke(n,s,i,t),u=W(n,a);if(u===void 0)o[a]=l;else if(l!==void 0){const c=r.get(u.handlerKey);c===void 0?(r.set(u.handlerKey,a),o[u.handlerKey]=l):T(oe(u.definition,u.handlerKey,o[u.handlerKey],n,t),oe(u.definition,u.handlerKey,l,n,t))||P(u.definition,u.handlerKey,[c,a],t)}}return o}function oe(e,n,t,o,r){const s={[n]:t};return ne(s,[e],r),Z(s,[e],ee(s,o),r)[n]}function se(e){const n=new Map;for(const t of e){const o=O(t);if(o===null)continue;const r={definition:t,handlerKey:o,kind:C(t),arity:F(t).value_arity,scalar:t.list!==!0},s=[L(t.long),typeof t.short=="string"?t.short.trim():""];for(const i of s.filter(a=>a?.startsWith("-")===!0))n.has(i)||n.set(i,r)}return n}function ie(e,n,t,o=ke){const r=e.optionOf(t),s=n.get(t),i=s!==void 0&&o(s)?s:void 0;if(r!==void 0){const a={arity:r.arity,...r.variadic===!0?{variadic:!0}:{}};if(i?.handlerKey===r.key)return{...a,declared:i};if(s!==void 0)return a;const l=Te(n,t,r,o);return l===void 0?a:{...a,declared:l,negates:!0}}if(!(!e.includesLooseFlags||s===void 0))return i===void 0?{arity:s.arity,loose:!0}:{arity:s.arity,declared:i,loose:!0}}function M(e){return e.length>1&&e.startsWith("-")}const ae=/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/u;function le(e,n,t){const{tokens:o}=e;let r=0,s,i=!1,a=!1;for(;r<o.length||s!==void 0;){const l=s??o[r++];if(l==="--")return;if(a&&s===void 0&&Ne(e,l))continue;const u=M(l)?qe(e,l,o[r],n,t):{consumedByCommander:!1,consumed:0};if(r+=u.consumed,s=u.group,a=u.variadic===!0,!u.consumedByCommander){if(Ve(e.stop,l,i))return;i=!0}}}function Ne(e,n){return!M(n)||e.negativeNumbersAreValues&&ae.test(n)}function Ve(e,n,t){return e!==void 0&&(e.atFirstUnrecognized||!t&&e.atSubcommand(n))}function qe(e,n,t,o,r){const s=De(n,t,o);if(s!==void 0)return r(s.spelling,s.entry,s.value,"loose"),{consumedByCommander:!1,consumed:s.consumed};const i=o(n);if(i!==void 0){const a=i.arity==="required"||i.arity==="optional"&&t!==void 0&&(!M(t)||e.negativeNumbersAreValues&&ae.test(t));return r(n,i,i.negates===!0?!1:a?t:!0,"commander"),{consumedByCommander:!0,consumed:a?1:0,variadic:i.variadic===!0}}return n[1]!=="-"?{consumed:0,...Re(n,o,r)}:{consumedByCommander:We(n,o,r,e.includesLooseFlags?r:()=>{}),consumed:0}}function De(e,n,t){const o=e.indexOf("="),r=o>1?e.slice(0,o):e,s=t(r);if(s?.loose===!0)return o>1?{spelling:r,entry:s,value:e.slice(o+1),consumed:0}:n!==void 0&&!n.startsWith("-")?{spelling:r,entry:s,value:n,consumed:1}:{spelling:r,entry:s,value:!0,consumed:0};const i=o<0&&e.startsWith("--no-")?t(`--${e.slice(5)}`):void 0;return i?.loose===!0&&i.declared?.kind==="boolean"?{spelling:e,entry:i,value:!1,consumed:0}:void 0}function Re(e,n,t){const o=e.slice(0,2),r=e.length>2?n(o):void 0;return r===void 0||r.loose===!0?{consumedByCommander:!1}:r.arity!=="none"?(t(o,r,e.slice(2),"commander"),{consumedByCommander:!0}):(t(o,r,!0,"commander"),{consumedByCommander:!0,group:`-${e.slice(2)}`})}function We(e,n,t,o){const r=e.indexOf("=");if(r>2){const i=e.slice(0,r),a=n(i);return a!==void 0&&a.arity!=="none"?(t(i,a,e.slice(r+1),"commander"),!0):(a?.declared?.kind==="boolean"&&o(i,a,e.slice(r+1),"loose"),!1)}const s=e.startsWith("--no-")?n(`--${e.slice(5)}`):void 0;return s?.declared?.kind==="boolean"&&o(e,s,!1,"loose"),!1}function nn(e,n,t){const o=se(n),r=new Map;for(const s of e)le(s,i=>ie(s,o,i),(i,a,l)=>{a.declared!==void 0&&Me(r,a.declared,i,l,t)})}function Me(e,n,t,o,r){const{definition:s,handlerKey:i,kind:a}=n,l=a?b(o,a):o,u=e.get(i)??new Map,c=[...u].find(([g,f])=>g!==t&&!T(f,l));c!==void 0&&P(s,i,[c[0],t],r),u.set(t,l),e.set(i,u)}function Te(e,n,t,o){const r=n.startsWith("--no-")?e.get(`--${n.slice(5)}`):void 0;return r!==void 0&&o(r)&&r.kind==="boolean"&&r.handlerKey===t.key?r:void 0}function ke(e){return e.scalar}function ue(e){return!e.scalar&&e.kind==="boolean"&&e.arity==="none"}function tn(e,n,t){const o=se(t),r=[...new Set(o.values())].filter(ue);if(r.length===0)return e;const s=new Set(t.map(f=>O(f)).filter(f=>f!==null)),i=f=>v(f.definition).filter(d=>d===f.handlerKey||!s.has(d)),a=new Map([...r].reverse().flatMap(f=>i(f).map(d=>[d,f]))),l=new Map;for(const f of n)le(f,d=>ie(f,o,d,ue)??ze(f,a,d),(d,w,S,A)=>{if(w.declared===void 0)return;const _=l.get(w.declared)??[];_.push(A==="commander"?{value:S}:null),l.set(w.declared,_)});const u=[...l].filter(([,f])=>f.some(d=>d!==null));if(u.length===0)return e;let c=e[x]??[];for(const[f,d]of u){const w=new Set(i(f)),S=c.filter(({key:p})=>w.has(p));if(S.length===0)continue;const A=p=>({consumed:0,key:f.handlerKey,value:p.value});let _=0;const ce=d.filter(p=>p===null).length===S.length?d.map(p=>p===null?S[_++]:A(p)):[...S,...d.filter(p=>p!==null).map(A)];c=[...c.filter(({key:p})=>!w.has(p)),...ce]}const g=Object.assign(Object.create(null),e);return Object.defineProperty(g,x,{value:c}),g}function ze(e,n,t){const o=!t.startsWith("--")&&e.optionOf(t.slice(0,2))!==void 0;if(!e.includesLooseFlags||o)return;const r=n.get(h(t.replace(/^-+/u,"")));return r===void 0?void 0:{arity:r.arity,declared:r,loose:!0}}export{Z as coerceLooseCommandOptionsWithFlagDefinitions,Pe as collectExtensionFlagDefinitionsForCommand,He as collectLooseCommandOptionKeysForDefinitions,Ye as collectLoosePositionalArgs,en as normalizeDirectExtensionCommandOptions,tn as orderArgvRepeatableSwitchOccurrences,Xe as parseLooseCommandOptions,nn as refuseConflictingArgvOptionSpellings,Qe as resolveExtensionFlagOptionKey,C as resolveLooseOptionCoercionKind,Ze as stripLooseCommandOptionTokens,Je as validateLooseCommandOptionsWithFlagDefinitions};
|
|
2
2
|
//# sourceMappingURL=command-options.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createHash as k}from"node:crypto";import{runActiveOnWriteHooks as
|
|
2
|
-
`}function
|
|
1
|
+
import{createHash as k}from"node:crypto";import{runActiveOnWriteHooks as C}from"../core/extensions/index.js";import{mutateWorkspaceJsonWithHistory as I}from"../core/history/workspace-history.js";import{resolveAuthor as N}from"../core/shared/author.js";import{EXIT_CODE as p}from"../core/shared/constants.js";import{PmCliError as g}from"../core/shared/errors.js";import{asRecordOrNull as w}from"../core/shared/primitives.js";import{stableValueEquals as h}from"../core/shared/serialization.js";import{getSettingsPath as O}from"../core/store/paths.js";import{mergeSettings as E,readSettings as b,runWithConfigurationOnlySettings as P,serializeSettings as A}from"../core/store/settings.js";import{clearSettingsReadCache as W}from"../core/store/settings-read-cache.js";import{readSettingsSection as j,writeSettingsSection as x}from"../core/store/settings-sections.js";import{validateSettings as y}from"../core/store/settings-validator.js";import{isPmCliExpectedError as z}from"./errors.js";import{getItemAt as G}from"./history-read.js";import{fitOutputEnvelope as J}from"./output/fit-envelope.js";import{RelationshipEventLog as R,RelationshipEventStore as U}from"./relationship-history.js";import{analyzeGraphImpact as $}from"./relationship-analytics.js";import{RelationshipGraph as T,createRelationshipKindRegistry as F}from"./relationships.js";import{commitWorkspaceTransaction as D}from"./workspace-transaction.js";function v(t){const m=F();for(const c of t)m.register(c);return m}function H(t,m,c=[]){if(c.length===0)return t;const d=JSON.parse(t),e=JSON.parse(A(m));for(const n of c){const i=n.split(".");let l=e;for(const s of i){const a=w(l);if(!/^[a-zA-Z][a-zA-Z0-9_]*$/u.test(s)||["constructor","prototype","__proto__"].includes(s)||a===null||!Object.hasOwn(a,s))throw new g(`Invalid owned settings subtree: ${n}. Select a declared inline object path.`,p.USAGE);l=a[s]}if(w(l)===null)throw new g(`Invalid owned settings subtree: ${n}. Select a declared inline object path.`,p.USAGE);let o=d,u=e;for(const s of i.slice(0,-1)){const a=o[s];u=u[s],a===void 0&&Object.defineProperty(o,s,{value:structuredClone(u),enumerable:!0,writable:!0,configurable:!0}),o=o[s]}Object.defineProperty(o,i.at(-1),{value:l,enumerable:!0,writable:!0,configurable:!0})}return h(d,JSON.parse(t))?t:`${JSON.stringify(d,null,2)}
|
|
2
|
+
`}async function K(t,m,c){const d=m.schema?.fields??[];if(d.length===0)return;const{normalizeCliToken:e,resolveRuntimeFieldRegistry:n}=await import("../core/schema/runtime-schema.js"),i=r=>n({fields:[r]}).definitions[0],l=r=>JSON.parse(JSON.stringify(r)),o=[...t.schema.fields,...Array.isArray(c)?c:[]].map(r=>({resolved:i(r),persisted:l(r)})),u=r=>[r.cli_flag,...Array.isArray(r.cli_aliases)?r.cli_aliases:[]].some(f=>typeof f=="string"&&e(f).length===0),s=d.filter(r=>{const f=i(r),_=o.some(S=>h(S.persisted,l(r)));return f===void 0||u(r)?!_:!o.some(S=>h(S.resolved,f))});if(s.length===0)return;const{assertFieldDefinitionOptionsAvailable:a}=await import("./schema/field-option-collisions.js");for(const r of s)a(r)}function ue(t,m,c,d){return{fitOutputEnvelope:J,client:m,isItemNotFoundError:e=>z(e)&&e.exitCode===p.NOT_FOUND,getItemAt:(e,n)=>G(e,n,{pmRoot:t}),readSettingsSection:(e,n)=>j(t,e,n),writeSettingsSection:(e,n,i)=>x(t,e,n,{author:c,...i}),openRelationshipEventStore:e=>U.open({pmRoot:t,nodes:e.nodes,registry:v(e.definitions),...e.relativePath===void 0?{}:{relativePath:e.relativePath}}),createRelationshipGraph:e=>new T(e.nodes,e.edges,v(e.definitions)),analyzeRelationshipImpact:(e,n,i)=>$(e,n,i),validateRelationshipEvents:e=>{const n=new R(e.nodes,{registry:v(e.definitions)});return e.events.map(i=>n.append({...i,expectedVersion:n.version}))},commitWorkspaceTransaction:e=>D({...e,pmRoot:t}),mutateWorkspaceSettings:async e=>{if(!/^[a-zA-Z0-9._-]{1,128}$/u.test(e.operationId))throw new g("Workspace settings operationId must be 1-128 letters, digits, dots, underscores, or hyphens.",p.USAGE);const n=e.dryRun===!0?await P(t,()=>b(t)):await b(t);try{const i=await I({pmRoot:t,filePath:O(t),op:"extension:pm:settings",idempotencyKey:d===void 0?e.operationId:`${k("sha256").update(d).digest("hex").slice(0,16)}:${e.operationId}`,author:N(c,n.author_default),lockTtlSeconds:n.locks.ttl_seconds,lockWaitMs:n.locks.wait_ms,recordCreation:!1,dryRun:e.dryRun===!0,mutate:async l=>{const o=l===null?null:JSON.parse(l),u=y(o);if(!u.success)throw new g("Workspace settings mutation requires a valid initialized settings.json.",p.USAGE);const s=E(u.data),a=await e.mutate(structuredClone(s));if(!y(a).success)throw new g("Workspace settings mutation returned invalid settings.json.",p.USAGE);await K(s,a,o.schema?.fields);let r=h(s,a)?l:A(a,{source:{raw:o,validated:u.data}});r=H(r,a,e.replaceSubtrees);const f=y(JSON.parse(r));if(!f.success)throw new g("Workspace settings mutation serialized invalid settings.json.",p.USAGE);return{raw:r,result:e.includePreview===!0?E(f.data):void 0}}});return i.changed&&e.dryRun!==!0&&await C({path:O(t),scope:"project",op:"extension:pm:settings"}),{changed:i.changed,dry_run:e.dryRun===!0,replayed:i.replayed===!0,...i.result===void 0?{}:{preview:i.result}}}finally{W(t)}}}}export{ue as createExtensionCommandSdk};
|
|
3
3
|
//# sourceMappingURL=extension-command-context.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=[{code:"acceptance_criteria_mutation_conflict",exit_code:2,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_remove_unmatched",exit_code:3,sources:["sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_semicolon_forbidden",exit_code:2,stable:!0,sources:["core/item/parse.ts"]},{code:"accepted_rejected_value",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"alias_collision",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"alias_target_missing",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"already_claimed_by",exit_code:4,stable:!0,sources:["sdk/lifecycle/claim.ts"],emitting_commands:["claim"]},{code:"ambiguous_option_combination",exit_code:2,stable:!0,sources:["sdk/lifecycle/claim.ts","sdk/lifecycle/plan.ts"],emitting_commands:["claim","plan"]},{code:"annotation_alias_conflict",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"annotation_entry_mismatch",exit_code:4,sources:["sdk/annotations.ts"]},{code:"annotation_expectation_invalid",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_expectation_without_target",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_flag_like_value",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_if_absent_without_append",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_message_without_text",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_text_compacted",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_text_source_conflict",exit_code:2,sources:["sdk/runtime-input.ts"]},{code:"annotation_transposed_subcommand",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"append_empty_body",exit_code:2,stable:!0,sources:["sdk/lifecycle/append.ts"],emitting_commands:["append"]},{code:"assurance_registry_invalid",exit_code:1,sources:["sdk/governance/assurance.ts"]},{code:"bare_comma_entry_ambiguous",exit_code:2,sources:["core/item/parse.ts"]},{code:"blocker_identity_read_failed",exit_code:1,sources:["sdk/query/declared-blockers.ts"]},{code:"body_file_conflicts_with_body",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_missing_path",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_unreadable",exit_code:3,stable:!0,sources:["core/io/body-file.ts"]},{code:"budget_exceeded",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"bulk_create_route",exit_code:2,sources:["cli/register-mutation.ts"]},{code:"bulk_ids_input_empty",exit_code:2,sources:["core/io/bulk-ids-input.ts","sdk/history-compact.ts","sdk/history-mcp.ts"],owned_states:[{state:"bulk_ids_stdin_contains_no_nonempty_ids",probe_id:"bulk-ids-stdin-empty",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_missing_path",exit_code:2,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_token_omits_its_path",probe_id:"bulk-ids-file-path-missing",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_unreadable",exit_code:3,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_path_cannot_be_read",probe_id:"bulk-ids-file-unreadable",entrypoints:["update-many"],expected_exit_class:"not_found"}]},{code:"bundle_integrity_torn_install",exit_code:1,stable:!0,sources:["cli/bundle-integrity.ts"]},{code:"capability_undeclared",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"capability_unused",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"child_projection_item_bound_exceeded",exit_code:1,stable:!0,sources:["sdk/item-children.ts"]},{code:"close_reason_required",exit_code:2,stable:!0,sources:["sdk/lifecycle-policy.ts","sdk/lifecycle/close-many.ts"],emitting_commands:["*","close-many"]},{code:"close_through_update",exit_code:1,stable:!0,sources:["core/telemetry/observability.ts"]},{code:"close_validation_deferred_fields",exit_code:2,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"close_validation_missing_fields",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"collected_zero_items",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"collection_transposed_subcommand",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"command_failed",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"command_namespace",exit_code:2,stable:!0,sources:["sdk/cli-contracts/runtime-contracts.ts"]},{code:"command_override_conflict",exit_code:4,stable:!0,sources:["sdk/compose.ts"]},{code:"config_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"config_key_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts","sdk/config.ts"]},{code:"config_value_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"conflicting_lifecycle_owner",exit_code:2,stable:!0,sources:["cli/register-operations.ts"]},{code:"context_evaluation_read_incomplete",exit_code:2,sources:["sdk/context-relevance.ts"]},{code:"context_signal_store_invalid",exit_code:2,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_stale",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_write_failed",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_takes_no_item_argument",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"core_item_field_requires_dedicated_flag",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"create_deferral_conflict",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_deferral_field_unsupported",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_deferral_fields_required",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_deferral_reason_required",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_positional_type_without_title",exit_code:2,stable:!0,sources:["cli/register-mutation.ts"]},{code:"dependency_cardinality_created",exit_code:2,sources:["sdk/graph/cardinality-integrity.ts"]},{code:"dependency_edge_not_allowed",exit_code:2,stable:!0,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_flag_value_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_remove_no_match",exit_code:3,sources:["sdk/lifecycle/dependency-removal.ts"],emitting_commands:["update"]},{code:"dependency_target_not_found",exit_code:3,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_temporal_order_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"duplicate_canonical_flag",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"duplicate_command",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"duplicate_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"duplicate_edge",exit_code:1,stable:!0,sources:["sdk/graph/remediation.ts"]},{code:"duplicate_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"duplicate_probe",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"duplicate_sweep_cost_limit",exit_code:4,stable:!0,sources:["sdk/query/duplicate-candidates.ts"],emitting_commands:["duplicate-candidates"]},{code:"duplicate_target_circular",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_is_duplicate",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_missing",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_self",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"empty_corpus",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"empty_surface",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"error_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-closure.ts","sdk/agent/tracker-preflight-contracts.ts"]},{code:"event_cursor_query_mismatch",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"event_history_integrity_failed",exit_code:1,sources:["core/history/event-index.ts"]},{code:"event_index_unavailable",exit_code:1,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"exit_code_mismatch",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"expect_hash_background_unsupported",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invalid",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invocation_rewritten",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_requires_mutation",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_target_required",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expected_revision_duplicate",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"expected_revision_scope_conflict",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"extension_command_activation_failed",exit_code:1,stable:!0,sources:["cli/commander-usage.ts"]},{code:"extension_dependency_name_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_spec_invalid",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_version_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_flag_value_invalid",exit_code:2,sources:["sdk/extension/command-options.ts"]},{code:"extension_install_incomplete_source_scan",exit_code:2,sources:["sdk/extension/install-plan.ts"]},{code:"extension_install_rollback_failed",exit_code:1,sources:["sdk/extension/install-snapshot.ts"]},{code:"extension_install_soft_failed",exit_code:1,stable:!0,sources:["cli/register-setup.ts"]},{code:"extension_install_source_contains_destination",exit_code:2,stable:!0,sources:["sdk/extension/install-runtime.ts"]},{code:"extension_item_field_reserved",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_type_conflict",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_unknown",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_mutation_guard_failed",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_decision",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_denial",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_timed_out",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_option_disabled",exit_code:2,sources:["sdk/extension/command-options.ts"]},{code:"extension_option_spelling_conflict",exit_code:2,sources:["sdk/extension/command-options.ts"]},{code:"extension_read_output_invalid",exit_code:2,sources:["sdk/read-output/extension.ts"]},{code:"extension_update_health_partial_coverage",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"extensions_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"field_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_mcp_input_collision",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_option_collision",exit_code:1,sources:["core/profile/profile-lint.ts"]},{code:"finalization_invalid_document",exit_code:2,sources:["sdk/transactions/item-finalization.ts"]},{code:"github_source_entry_unbuilt",exit_code:2,stable:!0,sources:["sdk/extension/shared.ts"]},{code:"hierarchy_cardinality_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_cycle_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_parent_divergence_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"history_append_only_repair_unavailable",exit_code:4,sources:["sdk/history/append-only-repair.ts"]},{code:"history_author_acknowledge_plan_conflict",exit_code:4,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_plan_fingerprint_required",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_preview_limit_invalid",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_required_values_missing",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_conflict",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_required",exit_code:2,stable:!0,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_not_actionable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_unreadable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_baseline_unavailable",exit_code:1,sources:["core/history/projection.ts"]},{code:"history_compact_boundary_bridged",exit_code:2,sources:["sdk/history-compact.ts"]},{code:"history_drift_chain_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_chain_mismatches"]},{code:"history_drift_chain_unbridgeable",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_hash_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_hash_mismatches"]},{code:"history_drift_merge_receipt",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_missing_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_missing_streams"]},{code:"history_drift_unreadable_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_unreadable_streams"]},{code:"history_drift_unrepairable_stream",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_version_skew",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_version_skews"]},{code:"history_json_invalid",exit_code:1,sources:["core/history/read.ts"]},{code:"history_merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/history/read.ts"],canonical_code:"merge_conflict_markers_detected"},{code:"history_record_integrity_invalid",exit_code:4,sources:["sdk/history/reanchor-refusal.ts"]},{code:"history_record_invalid",exit_code:1,sources:["core/history/read.ts"]},{code:"history_record_version_unsupported",exit_code:4,sources:["sdk/history/reanchor-refusal.ts"]},{code:"history_redact_bridge_unlocated",exit_code:1,sources:["sdk/history-redact.ts"]},{code:"history_replay_invalid",exit_code:1,sources:["core/history/projection.ts","core/history/tombstone.ts"]},{code:"history_salvage_refused",exit_code:4,sources:["sdk/history/salvage.ts"]},{code:"history_stream_over_compact_threshold",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"history_target_out_of_range",exit_code:1,stable:!0,sources:["core/history/projection.ts"]},{code:"history_timestamp_invalid",exit_code:1,sources:["core/history/event-index.ts","core/history/history.ts"]},{code:"history_union_rebase_conflict",exit_code:4,sources:["sdk/merge/history-scalar-rebase.ts"]},{code:"history_unknown_author_events",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_unknown_author_events"]},{code:"history_version_mapping_unavailable",exit_code:2,sources:["core/history/version-address.ts"]},{code:"history_version_pruned",exit_code:2,sources:["core/history/projection.ts"]},{code:"history_version_unreconstructable",exit_code:2,sources:["core/history/projection.ts"]},{code:"host_environment_capacity_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_operation_invalid",exit_code:2,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_permission_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_resource_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"improvement_metric_contract_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"improvement_observation_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"in_progress_idle",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"in_progress_unowned",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"incomplete_allowed_values",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"inconsistent_concept_kind",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"init_existing_settings_requires_force",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_gitignore_unwritable",exit_code:1,stable:!0,sources:["sdk/workspace.ts"]},{code:"init_id_prefix_conflict",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_id_prefix_path_like",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"integrity_history_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_storage_history_conflict_markers"]},{code:"integrity_history_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_history_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_ahead_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_ahead_items"]},{code:"integrity_item_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_outdated_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_outdated_items"]},{code:"integrity_item_parse_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"invalid_argument_value",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/item/priority.ts","core/shared/url-credentials.ts","core/telemetry/observability.ts","sdk/config.ts","sdk/context-intent-contracts.ts","sdk/dependencies.ts","sdk/governance/assurance-mutation-error.ts","sdk/history-redact.ts","sdk/lifecycle/create.ts","sdk/lifecycle/task-composition.ts","sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts","sdk/linked-artifacts.ts","sdk/query/next.ts","sdk/runtime-input.ts","sdk/runtime.ts","sdk/runtime/mutation-admission.ts","sdk/runtime/mutation-value-validation.ts","sdk/runtime/schema-preview.ts","sdk/test/run-phases.ts","sdk/workspace.ts"],emitting_commands:["*","create","next","task-composition","update","update-many"]},{code:"invalid_command_usage",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts"]},{code:"invalid_event_cursor",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_cursor_mode",exit_code:2,sources:["cli/register-list-query.ts","sdk/mutation-events.ts","sdk/runtime-extended-actions.ts"]},{code:"invalid_event_follow_interval",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_limit",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_since",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_history_analytics_limit",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_minimum_sample",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_since",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_improvement_ledger",exit_code:1,sources:["sdk/improvement-ledger-validation.ts"]},{code:"invalid_improvement_metric",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_limit",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_timestamp",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_provenance_predicate",exit_code:2,stable:!0,sources:["sdk/history-provenance.ts"]},{code:"invalid_query_cursor",exit_code:2,stable:!0,sources:["sdk/pagination.ts","sdk/query/window-pagination.ts"]},{code:"invalid_read_output_session",exit_code:2,sources:["sdk/read-output-session.ts"]},{code:"invalid_reproducible_process_environment",exit_code:2,sources:["sdk/reproducibility/process.ts"]},{code:"invalid_workspace_snapshot_target",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"item_already_active",exit_code:4,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"item_already_exists",exit_code:4,stable:!0,sources:["sdk/lifecycle/create.ts"],emitting_commands:["create"]},{code:"item_deleted",exit_code:3,sources:["core/history/tombstone.ts"]},{code:"item_document_encoding_invalid",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_document_invalid",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_document_roundtrip_failed",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_format_version_unsupported",exit_code:4,sources:["core/item/item-format.ts"]},{code:"item_id_collision",exit_code:4,stable:!0,sources:["sdk/lifecycle/copy.ts"],emitting_commands:["copy"]},{code:"item_identity_ambiguous",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_identity_conflict",exit_code:4,sources:["sdk/governance/validate-history-drift.ts","sdk/lifecycle/item-revision.ts","sdk/merge/three-way.ts","sdk/query/declared-blockers.ts"]},{code:"item_identity_reserved",exit_code:4,sources:["core/history/history.ts"]},{code:"item_not_found",exit_code:3,stable:!0,sources:["cli/error-guidance.ts","core/store/item-store.ts","core/telemetry/observability.ts","sdk/governance/validate-history-drift.ts"]},{code:"item_revision_conflict",exit_code:4,sources:["core/store/item-mutation-precondition.ts"]},{code:"likely_duplicate",exit_code:4,stable:!0,sources:["sdk/similarity.ts"]},{code:"linked_artifact_mutation_conflict",exit_code:2,sources:["sdk/linked-artifacts.ts"]},{code:"linked_artifact_note_conflict",exit_code:4,sources:["sdk/linked-artifacts.ts"]},{code:"linked_artifact_note_key_misread",exit_code:2,sources:["sdk/linked-artifacts.ts"]},{code:"linked_resource_positional_value",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"linked_test_command_immutable",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_command_not_executable",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_context_invalid",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_patch_fields_unsupported",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_remove_no_match",exit_code:3,sources:["sdk/test/execution.ts"]},{code:"linked_test_update_ambiguous",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_update_no_match",exit_code:3,sources:["sdk/test/update.ts"]},{code:"linked_test_value_not_quoted",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"list_source_incomplete",exit_code:1,stable:!0,sources:["sdk/query/list.ts"],emitting_commands:["list"]},{code:"local_package_archive_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"local_source_not_found_bare_name",exit_code:3,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"lock_conflict",exit_code:4,stable:!0,sources:["cli/error-guidance.ts","core/lock/lock.ts","core/telemetry/observability.ts"]},{code:"lock_lost",exit_code:4,sources:["core/lock/lock.ts"]},{code:"lock_path_unsafe",exit_code:4,sources:["core/lock/lock-confinement.ts"]},{code:"locks_stale_count",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"locks_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"malformed_plan_step_evidence",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"managed_state_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"managed_state_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_capabilities_absent",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"manifest_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_unknown_key",exit_code:1,sources:["core/extensions/manifest-schema.ts"],owned_states:[{state:"author_workspace_manifest_declares_an_unknown_top_level_key",probe_id:"author-manifest-unknown-key",entrypoints:["health"],expected_exit_class:"generic_failure"}]},{code:"manifest_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"mcp_annotation_file_unavailable",exit_code:2,sources:["sdk/runtime-input.ts"]},{code:"mcp_stdin_unavailable",exit_code:2,sources:["sdk/annotations.ts"]},{code:"mcp_task_not_found_or_not_authorized",exit_code:3,sources:["sdk/mcp/tasks.ts"]},{code:"merge_artifacts_ignored",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_bun_launcher_unavailable",exit_code:5,sources:["sdk/merge/install.ts"]},{code:"merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/item/item-format.ts"],aliases:["history_merge_conflict_markers_detected"]},{code:"merge_decisions_unreviewed",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_driver_configuration_drift",exit_code:1,sources:["core/diagnostics/remediation.ts"]}];export{e as PM_ERROR_CODE_CATALOG_PART_1};
|
|
1
|
+
const e=[{code:"acceptance_criteria_mutation_conflict",exit_code:2,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_remove_unmatched",exit_code:3,sources:["sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts"],emitting_commands:["update","update-many"]},{code:"acceptance_criteria_semicolon_forbidden",exit_code:2,stable:!0,sources:["core/item/parse.ts"]},{code:"accepted_rejected_value",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"alias_collision",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"alias_target_missing",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"already_claimed_by",exit_code:4,stable:!0,sources:["sdk/lifecycle/claim.ts"],emitting_commands:["claim"]},{code:"ambiguous_option_combination",exit_code:2,stable:!0,sources:["sdk/lifecycle/claim.ts","sdk/lifecycle/plan.ts"],emitting_commands:["claim","plan"]},{code:"annotation_alias_conflict",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"annotation_entry_mismatch",exit_code:4,sources:["sdk/annotations.ts"]},{code:"annotation_expectation_invalid",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_expectation_without_target",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_flag_like_value",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_if_absent_without_append",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_message_without_text",exit_code:2,stable:!0,sources:["sdk/annotations.ts"]},{code:"annotation_text_compacted",exit_code:2,sources:["sdk/annotations.ts"]},{code:"annotation_text_source_conflict",exit_code:2,sources:["sdk/runtime-input.ts"]},{code:"annotation_transposed_subcommand",exit_code:2,sources:["cli/register-annotations.ts"]},{code:"append_empty_body",exit_code:2,stable:!0,sources:["sdk/lifecycle/append.ts"],emitting_commands:["append"]},{code:"assurance_registry_invalid",exit_code:1,sources:["sdk/governance/assurance.ts"]},{code:"bare_comma_entry_ambiguous",exit_code:2,sources:["core/item/parse.ts"]},{code:"blocker_identity_read_failed",exit_code:1,sources:["sdk/query/declared-blockers.ts"]},{code:"body_file_conflicts_with_body",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_missing_path",exit_code:2,stable:!0,sources:["core/io/body-file.ts"]},{code:"body_file_unreadable",exit_code:3,stable:!0,sources:["core/io/body-file.ts"]},{code:"budget_exceeded",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"bulk_create_route",exit_code:2,sources:["cli/register-mutation.ts"]},{code:"bulk_ids_input_empty",exit_code:2,sources:["core/io/bulk-ids-input.ts","sdk/history-compact.ts","sdk/history-mcp.ts"],owned_states:[{state:"bulk_ids_stdin_contains_no_nonempty_ids",probe_id:"bulk-ids-stdin-empty",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_missing_path",exit_code:2,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_token_omits_its_path",probe_id:"bulk-ids-file-path-missing",entrypoints:["update-many"],expected_exit_class:"usage"}]},{code:"bulk_ids_input_unreadable",exit_code:3,sources:["core/io/bulk-ids-input.ts"],owned_states:[{state:"bulk_ids_file_path_cannot_be_read",probe_id:"bulk-ids-file-unreadable",entrypoints:["update-many"],expected_exit_class:"not_found"}]},{code:"bundle_integrity_torn_install",exit_code:1,stable:!0,sources:["cli/bundle-integrity.ts"]},{code:"capability_undeclared",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"capability_unused",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"child_projection_item_bound_exceeded",exit_code:1,stable:!0,sources:["sdk/item-children.ts"]},{code:"close_reason_required",exit_code:2,stable:!0,sources:["sdk/lifecycle-policy.ts","sdk/lifecycle/close-many.ts"],emitting_commands:["*","close-many"]},{code:"close_through_update",exit_code:1,stable:!0,sources:["core/telemetry/observability.ts"]},{code:"close_validation_deferred_fields",exit_code:2,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"close_validation_missing_fields",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"collected_zero_items",exit_code:1,stable:!0,sources:["sdk/test/execution-receipts.ts"]},{code:"collection_transposed_subcommand",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"command_failed",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"command_namespace",exit_code:2,stable:!0,sources:["sdk/cli-contracts/runtime-contracts.ts"]},{code:"command_override_conflict",exit_code:4,stable:!0,sources:["sdk/compose.ts"]},{code:"config_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"config_key_unknown",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts","sdk/config.ts"]},{code:"config_value_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"conflicting_lifecycle_owner",exit_code:2,stable:!0,sources:["cli/register-operations.ts"]},{code:"context_evaluation_read_incomplete",exit_code:2,sources:["sdk/context-relevance.ts"]},{code:"context_signal_store_invalid",exit_code:2,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_stale",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_signal_store_write_failed",exit_code:1,sources:["sdk/context-signal-store.ts"]},{code:"context_takes_no_item_argument",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"core_item_field_requires_dedicated_flag",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"create_deferral_conflict",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_deferral_field_unsupported",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_deferral_fields_required",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_deferral_reason_required",exit_code:2,sources:["sdk/lifecycle/create-deferrals.ts"],emitting_commands:["create"]},{code:"create_positional_type_without_title",exit_code:2,stable:!0,sources:["cli/register-mutation.ts"]},{code:"dependency_cardinality_created",exit_code:2,sources:["sdk/graph/cardinality-integrity.ts"]},{code:"dependency_edge_not_allowed",exit_code:2,stable:!0,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_flag_value_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_remove_no_match",exit_code:3,sources:["sdk/lifecycle/dependency-removal.ts"],emitting_commands:["update"]},{code:"dependency_target_not_found",exit_code:3,sources:["sdk/dependency-flag-validation.ts"]},{code:"dependency_temporal_order_invalid",exit_code:2,sources:["sdk/dependency-flag-validation.ts"]},{code:"duplicate_canonical_flag",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"duplicate_command",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"duplicate_destination",exit_code:1,sources:["sdk/cli-contracts/grammar-contracts.ts"]},{code:"duplicate_edge",exit_code:1,stable:!0,sources:["sdk/graph/remediation.ts"]},{code:"duplicate_observation",exit_code:1,sources:["sdk/flag-invocation-contracts.ts"]},{code:"duplicate_probe",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"duplicate_sweep_cost_limit",exit_code:4,stable:!0,sources:["sdk/query/duplicate-candidates.ts"],emitting_commands:["duplicate-candidates"]},{code:"duplicate_target_circular",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_is_duplicate",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_missing",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"duplicate_target_self",exit_code:2,stable:!0,sources:["sdk/lifecycle/close.ts"],emitting_commands:["close"]},{code:"empty_corpus",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"empty_surface",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"error_code_mismatch",exit_code:1,sources:["sdk/agent/refusal-closure.ts","sdk/agent/tracker-preflight-contracts.ts"]},{code:"event_cursor_query_mismatch",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"event_history_integrity_failed",exit_code:1,sources:["core/history/event-index.ts"]},{code:"event_index_unavailable",exit_code:1,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"exit_code_mismatch",exit_code:1,sources:["sdk/agent/tracker-preflight-contracts.ts"]},{code:"expect_hash_background_unsupported",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invalid",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_invocation_rewritten",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_requires_mutation",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expect_hash_target_required",exit_code:2,sources:["sdk/lifecycle/item-revision.ts"]},{code:"expected_revision_duplicate",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"expected_revision_scope_conflict",exit_code:2,sources:["core/store/item-mutation-precondition.ts"]},{code:"extension_command_activation_failed",exit_code:1,stable:!0,sources:["cli/commander-usage.ts"]},{code:"extension_dependency_name_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_spec_invalid",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_dependency_version_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"extension_flag_value_invalid",exit_code:2,sources:["sdk/extension/command-options.ts"]},{code:"extension_install_incomplete_source_scan",exit_code:2,sources:["sdk/extension/install-plan.ts"]},{code:"extension_install_rollback_failed",exit_code:1,sources:["sdk/extension/install-snapshot.ts"]},{code:"extension_install_soft_failed",exit_code:1,stable:!0,sources:["cli/register-setup.ts"]},{code:"extension_install_source_contains_destination",exit_code:2,stable:!0,sources:["sdk/extension/install-runtime.ts"]},{code:"extension_item_field_reserved",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_type_conflict",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_item_field_unknown",exit_code:2,stable:!0,sources:["core/extensions/item-fields.ts"]},{code:"extension_mutation_guard_failed",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_decision",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_invalid_denial",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_mutation_guard_timed_out",exit_code:4,stable:!0,sources:["core/extensions/extension-hook-runtime.ts"]},{code:"extension_option_disabled",exit_code:2,sources:["sdk/extension/command-options.ts"]},{code:"extension_option_spelling_conflict",exit_code:2,sources:["sdk/extension/command-options.ts"]},{code:"extension_read_output_invalid",exit_code:2,sources:["sdk/read-output/extension.ts"]},{code:"extension_update_health_partial_coverage",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"extensions_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"field_duplicate",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_flag_invalid",exit_code:2,sources:["core/profile/profile-lint.ts"]},{code:"field_invalid",exit_code:2,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_mcp_input_collision",exit_code:1,stable:!0,sources:["core/profile/profile-lint.ts"]},{code:"field_option_collision",exit_code:1,sources:["core/profile/profile-lint.ts"]},{code:"finalization_invalid_document",exit_code:2,sources:["sdk/transactions/item-finalization.ts"]},{code:"github_source_entry_unbuilt",exit_code:2,stable:!0,sources:["sdk/extension/shared.ts"]},{code:"hierarchy_cardinality_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_cycle_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"hierarchy_parent_divergence_created",exit_code:4,sources:["sdk/graph/hierarchy-integrity.ts"]},{code:"history_append_only_repair_unavailable",exit_code:4,sources:["sdk/history/append-only-repair.ts"]},{code:"history_author_acknowledge_plan_conflict",exit_code:4,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_plan_fingerprint_required",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_preview_limit_invalid",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_required_values_missing",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_conflict",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_selector_required",exit_code:2,stable:!0,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_not_actionable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_author_acknowledge_target_unreadable",exit_code:2,sources:["sdk/author-attribution.ts"]},{code:"history_baseline_unavailable",exit_code:1,sources:["core/history/projection.ts"]},{code:"history_compact_boundary_bridged",exit_code:2,sources:["sdk/history-compact.ts"]},{code:"history_drift_chain_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_chain_mismatches"]},{code:"history_drift_chain_unbridgeable",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_hash_mismatch",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_hash_mismatches"]},{code:"history_drift_merge_receipt",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_missing_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_missing_streams"]},{code:"history_drift_unreadable_stream",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_unreadable_streams"]},{code:"history_drift_unrepairable_stream",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"history_drift_version_skew",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_drift_version_skews"]},{code:"history_json_invalid",exit_code:1,sources:["core/history/read.ts"]},{code:"history_merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/history/read.ts"],canonical_code:"merge_conflict_markers_detected"},{code:"history_record_integrity_invalid",exit_code:4,sources:["sdk/history/reanchor-refusal.ts"]},{code:"history_record_invalid",exit_code:1,sources:["core/history/read.ts"]},{code:"history_record_version_unsupported",exit_code:4,sources:["sdk/history/reanchor-refusal.ts"]},{code:"history_redact_bridge_unlocated",exit_code:1,sources:["sdk/history-redact.ts"]},{code:"history_replay_invalid",exit_code:1,sources:["core/history/projection.ts","core/history/tombstone.ts"]},{code:"history_salvage_refused",exit_code:4,sources:["sdk/history/salvage.ts"]},{code:"history_stream_over_compact_threshold",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"history_target_out_of_range",exit_code:1,stable:!0,sources:["core/history/projection.ts"]},{code:"history_timestamp_invalid",exit_code:1,sources:["core/history/event-index.ts","core/history/history.ts"]},{code:"history_union_rebase_conflict",exit_code:4,sources:["sdk/merge/history-scalar-rebase.ts"]},{code:"history_unknown_author_events",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_history_unknown_author_events"]},{code:"history_version_mapping_unavailable",exit_code:2,sources:["core/history/version-address.ts"]},{code:"history_version_pruned",exit_code:2,sources:["core/history/projection.ts"]},{code:"history_version_unreconstructable",exit_code:2,sources:["core/history/projection.ts"]},{code:"host_environment_capacity_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_operation_invalid",exit_code:2,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_permission_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"host_environment_resource_fault",exit_code:1,sources:["core/fs/host-environment-errors.ts"]},{code:"improvement_metric_contract_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"improvement_observation_conflict",exit_code:4,sources:["sdk/improvement-ledger.ts"]},{code:"in_progress_idle",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"in_progress_unowned",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"incomplete_allowed_values",exit_code:1,sources:["sdk/agent/refusal-closure.ts"]},{code:"inconsistent_concept_kind",exit_code:1,sources:["sdk/cli-contracts/flag-lexicon-contracts.ts"]},{code:"init_existing_settings_requires_force",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_gitignore_unwritable",exit_code:1,stable:!0,sources:["sdk/workspace.ts"]},{code:"init_id_prefix_conflict",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"init_id_prefix_path_like",exit_code:2,stable:!0,sources:["sdk/init.ts"]},{code:"integrity_history_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_storage_history_conflict_markers"]},{code:"integrity_history_invalid_json",exit_code:2,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_history_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_ahead_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_ahead_items"]},{code:"integrity_item_conflict_marker",exit_code:4,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_outdated_format_version",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"],aliases:["validate_format_version_outdated_items"]},{code:"integrity_item_parse_failed",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"integrity_item_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"invalid_argument_value",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/item/priority.ts","core/shared/url-credentials.ts","core/telemetry/observability.ts","sdk/config.ts","sdk/context-intent-contracts.ts","sdk/dependencies.ts","sdk/governance/assurance-mutation-error.ts","sdk/history-redact.ts","sdk/lifecycle/create.ts","sdk/lifecycle/task-composition.ts","sdk/lifecycle/update-many.ts","sdk/lifecycle/update.ts","sdk/linked-artifacts.ts","sdk/query/next.ts","sdk/runtime-input.ts","sdk/runtime.ts","sdk/runtime/mutation-admission.ts","sdk/runtime/mutation-value-validation.ts","sdk/runtime/schema-preview.ts","sdk/test/run-phases.ts","sdk/workspace.ts"],emitting_commands:["*","create","next","task-composition","update","update-many"]},{code:"invalid_command_usage",exit_code:2,stable:!0,sources:["cli/error-guidance.ts","core/telemetry/observability.ts"]},{code:"invalid_event_cursor",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_cursor_mode",exit_code:2,sources:["cli/register-list-query.ts","sdk/mutation-events.ts","sdk/runtime-extended-actions.ts"]},{code:"invalid_event_follow_interval",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_limit",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_event_since",exit_code:2,stable:!0,sources:["sdk/mutation-events.ts"]},{code:"invalid_history_analytics_limit",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_minimum_sample",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_history_analytics_since",exit_code:2,sources:["sdk/history-analytics.ts"]},{code:"invalid_improvement_ledger",exit_code:1,sources:["sdk/improvement-ledger-validation.ts"]},{code:"invalid_improvement_metric",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_limit",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_improvement_observation_timestamp",exit_code:2,sources:["sdk/improvement-ledger.ts"]},{code:"invalid_provenance_predicate",exit_code:2,stable:!0,sources:["sdk/history-provenance.ts"]},{code:"invalid_query_cursor",exit_code:2,stable:!0,sources:["sdk/pagination.ts","sdk/query/window-pagination.ts"]},{code:"invalid_read_output_session",exit_code:2,sources:["sdk/read-output-session.ts"]},{code:"invalid_reproducible_process_environment",exit_code:2,sources:["sdk/reproducibility/process.ts"]},{code:"invalid_workspace_snapshot_target",exit_code:2,sources:["sdk/workspace-snapshot.ts"]},{code:"item_already_active",exit_code:4,sources:["sdk/lifecycle/update.ts"],emitting_commands:["update"]},{code:"item_already_exists",exit_code:4,stable:!0,sources:["sdk/lifecycle/create.ts"],emitting_commands:["create"]},{code:"item_deleted",exit_code:3,sources:["core/history/tombstone.ts"]},{code:"item_document_encoding_invalid",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_document_invalid",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_document_roundtrip_failed",exit_code:1,stable:!0,sources:["core/item/item-format.ts"]},{code:"item_format_version_unsupported",exit_code:4,sources:["core/item/item-format.ts"]},{code:"item_id_collision",exit_code:4,stable:!0,sources:["sdk/lifecycle/copy.ts"],emitting_commands:["copy"]},{code:"item_identity_ambiguous",exit_code:4,sources:["core/store/item-store.ts"]},{code:"item_identity_conflict",exit_code:4,sources:["sdk/governance/validate-history-drift.ts","sdk/lifecycle/item-revision.ts","sdk/merge/three-way.ts","sdk/query/declared-blockers.ts"]},{code:"item_identity_reserved",exit_code:4,sources:["core/history/history.ts"]},{code:"item_not_found",exit_code:3,stable:!0,sources:["cli/error-guidance.ts","core/store/item-store.ts","core/telemetry/observability.ts","sdk/governance/validate-history-drift.ts"]},{code:"item_revision_conflict",exit_code:4,sources:["core/store/item-mutation-precondition.ts"]},{code:"likely_duplicate",exit_code:4,stable:!0,sources:["sdk/similarity.ts"]},{code:"linked_artifact_mutation_conflict",exit_code:2,sources:["sdk/linked-artifacts.ts"]},{code:"linked_artifact_note_conflict",exit_code:4,sources:["sdk/linked-artifacts.ts"]},{code:"linked_artifact_note_key_misread",exit_code:2,sources:["sdk/linked-artifacts.ts"]},{code:"linked_resource_positional_value",exit_code:2,sources:["cli/error-guidance.ts"]},{code:"linked_test_command_immutable",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_command_not_executable",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_context_invalid",exit_code:2,sources:["sdk/test/entry.ts"]},{code:"linked_test_patch_fields_unsupported",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_remove_no_match",exit_code:3,sources:["sdk/test/execution.ts"]},{code:"linked_test_update_ambiguous",exit_code:2,sources:["sdk/test/update.ts"]},{code:"linked_test_update_no_match",exit_code:3,sources:["sdk/test/update.ts"]},{code:"linked_test_value_not_quoted",exit_code:1,stable:!0,sources:["cli/error-guidance.ts"]},{code:"list_source_incomplete",exit_code:1,stable:!0,sources:["sdk/query/list.ts"],emitting_commands:["list"]},{code:"local_package_archive_unsafe",exit_code:2,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"local_source_not_found_bare_name",exit_code:3,stable:!0,sources:["sdk/extension/install-sources.ts"]},{code:"lock_conflict",exit_code:4,stable:!0,sources:["cli/error-guidance.ts","core/lock/lock.ts","core/telemetry/observability.ts"]},{code:"lock_lost",exit_code:4,sources:["core/lock/lock.ts"]},{code:"lock_path_unsafe",exit_code:4,sources:["core/lock/lock-confinement.ts"]},{code:"locks_stale_count",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"locks_unreadable",exit_code:1,stable:!0,sources:["core/diagnostics/remediation.ts"]},{code:"malformed_plan_step_evidence",exit_code:2,stable:!0,sources:["sdk/lifecycle/plan.ts"],emitting_commands:["plan"]},{code:"managed_state_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"managed_state_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_capabilities_absent",exit_code:1,stable:!0,sources:["sdk/compose.ts"]},{code:"manifest_invalid",exit_code:2,sources:["sdk/extension/static-inventory.ts"]},{code:"manifest_unknown_key",exit_code:1,sources:["core/extensions/manifest-schema.ts"],owned_states:[{state:"author_workspace_manifest_declares_an_unknown_top_level_key",probe_id:"author-manifest-unknown-key",entrypoints:["health"],expected_exit_class:"generic_failure"}]},{code:"manifest_unreadable",exit_code:1,sources:["sdk/extension/static-inventory.ts"]},{code:"mcp_annotation_file_unavailable",exit_code:2,sources:["sdk/runtime-input.ts"]},{code:"mcp_stdin_unavailable",exit_code:2,sources:["sdk/annotations.ts"]},{code:"mcp_task_not_found_or_not_authorized",exit_code:3,sources:["sdk/mcp/tasks.ts"]},{code:"merge_artifacts_ignored",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_bun_launcher_unavailable",exit_code:5,sources:["sdk/merge/install.ts"]},{code:"merge_conflict_markers_detected",exit_code:1,stable:!0,sources:["core/item/item-format.ts"],aliases:["history_merge_conflict_markers_detected"]},{code:"merge_decisions_unreviewed",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_driver_configuration_drift",exit_code:1,sources:["core/diagnostics/remediation.ts"]},{code:"merge_driver_configuration_missing",exit_code:1,sources:["core/diagnostics/remediation.ts"]}];export{e as PM_ERROR_CODE_CATALOG_PART_1};
|
|
2
2
|
//# sourceMappingURL=generated-error-code-catalog-part-1.js.map
|