@unbrained/pm-cli 2026.8.21 → 2026.8.22
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 +16 -0
- package/dist/cli/error-guidance.d.ts +9 -4
- package/dist/cli/error-guidance.js +16 -15
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +40 -7
- package/dist/cli-bundle/bundle-manifest.json +153 -153
- package/dist/cli-bundle/chunks/{chunk-BKYB45NQ.js → chunk-BWX4SK46.js} +48 -48
- package/dist/cli-bundle/chunks/chunk-EMWDM5FI.js +13 -0
- package/dist/cli-bundle/chunks/chunk-HYG6LRL4.js +200 -0
- package/dist/cli-bundle/chunks/{chunk-LARJJ3RK.js → chunk-MYYI3ZOA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BUNIEJNE.js → chunk-MZTZQTMS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LOVTQ52Z.js → chunk-QI2CT3IX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-SMWXHMVB.js +35 -0
- package/dist/cli-bundle/chunks/{chunk-N3DSV4CH.js → chunk-U6GQ4VMV.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-3AFAUHUE.js → chunk-VMMIL3SI.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-WG4STC36.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-JSLOFXGA.js → chunk-YBPJAOQQ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-F57EWDEF.js → register-list-query-HZKBQNWW.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-7IY2D5KO.js → register-mutation-HTKEEGRD.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-FALL3YTU.js → register-operations-6EMRWJJY.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-HXU7IZZD.js → register-setup-QK4OTOXN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FJ22HNRP.js → chunk-2ARQGDDW.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CKKQSJNN.js → chunk-2AZT5WXZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-F4YEW5I2.js → chunk-2POVTNLY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-3LKU6PTJ.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-5SHSBMX2.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FH6DYED3.js → chunk-6S2MO3Q3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UZE7XUZK.js → chunk-A2BC5PQL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-C4S4A4JJ.js +5 -0
- package/dist/cli-bundle/focused-chunks/{chunk-KDNG7TKQ.js → chunk-D6RBZEJJ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-E2EWYPY6.js +16 -0
- package/dist/cli-bundle/focused-chunks/{chunk-4ERLO7QD.js → chunk-GMYPD4FX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-L5LDSRO2.js +155 -0
- package/dist/cli-bundle/focused-chunks/{chunk-ZOSEELYJ.js → chunk-MB37AYN6.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-MCOR37QK.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-2NIY5NKG.js → chunk-PH2OXXVZ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-YKBKIEAJ.js → chunk-PMGJUFNQ.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-R6SR45XU.js +50 -0
- package/dist/cli-bundle/focused-chunks/chunk-WZE4LIPW.js +8 -0
- package/dist/cli-bundle/main.js +13 -13
- 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 +40 -40
- 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 +32 -32
- 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 +5 -5
- package/dist/core/extensions/extension-hook-runtime.js +22 -20
- package/dist/core/extensions/extension-types.d.ts +8 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +7 -3
- package/dist/core/extensions/service-ownership.d.ts +8 -0
- package/dist/core/extensions/service-ownership.js +20 -0
- package/dist/core/item/id.js +20 -5
- package/dist/core/item/item-format.js +27 -2
- package/dist/core/shared/errors.d.ts +4 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/sdk/agent/refusal-reachability.d.ts +1 -1
- package/dist/sdk/authoring.d.ts +1 -1
- package/dist/sdk/authoring.js +2 -2
- package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +77 -0
- package/dist/sdk/cli-contracts/agent-output-contracts.js +324 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -3
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +3 -1
- package/dist/sdk/cli-contracts/runtime-contracts.js +4 -3
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/extension/install-sources.d.ts +1 -1
- package/dist/sdk/extension/install-sources.js +6 -3
- package/dist/sdk/extension/output-ownership.d.ts +1 -0
- package/dist/sdk/extension/output-ownership.js +3 -2
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +38 -14
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +14 -2
- package/dist/sdk/governance/health.d.ts +3 -0
- package/dist/sdk/governance/health.js +39 -7
- package/dist/sdk/governance/hierarchy-validation.d.ts +29 -0
- package/dist/sdk/governance/hierarchy-validation.js +109 -0
- package/dist/sdk/governance/validate.d.ts +1 -7
- package/dist/sdk/governance/validate.js +47 -99
- package/dist/sdk/graph/assembly.d.ts +6 -1
- package/dist/sdk/graph/assembly.js +16 -22
- package/dist/sdk/graph/governance-contracts.d.ts +1 -1
- package/dist/sdk/graph/governance-contracts.js +8 -2
- package/dist/sdk/graph/governance.js +46 -2
- package/dist/sdk/graph/hierarchy-integrity.d.ts +94 -0
- package/dist/sdk/graph/hierarchy-integrity.js +311 -0
- package/dist/sdk/graph/index.d.ts +2 -1
- package/dist/sdk/graph/index.js +3 -2
- package/dist/sdk/graph/remediation.js +32 -2
- package/dist/sdk/graph/run.d.ts +31 -2
- package/dist/sdk/graph/run.js +80 -31
- package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +8 -0
- package/dist/sdk/graph/workspace-relationship-kind-registry.js +28 -0
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/item-children.js +21 -8
- package/dist/sdk/lifecycle/create.js +125 -96
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +15 -0
- package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +25 -0
- package/dist/sdk/lifecycle/update.d.ts +2 -0
- package/dist/sdk/lifecycle/update.js +171 -83
- package/dist/sdk/query/complete-list.d.ts +3 -3
- package/dist/sdk/query/complete-list.js +46 -3
- package/dist/sdk/query/list.d.ts +4 -3
- package/dist/sdk/query/list.js +89 -49
- package/dist/sdk/read-output-contracts.d.ts +5 -1
- package/dist/sdk/read-output-contracts.js +87 -22
- package/dist/sdk/relationship-context.js +3 -4
- package/dist/sdk/relationships.js +17 -10
- package/dist/sdk/runtime.d.ts +3 -2
- package/dist/sdk/runtime.js +3 -2
- package/dist/sdk/test/batch.js +13 -5
- package/dist/sdk/test/execution.js +10 -2
- package/dist/types.d.ts +11 -0
- package/dist/types.js +2 -2
- package/docs/AGENT_UX_CONTRACTS.md +20 -4
- package/docs/COMMANDS.md +29 -14
- package/docs/DEPENDENCY_KIND_CONTRACT.md +31 -3
- package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +98 -0
- package/docs/EXTENSIONS.md +2 -1
- package/docs/README.md +1 -0
- package/docs/READ_OUTPUT_CONTRACTS.md +9 -2
- package/docs/RELATIONSHIP_GRAPH.md +6 -3
- package/docs/TESTING.md +15 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/sdk/public-surface.json +593 -35
- package/dist/cli-bundle/chunks/chunk-2MA6ZQVZ.js +0 -197
- package/dist/cli-bundle/chunks/chunk-7VHZS727.js +0 -5
- package/dist/cli-bundle/chunks/chunk-OCLPLFAY.js +0 -35
- package/dist/cli-bundle/chunks/chunk-S4IRYKBU.js +0 -13
- package/dist/cli-bundle/focused-chunks/chunk-7WZRLCYF.js +0 -50
- package/dist/cli-bundle/focused-chunks/chunk-EEFKYMDR.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-F2A56DHV.js +0 -8
- package/dist/cli-bundle/focused-chunks/chunk-FV5ACOK7.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-JEAVFOWM.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-NJ63LOP6.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-NXRTQ7HI.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-TJ7EMJ46.js +0 -4
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements extension runtime contracts and governance for Extension Hook Runtime.
|
|
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]="d1dd5d4f-5f08-5e52-b109-d066f92ae3b3")}catch(e){}}();
|
|
8
8
|
import { cloneCommandOptionsSnapshot, cloneContextSnapshot, cloneGlobalOptionsSnapshot, normalizeCommandName, } from "./extension-runtime-helpers.js";
|
|
9
9
|
import { stableValueEquals } from "../shared/serialization.js";
|
|
10
10
|
import { EXIT_CODE } from "../shared/constants.js";
|
|
@@ -480,6 +480,20 @@ function isLegacyOutputPayloadEcho(result, context, serviceContext) {
|
|
|
480
480
|
result !== null &&
|
|
481
481
|
stableValueEquals(result, serviceContext.payload));
|
|
482
482
|
}
|
|
483
|
+
function resolveMatchedServiceDecision(matched, decision, warnings) {
|
|
484
|
+
if (!decision.handled) {
|
|
485
|
+
return undefined;
|
|
486
|
+
}
|
|
487
|
+
if (matched.passThrough === true) {
|
|
488
|
+
warnings.push(`extension_service_pass_through_contract_violated:${matched.layer}:${matched.name}:${matched.service}`);
|
|
489
|
+
return undefined;
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
handled: true,
|
|
493
|
+
result: decision.result,
|
|
494
|
+
warnings,
|
|
495
|
+
};
|
|
496
|
+
}
|
|
483
497
|
/** Implements run service override sync for the public runtime surface of this module. */
|
|
484
498
|
export function runServiceOverrideSync(services, context) {
|
|
485
499
|
const matches = matchingServiceOverrides(services, context.service);
|
|
@@ -499,15 +513,9 @@ export function runServiceOverrideSync(services, context) {
|
|
|
499
513
|
warnings.push(`extension_output_format_payload_echo_deprecated:${matched.layer}:${matched.name}`);
|
|
500
514
|
continue;
|
|
501
515
|
}
|
|
502
|
-
const
|
|
503
|
-
if (
|
|
504
|
-
|
|
505
|
-
}
|
|
506
|
-
return {
|
|
507
|
-
handled: true,
|
|
508
|
-
result: decision.result,
|
|
509
|
-
warnings,
|
|
510
|
-
};
|
|
516
|
+
const resolved = resolveMatchedServiceDecision(matched, resolveServiceOverrideValue(result, context), warnings);
|
|
517
|
+
if (resolved)
|
|
518
|
+
return resolved;
|
|
511
519
|
}
|
|
512
520
|
catch {
|
|
513
521
|
warnings.push(`extension_service_override_failed:${matched.layer}:${matched.name}:${matched.service}`);
|
|
@@ -534,15 +542,9 @@ export async function runServiceOverride(services, context) {
|
|
|
534
542
|
warnings.push(`extension_output_format_payload_echo_deprecated:${matched.layer}:${matched.name}`);
|
|
535
543
|
continue;
|
|
536
544
|
}
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
return {
|
|
542
|
-
handled: true,
|
|
543
|
-
result: decision.result,
|
|
544
|
-
warnings,
|
|
545
|
-
};
|
|
545
|
+
const resolved = resolveMatchedServiceDecision(matched, resolveServiceOverrideValue(result, context), warnings);
|
|
546
|
+
if (resolved)
|
|
547
|
+
return resolved;
|
|
546
548
|
}
|
|
547
549
|
catch {
|
|
548
550
|
warnings.push(`extension_service_override_failed:${matched.layer}:${matched.name}:${matched.service}`);
|
|
@@ -695,4 +697,4 @@ export function runRendererOverride(renderers, context) {
|
|
|
695
697
|
}
|
|
696
698
|
}
|
|
697
699
|
//# sourceMappingURL=extension-hook-runtime.js.map
|
|
698
|
-
//# debugId=
|
|
700
|
+
//# debugId=d1dd5d4f-5f08-5e52-b109-d066f92ae3b3
|
|
@@ -483,6 +483,11 @@ export type ServiceOverrideDecision = {
|
|
|
483
483
|
};
|
|
484
484
|
/** Restricts service override values accepted by command, SDK, and storage contracts. */
|
|
485
485
|
export type ServiceOverride = (context: ServiceOverrideContext) => unknown | ServiceOverrideDecision;
|
|
486
|
+
/** Host-enforced ownership metadata for a service override. */
|
|
487
|
+
export interface ServiceOverrideOwnership {
|
|
488
|
+
/** Declare that the callback may only decline. Any handled result is ignored and diagnosed by the host. */
|
|
489
|
+
passThrough?: boolean;
|
|
490
|
+
}
|
|
486
491
|
/** Documents the registered extension hook payload exchanged by command, SDK, and package integrations. */
|
|
487
492
|
export interface RegisteredExtensionHook<THook> {
|
|
488
493
|
/** Value that configures or reports layer for this contract. */
|
|
@@ -1187,6 +1192,8 @@ export interface RegisteredExtensionServiceOverride {
|
|
|
1187
1192
|
service: ExtensionServiceName;
|
|
1188
1193
|
/** Value that configures or reports run for this contract. */
|
|
1189
1194
|
run: ServiceOverride;
|
|
1195
|
+
/** Whether the host forbids this callback from handling the service payload. */
|
|
1196
|
+
passThrough?: boolean;
|
|
1190
1197
|
}
|
|
1191
1198
|
/** Documents the registered extension renderer override payload exchanged by command, SDK, and package integrations. */
|
|
1192
1199
|
export interface RegisteredExtensionRendererOverride {
|
|
@@ -1464,7 +1471,7 @@ export interface ExtensionApi {
|
|
|
1464
1471
|
/** Value that configures or reports register preflight for this contract. */
|
|
1465
1472
|
registerPreflight(override: PreflightOverride | ScopedPreflightOverrideDefinition): void;
|
|
1466
1473
|
/** Value that configures or reports register service for this contract. */
|
|
1467
|
-
registerService(service: ExtensionServiceName, override: ServiceOverride): void;
|
|
1474
|
+
registerService(service: ExtensionServiceName, override: ServiceOverride, ownership?: ServiceOverrideOwnership): void;
|
|
1468
1475
|
/** Value that configures or reports register flags for this contract. */
|
|
1469
1476
|
registerFlags(targetCommand: string, flags: FlagDefinition[]): void;
|
|
1470
1477
|
/** Value that configures or reports register item fields for this contract. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */
|
|
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]="
|
|
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]="87454a57-b62e-560a-b66f-3c15d4a95cc2")}catch(e){}}();
|
|
4
4
|
export const KNOWN_EXTENSION_CAPABILITIES = [
|
|
5
5
|
"commands",
|
|
6
6
|
"renderers",
|
|
@@ -100,4 +100,4 @@ export function createDefaultExtensionGovernancePolicy() {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
//# sourceMappingURL=extension-types.js.map
|
|
103
|
-
//# debugId=
|
|
103
|
+
//# debugId=87454a57-b62e-560a-b66f-3c15d4a95cc2
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements extension runtime contracts and governance for Loader.
|
|
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]="10311c96-5cba-5021-a8c5-82abd6eeb6f5")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
@@ -19,6 +19,7 @@ import { KNOWN_ITEM_FIELD_TYPES, normalizeItemFieldType, suggestKnownItemFieldTy
|
|
|
19
19
|
import { snapshotExtensionModuleGraph } from "./module-graph-snapshot.js";
|
|
20
20
|
import { captureExtensionActivationRollback } from "./activation-transaction.js";
|
|
21
21
|
import { collectPreflightCollisionWarnings, normalizePreflightOverride, } from "./preflight-ownership.js";
|
|
22
|
+
import { normalizeServiceOverrideOwnership } from "./service-ownership.js";
|
|
22
23
|
import { assertCommandDefinitionMetadataStrings } from "./command-visibility-tier.js";
|
|
23
24
|
import { buildImportExportContext, resolveImportExportArtifactOutput, } from "./exporter-output-contract.js";
|
|
24
25
|
import { asRegistrationRecord, assertOptionalBooleanField, assertOptionalFlagDefaultField, assertOptionalStringArrayField, assertOptionalStringField, normalizeOptionalStringArrayField, } from "./registration-validation.js";
|
|
@@ -1569,7 +1570,7 @@ class ExtensionApiRegistrar {
|
|
|
1569
1570
|
...normalized,
|
|
1570
1571
|
});
|
|
1571
1572
|
}
|
|
1572
|
-
registerService(service, override) {
|
|
1573
|
+
registerService(service, override, ownership = {}) {
|
|
1573
1574
|
assertExtensionCapability(this.#loadedExtension, "services", "registerService");
|
|
1574
1575
|
const normalizedService = String(service).trim().toLowerCase();
|
|
1575
1576
|
if (!isExtensionServiceName(normalizedService)) {
|
|
@@ -1584,6 +1585,9 @@ class ExtensionApiRegistrar {
|
|
|
1584
1585
|
name: this.#loadedExtension.name,
|
|
1585
1586
|
service: normalizedService,
|
|
1586
1587
|
run: override,
|
|
1588
|
+
...(normalizeServiceOverrideOwnership(ownership)
|
|
1589
|
+
? { passThrough: true }
|
|
1590
|
+
: {}),
|
|
1587
1591
|
});
|
|
1588
1592
|
}
|
|
1589
1593
|
registerRenderer(format, renderer, ownership = {}) {
|
|
@@ -2216,4 +2220,4 @@ export const _testOnlyLoader = {
|
|
|
2216
2220
|
},
|
|
2217
2221
|
};
|
|
2218
2222
|
//# sourceMappingURL=loader.js.map
|
|
2219
|
-
//# debugId=
|
|
2223
|
+
//# debugId=10311c96-5cba-5021-a8c5-82abd6eeb6f5
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/extensions/service-ownership
|
|
3
|
+
*
|
|
4
|
+
* Validates host-enforced ownership metadata for extension service overrides.
|
|
5
|
+
*/
|
|
6
|
+
import type { ServiceOverrideOwnership } from "./extension-types.js";
|
|
7
|
+
/** Validate one service ownership declaration and return its normalized pass-through flag. */
|
|
8
|
+
export declare function normalizeServiceOverrideOwnership(ownership: ServiceOverrideOwnership): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Validate one service ownership declaration and return its normalized pass-through flag. */
|
|
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]="a30142c8-b04d-5878-8497-c902ff299e94")}catch(e){}}();
|
|
4
|
+
export function normalizeServiceOverrideOwnership(ownership) {
|
|
5
|
+
if (ownership === null ||
|
|
6
|
+
typeof ownership !== "object" ||
|
|
7
|
+
Array.isArray(ownership)) {
|
|
8
|
+
throw new TypeError("registerService ownership must be an object");
|
|
9
|
+
}
|
|
10
|
+
if (Reflect.ownKeys(ownership).some((key) => key !== "passThrough")) {
|
|
11
|
+
throw new TypeError("registerService ownership supports only passThrough");
|
|
12
|
+
}
|
|
13
|
+
if (ownership.passThrough !== undefined &&
|
|
14
|
+
typeof ownership.passThrough !== "boolean") {
|
|
15
|
+
throw new TypeError("registerService ownership.passThrough must be a boolean when provided");
|
|
16
|
+
}
|
|
17
|
+
return ownership.passThrough === true;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=service-ownership.js.map
|
|
20
|
+
//# debugId=a30142c8-b04d-5878-8497-c902ff299e94
|
package/dist/core/item/id.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines item parsing, formatting, and lifecycle helpers for Id.
|
|
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]="6b3f1585-ab12-57ca-80eb-d3cebc384c52")}catch(e){}}();
|
|
8
8
|
import crypto from "node:crypto";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { TYPE_TO_FOLDER } from "../shared/constants.js";
|
|
@@ -12,10 +12,25 @@ import { pathExists } from "../fs/fs-utils.js";
|
|
|
12
12
|
import { nextReproducibleToken } from "../reproducibility/context.js";
|
|
13
13
|
/** Implements normalize prefix for the public runtime surface of this module. */
|
|
14
14
|
export function normalizePrefix(input) {
|
|
15
|
-
const normalized =
|
|
16
|
-
|
|
15
|
+
const normalized = [];
|
|
16
|
+
let separatorPending = false;
|
|
17
|
+
for (const character of (input ?? "").toLowerCase()) {
|
|
18
|
+
const codePoint = character.charCodeAt(0);
|
|
19
|
+
const isAsciiDigit = codePoint >= 48 && codePoint <= 57;
|
|
20
|
+
const isAsciiLetter = codePoint >= 97 && codePoint <= 122;
|
|
21
|
+
if (!isAsciiDigit && !isAsciiLetter) {
|
|
22
|
+
separatorPending = normalized.length > 0;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (separatorPending) {
|
|
26
|
+
normalized.push("-");
|
|
27
|
+
separatorPending = false;
|
|
28
|
+
}
|
|
29
|
+
normalized.push(character);
|
|
30
|
+
}
|
|
31
|
+
if (normalized.length === 0)
|
|
17
32
|
return "pm-";
|
|
18
|
-
return normalized.
|
|
33
|
+
return `${normalized.join("")}-`;
|
|
19
34
|
}
|
|
20
35
|
/** Implements normalize raw item id for the public runtime surface of this module. */
|
|
21
36
|
export function normalizeRawItemId(input) {
|
|
@@ -91,4 +106,4 @@ export async function generateItemId(pmRoot, prefix, options = {}) {
|
|
|
91
106
|
throw new Error(`Unable to generate unique id after ${attempts} attempts`);
|
|
92
107
|
}
|
|
93
108
|
//# sourceMappingURL=id.js.map
|
|
94
|
-
//# debugId=
|
|
109
|
+
//# debugId=6b3f1585-ab12-57ca-80eb-d3cebc384c52
|
|
@@ -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]="5eac19ec-235e-5e6f-8ae7-4725f99c9d7f")}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";
|
|
@@ -601,6 +601,30 @@ function normalizeTestRunMeasurements(value) {
|
|
|
601
601
|
.slice(0, 32);
|
|
602
602
|
return deduplicated.length > 0 ? deduplicated : undefined;
|
|
603
603
|
}
|
|
604
|
+
/** Normalize and bound command/context provenance retained for a test run. */
|
|
605
|
+
function normalizeTestRunExecutions(values) {
|
|
606
|
+
if (!Array.isArray(values))
|
|
607
|
+
return undefined;
|
|
608
|
+
const executions = values
|
|
609
|
+
.filter((execution) => execution &&
|
|
610
|
+
typeof execution.command === "string" &&
|
|
611
|
+
execution.command.trim().length > 0)
|
|
612
|
+
.slice(0, 32)
|
|
613
|
+
.map((execution) => ({
|
|
614
|
+
command: execution.command.trim(),
|
|
615
|
+
requested_pm_context_mode: execution.requested_pm_context_mode === "schema" ||
|
|
616
|
+
execution.requested_pm_context_mode === "tracker" ||
|
|
617
|
+
execution.requested_pm_context_mode === "auto"
|
|
618
|
+
? execution.requested_pm_context_mode
|
|
619
|
+
: undefined,
|
|
620
|
+
pm_context_mode: execution.pm_context_mode === "schema" ||
|
|
621
|
+
execution.pm_context_mode === "tracker" ||
|
|
622
|
+
execution.pm_context_mode === "auto"
|
|
623
|
+
? execution.pm_context_mode
|
|
624
|
+
: undefined,
|
|
625
|
+
}));
|
|
626
|
+
return executions.length > 0 ? executions : undefined;
|
|
627
|
+
}
|
|
604
628
|
function normalizeTestRunSummary(value) {
|
|
605
629
|
const runId = typeof value.run_id === "string" ? value.run_id.trim() : "";
|
|
606
630
|
const kind = value.kind === "test" || value.kind === "test-all" ? value.kind : "test";
|
|
@@ -623,6 +647,7 @@ function normalizeTestRunSummary(value) {
|
|
|
623
647
|
linked_tests: normalizeNonNegativeInteger(value.linked_tests),
|
|
624
648
|
fail_on_skipped_triggered: value.fail_on_skipped_triggered === true ? true : undefined,
|
|
625
649
|
measurements: normalizeTestRunMeasurements(value.measurements),
|
|
650
|
+
executions: normalizeTestRunExecutions(value.executions),
|
|
626
651
|
};
|
|
627
652
|
deleteUndefinedFields(summary);
|
|
628
653
|
return summary;
|
|
@@ -1393,4 +1418,4 @@ export const _testOnlyItemFormat = {
|
|
|
1393
1418
|
sortTests,
|
|
1394
1419
|
};
|
|
1395
1420
|
//# sourceMappingURL=item-format.js.map
|
|
1396
|
-
//# debugId=
|
|
1421
|
+
//# debugId=5eac19ec-235e-5e6f-8ae7-4725f99c9d7f
|
|
@@ -108,12 +108,16 @@ export interface PmCliErrorContext {
|
|
|
108
108
|
id: string;
|
|
109
109
|
kind?: string;
|
|
110
110
|
source_kind?: string;
|
|
111
|
+
author?: string;
|
|
112
|
+
created_at?: string;
|
|
111
113
|
}>;
|
|
112
114
|
/** Compact stored dependency identities available when a removal failed. */
|
|
113
115
|
available_dependencies?: Array<{
|
|
114
116
|
id: string;
|
|
115
117
|
kind: string;
|
|
116
118
|
source_kind?: string;
|
|
119
|
+
author?: string;
|
|
120
|
+
created_at?: string;
|
|
117
121
|
}>;
|
|
118
122
|
/** Exact verifier findings that caused an integrity-sensitive operation to refuse. */
|
|
119
123
|
verification_errors?: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Implements the exported pm cli error runtime abstraction for core/shared/errors.ts. */
|
|
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]="
|
|
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]="922e2e27-1499-5466-98e4-322d0d742e40")}catch(e){}}();
|
|
4
4
|
export class PmCliError extends Error {
|
|
5
5
|
/** Value that configures or reports exit code for this contract. */
|
|
6
6
|
exitCode;
|
|
@@ -18,4 +18,4 @@ export class PmCliError extends Error {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=errors.js.map
|
|
21
|
-
//# debugId=
|
|
21
|
+
//# debugId=922e2e27-1499-5466-98e4-322d0d742e40
|
|
@@ -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 ("
|
|
40
|
+
export declare const PM_RECOVERY_REFERENCE_FIELDS: readonly ("suggested_retry" | "next_best_command" | "candidate_commands" | "next_steps" | "examples" | "restore_with" | "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. */
|
package/dist/sdk/authoring.d.ts
CHANGED
|
@@ -15,4 +15,4 @@ export { planProfileApplication, type ProfileApplicationPlan, type ProfileChange
|
|
|
15
15
|
export { EXTENSION_CAPABILITY_REGISTRATION_SURFACES, collectUsedExtensionCapabilities, reconcileExtensionCapabilityUsage, type CollectUsedExtensionCapabilitiesOptions, type ExtensionCapabilityUsageReconciliation, } from "../core/extensions/capability-usage.js";
|
|
16
16
|
export { renderExtensionSurfaceMarkdown, type ExtensionSurfaceMarkdownOptions, } from "../core/extensions/activation-summary-markdown.js";
|
|
17
17
|
export { createExtensionContributionInventory, normalizeExtensionContributionInventory, } from "../core/extensions/contribution-inventory.js";
|
|
18
|
-
export type { AfterCommandAffectedItem, AfterCommandHook, AfterCommandHookContext, BeforeCommandHook, BeforeCommandHookContext, BeforeMutationHook, BeforeMutationHookContext, BeforeMutationHookDecision, CommandDefinition, ExtensionCommandArgumentDefinition, CommandHandler, CommandHandlerContext, CommandHandlerResult, ExtensionCommandSdk, CommandOverride, CommandOverrideContext, ExtensionServiceName, Exporter, ExporterArtifactOutputContract, ExporterRegistrationOptions, ExtensionActivationResult, ExtensionApi, ExtensionCommandRegistry, ExtensionDeactivationFailure, ExtensionDeactivationOptions, ExtensionDeactivationResult, ExtensionDiagnostic, ExtensionContributionInventory, ExtensionDiscoveryResult, ExtensionHookRegistry, ExtensionSelfIdentity, ExtensionLoadResult, ExtensionManifest, ExtensionManifestEngines, ExtensionMutationGuardSdk, ExtensionGovernancePolicy, ExtensionPolicyOverride, ExtensionProvenanceMetadata, ExtensionRuntimePermissionDeclaration, ExtensionSearchMode, ExtensionParserRegistry, ExtensionPreflightRegistry, ExtensionRegistrationRegistry, ExtensionRendererRegistry, ExtensionServiceRegistry, FlagValueType, FlagDefinition, ImportExportContext, ImportExportRegistrationOptions, Importer, OnIndexHook, OnIndexHookContext, OnReadHook, OnReadHookContext, OnWriteHook, OnWriteHookContext, OutputRendererFormat, ParserOverride, ParserOverrideContext, ParserOverrideDelta, PreflightOverride, PreflightOverrideContext, PreflightOverrideDelta, PreflightRuntimeDecision, RegisteredExtensionExporter, RegisteredExporterArtifactOutputContract, RegisteredExtensionFlagDefinitions, RegisteredExtensionHook, RegisteredExtensionImporter, RegisteredExtensionProjectProfile, RegisteredExtensionSchemaMigrationDefinition, RegisteredExtensionSearchProvider, RegisteredExtensionServiceOverride, RegisteredExtensionVectorStoreAdapter, RendererOverride, RendererOverrideContext, SchemaFieldDefinition, SchemaItemTypeCommandOptionPolicyDefinition, SchemaItemTypeOptionDefinition, SchemaItemTypeDefinition, SchemaMigrationDefinition, SchemaMigrationRunContext, SchemaMigrationRunner, SearchProviderEmbedBatchContext, SearchProviderEmbedContext, SearchProviderDefinition, SearchProviderHit, SearchProviderQueryContext, SearchProviderQueryResult, ServiceOverride, ServiceOverrideContext, ServiceOverrideDecision, VectorStoreAdapterDefinition, VectorStoreDeleteContext, VectorStoreQueryContext, VectorStoreQueryHit, VectorStoreUpsertContext, VectorStoreUpsertPoint, } from "../core/extensions/loader.js";
|
|
18
|
+
export type { AfterCommandAffectedItem, AfterCommandHook, AfterCommandHookContext, BeforeCommandHook, BeforeCommandHookContext, BeforeMutationHook, BeforeMutationHookContext, BeforeMutationHookDecision, CommandDefinition, ExtensionCommandArgumentDefinition, CommandHandler, CommandHandlerContext, CommandHandlerResult, ExtensionCommandSdk, CommandOverride, CommandOverrideContext, ExtensionServiceName, Exporter, ExporterArtifactOutputContract, ExporterRegistrationOptions, ExtensionActivationResult, ExtensionApi, ExtensionCommandRegistry, ExtensionDeactivationFailure, ExtensionDeactivationOptions, ExtensionDeactivationResult, ExtensionDiagnostic, ExtensionContributionInventory, ExtensionDiscoveryResult, ExtensionHookRegistry, ExtensionSelfIdentity, ExtensionLoadResult, ExtensionManifest, ExtensionManifestEngines, ExtensionMutationGuardSdk, ExtensionGovernancePolicy, ExtensionPolicyOverride, ExtensionProvenanceMetadata, ExtensionRuntimePermissionDeclaration, ExtensionSearchMode, ExtensionParserRegistry, ExtensionPreflightRegistry, ExtensionRegistrationRegistry, ExtensionRendererRegistry, ExtensionServiceRegistry, FlagValueType, FlagDefinition, ImportExportContext, ImportExportRegistrationOptions, Importer, OnIndexHook, OnIndexHookContext, OnReadHook, OnReadHookContext, OnWriteHook, OnWriteHookContext, OutputRendererFormat, ParserOverride, ParserOverrideContext, ParserOverrideDelta, PreflightOverride, PreflightOverrideContext, PreflightOverrideDelta, PreflightRuntimeDecision, RegisteredExtensionExporter, RegisteredExporterArtifactOutputContract, RegisteredExtensionFlagDefinitions, RegisteredExtensionHook, RegisteredExtensionImporter, RegisteredExtensionProjectProfile, RegisteredExtensionSchemaMigrationDefinition, RegisteredExtensionSearchProvider, RegisteredExtensionServiceOverride, RegisteredExtensionVectorStoreAdapter, RendererOverride, RendererOverrideContext, SchemaFieldDefinition, SchemaItemTypeCommandOptionPolicyDefinition, SchemaItemTypeOptionDefinition, SchemaItemTypeDefinition, SchemaMigrationDefinition, SchemaMigrationRunContext, SchemaMigrationRunner, SearchProviderEmbedBatchContext, SearchProviderEmbedContext, SearchProviderDefinition, SearchProviderHit, SearchProviderQueryContext, SearchProviderQueryResult, ServiceOverride, ServiceOverrideContext, ServiceOverrideDecision, ServiceOverrideOwnership, VectorStoreAdapterDefinition, VectorStoreDeleteContext, VectorStoreQueryContext, VectorStoreQueryHit, VectorStoreUpsertContext, VectorStoreUpsertPoint, } from "../core/extensions/loader.js";
|
package/dist/sdk/authoring.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides the focused extension and package authoring surface.
|
|
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]="bca95ba2-258c-5be2-8428-dcb8dbc87ef0")}catch(e){}}();
|
|
8
8
|
export * from "./compose.js";
|
|
9
9
|
export * from "./define.js";
|
|
10
10
|
export * from "./extension-contracts.js";
|
|
@@ -18,4 +18,4 @@ export { EXTENSION_CAPABILITY_REGISTRATION_SURFACES, collectUsedExtensionCapabil
|
|
|
18
18
|
export { renderExtensionSurfaceMarkdown, } from "../core/extensions/activation-summary-markdown.js";
|
|
19
19
|
export { createExtensionContributionInventory, normalizeExtensionContributionInventory, } from "../core/extensions/contribution-inventory.js";
|
|
20
20
|
//# sourceMappingURL=authoring.js.map
|
|
21
|
-
//# debugId=
|
|
21
|
+
//# debugId=bca95ba2-258c-5be2-8428-dcb8dbc87ef0
|
|
@@ -6,6 +6,59 @@ export type PmOutputDegradationStep = (typeof PM_OUTPUT_DEGRADATION_STEPS)[numbe
|
|
|
6
6
|
export declare const PM_OUTPUT_BUDGET_CLASSES: readonly ["mutation", "read", "discovery", "governance"];
|
|
7
7
|
/** Restricts command-output budget classes. */
|
|
8
8
|
export type PmOutputBudgetClass = (typeof PM_OUTPUT_BUDGET_CLASSES)[number];
|
|
9
|
+
/** Stable diagnostic families that require independent output ceilings. */
|
|
10
|
+
export declare const PM_DIAGNOSTIC_OUTPUT_CLASSES: readonly ["error", "warning", "validation_summary", "recovery_bundle"];
|
|
11
|
+
/** Restricts diagnostic budget selection to declared families. */
|
|
12
|
+
export type PmDiagnosticOutputClass = (typeof PM_DIAGNOSTIC_OUTPUT_CLASSES)[number];
|
|
13
|
+
/** Deterministic diagnostic degradation stages, from richest to smallest. */
|
|
14
|
+
export declare const PM_DIAGNOSTIC_DEGRADATION_STEPS: readonly ["full", "omit_explanation", "limit_collections", "compact_recovery", "action_only"];
|
|
15
|
+
/** Restricts diagnostic degradation receipts to declared stages. */
|
|
16
|
+
export type PmDiagnosticDegradationStep = (typeof PM_DIAGNOSTIC_DEGRADATION_STEPS)[number];
|
|
17
|
+
/** Declares one diagnostic family's text and JSON token ceilings. */
|
|
18
|
+
export interface PmDiagnosticOutputBudgetContract {
|
|
19
|
+
/** Diagnostic family governed by this contract. */
|
|
20
|
+
diagnostic_class: PmDiagnosticOutputClass;
|
|
21
|
+
/** Default ceiling by rendered transport. */
|
|
22
|
+
default_max_estimated_tokens_by_format: Readonly<{
|
|
23
|
+
text: number;
|
|
24
|
+
json: number;
|
|
25
|
+
}>;
|
|
26
|
+
/** Smallest explicit ceiling accepted by the projector. */
|
|
27
|
+
minimum_max_estimated_tokens: number;
|
|
28
|
+
/** Ordered degradation policy applied when the ceiling binds. */
|
|
29
|
+
degradation_ladder: readonly PmDiagnosticDegradationStep[];
|
|
30
|
+
/** Paths whose first actionable value must survive degradation. */
|
|
31
|
+
corrective_action_paths: readonly string[];
|
|
32
|
+
/** Stable estimate used by gates and SDK consumers. */
|
|
33
|
+
token_estimate: "ceil(utf8_bytes / 4)";
|
|
34
|
+
}
|
|
35
|
+
/** Machine-readable disclosure attached to a projected diagnostic. */
|
|
36
|
+
export interface PmDiagnosticOutputReceipt {
|
|
37
|
+
/** Diagnostic family whose contract bound the output. */
|
|
38
|
+
diagnostic_class: PmDiagnosticOutputClass;
|
|
39
|
+
/** Rendered transport measured by the projector. */
|
|
40
|
+
format: "json" | "text";
|
|
41
|
+
/** Effective estimated-token ceiling. */
|
|
42
|
+
budget: number;
|
|
43
|
+
/** Whether the caller supplied the ceiling or used the declaration. */
|
|
44
|
+
budget_source: "default" | "explicit";
|
|
45
|
+
/** Estimate before diagnostic degradation. */
|
|
46
|
+
original_estimated_tokens: number;
|
|
47
|
+
/** Exact estimate of the returned projection. */
|
|
48
|
+
estimated_tokens: number;
|
|
49
|
+
/** Whether one or more fields were removed or compacted. */
|
|
50
|
+
truncated: boolean;
|
|
51
|
+
/** Applied stages in contract order. */
|
|
52
|
+
degradation_steps: PmDiagnosticDegradationStep[];
|
|
53
|
+
/** Top-level fields removed from the original diagnostic. */
|
|
54
|
+
omitted_fields: string[];
|
|
55
|
+
/** Additional omitted fields not named individually in a bounded receipt. */
|
|
56
|
+
omitted_fields_overflow_count?: number;
|
|
57
|
+
}
|
|
58
|
+
/** JSON diagnostic after binding it to a declared output contract. */
|
|
59
|
+
export type PmProjectedDiagnostic<TDiagnostic extends object> = Partial<TDiagnostic> & Pick<TDiagnostic, Extract<keyof TDiagnostic, "code" | "required">> & {
|
|
60
|
+
diagnostic_output?: PmDiagnosticOutputReceipt;
|
|
61
|
+
};
|
|
9
62
|
/** Describes one command's default agent-output budget and degradation policy. */
|
|
10
63
|
export interface PmCommandOutputBudgetContract {
|
|
11
64
|
/** Canonical or compatibility command name. */
|
|
@@ -26,6 +79,8 @@ export interface PmCommandOutputBudgetContract {
|
|
|
26
79
|
/** Stable estimate used by gates and SDK consumers. */
|
|
27
80
|
token_estimate: "ceil(utf8_bytes / 4)";
|
|
28
81
|
}
|
|
82
|
+
/** Public default contract for every diagnostic family. */
|
|
83
|
+
export declare const PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS: PmDiagnosticOutputBudgetContract[];
|
|
29
84
|
/** Infer the conservative workload class for a core or package command. */
|
|
30
85
|
export declare function inferPmOutputBudgetClass(command: string): PmOutputBudgetClass;
|
|
31
86
|
/** Build the generated default budget for a core or package command. */
|
|
@@ -48,3 +103,25 @@ export declare function resolvePmCommandOutputBudget(command: string, options?:
|
|
|
48
103
|
}): PmCommandOutputBudgetContract | null;
|
|
49
104
|
/** Estimate conservative token usage from UTF-8 output bytes. */
|
|
50
105
|
export declare function estimatePmOutputTokens(utf8Bytes: number): number;
|
|
106
|
+
/** Resolve the binding output contract for one diagnostic family. */
|
|
107
|
+
export declare function resolvePmDiagnosticOutputBudget(diagnosticClass: PmDiagnosticOutputClass): PmDiagnosticOutputBudgetContract;
|
|
108
|
+
/**
|
|
109
|
+
* Bind a JSON diagnostic to its declared ceiling while preserving the first
|
|
110
|
+
* corrective action and reporting every top-level omission.
|
|
111
|
+
*/
|
|
112
|
+
export declare function projectPmDiagnosticOutput<TDiagnostic extends object>(diagnostic: TDiagnostic, options?: {
|
|
113
|
+
diagnosticClass?: PmDiagnosticOutputClass;
|
|
114
|
+
maxEstimatedTokens?: number;
|
|
115
|
+
}): PmProjectedDiagnostic<TDiagnostic>;
|
|
116
|
+
/** Text diagnostic together with the same measured receipt used by JSON. */
|
|
117
|
+
export interface PmProjectedTextDiagnostic {
|
|
118
|
+
/** Rendered action-first diagnostic. */
|
|
119
|
+
output: string;
|
|
120
|
+
/** Binding diagnostic budget receipt. */
|
|
121
|
+
diagnostic_output: PmDiagnosticOutputReceipt;
|
|
122
|
+
}
|
|
123
|
+
/** Bind human-readable diagnostics without ever truncating the corrective action away. */
|
|
124
|
+
export declare function projectPmDiagnosticText(output: string, correctiveAction: string, options?: {
|
|
125
|
+
diagnosticClass?: PmDiagnosticOutputClass;
|
|
126
|
+
maxEstimatedTokens?: number;
|
|
127
|
+
}): PmProjectedTextDiagnostic;
|