@unbrained/pm-cli 2026.8.26 → 2026.8.27
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/.agents/skills/HARNESS_COMPATIBILITY.md +32 -0
- package/.agents/skills/README.md +47 -0
- package/.agents/skills/pm-developer/SKILL.md +117 -0
- package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +49 -0
- package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +91 -0
- package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +72 -0
- package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
- package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +82 -0
- package/.agents/skills/pm-developer/references/TOKEN_BUDGETS.md +85 -0
- package/.agents/skills/pm-extensions/SKILL.md +106 -0
- package/.agents/skills/pm-extensions/references/AUTHORING.md +95 -0
- package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
- package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
- package/.agents/skills/pm-sdk/SKILL.md +107 -0
- package/.agents/skills/pm-sdk/references/DOMAIN_MODELING.md +78 -0
- package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
- package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
- package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +82 -0
- package/.agents/skills/pm-user/SKILL.md +111 -0
- package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +105 -0
- package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
- package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +25 -3
- package/README.md +8 -5
- package/dist/cli/commander-usage.js +11 -7
- package/dist/cli/error-guidance.js +3 -3
- package/dist/cli/help-content.d.ts +2 -0
- package/dist/cli/help-content.js +53 -17
- package/dist/cli/help-json-payload.d.ts +8 -2
- package/dist/cli/help-json-payload.js +46 -12
- package/dist/cli/main.js +52 -74
- package/dist/cli/register-annotations.js +27 -21
- package/dist/cli/register-setup.js +98 -57
- package/dist/cli-bundle/bundle-manifest.json +152 -152
- package/dist/cli-bundle/chunks/chunk-3OO3W6FW.js +202 -0
- package/dist/cli-bundle/chunks/chunk-52EKTW6V.js +3 -0
- package/dist/cli-bundle/chunks/{chunk-KBFP3E4E.js → chunk-CVBBGWW5.js} +62 -44
- package/dist/cli-bundle/chunks/chunk-MFNTKMTI.js +13 -0
- package/dist/cli-bundle/chunks/{chunk-E2GCFJSU.js → chunk-OS27HHBN.js} +31 -31
- package/dist/cli-bundle/chunks/chunk-QTO7USTH.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-S4U76VZF.js → chunk-R4ETAOJC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UKBCRPA2.js → chunk-SH6P7FXI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WRHJ3MB6.js → chunk-SHMDY36D.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZNRLJ54C.js → chunk-SKXLJIEK.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TNX6HC54.js +3 -0
- package/dist/cli-bundle/chunks/{register-list-query-EMCPMICY.js → register-list-query-EUWM6VII.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-OJ67ABCB.js → register-mutation-FD4HSAVU.js} +4 -4
- package/dist/cli-bundle/chunks/{register-operations-H2GLP7LT.js → register-operations-HRMNFEC3.js} +2 -2
- package/dist/cli-bundle/chunks/register-setup-33GNICLX.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4XNH2HM7.js → chunk-2AGZ5BRT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-72T6JGAE.js → chunk-4BR5UU52.js} +45 -45
- package/dist/cli-bundle/focused-chunks/{chunk-OHIHZ7HS.js → chunk-6GCRSLPG.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UYBA57GY.js → chunk-AD6ULRAF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-7YCDTCBC.js → chunk-AQ5IYEZZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YO3ZF3FI.js → chunk-EKX37ZHA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LV5N3LK5.js → chunk-FC2AXLB5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IBHXMFE7.js → chunk-HC7ODMH3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-4K2II4TV.js → chunk-HVQ22RC4.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-A644DUFQ.js → chunk-MEASX544.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FXDLT6FL.js → chunk-MXTYGECH.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MMXUPDDJ.js → chunk-SUBSWYW3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-57XY346D.js → chunk-XDPYBQCF.js} +9 -9
- package/dist/cli-bundle/focused-chunks/{chunk-TMJDFHVD.js → chunk-Y3JJXRVK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-66VGB23P.js → chunk-Y5A7SJJ7.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-YHWHX6YY.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-P2E6LDAE.js → chunk-YVVZ3LQ6.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-Z2USIBR2.js +5 -0
- package/dist/cli-bundle/main.js +15 -14
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +2 -2
- package/dist/cli-bundle/sdk-core.js +31 -31
- 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 +31 -31
- 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 +32 -7
- package/dist/core/governance/issue-codes.d.ts +11 -2
- package/dist/core/governance/issue-codes.js +29 -10
- package/dist/core/item/item-format.js +3 -3
- package/dist/core/store/item-store.js +12 -5
- package/dist/mcp/server.js +123 -9
- package/dist/mcp/tool-definitions.d.ts +2 -0
- package/dist/mcp/tool-definitions.js +2 -2
- package/dist/sdk/agent/closed-domain-contracts.d.ts +1 -1
- package/dist/sdk/agent/closed-domain-contracts.js +24 -2
- package/dist/sdk/agent-capability-contracts.js +6 -2
- package/dist/sdk/cli-bootstrap.js +3 -2
- package/dist/sdk/cli-contracts/command-aliases.js +15 -2
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
- package/dist/sdk/cli-contracts/flag-contracts.js +9 -5
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +3 -3
- package/dist/sdk/cli-contracts/grammar-contracts.js +24 -17
- package/dist/sdk/cli-contracts/runtime-contracts.js +13 -11
- package/dist/sdk/cli-contracts/tool-schema.js +18 -15
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/cli-program.js +3 -2
- package/dist/sdk/completion.js +40 -13
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +14 -2
- package/dist/sdk/governance/upgrade.d.ts +2 -0
- package/dist/sdk/governance/upgrade.js +30 -8
- package/dist/sdk/governance/validate.js +8 -6
- package/dist/sdk/guide-topics.js +6 -6
- package/dist/sdk/index.d.ts +4 -2
- package/dist/sdk/index.js +5 -3
- package/dist/sdk/mcp/apps.d.ts +70 -0
- package/dist/sdk/mcp/apps.js +154 -0
- package/dist/sdk/mcp/skills.d.ts +127 -0
- package/dist/sdk/mcp/skills.js +390 -0
- package/dist/sdk/read-output-contracts.js +16 -3
- package/dist/sdk/runtime-action-aliases.js +7 -3
- package/dist/sdk/runtime-input.js +12 -4
- package/dist/sdk/runtime-primitives.d.ts +1 -1
- package/dist/sdk/runtime-primitives.js +3 -3
- package/docs/CLI_GRAMMAR.md +7 -1
- package/docs/COMMANDS.md +2 -2
- package/docs/EXTENSIONS.md +33 -32
- package/docs/MCP_2026_07_28.md +24 -2
- package/docs/MCP_2026_07_28_CONFORMANCE.md +4 -4
- package/docs/MCP_SKILLS_AND_APPS.md +107 -0
- package/docs/QUICKSTART.md +15 -15
- package/docs/README.md +1 -0
- package/docs/RELEASING.md +11 -3
- package/docs/SDK_CONTEXT_INTEGRITY.md +6 -0
- package/docs/SDK_EVIDENCE_TRACEABILITY.md +9 -1
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +7 -6
- package/marketplace.json +2 -2
- package/package.json +9 -7
- package/packages/pm-beads/README.md +12 -6
- package/packages/pm-beads/docs/MIGRATION.md +53 -0
- package/packages/pm-beads/extensions/beads/index.ts +8 -0
- package/packages/pm-beads/extensions/beads/runtime.ts +671 -112
- 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-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +235 -13
- package/dist/cli-bundle/chunks/chunk-ES25LX3D.js +0 -202
- package/dist/cli-bundle/chunks/chunk-FRDWWB6R.js +0 -3
- package/dist/cli-bundle/chunks/chunk-ICQ3RVIY.js +0 -2
- package/dist/cli-bundle/chunks/chunk-IV64RJVE.js +0 -13
- package/dist/cli-bundle/chunks/chunk-MVYLQ67M.js +0 -3
- package/dist/cli-bundle/chunks/register-setup-GLZAHLVI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-7I23XGWO.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +0 -5
|
@@ -21,6 +21,15 @@ export interface IssueCodeItem {
|
|
|
21
21
|
parent?: string | null;
|
|
22
22
|
/** The id of the canonical item this one was closed as a duplicate of, when set. A closed-as-duplicate item has already been adjudicated, so it is excluded from collision detection entirely (GH-278) — re-flagging a resolved duplicate is permanent noise that erodes trust in `validate`. */
|
|
23
23
|
duplicate_of?: string | null;
|
|
24
|
+
/** Optional body evidence used to disambiguate mixed-case prose compounds. */
|
|
25
|
+
body?: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** Explicit classifier inputs for repository-specific issue-code formats. */
|
|
28
|
+
export interface IssueCodeDetectionOptions {
|
|
29
|
+
/** Prefixes configured by the repository, compared case-insensitively. */
|
|
30
|
+
configuredPrefixes?: readonly string[];
|
|
31
|
+
/** Item body used only for explicit code markers or backtick references. */
|
|
32
|
+
evidenceText?: string | null;
|
|
24
33
|
}
|
|
25
34
|
/** A logical issue code shared by two or more items. */
|
|
26
35
|
export interface DuplicateIssueCode {
|
|
@@ -42,7 +51,7 @@ export interface DuplicateIssueCode {
|
|
|
42
51
|
* Accepts unknown-ish input defensively (exported helper SDK consumers may call
|
|
43
52
|
* from untyped JS): a non-string or empty title resolves to `null`.
|
|
44
53
|
*/
|
|
45
|
-
export declare function extractIssueCode(title: string | null | undefined): string | null;
|
|
54
|
+
export declare function extractIssueCode(title: string | null | undefined, options?: IssueCodeDetectionOptions): string | null;
|
|
46
55
|
/**
|
|
47
56
|
* Find logical issue codes used by 2+ items. Any item whose title begins with a
|
|
48
57
|
* conventional issue code contributes; codes used by a single item are not
|
|
@@ -67,4 +76,4 @@ export declare function extractIssueCode(title: string | null | undefined): stri
|
|
|
67
76
|
* given (id) is used; duplicate ids (should not occur for a valid corpus) are
|
|
68
77
|
* de-duplicated so an item never inflates its own code's count.
|
|
69
78
|
*/
|
|
70
|
-
export declare function findDuplicateIssueCodes(items: readonly IssueCodeItem[]): DuplicateIssueCode[];
|
|
79
|
+
export declare function findDuplicateIssueCodes(items: readonly IssueCodeItem[], options?: Omit<IssueCodeDetectionOptions, "evidenceText">): DuplicateIssueCode[];
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* (digit immediately followed by a letter — no boundary) does not match.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
!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]="
|
|
26
|
-
const ISSUE_CODE_PATTERN = /^([A-Z][A-Z0-9]*-\d+)\b
|
|
25
|
+
!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]="8a7fbaf1-917f-5067-b9b6-a9f27c80e291")}catch(e){}}();
|
|
26
|
+
const ISSUE_CODE_PATTERN = /^([A-Z][A-Z0-9]*-\d+)\b/iu;
|
|
27
27
|
/**
|
|
28
28
|
* Extract the leading logical issue code from a title, or `null` when the title
|
|
29
29
|
* does not begin with one. The title is trimmed and upper-cased before matching
|
|
@@ -33,16 +33,32 @@ const ISSUE_CODE_PATTERN = /^([A-Z][A-Z0-9]*-\d+)\b/;
|
|
|
33
33
|
* Accepts unknown-ish input defensively (exported helper SDK consumers may call
|
|
34
34
|
* from untyped JS): a non-string or empty title resolves to `null`.
|
|
35
35
|
*/
|
|
36
|
-
export function extractIssueCode(title) {
|
|
36
|
+
export function extractIssueCode(title, options = {}) {
|
|
37
37
|
if (typeof title !== "string") {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
40
|
+
const trimmed = title.trim();
|
|
41
|
+
if (trimmed.length === 0) {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
|
-
const match = ISSUE_CODE_PATTERN.exec(
|
|
45
|
-
|
|
44
|
+
const match = ISSUE_CODE_PATTERN.exec(trimmed);
|
|
45
|
+
if (!match)
|
|
46
|
+
return null;
|
|
47
|
+
const rawCode = match[1];
|
|
48
|
+
const normalized = rawCode.toUpperCase();
|
|
49
|
+
const rawPrefix = rawCode.slice(0, rawCode.lastIndexOf("-"));
|
|
50
|
+
const configured = new Set((options.configuredPrefixes ?? []).map((prefix) => prefix.trim().replace(/-+$/u, "").toUpperCase()));
|
|
51
|
+
const remainder = trimmed.slice(rawCode.length);
|
|
52
|
+
const evidence = options.evidenceText?.toUpperCase() ?? "";
|
|
53
|
+
const hasExplicitBodyEvidence = evidence.includes(`ISSUE CODE: ${normalized}`) ||
|
|
54
|
+
evidence.includes(`ISSUE CODE \`${normalized}\``) ||
|
|
55
|
+
evidence.includes(`\`${normalized}\``) ||
|
|
56
|
+
evidence.includes(`[${normalized}]`);
|
|
57
|
+
const structurallyQualified = rawPrefix === rawPrefix.toUpperCase() ||
|
|
58
|
+
/^\s*(?::|—|–|\])/u.test(remainder) ||
|
|
59
|
+
configured.has(rawPrefix.toUpperCase()) ||
|
|
60
|
+
hasExplicitBodyEvidence;
|
|
61
|
+
return structurallyQualified ? normalized : null;
|
|
46
62
|
}
|
|
47
63
|
/** Test whether a value is a usable (non-empty after trim) item-id reference. */
|
|
48
64
|
function isNonEmptyIdReference(value) {
|
|
@@ -72,7 +88,7 @@ function isNonEmptyIdReference(value) {
|
|
|
72
88
|
* given (id) is used; duplicate ids (should not occur for a valid corpus) are
|
|
73
89
|
* de-duplicated so an item never inflates its own code's count.
|
|
74
90
|
*/
|
|
75
|
-
export function findDuplicateIssueCodes(items) {
|
|
91
|
+
export function findDuplicateIssueCodes(items, options = {}) {
|
|
76
92
|
const byCode = new Map();
|
|
77
93
|
for (const item of items) {
|
|
78
94
|
// A non-string title can never carry a code, so skip it before extraction;
|
|
@@ -84,7 +100,10 @@ export function findDuplicateIssueCodes(items) {
|
|
|
84
100
|
if (isNonEmptyIdReference(item.duplicate_of)) {
|
|
85
101
|
continue;
|
|
86
102
|
}
|
|
87
|
-
const code = extractIssueCode(item.title
|
|
103
|
+
const code = extractIssueCode(item.title, {
|
|
104
|
+
...options,
|
|
105
|
+
evidenceText: item.body,
|
|
106
|
+
});
|
|
88
107
|
if (code === null) {
|
|
89
108
|
continue;
|
|
90
109
|
}
|
|
@@ -130,4 +149,4 @@ export function findDuplicateIssueCodes(items) {
|
|
|
130
149
|
return duplicates.sort((left, right) => left.code.localeCompare(right.code));
|
|
131
150
|
}
|
|
132
151
|
//# sourceMappingURL=issue-codes.js.map
|
|
133
|
-
//# debugId=
|
|
152
|
+
//# debugId=8a7fbaf1-917f-5067-b9b6-a9f27c80e291
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines item parsing, formatting, and lifecycle helpers for Item Format.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="051655a4-8ba7-5118-9758-d9ca377fa7e4")}catch(e){}}();
|
|
8
8
|
import { encode as encodeToon } from "@toon-format/toon";
|
|
9
9
|
import { isDeepStrictEqual } from "node:util";
|
|
10
10
|
import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, PLAN_STEP_STATUS_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, STATUS_VALUES, weekdayOrderIndex, } from "../../types/index.js";
|
|
@@ -422,7 +422,7 @@ function sortDependencies(values) {
|
|
|
422
422
|
return undefined;
|
|
423
423
|
return [...values]
|
|
424
424
|
.map((value) => ({
|
|
425
|
-
id: value.id.trim()
|
|
425
|
+
id: value.id.trim(),
|
|
426
426
|
kind: value.kind,
|
|
427
427
|
created_at: value.created_at,
|
|
428
428
|
author: value.author?.trim() || undefined,
|
|
@@ -1472,4 +1472,4 @@ export const _testOnlyItemFormat = {
|
|
|
1472
1472
|
sortTests,
|
|
1473
1473
|
};
|
|
1474
1474
|
//# sourceMappingURL=item-format.js.map
|
|
1475
|
-
//# debugId=
|
|
1475
|
+
//# debugId=051655a4-8ba7-5118-9758-d9ca377fa7e4
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Reads and writes tracker storage with format-aware helpers for Item Store.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="bffd3114-3e85-58ae-90c7-eea5069cdb89")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveOnReadHooks, runActiveBeforeMutationHooks, runActiveOnWriteHooks, runActiveServiceOverride, } from "../extensions/index.js";
|
|
@@ -63,11 +63,18 @@ function resolveItemFormatSearchOrder(preferredFormat) {
|
|
|
63
63
|
}
|
|
64
64
|
/** Implements locate item for the public runtime surface of this module. */
|
|
65
65
|
export async function locateItem(pmRoot, rawId, idPrefix = "pm-", preferredFormat, typeToFolder = TYPE_TO_FOLDER) {
|
|
66
|
+
const trimmedRawId = rawId.trim();
|
|
67
|
+
const exactRawId = trimmedRawId.startsWith("#")
|
|
68
|
+
? trimmedRawId.slice(1)
|
|
69
|
+
: trimmedRawId;
|
|
70
|
+
if (exactRawId.length === 0) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
66
73
|
const normalizedId = normalizeItemId(rawId, idPrefix);
|
|
67
74
|
const rawNormalizedId = normalizeRawItemId(rawId);
|
|
68
|
-
const candidateIds =
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
const candidateIds = [
|
|
76
|
+
...new Set([exactRawId, normalizedId, rawNormalizedId]),
|
|
77
|
+
].filter((candidateId) => candidateId.length > 0);
|
|
71
78
|
const entries = Object.entries(typeToFolder);
|
|
72
79
|
const searchOrder = resolveItemFormatSearchOrder(preferredFormat);
|
|
73
80
|
for (const candidateId of candidateIds) {
|
|
@@ -642,4 +649,4 @@ export async function deleteItem(params) {
|
|
|
642
649
|
}
|
|
643
650
|
}
|
|
644
651
|
//# sourceMappingURL=item-store.js.map
|
|
645
|
-
//# debugId=
|
|
652
|
+
//# debugId=bffd3114-3e85-58ae-90c7-eea5069cdb89
|
package/dist/mcp/server.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Runs the MCP server adapter that exposes pm actions and contracts to external agents.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="77067047-62fc-54e8-9047-ad30580d6125")}catch(e){}}();
|
|
9
9
|
import { realpathSync } from "node:fs";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
import path from "node:path";
|
|
@@ -22,13 +22,15 @@ import { isRuntimeRecord, markMcpMutationTransportInput, } from "../sdk/runtime-
|
|
|
22
22
|
import { attachOutputTokenAccounting } from "../sdk/output-token-accounting.js";
|
|
23
23
|
import { createReproducibleProcessRunner, runWithReproducibleProcessEnvironment, } from "../sdk/reproducibility/process.js";
|
|
24
24
|
import { parseAtomicMutationControls, resolveItemMutationDocument, } from "../sdk/structured-mutations.js";
|
|
25
|
-
import { resolveAuthor, resolvePmRoot } from "../sdk/runtime-primitives.js";
|
|
25
|
+
import { resolveAuthor, resolvePmRoot, resolveWorkspaceRoot, } from "../sdk/runtime-primitives.js";
|
|
26
26
|
import { PM_MCP_ERROR_CODES, PM_MCP_META_KEYS, PM_MCP_PROTOCOL_VERSION, PmMcpProtocolError, attachMcpServerInfo, buildMcpCompleteResult, buildMcpDiscoverResult, hasMcpClientExtension, isMcpRecord, resolveMcpRequestContext, } from "../sdk/mcp/protocol.js";
|
|
27
27
|
import { PmMcpInputRequiredError, buildMcpInputRequiredResult, parseMcpInputResponses, validateMcpJsonSchema, withMcpCachePolicy, } from "../sdk/mcp/interactions.js";
|
|
28
28
|
import { PM_MCP_TASKS_EXTENSION, createMcpTaskStore, } from "../sdk/mcp/tasks.js";
|
|
29
29
|
import { PmMcpSubscriptionRegistry, } from "../sdk/mcp/subscriptions.js";
|
|
30
30
|
import { extractMcpTraceContext, runWithMcpTraceContext, } from "../sdk/mcp/authorization.js";
|
|
31
31
|
import { LegacyMcpAdapter } from "./legacy-adapter.js";
|
|
32
|
+
import { PM_MCP_APP_CONTRACTS, PM_MCP_APP_MIME_TYPE, PM_MCP_APPS_EXTENSION, PM_MCP_APPS_SERVER_CAPABILITY, decoratePmMcpToolsWithApps, findPmMcpAppByUri, hasPmMcpAppsCapability, renderPmMcpAppHtml, } from "../sdk/mcp/apps.js";
|
|
33
|
+
import { PM_MCP_SKILLS_EXTENSION, PM_MCP_SKILLS_SERVER_CAPABILITY, PmMcpSkillRegistry, assertPmMcpSkillsCapability, } from "../sdk/mcp/skills.js";
|
|
32
34
|
function runMcpAction(args) {
|
|
33
35
|
return runAction(markMcpMutationTransportInput(args));
|
|
34
36
|
}
|
|
@@ -53,7 +55,11 @@ const PM_MCP_SERVER_CAPABILITIES = {
|
|
|
53
55
|
prompts: { listChanged: true },
|
|
54
56
|
resources: { listChanged: true, subscribe: true },
|
|
55
57
|
tools: { listChanged: true },
|
|
56
|
-
extensions: {
|
|
58
|
+
extensions: {
|
|
59
|
+
[PM_MCP_TASKS_EXTENSION]: {},
|
|
60
|
+
[PM_MCP_APPS_EXTENSION]: PM_MCP_APPS_SERVER_CAPABILITY,
|
|
61
|
+
[PM_MCP_SKILLS_EXTENSION]: PM_MCP_SKILLS_SERVER_CAPABILITY,
|
|
62
|
+
},
|
|
57
63
|
};
|
|
58
64
|
const PM_MCP_SUBSCRIPTIONS = new Map();
|
|
59
65
|
function createMcpSubscriptionRegistry() {
|
|
@@ -87,6 +93,11 @@ const PM_MCP_RUN_TASK_ACTIONS = new Set([
|
|
|
87
93
|
"test-all",
|
|
88
94
|
"validate",
|
|
89
95
|
]);
|
|
96
|
+
const PM_MCP_SKILL_METHODS = new Set([
|
|
97
|
+
"skills/list",
|
|
98
|
+
"skills/get",
|
|
99
|
+
"resources/directory/read",
|
|
100
|
+
]);
|
|
90
101
|
const PM_MCP_INSTRUCTIONS = "You have access to native pm CLI tools for git-based project management. " +
|
|
91
102
|
"Use pm_next to pick the next actionable item, or pm_context or pm_search before creating new work. " +
|
|
92
103
|
"Prefer narrow tools (pm_next, pm_context, pm_list, pm_get, pm_search, pm_events, pm_create, pm_mutate, pm_copy, pm_focus, pm_update, pm_append, pm_claim, pm_release, pm_close, pm_comments, pm_files, pm_docs, pm_notes, pm_learnings, pm_deps, pm_graph, pm_test, pm_validate, pm_health, pm_contracts, pm_schema, pm_profile, pm_config, pm_plan) over pm_run when they cover the operation. " +
|
|
@@ -524,6 +535,16 @@ async function readWorkspaceResource(uri, params) {
|
|
|
524
535
|
],
|
|
525
536
|
};
|
|
526
537
|
}
|
|
538
|
+
async function loadRequestSkillRegistry(params) {
|
|
539
|
+
const args = requestWorkspaceArgs(params);
|
|
540
|
+
const cwd = typeof args.cwd === "string" ? args.cwd : process.cwd();
|
|
541
|
+
const workspaceRoot = resolveWorkspaceRoot(resolvePmRoot(cwd, typeof args.path === "string" ? args.path : undefined));
|
|
542
|
+
return PmMcpSkillRegistry.load({
|
|
543
|
+
packageRoot: resolvePmPackageRoot(),
|
|
544
|
+
workspaceRoot,
|
|
545
|
+
packageVersion: PM_MCP_SERVER_VERSION,
|
|
546
|
+
});
|
|
547
|
+
}
|
|
527
548
|
function renderWorkflowPrompt(params) {
|
|
528
549
|
const paramsRecord = asRecordClone(params);
|
|
529
550
|
const name = readRequiredString(paramsRecord, "name");
|
|
@@ -705,7 +726,11 @@ async function dispatchMcpTaskMethod(request, requestContext) {
|
|
|
705
726
|
async function dispatchModernToolMethod(request, requestContext, clientInfo) {
|
|
706
727
|
if (request.method === "tools/list") {
|
|
707
728
|
const surface = await resolveMcpToolSurface(TOOLS, requestWorkspaceArgs(request.params));
|
|
708
|
-
return buildMcpCompleteResult(withMcpCachePolicy({
|
|
729
|
+
return buildMcpCompleteResult(withMcpCachePolicy({
|
|
730
|
+
tools: hasCompatiblePmMcpAppsCapability(requestContext)
|
|
731
|
+
? decoratePmMcpToolsWithApps(deterministicMcpTools(surface.tools))
|
|
732
|
+
: deterministicMcpTools(surface.tools),
|
|
733
|
+
}, PM_MCP_CACHE_POLICIES.tools), PM_MCP_SERVER_INFO);
|
|
709
734
|
}
|
|
710
735
|
if (shouldCreateMcpTask(request.params, requestContext)) {
|
|
711
736
|
return createMcpTaskForToolCall(request.params, requestContext);
|
|
@@ -724,16 +749,59 @@ async function dispatchModernToolMethod(request, requestContext, clientInfo) {
|
|
|
724
749
|
});
|
|
725
750
|
}
|
|
726
751
|
}
|
|
727
|
-
async function dispatchModernResourceMethod(request) {
|
|
752
|
+
async function dispatchModernResourceMethod(request, requestContext) {
|
|
728
753
|
if (request.method === "resources/list") {
|
|
729
|
-
const resources = [
|
|
754
|
+
const resources = [
|
|
755
|
+
...PM_MCP_RESOURCE_CONTRACTS,
|
|
756
|
+
...(hasCompatiblePmMcpAppsCapability(requestContext)
|
|
757
|
+
? PM_MCP_APP_CONTRACTS.map((contract) => ({
|
|
758
|
+
uri: contract.uri,
|
|
759
|
+
name: contract.name,
|
|
760
|
+
description: contract.description,
|
|
761
|
+
mimeType: PM_MCP_APP_MIME_TYPE,
|
|
762
|
+
_meta: { ui: contract.resourceMeta },
|
|
763
|
+
}))
|
|
764
|
+
: []),
|
|
765
|
+
].sort((left, right) => left.uri.localeCompare(right.uri));
|
|
730
766
|
return buildMcpCompleteResult(withMcpCachePolicy({ resources }, PM_MCP_CACHE_POLICIES.resources), PM_MCP_SERVER_INFO);
|
|
731
767
|
}
|
|
732
768
|
if (request.method === "resources/templates/list") {
|
|
733
769
|
return buildMcpCompleteResult(withMcpCachePolicy({ resourceTemplates: [] }, PM_MCP_CACHE_POLICIES.resources), PM_MCP_SERVER_INFO);
|
|
734
770
|
}
|
|
735
771
|
try {
|
|
736
|
-
const
|
|
772
|
+
const uri = readRequiredString(asRecordClone(request.params), "uri");
|
|
773
|
+
const app = findPmMcpAppByUri(uri);
|
|
774
|
+
let resource;
|
|
775
|
+
if (app) {
|
|
776
|
+
if (!hasPmMcpAppsCapability(requestContext)) {
|
|
777
|
+
throw new PmMcpProtocolError("MCP App resource requires negotiated client capability", PM_MCP_ERROR_CODES.missingRequiredClientCapability, {
|
|
778
|
+
requiredCapabilities: {
|
|
779
|
+
extensions: {
|
|
780
|
+
[PM_MCP_APPS_EXTENSION]: PM_MCP_APPS_SERVER_CAPABILITY,
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
resource = {
|
|
786
|
+
contents: [
|
|
787
|
+
{
|
|
788
|
+
uri,
|
|
789
|
+
mimeType: PM_MCP_APP_MIME_TYPE,
|
|
790
|
+
text: renderPmMcpAppHtml(app),
|
|
791
|
+
_meta: { ui: app.resourceMeta },
|
|
792
|
+
},
|
|
793
|
+
],
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
else if (uri.startsWith("skill://")) {
|
|
797
|
+
assertPmMcpSkillsCapability(requestContext);
|
|
798
|
+
resource = {
|
|
799
|
+
...(await loadRequestSkillRegistry(request.params)).read(uri),
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
else {
|
|
803
|
+
resource = await readWorkspaceResource(uri, request.params);
|
|
804
|
+
}
|
|
737
805
|
return buildMcpCompleteResult(withMcpCachePolicy(resource, PM_MCP_CACHE_POLICIES.resource), PM_MCP_SERVER_INFO);
|
|
738
806
|
}
|
|
739
807
|
catch (error) {
|
|
@@ -744,6 +812,49 @@ async function dispatchModernResourceMethod(request) {
|
|
|
744
812
|
throw new PmMcpProtocolError(error.message, PM_MCP_ERROR_CODES.invalidParams, { field: "uri" });
|
|
745
813
|
}
|
|
746
814
|
}
|
|
815
|
+
/** Treat an incompatible optional Apps declaration as absent during discovery. */
|
|
816
|
+
function hasCompatiblePmMcpAppsCapability(requestContext) {
|
|
817
|
+
try {
|
|
818
|
+
return hasPmMcpAppsCapability(requestContext);
|
|
819
|
+
}
|
|
820
|
+
catch (error) {
|
|
821
|
+
if (error instanceof PmMcpProtocolError)
|
|
822
|
+
return false;
|
|
823
|
+
throw error;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
/** Validate Skills pagination inputs before handing them to the SDK registry. */
|
|
827
|
+
function readSkillPageOptions(params) {
|
|
828
|
+
if (params.cursor !== undefined && typeof params.cursor !== "string") {
|
|
829
|
+
throw new PmMcpProtocolError("Skills cursor must be a string", PM_MCP_ERROR_CODES.invalidParams, { field: "cursor" });
|
|
830
|
+
}
|
|
831
|
+
if (params.limit !== undefined && typeof params.limit !== "number") {
|
|
832
|
+
throw new PmMcpProtocolError("Skills limit must be a number", PM_MCP_ERROR_CODES.invalidParams, { field: "limit" });
|
|
833
|
+
}
|
|
834
|
+
return {
|
|
835
|
+
...(typeof params.cursor === "string" ? { cursor: params.cursor } : {}),
|
|
836
|
+
...(typeof params.limit === "number" ? { limit: params.limit } : {}),
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
async function dispatchModernSkillMethod(request, requestContext) {
|
|
840
|
+
const directoryRead = request.method === "resources/directory/read";
|
|
841
|
+
assertPmMcpSkillsCapability(requestContext, directoryRead);
|
|
842
|
+
const params = asRecordClone(request.params);
|
|
843
|
+
const registry = await loadRequestSkillRegistry(request.params);
|
|
844
|
+
let result;
|
|
845
|
+
if (request.method === "skills/list") {
|
|
846
|
+
result = { ...registry.list(readSkillPageOptions(params)) };
|
|
847
|
+
}
|
|
848
|
+
else if (request.method === "skills/get") {
|
|
849
|
+
result = { skill: registry.get(readRequiredString(params, "uri")) };
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
result = {
|
|
853
|
+
...registry.readDirectory(readRequiredString(params, "uri"), readSkillPageOptions(params)),
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
return buildMcpCompleteResult(withMcpCachePolicy(result, PM_MCP_CACHE_POLICIES.resource), PM_MCP_SERVER_INFO);
|
|
857
|
+
}
|
|
747
858
|
function dispatchModernPromptMethod(request) {
|
|
748
859
|
const result = request.method === "prompts/list"
|
|
749
860
|
? withMcpCachePolicy({
|
|
@@ -773,6 +884,9 @@ async function dispatchModernMcpRequest(request, meta) {
|
|
|
773
884
|
removedIn: PM_MCP_PROTOCOL_VERSION,
|
|
774
885
|
});
|
|
775
886
|
}
|
|
887
|
+
if (PM_MCP_SKILL_METHODS.has(request.method ?? "")) {
|
|
888
|
+
return dispatchModernSkillMethod(request, requestContext);
|
|
889
|
+
}
|
|
776
890
|
if (request.method === "tasks/get" ||
|
|
777
891
|
request.method === "tasks/update" ||
|
|
778
892
|
request.method === "tasks/cancel") {
|
|
@@ -784,7 +898,7 @@ async function dispatchModernMcpRequest(request, meta) {
|
|
|
784
898
|
if (request.method === "resources/list" ||
|
|
785
899
|
request.method === "resources/templates/list" ||
|
|
786
900
|
request.method === "resources/read") {
|
|
787
|
-
return dispatchModernResourceMethod(request);
|
|
901
|
+
return dispatchModernResourceMethod(request, requestContext);
|
|
788
902
|
}
|
|
789
903
|
if (request.method === "prompts/list" || request.method === "prompts/get") {
|
|
790
904
|
return dispatchModernPromptMethod(request);
|
|
@@ -1048,4 +1162,4 @@ if (isInvokedAsMcpMainModule(process.argv[1], import.meta.url)) {
|
|
|
1048
1162
|
}
|
|
1049
1163
|
/* c8 ignore stop */
|
|
1050
1164
|
//# sourceMappingURL=server.js.map
|
|
1051
|
-
//# debugId=
|
|
1165
|
+
//# debugId=77067047-62fc-54e8-9047-ad30580d6125
|
|
@@ -14,6 +14,8 @@ export interface ToolDefinition {
|
|
|
14
14
|
description: string;
|
|
15
15
|
/** Value that configures or reports input schema for this contract. */
|
|
16
16
|
inputSchema: Record<string, unknown>;
|
|
17
|
+
/** Optional negotiated extension metadata projected during tools/list. */
|
|
18
|
+
_meta?: Record<string, unknown>;
|
|
17
19
|
}
|
|
18
20
|
/** MCP transport parameters layered over every canonical action schema. */
|
|
19
21
|
export declare const TOOL_SCHEMA_BASE: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines the Tool Definitions module for pm CLI source.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="b69edba8-884f-521c-9bc3-451c7df755a9")}catch(e){}}();
|
|
8
8
|
import { GRAPH_SUBCOMMAND_VALUES, PM_DISCOVERABLE_TOOL_ACTIONS, } from "../sdk/cli-contracts/enum-contracts.js";
|
|
9
9
|
import { buildPmActionToolInputSchema } from "../sdk/cli-contracts/tool-schema.js";
|
|
10
10
|
import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
|
|
@@ -748,4 +748,4 @@ export function buildMcpToolContracts() {
|
|
|
748
748
|
}).sort((left, right) => left.name.localeCompare(right.name));
|
|
749
749
|
}
|
|
750
750
|
//# sourceMappingURL=tool-definitions.js.map
|
|
751
|
-
//# debugId=
|
|
751
|
+
//# debugId=b69edba8-884f-521c-9bc3-451c7df755a9
|
|
@@ -15,7 +15,7 @@ export interface PmClosedDomainContract {
|
|
|
15
15
|
/** Exact argv expected in the refusal's executable recovery. */
|
|
16
16
|
suggested_retry_args: readonly string[];
|
|
17
17
|
/** Stable machine-readable error code that owns the refusal. */
|
|
18
|
-
error_code: "projection_options_mutually_exclusive" | "unknown_context_intent" | "unknown_field_projection";
|
|
18
|
+
error_code: "package_upgrade_modes_mutually_exclusive" | "projection_options_mutually_exclusive" | "unknown_context_intent" | "unknown_field_projection";
|
|
19
19
|
/** Whether a complete accepted-value domain is required in the refusal. */
|
|
20
20
|
allowed_values_required?: boolean;
|
|
21
21
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* without changing the stable core corpus.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
!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]="
|
|
9
|
+
!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]="95833d58-d6b9-5ab4-b447-5ce003643fd5")}catch(e){}}();
|
|
10
10
|
import { PM_CONTEXT_INTENT_CONTRACTS } from "../context-intent-contracts.js";
|
|
11
11
|
import { LIST_COMMAND_DEFAULT_PROJECTIONS, listGetProjectionFields, listListProjectionFields, listSearchProjectionFields, } from "../query/projection-contracts.js";
|
|
12
12
|
const REJECTED_INTENT = "not-a-declared-intent";
|
|
@@ -107,6 +107,28 @@ export function listCoreClosedDomainContracts() {
|
|
|
107
107
|
error_code: "projection_options_mutually_exclusive",
|
|
108
108
|
allowed_values_required: false,
|
|
109
109
|
},
|
|
110
|
+
{
|
|
111
|
+
probe_id: "package-upgrade-mutually-exclusive-modes",
|
|
112
|
+
command: "package upgrade",
|
|
113
|
+
flag: "--cli-only/--packages-only",
|
|
114
|
+
rejected_value: "--cli-only+--packages-only",
|
|
115
|
+
refusal_args: [
|
|
116
|
+
"package",
|
|
117
|
+
"upgrade",
|
|
118
|
+
"--cli-only",
|
|
119
|
+
"--packages-only",
|
|
120
|
+
"--dry-run",
|
|
121
|
+
],
|
|
122
|
+
allowed_values: [],
|
|
123
|
+
suggested_retry_args: [
|
|
124
|
+
"package",
|
|
125
|
+
"upgrade",
|
|
126
|
+
"--packages-only",
|
|
127
|
+
"--dry-run",
|
|
128
|
+
],
|
|
129
|
+
error_code: "package_upgrade_modes_mutually_exclusive",
|
|
130
|
+
allowed_values_required: false,
|
|
131
|
+
},
|
|
110
132
|
{
|
|
111
133
|
probe_id: "search-invalid-field",
|
|
112
134
|
command: "search",
|
|
@@ -137,4 +159,4 @@ export function renderPmClosedDomainHelp(command, flag) {
|
|
|
137
159
|
return `Allowed core values: ${canonicalValues.join("|")}.${runtimeSuffix}`;
|
|
138
160
|
}
|
|
139
161
|
//# sourceMappingURL=closed-domain-contracts.js.map
|
|
140
|
-
//# debugId=
|
|
162
|
+
//# debugId=95833d58-d6b9-5ab4-b447-5ce003643fd5
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* surfaces from one public SDK contract.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!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]="
|
|
8
|
+
!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]="d8f3f734-9adf-56f3-a5ba-c8b6407c4a89")}catch(e){}}();
|
|
9
9
|
import { PM_CORE_COMMAND_NAMES } from "./cli-contracts/enum-contracts.js";
|
|
10
10
|
const CORE_COMMANDS = new Set([
|
|
11
11
|
"claim",
|
|
@@ -244,6 +244,8 @@ const CAPABILITY_FAMILY_ORDER = [
|
|
|
244
244
|
];
|
|
245
245
|
const CAPABILITY_ROUTING_EXCLUDED_ALIASES = new Set([
|
|
246
246
|
"ctx",
|
|
247
|
+
"extension",
|
|
248
|
+
"install",
|
|
247
249
|
"item-reopen",
|
|
248
250
|
"list-all",
|
|
249
251
|
"list-blocked",
|
|
@@ -252,6 +254,8 @@ const CAPABILITY_ROUTING_EXCLUDED_ALIASES = new Set([
|
|
|
252
254
|
"list-draft",
|
|
253
255
|
"list-in-progress",
|
|
254
256
|
"list-open",
|
|
257
|
+
"packages",
|
|
258
|
+
"upgrade",
|
|
255
259
|
]);
|
|
256
260
|
/** Group the command registry for progressive-disclosure routing surfaces. */
|
|
257
261
|
export function listPmCommandCapabilityGroups(contracts = PM_COMMAND_CAPABILITY_CONTRACTS) {
|
|
@@ -420,4 +424,4 @@ export function renderPmCapabilityRoutingMarkdown(contracts = PM_COMMAND_CAPABIL
|
|
|
420
424
|
].join("\n");
|
|
421
425
|
}
|
|
422
426
|
//# sourceMappingURL=agent-capability-contracts.js.map
|
|
423
|
-
//# debugId=
|
|
427
|
+
//# debugId=d8f3f734-9adf-56f3-a5ba-c8b6407c4a89
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides public bootstrap argument normalization for embedded CLI hosts.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="90f1f3ba-b3a9-5730-9cf7-8947e782a027")}catch(e){}}();
|
|
8
8
|
import { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, resolveSubcommandFlagContractsForCommand, } from "./cli-contracts.js";
|
|
9
9
|
export { EXECUTABLE_COMMAND_ALIASES, PM_COMMAND_ALIAS_CONTRACTS, renderPmCommandAliasMigrationHint, resolvePmCommandAlias, };
|
|
10
10
|
import { levenshteinDistanceWithinLimit } from "../core/shared/levenshtein.js";
|
|
@@ -50,6 +50,7 @@ const BOOTSTRAP_BOOLEAN_FLAGS = new Set([
|
|
|
50
50
|
"--lean",
|
|
51
51
|
"--token-accounting",
|
|
52
52
|
"--output-row-contract",
|
|
53
|
+
"--all",
|
|
53
54
|
]);
|
|
54
55
|
/** Consume one bootstrap-global token and update the accumulated parse state. */
|
|
55
56
|
function consumeBootstrapGlobalToken(argv, index, state) {
|
|
@@ -895,4 +896,4 @@ export const _testOnly = {
|
|
|
895
896
|
resolveCanonicalFlag,
|
|
896
897
|
};
|
|
897
898
|
//# sourceMappingURL=cli-bootstrap.js.map
|
|
898
|
-
//# debugId=
|
|
899
|
+
//# debugId=90f1f3ba-b3a9-5730-9cf7-8947e782a027
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* are intentionally absent from default help and completion discovery.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
!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]="
|
|
13
|
+
!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]="3c9694bd-3635-5298-abeb-6899c94317ab")}catch(e){}}();
|
|
14
14
|
export const PM_COMMAND_ALIAS_CONTRACTS = [
|
|
15
15
|
...[
|
|
16
16
|
["fetch", "get"],
|
|
@@ -70,6 +70,19 @@ export const PM_COMMAND_ALIAS_CONTRACTS = [
|
|
|
70
70
|
registration: "commander",
|
|
71
71
|
owner: "pm-pfqi",
|
|
72
72
|
})),
|
|
73
|
+
...[
|
|
74
|
+
["extension", "package"],
|
|
75
|
+
["install", "package install"],
|
|
76
|
+
["upgrade", "package upgrade"],
|
|
77
|
+
].map(([alias, canonical]) => ({
|
|
78
|
+
alias,
|
|
79
|
+
canonical,
|
|
80
|
+
canonical_argv: canonical.split(" "),
|
|
81
|
+
lifecycle: "deprecated",
|
|
82
|
+
hidden: true,
|
|
83
|
+
registration: "commander",
|
|
84
|
+
owner: "pm-tnud",
|
|
85
|
+
})),
|
|
73
86
|
];
|
|
74
87
|
/** High-frequency executable aliases whose targets accept identical arguments. */
|
|
75
88
|
export const EXECUTABLE_COMMAND_ALIASES = Object.fromEntries(PM_COMMAND_ALIAS_CONTRACTS.filter((contract) => contract.registration === "bootstrap").map((contract) => [contract.alias, contract.canonical]));
|
|
@@ -83,4 +96,4 @@ export function renderPmCommandAliasMigrationHint(contract) {
|
|
|
83
96
|
return `Deprecated command \`${contract.alias}\`; use \`pm ${contract.canonical_argv.join(" ")}\`.`;
|
|
84
97
|
}
|
|
85
98
|
//# sourceMappingURL=command-aliases.js.map
|
|
86
|
-
//# debugId=
|
|
99
|
+
//# debugId=3c9694bd-3635-5298-abeb-6899c94317ab
|
|
@@ -34,6 +34,8 @@ export declare const MERGE_SUBCOMMAND_VALUES: readonly ["install", "reconcile",
|
|
|
34
34
|
export type MergeSubcommand = (typeof MERGE_SUBCOMMAND_VALUES)[number];
|
|
35
35
|
/** Nested lifecycle verbs flattened by SDK and MCP package actions. */
|
|
36
36
|
export declare const PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS: readonly ["init", "install", "uninstall", "explore", "manage", "describe", "reload", "doctor", "catalog", "adopt", "adopt-all", "activate", "deactivate"];
|
|
37
|
+
/** Package-only lifecycle verbs flattened by SDK and MCP package actions. */
|
|
38
|
+
export declare const PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS: readonly ["upgrade"];
|
|
37
39
|
/** Noun-first item lifecycle verbs flattened for SDK and MCP dispatch. */
|
|
38
40
|
export declare const PM_ITEM_ACTION_SUBCOMMANDS: readonly ["reopen"];
|
|
39
41
|
/** CLI-only presentation commands intentionally omitted from programmatic actions. */
|
|
@@ -44,9 +46,10 @@ export declare const PM_CLI_ONLY_TOOL_ACTION_WAIVERS: {
|
|
|
44
46
|
type PmCoreCommandName = (typeof PM_CORE_COMMAND_NAMES)[number];
|
|
45
47
|
type PmCliOnlyToolAction = keyof typeof PM_CLI_ONLY_TOOL_ACTION_WAIVERS;
|
|
46
48
|
type PmExtensionPackageAction = `${"extension" | "package"}-${(typeof PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS)[number]}`;
|
|
49
|
+
type PmPackageOnlyAction = `package-${(typeof PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS)[number]}`;
|
|
47
50
|
type PmItemAction = `item-${(typeof PM_ITEM_ACTION_SUBCOMMANDS)[number]}`;
|
|
48
51
|
/** Restricts pm tool action values accepted by command, SDK, and storage contracts. */
|
|
49
|
-
export type PmToolAction = Exclude<PmCoreCommandName, PmCliOnlyToolAction | "item"> | PmExtensionPackageAction | PmItemAction;
|
|
52
|
+
export type PmToolAction = Exclude<PmCoreCommandName, PmCliOnlyToolAction | "item"> | PmExtensionPackageAction | PmPackageOnlyAction | PmItemAction;
|
|
50
53
|
/**
|
|
51
54
|
* Public pm tool actions derived from the CLI vocabulary. Nested extension and
|
|
52
55
|
* package verbs are flattened for transports that expose one action string.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines SDK command-contract metadata for Enum Contracts.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="6315a62f-6f55-5200-a5ea-ec892ff39f58")}catch(e){}}();
|
|
8
8
|
import { KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_POLICY_MODES, KNOWN_EXTENSION_POLICY_SURFACES, KNOWN_EXTENSION_SANDBOX_PROFILES, KNOWN_EXTENSION_SERVICE_NAMES, KNOWN_EXTENSION_TRUST_MODES, } from "../../core/extensions/extension-types.js";
|
|
9
9
|
import { PM_COMMAND_ALIAS_CONTRACTS } from "./command-aliases.js";
|
|
10
10
|
/** Public contract for pm extension capability contracts, shared by SDK and presentation-layer consumers. */
|
|
@@ -147,6 +147,8 @@ export const PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS = [
|
|
|
147
147
|
"activate",
|
|
148
148
|
"deactivate",
|
|
149
149
|
];
|
|
150
|
+
/** Package-only lifecycle verbs flattened by SDK and MCP package actions. */
|
|
151
|
+
export const PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS = ["upgrade"];
|
|
150
152
|
/** Noun-first item lifecycle verbs flattened for SDK and MCP dispatch. */
|
|
151
153
|
export const PM_ITEM_ACTION_SUBCOMMANDS = ["reopen"];
|
|
152
154
|
/** CLI-only presentation commands intentionally omitted from programmatic actions. */
|
|
@@ -164,6 +166,9 @@ export const PM_TOOL_ACTIONS = Object.freeze(PM_CORE_COMMAND_NAMES.flatMap((comm
|
|
|
164
166
|
if (command === "extension" || command === "package") {
|
|
165
167
|
return [
|
|
166
168
|
...PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS.map((subcommand) => `${command}-${subcommand}`),
|
|
169
|
+
...(command === "package"
|
|
170
|
+
? PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS.map((subcommand) => `package-${subcommand}`)
|
|
171
|
+
: []),
|
|
167
172
|
command,
|
|
168
173
|
];
|
|
169
174
|
}
|
|
@@ -215,4 +220,4 @@ export function isPmExtensionPolicySurfaceContract(value) {
|
|
|
215
220
|
return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
|
|
216
221
|
}
|
|
217
222
|
//# sourceMappingURL=enum-contracts.js.map
|
|
218
|
-
//# debugId=
|
|
223
|
+
//# debugId=6315a62f-6f55-5200-a5ea-ec892ff39f58
|