@theaiplatform/miniapp-sdk 0.3.3 → 0.4.0

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.
@@ -8,7 +8,26 @@ import * as __rspack_external_node_path_806ed179 from "node:path";
8
8
  import * as __rspack_external_node_url_3991086a from "node:url";
9
9
  import * as __rspack_external_saxes from "saxes";
10
10
  import * as __rspack_external_node_util_ac04460e from "node:util";
11
+ import { registerTapManifestAjvFormats } from "../internal/json-schema.js";
11
12
  var config_schema_namespaceObject = /*#__PURE__*/ JSON.parse('{"$defs":{"ActorKind":{"enum":["human","specialist"],"type":"string"},"AuthorizationBinding":{"additionalProperties":false,"properties":{"allOf":{"items":{"type":"string"},"type":"array"},"effects":{"items":{"$ref":"#/$defs/RuntimeEffect"},"type":"array"}},"type":"object"},"AutonomyLevel":{"enum":["listen","plan","do"],"type":"string"},"BrowserExtensionOptions":{"additionalProperties":false,"properties":{"manifest":{"type":"string"},"permissions":{"items":{"type":"string"},"type":"array"},"restartRequired":{"default":false,"type":"boolean"}},"required":["manifest"],"type":"object"},"ChatBlockOptions":{"additionalProperties":false,"properties":{"accessibilityLabel":{"type":"string"},"fallbackFormat":{"$ref":"#/$defs/FallbackFormat"},"payloadSchema":{"type":"string"},"protocol":{"$ref":"#/$defs/ChatBlockProtocol"}},"required":["protocol","payloadSchema","fallbackFormat","accessibilityLabel"],"type":"object"},"ChatBlockProtocol":{"enum":["tap-primitives-v1","tap-federated-view-v1","isolated-html-v1","mcp-app-2026-01-26"],"type":"string"},"CommandOptions":{"additionalProperties":false,"properties":{"inputSchema":{"type":["string","null"]},"label":{"type":"string"},"placements":{"items":{"type":"string"},"type":"array"}},"required":["label"],"type":"object"},"CompositionOptions":{"additionalProperties":false,"properties":{"childPackageIds":{"items":{"type":"string"},"type":"array"},"contributionIds":{"items":{"type":"string"},"type":"array"}},"type":"object"},"ConsentPolicy":{"enum":["none","once","channel","reusable","fresh-decision"],"type":"string"},"ContributionScope":{"enum":["user","workspace","channel","conversation","project","resource"],"type":"string"},"ContributionTarget":{"anyOf":[{"$ref":"#/$defs/ModuleContributionTarget"},{"$ref":"#/$defs/HostDeclarativeContributionTarget"}],"description":"A target-specific execution binding selected for a contribution.\\n\\nExecutable package modules select one immutable Federation expose. Host-\\ndeclarative contributions are materialized by TAP and therefore select the\\nhost runtime without inventing a module expose."},"DeclarativeOptions":{"additionalProperties":false,"properties":{"schema":{"type":"string"}},"required":["schema"],"type":"object"},"EventDelivery":{"enum":["ephemeral","durable"],"type":"string"},"ExecutableOptions":{"additionalProperties":false,"properties":{"effects":{"items":{"$ref":"#/$defs/RuntimeEffect"},"type":"array"},"inputSchema":{"type":["string","null"]},"outputSchema":{"type":["string","null"]},"timeoutMs":{"format":"uint64","minimum":0,"type":["integer","null"]}},"type":"object"},"ExecutionRuntime":{"enum":["webview","quickjs","worker","node","workflow-host"],"type":"string"},"FallbackFormat":{"enum":["text","markdown"],"type":"string"},"FederationExpose":{"additionalProperties":false,"description":"One exposed module in the locked Federation graph.","properties":{"integrity":{"type":"string"},"runtime":{"$ref":"#/$defs/ExecutionRuntime"}},"required":["integrity","runtime"],"type":"object"},"FederationLibraryType":{"enum":["module","script","commonjs-module"],"type":"string"},"FederationTarget":{"additionalProperties":false,"description":"One target-specific Module Federation remote container.","properties":{"assetLock":{"description":"Relative path to the build-generated content-addressed asset graph lock.","type":"string"},"assetLockIntegrity":{"description":"SHA-256 integrity of the canonical asset-lock bytes.","type":"string"},"exposes":{"additionalProperties":{"$ref":"#/$defs/FederationExpose"},"type":"object"},"libraryType":{"$ref":"#/$defs/FederationLibraryType"},"manifest":{"type":["string","null"]},"manifestIntegrity":{"type":["string","null"]},"remoteEntry":{"type":"string"},"remoteEntryIntegrity":{"type":"string"},"remoteName":{"type":"string"}},"required":["remoteName","remoteEntry","remoteEntryIntegrity","assetLock","assetLockIntegrity","libraryType","exposes"],"type":"object"},"HostDeclarativeContributionTarget":{"additionalProperties":false,"description":"A contribution whose declarative configuration TAP materializes directly.","properties":{"runtime":{"$ref":"#/$defs/HostDeclarativeRuntime"}},"required":["runtime"],"type":"object"},"HostDeclarativeRuntime":{"description":"The only runtime accepted by an expose-free contribution target binding.","enum":["host-declarative"],"type":"string"},"InstancePolicy":{"enum":["per-mount","per-conversation","per-channel","per-workspace","singleton"],"type":"string"},"KnowledgeOptions":{"additionalProperties":false,"properties":{"materialization":{"type":["string","null"]},"schema":{"type":"string"}},"required":["schema"],"type":"object"},"LifecycleScope":{"enum":["installation","realm","contribution","mount"],"type":"string"},"McpAppOptions":{"additionalProperties":false,"description":"One sandboxed MCP App bound to exact tool and UI resource contributions.","properties":{"protocolVersion":{"type":"string"},"resourceContributionId":{"type":"string"},"serverContributionId":{"type":"string"},"toolContributionId":{"type":"string"}},"required":["serverContributionId","toolContributionId","resourceContributionId","protocolVersion"],"type":"object"},"McpConsumerPolicy":{"additionalProperties":false,"description":"Publisher-declared upper bound on who may consume an MCP server.\\n\\nBoth lists default empty. Installation policy may select or remove entries,\\nbut cannot authorize consumers outside this signed maximum.","properties":{"contributionIds":{"description":"Exact same-package contribution identities eligible to receive access.","items":{"type":"string"},"type":"array"},"externalConsumers":{"description":"External platform consumer classes eligible for narrower host grants.","items":{"$ref":"#/$defs/McpExternalConsumerClass"},"type":"array"}},"type":"object"},"McpExternalConsumerClass":{"description":"Closed external consumer classes a publisher may include in its maximum.","enum":["selected-miniapps","selected-specialists","chat","workflows","platform"],"type":"string"},"McpHttpCredentialRequirement":{"additionalProperties":false,"description":"One host-held credential injected into a declared Streamable HTTP header.\\n\\nDescriptors name requirements and destinations only. Credential values are\\nresolved from host-owned secret storage after installation consent.","properties":{"header":{"type":"string"},"id":{"type":"string"}},"required":["id","header"],"type":"object"},"McpPromptOptions":{"additionalProperties":false,"description":"One MCP prompt promoted from its owning server\'s live catalog.","properties":{"promptName":{"type":"string"},"serverContributionId":{"type":"string"}},"required":["serverContributionId","promptName"],"type":"object"},"McpResourceOptions":{"additionalProperties":false,"description":"One exact MCP resource promoted from its owning server\'s live catalog.","properties":{"mimeType":{"type":["string","null"]},"serverContributionId":{"type":"string"},"uri":{"type":"string"}},"required":["serverContributionId","uri"],"type":"object"},"McpResourceTemplateOptions":{"additionalProperties":false,"description":"One MCP resource template promoted from its owning server\'s live catalog.","properties":{"mimeType":{"type":["string","null"]},"serverContributionId":{"type":"string"},"uriTemplate":{"type":"string"}},"required":["serverContributionId","uriTemplate"],"type":"object"},"McpServerImplementation":{"description":"Mutually exclusive ways TAP can activate a declared MCP server.","oneOf":[{"additionalProperties":false,"description":"Load the server adapter from the contribution\'s verified Federation expose.","properties":{"type":{"const":"package-runtime","type":"string"}},"required":["type"],"type":"object"},{"additionalProperties":false,"description":"Spawn a reviewed local process and communicate over stdio.","properties":{"args":{"items":{"type":"string"},"type":"array"},"command":{"type":"string"},"credentialRequirements":{"items":{"$ref":"#/$defs/McpStdioCredentialRequirement"},"type":"array"},"type":{"const":"stdio","type":"string"}},"required":["type","command"],"type":"object"},{"additionalProperties":false,"description":"Connect to an HTTPS MCP endpoint using Streamable HTTP.","properties":{"credentialRequirements":{"items":{"$ref":"#/$defs/McpHttpCredentialRequirement"},"type":"array"},"type":{"const":"streamable-http","type":"string"},"url":{"type":"string"}},"required":["type","url"],"type":"object"}]},"McpServerOptions":{"additionalProperties":false,"description":"One package-declared MCP server and its maximum consumer audience.","properties":{"consumerPolicy":{"$ref":"#/$defs/McpConsumerPolicy","default":{}},"implementation":{"$ref":"#/$defs/McpServerImplementation"},"protocolVersion":{"type":"string"}},"required":["protocolVersion","implementation"],"type":"object"},"McpStdioCredentialRequirement":{"additionalProperties":false,"description":"One host-held credential injected into a declared stdio environment slot.\\n\\nDescriptors name requirements and destinations only. Credential values are\\nresolved from host-owned secret storage after installation consent.","properties":{"environmentVariable":{"type":"string"},"id":{"type":"string"}},"required":["id","environmentVariable"],"type":"object"},"McpToolOptions":{"additionalProperties":false,"description":"One MCP tool promoted from its owning server\'s live catalog.","properties":{"effects":{"items":{"$ref":"#/$defs/RuntimeEffect"},"type":"array"},"inputSchema":{"type":["string","null"]},"outputSchema":{"type":["string","null"]},"serverContributionId":{"type":"string"},"timeoutMs":{"format":"uint64","minimum":0,"type":["integer","null"]},"toolName":{"type":"string"}},"required":["serverContributionId","toolName"],"type":"object"},"MiniAppBundleManifest":{"additionalProperties":false,"description":"Manifest for a single TAP miniapp bundle.","properties":{"$schema":{"description":"Optional JSON Schema reference for editor support.","type":["string","null"]},"description":{"description":"Short human-readable summary of the miniapp.","minLength":1,"type":"string"},"entry":{"$ref":"#/$defs/MiniAppSource","description":"Entry file, package specifier, or URL for the miniapp config."},"icon":{"description":"Lucide-compatible icon name shown by host UI surfaces.","minLength":1,"type":["string","null"]},"name":{"description":"Display name for the miniapp.","minLength":1,"type":"string"},"runtime":{"$ref":"#/$defs/TapRuntime","description":"TAP miniapp runtime version."},"version":{"description":"Miniapp version.","minLength":1,"type":"string"}},"required":["name","description","version","runtime","entry"],"title":"Tap Miniapp Bundle Manifest","type":"object"},"MiniAppCategory":{"description":"Closed Marketplace discovery taxonomy for descriptor-backed miniapps.","enum":["productivity","developer-tools","creativity","communication","data-and-analytics","business","education","media-and-entertainment","utilities","other"],"type":"string"},"MiniAppSource":{"description":"Absolute URL or local path. Bundle entry paths are resolved relative to the manifest that declares them.","oneOf":[{"additionalProperties":false,"properties":{"Path":{"additionalProperties":false,"properties":{"path":{"minLength":1,"type":"string"}},"required":["path"],"type":"object"}},"required":["Path"],"type":"object"},{"additionalProperties":false,"properties":{"Url":{"additionalProperties":false,"properties":{"hash":{"description":"Expected SHA-256 hex digest for the remote source bytes.","type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"}},"required":["Url"],"type":"object"},{"description":"Absolute URL or local path. Bundle entry paths are resolved relative to the manifest that declares them.","minLength":1,"type":"string"},{"additionalProperties":false,"properties":{"hash":{"description":"Expected SHA-256 hex digest for the remote source bytes.","type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"}]},"ModuleContributionTarget":{"additionalProperties":false,"description":"A contribution implemented by one module in the locked Federation graph.","properties":{"expose":{"type":"string"},"runtime":{"$ref":"#/$defs/ExecutionRuntime"}},"required":["expose","runtime"],"type":"object"},"PackageCompatibility":{"additionalProperties":false,"description":"Host and SDK compatibility checked before remote loading.","properties":{"tapHost":{"type":"string"},"tapSdk":{"type":"string"}},"required":["tapSdk","tapHost"],"type":"object"},"PackageContribution":{"description":"Strict contribution union covering the initial TAP extension catalog.","oneOf":[{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"ui.surface","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/UiSurfaceOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"ui.renderer","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/RendererOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"chat.block","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/ChatBlockOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"action.command","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/CommandOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"prompt","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/ExecutableOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"skill","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/ExecutableOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"tool","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/ExecutableOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"specialist","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/ExecutableOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"task.type","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/TaskOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"task.attribute","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/TaskOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"task.view","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/TaskOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"task.action","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/TaskOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"task.template","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/TaskOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"workflow","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/WorkflowOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"workflow.node","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/WorkflowNodeOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"automation.trigger","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/ExecutableOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"mcp.server","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/McpServerOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"mcp.tool","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/McpToolOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"mcp.prompt","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/McpPromptOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"mcp.resource","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/McpResourceOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"mcp.resource-template","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/McpResourceTemplateOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"mcp.app","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/McpAppOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"miniapp","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/CompositionOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"integration.connector","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/CompositionOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"browser.extension","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/BrowserExtensionOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"knowledge.plot-template","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/KnowledgeOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"knowledge.source-provider","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/KnowledgeOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"knowledge.enricher","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/KnowledgeOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"knowledge.retriever","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/KnowledgeOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"provider.adapter","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/ExecutableOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"template","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/DeclarativeOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"},{"additionalProperties":false,"description":"Fields shared by every package contribution.","properties":{"apiVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"authorization":{"$ref":"#/$defs/AuthorizationBinding","default":{}},"id":{"type":"string"},"kind":{"const":"permission.catalog","type":"string"},"lifecycleScope":{"$ref":"#/$defs/LifecycleScope","default":"mount"},"options":{"$ref":"#/$defs/PermissionCatalogOptions"},"publishes":{"items":{"type":"string"},"type":"array"},"subscribes":{"items":{"type":"string"},"type":"array"},"targets":{"additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/ContributionTarget"},"mobile":{"$ref":"#/$defs/ContributionTarget"},"node":{"$ref":"#/$defs/ContributionTarget"},"quickjs":{"$ref":"#/$defs/ContributionTarget"},"worker":{"$ref":"#/$defs/ContributionTarget"},"workflow-host":{"$ref":"#/$defs/ContributionTarget"}},"type":"object"}},"required":["kind","id","apiVersion","options"],"type":"object"}]},"PackageDependency":{"additionalProperties":false,"properties":{"alias":{"type":"string"},"optional":{"default":false,"type":"boolean"},"packageId":{"type":"string"},"version":{"type":"string"}},"required":["alias","packageId","version"],"type":"object"},"PackageEventCatalog":{"additionalProperties":false,"description":"Package-defined published and consumed events.","properties":{"publishes":{"items":{"$ref":"#/$defs/PublishedEvent"},"type":"array"},"subscribes":{"items":{"$ref":"#/$defs/SubscribedEvent"},"type":"array"}},"type":"object"},"PackageIdentity":{"additionalProperties":false,"description":"Immutable identity carried by a package descriptor.","properties":{"namespace":{"type":"string"},"organizationId":{"type":["string","null"]},"packageId":{"type":"string"},"parentPackageId":{"type":["string","null"]},"publisherId":{"type":"string"},"slug":{"type":"string"}},"required":["packageId","publisherId","namespace","slug"],"type":"object"},"PackageLifecyclePolicy":{"additionalProperties":false,"properties":{"checkpoint":{"$ref":"#/$defs/PersistencePolicy","default":"none"},"checkpointSchema":{"type":["string","null"]},"lifecycleExpose":{"type":["string","null"]}},"type":"object"},"PackagePermissionAction":{"additionalProperties":false,"properties":{"autonomyCeiling":{"$ref":"#/$defs/AutonomyLevel"},"consent":{"$ref":"#/$defs/ConsentPolicy"},"delegatedActors":{"items":{"$ref":"#/$defs/ActorKind"},"type":"array"},"directActors":{"items":{"$ref":"#/$defs/ActorKind"},"type":"array"},"id":{"type":"string"},"resource":{"type":"string"},"risk":{"$ref":"#/$defs/PermissionRisk"},"scopes":{"items":{"$ref":"#/$defs/ContributionScope"},"type":"array"}},"required":["id","resource","scopes","directActors","delegatedActors","autonomyCeiling","consent","risk"],"type":"object"},"PackagePermissionLevel":{"additionalProperties":false,"properties":{"actions":{"items":{"type":"string"},"type":"array"},"assignableTo":{"items":{"$ref":"#/$defs/ActorKind"},"type":"array"},"id":{"type":"string"},"includes":{"items":{"type":"string"},"type":"array"}},"required":["id","assignableTo"],"type":"object"},"PackagePresentation":{"additionalProperties":false,"description":"Package presentation metadata and content-addressed visual assets.","properties":{"assets":{"items":{"$ref":"#/$defs/PresentationAsset"},"type":"array"},"categories":{"description":"Ordered Marketplace discovery categories. Existing private/manual\\npackages may omit categories; published listings validate their own\\ndiscovery requirements before accepting a release.","items":{"$ref":"#/$defs/MiniAppCategory"},"maxItems":3,"type":"array","uniqueItems":true},"description":{"type":"string"},"iconAssets":{"default":[],"description":"Ordered parent-package icon candidates. Empty inherits every app-icon\\nfor backwards compatibility; collection packages should select their\\nparent artwork explicitly so child surfaces cannot replace it.","items":{"type":"string"},"type":"array"},"name":{"type":"string"}},"required":["name","description"],"type":"object"},"PermissionCatalogOptions":{"additionalProperties":false,"description":"A signed package-local permission catalog. These are definitions, never grants.","properties":{"actions":{"items":{"$ref":"#/$defs/PackagePermissionAction"},"type":"array"},"levels":{"items":{"$ref":"#/$defs/PackagePermissionLevel"},"type":"array"},"roleRecommendations":{"items":{"$ref":"#/$defs/RoleRecommendation"},"type":"array"}},"type":"object"},"PermissionRisk":{"enum":["read","write","consequential","financial"],"type":"string"},"PersistencePolicy":{"enum":["none","checkpoint","retained"],"type":"string"},"PresentationAsset":{"additionalProperties":false,"description":"A PNG or SVG package, publisher, or organization presentation asset.","properties":{"integrity":{"type":"string"},"mediaType":{"$ref":"#/$defs/PresentationAssetMediaType"},"path":{"type":"string"},"role":{"$ref":"#/$defs/PresentationAssetRole"},"sizes":{"items":{"type":"string"},"type":"array"},"theme":{"$ref":"#/$defs/PresentationAssetTheme","default":"any"}},"required":["role","mediaType","path","integrity"],"type":"object"},"PresentationAssetMediaType":{"enum":["image/png","image/svg+xml"],"type":"string"},"PresentationAssetRole":{"enum":["app-icon","publisher-icon","organization-icon","marketplace-card","wordmark"],"type":"string"},"PresentationAssetTheme":{"enum":["any","light","dark"],"type":"string"},"PublishedEvent":{"additionalProperties":false,"properties":{"delivery":{"$ref":"#/$defs/EventDelivery"},"name":{"type":"string"},"schema":{"type":"string"},"schemaVersion":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"visibility":{"$ref":"#/$defs/ContributionScope"}},"required":["name","schema","schemaVersion","visibility","delivery"],"type":"object"},"ReleaseIdentity":{"additionalProperties":false,"description":"Immutable release identity carried by a package descriptor.","properties":{"contentDigest":{"type":"string"},"releaseId":{"type":"string"},"version":{"type":"string"}},"required":["releaseId","version","contentDigest"],"type":"object"},"RendererOptions":{"additionalProperties":false,"properties":{"payloadSchema":{"type":["string","null"]},"protocol":{"type":"string"}},"required":["protocol"],"type":"object"},"RoleRecommendation":{"additionalProperties":false,"properties":{"actor":{"$ref":"#/$defs/ActorKind"},"level":{"type":"string"},"workspaceRole":{"type":"string"}},"required":["actor","workspaceRole","level"],"type":"object"},"RuntimeEffect":{"additionalProperties":false,"properties":{"kind":{"type":"string"},"resources":{"items":{"type":"string"},"type":"array"}},"required":["kind"],"type":"object"},"SubscribedEvent":{"additionalProperties":false,"properties":{"dependency":{"type":["string","null"]},"event":{"type":"string"},"versions":{"items":{"format":"uint16","maximum":65535,"minimum":0,"type":"integer"},"type":"array"}},"required":["event","versions"],"type":"object"},"TapPackageDescriptorV1":{"additionalProperties":false,"description":"Versioned package descriptor inspected before a remote entry is evaluated.","properties":{"$schema":{"description":"Optional JSON Schema reference for editor validation and completion.","type":["string","null"]},"compatibility":{"$ref":"#/$defs/PackageCompatibility","description":"Host and SDK compatibility requirements."},"contributions":{"description":"Statically declared contributions. Code cannot add undeclared contributions at runtime.","items":{"$ref":"#/$defs/PackageContribution"},"type":"array"},"dependencies":{"description":"Package dependencies and optional collection children.","items":{"$ref":"#/$defs/PackageDependency"},"type":"array"},"descriptorVersion":{"description":"Descriptor schema version. Version 1 is the first Federation package contract.","format":"uint16","maximum":1,"minimum":1,"type":"integer"},"events":{"$ref":"#/$defs/PackageEventCatalog","default":{},"description":"Statically declared package event catalog."},"lifecycle":{"$ref":"#/$defs/PackageLifecyclePolicy","default":{"checkpoint":"none"},"description":"Package lifecycle and checkpoint policy."},"package":{"$ref":"#/$defs/PackageIdentity","description":"Immutable package, publisher, namespace, and collection identity."},"presentation":{"$ref":"#/$defs/PackagePresentation","description":"Marketplace and host presentation metadata."},"release":{"$ref":"#/$defs/ReleaseIdentity","description":"Immutable release identity and content digest."},"targets":{"additionalProperties":false,"description":"Target-specific Module Federation containers.","properties":{"desktop":{"$ref":"#/$defs/FederationTarget"},"mobile":{"$ref":"#/$defs/FederationTarget"},"node":{"$ref":"#/$defs/FederationTarget"},"quickjs":{"$ref":"#/$defs/FederationTarget"},"worker":{"$ref":"#/$defs/FederationTarget"},"workflow-host":{"$ref":"#/$defs/FederationTarget"}},"type":"object"}},"required":["descriptorVersion","package","release","presentation","compatibility","targets","contributions"],"type":"object"},"TapRuntime":{"description":"Supported TAP miniapp runtime versions.","enum":[0,1],"type":"integer"},"TaskOptions":{"additionalProperties":false,"properties":{"canonicalStatuses":{"additionalProperties":{"type":"string"},"type":"object"},"migrationExpose":{"type":["string","null"]},"schema":{"type":"string"}},"required":["schema"],"type":"object"},"UiPlacement":{"enum":["workspace-left","channel-apps","chat-right","route","settings","dialog","standalone-window"],"type":"string"},"UiSurfaceOptions":{"additionalProperties":false,"properties":{"description":{"type":["string","null"]},"displayName":{"description":"Surface-specific label. Packages with multiple mini apps must not rely\\non the package-wide Marketplace name for every navigation entry.","type":["string","null"]},"iconAssets":{"default":[],"description":"Ordered package presentation assets eligible for this contribution.\\nEmpty inherits the package-level `presentation.iconAssets` selection.","items":{"type":"string"},"type":"array"},"instancePolicy":{"$ref":"#/$defs/InstancePolicy","default":"per-mount"},"persistence":{"$ref":"#/$defs/PersistencePolicy","default":"none"},"placement":{"$ref":"#/$defs/UiPlacement"},"scope":{"$ref":"#/$defs/ContributionScope"}},"required":["placement","scope"],"type":"object"},"WorkflowCancellationPolicy":{"description":"Cancellation behavior supported by package-provided workflows.","enum":["host-managed"],"type":"string"},"WorkflowCheckpointPolicy":{"description":"Checkpoint behavior supported by the package-contribution ABI.","enum":["none"],"type":"string"},"WorkflowExecutionSemantics":{"additionalProperties":false,"description":"Fixed v1 execution semantics for one immutable package workflow.","properties":{"cancellation":{"$ref":"#/$defs/WorkflowCancellationPolicy"},"checkpoint":{"$ref":"#/$defs/WorkflowCheckpointPolicy"},"retry":{"$ref":"#/$defs/WorkflowRetryPolicy"},"rollback":{"$ref":"#/$defs/WorkflowRollbackPolicy"},"upgrade":{"$ref":"#/$defs/WorkflowUpgradePolicy"}},"required":["retry","cancellation","checkpoint","upgrade","rollback"],"type":"object"},"WorkflowHostPort":{"description":"Narrow host port a package-provided workflow node may request.","enum":["fs","proc","http","clock","crypto","store","source"],"type":"string"},"WorkflowNodeCancellationPolicy":{"description":"Cancellation behavior supported by one package-provided node attempt.","enum":["not-supported"],"type":"string"},"WorkflowNodeEffect":{"description":"Side-effect classification for a package-provided workflow node.","enum":["pure","read","write","exec"],"type":"string"},"WorkflowNodeExecutionSemantics":{"additionalProperties":false,"description":"Fixed v1 execution semantics for one package-provided workflow node.","properties":{"cancellation":{"$ref":"#/$defs/WorkflowNodeCancellationPolicy"},"checkpoint":{"$ref":"#/$defs/WorkflowCheckpointPolicy"},"idempotency":{"$ref":"#/$defs/WorkflowNodeIdempotency"},"maxAttempts":{"format":"uint8","maximum":1,"minimum":1,"type":"integer"},"rollback":{"$ref":"#/$defs/WorkflowRollbackPolicy"},"upgrade":{"$ref":"#/$defs/WorkflowUpgradePolicy"}},"required":["maxAttempts","idempotency","cancellation","checkpoint","upgrade","rollback"],"type":"object"},"WorkflowNodeIdempotency":{"description":"Idempotency claim for the one attempt allowed by the v1 node ABI.","enum":["idempotent","non-idempotent"],"type":"string"},"WorkflowNodeOptions":{"additionalProperties":false,"description":"Exact descriptor options for a canonical `ze-workflows` contributed node.","properties":{"config":{"$ref":"#/$defs/WorkflowSchemaReference"},"effect":{"$ref":"#/$defs/WorkflowNodeEffect"},"execution":{"$ref":"#/$defs/WorkflowNodeExecutionSemantics"},"exportName":{"type":"string"},"inputs":{"items":{"$ref":"#/$defs/WorkflowPort"},"type":"array"},"nodeKind":{"type":"string"},"outcomes":{"items":{"type":"string"},"type":"array"},"outputs":{"items":{"$ref":"#/$defs/WorkflowPort"},"type":"array"},"requires":{"items":{"$ref":"#/$defs/WorkflowHostPort"},"type":"array"}},"required":["nodeKind","exportName","config","inputs","outputs","outcomes","effect","requires","execution"],"type":"object"},"WorkflowOptions":{"additionalProperties":false,"description":"Exact descriptor options for a canonical `ze-workflows` workflow.\\n\\nThe module expose and runtime remain in [`ContributionBase::targets`]; the\\npackage host combines that verified target with these inert declarations to\\nbuild the release-scoped `ze-workflows` catalog.","properties":{"exportName":{"type":"string"},"inputs":{"items":{"$ref":"#/$defs/WorkflowPort"},"type":"array"},"lifecycle":{"$ref":"#/$defs/WorkflowExecutionSemantics"},"manifest":{"$ref":"#/$defs/WorkflowSchemaReference"},"outputs":{"items":{"$ref":"#/$defs/WorkflowPort"},"type":"array"},"workflowId":{"type":"string"}},"required":["workflowId","exportName","manifest","inputs","outputs","lifecycle"],"type":"object"},"WorkflowPort":{"additionalProperties":false,"description":"One named, schema-bound workflow input or output port.","properties":{"name":{"type":"string"},"required":{"type":"boolean"},"schema":{"$ref":"#/$defs/WorkflowSchemaReference"}},"required":["name","schema","required"],"type":"object"},"WorkflowRetryPolicy":{"description":"Retry behavior supported by package-provided workflow definitions.","enum":["none"],"type":"string"},"WorkflowRollbackPolicy":{"description":"Rollback ownership for package-provided workflows and nodes.","enum":["host-managed"],"type":"string"},"WorkflowSchemaReference":{"additionalProperties":false,"description":"Exact schema identity admitted by the canonical `ze-workflows` package ABI.\\n\\n`id` is the release-relative schema asset path and `integrity` is the SRI of\\nthe canonical JSON document. The target\'s [`PackageAssetLockV1`] separately\\nbinds the raw file bytes; the package host verifies both identities before\\nit evaluates the workflow-host export.","properties":{"id":{"type":"string"},"integrity":{"type":"string"}},"required":["id","integrity"],"type":"object"},"WorkflowUpgradePolicy":{"description":"Upgrade behavior supported by immutable package workflow definitions.","enum":["restart"],"type":"string"}},"$id":"https://tap.local/schemas/manifest.tap.schema.json","$schema":"https://json-schema.org/draft/2020-12/schema","anyOf":[{"$ref":"#/$defs/TapPackageDescriptorV1","description":"A static TAP package descriptor, validated before its remote code is evaluated."},{"$ref":"#/$defs/MiniAppBundleManifest","description":"A single miniapp bundle with its runtime entrypoint."}],"description":"Manifest for one Tap package or legacy miniapp bundle.","title":"Tap Miniapp Manifest"}');
