@unbrained/pm-cli 2026.5.24 → 2026.5.28
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/CHANGELOG.md +953 -522
- package/README.md +2 -10
- package/dist/cli/bootstrap-args.d.ts +18 -1
- package/dist/cli/bootstrap-args.js +143 -3
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +134 -11
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/append.js +4 -3
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/claim.js +5 -4
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.d.ts +3 -0
- package/dist/cli/commands/close.js +26 -3
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.d.ts +2 -2
- package/dist/cli/commands/completion.js +109 -56
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.js +82 -4
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/create.js +7 -272
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/delete.js +4 -3
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +1 -12
- package/dist/cli/commands/docs.js +8 -312
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +14 -0
- package/dist/cli/commands/extension/bundled-catalog.js +268 -0
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -0
- package/dist/cli/commands/extension/doctor.d.ts +31 -0
- package/dist/cli/commands/extension/doctor.js +345 -0
- package/dist/cli/commands/extension/doctor.js.map +1 -0
- package/dist/cli/commands/extension/install-sources.d.ts +37 -0
- package/dist/cli/commands/extension/install-sources.js +384 -0
- package/dist/cli/commands/extension/install-sources.js.map +1 -0
- package/dist/cli/commands/extension/managed-state.d.ts +48 -0
- package/dist/cli/commands/extension/managed-state.js +172 -0
- package/dist/cli/commands/extension/managed-state.js.map +1 -0
- package/dist/cli/commands/extension/scaffold.d.ts +14 -0
- package/dist/cli/commands/extension/scaffold.js +202 -0
- package/dist/cli/commands/extension/scaffold.js.map +1 -0
- package/dist/cli/commands/extension/shared.d.ts +14 -0
- package/dist/cli/commands/extension/shared.js +106 -0
- package/dist/cli/commands/extension/shared.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +36 -68
- package/dist/cli/commands/extension.js +143 -1422
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.d.ts +1 -12
- package/dist/cli/commands/files.js +11 -308
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/get.js +4 -3
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.js +17 -3
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.js +23 -18
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +24 -18
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/legacy-none-tokens.d.ts +3 -0
- package/dist/cli/commands/legacy-none-tokens.js +39 -0
- package/dist/cli/commands/legacy-none-tokens.js.map +1 -0
- package/dist/cli/commands/linked-artifacts.d.ts +96 -0
- package/dist/cli/commands/linked-artifacts.js +335 -0
- package/dist/cli/commands/linked-artifacts.js.map +1 -0
- package/dist/cli/commands/linked-test-parsers.d.ts +28 -0
- package/dist/cli/commands/linked-test-parsers.js +192 -0
- package/dist/cli/commands/linked-test-parsers.js.map +1 -0
- package/dist/cli/commands/list.js +19 -5
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +4 -3
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +5 -0
- package/dist/cli/commands/plan.js +56 -8
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.d.ts +26 -0
- package/dist/cli/commands/recurrence-parsers.js +98 -0
- package/dist/cli/commands/recurrence-parsers.js.map +1 -0
- package/dist/cli/commands/restore.js +19 -8
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/search.js +5 -8
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test/linked-command-detection.d.ts +37 -0
- package/dist/cli/commands/test/linked-command-detection.js +200 -0
- package/dist/cli/commands/test/linked-command-detection.js.map +1 -0
- package/dist/cli/commands/test.d.ts +1 -2
- package/dist/cli/commands/test.js +8 -350
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +4 -3
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +83 -356
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.js +32 -12
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +1 -0
- package/dist/cli/error-guidance.js +6 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/main.d.ts +11 -0
- package/dist/cli/main.js +76 -28
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +4 -1
- package/dist/cli/register-list-query.js +242 -203
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +73 -11
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +3 -3
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +12 -7
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +3 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli.js +4 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/config/positional-value.d.ts +44 -0
- package/dist/core/config/positional-value.js +109 -0
- package/dist/core/config/positional-value.js.map +1 -0
- package/dist/core/extensions/extension-capability-aliases.d.ts +14 -0
- package/dist/core/extensions/extension-capability-aliases.js +159 -0
- package/dist/core/extensions/extension-capability-aliases.js.map +1 -0
- package/dist/core/extensions/extension-hook-runtime.d.ts +13 -0
- package/dist/core/extensions/extension-hook-runtime.js +414 -0
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -0
- package/dist/core/extensions/extension-policy.d.ts +69 -0
- package/dist/core/extensions/extension-policy.js +481 -0
- package/dist/core/extensions/extension-policy.js.map +1 -0
- package/dist/core/extensions/extension-registries.d.ts +8 -0
- package/dist/core/extensions/extension-registries.js +52 -0
- package/dist/core/extensions/extension-registries.js.map +1 -0
- package/dist/core/extensions/extension-runtime-helpers.d.ts +6 -0
- package/dist/core/extensions/extension-runtime-helpers.js +29 -0
- package/dist/core/extensions/extension-runtime-helpers.js.map +1 -0
- package/dist/core/extensions/extension-types.d.ts +13 -39
- package/dist/core/extensions/extension-types.js +34 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +7 -0
- package/dist/core/extensions/index.js +11 -2
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +4 -22
- package/dist/core/extensions/loader.js +22 -1139
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/drift-scan.d.ts +11 -0
- package/dist/core/history/drift-scan.js +114 -32
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/history/history-rewrite.d.ts +43 -0
- package/dist/core/history/history-rewrite.js +48 -0
- package/dist/core/history/history-rewrite.js.map +1 -0
- package/dist/core/history/history.js +5 -4
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/history/replay.js +4 -3
- package/dist/core/history/replay.js.map +1 -1
- package/dist/core/item/item-record.d.ts +19 -0
- package/dist/core/item/item-record.js +24 -0
- package/dist/core/item/item-record.js.map +1 -0
- package/dist/core/output/mutation-projection.d.ts +31 -0
- package/dist/core/output/mutation-projection.js +103 -0
- package/dist/core/output/mutation-projection.js.map +1 -0
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +5 -3
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +8 -38
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/vector-stores.js +46 -9
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.d.ts +1 -1
- package/dist/core/sentry/helpers.js +20 -3
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +1 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/constants.d.ts +10 -1
- package/dist/core/shared/constants.js +56 -58
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/levenshtein.js +23 -7
- package/dist/core/shared/levenshtein.js.map +1 -1
- package/dist/core/shared/primitives.d.ts +23 -0
- package/dist/core/shared/primitives.js +39 -2
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +16 -2
- package/dist/core/store/front-matter-cache.js +99 -33
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.js +8 -73
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/mcp/server.js +76 -28
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +20 -0
- package/dist/sdk/cli-contracts/enum-contracts.js +156 -0
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +14 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js +243 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +11 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +901 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +11 -33
- package/dist/sdk/cli-contracts.js +30 -1356
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/package-import-adapters.d.ts +74 -0
- package/dist/sdk/package-import-adapters.js +186 -0
- package/dist/sdk/package-import-adapters.js.map +1 -0
- package/dist/sdk/package-runtime-options.d.ts +26 -0
- package/dist/sdk/package-runtime-options.js +71 -0
- package/dist/sdk/package-runtime-options.js.map +1 -0
- package/dist/sdk/runtime.d.ts +2 -0
- package/dist/sdk/runtime.js +4 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/docs/AGENT_GUIDE.md +6 -10
- package/docs/CLAUDE_CODE_PLUGIN.md +5 -28
- package/docs/CODEX_PLUGIN.md +5 -5
- package/docs/COMMANDS.md +19 -3
- package/docs/CONFIGURATION.md +15 -0
- package/docs/EXTENSIONS.md +4 -63
- package/docs/RELEASING.md +4 -4
- package/marketplace.json +7 -3
- package/package.json +9 -6
- package/packages/pm-beads/extensions/beads/index.js +2 -49
- package/packages/pm-beads/extensions/beads/index.ts +2 -54
- package/packages/pm-beads/extensions/beads/runtime-loader.js +86 -0
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +88 -0
- package/packages/pm-beads/extensions/beads/runtime.js +26 -115
- package/packages/pm-beads/extensions/beads/runtime.ts +33 -132
- package/packages/pm-calendar/extensions/calendar/index.js +47 -2
- package/packages/pm-calendar/extensions/calendar/index.ts +52 -2
- package/packages/pm-calendar/extensions/calendar/runtime.js +1 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +1 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +14 -41
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +25 -41
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +10 -50
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +17 -50
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +8 -40
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +10 -40
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +1 -1
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +4 -37
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +6 -37
- package/packages/pm-todos/extensions/todos/index.js +3 -50
- package/packages/pm-todos/extensions/todos/index.ts +3 -55
- package/packages/pm-todos/extensions/todos/runtime-loader.js +86 -0
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +88 -0
- package/packages/pm-todos/extensions/todos/runtime.js +24 -117
- package/packages/pm-todos/extensions/todos/runtime.ts +32 -129
- package/plugins/pm-claude/README.md +2 -2
- package/plugins/pm-claude/commands/pm-planner.md +1 -15
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +5 -2
- package/plugins/pm-claude/skills/pm-planner/SKILL.md +3 -21
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +15 -6
- package/plugins/pm-codex/skills/pm-native/SKILL.md +1 -13
- package/PRD.md +0 -1734
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-policy.js","sources":["core/extensions/extension-policy.ts"],"sourceRoot":"/","sourcesContent":["import {\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n type ExtensionCapability,\n type ExtensionGovernancePolicy,\n type ExtensionLayer,\n type ExtensionPolicyMode,\n type ExtensionPolicyOverride,\n type ExtensionPolicySurface,\n type ExtensionSandboxProfile,\n type ExtensionTrustMode,\n} from \"./extension-types.js\";\nimport { isKnownExtensionCapability } from \"./extension-capability-aliases.js\";\nimport { normalizeCommandName } from \"./extension-runtime-helpers.js\";\nimport type { PmSettings } from \"../../types/index.js\";\n\ninterface NormalizedExtensionPolicyOverride {\n name: string;\n disabled: boolean;\n requireTrusted: boolean;\n requireProvenance: boolean;\n sandboxProfile?: ExtensionSandboxProfile;\n allowedCapabilities: Set<string>;\n blockedCapabilities: Set<string>;\n allowedSurfaces: Set<string>;\n blockedSurfaces: Set<string>;\n allowedCommands: Set<string>;\n blockedCommands: Set<string>;\n allowedActions: Set<string>;\n blockedActions: Set<string>;\n allowedServices: Set<string>;\n blockedServices: Set<string>;\n}\n\nexport interface NormalizedExtensionPolicy {\n mode: ExtensionPolicyMode;\n trustMode: ExtensionTrustMode;\n requireProvenance: boolean;\n trustedExtensions: Set<string>;\n defaultSandboxProfile: ExtensionSandboxProfile;\n allowedExtensions: Set<string>;\n blockedExtensions: Set<string>;\n allowedCapabilities: Set<string>;\n blockedCapabilities: Set<string>;\n allowedSurfaces: Set<string>;\n blockedSurfaces: Set<string>;\n allowedCommands: Set<string>;\n blockedCommands: Set<string>;\n allowedActions: Set<string>;\n blockedActions: Set<string>;\n allowedServices: Set<string>;\n blockedServices: Set<string>;\n overridesByName: Map<string, NormalizedExtensionPolicyOverride>;\n warnings: string[];\n}\n\nexport interface PolicyExtensionRef {\n layer: ExtensionLayer;\n name: string;\n trusted?: boolean;\n provenanceVerified?: boolean;\n sandboxProfile?: ExtensionSandboxProfile;\n permissions?: Record<string, boolean | undefined>;\n}\n\nfunction normalizePolicyName(value: string | undefined): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n return value.trim().toLowerCase();\n}\n\nfunction normalizePolicyStringSet(values: readonly string[] | undefined): Set<string> {\n return new Set(\n (values ?? [])\n .map((value) => value.trim().toLowerCase())\n .filter((value) => value.length > 0),\n );\n}\n\nfunction normalizePolicySurfaceToken(value: string): string {\n const normalized = value.trim().toLowerCase();\n if (normalized.length === 0) {\n return \"\";\n }\n const segments = normalized\n .split(/[.:/]/)\n .map((segment) => segment.replace(/[\\s_-]+/g, \"\"))\n .filter((segment) => segment.length > 0);\n if (segments.length === 0) {\n return \"\";\n }\n if (segments.length === 1) {\n return segments[0];\n }\n return `${segments[0]}.${segments.slice(1).join(\"\")}`;\n}\n\nfunction normalizePolicySurfaceSet(values: readonly string[] | undefined): Set<string> {\n return new Set(\n (values ?? [])\n .map((value) => normalizePolicySurfaceToken(value))\n .filter((value) => value.length > 0),\n );\n}\n\nfunction normalizePolicyMode(value: string | undefined): ExtensionPolicyMode {\n const normalized = normalizePolicyName(value);\n if ((KNOWN_EXTENSION_POLICY_MODES as readonly string[]).includes(normalized)) {\n return normalized as ExtensionPolicyMode;\n }\n return \"off\";\n}\n\nfunction normalizePolicyTrustMode(value: string | undefined): ExtensionTrustMode {\n const normalized = normalizePolicyName(value);\n if ((KNOWN_EXTENSION_TRUST_MODES as readonly string[]).includes(normalized)) {\n return normalized as ExtensionTrustMode;\n }\n return \"off\";\n}\n\nexport function normalizePolicySandboxProfile(value: string | undefined): ExtensionSandboxProfile {\n const normalized = normalizePolicyName(value);\n if ((KNOWN_EXTENSION_SANDBOX_PROFILES as readonly string[]).includes(normalized)) {\n return normalized as ExtensionSandboxProfile;\n }\n return \"none\";\n}\n\nfunction toSortedList(values: Iterable<string>): string[] {\n return [...new Set(values)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildExtensionPolicyOverride(\n rawOverride: ExtensionPolicyOverride,\n): { name: string; normalized: NormalizedExtensionPolicyOverride } | null {\n const name = normalizePolicyName(rawOverride.name);\n if (name.length === 0) {\n return null;\n }\n return {\n name,\n normalized: {\n name,\n disabled: rawOverride.disabled === true,\n requireTrusted: rawOverride.require_trusted === true,\n requireProvenance: rawOverride.require_provenance === true,\n sandboxProfile:\n rawOverride.sandbox_profile !== undefined\n ? normalizePolicySandboxProfile(rawOverride.sandbox_profile)\n : undefined,\n allowedCapabilities: normalizePolicyStringSet(rawOverride.allowed_capabilities),\n blockedCapabilities: normalizePolicyStringSet(rawOverride.blocked_capabilities),\n allowedSurfaces: normalizePolicySurfaceSet(rawOverride.allowed_surfaces),\n blockedSurfaces: normalizePolicySurfaceSet(rawOverride.blocked_surfaces),\n allowedCommands: normalizePolicyStringSet(rawOverride.allowed_commands),\n blockedCommands: normalizePolicyStringSet(rawOverride.blocked_commands),\n allowedActions: normalizePolicyStringSet(rawOverride.allowed_actions),\n blockedActions: normalizePolicyStringSet(rawOverride.blocked_actions),\n allowedServices: normalizePolicyStringSet(rawOverride.allowed_services),\n blockedServices: normalizePolicyStringSet(rawOverride.blocked_services),\n },\n };\n}\n\nfunction collectExtensionPolicyOverrides(\n rawOverrides: readonly ExtensionPolicyOverride[] | undefined,\n): Map<string, NormalizedExtensionPolicyOverride> {\n const overridesByName = new Map<string, NormalizedExtensionPolicyOverride>();\n for (const rawOverride of rawOverrides ?? []) {\n const built = buildExtensionPolicyOverride(rawOverride);\n if (built) {\n overridesByName.set(built.name, built.normalized);\n }\n }\n return overridesByName;\n}\n\nexport function normalizeExtensionPolicy(settings: PmSettings): NormalizedExtensionPolicy {\n const policy = settings.extensions.policy;\n const mode = normalizePolicyMode(policy?.mode);\n const trustMode = normalizePolicyTrustMode(policy?.trust_mode);\n const requireProvenance = policy?.require_provenance === true;\n const trustedExtensions = normalizePolicyStringSet(policy?.trusted_extensions);\n const defaultSandboxProfile = normalizePolicySandboxProfile(policy?.default_sandbox_profile);\n const allowedExtensions = normalizePolicyStringSet(policy?.allowed_extensions);\n const blockedExtensions = normalizePolicyStringSet(policy?.blocked_extensions);\n const allowedCapabilities = normalizePolicyStringSet(policy?.allowed_capabilities);\n const blockedCapabilities = normalizePolicyStringSet(policy?.blocked_capabilities);\n const allowedSurfaces = normalizePolicySurfaceSet(policy?.allowed_surfaces);\n const blockedSurfaces = normalizePolicySurfaceSet(policy?.blocked_surfaces);\n const allowedCommands = normalizePolicyStringSet(policy?.allowed_commands);\n const blockedCommands = normalizePolicyStringSet(policy?.blocked_commands);\n const allowedActions = normalizePolicyStringSet(policy?.allowed_actions);\n const blockedActions = normalizePolicyStringSet(policy?.blocked_actions);\n const allowedServices = normalizePolicyStringSet(policy?.allowed_services);\n const blockedServices = normalizePolicyStringSet(policy?.blocked_services);\n const overridesByName = collectExtensionPolicyOverrides(policy?.extension_overrides);\n\n const warnings: string[] = [];\n for (const capability of toSortedList([...allowedCapabilities, ...blockedCapabilities])) {\n if (!isKnownExtensionCapability(capability)) {\n warnings.push(`extension_policy_unknown_capability:${capability}`);\n }\n }\n for (const override of [...overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name))) {\n for (const capability of toSortedList([...override.allowedCapabilities, ...override.blockedCapabilities])) {\n if (!isKnownExtensionCapability(capability)) {\n warnings.push(`extension_policy_unknown_capability:${override.name}:${capability}`);\n }\n }\n }\n const knownSurfaces = new Set<string>(KNOWN_EXTENSION_POLICY_SURFACES);\n for (const surface of toSortedList([...allowedSurfaces, ...blockedSurfaces])) {\n if (!knownSurfaces.has(surface)) {\n warnings.push(`extension_policy_unknown_surface:${surface}`);\n }\n }\n for (const override of [...overridesByName.values()].sort((left, right) => left.name.localeCompare(right.name))) {\n for (const surface of toSortedList([...override.allowedSurfaces, ...override.blockedSurfaces])) {\n if (!knownSurfaces.has(surface)) {\n warnings.push(`extension_policy_unknown_surface:${override.name}:${surface}`);\n }\n }\n }\n\n return {\n mode,\n trustMode,\n requireProvenance,\n trustedExtensions,\n defaultSandboxProfile,\n allowedExtensions,\n blockedExtensions,\n allowedCapabilities,\n blockedCapabilities,\n allowedSurfaces,\n blockedSurfaces,\n allowedCommands,\n blockedCommands,\n allowedActions,\n blockedActions,\n allowedServices,\n blockedServices,\n overridesByName,\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n };\n}\n\nexport function serializeExtensionPolicy(policy: NormalizedExtensionPolicy): ExtensionGovernancePolicy {\n const overrides = [...policy.overridesByName.values()]\n .sort((left, right) => left.name.localeCompare(right.name))\n .map((override) => ({\n name: override.name,\n ...(override.disabled ? { disabled: true } : {}),\n ...(override.requireTrusted ? { require_trusted: true } : {}),\n ...(override.requireProvenance ? { require_provenance: true } : {}),\n ...(override.sandboxProfile ? { sandbox_profile: override.sandboxProfile } : {}),\n ...(override.allowedCapabilities.size > 0 ? { allowed_capabilities: toSortedList(override.allowedCapabilities) } : {}),\n ...(override.blockedCapabilities.size > 0 ? { blocked_capabilities: toSortedList(override.blockedCapabilities) } : {}),\n ...(override.allowedSurfaces.size > 0 ? { allowed_surfaces: toSortedList(override.allowedSurfaces) } : {}),\n ...(override.blockedSurfaces.size > 0 ? { blocked_surfaces: toSortedList(override.blockedSurfaces) } : {}),\n ...(override.allowedCommands.size > 0 ? { allowed_commands: toSortedList(override.allowedCommands) } : {}),\n ...(override.blockedCommands.size > 0 ? { blocked_commands: toSortedList(override.blockedCommands) } : {}),\n ...(override.allowedActions.size > 0 ? { allowed_actions: toSortedList(override.allowedActions) } : {}),\n ...(override.blockedActions.size > 0 ? { blocked_actions: toSortedList(override.blockedActions) } : {}),\n ...(override.allowedServices.size > 0 ? { allowed_services: toSortedList(override.allowedServices) } : {}),\n ...(override.blockedServices.size > 0 ? { blocked_services: toSortedList(override.blockedServices) } : {}),\n }));\n return {\n mode: policy.mode,\n trust_mode: policy.trustMode,\n require_provenance: policy.requireProvenance,\n trusted_extensions: toSortedList(policy.trustedExtensions),\n default_sandbox_profile: policy.defaultSandboxProfile,\n allowed_extensions: toSortedList(policy.allowedExtensions),\n blocked_extensions: toSortedList(policy.blockedExtensions),\n allowed_capabilities: toSortedList(policy.allowedCapabilities),\n blocked_capabilities: toSortedList(policy.blockedCapabilities),\n allowed_surfaces: toSortedList(policy.allowedSurfaces),\n blocked_surfaces: toSortedList(policy.blockedSurfaces),\n allowed_commands: toSortedList(policy.allowedCommands),\n blocked_commands: toSortedList(policy.blockedCommands),\n allowed_actions: toSortedList(policy.allowedActions),\n blocked_actions: toSortedList(policy.blockedActions),\n allowed_services: toSortedList(policy.allowedServices),\n blocked_services: toSortedList(policy.blockedServices),\n extension_overrides: overrides,\n };\n}\n\nexport function hydrateExtensionPolicy(policy: ExtensionGovernancePolicy): NormalizedExtensionPolicy {\n const overridesByName = collectExtensionPolicyOverrides(policy.extension_overrides);\n return {\n mode: normalizePolicyMode(policy.mode),\n trustMode: normalizePolicyTrustMode(policy.trust_mode),\n requireProvenance: policy.require_provenance === true,\n trustedExtensions: normalizePolicyStringSet(policy.trusted_extensions),\n defaultSandboxProfile: normalizePolicySandboxProfile(policy.default_sandbox_profile),\n allowedExtensions: normalizePolicyStringSet(policy.allowed_extensions),\n blockedExtensions: normalizePolicyStringSet(policy.blocked_extensions),\n allowedCapabilities: normalizePolicyStringSet(policy.allowed_capabilities),\n blockedCapabilities: normalizePolicyStringSet(policy.blocked_capabilities),\n allowedSurfaces: normalizePolicySurfaceSet(policy.allowed_surfaces),\n blockedSurfaces: normalizePolicySurfaceSet(policy.blocked_surfaces),\n allowedCommands: normalizePolicyStringSet(policy.allowed_commands),\n blockedCommands: normalizePolicyStringSet(policy.blocked_commands),\n allowedActions: normalizePolicyStringSet(policy.allowed_actions),\n blockedActions: normalizePolicyStringSet(policy.blocked_actions),\n allowedServices: normalizePolicyStringSet(policy.allowed_services),\n blockedServices: normalizePolicyStringSet(policy.blocked_services),\n overridesByName,\n warnings: [],\n };\n}\n\nfunction resolvePolicyOverride(\n policy: NormalizedExtensionPolicy,\n extensionName: string,\n): NormalizedExtensionPolicyOverride | null {\n return policy.overridesByName.get(normalizePolicyName(extensionName)) ?? null;\n}\n\nfunction evaluatePolicySet(\n allowed: Set<string>,\n blocked: Set<string>,\n value: string,\n notAllowlistedReason: string,\n blockedReason: string,\n): string | null {\n if (blocked.has(value)) {\n return blockedReason;\n }\n if (allowed.size > 0 && !allowed.has(value)) {\n return notAllowlistedReason;\n }\n return null;\n}\n\nfunction resolvePolicyCapabilityReason(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n capability: string,\n): string | null {\n const normalizedCapability = capability.trim().toLowerCase();\n const override = resolvePolicyOverride(policy, extension.name);\n const allowed = override && override.allowedCapabilities.size > 0 ? override.allowedCapabilities : policy.allowedCapabilities;\n const blocked = new Set<string>([\n ...policy.blockedCapabilities,\n ...(override ? override.blockedCapabilities : []),\n ]);\n return evaluatePolicySet(\n allowed,\n blocked,\n normalizedCapability,\n \"capability_not_allowlisted\",\n \"capability_blocked\",\n );\n}\n\nfunction resolvePolicySurfaceReason(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n surface: ExtensionPolicySurface,\n): string | null {\n const override = resolvePolicyOverride(policy, extension.name);\n const allowed = override && override.allowedSurfaces.size > 0 ? override.allowedSurfaces : policy.allowedSurfaces;\n const blocked = new Set<string>([\n ...policy.blockedSurfaces,\n ...(override ? override.blockedSurfaces : []),\n ]);\n return evaluatePolicySet(allowed, blocked, surface, \"surface_not_allowlisted\", \"surface_blocked\");\n}\n\nfunction resolvePolicyCommandReason(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n command: string,\n): string | null {\n const normalizedCommand = normalizeCommandName(command);\n if (normalizedCommand.length === 0) {\n return null;\n }\n const override = resolvePolicyOverride(policy, extension.name);\n const allowed = override && override.allowedCommands.size > 0 ? override.allowedCommands : policy.allowedCommands;\n const blocked = new Set<string>([\n ...policy.blockedCommands,\n ...(override ? override.blockedCommands : []),\n ]);\n return evaluatePolicySet(allowed, blocked, normalizedCommand, \"command_not_allowlisted\", \"command_blocked\");\n}\n\nfunction resolvePolicyActionReason(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n action: string,\n): string | null {\n const normalizedAction = normalizePolicyName(action).replace(/\\s+/g, \"-\");\n if (normalizedAction.length === 0) {\n return null;\n }\n const override = resolvePolicyOverride(policy, extension.name);\n const allowed = override && override.allowedActions.size > 0 ? override.allowedActions : policy.allowedActions;\n const blocked = new Set<string>([\n ...policy.blockedActions,\n ...(override ? override.blockedActions : []),\n ]);\n return evaluatePolicySet(allowed, blocked, normalizedAction, \"action_not_allowlisted\", \"action_blocked\");\n}\n\nfunction resolvePolicyServiceReason(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n service: string,\n): string | null {\n const normalizedService = normalizePolicyName(service);\n if (normalizedService.length === 0) {\n return null;\n }\n const override = resolvePolicyOverride(policy, extension.name);\n const allowed = override && override.allowedServices.size > 0 ? override.allowedServices : policy.allowedServices;\n const blocked = new Set<string>([\n ...policy.blockedServices,\n ...(override ? override.blockedServices : []),\n ]);\n return evaluatePolicySet(allowed, blocked, normalizedService, \"service_not_allowlisted\", \"service_blocked\");\n}\n\nfunction resolvePolicyExtensionReason(policy: NormalizedExtensionPolicy, extension: PolicyExtensionRef): string | null {\n const name = normalizePolicyName(extension.name);\n const override = resolvePolicyOverride(policy, extension.name);\n if (override?.disabled === true) {\n return \"extension_override_disabled\";\n }\n return evaluatePolicySet(\n policy.allowedExtensions,\n policy.blockedExtensions,\n name,\n \"extension_not_allowlisted\",\n \"extension_blocked\",\n );\n}\n\nfunction resolvePolicyTrustReason(policy: NormalizedExtensionPolicy, extension: PolicyExtensionRef): string | null {\n if (policy.trustMode === \"off\") {\n return null;\n }\n const override = resolvePolicyOverride(policy, extension.name);\n const name = normalizePolicyName(extension.name);\n const trusted = extension.trusted === true;\n const provenanceVerified = extension.provenanceVerified === true;\n\n if (policy.trustedExtensions.size > 0 && !policy.trustedExtensions.has(name)) {\n return \"extension_not_trusted\";\n }\n if ((override?.requireTrusted === true || policy.trustMode === \"warn\" || policy.trustMode === \"enforce\") && !trusted) {\n return \"extension_untrusted\";\n }\n if ((policy.requireProvenance || override?.requireProvenance === true) && !provenanceVerified) {\n return \"provenance_missing_or_unverified\";\n }\n return null;\n}\n\nfunction resolvePolicySandboxReason(policy: NormalizedExtensionPolicy, extension: PolicyExtensionRef): string | null {\n if (policy.mode === \"off\") {\n return null;\n }\n const override = resolvePolicyOverride(policy, extension.name);\n const profile = override?.sandboxProfile ?? extension.sandboxProfile ?? policy.defaultSandboxProfile;\n if (profile === \"none\") {\n return null;\n }\n const permissions = extension.permissions;\n if (!permissions) {\n return \"sandbox_permissions_missing\";\n }\n\n const hasPermission = (name: keyof typeof permissions): boolean => permissions[name] === true;\n if (profile === \"restricted\") {\n if (hasPermission(\"process_spawn\")) {\n return \"sandbox_restricted_disallows_process_spawn\";\n }\n if (hasPermission(\"env_write\")) {\n return \"sandbox_restricted_disallows_env_write\";\n }\n return null;\n }\n\n if (profile === \"strict\") {\n if (hasPermission(\"process_spawn\")) {\n return \"sandbox_strict_disallows_process_spawn\";\n }\n if (hasPermission(\"network\")) {\n return \"sandbox_strict_disallows_network\";\n }\n if (hasPermission(\"fs_write\")) {\n return \"sandbox_strict_disallows_fs_write\";\n }\n if (hasPermission(\"env_write\")) {\n return \"sandbox_strict_disallows_env_write\";\n }\n }\n return null;\n}\n\nfunction buildPolicyWarning(\n mode: \"blocked\" | \"violation\",\n scope: \"extension\" | \"capability\" | \"registration\" | \"trust\",\n extension: PolicyExtensionRef,\n reason: string,\n details: Record<string, string> = {},\n): string {\n const tokens = Object.entries(details)\n .sort((left, right) => left[0].localeCompare(right[0]))\n .map(([key, value]) => `${key}=${value}`)\n .join(\":\");\n const suffix = tokens.length > 0 ? `:${tokens}` : \"\";\n return `extension_policy_${mode}_${scope}:${extension.layer}:${extension.name}:reason=${reason}${suffix}`;\n}\n\nexport function evaluateExtensionPolicyForExtension(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n): { allowed: boolean; warning: string | null } {\n if (policy.mode === \"off\" && policy.trustMode === \"off\") {\n return { allowed: true, warning: null };\n }\n const reason = resolvePolicyExtensionReason(policy, extension);\n const trustReason = resolvePolicyTrustReason(policy, extension);\n const sandboxReason = resolvePolicySandboxReason(policy, extension);\n const extensionEnforced = reason && policy.mode === \"enforce\";\n const trustEnforced = trustReason && policy.trustMode === \"enforce\";\n const sandboxEnforced = sandboxReason && policy.mode === \"enforce\";\n if (!reason && !trustReason && !sandboxReason) {\n return { allowed: true, warning: null };\n }\n if (extensionEnforced) {\n return {\n allowed: false,\n warning: buildPolicyWarning(\"blocked\", \"extension\", extension, reason),\n };\n }\n if (trustEnforced) {\n return {\n allowed: false,\n warning: buildPolicyWarning(\"blocked\", \"trust\", extension, trustReason),\n };\n }\n if (sandboxEnforced) {\n return {\n allowed: false,\n warning: buildPolicyWarning(\"blocked\", \"extension\", extension, sandboxReason),\n };\n }\n if (reason && policy.mode === \"warn\") {\n return {\n allowed: true,\n warning: buildPolicyWarning(\"violation\", \"extension\", extension, reason),\n };\n }\n if (trustReason && policy.trustMode === \"warn\") {\n return {\n allowed: true,\n warning: buildPolicyWarning(\"violation\", \"trust\", extension, trustReason),\n };\n }\n if (sandboxReason && policy.mode === \"warn\") {\n return {\n allowed: true,\n warning: buildPolicyWarning(\"violation\", \"extension\", extension, sandboxReason),\n };\n }\n return {\n allowed: true,\n warning: null,\n };\n}\n\nexport function evaluateExtensionPolicyForCapability(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n capability: string,\n): { allowed: boolean; warning: string | null } {\n if (policy.mode === \"off\") {\n return { allowed: true, warning: null };\n }\n const reason = resolvePolicyCapabilityReason(policy, extension, capability);\n if (!reason) {\n return { allowed: true, warning: null };\n }\n return {\n allowed: policy.mode === \"warn\",\n warning: buildPolicyWarning(\n policy.mode === \"warn\" ? \"violation\" : \"blocked\",\n \"capability\",\n extension,\n reason,\n { capability: capability.trim().toLowerCase() },\n ),\n };\n}\n\nexport function evaluateExtensionPolicyForRegistration(\n policy: NormalizedExtensionPolicy,\n extension: PolicyExtensionRef,\n surface: ExtensionPolicySurface,\n method: string,\n capability?: ExtensionCapability,\n details?: {\n command?: string;\n action?: string;\n service?: string;\n },\n): { allowed: boolean; warning: string | null } {\n if (policy.mode === \"off\") {\n return { allowed: true, warning: null };\n }\n const capabilityReason =\n typeof capability === \"string\" ? resolvePolicyCapabilityReason(policy, extension, capability) : null;\n const surfaceReason = resolvePolicySurfaceReason(policy, extension, surface);\n const commandReason = details?.command ? resolvePolicyCommandReason(policy, extension, details.command) : null;\n const actionReason = details?.action ? resolvePolicyActionReason(policy, extension, details.action) : null;\n const serviceReason = details?.service ? resolvePolicyServiceReason(policy, extension, details.service) : null;\n const reason = capabilityReason ?? surfaceReason ?? commandReason ?? actionReason ?? serviceReason;\n if (!reason) {\n return { allowed: true, warning: null };\n }\n const warningDetails: Record<string, string> = {\n method: normalizePolicyName(method).replace(/\\s+/g, \"_\"),\n surface,\n };\n if (capability) {\n warningDetails.capability = capability;\n }\n if (details?.command) {\n warningDetails.command = normalizeCommandName(details.command);\n }\n if (details?.action) {\n warningDetails.action = normalizePolicyName(details.action).replace(/\\s+/g, \"-\");\n }\n if (details?.service) {\n warningDetails.service = normalizePolicyName(details.service);\n }\n const warning = buildPolicyWarning(\n policy.mode === \"warn\" ? \"violation\" : \"blocked\",\n \"registration\",\n extension,\n reason,\n warningDetails,\n );\n return {\n allowed: policy.mode === \"warn\",\n warning,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,GAS5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAoDtE,SAAS,mBAAmB,CAAC,KAAyB;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpC,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAqC;IACrE,OAAO,IAAI,GAAG,CACZ,CAAC,MAAM,IAAI,EAAE,CAAC;SACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAC1C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CACvC,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAa;IAChD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,QAAQ,GAAG,UAAU;SACxB,KAAK,CAAC,OAAO,CAAC;SACd,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,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AkB,CAChC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAChD,cAAc,EACd,SAAS,EACT,MAAM,EACN,cAAc,CACf,CAAC;IACF,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,MAAM;QAC/B,OAAO;KACR,CAAC;AACJ,CAAC","debugId":"3a8acf74-cc81-5417-8ee9-30d80fde2102"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ExtensionHookRegistry, ExtensionCommandRegistry, ExtensionParserRegistry, ExtensionPreflightRegistry, ExtensionServiceRegistry, ExtensionRendererRegistry, ExtensionRegistrationRegistry } from "./extension-types.js";
|
|
2
|
+
export declare function createEmptyExtensionHookRegistry(): ExtensionHookRegistry;
|
|
3
|
+
export declare function createEmptyExtensionCommandRegistry(): ExtensionCommandRegistry;
|
|
4
|
+
export declare function createEmptyExtensionParserRegistry(): ExtensionParserRegistry;
|
|
5
|
+
export declare function createEmptyExtensionPreflightRegistry(): ExtensionPreflightRegistry;
|
|
6
|
+
export declare function createEmptyExtensionServiceRegistry(): ExtensionServiceRegistry;
|
|
7
|
+
export declare function createEmptyExtensionRendererRegistry(): ExtensionRendererRegistry;
|
|
8
|
+
export declare function createEmptyExtensionRegistrationRegistry(): ExtensionRegistrationRegistry;
|
|
@@ -0,0 +1,52 @@
|
|
|
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]="8789ac45-d04d-5d1b-984a-cf5159fc01ba")}catch(e){}}();
|
|
3
|
+
export function createEmptyExtensionHookRegistry() {
|
|
4
|
+
return {
|
|
5
|
+
beforeCommand: [],
|
|
6
|
+
afterCommand: [],
|
|
7
|
+
onWrite: [],
|
|
8
|
+
onRead: [],
|
|
9
|
+
onIndex: [],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function createEmptyExtensionCommandRegistry() {
|
|
13
|
+
return {
|
|
14
|
+
overrides: [],
|
|
15
|
+
handlers: [],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function createEmptyExtensionParserRegistry() {
|
|
19
|
+
return {
|
|
20
|
+
overrides: [],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function createEmptyExtensionPreflightRegistry() {
|
|
24
|
+
return {
|
|
25
|
+
overrides: [],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function createEmptyExtensionServiceRegistry() {
|
|
29
|
+
return {
|
|
30
|
+
overrides: [],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function createEmptyExtensionRendererRegistry() {
|
|
34
|
+
return {
|
|
35
|
+
overrides: [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function createEmptyExtensionRegistrationRegistry() {
|
|
39
|
+
return {
|
|
40
|
+
commands: [],
|
|
41
|
+
flags: [],
|
|
42
|
+
item_fields: [],
|
|
43
|
+
item_types: [],
|
|
44
|
+
migrations: [],
|
|
45
|
+
importers: [],
|
|
46
|
+
exporters: [],
|
|
47
|
+
search_providers: [],
|
|
48
|
+
vector_store_adapters: [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=extension-registries.js.map
|
|
52
|
+
//# debugId=8789ac45-d04d-5d1b-984a-cf5159fc01ba
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-registries.js","sources":["core/extensions/extension-registries.ts"],"sourceRoot":"/","sourcesContent":["import type {\n ExtensionHookRegistry,\n ExtensionCommandRegistry,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionServiceRegistry,\n ExtensionRendererRegistry,\n ExtensionRegistrationRegistry,\n} from \"./extension-types.js\";\n\nexport function createEmptyExtensionHookRegistry(): ExtensionHookRegistry {\n return {\n beforeCommand: [],\n afterCommand: [],\n onWrite: [],\n onRead: [],\n onIndex: [],\n };\n}\n\nexport function createEmptyExtensionCommandRegistry(): ExtensionCommandRegistry {\n return {\n overrides: [],\n handlers: [],\n };\n}\n\nexport function createEmptyExtensionParserRegistry(): ExtensionParserRegistry {\n return {\n overrides: [],\n };\n}\n\nexport function createEmptyExtensionPreflightRegistry(): ExtensionPreflightRegistry {\n return {\n overrides: [],\n };\n}\n\nexport function createEmptyExtensionServiceRegistry(): ExtensionServiceRegistry {\n return {\n overrides: [],\n };\n}\n\nexport function createEmptyExtensionRendererRegistry(): ExtensionRendererRegistry {\n return {\n overrides: [],\n };\n}\n\nexport function createEmptyExtensionRegistrationRegistry(): ExtensionRegistrationRegistry {\n return {\n commands: [],\n flags: [],\n item_fields: [],\n item_types: [],\n migrations: [],\n importers: [],\n exporters: [],\n search_providers: [],\n vector_store_adapters: [],\n };\n}\n"],"names":[],"mappings":";;AAUA,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mCAAmC;IACjD,OAAO;QACL,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC;IAChD,OAAO;QACL,SAAS,EAAE,EAAE;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qCAAqC;IACnD,OAAO;QACL,SAAS,EAAE,EAAE;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mCAAmC;IACjD,OAAO;QACL,SAAS,EAAE,EAAE;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC;IAClD,OAAO;QACL,SAAS,EAAE,EAAE;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wCAAwC;IACtD,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,gBAAgB,EAAE,EAAE;QACpB,qBAAqB,EAAE,EAAE;KAC1B,CAAC;AACJ,CAAC","debugId":"8789ac45-d04d-5d1b-984a-cf5159fc01ba"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { GlobalOptions } from "../shared/command-types.js";
|
|
2
|
+
export declare function normalizeCommandName(command: string): string;
|
|
3
|
+
export declare function defaultGlobalOptions(): GlobalOptions;
|
|
4
|
+
export declare function cloneCommandOptionsSnapshot(options: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
5
|
+
export declare function cloneGlobalOptionsSnapshot(options: GlobalOptions | undefined): GlobalOptions;
|
|
6
|
+
export declare function cloneContextSnapshot<T>(value: T): T;
|
|
@@ -0,0 +1,29 @@
|
|
|
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]="c6de469b-25b5-5a67-be13-398277b156c4")}catch(e){}}();
|
|
3
|
+
export function normalizeCommandName(command) {
|
|
4
|
+
return command
|
|
5
|
+
.trim()
|
|
6
|
+
.toLowerCase()
|
|
7
|
+
.split(/\s+/)
|
|
8
|
+
.filter((part) => part.length > 0)
|
|
9
|
+
.join(" ");
|
|
10
|
+
}
|
|
11
|
+
export function defaultGlobalOptions() {
|
|
12
|
+
return {
|
|
13
|
+
json: false,
|
|
14
|
+
quiet: false,
|
|
15
|
+
noExtensions: false,
|
|
16
|
+
profile: false,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function cloneCommandOptionsSnapshot(options) {
|
|
20
|
+
return options ? cloneContextSnapshot(options) : {};
|
|
21
|
+
}
|
|
22
|
+
export function cloneGlobalOptionsSnapshot(options) {
|
|
23
|
+
return options ? cloneContextSnapshot(options) : defaultGlobalOptions();
|
|
24
|
+
}
|
|
25
|
+
export function cloneContextSnapshot(value) {
|
|
26
|
+
return structuredClone(value);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=extension-runtime-helpers.js.map
|
|
29
|
+
//# debugId=c6de469b-25b5-5a67-be13-398277b156c4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-runtime-helpers.js","sources":["core/extensions/extension-runtime-helpers.ts"],"sourceRoot":"/","sourcesContent":["import type { GlobalOptions } from \"../shared/command-types.js\";\n\nexport function normalizeCommandName(command: string): string {\n return command\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nexport function defaultGlobalOptions(): GlobalOptions {\n return {\n json: false,\n quiet: false,\n noExtensions: false,\n profile: false,\n };\n}\n\nexport function cloneCommandOptionsSnapshot(options: Record<string, unknown> | undefined): Record<string, unknown> {\n return options ? cloneContextSnapshot(options) : {};\n}\n\nexport function cloneGlobalOptionsSnapshot(options: GlobalOptions | undefined): GlobalOptions {\n return options ? cloneContextSnapshot(options) : defaultGlobalOptions();\n}\n\nexport function cloneContextSnapshot<T>(value: T): T {\n return structuredClone(value);\n}\n"],"names":[],"mappings":";;AAEA,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,OAAO;SACX,IAAI,EAAE;SACN,WAAW,EAAE;SACb,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,KAAK;QACnB,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,OAA4C;IACtF,OAAO,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAkC;IAC3E,OAAO,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAI,KAAQ;IAC9C,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC","debugId":"c6de469b-25b5-5a67-be13-398277b156c4"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ItemDocument, PmSettings } from "../../types/index.js";
|
|
1
|
+
import type { ExtensionPolicyOverrideSettings, ExtensionPolicySettings, ItemDocument, PmSettings } from "../../types/index.js";
|
|
2
2
|
import type { GlobalOptions } from "../shared/command-types.js";
|
|
3
3
|
export declare const KNOWN_EXTENSION_CAPABILITIES: readonly ["commands", "renderers", "hooks", "schema", "importers", "search", "parser", "preflight", "services"];
|
|
4
4
|
export type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];
|
|
@@ -19,6 +19,8 @@ export declare const KNOWN_EXTENSION_SANDBOX_PROFILES: readonly ["none", "restri
|
|
|
19
19
|
export type ExtensionSandboxProfile = (typeof KNOWN_EXTENSION_SANDBOX_PROFILES)[number];
|
|
20
20
|
export declare const KNOWN_EXTENSION_POLICY_SURFACES: readonly ["commands.override", "commands.handler", "hooks.beforecommand", "hooks.aftercommand", "hooks.onwrite", "hooks.onread", "hooks.onindex", "schema.flags", "schema.itemfields", "schema.itemtypes", "schema.migrations", "parser.override", "preflight.override", "services.override", "renderers.override", "importers.importer", "importers.exporter", "search.provider", "search.vectorstore"];
|
|
21
21
|
export type ExtensionPolicySurface = (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];
|
|
22
|
+
export declare const KNOWN_EXTENSION_SERVICE_NAMES: readonly ["output_format", "error_format", "help_format", "lock_acquire", "lock_release", "history_append", "item_store_write", "item_store_delete"];
|
|
23
|
+
export type ExtensionServiceName = (typeof KNOWN_EXTENSION_SERVICE_NAMES)[number];
|
|
22
24
|
export interface ExtensionProvenanceMetadata {
|
|
23
25
|
source?: string;
|
|
24
26
|
signature?: string;
|
|
@@ -33,43 +35,9 @@ export interface ExtensionRuntimePermissionDeclaration {
|
|
|
33
35
|
env_write?: boolean;
|
|
34
36
|
process_spawn?: boolean;
|
|
35
37
|
}
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
require_trusted?: boolean;
|
|
40
|
-
require_provenance?: boolean;
|
|
41
|
-
sandbox_profile?: ExtensionSandboxProfile;
|
|
42
|
-
allowed_capabilities?: string[];
|
|
43
|
-
blocked_capabilities?: string[];
|
|
44
|
-
allowed_surfaces?: string[];
|
|
45
|
-
blocked_surfaces?: string[];
|
|
46
|
-
allowed_commands?: string[];
|
|
47
|
-
blocked_commands?: string[];
|
|
48
|
-
allowed_actions?: string[];
|
|
49
|
-
blocked_actions?: string[];
|
|
50
|
-
allowed_services?: string[];
|
|
51
|
-
blocked_services?: string[];
|
|
52
|
-
}
|
|
53
|
-
export interface ExtensionGovernancePolicy {
|
|
54
|
-
mode: ExtensionPolicyMode;
|
|
55
|
-
trust_mode: ExtensionTrustMode;
|
|
56
|
-
require_provenance: boolean;
|
|
57
|
-
trusted_extensions: string[];
|
|
58
|
-
default_sandbox_profile: ExtensionSandboxProfile;
|
|
59
|
-
allowed_extensions: string[];
|
|
60
|
-
blocked_extensions: string[];
|
|
61
|
-
allowed_capabilities: string[];
|
|
62
|
-
blocked_capabilities: string[];
|
|
63
|
-
allowed_surfaces: string[];
|
|
64
|
-
blocked_surfaces: string[];
|
|
65
|
-
allowed_commands: string[];
|
|
66
|
-
blocked_commands: string[];
|
|
67
|
-
allowed_actions: string[];
|
|
68
|
-
blocked_actions: string[];
|
|
69
|
-
allowed_services: string[];
|
|
70
|
-
blocked_services: string[];
|
|
71
|
-
extension_overrides: ExtensionPolicyOverride[];
|
|
72
|
-
}
|
|
38
|
+
export type ExtensionPolicyOverride = ExtensionPolicyOverrideSettings;
|
|
39
|
+
export type ExtensionGovernancePolicy = ExtensionPolicySettings;
|
|
40
|
+
export declare function createDefaultExtensionGovernancePolicy(): ExtensionGovernancePolicy;
|
|
73
41
|
export type ExtensionLayer = "global" | "project";
|
|
74
42
|
export type ExtensionStatus = "ok" | "warn";
|
|
75
43
|
export interface ExtensionManifest {
|
|
@@ -234,7 +202,6 @@ export interface PreflightOverrideDelta extends ParserOverrideDelta {
|
|
|
234
202
|
run_extension_migrations?: boolean;
|
|
235
203
|
enforce_mandatory_migration_gate?: boolean;
|
|
236
204
|
}
|
|
237
|
-
export type ExtensionServiceName = "output_format" | "error_format" | "help_format" | "lock_acquire" | "lock_release" | "history_append" | "item_store_write" | "item_store_delete";
|
|
238
205
|
export interface ServiceOverrideContext {
|
|
239
206
|
service: ExtensionServiceName;
|
|
240
207
|
command?: string;
|
|
@@ -648,6 +615,13 @@ export interface CommandHandlerResult {
|
|
|
648
615
|
handled: boolean;
|
|
649
616
|
result: unknown;
|
|
650
617
|
warnings: string[];
|
|
618
|
+
/**
|
|
619
|
+
* Human-readable, single-line, length-bounded message describing why an
|
|
620
|
+
* extension command handler failed. Surfaced to the user/CI so the real cause
|
|
621
|
+
* (e.g. "Changelog is out of date: CHANGELOG.md") is visible instead of only
|
|
622
|
+
* the opaque `extension_command_handler_failed` warning code.
|
|
623
|
+
*/
|
|
624
|
+
errorMessage?: string;
|
|
651
625
|
}
|
|
652
626
|
export interface ParserOverrideResult {
|
|
653
627
|
overridden: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="
|
|
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]="75f1bede-2849-550d-8e31-0492def7d786")}catch(e){}}();
|
|
3
3
|
export const KNOWN_EXTENSION_CAPABILITIES = [
|
|
4
4
|
"commands",
|
|
5
5
|
"renderers",
|
|
@@ -45,5 +45,37 @@ export const KNOWN_EXTENSION_POLICY_SURFACES = [
|
|
|
45
45
|
"search.provider",
|
|
46
46
|
"search.vectorstore",
|
|
47
47
|
];
|
|
48
|
+
export const KNOWN_EXTENSION_SERVICE_NAMES = [
|
|
49
|
+
"output_format",
|
|
50
|
+
"error_format",
|
|
51
|
+
"help_format",
|
|
52
|
+
"lock_acquire",
|
|
53
|
+
"lock_release",
|
|
54
|
+
"history_append",
|
|
55
|
+
"item_store_write",
|
|
56
|
+
"item_store_delete",
|
|
57
|
+
];
|
|
58
|
+
export function createDefaultExtensionGovernancePolicy() {
|
|
59
|
+
return {
|
|
60
|
+
mode: "off",
|
|
61
|
+
trust_mode: "off",
|
|
62
|
+
require_provenance: false,
|
|
63
|
+
trusted_extensions: [],
|
|
64
|
+
default_sandbox_profile: "none",
|
|
65
|
+
allowed_extensions: [],
|
|
66
|
+
blocked_extensions: [],
|
|
67
|
+
allowed_capabilities: [],
|
|
68
|
+
blocked_capabilities: [],
|
|
69
|
+
allowed_surfaces: [],
|
|
70
|
+
blocked_surfaces: [],
|
|
71
|
+
allowed_commands: [],
|
|
72
|
+
blocked_commands: [],
|
|
73
|
+
allowed_actions: [],
|
|
74
|
+
blocked_actions: [],
|
|
75
|
+
allowed_services: [],
|
|
76
|
+
blocked_services: [],
|
|
77
|
+
extension_overrides: [],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
48
80
|
//# sourceMappingURL=extension-types.js.map
|
|
49
|
-
//# debugId=
|
|
81
|
+
//# debugId=75f1bede-2849-550d-8e31-0492def7d786
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-types.js","sources":["core/extensions/extension-types.ts"],"sourceRoot":"/","sourcesContent":["import type { ItemDocument, PmSettings } from \"../../types/index.js\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\n\nexport const KNOWN_EXTENSION_CAPABILITIES = [\n \"commands\",\n \"renderers\",\n \"hooks\",\n \"schema\",\n \"importers\",\n \"search\",\n \"parser\",\n \"preflight\",\n \"services\",\n] as const;\nexport type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];\nexport const EXTENSION_CAPABILITY_CONTRACT_VERSION = 2;\nexport const EXTENSION_CAPABILITY_LEGACY_ALIASES: Readonly<Record<string, ExtensionCapability>> = Object.freeze({\n migration: \"schema\",\n validation: \"schema\",\n});\nexport const EXTENSION_CAPABILITY_CONTRACT = Object.freeze({\n version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n capabilities: [...KNOWN_EXTENSION_CAPABILITIES],\n legacy_aliases: { ...EXTENSION_CAPABILITY_LEGACY_ALIASES },\n});\n\nexport const KNOWN_EXTENSION_POLICY_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionPolicyMode = (typeof KNOWN_EXTENSION_POLICY_MODES)[number];\nexport const KNOWN_EXTENSION_TRUST_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionTrustMode = (typeof KNOWN_EXTENSION_TRUST_MODES)[number];\nexport const KNOWN_EXTENSION_SANDBOX_PROFILES = [\"none\", \"restricted\", \"strict\"] as const;\nexport type ExtensionSandboxProfile = (typeof KNOWN_EXTENSION_SANDBOX_PROFILES)[number];\n\nexport const KNOWN_EXTENSION_POLICY_SURFACES = [\n \"commands.override\",\n \"commands.handler\",\n \"hooks.beforecommand\",\n \"hooks.aftercommand\",\n \"hooks.onwrite\",\n \"hooks.onread\",\n \"hooks.onindex\",\n \"schema.flags\",\n \"schema.itemfields\",\n \"schema.itemtypes\",\n \"schema.migrations\",\n \"parser.override\",\n \"preflight.override\",\n \"services.override\",\n \"renderers.override\",\n \"importers.importer\",\n \"importers.exporter\",\n \"search.provider\",\n \"search.vectorstore\",\n] as const;\nexport type ExtensionPolicySurface = (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];\n\nexport interface ExtensionProvenanceMetadata {\n source?: string;\n signature?: string;\n attestation?: string;\n verified?: boolean;\n}\n\nexport interface ExtensionRuntimePermissionDeclaration {\n fs_read?: boolean;\n fs_write?: boolean;\n network?: boolean;\n env_read?: boolean;\n env_write?: boolean;\n process_spawn?: boolean;\n}\n\nexport interface ExtensionPolicyOverride {\n name: string;\n disabled?: boolean;\n require_trusted?: boolean;\n require_provenance?: boolean;\n sandbox_profile?: ExtensionSandboxProfile;\n allowed_capabilities?: string[];\n blocked_capabilities?: string[];\n allowed_surfaces?: string[];\n blocked_surfaces?: string[];\n allowed_commands?: string[];\n blocked_commands?: string[];\n allowed_actions?: string[];\n blocked_actions?: string[];\n allowed_services?: string[];\n blocked_services?: string[];\n}\n\nexport interface ExtensionGovernancePolicy {\n mode: ExtensionPolicyMode;\n trust_mode: ExtensionTrustMode;\n require_provenance: boolean;\n trusted_extensions: string[];\n default_sandbox_profile: ExtensionSandboxProfile;\n allowed_extensions: string[];\n blocked_extensions: string[];\n allowed_capabilities: string[];\n blocked_capabilities: string[];\n allowed_surfaces: string[];\n blocked_surfaces: string[];\n allowed_commands: string[];\n blocked_commands: string[];\n allowed_actions: string[];\n blocked_actions: string[];\n allowed_services: string[];\n blocked_services: string[];\n extension_overrides: ExtensionPolicyOverride[];\n}\n\nexport type ExtensionLayer = \"global\" | \"project\";\nexport type ExtensionStatus = \"ok\" | \"warn\";\n\nexport interface ExtensionManifest {\n name: string;\n version: string;\n entry: string;\n priority: number;\n capabilities: string[];\n manifest_version?: number;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n legacy_capability_aliases?: LegacyExtensionCapabilityAliasMapping[];\n}\n\nexport interface ExtensionDiagnostic {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string | null;\n version: string | null;\n entry: string | null;\n priority: number | null;\n entry_path: string | null;\n enabled: boolean | null;\n status: ExtensionStatus;\n}\n\nexport interface EffectiveExtension {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string;\n version: string;\n entry: string;\n priority: number;\n entry_path: string;\n manifest_version?: number;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n capabilities?: string[];\n}\n\nexport interface ExtensionDiscoveryResult {\n disabled_by_flag: boolean;\n roots: {\n global: string;\n project: string;\n };\n configured_enabled: string[];\n configured_disabled: string[];\n discovered: ExtensionDiagnostic[];\n effective: EffectiveExtension[];\n warnings: string[];\n policy: ExtensionGovernancePolicy;\n}\n\nexport interface LoadedExtension extends EffectiveExtension {\n module: unknown;\n}\n\nexport interface FailedExtensionLoad {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n}\n\nexport interface ExtensionLoadResult extends ExtensionDiscoveryResult {\n loaded: LoadedExtension[];\n failed: FailedExtensionLoad[];\n}\n\nexport interface BeforeCommandHookContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n}\n\nexport interface AfterCommandHookContext extends BeforeCommandHookContext {\n ok: boolean;\n error?: string;\n result?: unknown;\n}\n\nexport interface OnWriteHookContext {\n path: string;\n scope: \"project\" | \"global\";\n op: string;\n}\n\nexport interface OnReadHookContext {\n path: string;\n scope: \"project\" | \"global\";\n}\n\nexport interface OnIndexHookContext {\n mode: string;\n total_items?: number;\n}\n\nexport type BeforeCommandHook = (context: BeforeCommandHookContext) => Promise<void> | void;\nexport type AfterCommandHook = (context: AfterCommandHookContext) => Promise<void> | void;\nexport type OnWriteHook = (context: OnWriteHookContext) => Promise<void> | void;\nexport type OnReadHook = (context: OnReadHookContext) => Promise<void> | void;\nexport type OnIndexHook = (context: OnIndexHookContext) => Promise<void> | void;\nexport type OutputRendererFormat = \"toon\" | \"json\";\nexport type CommandOverride = (context: CommandOverrideContext) => unknown;\nexport type RendererOverride = (context: RendererOverrideContext) => string;\nexport type CommandHandler = (context: CommandHandlerContext) => unknown;\nexport type ParserOverride = (context: ParserOverrideContext) => ParserOverrideDelta | Promise<ParserOverrideDelta>;\nexport type PreflightOverride = (context: PreflightOverrideContext) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;\nexport type ServiceOverride = (context: ServiceOverrideContext) => unknown;\n\nexport interface RegisteredExtensionHook<THook> {\n layer: ExtensionLayer;\n name: string;\n run: THook;\n}\n\nexport interface ExtensionHookRegistry {\n beforeCommand: Array<RegisteredExtensionHook<BeforeCommandHook>>;\n afterCommand: Array<RegisteredExtensionHook<AfterCommandHook>>;\n onWrite: Array<RegisteredExtensionHook<OnWriteHook>>;\n onRead: Array<RegisteredExtensionHook<OnReadHook>>;\n onIndex: Array<RegisteredExtensionHook<OnIndexHook>>;\n}\n\nexport interface CommandOverrideContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n result: unknown;\n}\n\nexport interface RendererOverrideContext {\n format: OutputRendererFormat;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n result: unknown;\n}\n\nexport interface CommandHandlerContext {\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport interface ParserOverrideContext extends CommandHandlerContext {}\n\nexport interface ParserOverrideDelta {\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n}\n\nexport interface PreflightOverrideContext extends CommandHandlerContext {\n decision: PreflightRuntimeDecision;\n}\n\nexport interface PreflightRuntimeDecision {\n enforce_item_format_gate: boolean;\n run_preflight_item_format_sync: boolean;\n run_extension_migrations: boolean;\n enforce_mandatory_migration_gate: boolean;\n}\n\nexport interface PreflightOverrideDelta extends ParserOverrideDelta {\n enforce_item_format_gate?: boolean;\n run_preflight_item_format_sync?: boolean;\n run_extension_migrations?: boolean;\n enforce_mandatory_migration_gate?: boolean;\n}\n\nexport type ExtensionServiceName =\n | \"output_format\"\n | \"error_format\"\n | \"help_format\"\n | \"lock_acquire\"\n | \"lock_release\"\n | \"history_append\"\n | \"item_store_write\"\n | \"item_store_delete\";\n\nexport interface ServiceOverrideContext {\n service: ExtensionServiceName;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n payload: unknown;\n}\n\nexport interface ExtensionCommandArgumentDefinition {\n name: string;\n required?: boolean;\n variadic?: boolean;\n description?: string;\n}\n\nexport interface CommandDefinition {\n name: string;\n run?: CommandHandler;\n /**\n * @deprecated Use `run` instead. This alias remains for backward compatibility.\n */\n handler?: CommandHandler;\n action?: string;\n description?: string;\n intent?: string;\n examples?: string[];\n failure_hints?: string[];\n arguments?: ExtensionCommandArgumentDefinition[];\n flags?: FlagDefinition[];\n}\n\nexport type FlagValueType = \"string\" | \"number\" | \"boolean\";\n\nexport interface FlagDefinition {\n long?: string;\n short?: string;\n value_name?: string;\n description?: string;\n required?: boolean;\n enabled?: boolean;\n visible?: boolean;\n type?: FlagValueType;\n value_type?: FlagValueType;\n [key: string]: unknown;\n}\n\nexport interface SchemaFieldDefinition {\n name: string;\n type: string;\n optional?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeCommandOptionPolicyDefinition {\n command: string;\n option: string;\n enabled?: boolean;\n required?: boolean;\n visible?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeOptionDefinition {\n key: string;\n values?: string[];\n required?: boolean;\n aliases?: string[];\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeDefinition {\n name: string;\n folder?: string;\n aliases?: string[];\n required_create_fields?: string[];\n required_create_repeatables?: string[];\n command_option_policies?: SchemaItemTypeCommandOptionPolicyDefinition[];\n options?: SchemaItemTypeOptionDefinition[];\n [key: string]: unknown;\n}\n\nexport interface SchemaMigrationRunContext {\n id: string;\n command: \"migration\";\n layer: ExtensionLayer;\n extension: string;\n pm_root: string;\n status: string;\n}\n\nexport type SchemaMigrationRunner = (context: SchemaMigrationRunContext) => unknown | Promise<unknown>;\n\nexport interface SchemaMigrationDefinition {\n id?: string;\n description?: string;\n status?: string;\n mandatory?: boolean;\n run?: SchemaMigrationRunner;\n [key: string]: unknown;\n}\n\nexport interface ImportExportContext {\n registration: string;\n action: \"import\" | \"export\";\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport type Importer = (context: ImportExportContext) => unknown | Promise<unknown>;\nexport type Exporter = (context: ImportExportContext) => unknown | Promise<unknown>;\n\nexport type ExtensionSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\nexport interface SearchProviderQueryContext {\n query: string;\n mode: ExtensionSearchMode;\n tokens: string[];\n options: Record<string, unknown>;\n settings: PmSettings;\n documents: ItemDocument[];\n [key: string]: unknown;\n}\n\nexport interface SearchProviderHit {\n id: string;\n score: number;\n matched_fields?: string[];\n [key: string]: unknown;\n}\n\nexport type SearchProviderQueryResult = SearchProviderHit[] | { hits?: SearchProviderHit[] };\n\nexport interface SearchProviderEmbedBatchContext {\n inputs: string[];\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderEmbedContext {\n input: string;\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderDefinition {\n name: string;\n query?: (context: SearchProviderQueryContext) => SearchProviderQueryResult | Promise<SearchProviderQueryResult>;\n embedBatch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed_batch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed?: (context: SearchProviderEmbedContext) => number[] | Promise<number[]>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryHit {\n id: string;\n score: number;\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryContext {\n vector: number[];\n limit: number;\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertPoint {\n id: string;\n vector: number[];\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertContext {\n points: VectorStoreUpsertPoint[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreDeleteContext {\n ids: string[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreAdapterDefinition {\n name: string;\n query?: (context: VectorStoreQueryContext) => VectorStoreQueryHit[] | Promise<VectorStoreQueryHit[]>;\n upsert?: (context: VectorStoreUpsertContext) => unknown | Promise<unknown>;\n delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;\n [key: string]: unknown;\n}\n\nexport interface RegisteredExtensionCommandOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandOverride;\n}\n\nexport interface RegisteredExtensionCommandHandler {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandHandler;\n}\n\nexport interface RegisteredExtensionParserOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: ParserOverride;\n}\n\nexport interface RegisteredExtensionPreflightOverride {\n layer: ExtensionLayer;\n name: string;\n run: PreflightOverride;\n}\n\nexport interface RegisteredExtensionServiceOverride {\n layer: ExtensionLayer;\n name: string;\n service: ExtensionServiceName;\n run: ServiceOverride;\n}\n\nexport interface RegisteredExtensionRendererOverride {\n layer: ExtensionLayer;\n name: string;\n format: OutputRendererFormat;\n run: RendererOverride;\n}\n\nexport interface ExtensionCommandRegistry {\n overrides: RegisteredExtensionCommandOverride[];\n handlers: RegisteredExtensionCommandHandler[];\n}\n\nexport interface ExtensionParserRegistry {\n overrides: RegisteredExtensionParserOverride[];\n}\n\nexport interface ExtensionPreflightRegistry {\n overrides: RegisteredExtensionPreflightOverride[];\n}\n\nexport interface ExtensionServiceRegistry {\n overrides: RegisteredExtensionServiceOverride[];\n}\n\nexport interface ExtensionRendererRegistry {\n overrides: RegisteredExtensionRendererOverride[];\n}\n\nexport interface RegisteredExtensionFlagDefinitions {\n layer: ExtensionLayer;\n name: string;\n target_command: string;\n flags: FlagDefinition[];\n}\n\nexport interface RegisteredExtensionCommandDefinition {\n layer: ExtensionLayer;\n name: string;\n command: string;\n action: string;\n description?: string;\n intent?: string;\n examples: string[];\n failure_hints: string[];\n arguments: ExtensionCommandArgumentDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaFieldDefinitions {\n layer: ExtensionLayer;\n name: string;\n fields: SchemaFieldDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaItemTypeDefinitions {\n layer: ExtensionLayer;\n name: string;\n types: SchemaItemTypeDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaMigrationDefinition {\n layer: ExtensionLayer;\n name: string;\n definition: SchemaMigrationDefinition;\n runtime_definition: SchemaMigrationDefinition;\n}\n\nexport interface RegisteredExtensionImporter {\n layer: ExtensionLayer;\n name: string;\n importer: string;\n}\n\nexport interface RegisteredExtensionExporter {\n layer: ExtensionLayer;\n name: string;\n exporter: string;\n}\n\nexport interface RegisteredExtensionSearchProvider {\n layer: ExtensionLayer;\n name: string;\n definition: SearchProviderDefinition;\n runtime_definition: SearchProviderDefinition;\n}\n\nexport interface RegisteredExtensionVectorStoreAdapter {\n layer: ExtensionLayer;\n name: string;\n definition: VectorStoreAdapterDefinition;\n runtime_definition: VectorStoreAdapterDefinition;\n}\n\nexport interface ExtensionRegistrationRegistry {\n commands: RegisteredExtensionCommandDefinition[];\n flags: RegisteredExtensionFlagDefinitions[];\n item_fields: RegisteredExtensionSchemaFieldDefinitions[];\n item_types: RegisteredExtensionSchemaItemTypeDefinitions[];\n migrations: RegisteredExtensionSchemaMigrationDefinition[];\n importers: RegisteredExtensionImporter[];\n exporters: RegisteredExtensionExporter[];\n search_providers: RegisteredExtensionSearchProvider[];\n vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];\n}\n\nexport interface ExtensionRegistrationCounts {\n commands: number;\n flags: number;\n item_fields: number;\n item_types: number;\n migrations: number;\n importers: number;\n exporters: number;\n search_providers: number;\n vector_store_adapters: number;\n}\n\nexport interface ExtensionApi {\n registerCommand(command: string, override: CommandOverride): void;\n registerCommand(definition: CommandDefinition): void;\n registerParser(command: string, override: ParserOverride): void;\n registerPreflight(override: PreflightOverride): void;\n registerService(service: ExtensionServiceName, override: ServiceOverride): void;\n registerFlags(targetCommand: string, flags: FlagDefinition[]): void;\n registerItemFields(fields: SchemaFieldDefinition[]): void;\n registerItemTypes(types: SchemaItemTypeDefinition[]): void;\n registerMigration(definition: SchemaMigrationDefinition): void;\n registerRenderer(format: OutputRendererFormat, renderer: RendererOverride): void;\n registerImporter(name: string, importer: Importer): void;\n registerExporter(name: string, exporter: Exporter): void;\n registerSearchProvider(provider: SearchProviderDefinition): void;\n registerVectorStoreAdapter(adapter: VectorStoreAdapterDefinition): void;\n hooks: {\n beforeCommand(hook: BeforeCommandHook): void;\n afterCommand(hook: AfterCommandHook): void;\n onWrite(hook: OnWriteHook): void;\n onRead(hook: OnReadHook): void;\n onIndex(hook: OnIndexHook): void;\n };\n}\n\nexport interface FailedExtensionActivation {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n trace?: ExtensionActivationFailureTrace;\n}\n\nexport interface ExtensionActivationFailureTrace {\n method: string;\n registration_index: number;\n command?: string;\n expected_schema: string;\n received?: unknown;\n hint?: string;\n}\n\nexport interface ExtensionActivationResult {\n hooks: ExtensionHookRegistry;\n commands: ExtensionCommandRegistry;\n parsers: ExtensionParserRegistry;\n preflight: ExtensionPreflightRegistry;\n services: ExtensionServiceRegistry;\n renderers: ExtensionRendererRegistry;\n registrations: ExtensionRegistrationRegistry;\n failed: FailedExtensionActivation[];\n warnings: string[];\n hook_counts: {\n before_command: number;\n after_command: number;\n on_write: number;\n on_read: number;\n on_index: number;\n };\n command_override_count: number;\n command_handler_count: number;\n parser_override_count: number;\n preflight_override_count: number;\n service_override_count: number;\n renderer_override_count: number;\n registration_counts: ExtensionRegistrationCounts;\n}\n\nexport interface ExtensionCandidate {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n}\n\nexport interface ExtensionLayerScanResult {\n diagnostics: ExtensionDiagnostic[];\n warnings: string[];\n candidates: ExtensionCandidate[];\n}\n\nexport interface ScannedExtensionDirectory {\n diagnostic: ExtensionDiagnostic;\n warnings: string[];\n candidate: ExtensionCandidate | null;\n}\n\nexport interface LegacyExtensionCapabilityAliasMapping {\n alias: string;\n target: ExtensionCapability;\n}\n\nexport interface DiscoverExtensionsOptions {\n pmRoot: string;\n settings: PmSettings;\n cwd?: string;\n noExtensions?: boolean;\n reload_token?: string;\n cache_bust?: boolean;\n}\n\nexport interface ActivatableExtension {\n activate: (api: ExtensionApi) => void | Promise<void>;\n}\n\nexport interface ServiceOverrideResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandOverrideResult {\n overridden: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandHandlerResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface ParserOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n warnings: string[];\n}\n\nexport interface PreflightOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n decision: PreflightRuntimeDecision;\n warnings: string[];\n}\n\nexport interface RendererOverrideResult {\n overridden: boolean;\n rendered: string | null;\n warnings: string[];\n}\n\nexport interface UnknownExtensionCapabilityWarningDetails {\n layer: ExtensionLayer;\n name: string;\n capability: string;\n allowed_capabilities: string[];\n capability_contract_version: number;\n suggested_capability?: string;\n suggestion_source?: \"legacy_alias\" | \"nearest_match\";\n legacy_alias_target?: string;\n}\n"],"names":[],"mappings":";;AAGA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,UAAU;IACV,WAAW;IACX,OAAO;IACP,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,mCAAmC,GAAkD,MAAM,CAAC,MAAM,CAAC;IAC9G,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,qCAAqC;IAC9C,YAAY,EAAE,CAAC,GAAG,4BAA4B,CAAC;IAC/C,cAAc,EAAE,EAAE,GAAG,mCAAmC,EAAE;CAC3D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAE/E,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAU,CAAC;AAG1F,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,eAAe;IACf,cAAc;IACd,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;CACZ,CAAC","debugId":"5cbc41cc-5c45-59cf-a3f5-eaa95c6baf8e"}
|
|
1
|
+
{"version":3,"file":"extension-types.js","sources":["core/extensions/extension-types.ts"],"sourceRoot":"/","sourcesContent":["import type {\n ExtensionPolicyOverrideSettings,\n ExtensionPolicySettings,\n ItemDocument,\n PmSettings,\n} from \"../../types/index.js\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\n\nexport const KNOWN_EXTENSION_CAPABILITIES = [\n \"commands\",\n \"renderers\",\n \"hooks\",\n \"schema\",\n \"importers\",\n \"search\",\n \"parser\",\n \"preflight\",\n \"services\",\n] as const;\nexport type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];\nexport const EXTENSION_CAPABILITY_CONTRACT_VERSION = 2;\nexport const EXTENSION_CAPABILITY_LEGACY_ALIASES: Readonly<Record<string, ExtensionCapability>> = Object.freeze({\n migration: \"schema\",\n validation: \"schema\",\n});\nexport const EXTENSION_CAPABILITY_CONTRACT = Object.freeze({\n version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n capabilities: [...KNOWN_EXTENSION_CAPABILITIES],\n legacy_aliases: { ...EXTENSION_CAPABILITY_LEGACY_ALIASES },\n});\n\nexport const KNOWN_EXTENSION_POLICY_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionPolicyMode = (typeof KNOWN_EXTENSION_POLICY_MODES)[number];\nexport const KNOWN_EXTENSION_TRUST_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionTrustMode = (typeof KNOWN_EXTENSION_TRUST_MODES)[number];\nexport const KNOWN_EXTENSION_SANDBOX_PROFILES = [\"none\", \"restricted\", \"strict\"] as const;\nexport type ExtensionSandboxProfile = (typeof KNOWN_EXTENSION_SANDBOX_PROFILES)[number];\n\nexport const KNOWN_EXTENSION_POLICY_SURFACES = [\n \"commands.override\",\n \"commands.handler\",\n \"hooks.beforecommand\",\n \"hooks.aftercommand\",\n \"hooks.onwrite\",\n \"hooks.onread\",\n \"hooks.onindex\",\n \"schema.flags\",\n \"schema.itemfields\",\n \"schema.itemtypes\",\n \"schema.migrations\",\n \"parser.override\",\n \"preflight.override\",\n \"services.override\",\n \"renderers.override\",\n \"importers.importer\",\n \"importers.exporter\",\n \"search.provider\",\n \"search.vectorstore\",\n] as const;\nexport type ExtensionPolicySurface = (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];\n\nexport const KNOWN_EXTENSION_SERVICE_NAMES = [\n \"output_format\",\n \"error_format\",\n \"help_format\",\n \"lock_acquire\",\n \"lock_release\",\n \"history_append\",\n \"item_store_write\",\n \"item_store_delete\",\n] as const;\nexport type ExtensionServiceName = (typeof KNOWN_EXTENSION_SERVICE_NAMES)[number];\n\nexport interface ExtensionProvenanceMetadata {\n source?: string;\n signature?: string;\n attestation?: string;\n verified?: boolean;\n}\n\nexport interface ExtensionRuntimePermissionDeclaration {\n fs_read?: boolean;\n fs_write?: boolean;\n network?: boolean;\n env_read?: boolean;\n env_write?: boolean;\n process_spawn?: boolean;\n}\n\nexport type ExtensionPolicyOverride = ExtensionPolicyOverrideSettings;\nexport type ExtensionGovernancePolicy = ExtensionPolicySettings;\n\nexport function createDefaultExtensionGovernancePolicy(): ExtensionGovernancePolicy {\n return {\n mode: \"off\",\n trust_mode: \"off\",\n require_provenance: false,\n trusted_extensions: [],\n default_sandbox_profile: \"none\",\n allowed_extensions: [],\n blocked_extensions: [],\n allowed_capabilities: [],\n blocked_capabilities: [],\n allowed_surfaces: [],\n blocked_surfaces: [],\n allowed_commands: [],\n blocked_commands: [],\n allowed_actions: [],\n blocked_actions: [],\n allowed_services: [],\n blocked_services: [],\n extension_overrides: [],\n };\n}\n\nexport type ExtensionLayer = \"global\" | \"project\";\nexport type ExtensionStatus = \"ok\" | \"warn\";\n\nexport interface ExtensionManifest {\n name: string;\n version: string;\n entry: string;\n priority: number;\n capabilities: string[];\n manifest_version?: number;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n legacy_capability_aliases?: LegacyExtensionCapabilityAliasMapping[];\n}\n\nexport interface ExtensionDiagnostic {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string | null;\n version: string | null;\n entry: string | null;\n priority: number | null;\n entry_path: string | null;\n enabled: boolean | null;\n status: ExtensionStatus;\n}\n\nexport interface EffectiveExtension {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string;\n version: string;\n entry: string;\n priority: number;\n entry_path: string;\n manifest_version?: number;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n capabilities?: string[];\n}\n\nexport interface ExtensionDiscoveryResult {\n disabled_by_flag: boolean;\n roots: {\n global: string;\n project: string;\n };\n configured_enabled: string[];\n configured_disabled: string[];\n discovered: ExtensionDiagnostic[];\n effective: EffectiveExtension[];\n warnings: string[];\n policy: ExtensionGovernancePolicy;\n}\n\nexport interface LoadedExtension extends EffectiveExtension {\n module: unknown;\n}\n\nexport interface FailedExtensionLoad {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n}\n\nexport interface ExtensionLoadResult extends ExtensionDiscoveryResult {\n loaded: LoadedExtension[];\n failed: FailedExtensionLoad[];\n}\n\nexport interface BeforeCommandHookContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n}\n\nexport interface AfterCommandHookContext extends BeforeCommandHookContext {\n ok: boolean;\n error?: string;\n result?: unknown;\n}\n\nexport interface OnWriteHookContext {\n path: string;\n scope: \"project\" | \"global\";\n op: string;\n}\n\nexport interface OnReadHookContext {\n path: string;\n scope: \"project\" | \"global\";\n}\n\nexport interface OnIndexHookContext {\n mode: string;\n total_items?: number;\n}\n\nexport type BeforeCommandHook = (context: BeforeCommandHookContext) => Promise<void> | void;\nexport type AfterCommandHook = (context: AfterCommandHookContext) => Promise<void> | void;\nexport type OnWriteHook = (context: OnWriteHookContext) => Promise<void> | void;\nexport type OnReadHook = (context: OnReadHookContext) => Promise<void> | void;\nexport type OnIndexHook = (context: OnIndexHookContext) => Promise<void> | void;\nexport type OutputRendererFormat = \"toon\" | \"json\";\nexport type CommandOverride = (context: CommandOverrideContext) => unknown;\nexport type RendererOverride = (context: RendererOverrideContext) => string;\nexport type CommandHandler = (context: CommandHandlerContext) => unknown;\nexport type ParserOverride = (context: ParserOverrideContext) => ParserOverrideDelta | Promise<ParserOverrideDelta>;\nexport type PreflightOverride = (context: PreflightOverrideContext) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;\nexport type ServiceOverride = (context: ServiceOverrideContext) => unknown;\n\nexport interface RegisteredExtensionHook<THook> {\n layer: ExtensionLayer;\n name: string;\n run: THook;\n}\n\nexport interface ExtensionHookRegistry {\n beforeCommand: Array<RegisteredExtensionHook<BeforeCommandHook>>;\n afterCommand: Array<RegisteredExtensionHook<AfterCommandHook>>;\n onWrite: Array<RegisteredExtensionHook<OnWriteHook>>;\n onRead: Array<RegisteredExtensionHook<OnReadHook>>;\n onIndex: Array<RegisteredExtensionHook<OnIndexHook>>;\n}\n\nexport interface CommandOverrideContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n result: unknown;\n}\n\nexport interface RendererOverrideContext {\n format: OutputRendererFormat;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n result: unknown;\n}\n\nexport interface CommandHandlerContext {\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport interface ParserOverrideContext extends CommandHandlerContext {}\n\nexport interface ParserOverrideDelta {\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n}\n\nexport interface PreflightOverrideContext extends CommandHandlerContext {\n decision: PreflightRuntimeDecision;\n}\n\nexport interface PreflightRuntimeDecision {\n enforce_item_format_gate: boolean;\n run_preflight_item_format_sync: boolean;\n run_extension_migrations: boolean;\n enforce_mandatory_migration_gate: boolean;\n}\n\nexport interface PreflightOverrideDelta extends ParserOverrideDelta {\n enforce_item_format_gate?: boolean;\n run_preflight_item_format_sync?: boolean;\n run_extension_migrations?: boolean;\n enforce_mandatory_migration_gate?: boolean;\n}\n\nexport interface ServiceOverrideContext {\n service: ExtensionServiceName;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n payload: unknown;\n}\n\nexport interface ExtensionCommandArgumentDefinition {\n name: string;\n required?: boolean;\n variadic?: boolean;\n description?: string;\n}\n\nexport interface CommandDefinition {\n name: string;\n run?: CommandHandler;\n /**\n * @deprecated Use `run` instead. This alias remains for backward compatibility.\n */\n handler?: CommandHandler;\n action?: string;\n description?: string;\n intent?: string;\n examples?: string[];\n failure_hints?: string[];\n arguments?: ExtensionCommandArgumentDefinition[];\n flags?: FlagDefinition[];\n}\n\nexport type FlagValueType = \"string\" | \"number\" | \"boolean\";\n\nexport interface FlagDefinition {\n long?: string;\n short?: string;\n value_name?: string;\n description?: string;\n required?: boolean;\n enabled?: boolean;\n visible?: boolean;\n type?: FlagValueType;\n value_type?: FlagValueType;\n [key: string]: unknown;\n}\n\nexport interface SchemaFieldDefinition {\n name: string;\n type: string;\n optional?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeCommandOptionPolicyDefinition {\n command: string;\n option: string;\n enabled?: boolean;\n required?: boolean;\n visible?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeOptionDefinition {\n key: string;\n values?: string[];\n required?: boolean;\n aliases?: string[];\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeDefinition {\n name: string;\n folder?: string;\n aliases?: string[];\n required_create_fields?: string[];\n required_create_repeatables?: string[];\n command_option_policies?: SchemaItemTypeCommandOptionPolicyDefinition[];\n options?: SchemaItemTypeOptionDefinition[];\n [key: string]: unknown;\n}\n\nexport interface SchemaMigrationRunContext {\n id: string;\n command: \"migration\";\n layer: ExtensionLayer;\n extension: string;\n pm_root: string;\n status: string;\n}\n\nexport type SchemaMigrationRunner = (context: SchemaMigrationRunContext) => unknown | Promise<unknown>;\n\nexport interface SchemaMigrationDefinition {\n id?: string;\n description?: string;\n status?: string;\n mandatory?: boolean;\n run?: SchemaMigrationRunner;\n [key: string]: unknown;\n}\n\nexport interface ImportExportContext {\n registration: string;\n action: \"import\" | \"export\";\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport type Importer = (context: ImportExportContext) => unknown | Promise<unknown>;\nexport type Exporter = (context: ImportExportContext) => unknown | Promise<unknown>;\n\nexport type ExtensionSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\nexport interface SearchProviderQueryContext {\n query: string;\n mode: ExtensionSearchMode;\n tokens: string[];\n options: Record<string, unknown>;\n settings: PmSettings;\n documents: ItemDocument[];\n [key: string]: unknown;\n}\n\nexport interface SearchProviderHit {\n id: string;\n score: number;\n matched_fields?: string[];\n [key: string]: unknown;\n}\n\nexport type SearchProviderQueryResult = SearchProviderHit[] | { hits?: SearchProviderHit[] };\n\nexport interface SearchProviderEmbedBatchContext {\n inputs: string[];\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderEmbedContext {\n input: string;\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderDefinition {\n name: string;\n query?: (context: SearchProviderQueryContext) => SearchProviderQueryResult | Promise<SearchProviderQueryResult>;\n embedBatch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed_batch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed?: (context: SearchProviderEmbedContext) => number[] | Promise<number[]>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryHit {\n id: string;\n score: number;\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryContext {\n vector: number[];\n limit: number;\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertPoint {\n id: string;\n vector: number[];\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertContext {\n points: VectorStoreUpsertPoint[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreDeleteContext {\n ids: string[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreAdapterDefinition {\n name: string;\n query?: (context: VectorStoreQueryContext) => VectorStoreQueryHit[] | Promise<VectorStoreQueryHit[]>;\n upsert?: (context: VectorStoreUpsertContext) => unknown | Promise<unknown>;\n delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;\n [key: string]: unknown;\n}\n\nexport interface RegisteredExtensionCommandOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandOverride;\n}\n\nexport interface RegisteredExtensionCommandHandler {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandHandler;\n}\n\nexport interface RegisteredExtensionParserOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: ParserOverride;\n}\n\nexport interface RegisteredExtensionPreflightOverride {\n layer: ExtensionLayer;\n name: string;\n run: PreflightOverride;\n}\n\nexport interface RegisteredExtensionServiceOverride {\n layer: ExtensionLayer;\n name: string;\n service: ExtensionServiceName;\n run: ServiceOverride;\n}\n\nexport interface RegisteredExtensionRendererOverride {\n layer: ExtensionLayer;\n name: string;\n format: OutputRendererFormat;\n run: RendererOverride;\n}\n\nexport interface ExtensionCommandRegistry {\n overrides: RegisteredExtensionCommandOverride[];\n handlers: RegisteredExtensionCommandHandler[];\n}\n\nexport interface ExtensionParserRegistry {\n overrides: RegisteredExtensionParserOverride[];\n}\n\nexport interface ExtensionPreflightRegistry {\n overrides: RegisteredExtensionPreflightOverride[];\n}\n\nexport interface ExtensionServiceRegistry {\n overrides: RegisteredExtensionServiceOverride[];\n}\n\nexport interface ExtensionRendererRegistry {\n overrides: RegisteredExtensionRendererOverride[];\n}\n\nexport interface RegisteredExtensionFlagDefinitions {\n layer: ExtensionLayer;\n name: string;\n target_command: string;\n flags: FlagDefinition[];\n}\n\nexport interface RegisteredExtensionCommandDefinition {\n layer: ExtensionLayer;\n name: string;\n command: string;\n action: string;\n description?: string;\n intent?: string;\n examples: string[];\n failure_hints: string[];\n arguments: ExtensionCommandArgumentDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaFieldDefinitions {\n layer: ExtensionLayer;\n name: string;\n fields: SchemaFieldDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaItemTypeDefinitions {\n layer: ExtensionLayer;\n name: string;\n types: SchemaItemTypeDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaMigrationDefinition {\n layer: ExtensionLayer;\n name: string;\n definition: SchemaMigrationDefinition;\n runtime_definition: SchemaMigrationDefinition;\n}\n\nexport interface RegisteredExtensionImporter {\n layer: ExtensionLayer;\n name: string;\n importer: string;\n}\n\nexport interface RegisteredExtensionExporter {\n layer: ExtensionLayer;\n name: string;\n exporter: string;\n}\n\nexport interface RegisteredExtensionSearchProvider {\n layer: ExtensionLayer;\n name: string;\n definition: SearchProviderDefinition;\n runtime_definition: SearchProviderDefinition;\n}\n\nexport interface RegisteredExtensionVectorStoreAdapter {\n layer: ExtensionLayer;\n name: string;\n definition: VectorStoreAdapterDefinition;\n runtime_definition: VectorStoreAdapterDefinition;\n}\n\nexport interface ExtensionRegistrationRegistry {\n commands: RegisteredExtensionCommandDefinition[];\n flags: RegisteredExtensionFlagDefinitions[];\n item_fields: RegisteredExtensionSchemaFieldDefinitions[];\n item_types: RegisteredExtensionSchemaItemTypeDefinitions[];\n migrations: RegisteredExtensionSchemaMigrationDefinition[];\n importers: RegisteredExtensionImporter[];\n exporters: RegisteredExtensionExporter[];\n search_providers: RegisteredExtensionSearchProvider[];\n vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];\n}\n\nexport interface ExtensionRegistrationCounts {\n commands: number;\n flags: number;\n item_fields: number;\n item_types: number;\n migrations: number;\n importers: number;\n exporters: number;\n search_providers: number;\n vector_store_adapters: number;\n}\n\nexport interface ExtensionApi {\n registerCommand(command: string, override: CommandOverride): void;\n registerCommand(definition: CommandDefinition): void;\n registerParser(command: string, override: ParserOverride): void;\n registerPreflight(override: PreflightOverride): void;\n registerService(service: ExtensionServiceName, override: ServiceOverride): void;\n registerFlags(targetCommand: string, flags: FlagDefinition[]): void;\n registerItemFields(fields: SchemaFieldDefinition[]): void;\n registerItemTypes(types: SchemaItemTypeDefinition[]): void;\n registerMigration(definition: SchemaMigrationDefinition): void;\n registerRenderer(format: OutputRendererFormat, renderer: RendererOverride): void;\n registerImporter(name: string, importer: Importer): void;\n registerExporter(name: string, exporter: Exporter): void;\n registerSearchProvider(provider: SearchProviderDefinition): void;\n registerVectorStoreAdapter(adapter: VectorStoreAdapterDefinition): void;\n hooks: {\n beforeCommand(hook: BeforeCommandHook): void;\n afterCommand(hook: AfterCommandHook): void;\n onWrite(hook: OnWriteHook): void;\n onRead(hook: OnReadHook): void;\n onIndex(hook: OnIndexHook): void;\n };\n}\n\nexport interface FailedExtensionActivation {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n trace?: ExtensionActivationFailureTrace;\n}\n\nexport interface ExtensionActivationFailureTrace {\n method: string;\n registration_index: number;\n command?: string;\n expected_schema: string;\n received?: unknown;\n hint?: string;\n}\n\nexport interface ExtensionActivationResult {\n hooks: ExtensionHookRegistry;\n commands: ExtensionCommandRegistry;\n parsers: ExtensionParserRegistry;\n preflight: ExtensionPreflightRegistry;\n services: ExtensionServiceRegistry;\n renderers: ExtensionRendererRegistry;\n registrations: ExtensionRegistrationRegistry;\n failed: FailedExtensionActivation[];\n warnings: string[];\n hook_counts: {\n before_command: number;\n after_command: number;\n on_write: number;\n on_read: number;\n on_index: number;\n };\n command_override_count: number;\n command_handler_count: number;\n parser_override_count: number;\n preflight_override_count: number;\n service_override_count: number;\n renderer_override_count: number;\n registration_counts: ExtensionRegistrationCounts;\n}\n\nexport interface ExtensionCandidate {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n}\n\nexport interface ExtensionLayerScanResult {\n diagnostics: ExtensionDiagnostic[];\n warnings: string[];\n candidates: ExtensionCandidate[];\n}\n\nexport interface ScannedExtensionDirectory {\n diagnostic: ExtensionDiagnostic;\n warnings: string[];\n candidate: ExtensionCandidate | null;\n}\n\nexport interface LegacyExtensionCapabilityAliasMapping {\n alias: string;\n target: ExtensionCapability;\n}\n\nexport interface DiscoverExtensionsOptions {\n pmRoot: string;\n settings: PmSettings;\n cwd?: string;\n noExtensions?: boolean;\n reload_token?: string;\n cache_bust?: boolean;\n}\n\nexport interface ActivatableExtension {\n activate: (api: ExtensionApi) => void | Promise<void>;\n}\n\nexport interface ServiceOverrideResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandOverrideResult {\n overridden: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandHandlerResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n /**\n * Human-readable, single-line, length-bounded message describing why an\n * extension command handler failed. Surfaced to the user/CI so the real cause\n * (e.g. \"Changelog is out of date: CHANGELOG.md\") is visible instead of only\n * the opaque `extension_command_handler_failed` warning code.\n */\n errorMessage?: string;\n}\n\nexport interface ParserOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n warnings: string[];\n}\n\nexport interface PreflightOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n decision: PreflightRuntimeDecision;\n warnings: string[];\n}\n\nexport interface RendererOverrideResult {\n overridden: boolean;\n rendered: string | null;\n warnings: string[];\n}\n\nexport interface UnknownExtensionCapabilityWarningDetails {\n layer: ExtensionLayer;\n name: string;\n capability: string;\n allowed_capabilities: string[];\n capability_contract_version: number;\n suggested_capability?: string;\n suggestion_source?: \"legacy_alias\" | \"nearest_match\";\n legacy_alias_target?: string;\n}\n"],"names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IAChB,kBAAkB;IAClB,mBAAmB;CACX,CAAC;AAsBX,MAAM,UAAU,sCAAsC;IACpD,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,kBAAkB,EAAE,EAAE;QACtB,uBAAuB,EAAE,MAAM;QAC/B,kBAAkB,EAAE,EAAE;QACtB,kBAAkB,EAAE,EAAE;QACtB,oBAAoB,EAAE,EAAE;QACxB,oBAAoB,EAAE,EAAE;QACxB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,mBAAmB,EAAE,EAAE;KACxB,CAAC;AACJ,CAAC","debugId":"75f1bede-2849-550d-8e31-0492def7d786"}
|
|
@@ -13,6 +13,13 @@ export declare function getActiveCommandResult(): unknown;
|
|
|
13
13
|
export declare function clearActiveExtensionHooks(): void;
|
|
14
14
|
export declare function runActiveOnWriteHooks(context: OnWriteHookContext): Promise<string[]>;
|
|
15
15
|
export declare function runActiveOnReadHooks(context: OnReadHookContext): Promise<string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Synchronous fast-path predicate: true only when at least one onRead hook is
|
|
18
|
+
* registered. Bulk readers (e.g. the metadata cache scanning hundreds of files)
|
|
19
|
+
* use this to skip per-file `await runActiveOnReadHooks(...)` calls entirely when
|
|
20
|
+
* no extension observes reads, avoiding hundreds of needless microtasks.
|
|
21
|
+
*/
|
|
22
|
+
export declare function hasActiveOnReadHooks(): boolean;
|
|
16
23
|
export declare function runActiveOnIndexHooks(context: OnIndexHookContext): Promise<string[]>;
|
|
17
24
|
export declare function runActiveCommandOverride(result: unknown): CommandOverrideResult;
|
|
18
25
|
export declare function runActiveCommandHandler(context: CommandHandlerContext): Promise<CommandHandlerResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="
|
|
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]="c826b268-5db1-567e-9a13-807ac5c092ff")}catch(e){}}();
|
|
3
3
|
import { runCommandHandler, runCommandOverride, runOnIndexHooks, runParserOverride, runPreflightOverride, runOnReadHooks, runRendererOverride, runServiceOverride, runServiceOverrideSync, runOnWriteHooks, } from "./loader.js";
|
|
4
4
|
let activeExtensionHooks = null;
|
|
5
5
|
let activeExtensionCommands = null;
|
|
@@ -66,6 +66,15 @@ export async function runActiveOnReadHooks(context) {
|
|
|
66
66
|
}
|
|
67
67
|
return runOnReadHooks(activeExtensionHooks, context);
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Synchronous fast-path predicate: true only when at least one onRead hook is
|
|
71
|
+
* registered. Bulk readers (e.g. the metadata cache scanning hundreds of files)
|
|
72
|
+
* use this to skip per-file `await runActiveOnReadHooks(...)` calls entirely when
|
|
73
|
+
* no extension observes reads, avoiding hundreds of needless microtasks.
|
|
74
|
+
*/
|
|
75
|
+
export function hasActiveOnReadHooks() {
|
|
76
|
+
return (activeExtensionHooks?.onRead?.length ?? 0) > 0;
|
|
77
|
+
}
|
|
69
78
|
export async function runActiveOnIndexHooks(context) {
|
|
70
79
|
if (!activeExtensionHooks) {
|
|
71
80
|
return [];
|
|
@@ -183,4 +192,4 @@ export function runActiveServiceOverrideSync(service, payload) {
|
|
|
183
192
|
}
|
|
184
193
|
export * from "./loader.js";
|
|
185
194
|
//# sourceMappingURL=index.js.map
|
|
186
|
-
//# debugId=
|
|
195
|
+
//# debugId=c826b268-5db1-567e-9a13-807ac5c092ff
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["core/extensions/index.ts"],"sourceRoot":"/","sourcesContent":["import {\n runCommandHandler,\n runCommandOverride,\n runOnIndexHooks,\n runParserOverride,\n runPreflightOverride,\n runOnReadHooks,\n runRendererOverride,\n runServiceOverride,\n runServiceOverrideSync,\n runOnWriteHooks,\n type CommandHandlerContext,\n type CommandHandlerResult,\n type CommandOverrideContext,\n type CommandOverrideResult,\n type ExtensionCommandRegistry,\n type ExtensionHookRegistry,\n type ExtensionParserRegistry,\n type ExtensionPreflightRegistry,\n type ExtensionRegistrationRegistry,\n type ExtensionRendererRegistry,\n type ExtensionServiceName,\n type ExtensionServiceRegistry,\n type OnIndexHookContext,\n type OnReadHookContext,\n type OnWriteHookContext,\n type OutputRendererFormat,\n type ParserOverrideContext,\n type ParserOverrideResult,\n type PreflightOverrideContext,\n type PreflightOverrideResult,\n type RendererOverrideResult,\n type ServiceOverrideResult,\n} from \"./loader.js\";\n\nlet activeExtensionHooks: ExtensionHookRegistry | null = null;\nlet activeExtensionCommands: ExtensionCommandRegistry | null = null;\nlet activeExtensionParsers: ExtensionParserRegistry | null = null;\nlet activeExtensionPreflight: ExtensionPreflightRegistry | null = null;\nlet activeExtensionServices: ExtensionServiceRegistry | null = null;\nlet activeExtensionRenderers: ExtensionRendererRegistry | null = null;\nlet activeExtensionRegistrations: ExtensionRegistrationRegistry | null = null;\nlet activeCommandContext: Omit<CommandOverrideContext, \"result\"> | null = null;\nlet activeCommandResult: unknown = undefined;\n\nexport function setActiveExtensionHooks(hooks: ExtensionHookRegistry | null): void {\n activeExtensionHooks = hooks;\n}\n\nexport function setActiveExtensionCommands(commands: ExtensionCommandRegistry | null): void {\n activeExtensionCommands = commands;\n}\n\nexport function setActiveExtensionParsers(parsers: ExtensionParserRegistry | null): void {\n activeExtensionParsers = parsers;\n}\n\nexport function setActiveExtensionPreflight(preflight: ExtensionPreflightRegistry | null): void {\n activeExtensionPreflight = preflight;\n}\n\nexport function setActiveExtensionServices(services: ExtensionServiceRegistry | null): void {\n activeExtensionServices = services;\n}\n\nexport function setActiveExtensionRenderers(renderers: ExtensionRendererRegistry | null): void {\n activeExtensionRenderers = renderers;\n}\n\nexport function setActiveExtensionRegistrations(registrations: ExtensionRegistrationRegistry | null): void {\n activeExtensionRegistrations = registrations;\n}\n\nexport function getActiveExtensionRegistrations(): ExtensionRegistrationRegistry | null {\n return activeExtensionRegistrations;\n}\n\nexport function setActiveCommandContext(context: Omit<CommandOverrideContext, \"result\"> | null): void {\n activeCommandContext = context;\n}\n\nexport function setActiveCommandResult(result: unknown): void {\n activeCommandResult = result;\n}\n\nexport function getActiveCommandResult(): unknown {\n return activeCommandResult;\n}\n\nexport function clearActiveExtensionHooks(): void {\n activeExtensionHooks = null;\n activeExtensionCommands = null;\n activeExtensionParsers = null;\n activeExtensionPreflight = null;\n activeExtensionServices = null;\n activeExtensionRenderers = null;\n activeExtensionRegistrations = null;\n activeCommandContext = null;\n activeCommandResult = undefined;\n}\n\nexport async function runActiveOnWriteHooks(context: OnWriteHookContext): Promise<string[]> {\n if (!activeExtensionHooks) {\n return [];\n }\n return runOnWriteHooks(activeExtensionHooks, context);\n}\n\nexport async function runActiveOnReadHooks(context: OnReadHookContext): Promise<string[]> {\n if (!activeExtensionHooks) {\n return [];\n }\n return runOnReadHooks(activeExtensionHooks, context);\n}\n\nexport async function runActiveOnIndexHooks(context: OnIndexHookContext): Promise<string[]> {\n if (!activeExtensionHooks) {\n return [];\n }\n return runOnIndexHooks(activeExtensionHooks, context);\n}\n\nexport function runActiveCommandOverride(result: unknown): CommandOverrideResult {\n if (!activeExtensionCommands || !activeCommandContext) {\n return {\n overridden: false,\n result,\n warnings: [],\n };\n }\n return runCommandOverride(activeExtensionCommands, {\n command: activeCommandContext.command,\n args: [...activeCommandContext.args],\n options: activeCommandContext.options ? { ...activeCommandContext.options } : {},\n global: activeCommandContext.global ? { ...activeCommandContext.global } : undefined,\n pm_root: activeCommandContext.pm_root,\n result,\n });\n}\n\nexport async function runActiveCommandHandler(context: CommandHandlerContext): Promise<CommandHandlerResult> {\n if (!activeExtensionCommands) {\n return {\n handled: false,\n result: null,\n warnings: [],\n };\n }\n return runCommandHandler(activeExtensionCommands, context);\n}\n\nexport async function runActiveParserOverride(context: ParserOverrideContext): Promise<ParserOverrideResult> {\n if (!activeExtensionParsers) {\n return {\n overridden: false,\n context: {\n command: context.command,\n args: [...context.args],\n options: { ...context.options },\n global: { ...context.global },\n pm_root: context.pm_root,\n },\n warnings: [],\n };\n }\n return runParserOverride(activeExtensionParsers, context);\n}\n\nexport async function runActivePreflightOverride(context: PreflightOverrideContext): Promise<PreflightOverrideResult> {\n if (!activeExtensionPreflight) {\n return {\n overridden: false,\n context: {\n command: context.command,\n args: [...context.args],\n options: { ...context.options },\n global: { ...context.global },\n pm_root: context.pm_root,\n },\n decision: { ...context.decision },\n warnings: [],\n };\n }\n return runPreflightOverride(activeExtensionPreflight, context);\n}\n\nexport function runActiveRendererOverride(format: OutputRendererFormat, result: unknown): RendererOverrideResult {\n if (!activeExtensionRenderers) {\n return {\n overridden: false,\n rendered: null,\n warnings: [],\n };\n }\n return runRendererOverride(activeExtensionRenderers, {\n format,\n command: activeCommandContext?.command,\n args: activeCommandContext ? [...activeCommandContext.args] : [],\n options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},\n global: activeCommandContext?.global ? { ...activeCommandContext.global } : undefined,\n pm_root: activeCommandContext?.pm_root,\n result,\n });\n}\n\nfunction buildServiceContext(service: ExtensionServiceName, payload: unknown) {\n return {\n service,\n command: activeCommandContext?.command,\n args: activeCommandContext ? [...activeCommandContext.args] : [],\n options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},\n global: activeCommandContext?.global ? { ...activeCommandContext.global } : undefined,\n pm_root: activeCommandContext?.pm_root,\n payload,\n };\n}\n\nexport async function runActiveServiceOverride(\n service: ExtensionServiceName,\n payload: unknown,\n): Promise<ServiceOverrideResult> {\n if (!activeExtensionServices) {\n return {\n handled: false,\n result: payload,\n warnings: [],\n };\n }\n return runServiceOverride(activeExtensionServices, buildServiceContext(service, payload));\n}\n\nexport function runActiveServiceOverrideSync(service: ExtensionServiceName, payload: unknown): ServiceOverrideResult {\n if (!activeExtensionServices) {\n return {\n handled: false,\n result: payload,\n warnings: [],\n };\n }\n return runServiceOverrideSync(activeExtensionServices, buildServiceContext(service, payload));\n}\n\nexport * from \"./loader.js\";\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,GAuBhB,MAAM,aAAa,CAAC;AAErB,IAAI,oBAAoB,GAAiC,IAAI,CAAC;AAC9D,IAAI,uBAAuB,GAAoC,IAAI,CAAC;AACpE,IAAI,sBAAsB,GAAmC,IAAI,CAAC;AAClE,IAAI,wBAAwB,GAAsC,IAAI,CAAC;AACvE,IAAI,uBAAuB,GAAoC,IAAI,CAAC;AACpE,IAAI,wBAAwB,GAAqC,IAAI,CAAC;AACtE,IAAI,4BAA4B,GAAyC,IAAI,CAAC;AAC9E,IAAI,oBAAoB,GAAkD,IAAI,CAAC;AAC/E,IAAI,mBAAmB,GAAY,SAAS,CAAC;AAE7C,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,oBAAoB,GAAG,KAAK,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAyC;IAClF,uBAAuB,GAAG,QAAQ,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,OAAuC;IAC/E,sBAAsB,GAAG,OAAO,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,SAA4C;IACtF,wBAAwB,GAAG,SAAS,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AAkB,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAA6B,EAAE,OAAgB;IAC1F,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IACD,OAAO,sBAAsB,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,cAAc,aAAa,CAAC","debugId":"8e4b126d-f01d-5bbd-a20c-144eeef71df4"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["core/extensions/index.ts"],"sourceRoot":"/","sourcesContent":["import {\n runCommandHandler,\n runCommandOverride,\n runOnIndexHooks,\n runParserOverride,\n runPreflightOverride,\n runOnReadHooks,\n runRendererOverride,\n runServiceOverride,\n runServiceOverrideSync,\n runOnWriteHooks,\n type CommandHandlerContext,\n type CommandHandlerResult,\n type CommandOverrideContext,\n type CommandOverrideResult,\n type ExtensionCommandRegistry,\n type ExtensionHookRegistry,\n type ExtensionParserRegistry,\n type ExtensionPreflightRegistry,\n type ExtensionRegistrationRegistry,\n type ExtensionRendererRegistry,\n type ExtensionServiceName,\n type ExtensionServiceRegistry,\n type OnIndexHookContext,\n type OnReadHookContext,\n type OnWriteHookContext,\n type OutputRendererFormat,\n type ParserOverrideContext,\n type ParserOverrideResult,\n type PreflightOverrideContext,\n type PreflightOverrideResult,\n type RendererOverrideResult,\n type ServiceOverrideResult,\n} from \"./loader.js\";\n\nlet activeExtensionHooks: ExtensionHookRegistry | null = null;\nlet activeExtensionCommands: ExtensionCommandRegistry | null = null;\nlet activeExtensionParsers: ExtensionParserRegistry | null = null;\nlet activeExtensionPreflight: ExtensionPreflightRegistry | null = null;\nlet activeExtensionServices: ExtensionServiceRegistry | null = null;\nlet activeExtensionRenderers: ExtensionRendererRegistry | null = null;\nlet activeExtensionRegistrations: ExtensionRegistrationRegistry | null = null;\nlet activeCommandContext: Omit<CommandOverrideContext, \"result\"> | null = null;\nlet activeCommandResult: unknown = undefined;\n\nexport function setActiveExtensionHooks(hooks: ExtensionHookRegistry | null): void {\n activeExtensionHooks = hooks;\n}\n\nexport function setActiveExtensionCommands(commands: ExtensionCommandRegistry | null): void {\n activeExtensionCommands = commands;\n}\n\nexport function setActiveExtensionParsers(parsers: ExtensionParserRegistry | null): void {\n activeExtensionParsers = parsers;\n}\n\nexport function setActiveExtensionPreflight(preflight: ExtensionPreflightRegistry | null): void {\n activeExtensionPreflight = preflight;\n}\n\nexport function setActiveExtensionServices(services: ExtensionServiceRegistry | null): void {\n activeExtensionServices = services;\n}\n\nexport function setActiveExtensionRenderers(renderers: ExtensionRendererRegistry | null): void {\n activeExtensionRenderers = renderers;\n}\n\nexport function setActiveExtensionRegistrations(registrations: ExtensionRegistrationRegistry | null): void {\n activeExtensionRegistrations = registrations;\n}\n\nexport function getActiveExtensionRegistrations(): ExtensionRegistrationRegistry | null {\n return activeExtensionRegistrations;\n}\n\nexport function setActiveCommandContext(context: Omit<CommandOverrideContext, \"result\"> | null): void {\n activeCommandContext = context;\n}\n\nexport function setActiveCommandResult(result: unknown): void {\n activeCommandResult = result;\n}\n\nexport function getActiveCommandResult(): unknown {\n return activeCommandResult;\n}\n\nexport function clearActiveExtensionHooks(): void {\n activeExtensionHooks = null;\n activeExtensionCommands = null;\n activeExtensionParsers = null;\n activeExtensionPreflight = null;\n activeExtensionServices = null;\n activeExtensionRenderers = null;\n activeExtensionRegistrations = null;\n activeCommandContext = null;\n activeCommandResult = undefined;\n}\n\nexport async function runActiveOnWriteHooks(context: OnWriteHookContext): Promise<string[]> {\n if (!activeExtensionHooks) {\n return [];\n }\n return runOnWriteHooks(activeExtensionHooks, context);\n}\n\nexport async function runActiveOnReadHooks(context: OnReadHookContext): Promise<string[]> {\n if (!activeExtensionHooks) {\n return [];\n }\n return runOnReadHooks(activeExtensionHooks, context);\n}\n\n/**\n * Synchronous fast-path predicate: true only when at least one onRead hook is\n * registered. Bulk readers (e.g. the metadata cache scanning hundreds of files)\n * use this to skip per-file `await runActiveOnReadHooks(...)` calls entirely when\n * no extension observes reads, avoiding hundreds of needless microtasks.\n */\nexport function hasActiveOnReadHooks(): boolean {\n return (activeExtensionHooks?.onRead?.length ?? 0) > 0;\n}\n\nexport async function runActiveOnIndexHooks(context: OnIndexHookContext): Promise<string[]> {\n if (!activeExtensionHooks) {\n return [];\n }\n return runOnIndexHooks(activeExtensionHooks, context);\n}\n\nexport function runActiveCommandOverride(result: unknown): CommandOverrideResult {\n if (!activeExtensionCommands || !activeCommandContext) {\n return {\n overridden: false,\n result,\n warnings: [],\n };\n }\n return runCommandOverride(activeExtensionCommands, {\n command: activeCommandContext.command,\n args: [...activeCommandContext.args],\n options: activeCommandContext.options ? { ...activeCommandContext.options } : {},\n global: activeCommandContext.global ? { ...activeCommandContext.global } : undefined,\n pm_root: activeCommandContext.pm_root,\n result,\n });\n}\n\nexport async function runActiveCommandHandler(context: CommandHandlerContext): Promise<CommandHandlerResult> {\n if (!activeExtensionCommands) {\n return {\n handled: false,\n result: null,\n warnings: [],\n };\n }\n return runCommandHandler(activeExtensionCommands, context);\n}\n\nexport async function runActiveParserOverride(context: ParserOverrideContext): Promise<ParserOverrideResult> {\n if (!activeExtensionParsers) {\n return {\n overridden: false,\n context: {\n command: context.command,\n args: [...context.args],\n options: { ...context.options },\n global: { ...context.global },\n pm_root: context.pm_root,\n },\n warnings: [],\n };\n }\n return runParserOverride(activeExtensionParsers, context);\n}\n\nexport async function runActivePreflightOverride(context: PreflightOverrideContext): Promise<PreflightOverrideResult> {\n if (!activeExtensionPreflight) {\n return {\n overridden: false,\n context: {\n command: context.command,\n args: [...context.args],\n options: { ...context.options },\n global: { ...context.global },\n pm_root: context.pm_root,\n },\n decision: { ...context.decision },\n warnings: [],\n };\n }\n return runPreflightOverride(activeExtensionPreflight, context);\n}\n\nexport function runActiveRendererOverride(format: OutputRendererFormat, result: unknown): RendererOverrideResult {\n if (!activeExtensionRenderers) {\n return {\n overridden: false,\n rendered: null,\n warnings: [],\n };\n }\n return runRendererOverride(activeExtensionRenderers, {\n format,\n command: activeCommandContext?.command,\n args: activeCommandContext ? [...activeCommandContext.args] : [],\n options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},\n global: activeCommandContext?.global ? { ...activeCommandContext.global } : undefined,\n pm_root: activeCommandContext?.pm_root,\n result,\n });\n}\n\nfunction buildServiceContext(service: ExtensionServiceName, payload: unknown) {\n return {\n service,\n command: activeCommandContext?.command,\n args: activeCommandContext ? [...activeCommandContext.args] : [],\n options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},\n global: activeCommandContext?.global ? { ...activeCommandContext.global } : undefined,\n pm_root: activeCommandContext?.pm_root,\n payload,\n };\n}\n\nexport async function runActiveServiceOverride(\n service: ExtensionServiceName,\n payload: unknown,\n): Promise<ServiceOverrideResult> {\n if (!activeExtensionServices) {\n return {\n handled: false,\n result: payload,\n warnings: [],\n };\n }\n return runServiceOverride(activeExtensionServices, buildServiceContext(service, payload));\n}\n\nexport function runActiveServiceOverrideSync(service: ExtensionServiceName, payload: unknown): ServiceOverrideResult {\n if (!activeExtensionServices) {\n return {\n handled: false,\n result: payload,\n warnings: [],\n };\n }\n return runServiceOverrideSync(activeExtensionServices, buildServiceContext(service, payload));\n}\n\nexport * from \"./loader.js\";\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,GAuBhB,MAAM,aAAa,CAAC;AAErB,IAAI,oBAAoB,GAAiC,IAAI,CAAC;AAC9D,IAAI,uBAAuB,GAAoC,IAAI,CAAC;AACpE,IAAI,sBAAsB,GAAmC,IAA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