@unbrained/pm-cli 2026.9.19 → 2026.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +954 -924
- package/dist/cli/main.d.ts +10 -76
- package/dist/cli/main.js +1 -2
- package/dist/cli/register-operations.js +1 -1
- package/dist/cli/runtime/activation.d.ts +51 -0
- package/dist/cli/runtime/activation.js +2 -0
- package/dist/cli/runtime/invocation-options.d.ts +41 -0
- package/dist/cli/runtime/invocation-options.js +2 -0
- package/dist/cli/runtime/selection.d.ts +29 -0
- package/dist/cli/runtime/selection.js +2 -0
- package/dist/cli/runtime/telemetry-outcome.d.ts +20 -0
- package/dist/cli/runtime/telemetry-outcome.js +2 -0
- package/dist/cli-bundle/bundle-manifest.json +150 -150
- package/dist/cli-bundle/chunks/{chunk-QA4GUEKJ.js → chunk-2QLXN6HZ.js} +46 -46
- package/dist/cli-bundle/chunks/chunk-2UNYUB4A.js +2 -0
- package/dist/cli-bundle/chunks/chunk-4SI67A2F.js +8 -0
- package/dist/cli-bundle/chunks/chunk-7YUYLYJQ.js +6 -0
- package/dist/cli-bundle/chunks/{chunk-7CN53F4S.js → chunk-FBWAECBI.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-GRHSNUQO.js +20 -0
- package/dist/cli-bundle/chunks/chunk-HAFSMFJK.js +3 -0
- package/dist/cli-bundle/chunks/chunk-JBJUOOJI.js +238 -0
- package/dist/cli-bundle/chunks/chunk-K7RWRJLT.js +29 -0
- package/dist/cli-bundle/chunks/chunk-NHRB3L5T.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-CCLWCESZ.js → chunk-QZTS23BV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-K4VAU4HU.js → chunk-SDLBF4PY.js} +1252 -1252
- package/dist/cli-bundle/chunks/{register-list-query-RMZNHSII.js → register-list-query-5V43MYPN.js} +6 -6
- package/dist/cli-bundle/chunks/{register-mutation-HJGSGX3H.js → register-mutation-DXES37MA.js} +4 -4
- package/dist/cli-bundle/chunks/register-operations-LJU5H2CU.js +2 -0
- package/dist/cli-bundle/chunks/register-setup-HJUNGYBB.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-3XPBKIV6.js +12 -0
- package/dist/cli-bundle/focused-chunks/{chunk-7Y7PAC56.js → chunk-5BLRMUMK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5SZ4JSPZ.js → chunk-6MNKQKT6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IKPR4VVN.js → chunk-DPBTIFW7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-J3GN4SQT.js → chunk-DRNXMOSV.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-P4BA7OX7.js → chunk-FXAZPSU6.js} +7 -7
- package/dist/cli-bundle/focused-chunks/{chunk-ARK4FIO4.js → chunk-HYPK5OPA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-I4WDON3K.js → chunk-IA5CCSBB.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CJ4QA4RW.js → chunk-ISEOBALS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-ZI2YBJFH.js → chunk-K5ZCBC6Y.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-V3YMNAO7.js → chunk-L6L4XCLY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TDHVROGL.js → chunk-N6KI3LWF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-PC6ZZVNP.js +20 -0
- package/dist/cli-bundle/focused-chunks/chunk-RQL5WLNZ.js +30 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZDBKYZFE.js → chunk-U2SB2BMM.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YDFEWXXZ.js → chunk-UIS5FVHH.js} +53 -53
- package/dist/cli-bundle/main.js +26 -27
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +39 -39
- 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 +42 -42
- 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 +8 -8
- package/dist/core/diagnostics/remediation.js +1 -1
- package/dist/core/extensions/extension-types.d.ts +2 -2
- package/dist/core/extensions/loader.d.ts +9 -15
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/manifest-parser.d.ts +5 -0
- package/dist/core/extensions/manifest-parser.js +2 -0
- package/dist/core/extensions/registration-contracts.d.ts +34 -0
- package/dist/core/extensions/registration-contracts.js +2 -0
- package/dist/core/governance/issue-codes.d.ts +10 -1
- package/dist/core/governance/issue-codes.js +1 -1
- package/dist/core/validate/fix-planning.d.ts +3 -3
- package/dist/core/validate/fix-planning.js +1 -1
- package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
- package/dist/sdk/completion/bash.d.ts +3 -0
- package/dist/sdk/completion/bash.js +2 -0
- package/dist/sdk/completion/fish.d.ts +3 -0
- package/dist/sdk/completion/fish.js +1054 -0
- package/dist/sdk/completion/shared.d.ts +103 -0
- package/dist/sdk/completion/shared.js +2 -0
- package/dist/sdk/completion/zsh.d.ts +3 -0
- package/dist/sdk/completion/zsh.js +1109 -0
- package/dist/sdk/completion.d.ts +5 -30
- package/dist/sdk/completion.js +1 -2160
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
- package/dist/sdk/governance/closure-timestamps.d.ts +32 -0
- package/dist/sdk/governance/closure-timestamps.js +2 -0
- package/dist/sdk/governance/validate-normalization.d.ts +2 -0
- package/dist/sdk/governance/validate-normalization.js +1 -1
- package/dist/sdk/governance/validate.js +1 -1
- package/dist/sdk/governance.d.ts +1 -0
- package/dist/sdk/governance.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/dist/sdk/query/search/corpus.d.ts +27 -0
- package/dist/sdk/query/search/corpus.js +2 -0
- package/dist/sdk/query/search/filters.d.ts +27 -0
- package/dist/sdk/query/search/filters.js +2 -0
- package/dist/sdk/query/search/input.d.ts +28 -0
- package/dist/sdk/query/search/input.js +2 -0
- package/dist/sdk/query/search/lexical.d.ts +34 -0
- package/dist/sdk/query/search/lexical.js +2 -0
- package/dist/sdk/query/search/response.d.ts +34 -0
- package/dist/sdk/query/search/response.js +2 -0
- package/dist/sdk/query/search/semantic.d.ts +229 -0
- package/dist/sdk/query/search/semantic.js +3 -0
- package/dist/sdk/query/search/types.d.ts +123 -0
- package/dist/sdk/query/search/types.js +2 -0
- package/dist/sdk/query/search.d.ts +13 -364
- package/dist/sdk/query/search.js +1 -2
- package/dist/sdk/runtime/actions.d.ts +4 -0
- package/dist/sdk/runtime/actions.js +2 -0
- package/dist/sdk/runtime/context.d.ts +38 -0
- package/dist/sdk/runtime/context.js +2 -0
- package/dist/sdk/runtime/schema.d.ts +4 -0
- package/dist/sdk/runtime/schema.js +2 -0
- package/dist/sdk/runtime.d.ts +90 -95
- package/dist/sdk/runtime.js +1 -1
- package/docs/ARCHITECTURE.md +68 -0
- package/docs/HISTORY_GOVERNANCE_REPAIR.md +66 -0
- package/docs/README.md +2 -0
- package/docs/VALIDATION_PORTABILITY.md +82 -0
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
- package/marketplace.json +2 -2
- package/package.json +6 -6
- 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/extensions/guide-shell/runtime.ts +23 -17
- 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-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-AACGU5IA.js +0 -3
- package/dist/cli-bundle/chunks/chunk-J7NP7QLW.js +0 -6
- package/dist/cli-bundle/chunks/chunk-KHN4NMKT.js +0 -238
- package/dist/cli-bundle/chunks/chunk-KYG2QKNY.js +0 -29
- package/dist/cli-bundle/chunks/chunk-OQS2Y6VN.js +0 -2
- package/dist/cli-bundle/chunks/chunk-QTHR3LXF.js +0 -20
- package/dist/cli-bundle/chunks/chunk-RVMDPIGD.js +0 -2
- package/dist/cli-bundle/chunks/chunk-WASMH647.js +0 -8
- package/dist/cli-bundle/chunks/register-operations-LBEMFUMM.js +0 -2
- package/dist/cli-bundle/chunks/register-setup-MU557JAA.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-I32L3FWW.js +0 -12
- package/dist/cli-bundle/focused-chunks/chunk-OOZHQFBF.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-QL4MO5M2.js +0 -30
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7640f483-6c14-56f1-bccd-cec9ca88e6ea")}catch(e2){}})();import{describeExtensionLongFlagFailure,findExtensionFlagTokenFailure}from"./flag-definition-validation.js";import{flattenFlagListValue,isFlagDefaultValueCoercible,resolveFlagValueKind}from"./flag-value-types.js";import{KNOWN_ITEM_FIELD_TYPES,normalizeItemFieldType,suggestKnownItemFieldType}from"./item-field-types.js";import{asRegistrationRecord,assertOptionalBooleanField,assertOptionalFlagDefaultField,assertOptionalStringArrayField,assertOptionalStringField}from"./registration-validation.js";import{assertNonEmptyRegistrationString,normalizeRegistrationRecordList}from"./registration-values.js";const FLAG_DEFINITION_KEYS=new Set(["default","description","enabled","list","long","repeatable","required","short","type","value_name","value_type","visible"]);function normalizeFlagDefinitions(name,value){return normalizeRegistrationRecordList(name,value).map(record=>{if(record.repeatable===true){record.list=true}return record})}function normalizeCommandActionName(value){return value.trim().toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function resolveCommandDefinitionAction(commandPath,action){if(action===void 0){return commandPath.replace(/\s+/g,"-")}if(typeof action!=="string"||action.trim().length===0){throw new TypeError("registerCommand definition.action must be a non-empty string when provided")}const normalized=normalizeCommandActionName(action);if(normalized.length===0){throw new TypeError("registerCommand definition.action must contain alphanumeric characters")}return normalized}function normalizeCommandDefinitionArguments(value){if(value===void 0){return[]}if(!Array.isArray(value)){throw new TypeError("registerCommand definition.arguments must be an array when provided")}const normalized=[];for(const[index,entry]of value.entries()){const record=asRegistrationRecord(`registerCommand definition.arguments[${index}]`,entry);const name=assertNonEmptyRegistrationString(`registerCommand definition.arguments[${index}].name`,record.name);assertOptionalBooleanField(`registerCommand definition.arguments[${index}].required`,record.required);assertOptionalBooleanField(`registerCommand definition.arguments[${index}].variadic`,record.variadic);assertOptionalStringField(`registerCommand definition.arguments[${index}].description`,record.description);if(name.includes(" ")){throw new TypeError(`registerCommand definition.arguments[${index}].name must not contain spaces`)}const definition={name};if(record.required===true){definition.required=true}if(record.variadic===true){definition.variadic=true}if(typeof record.description==="string"){definition.description=record.description.trim()}normalized.push(definition)}const variadicIndexes=normalized.map((argument,index)=>argument.variadic?index:-1).filter(index=>index>=0);if(variadicIndexes.length>1){throw new TypeError("registerCommand definition.arguments supports at most one variadic argument")}if(variadicIndexes.length===1&&variadicIndexes[0]!==normalized.length-1){throw new TypeError("registerCommand definition.arguments variadic argument must be the final argument")}return normalized}function validateFlagDefinitions(flags){if(!Array.isArray(flags)){throw new TypeError("registerFlags flags requires an array of object definitions")}for(const[index,raw]of flags.entries()){const record=asRegistrationRecord(`registerFlags flags[${index}]`,raw);const unknownKeys=Object.keys(record).filter(key=>!FLAG_DEFINITION_KEYS.has(key)).sort((left,right)=>left.localeCompare(right));if(unknownKeys.length>0){throw new TypeError(`registerFlags flags[${index}] contains unknown field(s): ${unknownKeys.join(", ")}`)}const long=record.long;const short=record.short;if(long===void 0&&short===void 0){throw new TypeError(`registerFlags flags[${index}] requires at least one of long or short`)}assertOptionalStringField(`registerFlags flags[${index}].long`,long);assertOptionalStringField(`registerFlags flags[${index}].short`,short);const tokenFinding=findExtensionFlagTokenFailure(long,short);if(tokenFinding!==null){throw new TypeError(`registerFlags flags[${index}] ${describeExtensionLongFlagFailure(tokenFinding.token,tokenFinding.failure)}`)}assertOptionalStringField(`registerFlags flags[${index}].value_name`,record.value_name);assertOptionalStringField(`registerFlags flags[${index}].description`,record.description);assertOptionalBooleanField(`registerFlags flags[${index}].required`,record.required);assertOptionalBooleanField(`registerFlags flags[${index}].enabled`,record.enabled);assertOptionalBooleanField(`registerFlags flags[${index}].visible`,record.visible);assertOptionalBooleanField(`registerFlags flags[${index}].list`,record.list);assertOptionalBooleanField(`registerFlags flags[${index}].repeatable`,record.repeatable);if(record.list!==void 0&&record.repeatable!==void 0&&record.list!==record.repeatable){throw new TypeError(`registerFlags flags[${index}].list and repeatable must match when both are provided`)}assertOptionalFlagDefaultField(`registerFlags flags[${index}].default`,record.default);if(Array.isArray(record.default)&&record.list!==true&&record.repeatable!==true){throw new TypeError(`registerFlags flags[${index}].default cannot be an array unless list is true.`)}assertFlagValueTypeAndDefault(`registerFlags flags[${index}]`,record)}}function assertFlagValueTypeAndDefault(label,record){const declaredType=(typeof record.value_type==="string"?record.value_type:void 0)??(typeof record.type==="string"?record.type:void 0);if(declaredType===void 0){return}const kind=resolveFlagValueKind(declaredType);if(kind===null){throw new TypeError(`${label} value_type "${declaredType}" is not a known flag value type (expected one of: string, number, boolean).`)}if(record.default===void 0){return}const defaults=record.list===true||record.repeatable===true?flattenFlagListValue(record.default):[record.default];for(const[defaultIndex,defaultValue]of defaults.entries()){if(!isFlagDefaultValueCoercible(defaultValue,kind)){const suffix=defaults.length>1?`default[${defaultIndex}]`:"default";throw new TypeError(`${label}.${suffix} (${JSON.stringify(defaultValue)}) is not coercible to ${kind}.`)}}}function validateItemFieldDefinitions(fields){if(!Array.isArray(fields)){throw new TypeError("registerItemFields fields requires an array of object definitions")}for(const[index,raw]of fields.entries()){const record=asRegistrationRecord(`registerItemFields fields[${index}]`,raw);assertNonEmptyRegistrationString(`registerItemFields fields[${index}].name`,record.name);const fieldType=assertNonEmptyRegistrationString(`registerItemFields fields[${index}].type`,record.type);if(normalizeItemFieldType(fieldType)===null){const suggestion=suggestKnownItemFieldType(fieldType);const hint=suggestion?` Did you mean "${suggestion}"?`:"";throw new TypeError(`registerItemFields fields[${index}].type "${fieldType}" is not a known field type (expected one of: ${KNOWN_ITEM_FIELD_TYPES.join(", ")}).${hint}`)}assertOptionalBooleanField(`registerItemFields fields[${index}].optional`,record.optional)}}function validateItemTypeCommandOptionPolicies(typeIndex,value){if(value===void 0){return}const label=`registerItemTypes types[${typeIndex}].command_option_policies`;if(!Array.isArray(value)){throw new TypeError(`${label} must be an array when provided`)}for(const[policyIndex,rawPolicy]of value.entries()){const at=`${label}[${policyIndex}]`;const policy=asRegistrationRecord(at,rawPolicy);assertNonEmptyRegistrationString(`${at}.command`,policy.command);assertNonEmptyRegistrationString(`${at}.option`,policy.option);assertOptionalBooleanField(`${at}.enabled`,policy.enabled);assertOptionalBooleanField(`${at}.required`,policy.required);assertOptionalBooleanField(`${at}.visible`,policy.visible)}}function validateItemTypeOptions(typeIndex,value){if(value===void 0){return}const label=`registerItemTypes types[${typeIndex}].options`;if(!Array.isArray(value)){throw new TypeError(`${label} must be an array when provided`)}for(const[optionIndex,rawOption]of value.entries()){const at=`${label}[${optionIndex}]`;const option=asRegistrationRecord(at,rawOption);assertNonEmptyRegistrationString(`${at}.key`,option.key);assertOptionalStringArrayField(`${at}.values`,option.values);assertOptionalBooleanField(`${at}.required`,option.required);assertOptionalStringArrayField(`${at}.aliases`,option.aliases)}}function validateItemTypeDefinitions(types){if(!Array.isArray(types)){throw new TypeError("registerItemTypes types requires an array of object definitions")}for(const[typeIndex,raw]of types.entries()){const at=`registerItemTypes types[${typeIndex}]`;const record=asRegistrationRecord(at,raw);assertNonEmptyRegistrationString(`${at}.name`,record.name);assertOptionalStringField(`${at}.folder`,record.folder);assertOptionalStringArrayField(`${at}.aliases`,record.aliases);assertOptionalStringArrayField(`${at}.required_create_fields`,record.required_create_fields);assertOptionalStringArrayField(`${at}.required_create_repeatables`,record.required_create_repeatables);validateItemTypeCommandOptionPolicies(typeIndex,record.command_option_policies);validateItemTypeOptions(typeIndex,record.options)}}function validateMigrationDefinition(definition){const record=asRegistrationRecord("registerMigration definition",definition);if(record.id!==void 0&&typeof record.id!=="string"){throw new TypeError("registerMigration definition.id must be a string when provided")}if(record.description!==void 0&&typeof record.description!=="string"){throw new TypeError("registerMigration definition.description must be a string when provided")}if(record.status!==void 0&&typeof record.status!=="string"){throw new TypeError("registerMigration definition.status must be a string when provided")}assertOptionalBooleanField("registerMigration definition.mandatory",record.mandatory);if(record.run!==void 0&&typeof record.run!=="function"){throw new TypeError("registerMigration definition.run must be a function when provided")}}const PROJECT_PROFILE_DIMENSIONS=["types","statuses","fields","workflows","config","templates","packages"];const PROJECT_PROFILE_ENTRY_VALIDATORS={types:(at,entry)=>{if(entry.name!==void 0&&typeof entry.name!=="string"){throw new TypeError(`${at}.name must be a string when provided`)}},workflows:(at,entry)=>{if(typeof entry.type!=="string"){throw new TypeError(`${at}.type must be a string`)}if(!Array.isArray(entry.allowed_transitions)){throw new TypeError(`${at}.allowed_transitions must be an array`)}for(const[pairIndex,pair]of entry.allowed_transitions.entries()){if(!Array.isArray(pair)){throw new TypeError(`${at}.allowed_transitions[${pairIndex}] must be a [from, to] array`)}}},templates:(at,entry)=>{if(typeof entry.name!=="string"){throw new TypeError(`${at}.name must be a string`)}if(typeof entry.options!=="object"||entry.options===null||Array.isArray(entry.options)){throw new TypeError(`${at}.options must be an object`)}},packages:(at,entry)=>{if(typeof entry.spec!=="string"){throw new TypeError(`${at}.spec must be a string`)}}};function validateProjectProfileDefinition(profile){const record=asRegistrationRecord("registerProfile profile",profile);assertNonEmptyRegistrationString("registerProfile profile.name",record.name);assertNonEmptyRegistrationString("registerProfile profile.title",record.title);if(record.summary!==void 0&&typeof record.summary!=="string"){throw new TypeError("registerProfile profile.summary must be a string when provided")}for(const dimension of PROJECT_PROFILE_DIMENSIONS){const value=record[dimension];if(value===void 0){continue}if(!Array.isArray(value)){throw new TypeError(`registerProfile profile.${dimension} must be an array when provided`)}for(const[index,entry]of value.entries()){if(typeof entry!=="object"||entry===null||Array.isArray(entry)){throw new TypeError(`registerProfile profile.${dimension}[${index}] must be an object`)}PROJECT_PROFILE_ENTRY_VALIDATORS[dimension]?.(`registerProfile profile.${dimension}[${index}]`,entry)}}}function applyProjectProfileDefaults(profile){if(profile.summary===void 0){profile.summary=""}for(const dimension of PROJECT_PROFILE_DIMENSIONS){if(profile[dimension]===void 0){profile[dimension]=[]}}return profile}export{applyProjectProfileDefaults,assertFlagValueTypeAndDefault,normalizeCommandDefinitionArguments,normalizeFlagDefinitions,resolveCommandDefinitionAction,validateFlagDefinitions,validateItemFieldDefinitions,validateItemTypeDefinitions,validateMigrationDefinition,validateProjectProfileDefinition};
|
|
2
|
+
//# sourceMappingURL=registration-contracts.js.map
|
|
@@ -23,6 +23,11 @@ export interface IssueCodeItem {
|
|
|
23
23
|
duplicate_of?: string | null;
|
|
24
24
|
/** Optional body evidence used to disambiguate mixed-case prose compounds. */
|
|
25
25
|
body?: string | null;
|
|
26
|
+
/** Typed provenance links; only derivations targeting this same code group exempt a follow-up. */
|
|
27
|
+
dependencies?: readonly {
|
|
28
|
+
id: string;
|
|
29
|
+
kind: string;
|
|
30
|
+
}[] | null;
|
|
26
31
|
}
|
|
27
32
|
/** Explicit classifier inputs for repository-specific issue-code formats. */
|
|
28
33
|
export interface IssueCodeDetectionOptions {
|
|
@@ -58,7 +63,7 @@ export declare function extractIssueCode(title: string | null | undefined, optio
|
|
|
58
63
|
* reported. Status is intentionally NOT considered for genuine collisions — a
|
|
59
64
|
* closed item and an open item sharing a code still collide for audit purposes.
|
|
60
65
|
*
|
|
61
|
-
*
|
|
66
|
+
* Adjudicated/by-design cases are excluded so `validate` output stays
|
|
62
67
|
* trustworthy in real trackers (GH-275, GH-278):
|
|
63
68
|
*
|
|
64
69
|
* - **Closed-as-duplicate** (GH-278): an item with a non-empty `duplicate_of`
|
|
@@ -71,6 +76,10 @@ export declare function extractIssueCode(title: string | null | undefined, optio
|
|
|
71
76
|
* collision. A genuine duplicate (two items with the same code, neither the
|
|
72
77
|
* parent of the other) still surfaces after this filtering.
|
|
73
78
|
*
|
|
79
|
+
* - **Typed derivation** (pm-pivf): discovered_from, supersedes and incident_from
|
|
80
|
+
* links within the same code group exempt follow-ups whose ancestry reaches
|
|
81
|
+
* a root. Unrelated links, self references and cycles never establish lineage.
|
|
82
|
+
*
|
|
74
83
|
* Results are deterministic: duplicate groups are sorted by code, and the
|
|
75
84
|
* `ids`/`titles` within each group are sorted by id. The first-seen title for a
|
|
76
85
|
* given (id) is used; duplicate ids (should not occur for a valid corpus) are
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3b09b58f-2ec7-523e-87f3-8d828deb8480")}catch(e2){}})();const ISSUE_CODE_PATTERN=/^([A-Z][A-Z0-9]*-\d+)\b/iu;function extractIssueCode(title,options={}){if(typeof title!=="string"){return null}const trimmed=title.trim();if(trimmed.length===0){return null}const match=ISSUE_CODE_PATTERN.exec(trimmed);if(!match)return null;const rawCode=match[1];const normalized=rawCode.toUpperCase();const rawPrefix=rawCode.slice(0,rawCode.lastIndexOf("-"));const configured=new Set((options.configuredPrefixes??[]).map(prefix=>prefix.trim().replace(/-+$/u,"").toUpperCase()));const remainder=trimmed.slice(rawCode.length);const evidence=options.evidenceText?.toUpperCase()??"";const hasExplicitBodyEvidence=evidence.includes(`ISSUE CODE: ${normalized}`)||evidence.includes(`ISSUE CODE \`${normalized}\``)||evidence.includes(`\`${normalized}\``)||evidence.includes(`[${normalized}]`);const structurallyQualified=rawPrefix===rawPrefix.toUpperCase()||/^\s*(?::|—|–|\])/u.test(remainder)||configured.has(rawPrefix.toUpperCase())||hasExplicitBodyEvidence;return structurallyQualified?normalized:null}function isNonEmptyIdReference(value){return typeof value==="string"&&value.trim().length>0}function findCodeCollisionEntries(entries){const idsInGroup=new Set(entries.map(entry=>entry.id.toLowerCase()));const prerequisites=new Map;const dependents=new Map;for(const entry of entries){const id=entry.id.toLowerCase();const targets=new Set([...entry.parent===null?[]:[entry.parent.toLowerCase()],...entry.derivations].filter(target=>target!==id&&idsInGroup.has(target)));prerequisites.set(id,targets);for(const target of targets){const successors=dependents.get(target)??[];successors.push(id);dependents.set(target,successors)}}const roots=[...prerequisites].filter(([,targets])=>targets.size===0).map(([id])=>id);const queue=[...roots];const derived=new Set;for(let index=0;index<queue.length;index+=1){for(const successor of dependents.get(queue[index])??[]){const targets=prerequisites.get(successor);targets.delete(queue[index]);if(targets.size===0){derived.add(successor);queue.push(successor)}}}return entries.filter(entry=>!derived.has(entry.id.toLowerCase()))}function findDuplicateIssueCodes(items,options={}){const byCode=new Map;for(const item of items){if(typeof item.title!=="string"){continue}if(isNonEmptyIdReference(item.duplicate_of)){continue}const code=extractIssueCode(item.title,{...options,evidenceText:item.body});if(code===null){continue}let entries=byCode.get(code);if(!entries){entries=[];byCode.set(code,entries)}if(!entries.some(entry=>entry.id===item.id)){entries.push({id:item.id,title:item.title,parent:isNonEmptyIdReference(item.parent)?item.parent.trim():null,derivations:(item.dependencies??[]).filter(edge=>["discovered_from","supersedes","incident_from"].includes(edge.kind)).map(edge=>edge.id.trim().toLowerCase()).filter(id=>id!==item.id.toLowerCase())})}}const duplicates=[];for(const[code,entries]of byCode){if(entries.length<2){continue}const collisionEntries=findCodeCollisionEntries(entries);if(collisionEntries.length<2){continue}const sorted=[...collisionEntries].sort((left,right)=>left.id.localeCompare(right.id));duplicates.push({code,count:sorted.length,ids:sorted.map(entry=>entry.id),titles:sorted.map(entry=>entry.title)})}return duplicates.sort((left,right)=>left.code.localeCompare(right.code))}export{extractIssueCode,findDuplicateIssueCodes};
|
|
2
2
|
//# sourceMappingURL=issue-codes.js.map
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
/** Restricts validate fix check values accepted by command, SDK, and storage contracts. */
|
|
19
19
|
export type ValidateFixCheck = "metadata" | "resolution" | "lifecycle" | "files";
|
|
20
20
|
/** Restricts validate fix kind values accepted by command, SDK, and storage contracts. */
|
|
21
|
-
export type ValidateFixKind = "set_resolution" | "set_close_reason" | "set_estimate" | "reparent" | "unset_parent" | "prune_file_link" | "prune_doc_link";
|
|
21
|
+
export type ValidateFixKind = "set_resolution" | "set_close_reason" | "set_estimate" | "set_closed_at" | "reparent" | "unset_parent" | "prune_file_link" | "prune_doc_link";
|
|
22
22
|
/** Restricts validate fix scope values accepted by command, SDK, and storage contracts. */
|
|
23
|
-
export type ValidateFixScope = "metadata" | "resolution" | "estimates" | "lifecycle";
|
|
23
|
+
export type ValidateFixScope = "metadata" | "resolution" | "estimates" | "timestamps" | "lifecycle";
|
|
24
24
|
/** Scopes auto-applied without an explicit `--fix-scope` (safe field backfills). */
|
|
25
25
|
export declare const DEFAULT_GRANTED_FIX_SCOPES: readonly ValidateFixScope[];
|
|
26
|
-
/** Scopes accepted by `--fix-scope`.
|
|
26
|
+
/** Scopes accepted by `--fix-scope`. Estimates are heuristic, timestamps require verified historical replay, and lifecycle changes are structural; all three require explicit opt-in. */
|
|
27
27
|
export declare const SUPPORTED_FIX_SCOPES: readonly ValidateFixScope[];
|
|
28
28
|
/** Documents the validate fix record payload exchanged by command, SDK, and package integrations. */
|
|
29
29
|
export interface ValidateFixRecord {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c1b189d7-2939-5891-b936-5f208dc8f5ff")}catch(e2){}})();import{EXIT_CODE}from"../shared/constants.js";import{PmCliError}from"../shared/errors.js";import{resolveEstimateDefaultMinutes}from"./estimate-defaults.js";const DEFAULT_GRANTED_FIX_SCOPES=["metadata","resolution"];const SUPPORTED_FIX_SCOPES=["metadata","resolution","estimates","timestamps","lifecycle"];const DEFAULT_RESOLUTION_BACKFILL_VALUE="completed";function quoteForCommand(value){return`"${value.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}function toMeaningfulValue(value){const trimmed=value?.trim();return trimmed!==void 0&&trimmed.length>0?trimmed:void 0}function planResolutionBackfillFixes(rows){const fixes=[];for(const row of rows){if(!row.missing_fields.includes("resolution")){continue}const value=toMeaningfulValue(row.close_reason)??DEFAULT_RESOLUTION_BACKFILL_VALUE;fixes.push({item_id:row.id,check:"resolution",field:"resolution",kind:"set_resolution",value,command:`pm update ${row.id} --resolution ${quoteForCommand(value)}`,gate:"resolution"})}return fixes}function planCloseReasonBackfillFixes(rows){const fixes=[];for(const row of rows){const value=toMeaningfulValue(row.resolution);if(value===void 0){continue}fixes.push({item_id:row.id,check:"metadata",field:"close_reason",kind:"set_close_reason",value,command:`pm update ${row.id} --close-reason ${quoteForCommand(value)}`,gate:"metadata"})}return fixes}function planEstimateBackfillFixes(rows,overrides){return rows.map(row=>{const minutes=resolveEstimateDefaultMinutes(row.type,overrides);return{item_id:row.id,check:"metadata",field:"estimated_minutes",kind:"set_estimate",value:String(minutes),command:`pm update ${row.id} --estimate ${minutes}`,gate:"estimates"}})}function planTerminalParentFixes(rows){return rows.map(row=>{if(row.grandparent_id!==void 0&&row.grandparent_active===true){return{item_id:row.id,check:"lifecycle",field:"parent",kind:"reparent",parent_id:row.grandparent_id,command:`pm update ${row.id} --parent ${row.grandparent_id}`,gate:"lifecycle"}}return{item_id:row.id,check:"lifecycle",field:"parent",kind:"unset_parent",command:`pm update ${row.id} --unset parent`,gate:"lifecycle"}})}function planStaleLinkPruneFixes(rows){const fixes=[];for(const row of rows){if(row.classification!=="deleted"){continue}const noun=row.link_kind==="files"?"files":"docs";fixes.push({item_id:row.item_id,check:"files",field:row.link_kind,kind:row.link_kind==="files"?"prune_file_link":"prune_doc_link",path:row.path,command:`pm ${noun} ${row.item_id} --remove ${quoteForCommand(row.path)}`})}return fixes}function resolveGrantedFixScopes(rawScopes){const tokens=(rawScopes??[]).flatMap(raw=>raw.split(",")).map(raw=>raw.trim()).filter(raw=>raw.length>0);if(tokens.length===0){if(rawScopes!==void 0&&rawScopes.length>0){throw new PmCliError(`--fix-scope values must not be empty. Supported values: ${SUPPORTED_FIX_SCOPES.join(", ")}.`,EXIT_CODE.USAGE)}return new Set(DEFAULT_GRANTED_FIX_SCOPES)}const granted=new Set;for(const raw of tokens){const normalized=raw.toLowerCase().replaceAll("-","_");if(SUPPORTED_FIX_SCOPES.includes(normalized)){granted.add(normalized);continue}throw new PmCliError(`Unknown --fix-scope value "${raw}". Supported values: ${SUPPORTED_FIX_SCOPES.join(", ")}.`,EXIT_CODE.USAGE)}return granted}function partitionFixesByGrant(fixes,granted){const applicable=[];const gated=[];for(const fix of fixes){if(fix.gate!==void 0&&!granted.has(fix.gate)){gated.push(fix)}else{applicable.push(fix)}}return{applicable,gated}}function toFixOutputRow(fix){return{item_id:fix.item_id,check:fix.check,field:fix.field,command:fix.command,...fix.gate!==void 0?{gate:fix.gate}:{}}}export{DEFAULT_GRANTED_FIX_SCOPES,SUPPORTED_FIX_SCOPES,partitionFixesByGrant,planCloseReasonBackfillFixes,planEstimateBackfillFixes,planResolutionBackfillFixes,planStaleLinkPruneFixes,planTerminalParentFixes,resolveGrantedFixScopes,toFixOutputRow};
|
|
2
2
|
//# sourceMappingURL=fix-planning.js.map
|
|
@@ -37,7 +37,7 @@ export type PmRecoveryReferenceKind = (typeof PM_RECOVERY_REFERENCE_KINDS)[numbe
|
|
|
37
37
|
/** Behavioral promise attached to a recovery reference. */
|
|
38
38
|
export type PmRecoveryReferenceSemantics = "recovery" | "replacement" | "behavior_preserving";
|
|
39
39
|
/** Literal envelope fields recognized as recovery-reference producers. */
|
|
40
|
-
export declare const PM_RECOVERY_REFERENCE_FIELDS: readonly ("suggested_retry" | "
|
|
40
|
+
export declare const PM_RECOVERY_REFERENCE_FIELDS: readonly ("suggested_retry" | "restore_with" | "next_best_command" | "candidate_commands" | "next_steps" | "examples" | "migration_hint" | "migration_hints" | "fallback_candidates" | "suggested_next_steps" | "example" | "candidate_command" | "next_step" | "retry_command")[];
|
|
41
41
|
/** One source file supplied to the producer-census analyzer. */
|
|
42
42
|
export interface PmRecoveryProducerSource {
|
|
43
43
|
/** Repository-relative source path. */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompletionRuntimeConfig } from "./shared.js";
|
|
2
|
+
/** Render Bash 3.2-compatible completion with literal prefix matching of schema and command choices. */
|
|
3
|
+
export declare function generateBashScript(itemTypes?: string[], tags?: string[], eagerTagExpansion?: boolean, runtime?: CompletionRuntimeConfig): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2c4ca878-fa53-55b5-9cae-9fc6d7a3f0a7")}catch(e2){}})();import{PM_NAMESPACED_COMMAND_ALIASES}from"../cli-contracts.js";import{AGGREGATE_FLAGS,ALL_COMMANDS,APPEND_FLAGS,CALENDAR_FLAGS,CLAIM_MUTATION_FLAGS,CLOSE_MANY_FLAGS,CLOSE_MUTATION_FLAGS,CLOSE_TASK_MUTATION_FLAGS,COMPLETION_SHELL_CHOICES,CONTEXT_FLAGS,CONTRACTS_FLAGS,COPY_FLAGS,CREATE_FLAGS,DELETE_MUTATION_FLAGS,DEPS_FLAGS,DUPLICATES_FLAGS,EVENTS_FLAGS,EXTENSION_LIFECYCLE_ACTIONS,EXTENSION_LIFECYCLE_FLAGS,FOCUS_FLAGS,GET_FLAGS,GLOBAL_COMPLETION_INLINE_PATTERNS,GLOBAL_COMPLETION_SWITCH_PATTERNS,GLOBAL_COMPLETION_VALUE_PATTERNS,GLOBAL_FLAGS,GRAPH_FLAGS,GUIDE_FLAGS,GUIDE_TOPIC_CHOICES,HEALTH_FLAGS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS,HISTORY_FLAGS,HISTORY_LEAVES,HISTORY_OPERATION_FLAGS,INIT_FLAGS,LIST_FLAGS,MEET_FLAGS,MUTATION_FLAGS,NAMESPACE_NOUNS,NAMESPACE_PREFIXES,NEXT_FLAGS,PACKAGE_LIFECYCLE_ACTIONS,PACKAGE_LIFECYCLE_FLAGS,PLAN_FLAGS,PLAN_SUBCOMMANDS_LIST,RELEASE_MUTATION_FLAGS,REMIND_FLAGS,SCHEMA_SUBCOMMAND_CHOICES,SEARCH_FLAGS,STATS_FLAGS,UPDATE_FLAGS,UPDATE_MANY_FLAGS,UPGRADE_FLAGS,completionNamespaceLeaves,completionStatusValues,completionTypeValues,joinCompletionValues,mergeFlagStrings,shellDoubleQuote}from"./shared.js";function renderBashDynamicChoiceResolver(kind,command,fallback){const envKind=kind.toUpperCase();const cacheVar=`PM_COMPLETION_${envKind}_CACHE`;const cacheTsVar=`PM_COMPLETION_${envKind}_CACHE_TS`;const ttlVar=`PM_COMPLETION_${envKind}_TTL`;const escapedFallback=shellDoubleQuote(fallback);return[`_pm_completion_${kind}_choices() {`," local now ttl cache_ts resolved",' now="$(date +%s 2>/dev/null || echo 0)"',` ttl="\${${ttlVar}:-120}"`,` cache_ts="\${${cacheTsVar}:-0}"`,` if [[ -n "\${${cacheVar}:-}" && "$now" -ne 0 && $((now - cache_ts)) -lt "$ttl" ]]; then`,` printf '%s\\n' "$${cacheVar}"`," return 0"," fi",` resolved="$(pm ${command} 2>/dev/null)"`,' if [[ -z "$resolved" ]]; then',` resolved="${escapedFallback}"`," fi",` ${cacheVar}="$resolved"`,` ${cacheTsVar}="$now"`,` printf '%s\\n' "$${cacheVar}"`,"}"]}function generateBashScript(itemTypes=[],tags=[],eagerTagExpansion=false,runtime={}){const namespaceLeaves=completionNamespaceLeaves(runtime);const cmds=ALL_COMMANDS.join(" ");const useDynamicTypeExpansion=itemTypes.length===0;const typeValues=completionTypeValues(itemTypes,runtime);const statusValues=completionStatusValues(runtime);const tagValues=joinCompletionValues(tags);const listFlags=mergeFlagStrings(LIST_FLAGS,runtime.command_flags?.list);const createFlags=mergeFlagStrings(CREATE_FLAGS,runtime.command_flags?.create);const updateFlags=mergeFlagStrings(UPDATE_FLAGS,runtime.command_flags?.update);const updateManyFlags=mergeFlagStrings(UPDATE_MANY_FLAGS,runtime.command_flags?.["update-many"]);const searchFlags=mergeFlagStrings(SEARCH_FLAGS,runtime.command_flags?.search);const calendarFlags=mergeFlagStrings(CALENDAR_FLAGS,runtime.command_flags?.calendar);const contextFlags=mergeFlagStrings(CONTEXT_FLAGS,runtime.command_flags?.context);const useEagerTagExpansion=eagerTagExpansion||tags.length>0;const matchWords=values=>`_pm_completion_add_matches "${shellDoubleQuote(values)}"`;return["# bash completion for pm",`# Source this file or add 'eval "$(pm completion bash)"' to ~/.bashrc`,"",...useDynamicTypeExpansion?[...renderBashDynamicChoiceResolver("type","completion-types",typeValues),""]:[],...renderBashDynamicChoiceResolver("status","completion-statuses",statusValues),"","# Treat choices as data: no eval, compgen expansion, or filename globbing.","_pm_completion_add_matches() {"," local line value quoted"," local -a values"," while IFS= read -r line; do",' read -r -a values <<< "$line"',' for value in "${values[@]}"; do',' [[ "$value" == "$cur"* ]] || continue',' case "$value" in'," *[!a-zA-Z0-9_.,:/@%+=-]*)"," quoted=${value//\\'/\\'\\\\\\'\\'}",` COMPREPLY+=("'$quoted'")`," ;;",' *) COMPREPLY+=("$value") ;;'," esac"," done",' done <<< "$1"',"}","","_pm_completion() {"," local cur prev words cword"," COMPREPLY=()"," # Refuse ambiguous shell quoting before _init_completion can dequote it.",' case "${COMP_WORDS[COMP_CWORD]}" in',` *"'"*|*'"'*|*'\`'*|*'\\'*) return 0 ;;`," esac"," _init_completion 2>/dev/null || {",' cur="${COMP_WORDS[COMP_CWORD]}"',' prev="${COMP_WORDS[COMP_CWORD-1]}"'," cword=$COMP_CWORD"," }",""," if [[ $cword -eq 1 ]]; then",` ${matchWords(cmds)}`," return 0"," fi","",' if [[ "$prev" == "--type" ]]; then',useDynamicTypeExpansion?' _pm_completion_add_matches "$(_pm_completion_type_choices)"':` ${matchWords(typeValues)}`," return 0"," fi","",' if [[ "$prev" == "--status" ]]; then',' _pm_completion_add_matches "$(_pm_completion_status_choices)"'," return 0"," fi","",...useEagerTagExpansion?[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then',` ${matchWords(tagValues)}`," return 0"," fi"]:[' if [[ ( "$prev" == "--tag" || "$prev" == "--tags" ) && ! ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," local now ttl cache_ts tag_values",' now="$(date +%s 2>/dev/null || echo 0)"',' ttl="${PM_COMPLETION_TAG_TTL:-120}"',' cache_ts="${PM_COMPLETION_TAG_CACHE_TS:-0}"',' tag_values="${PM_COMPLETION_TAG_CACHE:-}"',' if [[ -z "$tag_values" || "$now" -eq 0 || $((now - cache_ts)) -ge "$ttl" ]]; then',' tag_values="$(pm completion-tags 2>/dev/null)"',' PM_COMPLETION_TAG_CACHE="$tag_values"',' PM_COMPLETION_TAG_CACHE_TS="$now"'," fi",' _pm_completion_add_matches "$tag_values"'," return 0"," fi"],"",' if [[ "$prev" == "--tag" && ( ( "${COMP_WORDS[1]}" == "package" || "${COMP_WORDS[1]}" == "packages" ) && "${COMP_WORDS[2]}" == "upgrade" ) ]]; then'," COMPREPLY=()"," return 0"," fi","",' local cmd="" command_path="" word_index=1 word'," while (( word_index < cword )); do",' word="${COMP_WORDS[word_index]}"',' case "${word//_/-}" in',` ${GLOBAL_COMPLETION_VALUE_PATTERNS}) (( word_index += 2 )); continue ;;`,` ${GLOBAL_COMPLETION_INLINE_PATTERNS}|${GLOBAL_COMPLETION_SWITCH_PATTERNS}) (( word_index++ )); continue ;;`," --) break ;;"," esac",' if [[ -z "$cmd" ]]; then',' cmd="$word"',' [[ "$cmd" == "ctx" ]] && cmd="context"',' command_path="$cmd"',` case "$cmd" in ${NAMESPACE_NOUNS.join("|")}) ;; *) break ;; esac`," else",' case "$command_path $word" in',...PM_NAMESPACED_COMMAND_ALIASES.map(entry=>` "${entry.canonical}") cmd="${entry.alias}"; command_path="${entry.canonical}" ;;`)," *) break ;;"," esac",` case "$command_path" in ${NAMESPACE_PREFIXES.map(prefix=>`"${prefix}"`).join("|")}) ;; *) (( word_index++ )); break ;; esac`," fi"," (( word_index++ ))"," done",' case "$cmd" in',...HISTORY_OPERATION_FLAGS.flatMap(entry=>[` ${entry.alias})`,` ${matchWords(entry.flags)}`," return 0"," ;;"])," list)",` ${matchWords(listFlags)}`," ;;"," aggregate)",` ${matchWords(AGGREGATE_FLAGS)}`," ;;"," duplicates)",` ${matchWords(DUPLICATES_FLAGS)}`," ;;"," create)",` ${matchWords(createFlags)}`," ;;"," copy)",` ${matchWords(COPY_FLAGS)}`," ;;"," focus)",` ${matchWords(FOCUS_FLAGS)}`," ;;"," update)",` ${matchWords(updateFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.update)}`," fi"," ;;"," update-many)",` ${matchWords(updateManyFlags)}`," ;;"," calendar|cal)",` ${matchWords(calendarFlags)}`," ;;"," context|ctx)",` ${matchWords(contextFlags)}`," if [[ $word_index -eq $cword ]]; then",` ${matchWords(namespaceLeaves.context)}`," fi"," ;;"," ops)",` ${matchWords(`${GLOBAL_FLAGS} ${namespaceLeaves.ops}`)}`," ;;"," next)",` ${matchWords(NEXT_FLAGS)}`," ;;"," guide)",` ${matchWords(`${GUIDE_FLAGS} ${GUIDE_TOPIC_CHOICES}`)}`," ;;"," search)",` ${matchWords(searchFlags)}`," ;;"," reindex)",` ${matchWords("--mode --progress --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," init)",` ${matchWords(`${INIT_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," config)",` ${matchWords("--criterion --clear-criteria --format --policy --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," extension)",` ${matchWords(`${EXTENSION_LIFECYCLE_ACTIONS} ${EXTENSION_LIFECYCLE_FLAGS}`)}`," ;;"," package|packages)",` ${matchWords(`${PACKAGE_LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS} ${UPGRADE_FLAGS}`)}`," ;;"," comments)",` ${matchWords("--add --body --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," notes)",` ${matchWords("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," learnings)",` ${matchWords("--add --stdin --file --edit --delete --limit --full-history --if-absent --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," files)",` ${matchWords("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --explain --lines --decision-depth --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," docs)",` ${matchWords("--add --add-glob --remove --migrate --note --validate-paths --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," append)",` ${matchWords(APPEND_FLAGS)}`," ;;"," deps)",` ${matchWords(DEPS_FLAGS)}`," ;;"," graph)",` ${matchWords(`ancestors descendants predecessors successors paths impact analyze audit communities redundancy dominators slack centrality articulation plan index ${GRAPH_FLAGS}`)}`," ;;"," test)",` ${matchWords("--add --add-json --remove --remove-index --list --run --match --only-index --only-last --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-all)",` ${matchWords("--status --limit --offset --background --timeout --progress --env-set --env-clear --shared-host-safe --pm-context --override-linked-pm-context --fail-on-context-mismatch --fail-on-skipped --fail-on-empty-test-run --require-assertions-for-pm --check-context --auto-pm-context --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," test-runs)",` ${matchWords("list status logs stop resume --status --limit --stream --tail --force --author --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," validate)",` ${matchWords("--check-completeness --check-metadata --metadata-profile --check-resolution --check-lifecycle --check-stale-blockers --dependency-cycle-severity --parent-cycle-severity --check-files --scan-mode --include-pm-internals --verbose-file-lists --verbose-diagnostics --all-affected-ids --strict-exit --fail-on-warn --fix-hints --auto-fix --dry-run --fix-scope --prune-missing --check-history-drift --check-command-references --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," health)",` ${matchWords(HEALTH_FLAGS)}`," ;;"," history)"," if [[ $word_index -eq $cword ]]; then",` ${matchWords(`${HISTORY_FLAGS} ${HISTORY_LEAVES}`)}`," else",` ${matchWords(HISTORY_FLAGS)}`," fi"," ;;"," events)",` ${matchWords(EVENTS_FLAGS)}`," ;;"," history-author-acknowledge)",` ${matchWords(`${HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS} --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," get)",` ${matchWords(GET_FLAGS)}`," ;;"," schema)",' if [[ "$prev" == "policy-mode" ]]; then',` ${matchWords("advise refuse")}`," return"," fi",` ${matchWords(`${SCHEMA_SUBCOMMAND_CHOICES} --definition --policy --message --description --default-status --folder --alias --role --order --type --commands --cli-flag --required --required-on-create --no-allow-unset --required-types --infer --min-count --apply --to --migration-id --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help`)}`," ;;"," profile)",` ${matchWords("list show apply lint agile ops research --dry-run --author --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," plan)",` ${matchWords(`${PLAN_SUBCOMMANDS_LIST} ${PLAN_FLAGS}`)}`," ;;"," contracts)",` ${matchWords(CONTRACTS_FLAGS)}`," ;;"," gc)",` ${matchWords("--dry-run --scope --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")}`," ;;"," stats)",` ${matchWords(STATS_FLAGS)}`," ;;"," close-task)",` ${matchWords(CLOSE_TASK_MUTATION_FLAGS)}`," ;;"," close)",` ${matchWords(CLOSE_MUTATION_FLAGS)}`,' if [[ "$cmd" == "close" && $word_index -eq $cword ]]; then',` ${matchWords(namespaceLeaves.close)}`," fi"," ;;"," close-many)",` ${matchWords(CLOSE_MANY_FLAGS)}`," ;;"," release)",` ${matchWords(RELEASE_MUTATION_FLAGS)}`," ;;"," delete)",` ${matchWords(DELETE_MUTATION_FLAGS)}`," ;;"," claim)",` ${matchWords(CLAIM_MUTATION_FLAGS)}`," ;;"," start-task|pause-task)",` ${matchWords(MUTATION_FLAGS)}`," ;;"," meet|event)",` ${matchWords(MEET_FLAGS)}`," ;;"," remind)",` ${matchWords(REMIND_FLAGS)}`," ;;"," completion)",` ${matchWords(COMPLETION_SHELL_CHOICES)}`," ;;"," templates)",` ${matchWords("save list show")}`," ;;"," *)",` ${matchWords(GLOBAL_FLAGS)}`," ;;"," esac"," if [[ $word_index -eq $cword ]]; then",' case "$command_path" in',...Object.entries(namespaceLeaves).filter(([prefix])=>["item","workspace","search"].includes(prefix.split(" ")[0])).map(([prefix,leaves])=>` "${prefix}") ${matchWords(leaves)} ;;`)," esac"," fi",' if [[ "$cmd" == "comments" || "$cmd" == "notes" || "$cmd" == "learnings" ]]; then',` ${matchWords("--text")}`," fi"," return 0","}","","complete -F _pm_completion pm"].join("\n")}export{generateBashScript};
|
|
2
|
+
//# sourceMappingURL=bash.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompletionRuntimeConfig } from "./shared.js";
|
|
2
|
+
/** Implements generate fish script for the public runtime surface of this module. */
|
|
3
|
+
export declare function generateFishScript(itemTypes?: string[], tags?: string[], eagerTagExpansion?: boolean, runtime?: CompletionRuntimeConfig): string;
|