@unbrained/pm-cli 2026.8.16 → 2026.8.18
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/AGENTS.md +4 -3
- package/CHANGELOG.md +65 -6
- package/README.md +16 -16
- package/dist/cli/error-guidance.js +7 -4
- package/dist/cli/public.d.ts +2 -0
- package/dist/cli/public.js +21 -0
- package/dist/cli/register-list-query.js +132 -51
- package/dist/cli/register-mutation.js +4 -4
- package/dist/cli-bundle/bundle-manifest.json +148 -148
- package/dist/cli-bundle/chunks/chunk-5UZZAJKR.js +3 -0
- package/dist/cli-bundle/chunks/chunk-ALDJGKAK.js +2 -0
- package/dist/cli-bundle/chunks/chunk-BSK2IN3C.js +8 -0
- package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +197 -0
- package/dist/cli-bundle/chunks/{chunk-73UGEBRS.js → chunk-GNFAFIJI.js} +10 -10
- package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +35 -0
- package/dist/cli-bundle/chunks/{chunk-RIS565OA.js → chunk-PVRUN5ZS.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-RZQTVMRQ.js +2 -0
- package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +3 -0
- package/dist/cli-bundle/chunks/chunk-UYCLQVL2.js +13 -0
- package/dist/cli-bundle/chunks/{chunk-URW4QRMI.js → chunk-YRGOLZA7.js} +59 -55
- package/dist/cli-bundle/chunks/register-list-query-I23LALEE.js +11 -0
- package/dist/cli-bundle/chunks/register-mutation-6YGU3GPH.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-KGDNRMCL.js → register-operations-4HTFC6J7.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-NVXBOD5I.js → register-setup-PPPEF3SN.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-C7JUBRFP.js → chunk-3TKWMNKF.js} +3 -3
- package/dist/cli-bundle/focused-chunks/chunk-5AF3ZBNB.js +155 -0
- package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-CODV5LUT.js → chunk-EUEGXZ2A.js} +3 -3
- package/dist/cli-bundle/focused-chunks/{chunk-4JPEBFFC.js → chunk-EX6MKP2X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-SSNDYZTM.js → chunk-K43KKAFS.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-6ROKKT4X.js → chunk-M62NO7EI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-T46KLOIB.js → chunk-ODOVCP45.js} +47 -47
- package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +16 -0
- package/dist/cli-bundle/focused-chunks/chunk-TN4AE665.js +26 -0
- package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-UI6AJ5TD.js +4 -0
- package/dist/cli-bundle/focused-chunks/chunk-V5XTGLK7.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-WGHQVU6P.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +2 -0
- package/dist/cli-bundle/main.js +7 -7
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +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 +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 +4 -2
- package/dist/core/config/nested-settings.js +8 -2
- package/dist/core/extensions/exporter-output-contract.d.ts +12 -0
- package/dist/core/extensions/exporter-output-contract.js +67 -0
- package/dist/core/extensions/extension-types.d.ts +36 -1
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +43 -48
- package/dist/core/extensions/manifest-schema.d.ts +20 -0
- package/dist/core/extensions/manifest-schema.js +52 -0
- package/dist/core/history/event-index.d.ts +5 -0
- package/dist/core/history/event-index.js +133 -27
- package/dist/core/history/replay.js +32 -14
- package/dist/core/schema/fields-file.d.ts +1 -1
- package/dist/core/schema/fields-file.js +2 -2
- package/dist/core/schema/runtime-field-values.js +115 -9
- package/dist/core/schema/runtime-schema.d.ts +3 -1
- package/dist/core/schema/runtime-schema.js +124 -3
- package/dist/core/sentry/helpers.js +3 -3
- package/dist/core/shared/constants.js +5 -2
- package/dist/core/shared/errors.d.ts +10 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/time.d.ts +2 -0
- package/dist/core/shared/time.js +27 -2
- package/dist/core/store/settings-validator.d.ts +4 -0
- package/dist/core/store/settings-validator.js +3 -2
- package/dist/core/store/settings.js +8 -2
- package/dist/mcp/tool-definitions.js +12 -7
- package/dist/sdk/agent/refusal-reachability.d.ts +46 -6
- package/dist/sdk/agent/refusal-reachability.js +350 -8
- package/dist/sdk/authoring.d.ts +1 -1
- package/dist/sdk/authoring.js +2 -2
- package/dist/sdk/cli-bootstrap.d.ts +2 -2
- package/dist/sdk/cli-bootstrap.js +4 -4
- package/dist/sdk/cli-contracts/command-aliases.d.ts +34 -2
- package/dist/sdk/cli-contracts/command-aliases.js +64 -13
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -0
- package/dist/sdk/cli-contracts/enum-contracts.js +9 -2
- package/dist/sdk/cli-contracts/flag-contracts.js +11 -7
- package/dist/sdk/cli-contracts/grammar-contracts.d.ts +70 -0
- package/dist/sdk/cli-contracts/grammar-contracts.js +345 -0
- package/dist/sdk/cli-contracts/runtime-contracts.d.ts +19 -2
- package/dist/sdk/cli-contracts/runtime-contracts.js +61 -14
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -4
- package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -2
- package/dist/sdk/cli-contracts/tool-schema.js +20 -11
- package/dist/sdk/cli-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts.js +4 -4
- package/dist/sdk/completion.js +13 -15
- package/dist/sdk/compose.d.ts +9 -5
- package/dist/sdk/compose.js +33 -3
- package/dist/sdk/context-intent-contracts.d.ts +8 -4
- package/dist/sdk/context-intent-contracts.js +76 -31
- package/dist/sdk/contracts.d.ts +1 -0
- package/dist/sdk/contracts.js +3 -2
- package/dist/sdk/core.d.ts +1 -1
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/dependency-flag-validation.d.ts +9 -2
- package/dist/sdk/dependency-flag-validation.js +101 -35
- package/dist/sdk/environment/host-environment-errors.js +25 -7
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +78 -14
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +62 -14
- package/dist/sdk/governance/assurance-action.d.ts +3 -7
- package/dist/sdk/governance/assurance-action.js +97 -2
- package/dist/sdk/governance/boundary-fixtures.d.ts +86 -0
- package/dist/sdk/governance/boundary-fixtures.js +201 -0
- package/dist/sdk/governance/defect-recurrence-signals.d.ts +10 -0
- package/dist/sdk/governance/defect-recurrence-signals.js +25 -0
- package/dist/sdk/governance/defect-recurrence.d.ts +242 -0
- package/dist/sdk/governance/defect-recurrence.js +523 -0
- package/dist/sdk/governance.d.ts +2 -0
- package/dist/sdk/governance.js +4 -2
- package/dist/sdk/graph/governance.js +3 -2
- package/dist/sdk/guide-topics.js +193 -4
- package/dist/sdk/index.d.ts +7 -3
- package/dist/sdk/index.js +8 -5
- package/dist/sdk/init-agent-guidance.js +3 -3
- package/dist/sdk/lifecycle/create.js +4 -2
- package/dist/sdk/lifecycle/update-many.js +15 -2
- package/dist/sdk/lifecycle/update.js +5 -2
- package/dist/sdk/linked-artifacts.js +63 -14
- package/dist/sdk/mutation-events.d.ts +18 -2
- package/dist/sdk/mutation-events.js +59 -16
- package/dist/sdk/output.d.ts +44 -0
- package/dist/sdk/output.js +28 -2
- package/dist/sdk/query/complete-list.d.ts +94 -0
- package/dist/sdk/query/complete-list.js +173 -0
- package/dist/sdk/query/get.d.ts +2 -0
- package/dist/sdk/query/get.js +32 -7
- package/dist/sdk/query/list.js +5 -2
- package/dist/sdk/query.d.ts +1 -0
- package/dist/sdk/query.js +3 -2
- package/dist/sdk/read-output-contracts.d.ts +2 -2
- package/dist/sdk/read-output-contracts.js +36 -9
- package/dist/sdk/relationship-analytics.js +90 -14
- package/dist/sdk/relationship-kinds/contract.d.ts +4 -0
- package/dist/sdk/relationship-kinds/contract.js +3 -2
- package/dist/sdk/relationships.d.ts +1 -1
- package/dist/sdk/relationships.js +11 -2
- package/dist/sdk/runtime-extended-actions.js +10 -2
- package/dist/sdk/runtime.d.ts +8 -2
- package/dist/sdk/runtime.js +11 -8
- package/dist/sdk/schema.d.ts +1 -0
- package/dist/sdk/schema.js +2 -2
- package/dist/sdk/test/execution.d.ts +6 -2
- package/dist/sdk/test/execution.js +39 -13
- package/dist/types.d.ts +34 -2
- package/dist/types.js +4 -2
- package/docs/AGENT_GUIDE.md +25 -9
- package/docs/CLI_GRAMMAR.md +106 -0
- package/docs/COMMANDS.md +23 -23
- package/docs/CONFIGURATION.md +58 -1
- package/docs/CONTEXT_INTEGRITY_CONTRACTS.md +58 -0
- package/docs/DEFECT_RECURRENCE.md +134 -0
- package/docs/DEPENDENCY_KIND_CONTRACT.md +12 -2
- package/docs/ONBOARDING.md +4 -4
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.md +4 -0
- package/docs/RELATIONSHIP_GRAPH.md +16 -2
- package/docs/RELEASING.md +30 -6
- package/docs/SDK.md +74 -7
- package/docs/SDK_ARTIFACT_OUTPUT.md +72 -0
- package/docs/SDK_CONTEXT_COORDINATION.md +46 -12
- package/docs/SDK_RUNTIME_BOUNDARIES.md +9 -1
- package/docs/TESTING.md +18 -1
- package/docs/TRUSTWORTHY_CONTEXT_EVIDENCE.md +1 -1
- package/docs/agent-task-token-baseline.json +5 -5
- package/marketplace.json +2 -2
- package/package.json +8 -5
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/skills/pm-audit/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-developer/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-planner/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-release/SKILL.md +26 -0
- package/plugins/pm-claude/skills/pm-workflow/SKILL.md +26 -0
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/skills/pm-auditor/SKILL.md +26 -0
- package/plugins/pm-codex/skills/pm-native/SKILL.md +26 -0
- package/plugins/pm-codex/skills/pm-release/SKILL.md +26 -0
- package/sdk/public-surface.json +1243 -54
- package/dist/cli-bundle/chunks/chunk-47OQEOQB.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HCIYWD6M.js +0 -35
- package/dist/cli-bundle/chunks/chunk-I2LUWWR5.js +0 -3
- package/dist/cli-bundle/chunks/chunk-IC5W2T34.js +0 -2
- package/dist/cli-bundle/chunks/chunk-OAC5NIV4.js +0 -3
- package/dist/cli-bundle/chunks/chunk-PANOOBIS.js +0 -13
- package/dist/cli-bundle/chunks/chunk-TK6N7HGM.js +0 -8
- package/dist/cli-bundle/chunks/chunk-TOFG2URD.js +0 -197
- package/dist/cli-bundle/chunks/register-list-query-EYCXHZAG.js +0 -10
- package/dist/cli-bundle/chunks/register-mutation-7YVIG54J.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-5NMFSX26.js +0 -155
- package/dist/cli-bundle/focused-chunks/chunk-725JSCMP.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-DQ6SMTBF.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-HAACPSUW.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-J4UFYHOD.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-JX5Z344Q.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-L4RDYBIQ.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-NJ5RLEFD.js +0 -26
- package/dist/cli-bundle/focused-chunks/chunk-QYZERYR5.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-TZATVC4G.js +0 -16
- package/dist/cli-bundle/focused-chunks/chunk-WY3WRPVN.js +0 -2
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
/** Search/provider/vector-store leaves. Order is the display order in `pm config list` and in error hints. */
|
|
26
26
|
|
|
27
|
-
!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]="
|
|
27
|
+
!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]="be95f220-5f66-5e8c-8447-996696d02e43")}catch(e){}}();
|
|
28
28
|
export const NESTED_SETTING_DESCRIPTORS = [
|
|
29
29
|
{
|
|
30
30
|
key: "search_provider",
|
|
@@ -255,6 +255,12 @@ export const NESTED_SETTING_DESCRIPTORS = [
|
|
|
255
255
|
choices: ["toon", "json"],
|
|
256
256
|
summary: "Default output format for commands that support it: toon or json.",
|
|
257
257
|
},
|
|
258
|
+
{
|
|
259
|
+
key: "ux_deprecation_hints",
|
|
260
|
+
path: "ux.deprecation_hints",
|
|
261
|
+
kind: "boolean",
|
|
262
|
+
summary: "Emit one stderr migration hint for deprecated command aliases.",
|
|
263
|
+
},
|
|
258
264
|
{
|
|
259
265
|
key: "locks_ttl_seconds",
|
|
260
266
|
path: "locks.ttl_seconds",
|
|
@@ -520,4 +526,4 @@ export function writeNestedSettingValue(settings, descriptor, value) {
|
|
|
520
526
|
return true;
|
|
521
527
|
}
|
|
522
528
|
//# sourceMappingURL=nested-settings.js.map
|
|
523
|
-
//# debugId=
|
|
529
|
+
//# debugId=be95f220-5f66-5e8c-8447-996696d02e43
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/extensions/exporter-output-contract
|
|
3
|
+
*
|
|
4
|
+
* Validates SDK-declared exporter artifact channels independently from extension activation.
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandHandlerContext, ExporterRegistrationOptions, ImportExportContext, RegisteredExporterArtifactOutputContract } from "./extension-types.js";
|
|
7
|
+
/** Validates and normalizes the public artifact-channel metadata for one exporter registration. */
|
|
8
|
+
export declare function normalizeExporterArtifactOutput(value: unknown): RegisteredExporterArtifactOutputContract;
|
|
9
|
+
/** Enforces importer/exporter channel ownership and applies the stdout-specific derived description. */
|
|
10
|
+
export declare function resolveImportExportArtifactOutput(method: "registerImporter" | "registerExporter", resolvedOptions: ExporterRegistrationOptions, descriptionWasDeclared: boolean): RegisteredExporterArtifactOutputContract | undefined;
|
|
11
|
+
/** Snapshots a host command invocation into the stable importer/exporter context contract. */
|
|
12
|
+
export declare function buildImportExportContext(context: CommandHandlerContext, registration: string, action: "import" | "export"): ImportExportContext;
|
|
@@ -0,0 +1,67 @@
|
|
|
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]="057f439e-ac5c-5715-9fd0-4410e003d481")}catch(e){}}();
|
|
3
|
+
import { cloneContextSnapshot } from "./extension-runtime-helpers.js";
|
|
4
|
+
import { asRegistrationRecord, assertOptionalStringField, } from "./registration-validation.js";
|
|
5
|
+
/** Validates and normalizes the public artifact-channel metadata for one exporter registration. */
|
|
6
|
+
export function normalizeExporterArtifactOutput(value) {
|
|
7
|
+
const candidate = asRegistrationRecord("registerExporter options.output", value);
|
|
8
|
+
const allowedKeys = new Set(["channel", "receipt", "media_type"]);
|
|
9
|
+
for (const key of Object.keys(candidate)) {
|
|
10
|
+
if (!allowedKeys.has(key)) {
|
|
11
|
+
throw new TypeError(`registerExporter options.output contains unsupported field ${key}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (candidate.channel !== "stdout" && candidate.channel !== "file") {
|
|
15
|
+
throw new TypeError("registerExporter options.output.channel must be stdout|file");
|
|
16
|
+
}
|
|
17
|
+
if (candidate.receipt !== undefined &&
|
|
18
|
+
candidate.receipt !== "suppress" &&
|
|
19
|
+
candidate.receipt !== "render") {
|
|
20
|
+
throw new TypeError("registerExporter options.output.receipt must be suppress|render");
|
|
21
|
+
}
|
|
22
|
+
if (candidate.channel === "stdout" && candidate.receipt === "render") {
|
|
23
|
+
throw new TypeError("registerExporter stdout artifacts cannot render a host receipt");
|
|
24
|
+
}
|
|
25
|
+
assertOptionalStringField("registerExporter options.output.media_type", candidate.media_type);
|
|
26
|
+
return {
|
|
27
|
+
channel: candidate.channel,
|
|
28
|
+
receipt: candidate.receipt ??
|
|
29
|
+
(candidate.channel === "stdout" ? "suppress" : "render"),
|
|
30
|
+
...(typeof candidate.media_type === "string"
|
|
31
|
+
? { media_type: candidate.media_type }
|
|
32
|
+
: {}),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Enforces importer/exporter channel ownership and applies the stdout-specific derived description. */
|
|
36
|
+
export function resolveImportExportArtifactOutput(method, resolvedOptions, descriptionWasDeclared) {
|
|
37
|
+
if (method === "registerImporter" && resolvedOptions.output !== undefined) {
|
|
38
|
+
throw new TypeError("registerImporter options.output is exporter-only");
|
|
39
|
+
}
|
|
40
|
+
if (method !== "registerExporter" || resolvedOptions.output === undefined) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const output = normalizeExporterArtifactOutput(resolvedOptions.output);
|
|
44
|
+
if (!descriptionWasDeclared && output.channel === "stdout") {
|
|
45
|
+
resolvedOptions.description =
|
|
46
|
+
"Export items with the registered extension adapter. Artifact bytes are written exclusively to stdout and the host receipt is suppressed by default.";
|
|
47
|
+
}
|
|
48
|
+
return output;
|
|
49
|
+
}
|
|
50
|
+
/** Snapshots a host command invocation into the stable importer/exporter context contract. */
|
|
51
|
+
export function buildImportExportContext(context, registration, action) {
|
|
52
|
+
return {
|
|
53
|
+
registration,
|
|
54
|
+
action,
|
|
55
|
+
command: context.command,
|
|
56
|
+
args: cloneContextSnapshot(context.args),
|
|
57
|
+
options: cloneContextSnapshot(context.options),
|
|
58
|
+
global: cloneContextSnapshot(context.global),
|
|
59
|
+
pm_root: context.pm_root,
|
|
60
|
+
source_workspace_root: context.source_workspace_root,
|
|
61
|
+
repo_root: context.repo_root,
|
|
62
|
+
pm_root_rel: context.pm_root_rel,
|
|
63
|
+
...(context.sdk === undefined ? {} : { sdk: context.sdk }),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=exporter-output-contract.js.map
|
|
67
|
+
//# debugId=057f439e-ac5c-5715-9fd0-4410e003d481
|
|
@@ -715,6 +715,39 @@ export interface ImportExportRegistrationOptions {
|
|
|
715
715
|
/** Value that configures or reports flags for this contract. */
|
|
716
716
|
flags?: FlagDefinition[];
|
|
717
717
|
}
|
|
718
|
+
/**
|
|
719
|
+
* Declares where an exporter writes its artifact and whether the host may
|
|
720
|
+
* render the returned structured receipt after the exporter completes.
|
|
721
|
+
*/
|
|
722
|
+
export type ExporterArtifactOutputContract = {
|
|
723
|
+
/** Stdout exclusively carries artifact bytes. */
|
|
724
|
+
channel: "stdout";
|
|
725
|
+
/** Stdout artifacts cannot opt back into host rendering. */
|
|
726
|
+
receipt?: "suppress";
|
|
727
|
+
/** Optional IANA media type describing the emitted artifact. */
|
|
728
|
+
media_type?: string;
|
|
729
|
+
} | {
|
|
730
|
+
/** The exporter writes its artifact to a file. */
|
|
731
|
+
channel: "file";
|
|
732
|
+
/** File exporters may render or suppress their bounded receipt. */
|
|
733
|
+
receipt?: "suppress" | "render";
|
|
734
|
+
/** Optional IANA media type describing the emitted artifact. */
|
|
735
|
+
media_type?: string;
|
|
736
|
+
};
|
|
737
|
+
/** Exporter command metadata plus its optional artifact-delivery contract. */
|
|
738
|
+
export interface ExporterRegistrationOptions extends ImportExportRegistrationOptions {
|
|
739
|
+
/** Declaration for artifact bytes and the host receipt. */
|
|
740
|
+
output?: ExporterArtifactOutputContract;
|
|
741
|
+
}
|
|
742
|
+
/** Fully normalized exporter artifact contract stored in inventories. */
|
|
743
|
+
export interface RegisteredExporterArtifactOutputContract {
|
|
744
|
+
/** Destination carrying the artifact bytes. */
|
|
745
|
+
channel: "stdout" | "file";
|
|
746
|
+
/** Explicit host receipt policy after normalization. */
|
|
747
|
+
receipt: "suppress" | "render";
|
|
748
|
+
/** Optional IANA media type describing the emitted artifact. */
|
|
749
|
+
media_type?: string;
|
|
750
|
+
}
|
|
718
751
|
/** Restricts flag value type values accepted by command, SDK, and storage contracts. */
|
|
719
752
|
export type FlagValueType = "string" | "number" | "boolean";
|
|
720
753
|
/** Documents the flag definition payload exchanged by command, SDK, and package integrations. */
|
|
@@ -1288,6 +1321,8 @@ export interface RegisteredExtensionExporter {
|
|
|
1288
1321
|
name: string;
|
|
1289
1322
|
/** Value that configures or reports exporter for this contract. */
|
|
1290
1323
|
exporter: string;
|
|
1324
|
+
/** Declared artifact channel and normalized receipt policy. */
|
|
1325
|
+
output?: RegisteredExporterArtifactOutputContract;
|
|
1291
1326
|
}
|
|
1292
1327
|
/** Documents the registered extension search provider payload exchanged by command, SDK, and package integrations. */
|
|
1293
1328
|
export interface RegisteredExtensionSearchProvider {
|
|
@@ -1447,7 +1482,7 @@ export interface ExtensionApi {
|
|
|
1447
1482
|
/** Value that configures or reports register importer for this contract. */
|
|
1448
1483
|
registerImporter(name: string, importer: Importer, options?: ImportExportRegistrationOptions): void;
|
|
1449
1484
|
/** Value that configures or reports register exporter for this contract. */
|
|
1450
|
-
registerExporter(name: string, exporter: Exporter, options?:
|
|
1485
|
+
registerExporter(name: string, exporter: Exporter, options?: ExporterRegistrationOptions): void;
|
|
1451
1486
|
/** Value that configures or reports register search provider for this contract. */
|
|
1452
1487
|
registerSearchProvider(provider: SearchProviderDefinition): void;
|
|
1453
1488
|
/** Value that configures or reports register vector store adapter 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]="a54549aa-2f6c-5092-a3eb-5b36ee698ea4")}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=a54549aa-2f6c-5092-a3eb-5b36ee698ea4
|
|
@@ -4,12 +4,13 @@
|
|
|
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]="cccce7c1-dd08-5c9f-a74e-e639536b9a6a")}catch(e){}}();
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
11
11
|
import { pathExists } from "../fs/fs-utils.js";
|
|
12
12
|
import { isPathWithinDirectory } from "../fs/path-utils.js";
|
|
13
|
+
import { isHostOutputSuppressed, suppressHostOutput, } from "../output/output-control.js";
|
|
13
14
|
import { resolvePmPackageRootFromModule } from "../packages/root.js";
|
|
14
15
|
import { resolveGlobalPmRoot } from "../store/paths.js";
|
|
15
16
|
import { asRecordLoose, resolveActivatablePropertyRecord, } from "../shared/primitives.js";
|
|
@@ -19,6 +20,7 @@ import { snapshotExtensionModuleGraph } from "./module-graph-snapshot.js";
|
|
|
19
20
|
import { captureExtensionActivationRollback } from "./activation-transaction.js";
|
|
20
21
|
import { collectPreflightCollisionWarnings, normalizePreflightOverride, } from "./preflight-ownership.js";
|
|
21
22
|
import { assertCommandDefinitionMetadataStrings } from "./command-visibility-tier.js";
|
|
23
|
+
import { buildImportExportContext, resolveImportExportArtifactOutput, } from "./exporter-output-contract.js";
|
|
22
24
|
import { asRegistrationRecord, assertOptionalBooleanField, assertOptionalFlagDefaultField, assertOptionalStringArrayField, assertOptionalStringField, normalizeOptionalStringArrayField, } from "./registration-validation.js";
|
|
23
25
|
import { describeExtensionLongFlagFailure, findExtensionFlagTokenFailure, } from "./flag-definition-validation.js";
|
|
24
26
|
import { compareComparableVersions, evaluatePmMaxVersionBound, evaluatePmMinVersionBound, parseComparableVersion, } from "./version-compat.js";
|
|
@@ -26,8 +28,9 @@ import { createRelationshipKindRegistry, } from "../../sdk/relationships.js";
|
|
|
26
28
|
import { normalizeNames, isKnownExtensionCapability, collectUnknownExtensionCapabilities, normalizeManifestCapabilities, formatUnknownExtensionCapabilityWarning, formatLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
|
|
27
29
|
import { normalizeExtensionPolicy, serializeExtensionPolicy, hydrateExtensionPolicy, normalizePolicySandboxProfile, evaluateExtensionPolicyForExtension, evaluateExtensionPolicyForCapability, evaluateExtensionPolicyForRegistration, } from "./extension-policy.js";
|
|
28
30
|
import { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
|
|
29
|
-
import { normalizeCommandName
|
|
31
|
+
import { normalizeCommandName } from "./extension-runtime-helpers.js";
|
|
30
32
|
import { normalizeExtensionContributionInventory } from "./contribution-inventory.js";
|
|
33
|
+
import { formatExtensionManifestSchemaWarnings } from "./manifest-schema.js";
|
|
31
34
|
import { attachRuntimeDefinition, assertHookHandler, assertNonEmptyRegistrationString, assertRegistrationFunction, cloneRuntimeRegistrationValue, createRegistrationValidationError, extractRegistrationValidationTrace, isExtensionServiceName, isOutputRendererFormat, normalizeRegistrationRecord, normalizeRegistrationRecordList, normalizeRuntimeRegistrationRecord, normalizeRegistrationName, sanitizeRegistrationValue, toRegistrationCommandPath, validateAssuranceMeasurementProviderDefinition, } from "./registration-values.js";
|
|
32
35
|
import { buildReadyExtensionCandidate, } from "./extension-candidate.js";
|
|
33
36
|
export { parseUnknownExtensionCapabilityWarning, parseLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
|
|
@@ -513,8 +516,8 @@ function buildUnavailableExtensionScan(layer, directory, manifestPath, warning)
|
|
|
513
516
|
};
|
|
514
517
|
}
|
|
515
518
|
/** Collect the non-fatal load warnings for a parsed extension manifest, in detection order: legacy capability aliases, unknown capabilities, an entry outside or absent from the extension directory, then the pm version floor/ceiling incompatibility warnings. */
|
|
516
|
-
function collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility) {
|
|
517
|
-
const extensionWarnings =
|
|
519
|
+
function collectScannedExtensionWarnings(layer, manifest, rawManifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility) {
|
|
520
|
+
const extensionWarnings = formatExtensionManifestSchemaWarnings(layer, manifest, rawManifest);
|
|
518
521
|
if (Array.isArray(manifest.legacy_capability_aliases) &&
|
|
519
522
|
manifest.legacy_capability_aliases.length > 0) {
|
|
520
523
|
extensionWarnings.push(formatLegacyExtensionCapabilityAliasWarning(layer, manifest.name, manifest.legacy_capability_aliases));
|
|
@@ -543,14 +546,17 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
|
|
|
543
546
|
return buildUnavailableExtensionScan(layer, directory, manifestPath, `extension_manifest_missing:${layer}:${directory}`);
|
|
544
547
|
}
|
|
545
548
|
let manifest;
|
|
549
|
+
let rawManifest;
|
|
546
550
|
try {
|
|
547
551
|
const parsed = JSON.parse(await fs.readFile(manifestPath, "utf8"));
|
|
552
|
+
rawManifest = asRecordLoose(parsed);
|
|
548
553
|
manifest = parseExtensionManifestDocument(parsed);
|
|
549
554
|
}
|
|
550
555
|
catch {
|
|
556
|
+
rawManifest = null;
|
|
551
557
|
manifest = null;
|
|
552
558
|
}
|
|
553
|
-
if (!manifest) {
|
|
559
|
+
if (!manifest || !rawManifest) {
|
|
554
560
|
return buildUnavailableExtensionScan(layer, directory, manifestPath, `extension_manifest_invalid:${layer}:${directory}`);
|
|
555
561
|
}
|
|
556
562
|
const entryPath = path.resolve(extensionDir, manifest.entry);
|
|
@@ -564,7 +570,7 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
|
|
|
564
570
|
const enabledForLoad = shouldEnable(manifest.name, enabled, disabled);
|
|
565
571
|
const pmVersionCompatibility = await evaluatePmMinVersionCompatibility(layer, manifest);
|
|
566
572
|
const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest, pmMaxVersionExceededMode);
|
|
567
|
-
const extensionWarnings = collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility);
|
|
573
|
+
const extensionWarnings = collectScannedExtensionWarnings(layer, manifest, rawManifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility);
|
|
568
574
|
const extensionReady = entryWithinDirectory &&
|
|
569
575
|
entryExists &&
|
|
570
576
|
pmVersionCompatibility.allowed &&
|
|
@@ -1723,6 +1729,23 @@ class ExtensionApiRegistrar {
|
|
|
1723
1729
|
profile: applyProjectProfileDefaults(snapshot),
|
|
1724
1730
|
});
|
|
1725
1731
|
}
|
|
1732
|
+
/** Validates and records optional importer/exporter flag metadata through the schema policy gate. */
|
|
1733
|
+
registerImportExportCommandFlags(method, commandPath, resolvedOptions) {
|
|
1734
|
+
if (resolvedOptions.flags === undefined) {
|
|
1735
|
+
return;
|
|
1736
|
+
}
|
|
1737
|
+
assertExtensionCapability(this.#loadedExtension, "schema", `${method} options.flags`);
|
|
1738
|
+
if (!this.allowRegistration("schema.flags", `${method} options.flags`, "schema")) {
|
|
1739
|
+
return;
|
|
1740
|
+
}
|
|
1741
|
+
validateFlagDefinitions(resolvedOptions.flags);
|
|
1742
|
+
this.#registrationRegistry.flags.push({
|
|
1743
|
+
layer: this.#loadedExtension.layer,
|
|
1744
|
+
name: this.#loadedExtension.name,
|
|
1745
|
+
target_command: commandPath,
|
|
1746
|
+
flags: normalizeFlagDefinitions(`${method} options.flags`, resolvedOptions.flags),
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1726
1749
|
applyImportExportCommandMetadata(method, commandPath, options) {
|
|
1727
1750
|
if (options !== undefined &&
|
|
1728
1751
|
(typeof options !== "object" ||
|
|
@@ -1743,6 +1766,7 @@ class ExtensionApiRegistrar {
|
|
|
1743
1766
|
description: options?.description ?? defaultDescription,
|
|
1744
1767
|
arguments: options?.arguments ?? defaultArguments,
|
|
1745
1768
|
};
|
|
1769
|
+
const output = resolveImportExportArtifactOutput(method, resolvedOptions, options?.description !== undefined);
|
|
1746
1770
|
assertOptionalStringField(`${method} options.action`, resolvedOptions.action);
|
|
1747
1771
|
assertOptionalStringField(`${method} options.description`, resolvedOptions.description);
|
|
1748
1772
|
assertOptionalStringField(`${method} options.intent`, resolvedOptions.intent);
|
|
@@ -1750,20 +1774,7 @@ class ExtensionApiRegistrar {
|
|
|
1750
1774
|
const examples = normalizeOptionalStringArrayField(`${method} options.examples`, resolvedOptions.examples);
|
|
1751
1775
|
const failureHints = normalizeOptionalStringArrayField(`${method} options.failure_hints`, resolvedOptions.failure_hints);
|
|
1752
1776
|
const argumentsDefinition = normalizeCommandDefinitionArguments(resolvedOptions.arguments);
|
|
1753
|
-
|
|
1754
|
-
assertExtensionCapability(this.#loadedExtension, "schema", `${method} options.flags`);
|
|
1755
|
-
// Route metadata flags through the same surface-policy gate as registerFlags so
|
|
1756
|
-
// enforce-mode policies blocking schema.flags are honored even when importers are allowed.
|
|
1757
|
-
if (this.allowRegistration("schema.flags", `${method} options.flags`, "schema")) {
|
|
1758
|
-
validateFlagDefinitions(resolvedOptions.flags);
|
|
1759
|
-
this.#registrationRegistry.flags.push({
|
|
1760
|
-
layer: this.#loadedExtension.layer,
|
|
1761
|
-
name: this.#loadedExtension.name,
|
|
1762
|
-
target_command: commandPath,
|
|
1763
|
-
flags: normalizeFlagDefinitions(`${method} options.flags`, resolvedOptions.flags),
|
|
1764
|
-
});
|
|
1765
|
-
}
|
|
1766
|
-
}
|
|
1777
|
+
this.registerImportExportCommandFlags(method, commandPath, resolvedOptions);
|
|
1767
1778
|
const registration = {
|
|
1768
1779
|
layer: this.#loadedExtension.layer,
|
|
1769
1780
|
name: this.#loadedExtension.name,
|
|
@@ -1783,6 +1794,7 @@ class ExtensionApiRegistrar {
|
|
|
1783
1794
|
registration.intent = intent;
|
|
1784
1795
|
}
|
|
1785
1796
|
this.#registrationRegistry.commands.push(registration);
|
|
1797
|
+
return output;
|
|
1786
1798
|
}
|
|
1787
1799
|
registerImporter(name, importer, options) {
|
|
1788
1800
|
assertExtensionCapability(this.#loadedExtension, "importers", "registerImporter");
|
|
@@ -1804,19 +1816,7 @@ class ExtensionApiRegistrar {
|
|
|
1804
1816
|
layer: this.#loadedExtension.layer,
|
|
1805
1817
|
name: this.#loadedExtension.name,
|
|
1806
1818
|
command: commandPath,
|
|
1807
|
-
run: async (context) => importer(
|
|
1808
|
-
registration: normalizedName,
|
|
1809
|
-
action: "import",
|
|
1810
|
-
command: context.command,
|
|
1811
|
-
args: cloneContextSnapshot(context.args),
|
|
1812
|
-
options: cloneContextSnapshot(context.options),
|
|
1813
|
-
global: cloneContextSnapshot(context.global),
|
|
1814
|
-
pm_root: context.pm_root,
|
|
1815
|
-
source_workspace_root: context.source_workspace_root,
|
|
1816
|
-
repo_root: context.repo_root,
|
|
1817
|
-
pm_root_rel: context.pm_root_rel,
|
|
1818
|
-
...(context.sdk === undefined ? {} : { sdk: context.sdk }),
|
|
1819
|
-
}),
|
|
1819
|
+
run: async (context) => importer(buildImportExportContext(context, normalizedName, "import")),
|
|
1820
1820
|
});
|
|
1821
1821
|
}
|
|
1822
1822
|
registerExporter(name, exporter, options) {
|
|
@@ -1829,29 +1829,24 @@ class ExtensionApiRegistrar {
|
|
|
1829
1829
|
const commandPath = toRegistrationCommandPath(normalizedName, "export");
|
|
1830
1830
|
// Validate and register optional command metadata before mutating the registry
|
|
1831
1831
|
// so an invalid options object leaves no partial exporter registration.
|
|
1832
|
-
this.applyImportExportCommandMetadata("registerExporter", commandPath, options);
|
|
1832
|
+
const output = this.applyImportExportCommandMetadata("registerExporter", commandPath, options);
|
|
1833
1833
|
this.#registrationRegistry.exporters.push({
|
|
1834
1834
|
layer: this.#loadedExtension.layer,
|
|
1835
1835
|
name: this.#loadedExtension.name,
|
|
1836
1836
|
exporter: normalizedName,
|
|
1837
|
+
...(output === undefined ? {} : { output }),
|
|
1837
1838
|
});
|
|
1838
1839
|
this.#commandRegistry.handlers.push({
|
|
1839
1840
|
layer: this.#loadedExtension.layer,
|
|
1840
1841
|
name: this.#loadedExtension.name,
|
|
1841
1842
|
command: commandPath,
|
|
1842
|
-
run: async (context) =>
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
pm_root: context.pm_root,
|
|
1850
|
-
source_workspace_root: context.source_workspace_root,
|
|
1851
|
-
repo_root: context.repo_root,
|
|
1852
|
-
pm_root_rel: context.pm_root_rel,
|
|
1853
|
-
...(context.sdk === undefined ? {} : { sdk: context.sdk }),
|
|
1854
|
-
}),
|
|
1843
|
+
run: async (context) => {
|
|
1844
|
+
const result = await exporter(buildImportExportContext(context, normalizedName, "export"));
|
|
1845
|
+
return output?.receipt === "suppress" &&
|
|
1846
|
+
!isHostOutputSuppressed(result)
|
|
1847
|
+
? suppressHostOutput(result)
|
|
1848
|
+
: result;
|
|
1849
|
+
},
|
|
1855
1850
|
});
|
|
1856
1851
|
}
|
|
1857
1852
|
registerSearchProvider(provider) {
|
|
@@ -2221,4 +2216,4 @@ export const _testOnlyLoader = {
|
|
|
2221
2216
|
},
|
|
2222
2217
|
};
|
|
2223
2218
|
//# sourceMappingURL=loader.js.map
|
|
2224
|
-
//# debugId=
|
|
2219
|
+
//# debugId=cccce7c1-dd08-5c9f-a74e-e639536b9a6a
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/extensions/manifest-schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the closed extension-manifest key vocabulary and returns pure schema
|
|
5
|
+
* diagnostics shared by SDK authoring checks and runtime discovery.
|
|
6
|
+
*/
|
|
7
|
+
import type { ExtensionLayer, ExtensionManifest } from "./extension-types.js";
|
|
8
|
+
/** Canonical top-level keys accepted by an extension `manifest.json`. */
|
|
9
|
+
export declare const KNOWN_EXTENSION_MANIFEST_KEYS: Set<string>;
|
|
10
|
+
/** Pure closed-schema inspection result for one raw extension manifest. */
|
|
11
|
+
export interface ExtensionManifestSchemaInspection {
|
|
12
|
+
/** Unknown top-level keys in deterministic lexical order. */
|
|
13
|
+
unknownKeys: string[];
|
|
14
|
+
/** Whether neither canonical pm compatibility bound is present. */
|
|
15
|
+
missingVersionBounds: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Inspect raw manifest keys without parsing, loading, or mutating an extension. */
|
|
18
|
+
export declare function inspectExtensionManifestSchema(manifest: Readonly<Record<string, unknown>>): ExtensionManifestSchemaInspection;
|
|
19
|
+
/** Format runtime discovery warnings for unknown keys and absent canonical compatibility bounds. */
|
|
20
|
+
export declare function formatExtensionManifestSchemaWarnings(layer: ExtensionLayer, manifest: ExtensionManifest, rawManifest: Readonly<Record<string, unknown>>): string[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/extensions/manifest-schema
|
|
3
|
+
*
|
|
4
|
+
* Defines the closed extension-manifest key vocabulary and returns pure schema
|
|
5
|
+
* diagnostics shared by SDK authoring checks and runtime discovery.
|
|
6
|
+
*/
|
|
7
|
+
/** Canonical top-level keys accepted by an extension `manifest.json`. */
|
|
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]="7d9d8924-3186-5aab-ac36-164fb08624a8")}catch(e){}}();
|
|
10
|
+
export const KNOWN_EXTENSION_MANIFEST_KEYS = new Set([
|
|
11
|
+
"name",
|
|
12
|
+
"version",
|
|
13
|
+
"entry",
|
|
14
|
+
"priority",
|
|
15
|
+
"description",
|
|
16
|
+
"author",
|
|
17
|
+
"capabilities",
|
|
18
|
+
"manifest_version",
|
|
19
|
+
"pm_min_version",
|
|
20
|
+
"pm_max_version",
|
|
21
|
+
"engines",
|
|
22
|
+
"trusted",
|
|
23
|
+
"provenance",
|
|
24
|
+
"sandbox_profile",
|
|
25
|
+
"permissions",
|
|
26
|
+
"activation",
|
|
27
|
+
"contributions",
|
|
28
|
+
"legacy_capability_aliases",
|
|
29
|
+
]);
|
|
30
|
+
/** Inspect raw manifest keys without parsing, loading, or mutating an extension. */
|
|
31
|
+
export function inspectExtensionManifestSchema(manifest) {
|
|
32
|
+
return {
|
|
33
|
+
unknownKeys: Object.keys(manifest)
|
|
34
|
+
.filter((key) => !KNOWN_EXTENSION_MANIFEST_KEYS.has(key))
|
|
35
|
+
.sort((left, right) => (left > right ? 1 : -1)),
|
|
36
|
+
missingVersionBounds: manifest.pm_min_version === undefined &&
|
|
37
|
+
manifest.pm_max_version === undefined,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Format runtime discovery warnings for unknown keys and absent canonical compatibility bounds. */
|
|
41
|
+
export function formatExtensionManifestSchemaWarnings(layer, manifest, rawManifest) {
|
|
42
|
+
const inspection = inspectExtensionManifestSchema(rawManifest);
|
|
43
|
+
const warnings = inspection.unknownKeys.map((key) => key === "compatibility"
|
|
44
|
+
? `extension_manifest_unknown_key:${layer}:${manifest.name}:key=compatibility:suggested=pm_min_version`
|
|
45
|
+
: `extension_manifest_unknown_key:${layer}:${manifest.name}:key=${key}`);
|
|
46
|
+
if (inspection.missingVersionBounds) {
|
|
47
|
+
warnings.push(`extension_manifest_no_version_bounds:${layer}:${manifest.name}:suggested=pm_min_version`);
|
|
48
|
+
}
|
|
49
|
+
return warnings;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=manifest-schema.js.map
|
|
52
|
+
//# debugId=7d9d8924-3186-5aab-ac36-164fb08624a8
|
|
@@ -51,6 +51,11 @@ declare function loadDatabaseSync(loadModule: (specifier: string) => unknown): D
|
|
|
51
51
|
declare function loadStableDatabaseSync(nodeVersion: string, loadModule: (specifier: string) => unknown): DatabaseSyncConstructor | null;
|
|
52
52
|
/** Rebuild the complete optional event projection from authoritative streams. */
|
|
53
53
|
export declare function rebuildHistoryEventIndex(pmRoot: string): Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Query authoritative history streams when the optional SQLite accelerator is
|
|
56
|
+
* unavailable. The result preserves the index contract at higher read cost.
|
|
57
|
+
*/
|
|
58
|
+
export declare function queryHistoryEventStreams(pmRoot: string, query: HistoryEventIndexQuery): Promise<HistoryEventIndexQueryResult>;
|
|
54
59
|
/**
|
|
55
60
|
* Update an already-built event projection after one authoritative append.
|
|
56
61
|
* Absence is a cheap no-op; corrupt projections are removed for lazy rebuild.
|