@plugmatica/semantic-contracts 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +62 -2
- package/dist/index.d.ts +2534 -0
- package/dist/index.js +1194 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generated/protocol.ts","../src/extensions/identity.ts","../src/extensions/standardSurfaces.ts","../src/extensions/targets.ts"],"names":["point"],"mappings":";;;;;AAMO,IAAM,eAAA,GAAkB;AAAA,EAC7B,IAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF;AAMO,IAAM,kBAAA,GAAqB;AAAA,EAChC,MAAA;AAAA,EACA,aAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,kBAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF;AAMO,IAAM,0BAAA,GAA6B;AAAA,EACxC,QAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF;;;ACuFO,IAAM,sBAAA,GAAN,cAAqC,KAAA,CAAM;AAAA,EAMhD,WAAA,CACE,IAAA,EACA,OAAA,EACA,KAAA,EACA;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AATf;AAAA,IAAA,aAAA,CAAA,IAAA,EAAS,MAAA,CAAA;AAET;AAAA,IAAA,aAAA,CAAA,IAAA,EAAS,OAAA,CAAA;AAQP,IAAA,IAAA,CAAK,IAAA,GAAO,wBAAA;AACZ,IAAA,IAAA,CAAK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GAAS;AAAA,OAC5D;AAEJ,MAAA,MAAM,oBACJ,MAAA,CAAO,oBAAA,KAAyB,MAAA,IAChC,OAAO,OAAO,oBAAA,KAAyB,SAAA;AAEzC,MAAA,OACE,OAAO,MAAA,CAAO,OAAA,KAAY,QAAA,IAC1B,OAAO,MAAA,CAAO,GAAA,KAAQ,QAAA,IACtB,OAAO,MAAA,CAAO,KAAA,KAAU,QAAA,IACxB,YAAA,IACA,iBAAA;AAAA,IAEJ;AAAA,IAEA,KAAK,WAAA;AACH,MAAA,OACE,OAAO,MAAA,CAAO,OAAA,KAAY,QAAA,IAC1B,OAAO,OAAO,GAAA,KAAQ,QAAA,IACtB,OAAO,MAAA,CAAO,SAAA,KAAc,QAAA;AAAA,IAGhC,KAAK,OAAA;AACH,MAAA,OAAO,OAAO,OAAO,KAAA,KAAU,QAAA;AAAA,IAEjC,KAAK,UAAA;AACH,MAAA,OAAO,OAAO,OAAO,QAAA,KAAa,QAAA;AAAA;AAExC","file":"index.js","sourcesContent":["// GENERATED from canonical backend plugin protocol metadata. DO NOT EDIT.\n\n/**\n * Extension contribution kinds supported by the shared plugin protocol.\n * @category Extension contracts\n */\nexport const EXTENSION_KINDS = [\n \"ui\",\n \"operation_hook\",\n \"event_handler\",\n \"provider\",\n] as const;\n\n/**\n * Extension surface families supported by the shared plugin protocol.\n * @category Extension contracts\n */\nexport const EXTENSION_SURFACES = [\n \"page\",\n \"page_header\",\n \"grid\",\n \"nav_menu\",\n \"form\",\n \"field\",\n \"card\",\n \"tabs\",\n \"panel\",\n \"dialog\",\n \"table\",\n \"chart\",\n \"metric\",\n \"action\",\n \"settings_section\",\n \"wizard\",\n \"slot\",\n \"slot_frame\",\n \"slot_container\",\n \"custom\",\n] as const;\n\n/**\n * Operation-hook execution phases supported by the shared plugin protocol.\n * @category Extension contracts\n */\nexport const OPERATION_EXTENSION_PHASES = [\n \"before\",\n \"after\",\n \"error\",\n \"finally\",\n] as const;\n","import type {\n PluginExtensionEvent,\n PluginExtensionProvider,\n PluginExtensionSurface,\n} from \"../entities/extension\";\nimport type { ExtensionSurface } from \"../enums/extension\";\n\n/**\n * Public identities are semantic ABI. These brands document intent without\n * changing the wire representation, which remains a string.\n */\ndeclare const extensionIdentityBrand: unique symbol;\n\ntype BrandedIdentity<TName extends string> = string & {\n readonly [extensionIdentityBrand]: TName;\n};\n\n/**\n * Runtime-only identifier assigned to a resolved contribution instance.\n * @category Extension identity\n */\nexport type RuntimeContributionId = BrandedIdentity<\"runtime-contribution-id\">;\n/**\n * Public key identifying an extension-aware surface.\n * @category Extension identity\n */\nexport type ExtensionSurfaceKey = BrandedIdentity<\"surface-key\">;\n/**\n * Public key identifying a contribution authored by a consuming plugin.\n * @category Extension identity\n */\nexport type ExtensionContributionKey = BrandedIdentity<\"contribution-key\">;\n/**\n * Public operation name exposed by a surface contract.\n * @category Extension identity\n */\nexport type ExtensionOperationKey = BrandedIdentity<\"operation-key\">;\n/**\n * Public point name exposed by a surface contract.\n * @category Extension identity\n */\nexport type ExtensionPointKey = BrandedIdentity<\"point-key\">;\n/**\n * Developer-facing static override used by the `extension` escape hatch.\n * @category Extension identity\n */\nexport type ExplicitExtensionName = BrandedIdentity<\"explicit-extension-name\">;\n\n/**\n * Shared shape for future semantic UI-kit components.\n * @category Extension identity\n */\nexport type ExtensionOverrideProps = {\n /** Optional static developer override for the public extension identity. */\n readonly extension?: string | null;\n};\n\n/**\n * Accepted input forms for an extension identity scope.\n * @category Extension identity\n */\nexport type ExtensionScopeInput = string | readonly string[] | null | undefined;\n\n/**\n * Normalized semantic scope used to compose public extension identities.\n * @category Extension identity\n */\nexport type ExtensionScope = {\n /** Normalized identity segments that make up the semantic scope. */\n readonly segments: readonly string[];\n};\n\n/**\n * Static-analysis result for a possible extension identity value.\n * @category Extension identity\n */\nexport type ExtensionIdentityCandidate =\n | { readonly state: \"absent\" }\n | { readonly state: \"dynamic\"; readonly expression?: string }\n | { readonly state: \"static\"; readonly value: string };\n\n/**\n * Source that supplied the final public extension identity.\n * @category Extension identity\n */\nexport type ExtensionIdentitySource = \"explicit\" | \"semantic\" | \"scope\";\n\n/**\n * Inputs accepted by the stateless public extension identity resolver.\n * @category Extension identity\n */\nexport type ExtensionIdentityRequest = {\n /** Enclosing semantic scope, for example `customer.detail.form`. */\n readonly scope?: ExtensionScopeInput;\n /** Static developer override from the public `extension` prop. */\n readonly explicit?: ExtensionIdentityCandidate;\n /** Stable semantic identity already present in source, e.g. field name. */\n readonly semantic?: ExtensionIdentityCandidate;\n /**\n * Allows the component to reuse the enclosing scope when that scope already\n * represents the exact public surface. This is deliberately opt-in because\n * silently reusing a parent scope is ambiguous for normal child surfaces.\n */\n readonly allowEnclosingScope?: boolean;\n};\n\n/**\n * Normalized public identity produced by extension identity derivation.\n * @category Extension identity\n */\nexport type DerivedExtensionIdentity = {\n /** Final scope-qualified public extension key. */\n readonly key: ExtensionSurfaceKey;\n /** Normalized scope used during derivation. */\n readonly scope: ExtensionScope;\n /** Input source that supplied the local identity. */\n readonly source: ExtensionIdentitySource;\n /** Normalized local identity before scope composition, or null when the enclosing scope is reused. */\n readonly localIdentity: string | null;\n};\n\n/**\n * Stable error codes emitted by extension identity validation.\n * @category Extension identity\n */\nexport type ExtensionIdentityErrorCode =\n | \"dynamic_explicit_identity\"\n | \"dynamic_semantic_identity\"\n | \"invalid_identity\"\n | \"ambiguous_identity\"\n | \"duplicate_identity\";\n\n/**\n * Error raised when a stable public extension identity cannot be derived.\n * @category Extension identity\n */\nexport class ExtensionIdentityError extends Error {\n /** Stable machine-readable reason for the identity failure. */\n readonly code: ExtensionIdentityErrorCode;\n /** Optional offending identity value or expression. */\n readonly value?: string;\n\n constructor(\n code: ExtensionIdentityErrorCode,\n message: string,\n value?: string,\n ) {\n super(message);\n this.name = \"ExtensionIdentityError\";\n this.code = code;\n this.value = value;\n }\n}\n\n/**\n * Diagnostic/source metadata is intentionally separate from public identity.\n * None of these fields may participate in identity derivation.\n * @category Extension identity\n */\nexport type ExtensionSourceMetadata = {\n /** Source file associated with this diagnostic metadata. */\n readonly file?: string;\n /** One-based source line when available. */\n readonly line?: number;\n /** One-based source column when available. */\n readonly column?: number;\n /** Source offset when available. */\n readonly offset?: number;\n /** Human-readable label displayed for this extension source metadata. */\n readonly label?: string;\n /** Localization key associated with the source element, when available. */\n readonly translationKey?: string;\n};\n\n/**\n * Current-source contract for one extension-aware surface.\n * @category Extension identity\n */\nexport type CurrentExtensionSurfaceContract = Pick<\n PluginExtensionSurface,\n \"surface\" | \"contract\"\n> & {\n /** Stable key identifying this current extension surface contract. */\n readonly key: ExtensionSurfaceKey;\n /** Contribution points exposed by this current extension surface contract. */\n readonly points: readonly {\n readonly key: ExtensionPointKey;\n readonly multiple: boolean;\n readonly ownerAnchors?: readonly string[];\n readonly ownerAnchorsComplete?: boolean;\n }[];\n /** Operations exposed by this current extension surface contract. */\n readonly operations: readonly ExtensionOperationKey[];\n};\n\n/**\n * Current-source contract for one extension event.\n * @category Extension identity\n */\nexport type CurrentExtensionEventContract = Pick<\n PluginExtensionEvent,\n \"contract\" | \"multiple\"\n> & {\n /** Stable key identifying this current extension event contract. */\n readonly key: ExtensionSurfaceKey;\n};\n\n/**\n * Current-source contract for one extension provider.\n * @category Extension identity\n */\nexport type CurrentExtensionProviderContract = Pick<\n PluginExtensionProvider,\n \"contract\" | \"multiple\"\n> & {\n /** Stable key identifying this current extension provider contract. */\n readonly key: ExtensionSurfaceKey;\n};\n\n/**\n * The deterministic public extension API derived from current source only.\n * Historical baselines are intentionally absent from this type and API.\n * @category Extension identity\n */\nexport type CurrentExtensionContract = {\n /** Current-source extension surfaces exposed by the plugin. */\n readonly surfaces: readonly CurrentExtensionSurfaceContract[];\n /** Current-source extension events exposed by the plugin. */\n readonly events: readonly CurrentExtensionEventContract[];\n /** Current-source extension providers exposed by the plugin. */\n readonly providers: readonly CurrentExtensionProviderContract[];\n};\n\n/**\n * Reusable candidate representing the absence of an explicit or semantic extension identity.\n * @category Extension identity\n */\nexport const absentExtensionIdentity = {\n state: \"absent\",\n} as const satisfies ExtensionIdentityCandidate;\n\n/**\n * Represent a statically known extension identity candidate.\n * @category Extension identity\n * @param value Statically known local identity value.\n * @returns A statically resolved identity candidate.\n */\nexport function staticExtensionIdentity(\n value: string,\n): ExtensionIdentityCandidate {\n return { state: \"static\", value };\n}\n\n/**\n * Represent an extension identity expression that cannot be resolved statically.\n * @category Extension identity\n * @param expression Optional source expression recorded for diagnostics.\n * @returns A dynamic identity candidate for compiler diagnostics.\n */\nexport function dynamicExtensionIdentity(\n expression?: string,\n): ExtensionIdentityCandidate {\n return expression ? { state: \"dynamic\", expression } : { state: \"dynamic\" };\n}\n\n/**\n * Normalize string or segment input into an extension identity scope.\n * @category Extension identity\n * @param input Scope string, segments, or empty value to normalize.\n * @returns The normalized scope segments.\n */\nexport function createExtensionScope(\n input: ExtensionScopeInput,\n): ExtensionScope {\n if (input == null || input === \"\") {\n return { segments: [] };\n }\n\n const raw = typeof input === \"string\" ? [input] : input;\n const segments = raw.flatMap((part) => splitIdentity(part));\n return { segments };\n}\n\n/** Always composes `identity` relative to `scope`. */\n/**\n * @category Extension identity\n * @param scope Enclosing semantic scope for the identity.\n * @param identity Local identity to append to the normalized scope.\n * @returns The normalized, scope-qualified public extension key.\n */\nexport function composeExtensionPublicKey(\n scope: ExtensionScopeInput,\n identity: string,\n): ExtensionSurfaceKey {\n const parent = createExtensionScope(scope);\n const local = splitIdentity(identity);\n return asSurfaceKey([...parent.segments, ...local].join(\".\"));\n}\n\n/**\n * Compatibility helper for existing explicit `extensionKey`/`actionKey` APIs:\n * a dotted key is treated as already-qualified, while a single segment is\n * scoped. New semantic derivation should use `composeExtensionPublicKey`.\n */\n/**\n * @category Extension identity\n * @param scope Enclosing semantic scope used for unqualified keys.\n * @param key Compatibility extension key to resolve.\n * @returns The normalized public extension key.\n */\nexport function resolveQualifiedExtensionPublicKey(\n scope: ExtensionScopeInput,\n key: string,\n): ExtensionSurfaceKey {\n const normalized = normalizePublicIdentity(key);\n if (normalized.includes(\".\")) {\n return asSurfaceKey(normalized);\n }\n return composeExtensionPublicKey(scope, normalized);\n}\n\n/**\n * Canonical stateless identity resolver.\n *\n * Precedence is explicit override -> semantic identity -> exact enclosing\n * scope -> error. No baseline, registry, filesystem, line number, label or\n * runtime state is accepted by this function.\n */\n/**\n * @category Extension identity\n * @param request Explicit, semantic, and enclosing-scope identity candidates.\n * @returns The derived public key, normalized scope, source, and local identity.\n */\nexport function derivePublicExtensionIdentity(\n request: ExtensionIdentityRequest,\n): DerivedExtensionIdentity {\n const scope = createExtensionScope(request.scope);\n const explicit = request.explicit ?? absentExtensionIdentity;\n const semantic = request.semantic ?? absentExtensionIdentity;\n\n if (explicit.state === \"dynamic\") {\n throw new ExtensionIdentityError(\n \"dynamic_explicit_identity\",\n \"The public `extension` override must be statically resolvable at build time.\",\n explicit.expression,\n );\n }\n\n if (explicit.state === \"static\") {\n const local = normalizeExplicitExtensionName(explicit.value);\n return {\n key: composeExtensionPublicKey(scope.segments, local),\n scope,\n source: \"explicit\",\n localIdentity: local,\n };\n }\n\n if (semantic.state === \"dynamic\") {\n throw new ExtensionIdentityError(\n \"dynamic_semantic_identity\",\n \"A semantic public extension identity must be statically resolvable at build time.\",\n semantic.expression,\n );\n }\n\n if (semantic.state === \"static\") {\n const local = normalizePublicIdentity(semantic.value);\n return {\n key: composeExtensionPublicKey(scope.segments, local),\n scope,\n source: \"semantic\",\n localIdentity: local,\n };\n }\n\n if (request.allowEnclosingScope && scope.segments.length > 0) {\n return {\n key: asSurfaceKey(scope.segments.join(\".\")),\n scope,\n source: \"scope\",\n localIdentity: null,\n };\n }\n\n throw new ExtensionIdentityError(\n \"ambiguous_identity\",\n \"A stable public extension identity cannot be inferred. Provide semantic source identity or a static `extension` override.\",\n );\n}\n\n/**\n * Derives a declaration set without ever inventing numeric/hash suffixes.\n * Duplicate public identities are rejected as ambiguous ABI.\n */\n/**\n * @category Extension identity\n * @param requests Identity requests to derive and verify for uniqueness.\n * @returns Derived identities in request order after uniqueness validation.\n */\nexport function deriveUniquePublicExtensionIdentities(\n requests: readonly ExtensionIdentityRequest[],\n): readonly DerivedExtensionIdentity[] {\n const result = requests.map(derivePublicExtensionIdentity);\n const seen = new Set<string>();\n\n for (const identity of result) {\n if (seen.has(identity.key)) {\n throw new ExtensionIdentityError(\n \"duplicate_identity\",\n `Public extension identity '${identity.key}' is declared more than once. Add stable semantic identity or an explicit extension override instead of relying on generated suffixes.`,\n identity.key,\n );\n }\n seen.add(identity.key);\n }\n\n return result;\n}\n\n/**\n * Creates the ABI-only Current Extension Contract. Source/diagnostic metadata\n * is intentionally discarded and ordering is canonicalized.\n */\n/**\n * @category Extension identity\n * @param input Current-source surfaces, events, and providers discovered for the plugin.\n * @returns The deterministic current-source extension contract.\n */\nexport function createCurrentExtensionContract(input: {\n readonly surfaces?: readonly PluginExtensionSurface[];\n readonly events?: readonly PluginExtensionEvent[];\n readonly providers?: readonly PluginExtensionProvider[];\n}): CurrentExtensionContract {\n const surfaces = (input.surfaces ?? []).map((surface) => ({\n surface: surface.surface,\n key: asSurfaceKey(surface.key),\n contract: { ...surface.contract },\n points: surface.points\n .map((point) => ({\n key: asPointKey(point.key),\n multiple: point.multiple,\n ...(point.ownerAnchors && point.ownerAnchors.length > 0\n ? {\n ownerAnchors: [...new Set(point.ownerAnchors)].sort(\n (left, right) => left.localeCompare(right),\n ),\n }\n : {}),\n ...(point.ownerAnchorsComplete ? { ownerAnchorsComplete: true } : {}),\n }))\n .sort((left, right) => left.key.localeCompare(right.key)),\n operations: surface.operations\n .map(asOperationKey)\n .sort((left, right) => left.localeCompare(right)),\n }));\n\n assertUniqueSurfaceContracts(surfaces);\n\n const events = (input.events ?? [])\n .map((event) => ({\n key: asSurfaceKey(event.key),\n contract: { ...event.contract },\n multiple: event.multiple,\n }))\n .sort((left, right) => left.key.localeCompare(right.key));\n assertUniqueKeys(events, \"event\");\n\n const providers = (input.providers ?? [])\n .map((provider) => ({\n key: asSurfaceKey(provider.key),\n contract: { ...provider.contract },\n multiple: provider.multiple,\n }))\n .sort((left, right) => left.key.localeCompare(right.key));\n assertUniqueKeys(providers, \"provider\");\n\n surfaces.sort(\n (left, right) =>\n left.surface.localeCompare(right.surface) ||\n left.key.localeCompare(right.key),\n );\n\n return { surfaces, events, providers };\n}\n\n/**\n * Normalize and validate a public extension identity string.\n * @category Extension identity\n * @param value Public identity string to normalize and validate.\n * @returns The normalized public identity.\n */\nexport function normalizePublicIdentity(value: string): string {\n return splitIdentity(value).join(\".\");\n}\n\n/**\n * Explicit overrides follow a developer-facing lower-kebab naming convention.\n * Dots are allowed to express a relative semantic path; they never escape the\n * enclosing scope.\n */\n/**\n * @category Extension identity\n * @param value Developer-supplied explicit extension name.\n * @returns The normalized explicit extension name.\n */\nexport function normalizeExplicitExtensionName(value: string): string {\n const normalized = normalizePublicIdentity(value);\n for (const segment of normalized.split(\".\")) {\n if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(segment)) {\n throw new ExtensionIdentityError(\n \"invalid_identity\",\n `Explicit extension name '${value}' is invalid. Use lower-kebab segments such as 'summary' or 'billing-summary'.`,\n value,\n );\n }\n }\n return normalized;\n}\n\nfunction splitIdentity(value: string): string[] {\n const normalized = value.trim();\n if (!normalized) {\n throw invalidIdentity(value, \"identity cannot be empty\");\n }\n if (/\\s/.test(normalized) || /[\\u0000-\\u001f\\u007f]/.test(normalized)) {\n throw invalidIdentity(\n value,\n \"whitespace and control characters are not allowed\",\n );\n }\n\n const segments = normalized.split(\".\");\n for (const segment of segments) {\n if (!segment) {\n throw invalidIdentity(\n value,\n \"empty dot-separated segments are not allowed\",\n );\n }\n if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(segment)) {\n throw invalidIdentity(\n value,\n `segment '${segment}' must contain only letters, digits, '_' or '-' and start with a letter or digit`,\n );\n }\n }\n return segments;\n}\n\nfunction invalidIdentity(\n value: string,\n reason: string,\n): ExtensionIdentityError {\n return new ExtensionIdentityError(\n \"invalid_identity\",\n `Invalid public extension identity '${value}': ${reason}.`,\n value,\n );\n}\n\nfunction asSurfaceKey(value: string): ExtensionSurfaceKey {\n return normalizePublicIdentity(value) as ExtensionSurfaceKey;\n}\n\nfunction asPointKey(value: string): ExtensionPointKey {\n return normalizePublicIdentity(value) as ExtensionPointKey;\n}\n\nfunction asOperationKey(value: string): ExtensionOperationKey {\n return normalizePublicIdentity(value) as ExtensionOperationKey;\n}\n\nfunction assertUniqueSurfaceContracts(\n surfaces: readonly {\n readonly surface: ExtensionSurface;\n readonly key: ExtensionSurfaceKey;\n }[],\n): void {\n const seen = new Set<string>();\n for (const surface of surfaces) {\n const identity = `${surface.surface}:${surface.key}`;\n if (seen.has(identity)) {\n throw new ExtensionIdentityError(\n \"duplicate_identity\",\n `Current Extension Contract contains duplicate surface '${identity}'.`,\n identity,\n );\n }\n seen.add(identity);\n }\n}\n\nfunction assertUniqueKeys(\n values: readonly { readonly key: ExtensionSurfaceKey }[],\n kind: \"event\" | \"provider\",\n): void {\n const seen = new Set<string>();\n for (const value of values) {\n if (seen.has(value.key)) {\n throw new ExtensionIdentityError(\n \"duplicate_identity\",\n `Current Extension Contract contains duplicate ${kind} '${value.key}'.`,\n value.key,\n );\n }\n seen.add(value.key);\n }\n}\n","import type {\n ExtensionContractDefinition,\n ExtensionContractRequirement,\n PluginExtensionSurface,\n PluginExtensionSurfacePoint,\n} from \"../entities/extension\";\nimport type { ExtensionSurface } from \"../enums/extension\";\n\n/**\n * Developer-facing importance levels for standard extension points.\n * @category Standard extension surfaces\n */\nexport type StandardExtensionPointImportance = \"primary\" | \"advanced\";\n\n/**\n * Runtime-checkable field vocabulary for canonical structured contributions.\n * @category Standard extension surfaces\n */\nexport type StandardContributionFieldType =\n | \"string\"\n | \"number\"\n | \"boolean\"\n | \"function\"\n | \"object\"\n | \"string[]\"\n | \"unknown\";\n\n/**\n * Canonical schema for points resolved through `contribute(context)` rather\n * than a renderable component module. `unknown` means the field must exist but\n * its value is deliberately owned by the consuming semantic component (for\n * example a ReactNode header).\n * @category Standard extension surfaces\n */\nexport type StandardContributionSchema = {\n /** Discriminator identifying this as a structured contribution schema. */\n readonly kind: \"object\";\n /** Required contribution fields and their portable types. */\n readonly required: Readonly<Record<string, StandardContributionFieldType>>;\n /** Optional contribution fields and their portable types. */\n readonly optional?: Readonly<Record<string, StandardContributionFieldType>>;\n /** Whether fields absent from the schema are accepted. */\n readonly allowUnknownFields?: boolean;\n};\n\n/**\n * Human-readable point metadata used by UI-kit, plugin-build and devtools.\n *\n * Only `key` and `multiple` are emitted as first-class manifest point fields.\n * Descriptive fields live in `surface.metadata.pointDefinitions` for runtime\n * tooling such as the developer surface inspector.\n * @category Standard extension surfaces\n */\nexport type StandardExtensionPointDefinition = PluginExtensionSurfacePoint & {\n /** Human-readable label displayed for this standard extension point definition. */\n label: string;\n /** Optional human-readable description of this standard extension point definition. */\n description: string;\n /** Optional documentation group used to organize this contribution point in developer tooling. */\n group: string;\n /** Whether the contribution point belongs to the primary or advanced developer surface. */\n importance: StandardExtensionPointImportance;\n /** Present only for points that consume structured contributions. */\n contributionSchema?: StandardContributionSchema;\n};\n\n/**\n * Canonical contract definition for one standard Plugmatica extension surface.\n * @category Standard extension surfaces\n */\nexport type StandardExtensionSurfaceContract = {\n /** Semantic surface family implemented by the contract. */\n surface: Exclude<ExtensionSurface, \"custom\">;\n /** Canonical UI Kit component associated with the surface. */\n component: string;\n /** Protocol identity for the standard surface. */\n contract: ExtensionContractDefinition;\n /** Canonical contribution points exposed by the surface. */\n points: readonly StandardExtensionPointDefinition[];\n /** Canonical operations exposed by the surface. */\n operations: readonly string[];\n};\n\nfunction point<\n const TKey extends string,\n const TSchema extends StandardContributionSchema | undefined = undefined,\n>(\n key: TKey,\n label: string,\n description: string,\n group: string,\n importance: StandardExtensionPointImportance = \"primary\",\n multiple = true,\n contributionSchema?: TSchema,\n): StandardExtensionPointDefinition & {\n key: TKey;\n} & (TSchema extends StandardContributionSchema\n ? { contributionSchema: TSchema }\n : { contributionSchema?: undefined }) {\n return {\n key,\n label,\n description,\n group,\n importance,\n multiple,\n ...(contributionSchema ? { contributionSchema } : {}),\n } as unknown as StandardExtensionPointDefinition & {\n key: TKey;\n } & (TSchema extends StandardContributionSchema\n ? { contributionSchema: TSchema }\n : { contributionSchema?: undefined });\n}\n\nconst orderedRenderContribution = {\n kind: \"object\",\n required: { key: \"string\", render: \"function\" },\n optional: { order: \"number\", placement: \"object\" },\n} as const satisfies StandardContributionSchema;\n\nconst orderedItemContribution = {\n kind: \"object\",\n required: { key: \"string\", item: \"object\" },\n optional: { order: \"number\", placement: \"object\" },\n} as const satisfies StandardContributionSchema;\n\n/** The same nine canonical regions are published by Card and Panel. */\nfunction spatialPoints(surface: \"card\" | \"panel\") {\n return [\n point(\"top.left\", \"Top left\", `Adds content to the ${surface}'s top-left zone.`, \"Spatial\"),\n point(\"top.center\", \"Top center\", `Adds content to the ${surface}'s top-center/title zone.`, \"Spatial\"),\n point(\"top.right\", \"Top right\", `Adds content to the ${surface}'s top-right/action zone.`, \"Spatial\"),\n point(\"middle.left\", \"Middle left\", `Adds content to the ${surface}'s middle-left zone.`, \"Spatial\"),\n point(\"middle.center\", \"Middle center\", `Adds content to the ${surface}'s main content zone.`, \"Spatial\"),\n point(\"middle.right\", \"Middle right\", `Adds content to the ${surface}'s middle-right zone.`, \"Spatial\"),\n point(\"bottom.left\", \"Bottom left\", `Adds content to the ${surface}'s bottom-left zone.`, \"Spatial\"),\n point(\"bottom.center\", \"Bottom center\", `Adds content to the ${surface}'s footer zone.`, \"Spatial\"),\n point(\"bottom.right\", \"Bottom right\", `Adds content to the ${surface}'s bottom-right zone.`, \"Spatial\"),\n ] as const;\n}\n\n/**\n * Canonical vocabulary for every Plugmatica-owned semantic UI surface.\n *\n * Instance identity is deliberately absent from this catalog. For example,\n * `customer.detail.tabs` is an instance key while `plugmatica.ui.tabs` is the\n * reusable contract identity shared by every standard Tabs instance.\n * @category Standard extension surfaces\n */\nexport const standardExtensionSurfaces = {\n page: {\n surface: \"page\",\n component: \"Page\",\n contract: { id: \"plugmatica.ui.page\", version: \"1.0.0\" },\n points: [\n point(\n \"before\",\n \"Before page\",\n \"Renders before owner page items.\",\n \"Page\",\n \"advanced\",\n ),\n point(\n \"items\",\n \"Page items\",\n \"Adds ordered top-level page sections.\",\n \"Page\",\n \"primary\",\n true,\n orderedRenderContribution,\n ),\n point(\n \"after\",\n \"After page\",\n \"Renders after owner page items.\",\n \"Page\",\n \"advanced\",\n ),\n ],\n operations: [],\n },\n\n page_header: {\n surface: \"page_header\",\n component: \"PageHeader\",\n contract: { id: \"plugmatica.ui.page-header\", version: \"1.0.0\" },\n points: [\n point(\n \"title.before\",\n \"Before title\",\n \"Renders before the page title block.\",\n \"Title\",\n \"advanced\",\n ),\n point(\n \"title.after\",\n \"After title\",\n \"Renders after the page title block.\",\n \"Title\",\n \"advanced\",\n ),\n point(\n \"actions\",\n \"Header actions\",\n \"Adds ordered actions to the page header.\",\n \"Actions\",\n \"primary\",\n true,\n orderedRenderContribution,\n ),\n ],\n operations: [],\n },\n\n dialog: {\n surface: \"dialog\",\n component: \"Dialog\",\n contract: { id: \"plugmatica.ui.dialog\", version: \"1.0.0\" },\n points: [\n point(\n \"actions\",\n \"Dialog actions\",\n \"Adds ordered footer actions relative to the dialog owner’s stable action keys.\",\n \"Actions\",\n \"primary\",\n true,\n orderedRenderContribution,\n ),\n ],\n operations: [],\n },\n\n grid: {\n surface: \"grid\",\n component: \"Grid\",\n contract: { id: \"plugmatica.ui.grid\", version: \"1.0.0\" },\n points: [\n point(\n \"items\",\n \"Grid items\",\n \"Adds ordered grid items relative to stable owner item keys.\",\n \"Items\",\n \"primary\",\n true,\n {\n ...orderedRenderContribution,\n optional: {\n ...orderedRenderContribution.optional,\n span: \"unknown\",\n className: \"string\",\n },\n },\n ),\n ],\n operations: [],\n },\n\n nav_menu: {\n surface: \"nav_menu\",\n component: \"NavMenu\",\n contract: { id: \"plugmatica.ui.nav-menu\", version: \"1.0.0\" },\n points: [\n point(\n \"items\",\n \"Navigation items\",\n \"Adds ordered navigation items.\",\n \"Navigation\",\n \"primary\",\n true,\n orderedItemContribution,\n ),\n point(\n \"footer.items\",\n \"Footer navigation items\",\n \"Adds ordered footer navigation items.\",\n \"Navigation\",\n \"advanced\",\n true,\n orderedItemContribution,\n ),\n ],\n operations: [\"select\"],\n },\n form: {\n surface: \"form\",\n component: \"Form\",\n contract: { id: \"plugmatica.ui.form\", version: \"1.0.0\" },\n points: [\n point(\n \"header.before\",\n \"Before header\",\n \"Renders immediately before the form header.\",\n \"Header\",\n \"advanced\",\n ),\n point(\n \"header.after\",\n \"After header\",\n \"Renders immediately after the form header.\",\n \"Header\",\n \"advanced\",\n ),\n point(\n \"fields.before\",\n \"Before fields\",\n \"Renders above the form field collection.\",\n \"Fields\",\n ),\n point(\n \"fields\",\n \"Form fields\",\n \"Adds fields to the form field collection.\",\n \"Fields\",\n \"primary\",\n true,\n orderedRenderContribution,\n ),\n point(\n \"fields.after\",\n \"After fields\",\n \"Renders below the form field collection.\",\n \"Fields\",\n ),\n point(\n \"actions.before\",\n \"Before actions\",\n \"Renders immediately before the form actions.\",\n \"Actions\",\n \"advanced\",\n ),\n point(\n \"actions\",\n \"Form actions\",\n \"Adds actions to the form action area.\",\n \"Actions\",\n \"primary\",\n true,\n orderedRenderContribution,\n ),\n point(\n \"actions.after\",\n \"After actions\",\n \"Renders immediately after the form actions.\",\n \"Actions\",\n \"advanced\",\n ),\n point(\n \"footer.before\",\n \"Before footer\",\n \"Renders immediately before the form footer.\",\n \"Footer\",\n \"advanced\",\n ),\n point(\n \"footer.after\",\n \"After footer\",\n \"Renders immediately after the form footer.\",\n \"Footer\",\n \"advanced\",\n ),\n ],\n operations: [\"submit\", \"reset\"],\n },\n\n field: {\n surface: \"field\",\n component: \"FormField\",\n contract: { id: \"plugmatica.ui.form-field\", version: \"1.0.0\" },\n points: [\n point(\n \"label.before\",\n \"Before label\",\n \"Renders before the field label.\",\n \"Label\",\n \"advanced\",\n ),\n point(\n \"label.after\",\n \"After label\",\n \"Renders after the field label.\",\n \"Label\",\n ),\n point(\n \"control.before\",\n \"Before control\",\n \"Renders before the input control.\",\n \"Control\",\n ),\n point(\n \"control.after\",\n \"After control\",\n \"Renders after the input control.\",\n \"Control\",\n ),\n point(\n \"description.before\",\n \"Before description\",\n \"Renders before help or description text.\",\n \"Description\",\n \"advanced\",\n ),\n point(\n \"description.after\",\n \"After description\",\n \"Renders after help or description text.\",\n \"Description\",\n ),\n point(\n \"message.before\",\n \"Before validation message\",\n \"Renders before validation feedback.\",\n \"Validation\",\n \"advanced\",\n ),\n point(\n \"message.after\",\n \"After validation message\",\n \"Renders after validation feedback.\",\n \"Validation\",\n ),\n ],\n operations: [\"change\", \"blur\"],\n },\n\n card: {\n surface: \"card\",\n component: \"Card\",\n contract: { id: \"plugmatica.ui.card\", version: \"1.0.0\" },\n points: spatialPoints(\"card\"),\n operations: [],\n },\n\n action: {\n surface: \"action\",\n component: \"Button\",\n contract: { id: \"plugmatica.ui.action\", version: \"1.0.0\" },\n points: [\n point(\n \"content.before\",\n \"Before button content\",\n \"Renders before the button label or icon.\",\n \"Content\",\n ),\n point(\n \"content.after\",\n \"After button content\",\n \"Renders after the button label or icon.\",\n \"Content\",\n ),\n ],\n operations: [\"click\"],\n },\n\n table: {\n surface: \"table\",\n component: \"DataTable\",\n contract: { id: \"plugmatica.ui.table\", version: \"1.0.0\" },\n points: [\n point(\n \"toolbar.before\",\n \"Before toolbar\",\n \"Renders before the table toolbar.\",\n \"Toolbar\",\n \"advanced\",\n ),\n point(\n \"toolbar.actions\",\n \"Toolbar actions\",\n \"Adds actions to the table toolbar.\",\n \"Toolbar\",\n ),\n point(\n \"toolbar.after\",\n \"After toolbar\",\n \"Renders after the table toolbar.\",\n \"Toolbar\",\n \"advanced\",\n ),\n point(\n \"columns\",\n \"Table columns\",\n \"Adds columns to the table.\",\n \"Table\",\n \"primary\",\n true,\n {\n kind: \"object\",\n required: {\n key: \"string\",\n header: \"unknown\",\n renderCell: \"function\",\n },\n optional: { order: \"number\", placement: \"object\" },\n },\n ),\n point(\n \"row.actions\",\n \"Row actions\",\n \"Adds actions to each table row.\",\n \"Rows\",\n ),\n point(\n \"selection.actions\",\n \"Selection actions\",\n \"Adds actions for the current selected-row set.\",\n \"Selection\",\n ),\n point(\n \"empty.before\",\n \"Before empty state\",\n \"Renders before the empty-state content.\",\n \"Empty state\",\n \"advanced\",\n ),\n point(\n \"empty.after\",\n \"After empty state\",\n \"Renders after the empty-state content.\",\n \"Empty state\",\n \"advanced\",\n ),\n point(\n \"footer.before\",\n \"Before footer\",\n \"Renders before the table footer.\",\n \"Footer\",\n \"advanced\",\n ),\n point(\n \"footer.after\",\n \"After footer\",\n \"Renders after the table footer.\",\n \"Footer\",\n \"advanced\",\n ),\n ],\n // Loading remains owner/query state rather than an operation. Semantic\n // table state transitions are operations because extensions may validate,\n // cancel or rewrite sorting/filter/pagination requests before owner state\n // is mutated.\n operations: [\n \"refresh\",\n \"export\",\n \"row.select\",\n \"sort.change\",\n \"filter.change\",\n \"pagination.change\",\n ],\n },\n\n chart: {\n surface: \"chart\",\n component: \"Chart\",\n contract: { id: \"plugmatica.ui.chart\", version: \"1.0.0\" },\n // V1 permits contextual content around the visualization, but deliberately\n // does not allow cross-plugin mutation of datasets, axes, series or raw\n // renderer options. Those require a future declarative contribution model.\n points: [\n point(\n \"before\",\n \"Before visualization\",\n \"Renders contextual content immediately before the chart.\",\n \"Context\",\n ),\n point(\n \"after\",\n \"After visualization\",\n \"Renders contextual content immediately after the chart.\",\n \"Context\",\n ),\n ],\n operations: [],\n },\n\n metric: {\n surface: \"metric\",\n component: \"Stat\",\n contract: { id: \"plugmatica.ui.metric\", version: \"1.0.0\" },\n points: [\n point(\n \"before\",\n \"Before metric\",\n \"Renders contextual content immediately before the metric.\",\n \"Context\",\n ),\n point(\n \"after\",\n \"After metric\",\n \"Renders contextual content immediately after the metric.\",\n \"Context\",\n ),\n ],\n operations: [],\n },\n\n tabs: {\n surface: \"tabs\",\n component: \"Tabs\",\n contract: { id: \"plugmatica.ui.tabs\", version: \"1.0.0\" },\n points: [\n point(\"items\", \"Tabs\", \"Adds selectable tabs.\", \"Tabs\", \"primary\", true, {\n ...orderedRenderContribution,\n optional: {\n ...orderedRenderContribution.optional,\n label: \"unknown\",\n disabled: \"boolean\",\n },\n }),\n point(\n \"content.before\",\n \"Above tab content\",\n \"Renders above the selected tab content.\",\n \"Content\",\n ),\n point(\n \"content.after\",\n \"Below tab content\",\n \"Renders below the selected tab content.\",\n \"Content\",\n ),\n point(\n \"actions\",\n \"Tab actions\",\n \"Adds actions beside the tab list.\",\n \"Actions\",\n ),\n ],\n operations: [\"change\"],\n },\n\n panel: {\n surface: \"panel\",\n component: \"Panel\",\n contract: { id: \"plugmatica.ui.panel\", version: \"1.0.0\" },\n points: spatialPoints(\"panel\"),\n operations: [\"open\", \"close\"],\n },\n\n settings_section: {\n surface: \"settings_section\",\n component: \"SettingsSection\",\n contract: { id: \"plugmatica.ui.settings-section\", version: \"1.0.0\" },\n points: [\n point(\n \"items.before\",\n \"Before settings\",\n \"Renders before the setting items.\",\n \"Settings\",\n ),\n point(\n \"items\",\n \"Setting items\",\n \"Adds settings to the section.\",\n \"Settings\",\n ),\n point(\n \"items.after\",\n \"After settings\",\n \"Renders after the setting items.\",\n \"Settings\",\n ),\n point(\n \"actions\",\n \"Section actions\",\n \"Adds actions to the settings section.\",\n \"Actions\",\n ),\n ],\n operations: [\"save\", \"reset\"],\n },\n\n wizard: {\n surface: \"wizard\",\n component: \"Wizard\",\n contract: { id: \"plugmatica.ui.wizard\", version: \"1.0.0\" },\n points: [\n point(\n \"steps\",\n \"Wizard steps\",\n \"Adds steps to the wizard.\",\n \"Steps\",\n \"primary\",\n true,\n {\n ...orderedRenderContribution,\n required: { ...orderedRenderContribution.required, title: \"string\" },\n optional: {\n ...orderedRenderContribution.optional,\n validationFields: \"string[]\",\n },\n },\n ),\n point(\n \"header.before\",\n \"Before header\",\n \"Renders before the wizard header.\",\n \"Header\",\n \"advanced\",\n ),\n point(\n \"content.before\",\n \"Above step content\",\n \"Renders above the active step.\",\n \"Content\",\n ),\n point(\n \"content.after\",\n \"Below step content\",\n \"Renders below the active step.\",\n \"Content\",\n ),\n point(\n \"footer.before\",\n \"Before footer\",\n \"Renders before wizard navigation.\",\n \"Footer\",\n \"advanced\",\n ),\n point(\n \"footer.actions\",\n \"Footer actions\",\n \"Adds actions to wizard navigation.\",\n \"Footer\",\n ),\n point(\n \"footer.after\",\n \"After footer\",\n \"Renders after wizard navigation.\",\n \"Footer\",\n \"advanced\",\n ),\n ],\n operations: [\"next\", \"previous\", \"finish\", \"cancel\"],\n },\n\n slot: {\n surface: \"slot\",\n component: \"ExtensionSlot\",\n contract: { id: \"plugmatica.ui.slot\", version: \"1.0.0\" },\n points: [\n point(\"content\", \"Content\", \"Adds content to the slot.\", \"Content\"),\n ],\n operations: [],\n },\n\n slot_frame: {\n surface: \"slot_frame\",\n component: \"SlotFrame\",\n contract: { id: \"plugmatica.ui.slot-frame\", version: \"1.0.0\" },\n points: [\n point(\n \"header.before\",\n \"Before header\",\n \"Renders immediately before the frame header.\",\n \"Header\",\n \"advanced\",\n ),\n point(\n \"header.actions\",\n \"Header actions\",\n \"Adds actions to the right side of the frame header.\",\n \"Header\",\n ),\n point(\n \"content.before\",\n \"Above content\",\n \"Renders between the header and the main frame content.\",\n \"Content\",\n ),\n point(\n \"content\",\n \"Main content\",\n \"Adds content inside the main frame body.\",\n \"Content\",\n ),\n point(\n \"content.after\",\n \"Below content\",\n \"Renders after the main content and before the footer.\",\n \"Content\",\n ),\n point(\n \"footer.before\",\n \"Before footer\",\n \"Renders immediately before the frame footer.\",\n \"Footer\",\n \"advanced\",\n ),\n point(\n \"footer.actions\",\n \"Footer actions\",\n \"Adds actions to the frame footer.\",\n \"Footer\",\n ),\n point(\n \"footer.after\",\n \"After footer\",\n \"Renders immediately after the frame footer.\",\n \"Footer\",\n \"advanced\",\n ),\n ],\n operations: [],\n },\n\n slot_container: {\n surface: \"slot_container\",\n component: \"ExtensionSlotContainer\",\n contract: { id: \"plugmatica.ui.slot-container\", version: \"1.0.0\" },\n points: [\n point(\"content\", \"Content\", \"Adds content to the container.\", \"Content\"),\n ],\n operations: [],\n },\n} as const satisfies Record<\n Exclude<ExtensionSurface, \"custom\">,\n StandardExtensionSurfaceContract\n>;\n\n/**\n * Names of all canonical Plugmatica extension surfaces.\n * @category Standard extension surfaces\n */\nexport type StandardExtensionSurfaceName =\n keyof typeof standardExtensionSurfaces;\n/**\n * Contract identifiers published by canonical standard extension surfaces.\n * @category Standard extension surfaces\n */\nexport type StandardExtensionContractId =\n (typeof standardExtensionSurfaces)[StandardExtensionSurfaceName][\"contract\"][\"id\"];\n/**\n * Contribution-point keys exposed by a selected standard extension surface.\n * @category Standard extension surfaces\n */\nexport type StandardExtensionPointKey<\n TSurface extends StandardExtensionSurfaceName,\n> = (typeof standardExtensionSurfaces)[TSurface][\"points\"][number][\"key\"];\n/**\n * Operation keys exposed by a selected standard extension surface.\n * @category Standard extension surfaces\n */\nexport type StandardExtensionOperationKey<\n TSurface extends StandardExtensionSurfaceName,\n> = (typeof standardExtensionSurfaces)[TSurface][\"operations\"][number];\n\n/**\n * Validation issue found while checking a standard surface declaration.\n * @category Standard extension surfaces\n */\nexport type StandardSurfaceValidationIssue = {\n /** Surface declaration field that failed validation. */\n field: \"surface\" | \"contract\" | \"points\" | \"operations\";\n /** Human-readable explanation of the validation failure. */\n message: string;\n};\n\n/**\n * Return the canonical contract definition for a standard extension surface.\n * @category Standard extension surfaces\n * @param surface Canonical standard surface whose contract is required.\n * @returns The canonical contract definition for the surface.\n */\nexport function standardSurfaceContract<\n TSurface extends StandardExtensionSurfaceName,\n>(surface: TSurface): (typeof standardExtensionSurfaces)[TSurface][\"contract\"] {\n return standardExtensionSurfaces[surface].contract;\n}\n\n/**\n * Canonical requirement for targeting a standard surface from another plugin.\n * This lets authors/tooling depend on the standard family without copying its\n * contract id into plugin-specific code or manifests.\n */\n/**\n * @category Standard extension surfaces\n * @param surface Canonical standard surface to target.\n * @returns The compatible contract requirement for consumers.\n */\nexport function standardSurfaceContractRequirement(\n surface: StandardExtensionSurfaceName,\n): ExtensionContractRequirement {\n const contract = standardExtensionSurfaces[surface].contract;\n return { id: contract.id, version: `^${contract.version}` };\n}\n\n/**\n * Create a manifest surface declaration from the canonical standard-surface catalog.\n * @category Standard extension surfaces\n * @param surface Canonical standard surface to declare.\n * @param key Public identity of the concrete surface instance.\n * @param metadata Additional manifest metadata to merge into the generated declaration.\n * @returns A plugin extension-surface declaration using the canonical contract.\n */\nexport function standardSurfaceDefinition(\n surface: StandardExtensionSurfaceName,\n key: string,\n metadata: Record<string, unknown> = {},\n): PluginExtensionSurface {\n const standard = standardExtensionSurfaces[surface];\n\n return {\n key,\n surface: standard.surface,\n contract: { ...standard.contract },\n points: standard.points.map(({ key: pointKey, multiple }) => ({\n key: pointKey,\n multiple,\n })),\n operations: [...standard.operations],\n metadata: {\n ...metadata,\n pointDefinitions: standard.points.map((definition) => ({\n ...definition,\n })),\n },\n };\n}\n\ntype StandardContributionFieldValue<\n TField extends StandardContributionFieldType,\n> = TField extends \"string\"\n ? string\n : TField extends \"number\"\n ? number\n : TField extends \"boolean\"\n ? boolean\n : TField extends \"function\"\n ? (...args: any[]) => unknown\n : TField extends \"object\"\n ? Record<string, unknown>\n : TField extends \"string[]\"\n ? readonly string[]\n : unknown;\n\ntype StandardContributionFromSchema<\n TSchema extends StandardContributionSchema,\n> = {\n [K in keyof TSchema[\"required\"]]: StandardContributionFieldValue<\n TSchema[\"required\"][K]\n >;\n} & (TSchema[\"optional\"] extends Readonly<\n Record<string, StandardContributionFieldType>\n>\n ? {\n [K in keyof TSchema[\"optional\"]]?: StandardContributionFieldValue<\n TSchema[\"optional\"][K]\n >;\n }\n : Record<never, never>);\n\ntype StandardPointDefinitionFor<\n TSurface extends StandardExtensionSurfaceName,\n TPoint extends string,\n> = Extract<\n (typeof standardExtensionSurfaces)[TSurface][\"points\"][number],\n { readonly key: TPoint }\n>;\n\n/**\n * Structured contribution type projected directly from the canonical standard\n * surface schema. Points without a structured schema intentionally resolve to\n * `unknown`, because they are renderable-module points instead.\n * @category Standard extension surfaces\n */\nexport type StandardContributionFor<\n TSurface extends StandardExtensionSurfaceName,\n TPoint extends string,\n> =\n StandardPointDefinitionFor<TSurface, TPoint> extends {\n readonly contributionSchema: infer TSchema extends\n StandardContributionSchema;\n }\n ? StandardContributionFromSchema<TSchema>\n : unknown;\n\n/**\n * Return the structured contribution schema for a standard surface point when one exists.\n * @category Standard extension surfaces\n * @param surface Canonical surface containing the contribution point.\n * @param pointKey Contribution point key to inspect.\n * @returns The structured schema, or null for renderable/unstructured points.\n */\nexport function standardContributionSchema(\n surface: StandardExtensionSurfaceName,\n pointKey: string,\n): StandardContributionSchema | null {\n const definition = standardExtensionSurfaces[surface].points.find(\n (candidate) => candidate.key === pointKey,\n ) as StandardExtensionPointDefinition | undefined;\n return definition?.contributionSchema ?? null;\n}\n\n/**\n * Validate a structured standard-surface contribution at the runtime boundary.\n * Renderable points intentionally return no issue because their contract is a\n * React component module rather than a `contribute()` payload.\n */\n/**\n * @category Standard extension surfaces\n * @param surface Canonical surface containing the contribution point.\n * @param pointKey Contribution point key to validate against.\n * @param value Contribution payload to validate.\n * @returns Validation messages; an empty array means the payload is valid or the point is unstructured.\n */\nexport function validateStandardContribution(\n surface: StandardExtensionSurfaceName,\n pointKey: string,\n value: unknown,\n): string[] {\n const schema = standardContributionSchema(surface, pointKey);\n if (!schema) return [];\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return [`${surface}:${pointKey} contribution must be an object.`];\n }\n\n const record = value as Record<string, unknown>;\n const issues: string[] = [];\n for (const [field, fieldType] of Object.entries(schema.required)) {\n if (!(field in record)) {\n issues.push(\n `${surface}:${pointKey} contribution is missing required field '${field}'.`,\n );\n continue;\n }\n if (!matchesContributionFieldType(record[field], fieldType)) {\n issues.push(\n `${surface}:${pointKey} contribution field '${field}' must be ${describeContributionFieldType(fieldType)}.`,\n );\n }\n }\n\n for (const [field, fieldType] of Object.entries(schema.optional ?? {})) {\n if (record[field] === undefined) continue;\n if (!matchesContributionFieldType(record[field], fieldType)) {\n issues.push(\n `${surface}:${pointKey} contribution field '${field}' must be ${describeContributionFieldType(fieldType)} when provided.`,\n );\n }\n }\n\n if (!schema.allowUnknownFields) {\n const known = new Set([\n ...Object.keys(schema.required),\n ...Object.keys(schema.optional ?? {}),\n ]);\n for (const field of Object.keys(record)) {\n if (!known.has(field)) {\n issues.push(\n `${surface}:${pointKey} contribution contains unknown field '${field}'.`,\n );\n }\n }\n }\n return issues;\n}\n\nfunction matchesContributionFieldType(\n value: unknown,\n fieldType: StandardContributionFieldType,\n): boolean {\n switch (fieldType) {\n case \"unknown\":\n return true;\n case \"string\":\n case \"number\":\n case \"boolean\":\n case \"function\":\n return typeof value === fieldType;\n case \"object\":\n return (\n Boolean(value) && typeof value === \"object\" && !Array.isArray(value)\n );\n case \"string[]\":\n return (\n Array.isArray(value) && value.every((item) => typeof item === \"string\")\n );\n }\n}\n\nfunction describeContributionFieldType(\n fieldType: StandardContributionFieldType,\n): string {\n if (fieldType === \"string[]\") return \"an array of strings\";\n if (fieldType === \"unknown\") return \"present\";\n return `a ${fieldType}`;\n}\n\n/**\n * Check whether a string names a canonical standard extension surface.\n * @category Standard extension surfaces\n * @param value Surface name to test.\n * @returns True when the value is a canonical standard surface name.\n */\nexport function isStandardExtensionSurface(\n value: string,\n): value is StandardExtensionSurfaceName {\n return Object.prototype.hasOwnProperty.call(standardExtensionSurfaces, value);\n}\n\n/**\n * Check whether a contract id belongs to a canonical standard extension surface.\n * @category Standard extension surfaces\n * @param value Contract id to test.\n * @returns True when the value is a canonical standard-surface contract id.\n */\nexport function isStandardExtensionContractId(\n value: string,\n): value is StandardExtensionContractId {\n return Object.values(standardExtensionSurfaces).some(\n (definition) => definition.contract.id === value,\n );\n}\n\n/**\n * Resolve a canonical standard surface from its contract identifier.\n * @category Standard extension surfaces\n * @param contractId Canonical contract identifier to resolve.\n * @returns The matching standard surface name, or null when the id is not canonical.\n */\nexport function standardSurfaceForContractId(\n contractId: string,\n): StandardExtensionSurfaceName | null {\n for (const [surface, definition] of Object.entries(\n standardExtensionSurfaces,\n )) {\n if (definition.contract.id === contractId) {\n return surface as StandardExtensionSurfaceName;\n }\n }\n return null;\n}\n\n/**\n * Validate a manifest/runtime declaration against the canonical standard\n * contract. Custom protocols are allowed, but canonical Plugmatica UI contract\n * identifiers are reserved for their matching standard surface families.\n */\n/**\n * @category Standard extension surfaces\n * @param candidate Surface declaration to compare with the canonical catalog.\n * @returns Validation issues; an empty array means the declaration is valid.\n */\nexport function validateStandardSurfaceDefinition(\n candidate: Pick<\n PluginExtensionSurface,\n \"surface\" | \"contract\" | \"points\" | \"operations\"\n >,\n): StandardSurfaceValidationIssue[] {\n if (candidate.surface === \"custom\") {\n if (isStandardExtensionContractId(candidate.contract.id)) {\n return [\n {\n field: \"contract\",\n message:\n `Contract id '${candidate.contract.id}' is reserved for the canonical ` +\n `Plugmatica standard surface '${standardSurfaceForContractId(candidate.contract.id)}'. ` +\n `Use a distinct contract id for a genuinely custom protocol.`,\n },\n ];\n }\n return [];\n }\n if (!isStandardExtensionSurface(candidate.surface)) {\n return [\n {\n field: \"surface\",\n message: `Unknown standard extension surface '${candidate.surface}'.`,\n },\n ];\n }\n\n const expected = standardExtensionSurfaces[candidate.surface];\n const issues: StandardSurfaceValidationIssue[] = [];\n\n if (\n candidate.contract.id !== expected.contract.id ||\n candidate.contract.version !== expected.contract.version\n ) {\n issues.push({\n field: \"contract\",\n message:\n `Standard surface '${candidate.surface}' must provide canonical contract ` +\n `'${expected.contract.id}@${expected.contract.version}', received ` +\n `'${candidate.contract.id}@${candidate.contract.version}'. Use surface ` +\n `'custom' for a genuinely custom protocol.`,\n });\n }\n\n const expectedPoints = expected.points.map(({ key, multiple }) => ({\n key,\n multiple,\n }));\n if (!samePoints(candidate.points, expectedPoints)) {\n issues.push({\n field: \"points\",\n message:\n `Standard surface '${candidate.surface}' must use canonical points [` +\n `${expectedPoints.map((item) => item.key).join(\", \")}].`,\n });\n }\n\n if (!sameStrings(candidate.operations, expected.operations)) {\n issues.push({\n field: \"operations\",\n message:\n `Standard surface '${candidate.surface}' must use canonical operations [` +\n `${expected.operations.join(\", \")}].`,\n });\n }\n\n return issues;\n}\n\n/**\n * Assert that a surface declaration matches its canonical standard-surface contract.\n * @category Standard extension surfaces\n * @param candidate Surface declaration to validate and assert.\n */\nexport function assertStandardSurfaceDefinition(\n candidate: Pick<\n PluginExtensionSurface,\n \"surface\" | \"contract\" | \"points\" | \"operations\"\n >,\n): void {\n const issues = validateStandardSurfaceDefinition(candidate);\n if (issues.length === 0) return;\n throw new Error(issues.map((issue) => issue.message).join(\"\\n\"));\n}\n\nfunction samePoints(\n actual: readonly PluginExtensionSurfacePoint[],\n expected: readonly PluginExtensionSurfacePoint[],\n): boolean {\n if (actual.length !== expected.length) return false;\n const actualMap = new Map(actual.map((point) => [point.key, point.multiple]));\n return expected.every((point) => actualMap.get(point.key) === point.multiple);\n}\n\nfunction sameStrings(\n actual: readonly string[],\n expected: readonly string[],\n): boolean {\n if (actual.length !== expected.length) return false;\n const actualSet = new Set(actual);\n return expected.every((value) => actualSet.has(value));\n}\n","import type {\n ExtensionContractDefinition,\n ExtensionContractRequirement,\n} from \"../entities/extension\";\nimport type { ExtensionSurface } from \"../enums/extension\";\nimport type { PluginKey } from \"../ids/plugin\";\nimport {\n isStandardExtensionSurface,\n standardSurfaceContractRequirement,\n type StandardContributionFor as StandardContributionSchemaFor,\n type StandardExtensionSurfaceName,\n} from \"./standardSurfaces\";\n\nexport type { StandardContributionFor } from \"./standardSurfaces\";\n\n/**\n * Format version for generated extension-target reference files.\n * @category Extension targets\n */\nexport const EXTENSION_TARGET_REFERENCE_VERSION = 1 as const;\n/**\n * Package export subpath containing generated extension target tokens.\n * @category Extension targets\n */\nexport const EXTENSION_TARGET_PACKAGE_SUBPATH = \"./extensions\" as const;\n\n/**\n * Kinds of generated extension targets that a contribution can address.\n * @category Extension targets\n */\nexport type ExtensionTargetKind = \"ui\" | \"operation\" | \"event\" | \"provider\";\n\n/**\n * Shared producer, version, and contract metadata carried by every generated extension target.\n * @category Extension targets\n */\nexport type ExtensionTargetTokenBase<\n TKind extends ExtensionTargetKind,\n TPlugin extends PluginKey = PluginKey,\n TPluginVersion extends string = string,\n TContract extends ExtensionContractRequirement = ExtensionContractRequirement,\n> = {\n /** Stable discriminator used by generated target modules and compiler tooling. */\n readonly __pmTarget: TKind;\n\n /** Compatible protocol range required by the consuming contribution. */\n readonly contract: TContract;\n} & (\n | {\n /** Direct target generated by a concrete provider package. */\n readonly resolution?: \"plugin\";\n /** Plugin that owns the public extension contract. */\n readonly plugin: TPlugin;\n /** Exact producer package version that emitted this token. */\n readonly pluginVersion: TPluginVersion;\n readonly required?: never;\n }\n | {\n /** Resolve the target by compatible installed capability at runtime. */\n readonly resolution: \"capability\";\n /** Whether absence of a compatible installed provider blocks activation. */\n readonly required: boolean;\n readonly plugin?: never;\n readonly pluginVersion?: never;\n }\n);\n\ntype UiExtensionTargetTokenBase<\n TPlugin extends PluginKey,\n TPluginVersion extends string,\n TSurface extends ExtensionSurface,\n TKey extends string,\n TPoint extends string,\n TContract extends ExtensionContractRequirement,\n> = ExtensionTargetTokenBase<\"ui\", TPlugin, TPluginVersion, TContract> & {\n readonly surface: TSurface;\n readonly key: TKey;\n readonly point: TPoint;\n\n /** Statically known owner anchors for this ordered collection point. */\n readonly ownerAnchors?: readonly string[];\n\n /** True only when ownerAnchors is a complete static set. */\n readonly ownerAnchorsComplete?: boolean;\n};\n\n/**\n * UI target backed by one of Plugmatica's canonical semantic surfaces.\n *\n * Standard targets can carry the type-only contribution schema projected from\n * the canonical standard-surface catalog.\n * @category Extension targets\n */\nexport type StandardUiExtensionTargetToken<\n TPlugin extends PluginKey = PluginKey,\n TPluginVersion extends string = string,\n TSurface extends StandardExtensionSurfaceName = StandardExtensionSurfaceName,\n TKey extends string = string,\n TPoint extends string = string,\n TContract extends ExtensionContractRequirement = ExtensionContractRequirement,\n> = UiExtensionTargetTokenBase<\n TPlugin,\n TPluginVersion,\n TSurface,\n TKey,\n TPoint,\n TContract\n> & {\n /**\n * Type-only carrier emitted by generated target declarations for structured\n * standard points. Runtime target objects never contain this property.\n */\n readonly __contribution?: StandardContributionSchemaFor<TSurface, TPoint>;\n};\n\n/**\n * UI target backed by a plugin-defined domain contract.\n *\n * Custom targets intentionally do not use StandardContributionFor because\n * their contribution protocol is defined by the owning plugin rather than the\n * canonical standard-surface catalog.\n * @category Extension targets\n */\nexport type CustomUiExtensionTargetToken<\n TPlugin extends PluginKey = PluginKey,\n TPluginVersion extends string = string,\n TKey extends string = string,\n TPoint extends string = string,\n TContract extends ExtensionContractRequirement = ExtensionContractRequirement,\n> = UiExtensionTargetTokenBase<\n TPlugin,\n TPluginVersion,\n \"custom\",\n TKey,\n TPoint,\n TContract\n>;\n\n/**\n * Public UI extension-target token.\n *\n * Preserve the generic surface parameter while making standard and custom\n * targets distinct at the type level:\n *\n * - standard semantic surface -> canonical StandardContributionFor carrier\n * - custom surface -> plugin-defined domain contract, no carrier\n * @category Extension targets\n */\nexport type UiExtensionTargetToken<\n TPlugin extends PluginKey = PluginKey,\n TPluginVersion extends string = string,\n TSurface extends ExtensionSurface = ExtensionSurface,\n TKey extends string = string,\n TPoint extends string = string,\n TContract extends ExtensionContractRequirement = ExtensionContractRequirement,\n> = TSurface extends StandardExtensionSurfaceName\n ? StandardUiExtensionTargetToken<\n TPlugin,\n TPluginVersion,\n TSurface,\n TKey,\n TPoint,\n TContract\n >\n : TSurface extends \"custom\"\n ? CustomUiExtensionTargetToken<\n TPlugin,\n TPluginVersion,\n TKey,\n TPoint,\n TContract\n >\n : never;\n\n/**\n * Generated token identifying one operation exposed by a target surface.\n * @category Extension targets\n */\nexport type OperationExtensionTargetToken<\n TPlugin extends PluginKey = PluginKey,\n TPluginVersion extends string = string,\n TSurface extends ExtensionSurface = ExtensionSurface,\n TKey extends string = string,\n TOperation extends string = string,\n TContract extends ExtensionContractRequirement = ExtensionContractRequirement,\n> = ExtensionTargetTokenBase<\n \"operation\",\n TPlugin,\n TPluginVersion,\n TContract\n> & {\n /** Extension surface family associated with this operation extension target token. */\n readonly surface: TSurface;\n /** Stable key identifying this operation extension target token. */\n readonly key: TKey;\n /** Operation key exposed by the target surface. */\n readonly operation: TOperation;\n};\n\n/**\n * Generated token identifying an event exposed by a plugin.\n * @category Extension targets\n */\nexport type EventExtensionTargetToken<\n TPayload = unknown,\n TPlugin extends PluginKey = PluginKey,\n TPluginVersion extends string = string,\n TEvent extends string = string,\n TContract extends ExtensionContractRequirement = ExtensionContractRequirement,\n> = ExtensionTargetTokenBase<\"event\", TPlugin, TPluginVersion, TContract> & {\n /** Event key addressed by this event extension target token. */\n readonly event: TEvent;\n\n /** Type-only payload carrier; omitted from generated runtime values. */\n readonly __payload?: TPayload;\n};\n\n/**\n * Generated token identifying a provider contract exposed by a plugin.\n * @category Extension targets\n */\nexport type ProviderExtensionTargetToken<\n TRequest = unknown,\n TValue = unknown,\n TPlugin extends PluginKey = PluginKey,\n TPluginVersion extends string = string,\n TProvider extends string = string,\n TContract extends ExtensionContractRequirement = ExtensionContractRequirement,\n> = ExtensionTargetTokenBase<\"provider\", TPlugin, TPluginVersion, TContract> & {\n /** Provider key addressed by this provider extension target token. */\n readonly provider: TProvider;\n\n /** Type-only request/value carriers; omitted from generated runtime values. */\n readonly __request?: TRequest;\n /** Type-only marker carrying the provider value type without affecting the runtime token shape. */\n readonly __value?: TValue;\n};\n\n/**\n * Union of all generated extension target token kinds.\n * @category Extension targets\n */\nexport type ExtensionTargetToken =\n | UiExtensionTargetToken\n | OperationExtensionTargetToken\n | EventExtensionTargetToken\n | ProviderExtensionTargetToken;\n\n/**\n * Generated, serializable reference to all extension targets exposed by a plugin package.\n * @category Extension targets\n */\nexport type ExtensionTargetReference = {\n /** Version of the generated target-reference file format. */\n readonly formatVersion: typeof EXTENSION_TARGET_REFERENCE_VERSION;\n\n /** Producer plugin identity and version for the reference. */\n readonly plugin: {\n readonly key: PluginKey;\n readonly version: string;\n };\n\n /**\n * Source-of-truth marker: targets are projected from the Current Extension\n * Contract.\n */\n readonly generatedFrom: \"current-extension-contract\";\n\n /** Canonical package subpath used to publish generated target namespaces. */\n readonly packageSubpath: typeof EXTENSION_TARGET_PACKAGE_SUBPATH;\n\n /** Generated target tokens exported by the producer plugin. */\n readonly targets: {\n readonly ui: readonly UiExtensionTargetToken[];\n readonly operations: readonly OperationExtensionTargetToken[];\n readonly events: readonly EventExtensionTargetToken[];\n readonly providers: readonly ProviderExtensionTargetToken[];\n };\n};\n\n/**\n * Convert an exact provided contract into the compatible requirement stored in\n * a generated target token.\n *\n * Standard surfaces use the canonical catalog range.\n * Custom/event/provider contracts use a caret range over the provided version.\n */\n/**\n * @category Extension targets\n * @param contract Producer contract definition whose compatibility range is required.\n * @param surface Surface family used when evaluating the compatible requirement.\n * @returns A compatible contract requirement for the consumer.\n */\nexport function compatibleExtensionContractRequirement(\n contract: ExtensionContractDefinition,\n surface?: ExtensionSurface,\n): ExtensionContractRequirement {\n if (surface && isStandardExtensionSurface(surface)) {\n return standardSurfaceContractRequirement(surface);\n }\n\n return {\n id: contract.id,\n version: contract.version.startsWith(\"^\")\n ? contract.version\n : `^${contract.version}`,\n };\n}\n\n/**\n * Check whether an unknown value has the shape of a generated extension target token.\n * @category Extension targets\n * @param value Unknown value to test.\n * @returns True when the value is a supported generated extension target token.\n */\n/**\n * Check whether a target token is resolved by runtime capability rather than a concrete provider.\n * @category Extension targets\n */\nexport function isCapabilityResolvedExtensionTargetToken(\n value: ExtensionTargetToken,\n): value is ExtensionTargetToken & {\n readonly resolution: \"capability\";\n readonly required: boolean;\n} {\n return value.resolution === \"capability\";\n}\n\n/**\n * Check whether a target token is bound to one concrete provider package.\n * @category Extension targets\n */\nexport function isDirectExtensionTargetToken(\n value: ExtensionTargetToken,\n): value is ExtensionTargetToken & {\n readonly plugin: PluginKey;\n readonly pluginVersion: string;\n} {\n return value.resolution !== \"capability\";\n}\n\nexport function isExtensionTargetToken(\n value: unknown,\n): value is ExtensionTargetToken {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return false;\n }\n\n const record = value as Record<string, unknown>;\n\n if (\n record.__pmTarget !== \"ui\" &&\n record.__pmTarget !== \"operation\" &&\n record.__pmTarget !== \"event\" &&\n record.__pmTarget !== \"provider\"\n ) {\n return false;\n }\n\n if (\n record.resolution !== undefined &&\n record.resolution !== \"plugin\" &&\n record.resolution !== \"capability\"\n ) {\n return false;\n }\n\n const capabilityResolved = record.resolution === \"capability\";\n if (capabilityResolved) {\n if (\n typeof record.required !== \"boolean\" ||\n record.plugin !== undefined ||\n record.pluginVersion !== undefined\n ) {\n return false;\n }\n } else if (\n typeof record.plugin !== \"string\" ||\n !record.plugin ||\n typeof record.pluginVersion !== \"string\" ||\n !record.pluginVersion ||\n record.required !== undefined\n ) {\n return false;\n }\n\n if (!record.contract || typeof record.contract !== \"object\") {\n return false;\n }\n\n const contract = record.contract as Record<string, unknown>;\n\n if (typeof contract.id !== \"string\" || typeof contract.version !== \"string\") {\n return false;\n }\n\n switch (record.__pmTarget) {\n case \"ui\": {\n const anchors = record.ownerAnchors;\n\n const anchorsValid =\n anchors === undefined ||\n (Array.isArray(anchors) &&\n anchors.every(\n (anchor) => typeof anchor === \"string\" && anchor.length > 0,\n ));\n\n const completenessValid =\n record.ownerAnchorsComplete === undefined ||\n typeof record.ownerAnchorsComplete === \"boolean\";\n\n return (\n typeof record.surface === \"string\" &&\n typeof record.key === \"string\" &&\n typeof record.point === \"string\" &&\n anchorsValid &&\n completenessValid\n );\n }\n\n case \"operation\":\n return (\n typeof record.surface === \"string\" &&\n typeof record.key === \"string\" &&\n typeof record.operation === \"string\"\n );\n\n case \"event\":\n return typeof record.event === \"string\";\n\n case \"provider\":\n return typeof record.provider === \"string\";\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plugmatica/semantic-contracts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"generate:protocol": "node scripts/protocol.mjs",
|
|
24
|
+
"check:protocol": "node scripts/protocol.mjs --check",
|
|
25
|
+
"build": "pnpm run generate:protocol && tsup",
|
|
26
|
+
"typecheck": "pnpm run generate:protocol && tsc --noEmit",
|
|
27
|
+
"test": "pnpm run generate:protocol && vitest run",
|
|
28
|
+
"test:protocol": "node --test scripts/protocol.test.mjs",
|
|
29
|
+
"clean": "rimraf dist src/generated",
|
|
30
|
+
"prepublishOnly": "pnpm -w run release:guard"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"plugmatica",
|
|
34
|
+
"semantic",
|
|
35
|
+
"contracts"
|
|
36
|
+
],
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"rimraf": "^6.0.1",
|
|
39
|
+
"tsup": "9.0.0",
|
|
40
|
+
"typescript": "^5.9.3",
|
|
41
|
+
"tsx": "^4.20.0",
|
|
42
|
+
"vitest": "4.1.12"
|
|
43
|
+
},
|
|
44
|
+
"description": "Framework-independent Plugmatica semantic extension contracts, identity and standard surfaces.",
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public",
|
|
47
|
+
"provenance": true,
|
|
48
|
+
"tag": "beta",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
},
|
|
51
|
+
"plugmatica": {
|
|
52
|
+
"owner": "Plugmatica OSS",
|
|
53
|
+
"stability": "beta",
|
|
54
|
+
"staticPolicy": "framework-free semantic contracts; pinned protocol input; public API approval required before release"
|
|
55
|
+
},
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/plugmatica/plugmatica-ui.git",
|
|
59
|
+
"directory": "packages/semantic-contracts"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://plugmatica.com",
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/plugmatica/plugmatica-ui/issues"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {}
|
|
66
|
+
}
|