{
  "$id": "https://tap.local/schemas/tap-miniapp.build.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "TAP Miniapp Build Manifest",
  "description": "Internal target-build staging manifest. Not an import descriptor.",
  "type": "object",
  "properties": {
    "$schema": {
      "description": "Optional JSON Schema reference for editor validation and completion.",
      "type": ["string", "null"]
    },
    "buildSchemaVersion": {
      "description": "Internal target-build schema version.",
      "type": "integer",
      "format": "uint16",
      "minimum": 2,
      "maximum": 2
    },
    "versionLabel": {
      "description": "Author-selected local version label. Registry release identity is minted after import.",
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "presentation": {
      "description": "Local Marketplace and host presentation metadata.",
      "$ref": "#/$defs/PackagePresentation"
    },
    "compatibility": {
      "description": "Host and SDK compatibility requirements.",
      "$ref": "#/$defs/PackageCompatibility"
    },
    "targets": {
      "description": "Target-specific Module Federation containers.",
      "type": "object",
      "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"
        }
      },
      "additionalProperties": false
    },
    "contributions": {
      "description": "Statically declared contributions. Code cannot add undeclared contributions at runtime.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/PackageContribution"
      }
    },
    "events": {
      "description": "Statically declared package event catalog.",
      "$ref": "#/$defs/PackageEventCatalog",
      "default": {}
    },
    "runtimePolicy": {
      "description": "Runtime checkpoint and lifecycle-expose behavior used during target compilation.",
      "$ref": "#/$defs/PackageLifecyclePolicy",
      "default": {
        "checkpoint": "none"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "buildSchemaVersion",
    "versionLabel",
    "presentation",
    "compatibility",
    "targets",
    "contributions"
  ],
  "$comment": "SDK build and tooling schema. Never accepted as a Registry import descriptor.",
  "$defs": {
    "PackagePresentation": {
      "description": "Local package presentation metadata carried into the source manifest as display data.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$"
        },
        "description": {
          "type": "string"
        },
        "categories": {
          "description": "Ordered Marketplace discovery categories.",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/MiniAppCategory"
          },
          "maxItems": 3
        },
        "iconAssets": {
          "description": "Ordered app-icon candidates.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "assets": {
          "description": "Content-addressed visual assets.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PresentationAsset"
          }
        }
      },
      "additionalProperties": false,
      "required": ["name", "slug", "description"]
    },
    "MiniAppCategory": {
      "description": "Closed Marketplace discovery taxonomy for descriptor-backed miniapps.",
      "type": "string",
      "enum": [
        "productivity",
        "developer-tools",
        "creativity",
        "communication",
        "data-and-analytics",
        "business",
        "education",
        "media-and-entertainment",
        "utilities",
        "other"
      ]
    },
    "PresentationAsset": {
      "description": "A PNG or SVG package, publisher, or organization presentation asset.",
      "type": "object",
      "properties": {
        "role": {
          "$ref": "#/$defs/PresentationAssetRole"
        },
        "mediaType": {
          "$ref": "#/$defs/PresentationAssetMediaType"
        },
        "path": {
          "type": "string"
        },
        "integrity": {
          "type": "string"
        },
        "sizes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "theme": {
          "$ref": "#/$defs/PresentationAssetTheme",
          "default": "any"
        }
      },
      "additionalProperties": false,
      "required": ["role", "mediaType", "path", "integrity"]
    },
    "PresentationAssetRole": {
      "type": "string",
      "enum": [
        "app-icon",
        "publisher-icon",
        "organization-icon",
        "marketplace-card",
        "wordmark"
      ]
    },
    "PresentationAssetMediaType": {
      "type": "string",
      "enum": ["image/png", "image/svg+xml"]
    },
    "PresentationAssetTheme": {
      "type": "string",
      "enum": ["any", "light", "dark"]
    },
    "PackageCompatibility": {
      "description": "Host and SDK compatibility checked before remote loading.",
      "type": "object",
      "properties": {
        "tapSdk": {
          "type": "string"
        },
        "tapHost": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["tapSdk", "tapHost"]
    },
    "FederationTarget": {
      "description": "One target-specific Module Federation remote container.",
      "type": "object",
      "properties": {
        "remoteName": {
          "type": "string"
        },
        "remoteEntry": {
          "type": "string"
        },
        "remoteEntryIntegrity": {
          "type": "string"
        },
        "manifest": {
          "type": ["string", "null"]
        },
        "manifestIntegrity": {
          "type": ["string", "null"]
        },
        "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"
        },
        "libraryType": {
          "$ref": "#/$defs/FederationLibraryType"
        },
        "exposes": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/FederationExpose"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "remoteName",
        "remoteEntry",
        "remoteEntryIntegrity",
        "assetLock",
        "assetLockIntegrity",
        "libraryType",
        "exposes"
      ]
    },
    "FederationLibraryType": {
      "type": "string",
      "enum": ["module", "script", "commonjs-module"]
    },
    "FederationExpose": {
      "description": "One exposed module in the locked Federation graph.",
      "type": "object",
      "properties": {
        "integrity": {
          "type": "string"
        },
        "runtime": {
          "$ref": "#/$defs/ExecutionRuntime"
        }
      },
      "additionalProperties": false,
      "required": ["integrity", "runtime"]
    },
    "ExecutionRuntime": {
      "type": "string",
      "enum": ["webview", "quickjs", "worker", "node", "workflow-host"]
    },
    "PackageContribution": {
      "description": "Strict contribution union covering the initial TAP extension catalog.",
      "oneOf": [
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/UiSurfaceOptions"
            },
            "kind": {
              "type": "string",
              "const": "ui.surface"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/RendererOptions"
            },
            "kind": {
              "type": "string",
              "const": "ui.renderer"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/FileHandlerOptions"
            },
            "kind": {
              "type": "string",
              "const": "file.handler"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/ChatBlockOptions"
            },
            "kind": {
              "type": "string",
              "const": "chat.block"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/LinkUnfurlOptions"
            },
            "kind": {
              "type": "string",
              "const": "link.unfurl"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/ContextProviderOptions"
            },
            "kind": {
              "type": "string",
              "const": "context.provider"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/CommandOptions"
            },
            "kind": {
              "type": "string",
              "const": "action.command"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/AgentSkillOptions"
            },
            "kind": {
              "type": "string",
              "const": "agent.skill"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/ExecutableOptions"
            },
            "kind": {
              "type": "string",
              "const": "tool"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/SpecialistOptions"
            },
            "kind": {
              "type": "string",
              "const": "specialist"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/WorkflowOptions"
            },
            "kind": {
              "type": "string",
              "const": "workflow"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/WorkflowNodeOptions"
            },
            "kind": {
              "type": "string",
              "const": "workflow.node"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/McpServerOptions"
            },
            "kind": {
              "type": "string",
              "const": "mcp.server"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/McpToolOptions"
            },
            "kind": {
              "type": "string",
              "const": "mcp.tool"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/McpPromptOptions"
            },
            "kind": {
              "type": "string",
              "const": "mcp.prompt"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/McpResourceOptions"
            },
            "kind": {
              "type": "string",
              "const": "mcp.resource"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/McpResourceTemplateOptions"
            },
            "kind": {
              "type": "string",
              "const": "mcp.resource-template"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/McpAppOptions"
            },
            "kind": {
              "type": "string",
              "const": "mcp.app"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/CompositionOptions"
            },
            "kind": {
              "type": "string",
              "const": "miniapp"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/CompositionOptions"
            },
            "kind": {
              "type": "string",
              "const": "integration.connector"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/PermissionCatalogOptions"
            },
            "kind": {
              "type": "string",
              "const": "permission.catalog"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/LocalServiceOptions"
            },
            "kind": {
              "type": "string",
              "const": "local.service"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        },
        {
          "description": "Fields shared by every package contribution.",
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "apiVersion": {
              "type": "integer",
              "format": "uint16",
              "minimum": 0,
              "maximum": 65535
            },
            "targets": {
              "type": "object",
              "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"
                }
              },
              "additionalProperties": false
            },
            "publishes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subscribes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "authorization": {
              "$ref": "#/$defs/AuthorizationBinding",
              "default": {}
            },
            "lifecycleScope": {
              "$ref": "#/$defs/LifecycleScope",
              "default": "mount"
            },
            "options": {
              "$ref": "#/$defs/ArtifactTypeOptions"
            },
            "kind": {
              "type": "string",
              "const": "artifact.type"
            }
          },
          "additionalProperties": false,
          "required": ["kind", "id", "apiVersion", "options"]
        }
      ]
    },
    "ContributionTarget": {
      "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.",
      "anyOf": [
        {
          "$ref": "#/$defs/ModuleContributionTarget"
        },
        {
          "$ref": "#/$defs/HostDeclarativeContributionTarget"
        }
      ]
    },
    "ModuleContributionTarget": {
      "description": "A contribution implemented by one module in the locked Federation graph.",
      "type": "object",
      "properties": {
        "expose": {
          "type": "string"
        },
        "runtime": {
          "$ref": "#/$defs/ExecutionRuntime"
        }
      },
      "additionalProperties": false,
      "required": ["expose", "runtime"]
    },
    "HostDeclarativeContributionTarget": {
      "description": "A contribution whose declarative configuration TAP materializes directly.",
      "type": "object",
      "properties": {
        "runtime": {
          "$ref": "#/$defs/HostDeclarativeRuntime"
        }
      },
      "additionalProperties": false,
      "required": ["runtime"]
    },
    "HostDeclarativeRuntime": {
      "description": "The only runtime accepted by an expose-free contribution target binding.",
      "type": "string",
      "enum": ["host-declarative"]
    },
    "AuthorizationBinding": {
      "type": "object",
      "properties": {
        "allOf": {
          "description": "Actions whose absence prevents the host from projecting this contribution.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "onDemand": {
          "description": "Actions a projected UI surface may request without requiring them at mount time.\n\nThese are declarations rather than grants. Every call still requires a\ncurrent host authorization decision.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "effects": {
          "description": "Host-visible runtime effects used to preflight non-action authority.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/RuntimeEffect"
          }
        }
      },
      "additionalProperties": false
    },
    "RuntimeEffect": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string"
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "required": ["kind"]
    },
    "LifecycleScope": {
      "type": "string",
      "enum": ["installation", "realm", "contribution", "mount"]
    },
    "UiSurfaceOptions": {
      "type": "object",
      "properties": {
        "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"]
        },
        "description": {
          "type": ["string", "null"]
        },
        "placement": {
          "$ref": "#/$defs/UiPlacement"
        },
        "scope": {
          "$ref": "#/$defs/ContributionScope"
        },
        "instancePolicy": {
          "$ref": "#/$defs/InstancePolicy",
          "default": "per-mount"
        },
        "persistence": {
          "$ref": "#/$defs/PersistencePolicy",
          "default": "none"
        },
        "iconAssets": {
          "description": "Ordered package presentation assets eligible for this contribution.\nEmpty inherits the package-level `presentation.iconAssets` selection.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false,
      "required": ["placement", "scope"]
    },
    "UiPlacement": {
      "type": "string",
      "enum": [
        "workspace-left",
        "channel-apps",
        "chat-right",
        "route",
        "settings",
        "dialog",
        "standalone-window"
      ]
    },
    "ContributionScope": {
      "type": "string",
      "enum": [
        "user",
        "workspace",
        "channel",
        "conversation",
        "project",
        "resource"
      ]
    },
    "InstancePolicy": {
      "type": "string",
      "enum": [
        "per-mount",
        "per-conversation",
        "per-channel",
        "per-workspace",
        "singleton"
      ]
    },
    "PersistencePolicy": {
      "type": "string",
      "enum": ["none", "checkpoint", "retained"]
    },
    "RendererOptions": {
      "type": "object",
      "properties": {
        "protocol": {
          "type": "string"
        },
        "payloadSchema": {
          "type": ["string", "null"]
        },
        "hostActions": {
          "description": "Host-owned actions exposed to the isolated renderer. These declarations\ngrant no package authority; the host resolves and executes the selected\nsame-package surface against current installation policy.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/RendererHostAction"
          },
          "maxItems": 16
        },
        "hostResources": {
          "description": "Host-authorized read resources available only through expiring,\npayload-bound same-origin RPC grants.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/RendererHostResource"
          }
        }
      },
      "additionalProperties": false,
      "required": ["protocol"]
    },
    "RendererHostAction": {
      "description": "A narrow host action made available to an isolated inline renderer.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/RendererHostActionKind"
        },
        "surfaceContributionId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["id", "kind", "surfaceContributionId"]
    },
    "RendererHostActionKind": {
      "type": "string",
      "enum": ["open-surface"]
    },
    "RendererHostResource": {
      "description": "A narrow host resource made available to an isolated chat renderer.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["id", "kind"]
    },
    "FileHandlerOptions": {
      "description": "Host-owned desktop file association for one exact same-package surface.",
      "type": "object",
      "properties": {
        "surfaceContributionId": {
          "description": "Exact same-package `ui.surface` contribution launched for this association.",
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "roles": {
          "description": "Distinct host intents supported by this handler.",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/FileHandlerRole"
          },
          "minItems": 1,
          "maxItems": 3
        },
        "mimeTypes": {
          "description": "Distinct canonical lowercase MIME types accepted by the handler.",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 3,
            "maxLength": 255,
            "pattern": "^[a-z0-9][a-z0-9!#$&^_.+-]*/[a-z0-9][a-z0-9!#$&^_.+-]*$"
          },
          "minItems": 1,
          "maxItems": 32
        },
        "extensions": {
          "description": "Distinct canonical lowercase leading-dot extensions accepted by the handler.",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 2,
            "maxLength": 33,
            "pattern": "^\\.[a-z0-9][a-z0-9._+-]{0,31}$"
          },
          "minItems": 1,
          "maxItems": 32
        },
        "launchSchema": {
          "description": "Safe release-relative JSON Schema asset locked for the desktop target.",
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        }
      },
      "additionalProperties": false,
      "required": [
        "surfaceContributionId",
        "roles",
        "mimeTypes",
        "extensions",
        "launchSchema"
      ]
    },
    "FileHandlerRole": {
      "description": "Closed host intent taxonomy for file associations.",
      "type": "string",
      "enum": ["open", "import", "export"]
    },
    "ChatBlockOptions": {
      "type": "object",
      "properties": {
        "protocol": {
          "$ref": "#/$defs/ChatBlockProtocol"
        },
        "payloadSchema": {
          "type": "string"
        },
        "rendererContributionId": {
          "type": ["string", "null"]
        },
        "fallbackFormat": {
          "$ref": "#/$defs/FallbackFormat"
        },
        "accessibilityLabel": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "protocol",
        "payloadSchema",
        "fallbackFormat",
        "accessibilityLabel"
      ]
    },
    "ChatBlockProtocol": {
      "type": "string",
      "enum": [
        "tap-primitives-v1",
        "tap-federated-view-v1",
        "isolated-html-v1",
        "mcp-app-2026-01-26"
      ]
    },
    "FallbackFormat": {
      "type": "string",
      "enum": ["text", "markdown"]
    },
    "LinkUnfurlOptions": {
      "description": "Host-owned link-preview presentation bound to one same-package isolated renderer.",
      "type": "object",
      "properties": {
        "protocol": {
          "$ref": "#/$defs/LinkUnfurlProtocol"
        },
        "rendererContributionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "match": {
          "$ref": "#/$defs/LinkUnfurlMatch"
        }
      },
      "additionalProperties": false,
      "required": ["protocol", "rendererContributionId", "match"]
    },
    "LinkUnfurlProtocol": {
      "description": "Closed protocol taxonomy for host-built link-unfurl payloads.",
      "type": "string",
      "enum": ["tap-link-unfurl-v1"]
    },
    "LinkUnfurlMatch": {
      "description": "One exact HTTPS hostname and path-template claim.",
      "type": "object",
      "properties": {
        "hostname": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253,
          "pattern": "^(?:(?:0|[1-9][0-9]{0,2})(?:\\.(?:0|[1-9][0-9]{0,2})){3}|(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+(?!(?:[0-9]+|0x[0-9a-f]*)$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)$"
        },
        "pathTemplate": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2048
        }
      },
      "additionalProperties": false,
      "required": ["hostname", "pathTemplate"]
    },
    "ContextProviderOptions": {
      "description": "Package-defined, host-scoped non-secret invocation context.",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "description": "Semver version of the payload schema stored with each resolved snapshot.",
          "type": "string"
        },
        "compatibleSchemaVersions": {
          "description": "Semver range accepted by this release when reading previously stored snapshots.",
          "type": "string"
        },
        "schema": {
          "description": "Safe package-relative JSON Schema asset locked for every selected target.",
          "type": "string"
        },
        "scopes": {
          "description": "Scopes at which the host may persist a validated value.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContextProviderScope"
          }
        },
        "resolverContributionId": {
          "description": "Same-package specialist contribution that owns resolution for this provider.",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "compatibleSchemaVersions",
        "schema",
        "scopes",
        "resolverContributionId"
      ]
    },
    "ContextProviderScope": {
      "type": "string",
      "enum": ["personal-workspace", "channel", "message"]
    },
    "CommandOptions": {
      "description": "One host-native context action that launches a verified package UI surface.",
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": ["string", "null"],
          "minLength": 1
        },
        "contexts": {
          "description": "Host contexts in which this action may be invoked.",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/CommandHostContext"
          },
          "minItems": 1
        },
        "launch": {
          "description": "Exact same-package UI surface launched by the host.",
          "$ref": "#/$defs/ActionCommandLaunch"
        }
      },
      "additionalProperties": false,
      "required": ["label", "contexts", "launch"]
    },
    "CommandHostContext": {
      "description": "A host artifact context to which an `action.command` may bind.",
      "type": "string",
      "enum": ["channel-message", "pull-request", "task", "repository-issue"]
    },
    "ActionCommandLaunch": {
      "description": "One explicit host-owned launch target for an `action.command`.",
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/$defs/ActionCommandLaunchKind"
        },
        "contributionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "required": ["kind", "contributionId"]
    },
    "ActionCommandLaunchKind": {
      "description": "Closed launch behavior supported by context actions.",
      "type": "string",
      "enum": ["ui.surface"]
    },
    "AgentSkillOptions": {
      "description": "One immutable instructional skill tree materialized directly by the host.",
      "type": "object",
      "properties": {
        "files": {
          "description": "Files relative to `skills/<contribution-id>/<release-version>`.\n\nThe list must include `SKILL.md`; every other resource is opt-in and\nmust be present in each selected target's immutable asset lock.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "required": ["files"]
    },
    "ExecutableOptions": {
      "type": "object",
      "properties": {
        "inputSchema": {
          "type": ["string", "null"]
        },
        "outputSchema": {
          "type": ["string", "null"]
        },
        "effects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RuntimeEffect"
          }
        },
        "timeoutMs": {
          "type": ["integer", "null"],
          "format": "uint64",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SpecialistOptions": {
      "description": "One immutable specialist manifest materialized directly by the host.",
      "type": "object",
      "properties": {
        "manifest": {
          "description": "Canonical release-relative manifest path present in every selected target's asset lock.",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["manifest"]
    },
    "WorkflowOptions": {
      "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.",
      "type": "object",
      "properties": {
        "workflowId": {
          "type": "string"
        },
        "exportName": {
          "type": "string"
        },
        "manifest": {
          "$ref": "#/$defs/WorkflowSchemaReference"
        },
        "inputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowPort"
          }
        },
        "outputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowPort"
          }
        },
        "lifecycle": {
          "$ref": "#/$defs/WorkflowExecutionSemantics"
        }
      },
      "additionalProperties": false,
      "required": [
        "workflowId",
        "exportName",
        "manifest",
        "inputs",
        "outputs",
        "lifecycle"
      ]
    },
    "WorkflowSchemaReference": {
      "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.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "integrity": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["id", "integrity"]
    },
    "WorkflowPort": {
      "description": "One named, schema-bound workflow input or output port.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "schema": {
          "$ref": "#/$defs/WorkflowSchemaReference"
        },
        "required": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "required": ["name", "schema", "required"]
    },
    "WorkflowExecutionSemantics": {
      "description": "Fixed v1 execution semantics for one immutable package workflow.",
      "type": "object",
      "properties": {
        "retry": {
          "$ref": "#/$defs/WorkflowRetryPolicy"
        },
        "cancellation": {
          "$ref": "#/$defs/WorkflowCancellationPolicy"
        },
        "checkpoint": {
          "$ref": "#/$defs/WorkflowCheckpointPolicy"
        },
        "upgrade": {
          "$ref": "#/$defs/WorkflowUpgradePolicy"
        },
        "rollback": {
          "$ref": "#/$defs/WorkflowRollbackPolicy"
        }
      },
      "additionalProperties": false,
      "required": ["retry", "cancellation", "checkpoint", "upgrade", "rollback"]
    },
    "WorkflowRetryPolicy": {
      "description": "Retry behavior supported by package-provided workflow definitions.",
      "type": "string",
      "enum": ["none"]
    },
    "WorkflowCancellationPolicy": {
      "description": "Cancellation behavior supported by package-provided workflows.",
      "type": "string",
      "enum": ["host-managed"]
    },
    "WorkflowCheckpointPolicy": {
      "description": "Checkpoint behavior supported by the package-contribution ABI.",
      "type": "string",
      "enum": ["none"]
    },
    "WorkflowUpgradePolicy": {
      "description": "Upgrade behavior supported by immutable package workflow definitions.",
      "type": "string",
      "enum": ["restart"]
    },
    "WorkflowRollbackPolicy": {
      "description": "Rollback ownership for package-provided workflows and nodes.",
      "type": "string",
      "enum": ["host-managed"]
    },
    "WorkflowNodeOptions": {
      "description": "Exact descriptor options for a canonical `ze-workflows` contributed node.",
      "type": "object",
      "properties": {
        "nodeKind": {
          "type": "string"
        },
        "exportName": {
          "type": "string"
        },
        "config": {
          "$ref": "#/$defs/WorkflowSchemaReference"
        },
        "inputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowPort"
          }
        },
        "outputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowPort"
          }
        },
        "outcomes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "effect": {
          "$ref": "#/$defs/WorkflowNodeEffect"
        },
        "requires": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkflowHostPort"
          }
        },
        "execution": {
          "$ref": "#/$defs/WorkflowNodeExecutionSemantics"
        }
      },
      "additionalProperties": false,
      "required": [
        "nodeKind",
        "exportName",
        "config",
        "inputs",
        "outputs",
        "outcomes",
        "effect",
        "requires",
        "execution"
      ]
    },
    "WorkflowNodeEffect": {
      "description": "Side-effect classification for a package-provided workflow node.",
      "type": "string",
      "enum": ["pure", "read", "write", "exec"]
    },
    "WorkflowHostPort": {
      "description": "Narrow host port a package-provided workflow node may request.",
      "type": "string",
      "enum": ["fs", "proc", "http", "clock", "crypto", "store", "source"]
    },
    "WorkflowNodeExecutionSemantics": {
      "description": "Fixed v1 execution semantics for one package-provided workflow node.",
      "type": "object",
      "properties": {
        "maxAttempts": {
          "type": "integer",
          "format": "uint8",
          "minimum": 1,
          "maximum": 1
        },
        "idempotency": {
          "$ref": "#/$defs/WorkflowNodeIdempotency"
        },
        "cancellation": {
          "$ref": "#/$defs/WorkflowNodeCancellationPolicy"
        },
        "checkpoint": {
          "$ref": "#/$defs/WorkflowCheckpointPolicy"
        },
        "upgrade": {
          "$ref": "#/$defs/WorkflowUpgradePolicy"
        },
        "rollback": {
          "$ref": "#/$defs/WorkflowRollbackPolicy"
        }
      },
      "additionalProperties": false,
      "required": [
        "maxAttempts",
        "idempotency",
        "cancellation",
        "checkpoint",
        "upgrade",
        "rollback"
      ]
    },
    "WorkflowNodeIdempotency": {
      "description": "Idempotency claim for the one attempt allowed by the v1 node ABI.",
      "type": "string",
      "enum": ["idempotent", "non-idempotent"]
    },
    "WorkflowNodeCancellationPolicy": {
      "description": "Cancellation behavior supported by one package-provided node attempt.",
      "type": "string",
      "enum": ["not-supported"]
    },
    "McpServerOptions": {
      "description": "One package-declared MCP server and its maximum consumer audience.",
      "type": "object",
      "properties": {
        "protocolVersion": {
          "$ref": "#/$defs/McpProtocolVersion"
        },
        "implementation": {
          "$ref": "#/$defs/McpServerImplementation"
        },
        "elicitationModes": {
          "description": "Signed maximum elicitation capability set. Omission means disabled.",
          "type": ["array", "null"],
          "items": {
            "$ref": "#/$defs/McpElicitationMode"
          },
          "minItems": 1,
          "maxItems": 2
        },
        "oauth": {
          "description": "Signed OAuth authority for an OAuth-backed Streamable HTTP server.",
          "anyOf": [
            {
              "$ref": "#/$defs/McpOAuthOptions"
            },
            {
              "type": "null"
            }
          ]
        },
        "consumerPolicy": {
          "$ref": "#/$defs/McpConsumerPolicy",
          "default": {}
        }
      },
      "additionalProperties": false,
      "required": ["protocolVersion", "implementation"]
    },
    "McpProtocolVersion": {
      "description": "MCP protocol versions implemented by TAP's pinned MCP SDK.\n\nKeep this closed set synchronized with `rmcp::model::ProtocolVersion::KNOWN_VERSIONS`. A\ndate-shaped value is not sufficient: rmcp deliberately deserializes unknown versions, which\nwould otherwise let a signed package select wire semantics TAP has never reviewed.",
      "type": "string",
      "enum": ["2024-11-05", "2025-03-26", "2025-06-18", "2025-11-25"]
    },
    "McpServerImplementation": {
      "description": "Mutually exclusive ways TAP can activate a declared MCP server.",
      "oneOf": [
        {
          "description": "Load the server adapter from the contribution's verified Federation expose.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "package-runtime"
            }
          },
          "required": ["type"],
          "additionalProperties": false
        },
        {
          "description": "Spawn a reviewed local process and communicate over stdio.",
          "type": "object",
          "properties": {
            "command": {
              "type": "string"
            },
            "args": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "credentialRequirements": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/McpStdioCredentialRequirement"
              }
            },
            "type": {
              "type": "string",
              "const": "stdio"
            }
          },
          "additionalProperties": false,
          "required": ["type", "command"]
        },
        {
          "description": "Connect to an HTTPS MCP endpoint using Streamable HTTP.",
          "type": "object",
          "properties": {
            "url": {
              "type": "string"
            },
            "authentication": {
              "$ref": "#/$defs/McpHttpAuthentication",
              "default": "none"
            },
            "credentialRequirements": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/McpHttpCredentialRequirement"
              }
            },
            "type": {
              "type": "string",
              "const": "streamable-http"
            }
          },
          "additionalProperties": false,
          "required": ["type", "url"]
        }
      ]
    },
    "McpStdioCredentialRequirement": {
      "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.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "environmentVariable": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["id", "environmentVariable"]
    },
    "McpHttpAuthentication": {
      "description": "Mutually exclusive host-custodied authentication mode for Streamable HTTP.",
      "type": "string",
      "enum": ["none", "oauth", "header-credentials"]
    },
    "McpHttpCredentialRequirement": {
      "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.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "header": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["id", "header"]
    },
    "McpElicitationMode": {
      "description": "Closed package-runtime MCP elicitation capabilities.",
      "type": "string",
      "enum": ["form", "url"]
    },
    "McpOAuthOptions": {
      "description": "Signed OAuth authority for one package-declared Streamable HTTP MCP server.",
      "type": "object",
      "properties": {
        "resource": {
          "description": "RFC 8707 protected-resource identity requested during authorization.",
          "type": "string"
        },
        "audience": {
          "description": "Optional provider-specific audience, kept distinct from the protected resource.",
          "type": ["string", "null"]
        },
        "scopes": {
          "description": "Exact non-empty signed OAuth scope set.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 64
        },
        "credentialScope": {
          "description": "Host credential partition selected by the publisher and still bound to a member.",
          "$ref": "#/$defs/McpOAuthCredentialScope"
        }
      },
      "additionalProperties": false,
      "required": ["resource", "scopes", "credentialScope"]
    },
    "McpOAuthCredentialScope": {
      "description": "Closed host credential partition for package-declared MCP OAuth.",
      "oneOf": [
        {
          "description": "One credential follows the authenticated user across workspaces.",
          "type": "string",
          "const": "user"
        },
        {
          "description": "One credential is isolated to the authenticated member in one workspace.",
          "type": "string",
          "const": "workspace-member"
        }
      ]
    },
    "McpConsumerPolicy": {
      "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.",
      "type": "object",
      "properties": {
        "contributionIds": {
          "description": "Exact same-package contribution identities eligible to receive access.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "externalConsumers": {
          "description": "External platform consumer classes eligible for narrower host grants.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/McpExternalConsumerClass"
          }
        }
      },
      "additionalProperties": false
    },
    "McpExternalConsumerClass": {
      "description": "Closed external consumer classes a publisher may include in its maximum.",
      "type": "string",
      "enum": [
        "selected-miniapps",
        "selected-specialists",
        "chat",
        "workflows",
        "platform"
      ]
    },
    "McpToolOptions": {
      "description": "One MCP tool promoted from its owning server's live catalog.",
      "type": "object",
      "properties": {
        "serverContributionId": {
          "type": "string"
        },
        "toolName": {
          "type": "string"
        },
        "storageReads": {
          "description": "Optional exact SDK storage rows selected for package-runtime execution.\n\nAbsence preserves the compatible whole-authorized-namespace snapshot. A present list,\nincluding an empty list, selects only its resolved addresses.",
          "type": ["array", "null"],
          "items": {
            "$ref": "#/$defs/McpStorageRead"
          },
          "maxItems": 64
        },
        "inputSchema": {
          "type": ["string", "null"]
        },
        "outputSchema": {
          "type": ["string", "null"]
        },
        "effects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RuntimeEffect"
          }
        },
        "timeoutMs": {
          "type": ["integer", "null"],
          "format": "uint64",
          "minimum": 0
        }
      },
      "additionalProperties": false,
      "required": ["serverContributionId", "toolName"]
    },
    "McpStorageRead": {
      "description": "One exact package-runtime MCP storage address template.",
      "type": "object",
      "properties": {
        "namespace": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "keyTemplate": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false,
      "required": ["namespace", "keyTemplate"]
    },
    "McpPromptOptions": {
      "description": "One MCP prompt promoted from its owning server's live catalog.",
      "type": "object",
      "properties": {
        "serverContributionId": {
          "type": "string"
        },
        "promptName": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["serverContributionId", "promptName"]
    },
    "McpResourceOptions": {
      "description": "One exact MCP resource promoted from its owning server's live catalog.",
      "type": "object",
      "properties": {
        "serverContributionId": {
          "type": "string"
        },
        "uri": {
          "type": "string"
        },
        "mimeType": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": false,
      "required": ["serverContributionId", "uri"]
    },
    "McpResourceTemplateOptions": {
      "description": "One MCP resource template promoted from its owning server's live catalog.",
      "type": "object",
      "properties": {
        "serverContributionId": {
          "type": "string"
        },
        "uriTemplate": {
          "type": "string"
        },
        "mimeType": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": false,
      "required": ["serverContributionId", "uriTemplate"]
    },
    "McpAppOptions": {
      "description": "One sandboxed MCP App bound to exact tool and UI resource contributions.",
      "type": "object",
      "properties": {
        "serverContributionId": {
          "type": "string"
        },
        "toolContributionId": {
          "type": "string"
        },
        "resourceContributionId": {
          "type": "string"
        },
        "protocolVersion": {
          "$ref": "#/$defs/McpAppProtocolVersion"
        }
      },
      "additionalProperties": false,
      "required": [
        "serverContributionId",
        "toolContributionId",
        "resourceContributionId",
        "protocolVersion"
      ]
    },
    "McpAppProtocolVersion": {
      "description": "MCP Apps protocol revisions implemented by TAP's isolated renderer lane.\n\nMCP Apps and the base MCP transport version are separate wire contracts; this type prevents\neither date-shaped namespace from being accepted as the other.",
      "type": "string",
      "enum": ["2026-01-26"]
    },
    "CompositionOptions": {
      "type": "object",
      "properties": {
        "contributionIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "childPackageIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "PermissionCatalogOptions": {
      "description": "A signed package-local permission catalog. These are definitions, never grants.",
      "type": "object",
      "properties": {
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PackagePermissionAction"
          }
        },
        "levels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PackagePermissionLevel"
          }
        },
        "roleRecommendations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RoleRecommendation"
          }
        }
      },
      "additionalProperties": false
    },
    "PackagePermissionAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "resource": {
          "type": "string"
        },
        "scopes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContributionScope"
          }
        },
        "directActors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ActorKind"
          }
        },
        "delegatedActors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ActorKind"
          }
        },
        "autonomyCeiling": {
          "$ref": "#/$defs/AutonomyLevel"
        },
        "consent": {
          "$ref": "#/$defs/ConsentPolicy"
        },
        "risk": {
          "$ref": "#/$defs/PermissionRisk"
        }
      },
      "additionalProperties": false,
      "required": [
        "id",
        "resource",
        "scopes",
        "directActors",
        "delegatedActors",
        "autonomyCeiling",
        "consent",
        "risk"
      ]
    },
    "ActorKind": {
      "type": "string",
      "enum": ["human", "specialist"]
    },
    "AutonomyLevel": {
      "type": "string",
      "enum": ["listen", "plan", "do"]
    },
    "ConsentPolicy": {
      "type": "string",
      "enum": ["none", "once", "channel", "reusable", "fresh-decision"]
    },
    "PermissionRisk": {
      "type": "string",
      "enum": ["read", "write", "consequential", "financial"]
    },
    "PackagePermissionLevel": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "includes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "assignableTo": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ActorKind"
          }
        }
      },
      "additionalProperties": false,
      "required": ["id", "assignableTo"]
    },
    "RoleRecommendation": {
      "type": "object",
      "properties": {
        "actor": {
          "$ref": "#/$defs/ActorKind"
        },
        "workspaceRole": {
          "type": "string"
        },
        "level": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["actor", "workspaceRole", "level"]
    },
    "LocalServiceOptions": {
      "description": "Host-managed loopback service configuration signed into a package release.",
      "type": "object",
      "properties": {
        "protocol": {
          "$ref": "#/$defs/LocalServiceProtocol"
        },
        "launchers": {
          "type": "object",
          "properties": {
            "aarch64-apple-darwin": {
              "$ref": "#/$defs/LocalServiceLauncher"
            },
            "x86_64-apple-darwin": {
              "$ref": "#/$defs/LocalServiceLauncher"
            },
            "x86_64-pc-windows-msvc": {
              "$ref": "#/$defs/LocalServiceLauncher"
            },
            "x86_64-unknown-linux-gnu": {
              "$ref": "#/$defs/LocalServiceLauncher"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false,
      "required": ["protocol", "launchers"]
    },
    "LocalServiceProtocol": {
      "description": "Network protocol supported by the v1 local-service supervisor.",
      "type": "string",
      "enum": ["http"]
    },
    "LocalServiceLauncher": {
      "description": "Complete immutable launch declaration for one desktop release triple.",
      "type": "object",
      "properties": {
        "runtimeRoot": {
          "type": "string"
        },
        "executable": {
          "type": "string"
        },
        "args": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "env": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "sandboxProfile": {
          "$ref": "#/$defs/LocalServiceSandboxProfile"
        },
        "readiness": {
          "$ref": "#/$defs/LocalServiceReadiness"
        },
        "restart": {
          "$ref": "#/$defs/LocalServiceRestartPolicy"
        }
      },
      "additionalProperties": false,
      "required": [
        "runtimeRoot",
        "executable",
        "args",
        "env",
        "sandboxProfile",
        "readiness",
        "restart"
      ]
    },
    "LocalServiceSandboxProfile": {
      "description": "Closed, host-reviewed sandbox policies available to package services.",
      "type": "string",
      "enum": ["local-http-service", "apple-simulator-control"]
    },
    "LocalServiceReadiness": {
      "description": "HTTP readiness probe and authoritative startup deadline.",
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        },
        "timeoutMs": {
          "type": "integer",
          "format": "uint64",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "intervalMs": {
          "type": "integer",
          "format": "uint64",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false,
      "required": ["path", "timeoutMs", "intervalMs"]
    },
    "LocalServiceRestartPolicy": {
      "description": "Finite fixed-backoff restart policy signed into a package release.",
      "type": "object",
      "properties": {
        "maxAttempts": {
          "type": "integer",
          "format": "uint64",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "windowMs": {
          "type": "integer",
          "format": "uint64",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "backoffMs": {
          "type": "integer",
          "format": "uint64",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false,
      "required": ["maxAttempts", "windowMs", "backoffMs"]
    },
    "ArtifactTypeOptions": {
      "description": "Package-owned durable collaborative artifact type signed into a package release.\n\nThe contribution declares type metadata, per-document sync protocols and schemas,\nand bounded limits while the platform owns transport, persistence, and authority.\nThe host never inspects package-owned protocol payloads or domain types.",
      "type": "object",
      "properties": {
        "typeId": {
          "description": "Package-qualified type identifier: `<package.namespace>.<name>.v<N>`.",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "documents": {
          "description": "Independently permissioned document lanes, such as content and review.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ArtifactDocumentDefinition"
          }
        },
        "schemas": {
          "$ref": "#/$defs/ArtifactTypeSchemas",
          "default": {}
        },
        "previewRenderer": {
          "description": "Same-package `ui.renderer` contribution that previews this artifact type.",
          "type": ["string", "null"]
        },
        "migration": {
          "description": "Package-owned migration entry point hosted by an admitted non-UI runtime.",
          "anyOf": [
            {
              "$ref": "#/$defs/ArtifactMigrationRuntime"
            },
            {
              "type": "null"
            }
          ]
        },
        "fileAssociations": {
          "description": "Optional file-handler and import/export associations for this artifact type.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ArtifactFileAssociation"
          }
        },
        "hostResources": {
          "description": "Closed set of host resource kinds this artifact type is permitted to use.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ArtifactHostResourceKind"
          }
        },
        "compatibility": {
          "description": "Artifact format versions this release can read and write.",
          "$ref": "#/$defs/ArtifactTypeCompatibility"
        }
      },
      "additionalProperties": false,
      "required": ["typeId", "displayName", "documents", "compatibility"]
    },
    "ArtifactDocumentDefinition": {
      "description": "One independently permissioned document lane within an artifact type.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "displayName": {
          "type": ["string", "null"]
        },
        "syncProtocol": {
          "description": "Package-qualified sync protocol identifier: `<package.namespace>.<name>.v<N>`.",
          "type": "string"
        },
        "snapshotSchema": {
          "description": "Package-relative JSON schema validating full-document snapshots.",
          "type": "string"
        },
        "operationSchema": {
          "description": "Package-relative JSON schema validating single sync operations.",
          "type": "string"
        },
        "writeAction": {
          "description": "Permission catalog action required to write this document lane.",
          "type": "string"
        },
        "maxOperationBytes": {
          "description": "Declared per-operation payload ceiling in bytes, bounded by the host.",
          "type": "integer",
          "format": "uint64",
          "minimum": 1,
          "maximum": 1048576
        },
        "maxSnapshotBytes": {
          "description": "Declared per-snapshot ceiling in bytes, bounded by the host.",
          "type": "integer",
          "format": "uint64",
          "minimum": 1,
          "maximum": 67108864
        }
      },
      "additionalProperties": false,
      "required": [
        "id",
        "syncProtocol",
        "snapshotSchema",
        "operationSchema",
        "writeAction",
        "maxOperationBytes",
        "maxSnapshotBytes"
      ]
    },
    "ArtifactTypeSchemas": {
      "description": "Optional type-wide schema assets.\n\nSchema versions are part of the package-relative path so one release can ship\nseveral schema generations side by side for N-1/N/N+1 compatibility.",
      "type": "object",
      "properties": {
        "anchorSchema": {
          "type": ["string", "null"]
        },
        "threadSchema": {
          "type": ["string", "null"]
        },
        "presenceSchema": {
          "type": ["string", "null"]
        },
        "previewSchema": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": false
    },
    "ArtifactMigrationRuntime": {
      "description": "Reference to the package-owned migration entry point for an artifact type.\n\nThe referenced contribution must be an admitted non-UI runtime (`local.service`\nor `workflow`) so migrations stay deterministic, idempotent, receipt-backed, and\noutside any UI surface.",
      "type": "object",
      "properties": {
        "contributionId": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": ["contributionId"]
    },
    "ArtifactFileAssociation": {
      "description": "Optional file-handler association between an artifact type and file formats.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 32
        },
        "mimeTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 32
        },
        "direction": {
          "$ref": "#/$defs/ArtifactFileDirection"
        }
      },
      "additionalProperties": false,
      "required": ["id", "extensions", "direction"]
    },
    "ArtifactFileDirection": {
      "description": "Import/export direction of one artifact file association.",
      "type": "string",
      "enum": ["import", "export", "import-export"]
    },
    "ArtifactHostResourceKind": {
      "description": "Closed set of platform-owned resource kinds an artifact type may consume.",
      "oneOf": [
        {
          "description": "Bounded operation transport between collaborating peers.",
          "type": "string",
          "const": "sync-transport"
        },
        {
          "description": "Durable snapshot persistence coordinates.",
          "type": "string",
          "const": "snapshot-store"
        },
        {
          "description": "Ephemeral presence directory.",
          "type": "string",
          "const": "presence-directory"
        },
        {
          "description": "Receipt journal backing migrations and authority decisions.",
          "type": "string",
          "const": "receipt-journal"
        }
      ]
    },
    "ArtifactTypeCompatibility": {
      "description": "Artifact format versions this release can read and write.\n\nOpening an older artifact negotiates against this range; downgrades fail\nexplicitly when the installed release's range cannot read the artifact.",
      "type": "object",
      "properties": {
        "minReaderVersion": {
          "description": "Oldest artifact format version this release can still read.",
          "type": "integer",
          "format": "uint32",
          "minimum": 1,
          "maximum": 64
        },
        "maxWriterVersion": {
          "description": "Newest artifact format version this release can write.",
          "type": "integer",
          "format": "uint32",
          "minimum": 1,
          "maximum": 64
        }
      },
      "additionalProperties": false,
      "required": ["minReaderVersion", "maxWriterVersion"]
    },
    "PackageEventCatalog": {
      "description": "Package-defined published and consumed events.",
      "type": "object",
      "properties": {
        "publishes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PublishedEvent"
          }
        },
        "subscribes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SubscribedEvent"
          }
        }
      },
      "additionalProperties": false
    },
    "PublishedEvent": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "schema": {
          "type": "string"
        },
        "schemaVersion": {
          "type": "integer",
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "visibility": {
          "$ref": "#/$defs/ContributionScope"
        },
        "delivery": {
          "$ref": "#/$defs/EventDelivery"
        }
      },
      "additionalProperties": false,
      "required": ["name", "schema", "schemaVersion", "visibility", "delivery"]
    },
    "EventDelivery": {
      "type": "string",
      "enum": ["ephemeral", "durable"]
    },
    "SubscribedEvent": {
      "type": "object",
      "properties": {
        "event": {
          "type": "string"
        },
        "versions": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "uint16",
            "minimum": 0,
            "maximum": 65535
          }
        },
        "dependency": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": false,
      "required": ["event", "versions"]
    },
    "PackageLifecyclePolicy": {
      "type": "object",
      "properties": {
        "checkpoint": {
          "$ref": "#/$defs/PersistencePolicy",
          "default": "none"
        },
        "lifecycleExpose": {
          "type": ["string", "null"]
        },
        "checkpointSchema": {
          "type": ["string", "null"]
        },
        "profileStorageQuotaBytes": {
          "description": "Requested private profile-storage quota. Omitted uses the host default.",
          "type": ["integer", "null"],
          "format": "uint64",
          "minimum": 1073741824,
          "maximum": 21474836480
        },
        "workspaceStorageQuotaBytes": {
          "description": "Requested quota for each private workspace route. Omitted uses the host default.",
          "type": ["integer", "null"],
          "format": "uint64",
          "minimum": 1073741824,
          "maximum": 21474836480
        },
        "profileStorageRetention": {
          "description": "Retention requested after verified profile authority revocation or package deletion.",
          "$ref": "#/$defs/PrivateStorageRetention"
        },
        "workspaceStorageRetention": {
          "description": "Retention requested after verified workspace authority revocation or package deletion.",
          "$ref": "#/$defs/PrivateStorageRetention"
        }
      },
      "additionalProperties": false
    },
    "PrivateStorageRetention": {
      "type": "string",
      "enum": ["retain", "delete-on-verified-revocation"]
    }
  }
}