13
+ function deterministicSurfaceTestUuid(seed, frameInstanceId, counter) {
14
+ if (!Number.isInteger(seed) || seed < 0 || seed > 0xffffffff || 0 === frameInstanceId.length || !Number.isInteger(counter) || counter < 0 || counter > 0xffffffff) throw new Error('Invalid TAP Test Lab deterministic UUID input.');
15
+ const mixWord = (input)=>{
16
+ let value = input + 0x9e3779b9 >>> 0;
17
+ value = Math.imul(value ^ value >>> 16, 0x21f0aaad) >>> 0;
18
+ value = Math.imul(value ^ value >>> 15, 0x735a2d97) >>> 0;
19
+ return (value ^ value >>> 15) >>> 0;
20
+ };
21
+ let scope = 0x811c9dc5;
22
+ for(let index = 0; index < frameInstanceId.length; index += 1)scope = Math.imul(scope ^ frameInstanceId.charCodeAt(index), 0x01000193) >>> 0;
23
+ const bytes = new Uint8Array(16);
24
+ const view = new DataView(bytes.buffer);
25
+ for(let index = 0; index < 4; index += 1)view.setUint32(4 * index, mixWord((seed ^ scope ^ Math.imul(counter + 1, 0x9e3779b1) ^ Math.imul(index + 1, 0x85ebca6b)) >>> 0));
26
+ bytes[6] = 0x0f & bytes[6] | 0x40;
27
+ bytes[8] = 0x3f & bytes[8] | 0x80;
28
+ const hex = Array.from(bytes, (byte)=>byte.toString(16).padStart(2, '0'));
29
+ return hex.slice(0, 4).join('') + '-' + hex.slice(4, 6).join('') + '-' + hex.slice(6, 8).join('') + '-' + hex.slice(8, 10).join('') + '-' + hex.slice(10).join('');
30
+ }
12
31
  const MAX_SVG_DEPTH = 64;
