@unbrained/pm-cli 2026.8.25 → 2026.8.26

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.
Files changed (116) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +33 -0
  3. package/dist/cli-bundle/bundle-manifest.json +133 -133
  4. package/dist/cli-bundle/chunks/chunk-E2GCFJSU.js +35 -0
  5. package/dist/cli-bundle/chunks/{chunk-QKGMHGEI.js → chunk-ES25LX3D.js} +51 -51
  6. package/dist/cli-bundle/chunks/{chunk-TPQIBSL2.js → chunk-FRDWWB6R.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-65MHLHAA.js → chunk-ICQ3RVIY.js} +2 -2
  8. package/dist/cli-bundle/chunks/chunk-IV64RJVE.js +13 -0
  9. package/dist/cli-bundle/chunks/{chunk-QLUORNIB.js → chunk-KBFP3E4E.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-T2ENPRXF.js → chunk-MVYLQ67M.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-5I5RWIJC.js → chunk-S4U76VZF.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-OWHNAR2B.js → chunk-UKBCRPA2.js} +2 -2
  13. package/dist/cli-bundle/chunks/chunk-WRHJ3MB6.js +8 -0
  14. package/dist/cli-bundle/chunks/{chunk-244MI4GS.js → chunk-ZNRLJ54C.js} +60 -60
  15. package/dist/cli-bundle/chunks/{register-list-query-XVN2ZLI7.js → register-list-query-EMCPMICY.js} +2 -2
  16. package/dist/cli-bundle/chunks/{register-mutation-QCKAEGIJ.js → register-mutation-OJ67ABCB.js} +2 -2
  17. package/dist/cli-bundle/chunks/{register-operations-SDEAXE7E.js → register-operations-H2GLP7LT.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-setup-LXVBRCJ3.js → register-setup-GLZAHLVI.js} +2 -2
  19. package/dist/cli-bundle/focused-chunks/{chunk-NOOZGIXP.js → chunk-4K2II4TV.js} +2 -2
  20. package/dist/cli-bundle/focused-chunks/{chunk-IBZZZGK3.js → chunk-4XNH2HM7.js} +2 -2
  21. package/dist/cli-bundle/focused-chunks/{chunk-VXWATRFL.js → chunk-57XY346D.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/{chunk-GQR3WH3F.js → chunk-66VGB23P.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/{chunk-42S3GGZ7.js → chunk-72T6JGAE.js} +45 -45
  24. package/dist/cli-bundle/focused-chunks/{chunk-RAFKLNZX.js → chunk-FXDLT6FL.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-H5JZEIQV.js → chunk-IBHXMFE7.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-N7W67YIG.js → chunk-LV5N3LK5.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/{chunk-2UIWOP3O.js → chunk-MMXUPDDJ.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/{chunk-ONYQCALA.js → chunk-P2E6LDAE.js} +6 -6
  29. package/dist/cli-bundle/focused-chunks/{chunk-XUQPEKRN.js → chunk-TMJDFHVD.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-OVJL6NZE.js → chunk-UYBA57GY.js} +4 -4
  31. package/dist/cli-bundle/main.js +2 -2
  32. package/dist/cli-bundle/sdk-authoring.js +1 -1
  33. package/dist/cli-bundle/sdk-contracts.js +1 -1
  34. package/dist/cli-bundle/sdk-core.js +31 -31
  35. package/dist/cli-bundle/sdk-governance.js +1 -1
  36. package/dist/cli-bundle/sdk-graph.js +1 -1
  37. package/dist/cli-bundle/sdk-merge.js +18 -18
  38. package/dist/cli-bundle/sdk-query.js +1 -1
  39. package/dist/cli-bundle/sdk-runtime.js +1 -1
  40. package/dist/cli-bundle/sdk-testing.js +1 -1
  41. package/dist/cli-bundle/sdk.js +7 -6
  42. package/dist/core/extensions/manifest-schema.d.ts +20 -0
  43. package/dist/core/extensions/manifest-schema.js +28 -10
  44. package/dist/mcp/http-server.d.ts +60 -0
  45. package/dist/mcp/http-server.js +451 -0
  46. package/dist/mcp/legacy-adapter.d.ts +50 -0
  47. package/dist/mcp/legacy-adapter.js +64 -0
  48. package/dist/mcp/server.d.ts +42 -9
  49. package/dist/mcp/server.js +457 -58
  50. package/dist/sdk/agent/refusal-closure-census.d.ts +6 -2
  51. package/dist/sdk/agent/refusal-closure-census.js +16 -8
  52. package/dist/sdk/compose.d.ts +4 -1
  53. package/dist/sdk/compose.js +23 -36
  54. package/dist/sdk/extension/author-manifest.d.ts +22 -0
  55. package/dist/sdk/extension/author-manifest.js +93 -0
  56. package/dist/sdk/extension.js +6 -3
  57. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +20 -5
  58. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +6 -3
  59. package/dist/sdk/governance/health.js +7 -2
  60. package/dist/sdk/index.d.ts +6 -0
  61. package/dist/sdk/index.js +8 -2
  62. package/dist/sdk/mcp/authorization.d.ts +134 -0
  63. package/dist/sdk/mcp/authorization.js +405 -0
  64. package/dist/sdk/mcp/interactions.d.ts +118 -0
  65. package/dist/sdk/mcp/interactions.js +337 -0
  66. package/dist/sdk/mcp/protocol.d.ts +142 -0
  67. package/dist/sdk/mcp/protocol.js +174 -0
  68. package/dist/sdk/mcp/subscriptions.d.ts +65 -0
  69. package/dist/sdk/mcp/subscriptions.js +212 -0
  70. package/dist/sdk/mcp/tasks.d.ts +107 -0
  71. package/dist/sdk/mcp/tasks.js +431 -0
  72. package/dist/sdk/mcp/transport.d.ts +30 -0
  73. package/dist/sdk/mcp/transport.js +261 -0
  74. package/dist/sdk/merge/receipts.d.ts +16 -0
  75. package/dist/sdk/merge/receipts.js +9 -8
  76. package/dist/sdk/runtime-primitives.d.ts +1 -1
  77. package/dist/sdk/runtime-primitives.js +3 -3
  78. package/dist/sdk/test/execution.d.ts +6 -0
  79. package/dist/sdk/test/execution.js +32 -3
  80. package/docs/AGENT_PROVENANCE_ADR.md +6 -4
  81. package/docs/AGENT_RUNTIME_PRIMITIVES.md +6 -5
  82. package/docs/CLAUDE_CODE_PLUGIN.md +12 -5
  83. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +8 -0
  84. package/docs/EXTENSIONS.md +3 -4
  85. package/docs/MCP_2026_07_28.md +138 -0
  86. package/docs/MCP_2026_07_28_CONFORMANCE.md +30 -0
  87. package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +180 -0
  88. package/docs/README.md +4 -0
  89. package/docs/RELEASING.md +3 -2
  90. package/docs/SDK.md +22 -1
  91. package/docs/SDK_AGENT_SESSION_CONTEXT.md +18 -13
  92. package/docs/SDK_MCP_INTERACTIONS.md +227 -0
  93. package/docs/TESTING.md +4 -0
  94. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +9 -8
  95. package/marketplace.json +2 -2
  96. package/package.json +7 -5
  97. package/packages/pm-beads/package.json +1 -1
  98. package/packages/pm-calendar/package.json +1 -1
  99. package/packages/pm-command-kit/package.json +1 -1
  100. package/packages/pm-digital-twin/package.json +1 -1
  101. package/packages/pm-governance-audit/package.json +1 -1
  102. package/packages/pm-guide-shell/package.json +1 -1
  103. package/packages/pm-kanban/package.json +1 -1
  104. package/packages/pm-lifecycle-hooks/package.json +1 -1
  105. package/packages/pm-linked-test-adapters/package.json +1 -1
  106. package/packages/pm-search-advanced/package.json +1 -1
  107. package/packages/pm-templates/package.json +1 -1
  108. package/packages/pm-todos/package.json +1 -1
  109. package/packages/pm-vcs/package.json +1 -1
  110. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  111. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  112. package/scripts/finalize-build.mjs +1 -0
  113. package/sdk/public-surface.json +628 -2
  114. package/dist/cli-bundle/chunks/chunk-2F3LUFMW.js +0 -8
  115. package/dist/cli-bundle/chunks/chunk-6C7GIMIL.js +0 -13
  116. package/dist/cli-bundle/chunks/chunk-YQMYF3YD.js +0 -35
@@ -44,10 +44,14 @@ export interface PmRefusalClosureCensusReport {
44
44
  /** Exactly one row for every catalog code. */
45
45
  rows: PmRefusalClosureCensusRow[];
46
46
  }
47
- /** Reviewed floor of 16 catalog rows; includes one alias across 15 canonical groups. */
47
+ /** @deprecated Historical v1 floor retained for SDK compatibility. */
48
48
  export declare const PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE = 16;
49
- /** Fifteen canonical compatibility groups that must retain executable evidence. */
49
+ /** @deprecated Historical v1 identities retained for SDK compatibility. */
50
50
  export declare const PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE: readonly ["bulk_ids_input_empty", "bulk_ids_input_missing_path", "bulk_ids_input_unreadable", "invalid_argument_value", "missing_lifecycle_target", "missing_required_argument", "projection_options_mutually_exclusive", "tracker_not_initialized", "tracker_root_missing", "tracker_root_not_directory", "tracker_root_unreadable", "unknown_context_intent", "unknown_field_projection", "unknown_option", "unknown_subcommand"];
51
+ /** Reviewed v2 floor of 18 catalog rows across 17 canonical groups. */
52
+ export declare const PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2 = 18;
53
+ /** V2 canonical identities that must retain executable evidence. */
54
+ export declare const PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2: readonly string[];
51
55
  /** Ratchet receipt that prevents catalog growth from erasing proven closure. */
52
56
  export declare function verifyPmRefusalClosureRatchet(report: PmRefusalClosureCensusReport, baseline?: number): {
53
57
  ok: boolean;
@@ -1,8 +1,8 @@
1
- /** Reviewed floor of 16 catalog rows; includes one alias across 15 canonical groups. */
1
+ /** @deprecated Historical v1 floor retained for SDK compatibility. */
2
2
 
3
- !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]="5560aa3a-036e-509c-955c-a09e9bf9df18")}catch(e){}}();
3
+ !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]="a1efaf49-c6ca-53dd-8fad-eb2540c20cc8")}catch(e){}}();
4
4
  export const PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE = 16;