13
32
  const MAX_SVG_ELEMENTS = 10000;
14
33
  const MAX_SVG_ATTRIBUTES_PER_ELEMENT = 64;
@@ -315,12 +334,35 @@ const normalizeFederationOptions = (target, federation)=>{
315
334
  dts: false
316
335
  };
317
336
  };
318
- const TAP_FEDERATED_SURFACE_HTML = `<!doctype html>
337
+ const exactEmbeddedFrameOrigins = (descriptor)=>{
338
+ const origins = new Set();
339
+ for (const contribution of descriptor.contributions ?? [])if ('ui.surface' === contribution.kind) {
340
+ for (const effect of contribution.authorization?.effects ?? [])if ('embedded-frame' === effect.kind) for (const resource of effect.resources ?? []){
341
+ let url;
342
+ try {
343
+ url = new URL(resource);
344
+ } catch {
345
+ throw new Error(`TAP UI surface ${contribution.id} embedded-frame resource "${resource}" must be an exact canonical HTTPS origin.`);
346
+ }
347
+ if ('https:' !== url.protocol || !url.hostname || url.username || url.password || url.origin !== resource) throw new Error(`TAP UI surface ${contribution.id} embedded-frame resource "${resource}" must be an exact canonical HTTPS origin.`);
348
+ origins.add(resource);
349
+ }
350
+ }
351
+ return [
352
+ ...origins
353
+ ].sort();
354
+ };
355
+ const tapFederatedSurfaceHtml = (descriptor)=>{
356
+ const frameSources = [
357
+ "'self'",
358
+ ...exactEmbeddedFrameOrigins(descriptor)
359
+ ].join(' ');
360
+ return `<!doctype html>
319
361
  <html lang="en">
320
362
  <head>
321
363
  <meta charset="utf-8">
322
364
  <meta name="viewport" content="width=device-width,initial-scale=1">
323
- <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; frame-src 'self'; worker-src 'self' blob:; object-src 'none'; base-uri 'none'; form-action 'none'">
365
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; frame-src ${frameSources}; worker-src 'self' blob:; object-src 'none'; base-uri 'none'; form-action 'none'">
324
366
  <title>TAP mini app</title>
325
367
  <style>html,body,#tap-root{height:100%;width:100%;margin:0}body{overflow:hidden;background:transparent}#tap-error{box-sizing:border-box;display:none;min-height:100%;padding:24px;font:14px/1.5 system-ui,sans-serif;color:#b42318;background:#fff}</style>
326
368
  </head>
@@ -331,7 +373,9 @@ const TAP_FEDERATED_SURFACE_HTML = `<!doctype html>
331
373
  </body>
332
374
  </html>
333
375
  `;
376
+ };
334
377
  const TAP_FEDERATED_DOCUMENT_ID_GLOBAL_KEY = JSON.stringify(MINIAPP_DOCUMENT_ID_GLOBAL_KEY);
378
+ const DETERMINISTIC_SURFACE_TEST_UUID_SOURCE = deterministicSurfaceTestUuid.toString();
335
379
  const TAP_FEDERATED_SURFACE_RUNTIME = String.raw`const params = new URLSearchParams(location.search);
336
380
  const required = (name) => {
337
381
  const value = params.get(name)?.trim();
@@ -358,6 +402,19 @@ const optionalSafeId = (name) => {
358
402
  }
359
403
  return value;
360
404
  };
405
+ const optionalUint32 = (name) => {
406
+ const values = params.getAll(name);
407
+ if (values.length === 0) return undefined;
408
+ const value = values[0];
409
+ if (
410
+ values.length !== 1 ||
411
+ !/^(?:0|[1-9]\d{0,9})$/u.test(value) ||
412
+ Number(value) > 0xffffffff
413
+ ) {
414
+ throw new Error('Invalid federated surface unsigned integer: ' + name);
415
+ }
416
+ return Number(value);
417
+ };
361
418
  const packageTarget = optionalSafeId('target');
362
419
  if (packageTarget !== undefined && packageTarget !== 'desktop' && packageTarget !== 'mobile') {
363
420
  throw new Error('Invalid federated surface package target.');
@@ -385,6 +442,33 @@ const instanceId = safeId('logicalInstanceId', 'instanceId');
385
442
  const workspaceId = optionalSafeId('workspaceId');
386
443
  const channelId = optionalSafeId('channelId');
387
444
  const conversationId = optionalSafeId('conversationId');
445
+ const testEntropySeed = optionalUint32('testEntropySeed');
446
+ let testEntropyCounter = 0;
447
+ const deterministicTestUuid = (${DETERMINISTIC_SURFACE_TEST_UUID_SOURCE});
448
+ const resetSurfaceEntropy = () => {
449
+ testEntropyCounter = 0;
450
+ };
451
+ const entropy = Object.freeze({
452
+ randomUUID() {
453
+ if (testEntropySeed === undefined) {
454
+ const randomUUID = globalThis.crypto?.randomUUID;
455
+ if (typeof randomUUID !== 'function') {
456
+ throw new Error('The TAP surface runtime requires cryptographic UUID support.');
457
+ }
458
+ return randomUUID.call(globalThis.crypto);
459
+ }
460
+ if (testEntropyCounter > 0xffffffff) {
461
+ throw new Error('The TAP Test Lab deterministic UUID stream is exhausted.');
462
+ }
463
+ const value = deterministicTestUuid(
464
+ testEntropySeed,
465
+ frameInstanceId,
466
+ testEntropyCounter,
467
+ );
468
+ testEntropyCounter += 1;
469
+ return value;
470
+ },
471
+ });
388
472
  const expose = required('expose');
389
473
  if (!/^\.\/[A-Za-z0-9._/-]+$/u.test(expose) || expose.includes('..')) {
390
474
  throw new Error('Invalid Module Federation expose.');
@@ -465,6 +549,8 @@ const MAX_RECEIPT_LINE_CHARS = 512;
465
549
  const MAX_RECEIPT_TOTAL_CHARS = 32768;
466
550
  const TERMINAL_GET_CAPABILITIES_ACTION = 'tap.platform.terminal.v1.get-capabilities';
467
551
  const TERMINAL_OPEN_ACTION = 'tap.platform.terminal.v1.open';
552
+ const AUTHORIZATION_CHECK_ACTION = 'tap.platform.authorization.check';
553
+ const AUTHORIZATION_AUTONOMY_LEVELS = new Set(['listen', 'plan', 'do']);
468
554
  const TERMINAL_PROFILES = new Set(['workspace-shell', 'neovim']);
469
555
  const MAX_TERMINAL_WRITE_BYTES = 64 * 1024;
470
556
  const MAX_PENDING_TERMINAL_COMMANDS = 32;
@@ -695,6 +781,36 @@ const projectResultFields = (value, fields, label) => {
695
781
  }
696
782
  return Object.freeze(projected);
697
783
  };
784
+ const projectExactBooleanResult = (value, field, label) => {
785
+ try {
786
+ const prototype =
787
+ value && typeof value === 'object' ? Object.getPrototypeOf(value) : null;
788
+ if (
789
+ !value ||
790
+ typeof value !== 'object' ||
791
+ Array.isArray(value) ||
792
+ (prototype !== null &&
793
+ prototype !== Object.prototype &&
794
+ Object.getPrototypeOf(prototype) !== null)
795
+ ) {
796
+ throw new Error(label + ' returned an invalid result.');
797
+ }
798
+ const keys = Reflect.ownKeys(value);
799
+ const descriptor = Object.getOwnPropertyDescriptor(value, field);
800
+ if (
801
+ keys.length !== 1 ||
802
+ keys[0] !== field ||
803
+ !descriptor ||
804
+ !Object.prototype.hasOwnProperty.call(descriptor, 'value') ||
805
+ typeof descriptor.value !== 'boolean'
806
+ ) {
807
+ throw new Error(label + ' returned an invalid result.');
808
+ }
809
+ return Object.freeze({ [field]: descriptor.value });
810
+ } catch {
811
+ throw new Error(label + ' returned an invalid result.');
812
+ }
813
+ };
698
814
  const invokeSdkHostAction = (
699
815
  action,
700
816
  options,
@@ -1522,6 +1638,29 @@ const appChat = Object.freeze({
1522
1638
  return invokeSdkHostAction('sendTextToChat', { text }, 'app.chat.sendTextToChat');
1523
1639
  },
1524
1640
  });
1641
+ const authorization = Object.freeze({
1642
+ check(options) {
1643
+ requireOptionsObject(options, 'app.authorization.check');
1644
+ if (
1645
+ Object.keys(options).length !== 2 ||
1646
+ !Object.prototype.hasOwnProperty.call(options, 'actionId') ||
1647
+ !Object.prototype.hasOwnProperty.call(options, 'autonomy') ||
1648
+ !validPlatformPartition(options.actionId, 512) ||
1649
+ !AUTHORIZATION_AUTONOMY_LEVELS.has(options.autonomy)
1650
+ ) {
1651
+ return Promise.reject(
1652
+ new Error('app.authorization.check options are invalid.'),
1653
+ );
1654
+ }
1655
+ return invokeSdkHostAction(
1656
+ AUTHORIZATION_CHECK_ACTION,
1657
+ { actionId: options.actionId, autonomy: options.autonomy },
1658
+ 'app.authorization.check',
1659
+ ).then((result) =>
1660
+ projectExactBooleanResult(result, 'allowed', 'app.authorization.check'),
1661
+ );
1662
+ },
1663
+ });
1525
1664
 
1526
1665
  const platformAuth = Object.freeze({
1527
1666
  getUserProfile() {
@@ -1711,6 +1850,7 @@ const miniappSdk = Object.freeze({
1711
1850
  projects,
1712
1851
  workflows,
1713
1852
  navigation,
1853
+ authorization,
1714
1854
  chat: miniappChat,
1715
1855
  storage,
1716
1856
  session,
@@ -1787,6 +1927,7 @@ const mountSurface = async () => {
1787
1927
  if (surfaceMounted) return;
1788
1928
  const mount = uiModule?.mount ?? uiModule?.default?.mount;
1789
1929
  if (typeof mount !== 'function') throw new Error('The UI expose must export mount(container, context).');
1930
+ resetSurfaceEntropy();
1790
1931
  mounted = await mount(root, Object.freeze({
1791
1932
  packageId,
1792
1933
  packageNamespace,
@@ -1800,6 +1941,7 @@ const mountSurface = async () => {
1800
1941
  channelId,
1801
1942
  conversationId,
1802
1943
  events,
1944
+ entropy,
1803
1945
  hostAuthority,
1804
1946
  }));
1805
1947
  surfaceMounted = true;
@@ -2008,33 +2150,6 @@ window.addEventListener('pagehide', () => {
2008
2150
  try { void unmountSurface(); } catch { /* page teardown is best-effort */ }
2009
2151
  }, { once: true });
2010
2152
  `;