5
- /** Fifteen canonical compatibility groups that must retain executable evidence. */
5
+ /** @deprecated Historical v1 identities retained for SDK compatibility. */
6
6
  export const PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE = Object.freeze([
7
7
  "bulk_ids_input_empty",
8
8
  "bulk_ids_input_missing_path",
@@ -20,8 +20,16 @@ export const PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE = Object.free
20
20
  "unknown_option",
21
21
  "unknown_subcommand",
22
22
  ]);
23
+ /** Reviewed v2 floor of 18 catalog rows across 17 canonical groups. */
24
+ export const PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2 = 18;
25
+ /** V2 canonical identities that must retain executable evidence. */
26
+ export const PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2 = Object.freeze([
27
+ ...PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,
28
+ "manifest_unknown_key",
29
+ "no_version_bounds_declared",
30
+ ].sort((left, right) => left.localeCompare(right)));
23
31
  /** Ratchet receipt that prevents catalog growth from erasing proven closure. */
24
- export function verifyPmRefusalClosureRatchet(report, baseline = PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE) {
32
+ export function verifyPmRefusalClosureRatchet(report, baseline = PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2) {
25
33
  return {
26
34
  ok: report.executable_error_code_count >= baseline,
27
35
  baseline,
@@ -29,7 +37,7 @@ export function verifyPmRefusalClosureRatchet(report, baseline = PM_REFUSAL_CLOS
29
37
  };
30
38
  }
31
39
  /** Ratchet canonical compatibility-group identities independently from counts. */
32
- export function verifyPmRefusalClosureIdentityRatchet(report, requiredCanonicalCodes = PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE) {
40
+ export function verifyPmRefusalClosureIdentityRatchet(report, requiredCanonicalCodes = PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2) {
33
41
  const executableCanonicalCodes = new Set(report.rows
34
42
  .filter(({ disposition }) => disposition === "executable")
35
43
  .map(({ canonical_code: canonicalCode }) => canonicalCode));
@@ -127,8 +135,8 @@ export function renderPmRefusalClosureCensusMarkdown(report) {
127
135
  "",
128
136
  `- Catalog error codes: ${report.catalog_error_code_count}`,
129
137
  `- Executable error codes: ${report.executable_error_code_count}`,
130
- `- Executable-code ratchet floor: ${PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE}`,
131
- `- Required executable canonical codes: ${PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE.map((code) => `\`${code}\``).join(", ")}`,
138
+ `- Executable-code ratchet floor: ${PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2}`,
139
+ `- Required executable canonical codes: ${PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2.map((code) => `\`${code}\``).join(", ")}`,
132
140
  `- Uncovered error codes: ${report.uncovered_error_code_count}`,
133
141
  `- Coverage fraction: ${report.coverage_fraction.toFixed(6)}`,
134
142
  `- Closed-domain probes: ${report.closed_domain_probe_count}`,
@@ -141,4 +149,4 @@ export function renderPmRefusalClosureCensusMarkdown(report) {
141
149
  ].join("\n");
142
150
  }
143
151
  //# sourceMappingURL=refusal-closure-census.js.map
144
- //# debugId=5560aa3a-036e-509c-955c-a09e9bf9df18
152
+ //# debugId=a1efaf49-c6ca-53dd-8fad-eb2540c20cc8
@@ -31,6 +31,9 @@ import type { ProjectProfileRegistrationInput } from "../core/profile/profile-pr
31
31
  import type { PmMaxVersionExceededMode } from "../core/extensions/extension-types.js";
32
32
  import type { RelationshipKindDefinition } from "./relationships.js";
33
33
  import { type PmVersionBoundKind } from "../core/extensions/version-compat.js";
34
+ import { inspectExtensionManifestSchema, lintExtensionManifestSchema, type ExtensionManifestSchemaFinding, type ExtensionManifestSchemaInspection, type ExtensionManifestSchemaLintResult } from "../core/extensions/manifest-schema.js";
35
+ export { inspectExtensionManifestSchema, lintExtensionManifestSchema };
36
+ export type { ExtensionManifestSchemaFinding, ExtensionManifestSchemaInspection, ExtensionManifestSchemaLintResult, };
34
37
  /**
35
38
  * Documents the extension module payload exchanged by command, SDK, and package integrations.
36
39
  *
@@ -489,7 +492,7 @@ export interface ExtensionManifestCompatibilityFinding {
489
492
  export interface ExtensionManifestCompatibilityResult {
490
493
  /** `true` when no `error`-severity finding blocks the load against the target version. */
491
494
  compatible: boolean;
492
- /** Every bound finding, lower bound before upper bound; empty when both bounds are absent or satisfied. */
495
+ /** Every schema and bound finding in stable evaluation order. */
493
496
  findings: ExtensionManifestCompatibilityFinding[];
494
497
  /** The target pm version the manifest was checked against, echoed back for messaging. */
495
498
  pmVersion: string;
@@ -1,11 +1,12 @@
1
1
 
2
- !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]="bbc8dcd1-7dde-54f5-bebf-6d95ea0aaa1e")}catch(e){}}();
2
+ !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]="23224ef3-9c86-5ae7-9ad8-0b3c687d4df7")}catch(e){}}();
3
3
  import { normalizeKnownExtensionCapability, resolveLegacyExtensionCapabilityAlias, } from "../core/extensions/extension-capability-aliases.js";
4
4
  import { normalizeCommandName } from "../core/extensions/extension-runtime-helpers.js";
5
5
  import { RESERVED_ITEM_FIELD_NAMES } from "../core/extensions/item-fields.js";
6
6
  import { describeExtensionLongFlagFailure, findExtensionFlagTokenFailure, } from "../core/extensions/flag-definition-validation.js";
7
7
  import { evaluatePmMaxVersionBound, evaluatePmMinVersionBound, } from "../core/extensions/version-compat.js";
8
- import { inspectExtensionManifestSchema } from "../core/extensions/manifest-schema.js";
8
+ import { inspectExtensionManifestSchema, lintExtensionManifestSchema, } from "../core/extensions/manifest-schema.js";
9
+ export { inspectExtensionManifestSchema, lintExtensionManifestSchema };
9
10
  /**
10
11
  * Typed identity helper for extension module exports.
11
12
  *
@@ -962,47 +963,33 @@ function toCompatibilityFinding(evaluation, pmVersion) {
962
963
  export function checkExtensionManifestCompatibility(manifest, target) {
963
964
  const minEvaluation = evaluatePmMinVersionBound(manifest.pm_min_version, target.pmVersion);
964
965
  const maxEvaluation = evaluatePmMaxVersionBound(manifest.pm_max_version, target.pmVersion, target.pmMaxVersionExceededMode ?? "block");
965
- const findings = [];
966
- const schema = inspectExtensionManifestSchema(manifest);
967
- for (const key of schema.unknownKeys) {
968
- findings.push({
969
- code: "manifest_unknown_key",
970
- severity: "warning",
971
- constraint: "manifest",
972
- required: key,
973
- current: target.pmVersion,
974
- path: key,
975
- ...(key === "compatibility"
976
- ? { suggested_key: "pm_min_version" }
977
- : {}),
978
- message: key === "compatibility"
979
- ? 'Manifest key "compatibility" is ignored; declare the canonical pm_min_version and optional pm_max_version fields instead.'
980
- : `Manifest key "${key}" is not part of the extension manifest contract and will be ignored.`,
981
- });
982
- }
983
- if (schema.missingVersionBounds) {
984
- findings.push({
985
- code: "no_version_bounds_declared",
986
- severity: "warning",
987
- constraint: "manifest",
988
- required: "pm_min_version",
989
- current: target.pmVersion,
990
- path: "$",
991
- suggested_key: "pm_min_version",
992
- message: "No canonical pm version bounds are declared; add pm_min_version so compatibility intent is explicit.",
993
- });
994
- }
966
+ const schema = lintExtensionManifestSchema(manifest);
967
+ const schemaFindings = schema.findings.map((finding) => ({
968
+ code: finding.code,
969
+ severity: "warning",
970
+ constraint: "manifest",
971
+ required: finding.code === "manifest_unknown_key"
972
+ ? finding.path
973
+ : "pm_min_version",
974
+ current: target.pmVersion,
975
+ path: finding.path,
976
+ ...(finding.suggested_key
977
+ ? { suggested_key: finding.suggested_key }
978
+ : {}),
979
+ message: finding.message,
980
+ }));
981
+ const compatibilityFindings = [];
995
982
  const minFinding = toCompatibilityFinding(minEvaluation, target.pmVersion);
996
983
  if (minFinding !== null) {
997
- findings.push(minFinding);
984
+ compatibilityFindings.push(minFinding);
998
985
  }
999
986
  const maxFinding = toCompatibilityFinding(maxEvaluation, target.pmVersion);
1000
987
  if (maxFinding !== null) {
1001
- findings.push(maxFinding);
988
+ compatibilityFindings.push(maxFinding);
1002
989
  }
1003
990
  return {
1004
991
  compatible: minEvaluation.allowed && maxEvaluation.allowed,
1005
- findings,
992
+ findings: [...schemaFindings, ...compatibilityFindings],
1006
993
  pmVersion: target.pmVersion,
1007
994
  };
1008
995
  }
@@ -1101,4 +1088,4 @@ export function preflightExtension(blueprint, options = {}) {
1101
1088
  };
1102
1089
  }
1103
1090
  //# sourceMappingURL=compose.js.map
1104
- //# debugId=bbc8dcd1-7dde-54f5-bebf-6d95ea0aaa1e
1091
+ //# debugId=23224ef3-9c86-5ae7-9ad8-0b3c687d4df7
@@ -0,0 +1,22 @@
1
+ import { type ExtensionManifestSchemaFinding } from "../../core/extensions/manifest-schema.js";
2
+ /** Read-only author-workspace manifest diagnostic shared by health and doctor. */
3
+ export interface ExtensionAuthorManifestDiagnostic {
4
+ /** Absolute path inspected for the extension runtime manifest. */
5
+ path: string;
6
+ /** Whether the workspace declares a root extension manifest. */
7
+ present: boolean;
8
+ /** Parse state for absent, valid, or malformed manifest content. */
9
+ parse_status: "absent" | "valid" | "invalid_json" | "invalid_shape";
10
+ /** Canonical package catalog metadata location, distinct from manifest.json. */
11
+ package_metadata_location: "package.json#pm";
12
+ /** Public schema findings when the file is a JSON object. */
13
+ schema_findings: ExtensionManifestSchemaFinding[];
14
+ /** Runtime warning tokens incorporated into health/doctor status. */
15
+ warnings: string[];
16
+ /** Direct author correction for every reported state. */
17
+ remediation: string[];
18
+ }
19
+ /** Inspect `<workspace>/manifest.json` without loading extension code. */
20
+ export declare function inspectExtensionAuthorManifest(workspaceRoot: string): Promise<ExtensionAuthorManifestDiagnostic>;
21
+ /** Inspect the author manifest for a resolved project tracker root. */
22
+ export declare function inspectExtensionAuthorManifestAtPmRoot(pmRoot: string): Promise<ExtensionAuthorManifestDiagnostic>;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * @module sdk/extension/author-manifest
3
+ *
4
+ * Reads the optional extension manifest at a package-author workspace root and
5
+ * projects the public schema lint into health/doctor diagnostics.
6
+ */
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]="5755dee7-d2df-5ced-8a94-aeb51762edb7")}catch(e){}}();
9
+ import fs from "node:fs/promises";
10
+ import path from "node:path";
11
+ import { isFileAbsentError } from "../../core/fs/fs-utils.js";
12
+ import { lintExtensionManifestSchema, } from "../../core/extensions/manifest-schema.js";
13
+ import { resolveWorkspaceRoot } from "../../core/store/paths.js";
14
+ function manifestName(raw) {
15
+ return typeof raw.name === "string" && raw.name.trim().length > 0
16
+ ? raw.name.trim()
17
+ : "workspace-manifest";
18
+ }
19
+ function authorManifestWarning(name, finding) {
20
+ return finding.code === "manifest_unknown_key"
21
+ ? `extension_manifest_unknown_key:author:${name}:key=${finding.path}${finding.suggested_key ? `:suggested=${finding.suggested_key}` : ""}`
22
+ : `extension_manifest_no_version_bounds:author:${name}:suggested=pm_min_version`;
23
+ }
24
+ /** Inspect `<workspace>/manifest.json` without loading extension code. */
25
+ export async function inspectExtensionAuthorManifest(workspaceRoot) {
26
+ const manifestPath = path.join(workspaceRoot, "manifest.json");
27
+ let content;
28
+ try {
29
+ content = await fs.readFile(manifestPath, "utf8");
30
+ }
31
+ catch (error) {
32
+ if (isFileAbsentError(error)) {
33
+ return {
34
+ path: manifestPath,
35
+ present: false,
36
+ parse_status: "absent",
37
+ package_metadata_location: "package.json#pm",
38
+ schema_findings: [],
39
+ warnings: [],
40
+ remediation: [],
41
+ };
42
+ }
43
+ throw error;
44
+ }
45
+ let parsed;
46
+ try {
47
+ parsed = JSON.parse(content);
48
+ }
49
+ catch {
50
+ return {
51
+ path: manifestPath,
52
+ present: true,
53
+ parse_status: "invalid_json",
54
+ package_metadata_location: "package.json#pm",
55
+ schema_findings: [],
56
+ warnings: ["extension_author_manifest_invalid_json:manifest.json"],
57
+ remediation: [
58
+ "Repair manifest.json so it contains one valid JSON object, then rerun pm package doctor --project.",
59
+ ],
60
+ };
61
+ }
62
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
63
+ return {
64
+ path: manifestPath,
65
+ present: true,
66
+ parse_status: "invalid_shape",
67
+ package_metadata_location: "package.json#pm",
68
+ schema_findings: [],
69
+ warnings: ["extension_author_manifest_invalid_shape:manifest.json"],
70
+ remediation: [
71
+ "Replace manifest.json with one JSON object, then rerun pm package doctor --project.",
72
+ ],
73
+ };
74
+ }
75
+ const raw = parsed;
76
+ const lint = lintExtensionManifestSchema(raw);
77
+ const name = manifestName(raw);
78
+ return {
79
+ path: manifestPath,
80
+ present: true,
81
+ parse_status: "valid",
82
+ package_metadata_location: "package.json#pm",
83
+ schema_findings: lint.findings,
84
+ warnings: lint.findings.map((finding) => authorManifestWarning(name, finding)),
85
+ remediation: lint.findings.map((finding) => finding.message),
86
+ };
87
+ }
88
+ /** Inspect the author manifest for a resolved project tracker root. */
89
+ export function inspectExtensionAuthorManifestAtPmRoot(pmRoot) {
90
+ return inspectExtensionAuthorManifest(resolveWorkspaceRoot(pmRoot));
91
+ }
92
+ //# sourceMappingURL=author-manifest.js.map
93
+ //# debugId=5755dee7-d2df-5ced-8a94-aeb51762edb7
@@ -4,7 +4,7 @@
4
4
  * Implements the pm extension command surface and its agent-facing runtime behavior.
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]="8b0fbe09-2221-5b8e-8712-90a83df19306")}catch(e){}}();
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]="8d5ed026-8d61-5083-956c-9281caa0168b")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { activateExtensions, createSerialQueue, loadExtensions, nextExtensionReloadToken, } from "../core/extensions/index.js";
@@ -41,6 +41,7 @@ import { collectGlobalOutputOverrideDoctorWarnings } from "./extension/output-ow
41
41
  import { collectMcpCustomFieldCollisionDoctorWarnings } from "./extension/custom-field-collisions.js";
42
42
  import { checkGithubUpdate } from "./extension/update-check.js";
43
43
  import { runExtensionMigrateAction } from "./extension/migrations.js";
44
+ import { inspectExtensionAuthorManifestAtPmRoot } from "./extension/author-manifest.js";
44
45
  import { resolveExtensionInstallSourceIdentity, } from "./extension/source-resolution.js";
45
46
  import { captureExtensionInstallSnapshot, readOptionalMetadataFile, restoreExtensionInstallSnapshot, } from "./extension/install-snapshot.js";
46
47
  // Re-export the public surface that lives in sibling modules but was previously
@@ -1773,7 +1774,8 @@ const runExtensionDoctorAction = async (ctx) => {
1773
1774
  ...loadResult,
1774
1775
  loaded: loadResult.loaded,
1775
1776
  });
1776
- warnings.push(...loadResult.warnings);
1777
+ const authorManifest = await inspectExtensionAuthorManifestAtPmRoot(resolvedRoots.pm_root);
1778
+ warnings.push(...authorManifest.warnings, ...loadResult.warnings);
1777
1779
  warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
1778
1780
  warnings.push(...activationResult.warnings);
1779
1781
  warnings.push(...classifyDoctorActivationFailureWarnings(activationResult.failed));
@@ -1885,6 +1887,7 @@ const runExtensionDoctorAction = async (ctx) => {
1885
1887
  capability_contract: capabilityContract,
1886
1888
  capability_guidance: capabilityGuidance,
1887
1889
  managed_state_fix: managedStateFixSummary,
1890
+ author_manifest: authorManifest,
1888
1891
  isolation,
1889
1892
  policy: loadResult.policy,
1890
1893
  };
@@ -2191,4 +2194,4 @@ export const _testOnly = {
2191
2194
  withExtensionInstallLock,
2192
2195
  };
2193
2196
  //# sourceMappingURL=extension.js.map
2194
- //# debugId=8b0fbe09-2221-5b8e-8712-90a83df19306
2197
+ //# debugId=8d5ed026-8d61-5083-956c-9281caa0168b
@@ -1,6 +1,6 @@
1
1
  /** Generated partition 1 of the exhaustive error-code catalog. */
2
2
 
3
- !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]="d68e7da2-7390-5632-a3d1-375f622d5c87")}catch(e){}}();
3
+ !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]="c51fce27-5acd-513d-83c4-5fd75bd999f9")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_1 = [
5
5
  {
6
6
  code: "acceptance_criteria_mutation_conflict",
@@ -1945,13 +1945,16 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1945
1945
  code: "manifest_unknown_key",
1946
1946
  meaning: "Manifest unknown key condition.",
1947
1947
  stability: "provisional",
1948
- exit_code: 2,
1949
- class: "usage",
1948
+ exit_code: 1,
1949
+ class: "generic_failure",
1950
1950
  recovery: "Inspect the structured error guidance and retry the suggested command.",
1951
- sources: ["sdk/compose.ts"],
1951
+ sources: ["core/extensions/manifest-schema.ts"],
1952
1952
  emitting_commands: ["*"],
1953
1953
  canonical_code: "manifest_unknown_key",
1954
1954
  aliases: [],
1955
+ owned_states: [
1956
+ { state: "author_workspace_manifest_declares_an_unknown_top_level_key", probe_id: "author-manifest-unknown-key", entrypoints: ["health"], expected_exit_class: "generic_failure" },
1957
+ ],
1955
1958
  },
1956
1959
  {
1957
1960
  code: "mcp_annotation_file_unavailable",
@@ -1977,6 +1980,18 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
1977
1980
  canonical_code: "mcp_stdin_unavailable",
1978
1981
  aliases: [],
1979
1982
  },
1983
+ {
1984
+ code: "mcp_task_not_found_or_not_authorized",
1985
+ meaning: "Mcp task not found or not authorized condition.",
1986
+ stability: "provisional",
1987
+ exit_code: 3,
1988
+ class: "not_found",
1989
+ recovery: "Inspect the structured error guidance and retry the suggested command.",
1990
+ sources: ["sdk/mcp/tasks.ts"],
1991
+ emitting_commands: ["*"],
1992
+ canonical_code: "mcp_task_not_found_or_not_authorized",
1993
+ aliases: [],
1994
+ },
1980
1995
  {
1981
1996
  code: "merge_conflict_markers_detected",
1982
1997
  meaning: "Merge conflict markers detected condition.",
@@ -2075,4 +2090,4 @@ export const PM_ERROR_CODE_CATALOG_PART_1 = [
2075
2090
  },
2076
2091
  ];
2077
2092
  //# sourceMappingURL=generated-error-code-catalog-part-1.js.map
2078
- //# debugId=d68e7da2-7390-5632-a3d1-375f622d5c87
2093
+ //# debugId=c51fce27-5acd-513d-83c4-5fd75bd999f9
@@ -1,6 +1,6 @@
1
1
  /** Generated partition 2 of the exhaustive error-code catalog. */
2
2
 
3
- !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]="23e8e07d-84f2-54b6-98ad-2e33d996f09d")}catch(e){}}();
3
+ !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]="347933e7-190b-5679-9379-f25f63d0351a")}catch(e){}}();
4
4
  export const PM_ERROR_CODE_CATALOG_PART_2 = [
5
5
  {
6
6
  code: "missing_allowed_values",
@@ -311,10 +311,13 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
311
311
  exit_code: 1,
312
312
  class: "generic_failure",
313
313
  recovery: "Inspect the structured error guidance and retry the suggested command.",
314
- sources: ["sdk/compose.ts"],
314
+ sources: ["core/extensions/manifest-schema.ts"],
315
315
  emitting_commands: ["*"],
316
316
  canonical_code: "no_version_bounds_declared",
317
317
  aliases: [],
318
+ owned_states: [
319
+ { state: "author_workspace_manifest_omits_canonical_pm_version_bounds", probe_id: "author-manifest-version-bounds-missing", entrypoints: ["health"], expected_exit_class: "generic_failure" },
320
+ ],
318
321
  },
319
322
  {
320
323
  code: "non_refusal_exit",
@@ -2099,4 +2102,4 @@ export const PM_ERROR_CODE_CATALOG_PART_2 = [
2099
2102
  },
2100
2103
  ];
2101
2104
  //# sourceMappingURL=generated-error-code-catalog-part-2.js.map
2102
- //# debugId=23e8e07d-84f2-54b6-98ad-2e33d996f09d
2105
+ //# debugId=347933e7-190b-5679-9379-f25f63d0351a
@@ -4,7 +4,7 @@
4
4
  * Implements the pm health command surface and its agent-facing runtime behavior.
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]="5887be76-3d1d-56fb-9cae-cf972f0b73f8")}catch(e){}}();
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]="652d1b49-f9d1-55a7-84b5-ff3cf57648ad")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { assertInitializedTracker } from "../environment/tracker-preflight.js";
@@ -41,6 +41,7 @@ import { scanHistoryAuthorAttribution, } from "../author-attribution.js";
41
41
  import { readManagedExtensionState } from "../extension.js";
42
42
  import { scanProvenanceResolverHealth } from "./provenance-health.js";
43
43
  import { applyStoredExtensionMigrationState } from "../extension/migrations.js";
44
+ import { inspectExtensionAuthorManifest } from "../extension/author-manifest.js";
44
45
  import { buildCapabilityContractMetadata, buildRegistrationCollisionRemediation, collectUnknownCapabilityGuidance, } from "../extension/doctor.js";
45
46
  import { scanStaleInProgressItems, } from "./stale-work.js";
46
47
  import { scanTrackedRuntimeCache } from "./tracked-runtime-cache.js";
@@ -649,6 +650,7 @@ function buildExtensionHealthTriageSummary(warnings, loadFailureCount, activatio
649
650
  };
650
651
  }
651
652
  async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
653
+ const authorManifest = await inspectExtensionAuthorManifest(resolveWorkspaceRoot(pmRoot));
652
654
  const loadResult = await loadExtensions({
653
655
  pmRoot,
654
656
  settings,
@@ -735,6 +737,7 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
735
737
  ]
736
738
  : [];
737
739
  const extensionWarnings = [
740
+ ...authorManifest.warnings,
738
741
  ...loadResult.warnings,
739
742
  ...activationDetails.warnings,
740
743
  ...migrationStatus.warnings,
@@ -757,6 +760,7 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
757
760
  loaded: loadedSummaries,
758
761
  warnings: extensionWarnings,
759
762
  activation: activationDetails,
763
+ author_manifest: authorManifest,
760
764
  triage: extensionTriage,
761
765
  ...(migrationStatus.summary.pending_count > 0
762
766
  ? {
@@ -902,6 +906,7 @@ const HEALTH_DETAIL_SUMMARIZERS = {
902
906
  registration_counts: activation.registration_counts,
903
907
  migration_status: summarizeActivationMigrationStatus(activation.migration_status),
904
908
  },
909
+ author_manifest: details.author_manifest,
905
910
  triage: details.triage,
906
911
  capability_contract: details.capability_contract,
907
912
  capability_guidance: summarizeRecordList(details.capability_guidance, limit),
@@ -2229,4 +2234,4 @@ export const _testOnlyHealthCommand = {
2229
2234
  warningCode,
2230
2235
  };
2231
2236
  //# sourceMappingURL=health.js.map
2232
- //# debugId=5887be76-3d1d-56fb-9cae-cf972f0b73f8
2237
+ //# debugId=652d1b49-f9d1-55a7-84b5-ff3cf57648ad
@@ -4,6 +4,12 @@
4
4
  * Defines public SDK APIs and package-author helpers for Index.
5
5
  */
6
6
  export { PM_COMMAND_CAPABILITY_CONTRACTS, PM_COMMAND_VISIBILITY_CONTRACTS, PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, PM_MCP_TOOL_COMMAND_CONTRACTS, listPmCommandsForFamily, listPmCommandsForTier, listPmMcpToolsForProfile, renderPmCommandVisibilityMarkdown, resolvePmCommandCapabilityFamily, resolvePmCommandVisibilityTier, } from "./agent-capability-contracts.js";
7
+ export * from "./mcp/protocol.js";
8
+ export * from "./mcp/interactions.js";
9
+ export * from "./mcp/tasks.js";
10
+ export * from "./mcp/subscriptions.js";
11
+ export * from "./mcp/transport.js";
12
+ export * from "./mcp/authorization.js";
7
13
  export * from "./cli-contracts/grammar-contracts.js";
8
14
  export * from "./agent-session-context.js";
9
15
  export type { PmCommandCapabilityContract, PmCommandCapabilityFamily, PmCommandVisibilityContract, PmCommandVisibilityTier, PmMcpPromptArgumentContract, PmMcpPromptContract, PmMcpResourceContract, PmMcpToolProfile, } from "./agent-capability-contracts.js";
package/dist/sdk/index.js CHANGED
@@ -4,8 +4,14 @@
4
4
  * Defines public SDK APIs and package-author helpers for Index.
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]="805c081a-a781-50c3-8919-81492208913b")}catch(e){}}();
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]="bfa96f97-ffdf-54f9-b632-006f5dfe2ee3")}catch(e){}}();
8
8
  export { PM_COMMAND_CAPABILITY_CONTRACTS, PM_COMMAND_VISIBILITY_CONTRACTS, PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, PM_MCP_TOOL_COMMAND_CONTRACTS, listPmCommandsForFamily, listPmCommandsForTier, listPmMcpToolsForProfile, renderPmCommandVisibilityMarkdown, resolvePmCommandCapabilityFamily, resolvePmCommandVisibilityTier, } from "./agent-capability-contracts.js";
9
+ export * from "./mcp/protocol.js";
10
+ export * from "./mcp/interactions.js";
11
+ export * from "./mcp/tasks.js";
12
+ export * from "./mcp/subscriptions.js";
13
+ export * from "./mcp/transport.js";
14
+ export * from "./mcp/authorization.js";
9
15
  export * from "./cli-contracts/grammar-contracts.js";
10
16
  export * from "./agent-session-context.js";
11
17
  export { isErrnoError, limitAnnotationEntries, parseAnnotationTextInput, readAnnotationEntries, normalizeAnnotationTransportOptions, resolveAnnotationInput, resolveAnnotationIndex, runAnnotationCommand, wrapOwnershipConflict, } from "./annotations.js";
@@ -167,4 +173,4 @@ export * from "./governance.js";
167
173
  export * from "./query.js";
168
174
  export * from "./testing.js";
169
175
  //# sourceMappingURL=index.js.map
170
- //# debugId=805c081a-a781-50c3-8919-81492208913b
176
+ //# debugId=bfa96f97-ffdf-54f9-b632-006f5dfe2ee3