2011
- const isUrl = (value)=>{
2012
- try {
2013
- new URL(value);
2014
- return true;
2015
- } catch {
2016
- return false;
2017
- }
2018
- };
2019
- const registerTapManifestAjvFormats = (ajv)=>{
2020
- ajv.addFormat('uri', {
2021
- type: 'string',
2022
- validate: isUrl
2023
- });
2024
- ajv.addFormat('uint8', {
2025
- type: 'number',
2026
- validate: (value)=>Number.isInteger(value) && value >= 0 && value <= 255
2027
- });
2028
- ajv.addFormat('uint16', {
2029
- type: 'number',
2030
- validate: (value)=>Number.isInteger(value) && value >= 0 && value <= 65535
2031
- });
2032
- ajv.addFormat('uint64', {
2033
- type: 'number',
2034
- validate: (value)=>Number.isSafeInteger(value) && value >= 0
2035
- });
2036
- return ajv;
2037
- };
2038
2153
  const getSchemaValidator = async ()=>{
2039
2154
  if (!schemaValidator) {
2040
2155
  const ajv = registerTapManifestAjvFormats(new __rspack_external_ajv_dist_2020_js_e85899db["default"]({
@@ -2101,6 +2216,14 @@ const toVersionedAssetPath = (filePath, contents)=>{
2101
2216
  };
2102
2217
  const minifyInlineCss = (css)=>css.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\s+/g, ' ').replace(/\s*([{}:;,>])\s*/g, '$1').trim();
2103
2218
  const minifyHtml = (html)=>html.replace(/<!--(?!\[if\b)[\s\S]*?-->/gi, '').replace(/<style\b([^>]*)>([\s\S]*?)<\/style>/gi, (_tag, attrs, css)=>`<style${attrs}>${minifyInlineCss(css)}</style>`).replace(/>\s+</g, '><').replace(/\s{2,}/g, ' ').trim();
2219
+ const isUrl = (value)=>{
2220
+ try {
2221
+ new URL(value);
2222
+ return true;
2223
+ } catch {
2224
+ return false;
2225
+ }
2226
+ };
2104
2227
  const toBuffer = (source)=>Buffer.isBuffer(source) ? source : Buffer.from(source);
2105
2228
  const isBundleManifest = (manifest)=>'entry' in manifest;
2106
2229
  const isPackageManifest = (manifest)=>"descriptorVersion" in manifest && 1 === manifest.descriptorVersion;
@@ -3138,7 +3261,7 @@ const setupFederatedTapPackage = (api, options, manifestPath)=>{
3138
3261
  if (Object.values(target.exposes).some((expose)=>'webview' === expose.runtime)) for (const [assetPath, contents] of [
3139
3262
  [
3140
3263
  TAP_FEDERATED_SURFACE_HTML_PATH,
3141
- TAP_FEDERATED_SURFACE_HTML
3264
+ tapFederatedSurfaceHtml(descriptor)
3142
3265
  ],
3143
3266
  [
3144
3267
  TAP_FEDERATED_SURFACE_RUNTIME_PATH,
@@ -3537,4 +3660,5 @@ const tapLib = (options = {})=>{
3537
3660
  ]
3538
3661
  };
3539
3662
  };
3540
- export { assembleTapPackage, assertPortableTapPackageArtifacts, pluginTap, registerTapManifestAjvFormats, tapLib };
3663
+ export { registerTapManifestAjvFormats } from "../internal/json-schema.js";
3664
+ export { assembleTapPackage, assertPortableTapPackageArtifacts, pluginTap, tapLib };
package/dist/sdk.d.ts CHANGED
@@ -98,6 +98,29 @@ export declare type MiniAppAuthApi = {
98
98
  getUserProfile(): MiniAppMaybePromise<MiniAppUserProfile | null>;
99
99
  };
100
100
 
101
+ /**
102
+ * Read-only authorization introspection for custom surface behavior.
103
+ *
104
+ * The host rejects action IDs that are not declared by the exact mounted
105
+ * surface. A declared action resolves to the current dynamic allow/deny
106
+ * decision without executing the action.
107
+ */
108
+ export declare type MiniAppAuthorizationApi = {
109
+ check(options: MiniAppAuthorizationCheckOptions): Promise<MiniAppAuthorizationCheckResult>;
110
+ };
111
+
112
+ /** Canonical autonomy requested for one descriptor-declared package action. */
113
+ export declare type MiniAppAuthorizationAutonomy = 'listen' | 'plan' | 'do';
114
+
115
+ export declare type MiniAppAuthorizationCheckOptions = {
116
+ actionId: string;
117
+ autonomy: MiniAppAuthorizationAutonomy;
118
+ };
119
+
120
+ export declare type MiniAppAuthorizationCheckResult = {
121
+ allowed: boolean;
122
+ };
123
+
101
124
  /**
102
125
  * @capability miniapp-platform
103
126
  */
@@ -317,6 +340,7 @@ export declare type MiniAppPlatformApi = {
317
340
  navigation: {
318
341
  open(options: OpenNavigationOptions): void | Promise<void>;
319
342
  };
343
+ authorization: MiniAppAuthorizationApi;
320
344
  chat: MiniAppChatApi;
321
345
  storage: MiniAppStorageApi;
322
346
  session: MiniAppSessionApi;
package/dist/surface.d.ts CHANGED
@@ -4,6 +4,19 @@
4
4
  */
5
5
  export declare function resolvePackageAssetUrl(context: Pick<TapFederatedSurfaceMountContext, 'packageAssetBaseUrl'>, relativePath: string): URL;
6
6
 
7
+ /**
8
+ * Host-owned entropy for release-scoped identifiers.
9
+ *
10
+ * Ordinary TAP surfaces use the browser's cryptographically strong UUID
11
+ * source. Test Lab mounts derive a deterministic stream from the selected
12
+ * profile seed and exact frame identity, then reset it before each mount so
13
+ * app-owned state is reproducible without weakening production identifiers,
14
+ * colliding across retained remounts, or relying on ambient test globals.
15
+ */
16
+ export declare interface TapFederatedSurfaceEntropy {
17
+ randomUUID(): string;
18
+ }
19
+
7
20
  /**
8
21
  * Read-only authority projected by TAP for the exact package release/frame.
9
22
  * A candidate frame starts without authority and may only perform host-backed
@@ -34,6 +47,7 @@ export declare interface TapFederatedSurfaceMountContext {
34
47
  readonly channelId?: string;
35
48
  readonly conversationId?: string;
36
49
  readonly events: TapPackageEventPublisher;
50
+ readonly entropy: TapFederatedSurfaceEntropy;
37
51
  readonly hostAuthority: TapFederatedSurfaceHostAuthority;
38
52
  }
39
53
 
@@ -0,0 +1,38 @@
1
+ import type { RstestConfig } from '@rstest/core';
2
+
3
+ /**
4
+ * Define an Rstest suite with TAP's exact, deterministic Test Lab policy.
5
+ *
6
+ * User configuration remains composable, but isolation, worker count,
7
+ * concurrency, retries, environment, and empty-suite behavior fail closed.
8
+ */
9
+ export declare function defineTapRstestConfig(options?: TapRstestConfigOptions): RstestConfig;
10
+
11
+ /**
12
+ * Rstest configuration accepted by TAP's deterministic miniapp runner.
13
+ *
14
+ * The literal fields document runner invariants for JavaScript callers while
15
+ * preventing TypeScript callers from selecting incompatible values.
16
+ */
17
+ export declare type TapRstestConfigOptions = Omit<RstestConfig, 'include' | 'isolate' | 'maxConcurrency' | 'passWithNoTests' | 'pool' | 'retry' | 'testEnvironment'> & {
18
+ /** Test files owned by the Test Lab suite. */
19
+ include?: string[];
20
+ /** TAP cases share one exact host session and therefore cannot be isolated. */
21
+ isolate?: false;
22
+ /** TAP serializes cases against one deterministic fixture realm. */
23
+ maxConcurrency?: 1;
24
+ /** An empty Test Lab suite is an error. */
25
+ passWithNoTests?: false;
26
+ /** Additional pool options; worker count is fixed at one. */
27
+ pool?: TapRstestPoolConfig & {
28
+ maxWorkers?: 1;
29
+ };
30
+ /** Assertion retries would hide fixture or lifecycle nondeterminism. */
31
+ retry?: 0;
32
+ /** The TAP adapter controls Chromium through a Node runner. */
33
+ testEnvironment?: 'node';
34
+ };
35
+
36
+ declare type TapRstestPoolConfig = Exclude<Extract<RstestConfig['pool'], object>, readonly unknown[]>;
37
+
38
+ export { }