@vetta-org/plugin-sdk 0.3.5 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/bottom-panel.d.ts +83 -0
  2. package/dist/bottom-panel.d.ts.map +1 -0
  3. package/dist/bottom-panel.js +23 -0
  4. package/dist/bottom-panel.js.map +1 -0
  5. package/dist/file-explorer.d.ts +30 -0
  6. package/dist/file-explorer.d.ts.map +1 -1
  7. package/dist/file-explorer.js.map +1 -1
  8. package/dist/fs.d.ts +17 -1
  9. package/dist/fs.d.ts.map +1 -1
  10. package/dist/fs.js.map +1 -1
  11. package/dist/images.d.ts +2 -0
  12. package/dist/images.d.ts.map +1 -1
  13. package/dist/images.js.map +1 -1
  14. package/dist/index.d.ts +9 -4
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/logger.d.ts +11 -0
  19. package/dist/logger.d.ts.map +1 -0
  20. package/dist/logger.js +18 -0
  21. package/dist/logger.js.map +1 -0
  22. package/dist/logging.d.ts +26 -0
  23. package/dist/logging.d.ts.map +1 -0
  24. package/dist/logging.js +38 -0
  25. package/dist/logging.js.map +1 -0
  26. package/dist/manifest-schema.d.ts +2 -2
  27. package/dist/manifest-schema.d.ts.map +1 -1
  28. package/dist/media.d.ts +20 -0
  29. package/dist/media.d.ts.map +1 -1
  30. package/dist/media.js.map +1 -1
  31. package/dist/models.d.ts +4 -0
  32. package/dist/models.d.ts.map +1 -1
  33. package/dist/models.js.map +1 -1
  34. package/dist/official.d.ts +80 -13
  35. package/dist/official.d.ts.map +1 -1
  36. package/dist/official.js.map +1 -1
  37. package/dist/permissions.d.ts +1 -1
  38. package/dist/permissions.d.ts.map +1 -1
  39. package/dist/permissions.js +2 -0
  40. package/dist/permissions.js.map +1 -1
  41. package/dist/service-provider.d.ts +1 -0
  42. package/dist/service-provider.d.ts.map +1 -1
  43. package/dist/service-provider.js.map +1 -1
  44. package/dist/ui.d.ts +50 -3
  45. package/dist/ui.d.ts.map +1 -1
  46. package/dist/ui.js.map +1 -1
  47. package/docs/.source.json +1 -0
  48. package/docs/README.md +4 -1
  49. package/docs/conversation-and-agent.md +14 -1
  50. package/docs/file-explorer.md +54 -3
  51. package/docs/getting-started.md +19 -10
  52. package/docs/logging.md +41 -0
  53. package/docs/manifest.md +3 -3
  54. package/docs/media.md +19 -2
  55. package/docs/message-cards.md +5 -1
  56. package/docs/permissions.md +7 -1
  57. package/docs/styling-and-pitfalls.md +12 -2
  58. package/docs/system-plugins.md +2 -2
  59. package/docs/ui-slots.md +100 -2
  60. package/package.json +5 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAgGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA+BxD,OAAO,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAelE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAgMxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAM9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAqBnE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAU3D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAUxF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIzE,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,GACf,MAAM,YAAY,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type {\n\tPluginAgentManifest,\n\tPluginBrowserManifest,\n\tPluginCliProviderManifest,\n\tPluginServiceArtifact,\n\tPluginServicePlatform,\n\tPluginServiceProviderManifest,\n\tPluginServiceRuntimeKind,\n\tPluginManifest,\n\tPluginManifestInput,\n\tPluginManifestResourceReference,\n\tPluginMcpServerConfig,\n\tPluginNetworkManifest,\n\tPluginSkillPresentation,\n\tPluginSkillPresentationRule,\n} from \"./manifest.js\";\n\n// File explorer\nexport type {\n\tPluginFileExplorerEntry,\n\tPluginWorkspaceRoot,\n\tPluginFileExplorerWhen,\n\tPluginFileExplorerActionContext,\n\tPluginFileExplorerContextMenuContribution,\n\tPluginFileExplorerToolbarContext,\n\tPluginFileExplorerToolbarContribution,\n\tPluginFileExplorerDecoration,\n\tPluginFileExplorerDecorationProvider,\n\tPluginFileExplorerChange,\n\tPluginFileExplorerRevealOptions,\n\tPluginFileExplorerApi,\n} from \"./file-explorer.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tConversationQueueState,\n\tCreateSessionOptions,\n\tPluginConversationApi,\n\tSendPromptResult,\n} from \"./conversation.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAbilityDetailSlotContribution,\n\tPluginAbilityDetailSlotProps,\n\tPluginNavBadge,\n\tPluginNavBadgeTone,\n\tPluginWorkspaceViewProps,\n\tPluginWorkspaceViewContribution,\n\tPluginWorkspaceViewHeader,\n\tPluginSidebarState,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginPreviewFileRef,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginActivityTabRetention,\n\tPluginActivityTabTargetOptions,\n\tPluginCaptureRegion,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tPluginNewSessionContext,\n\tPluginNewSessionContextActivation,\n\tPluginNewSessionContextContribution,\n\tPluginNewSessionTarget,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Keyboard shortcuts (host ShortcutScopeStack)\nexport type {\n\tPluginShortcutScopeKind,\n\tPluginShortcutWhen,\n\tPluginShortcutBinding,\n\tPluginShortcutScopeContribution,\n\tPluginRegisterShortcutScope,\n\tUsePluginShortcutScopeOptions,\n} from \"./shortcuts.js\";\nexport { usePluginShortcutScope } from \"./shortcuts.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginCodingAgentHookEvent,\n\tPluginCodingAgentHookEventName,\n\tPluginCodingAgentHookEventOf,\n\tPluginCodingAgentHookHandler,\n\tPluginCodingAgentHookHandlerContext,\n\tPluginCodingAgentHookRegistration,\n\tPluginCodingAgentHookResult,\n\tPluginCodingAgentHookTool,\n\tPluginCodingAgentPermissionMode,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\nexport { PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES } from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionUsage,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Host-managed AI\nexport type {\n\tPluginAiApi,\n\tPluginAiChatAssistantMessage,\n\tPluginAiChatMessage,\n\tPluginAiChatRequest,\n\tPluginAiChatResult,\n\tPluginAiChatTool,\n\tPluginAiChatToolResultMessage,\n\tPluginAiChatUserMessage,\n\tPluginAiCompleteRequest,\n\tPluginAiCompleteResult,\n\tPluginAiStreamOptions,\n\tPluginAiTextDeltaEvent,\n\tPluginAiModel,\n\tPluginAiModelListResult,\n\tPluginAiToolCall,\n\tPluginAiUsage,\n} from \"./ai.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialQuickPanelSettings,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialSessionHandle,\n\tPluginOfficialNavigationOpenInput,\n\tPluginOfficialOpenFilesOptions,\n\tPluginOfficialOpenedFile,\n\tPluginOfficialSessionAccess,\n\tPluginOfficialSessionRunningEvent,\n\tPluginOfficialSessionSummary,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / secrets\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnOptions,\n\tPluginCommandSpawnExit,\n\tPluginCommandSpawnStatus,\n\tPluginCommandSpawnHandle,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginCliProviderApi,\n\tPluginCliProviderPhase,\n\tPluginCliProviderStatus,\n} from \"./cli-provider.js\";\nexport type {\n\tPluginServiceApi,\n\tPluginServiceArtifactPayload,\n\tPluginServiceConnection,\n\tPluginServiceHostPlatform,\n\tPluginServicePhase,\n\tPluginServiceRequest,\n\tPluginServiceResponse,\n\tPluginServiceStatus,\n\tPluginServiceDataEncoding,\n} from \"./service-provider.js\";\nexport type { PluginModelDefinition, PluginModelProviderConfig, PluginModelsApi } from \"./models.js\";\nexport type {\n\tPluginBrowserAction,\n\tPluginBrowserActionResult,\n\tPluginBrowserApi,\n\tPluginBrowserPageState,\n\tPluginBrowserProfile,\n\tPluginBrowserRuntimePhase,\n\tPluginBrowserRuntimeStatus,\n\tPluginBrowserScreenshot,\n\tPluginBrowserSession,\n\tPluginBrowserSessionOptions,\n\tPluginBrowserSessionStatus,\n\tPluginBrowserSnapshot,\n\tPluginBrowserSource,\n\tPluginBrowserTextContent,\n} from \"./browser.js\";\nexport type {\n\tPluginCaptureApi,\n\tPluginOffscreenCaptureOptions,\n\tPluginOffscreenCaptureResult,\n} from \"./capture.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type {\n\tPluginArtifactDestination,\n\tPluginArtifactRef,\n\tPluginArtifactsApi,\n\tPluginPersistedArtifact,\n} from \"./artifacts.js\";\nexport type {\n\tPluginJob,\n\tPluginJobFailure,\n\tPluginJobProgress,\n\tPluginJobRef,\n\tPluginJobsApi,\n\tPluginJobStatus,\n\tPluginJobWaitOptions,\n} from \"./jobs.js\";\nexport type {\n\tPluginMediaApi,\n\tPluginMediaArtifact,\n\tPluginMediaCapability,\n\tPluginMediaComposeRequest,\n\tPluginMediaDimensions,\n\tPluginMediaErrorCode,\n\tPluginMediaFailure,\n\tPluginMediaGenerateRequest,\n\tPluginMediaGenerationInputSlot,\n\tPluginMediaGenerationMode,\n\tPluginMediaGenerationModeCapability,\n\tPluginMediaInput,\n\tPluginMediaInputSource,\n\tPluginMediaInputUploadRequest,\n\tPluginMediaJob,\n\tPluginMediaKind,\n\tPluginMediaOperation,\n\tPluginMediaOutput,\n\tPluginMediaOutputKind,\n\tPluginMediaProviderDescriptor,\n\tPluginMediaProviderArtifact,\n\tPluginMediaProviderArtifactSource,\n\tPluginMediaProviderHandlerContext,\n\tPluginMediaProviderInput,\n\tPluginMediaProviderJob,\n\tPluginMediaProviderRegistration,\n\tPluginMediaProviderSubmitRequest,\n\tPluginMediaSubmitRequest,\n\tPluginMediaTranscodeRequest,\n\tPluginMediaTransferResponse,\n} from \"./media.js\";\n// OCR Provider protocol\nexport type {\n\tOcrBlock,\n\tOcrClient,\n\tOcrErrorCode,\n\tOcrItemResult,\n\tOcrInput,\n\tOcrProgress,\n\tOcrProviderContext,\n\tOcrProviderDescriptor,\n\tOcrProviderInput,\n\tOcrProviderRegistration,\n\tOcrProviderRequest,\n\tOcrProviderResult,\n\tOcrRequest,\n\tOcrResult,\n\tOcrTransferResponse,\n\tOcrUploadRequest,\n} from \"./ocr.js\";\nexport { PluginMediaError } from \"./media.js\";\nexport type {\n\tPluginPromptAttachment,\n\tPluginPromptContext,\n\tPluginPromptContextJsonValue,\n} from \"./prompt-attachment.js\";\nexport { definePluginPromptContext } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type { PluginGatewayApi, PluginGatewayRequest, PluginGatewayResponse } from \"./gateway.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginPutBlobFromFileInput,\n\tPluginStorageApi,\n\tPluginStorageChange,\n\tPluginStorageCommitOptions,\n\tPluginStorageCommitResult,\n\tPluginStorageEncoding,\n\tPluginStorageSnapshot,\n\tPluginStorageWrite,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport { readJsonFile, writeJsonFile } from \"./storage.js\";\nexport type { PluginSecretsApi } from \"./secrets.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Context & lifecycle\nexport type {\n\tPluginPermissionApi,\n\tAgentMode,\n\tPluginActivationCleanup,\n\tPluginContext,\n\tPluginDefinition,\n} from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tusePromptAttachment,\n\tuseSidebarState,\n} from \"./hooks.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAkGtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA+BxD,OAAO,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAelE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAwMxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAM9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAqBnE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAU3D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAWxF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAUxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAazE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIzE,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,GACf,MAAM,YAAY,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type {\n\tPluginAgentManifest,\n\tPluginBrowserManifest,\n\tPluginCliProviderManifest,\n\tPluginServiceArtifact,\n\tPluginServicePlatform,\n\tPluginServiceProviderManifest,\n\tPluginServiceRuntimeKind,\n\tPluginManifest,\n\tPluginManifestInput,\n\tPluginManifestResourceReference,\n\tPluginMcpServerConfig,\n\tPluginNetworkManifest,\n\tPluginSkillPresentation,\n\tPluginSkillPresentationRule,\n} from \"./manifest.js\";\n\n// File explorer\nexport type {\n\tPluginFileExplorerEntry,\n\tPluginWorkspaceRoot,\n\tPluginFileExplorerWhen,\n\tPluginFileExplorerActionContext,\n\tPluginFileExplorerContextMenuContribution,\n\tPluginFileExplorerToolbarContext,\n\tPluginFileExplorerToolbarContribution,\n\tPluginFileExplorerDecoration,\n\tPluginFileExplorerDecorationProvider,\n\tPluginFileExplorerChange,\n\tPluginFileExplorerRevealOptions,\n\tPluginFileExplorerApi,\n} from \"./file-explorer.js\";\nexport type { PluginFileIconAssociations, PluginFileIconTheme } from \"./file-explorer.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tConversationQueueState,\n\tCreateSessionOptions,\n\tPluginConversationApi,\n\tSendPromptResult,\n} from \"./conversation.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAbilityDetailSlotContribution,\n\tPluginAbilityDetailSlotProps,\n\tPluginNavBadge,\n\tPluginNavBadgeTone,\n\tPluginWorkspaceViewProps,\n\tPluginWorkspaceViewContribution,\n\tPluginWorkspaceViewHeader,\n\tPluginSidebarState,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginPreviewFileRef,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginBottomPanelContribution,\n\tPluginActivityTabRetention,\n\tPluginActivityTabTargetOptions,\n\tPluginCaptureRegion,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tPluginNewSessionContext,\n\tPluginNewSessionContextActivation,\n\tPluginNewSessionContextContribution,\n\tPluginNewSessionTarget,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Keyboard shortcuts (host ShortcutScopeStack)\nexport type {\n\tPluginShortcutScopeKind,\n\tPluginShortcutWhen,\n\tPluginShortcutBinding,\n\tPluginShortcutScopeContribution,\n\tPluginRegisterShortcutScope,\n\tUsePluginShortcutScopeOptions,\n} from \"./shortcuts.js\";\nexport { usePluginShortcutScope } from \"./shortcuts.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginCodingAgentHookEvent,\n\tPluginCodingAgentHookEventName,\n\tPluginCodingAgentHookEventOf,\n\tPluginCodingAgentHookHandler,\n\tPluginCodingAgentHookHandlerContext,\n\tPluginCodingAgentHookRegistration,\n\tPluginCodingAgentHookResult,\n\tPluginCodingAgentHookTool,\n\tPluginCodingAgentPermissionMode,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\nexport { PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES } from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionUsage,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Host-managed AI\nexport type {\n\tPluginAiApi,\n\tPluginAiChatAssistantMessage,\n\tPluginAiChatMessage,\n\tPluginAiChatRequest,\n\tPluginAiChatResult,\n\tPluginAiChatTool,\n\tPluginAiChatToolResultMessage,\n\tPluginAiChatUserMessage,\n\tPluginAiCompleteRequest,\n\tPluginAiCompleteResult,\n\tPluginAiStreamOptions,\n\tPluginAiTextDeltaEvent,\n\tPluginAiModel,\n\tPluginAiModelListResult,\n\tPluginAiToolCall,\n\tPluginAiUsage,\n} from \"./ai.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialImageGenerationSettings,\n\tPluginOfficialImageGenerationSettingsUpdate,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialQuickPanelSettings,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerModel,\n\tPluginOfficialSchedulerNotification,\n\tPluginOfficialSchedulerRunTarget,\n\tPluginOfficialSchedulerSchedule,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialSessionHandle,\n\tPluginOfficialNavigationOpenInput,\n\tPluginOfficialOpenFilesOptions,\n\tPluginOfficialOpenedFile,\n\tPluginOfficialSessionAccess,\n\tPluginOfficialSessionRunningEvent,\n\tPluginOfficialSessionSummary,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / secrets\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsListFilesRecursiveOptions,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnOptions,\n\tPluginCommandSpawnExit,\n\tPluginCommandSpawnStatus,\n\tPluginCommandSpawnHandle,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginCliProviderApi,\n\tPluginCliProviderPhase,\n\tPluginCliProviderStatus,\n} from \"./cli-provider.js\";\nexport type {\n\tPluginServiceApi,\n\tPluginServiceArtifactPayload,\n\tPluginServiceConnection,\n\tPluginServiceHostPlatform,\n\tPluginServicePhase,\n\tPluginServiceRequest,\n\tPluginServiceResponse,\n\tPluginServiceStatus,\n\tPluginServiceDataEncoding,\n} from \"./service-provider.js\";\nexport type { PluginModelDefinition, PluginModelProviderConfig, PluginModelsApi } from \"./models.js\";\nexport type {\n\tPluginBrowserAction,\n\tPluginBrowserActionResult,\n\tPluginBrowserApi,\n\tPluginBrowserPageState,\n\tPluginBrowserProfile,\n\tPluginBrowserRuntimePhase,\n\tPluginBrowserRuntimeStatus,\n\tPluginBrowserScreenshot,\n\tPluginBrowserSession,\n\tPluginBrowserSessionOptions,\n\tPluginBrowserSessionStatus,\n\tPluginBrowserSnapshot,\n\tPluginBrowserSource,\n\tPluginBrowserTextContent,\n} from \"./browser.js\";\nexport type {\n\tPluginCaptureApi,\n\tPluginOffscreenCaptureOptions,\n\tPluginOffscreenCaptureResult,\n} from \"./capture.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type {\n\tPluginArtifactDestination,\n\tPluginArtifactRef,\n\tPluginArtifactsApi,\n\tPluginPersistedArtifact,\n} from \"./artifacts.js\";\nexport type {\n\tPluginJob,\n\tPluginJobFailure,\n\tPluginJobProgress,\n\tPluginJobRef,\n\tPluginJobsApi,\n\tPluginJobStatus,\n\tPluginJobWaitOptions,\n} from \"./jobs.js\";\nexport type {\n\tPluginMediaApi,\n\tPluginMediaArtifact,\n\tPluginMediaCapability,\n\tPluginMediaComposeRequest,\n\tPluginMediaDimensions,\n\tPluginMediaErrorCode,\n\tPluginMediaFailure,\n\tPluginMediaGenerateRequest,\n\tPluginMediaGenerationInputSlot,\n\tPluginMediaGenerationMode,\n\tPluginMediaGenerationModeCapability,\n\tPluginMediaInput,\n\tPluginMediaInputSource,\n\tPluginMediaInputUploadRequest,\n\tPluginMediaJob,\n\tPluginMediaKind,\n\tPluginMediaOperation,\n\tPluginMediaOutput,\n\tPluginMediaOutputKind,\n\tPluginMediaProviderDescriptor,\n\tPluginMediaGenerationModelDescriptor,\n\tPluginMediaProviderArtifact,\n\tPluginMediaProviderArtifactSource,\n\tPluginMediaProviderHandlerContext,\n\tPluginMediaProviderInput,\n\tPluginMediaProviderJob,\n\tPluginMediaProviderRegistration,\n\tPluginMediaProviderSubmitRequest,\n\tPluginMediaSubmitRequest,\n\tPluginMediaTranscodeRequest,\n\tPluginMediaTransferResponse,\n} from \"./media.js\";\n// OCR Provider protocol\nexport type {\n\tOcrBlock,\n\tOcrClient,\n\tOcrErrorCode,\n\tOcrItemResult,\n\tOcrInput,\n\tOcrProgress,\n\tOcrProviderContext,\n\tOcrProviderDescriptor,\n\tOcrProviderInput,\n\tOcrProviderRegistration,\n\tOcrProviderRequest,\n\tOcrProviderResult,\n\tOcrRequest,\n\tOcrResult,\n\tOcrTransferResponse,\n\tOcrUploadRequest,\n} from \"./ocr.js\";\nexport { PluginMediaError } from \"./media.js\";\nexport type {\n\tPluginPromptAttachment,\n\tPluginPromptContext,\n\tPluginPromptContextJsonValue,\n} from \"./prompt-attachment.js\";\nexport { definePluginPromptContext } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type { PluginGatewayApi, PluginGatewayRequest, PluginGatewayResponse } from \"./gateway.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginPutBlobFromFileInput,\n\tPluginStorageApi,\n\tPluginStorageChange,\n\tPluginStorageCommitOptions,\n\tPluginStorageCommitResult,\n\tPluginStorageEncoding,\n\tPluginStorageSnapshot,\n\tPluginStorageWrite,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport { readJsonFile, writeJsonFile } from \"./storage.js\";\nexport type { PluginSecretsApi } from \"./secrets.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Build-bound logging\nexport type {\n\tPluginLogEntry,\n\tPluginLogFields,\n\tPluginLogIdentity,\n\tPluginLogLevel,\n\tPluginLogger,\n\tPluginLogSink,\n} from \"./logging.js\";\nexport { __createPluginLogger, __setPluginLogSink } from \"./logging.js\";\n\n// Context & lifecycle\nexport type {\n\tPluginPermissionApi,\n\tAgentMode,\n\tPluginActivationCleanup,\n\tPluginContext,\n\tPluginDefinition,\n} from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// Bottom panel context\nexport type {\n\tPluginBottomPanelCloseConfirm,\n\tPluginBottomPanelCloseDecision,\n\tPluginBottomPanelCloseReason,\n\tPluginBottomPanelCloseRequest,\n\tPluginBottomPanelContextValue,\n\tPluginBottomPanelMeta,\n\tPluginBottomPanelStatus,\n\tPluginBottomPanelTerminalRequest,\n} from \"./bottom-panel.js\";\nexport { __BottomPanelContext, useBottomPanel } from \"./bottom-panel.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tusePromptAttachment,\n\tuseSidebarState,\n} from \"./hooks.js\";\n"]}
@@ -0,0 +1,11 @@
1
+ import type { PluginLogger } from "./logging.js";
2
+ /**
3
+ * Build-bound plugin logger.
4
+ *
5
+ * `@vetta-org/plugin-vite` replaces this module with a facade whose immutable
6
+ * identity comes from the validated `plugin.json`. The fallback deliberately
7
+ * fails on use so an unsupported build pipeline cannot emit unscoped logs.
8
+ */
9
+ export declare const logger: PluginLogger;
10
+ export type { PluginLogFields, PluginLogLevel, PluginLogger } from "./logging.js";
11
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,cAAc,CAAC;AAQlE;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,YAMnB,CAAC;AAEH,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC","sourcesContent":["import type { PluginLogFields, PluginLogger } from \"./logging.js\";\n\nfunction unavailable(): never {\n\tthrow new Error(\n\t\t\"Plugin logger is not bound. Build this plugin with a compatible @vetta-org/plugin-vite release.\",\n\t);\n}\n\n/**\n * Build-bound plugin logger.\n *\n * `@vetta-org/plugin-vite` replaces this module with a facade whose immutable\n * identity comes from the validated `plugin.json`. The fallback deliberately\n * fails on use so an unsupported build pipeline cannot emit unscoped logs.\n */\nexport const logger: PluginLogger = Object.freeze({\n\tdebug: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\tinfo: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\twarn: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\terror: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\tchild: (_scope: string) => unavailable(),\n});\n\nexport type { PluginLogFields, PluginLogLevel, PluginLogger } from \"./logging.js\";\n"]}
package/dist/logger.js ADDED
@@ -0,0 +1,18 @@
1
+ function unavailable() {
2
+ throw new Error("Plugin logger is not bound. Build this plugin with a compatible @vetta-org/plugin-vite release.");
3
+ }
4
+ /**
5
+ * Build-bound plugin logger.
6
+ *
7
+ * `@vetta-org/plugin-vite` replaces this module with a facade whose immutable
8
+ * identity comes from the validated `plugin.json`. The fallback deliberately
9
+ * fails on use so an unsupported build pipeline cannot emit unscoped logs.
10
+ */
11
+ export const logger = Object.freeze({
12
+ debug: (_message, _fields) => unavailable(),
13
+ info: (_message, _fields) => unavailable(),
14
+ warn: (_message, _fields) => unavailable(),
15
+ error: (_message, _fields) => unavailable(),
16
+ child: (_scope) => unavailable(),
17
+ });
18
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,SAAS,WAAW,GAAU;IAC7B,MAAM,IAAI,KAAK,CACd,iGAAiG,CACjG,CAAC;AAAA,CACF;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAiB,MAAM,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,CAAC,QAAgB,EAAE,OAAyB,EAAE,EAAE,CAAC,WAAW,EAAE;IACrE,IAAI,EAAE,CAAC,QAAgB,EAAE,OAAyB,EAAE,EAAE,CAAC,WAAW,EAAE;IACpE,IAAI,EAAE,CAAC,QAAgB,EAAE,OAAyB,EAAE,EAAE,CAAC,WAAW,EAAE;IACpE,KAAK,EAAE,CAAC,QAAgB,EAAE,OAAyB,EAAE,EAAE,CAAC,WAAW,EAAE;IACrE,KAAK,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,WAAW,EAAE;CACxC,CAAC,CAAC","sourcesContent":["import type { PluginLogFields, PluginLogger } from \"./logging.js\";\n\nfunction unavailable(): never {\n\tthrow new Error(\n\t\t\"Plugin logger is not bound. Build this plugin with a compatible @vetta-org/plugin-vite release.\",\n\t);\n}\n\n/**\n * Build-bound plugin logger.\n *\n * `@vetta-org/plugin-vite` replaces this module with a facade whose immutable\n * identity comes from the validated `plugin.json`. The fallback deliberately\n * fails on use so an unsupported build pipeline cannot emit unscoped logs.\n */\nexport const logger: PluginLogger = Object.freeze({\n\tdebug: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\tinfo: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\twarn: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\terror: (_message: string, _fields?: PluginLogFields) => unavailable(),\n\tchild: (_scope: string) => unavailable(),\n});\n\nexport type { PluginLogFields, PluginLogLevel, PluginLogger } from \"./logging.js\";\n"]}
@@ -0,0 +1,26 @@
1
+ export type PluginLogLevel = "debug" | "info" | "warn" | "error";
2
+ export type PluginLogFields = Readonly<Record<string, unknown>>;
3
+ export interface PluginLogger {
4
+ debug(message: string, fields?: PluginLogFields): void;
5
+ info(message: string, fields?: PluginLogFields): void;
6
+ warn(message: string, fields?: PluginLogFields): void;
7
+ error(message: string, fields?: PluginLogFields): void;
8
+ child(scope: string): PluginLogger;
9
+ }
10
+ export interface PluginLogIdentity {
11
+ id: string;
12
+ version: string;
13
+ }
14
+ export interface PluginLogEntry {
15
+ level: PluginLogLevel;
16
+ plugin: PluginLogIdentity;
17
+ scope?: string;
18
+ message: string;
19
+ fields?: PluginLogFields;
20
+ }
21
+ export type PluginLogSink = (entry: PluginLogEntry) => void;
22
+ /** Host-only: install the sink used by build-bound plugin loggers. */
23
+ export declare function __setPluginLogSink(sink: PluginLogSink | undefined): void;
24
+ /** Build-tool entry point. Plugin authors import the bound facade from `@vetta-org/plugin-sdk/logger`. */
25
+ export declare function __createPluginLogger(plugin: PluginLogIdentity, scope?: string): PluginLogger;
26
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC5B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACtD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACvD,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;AAI5D,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAExE;AAyBD,0GAA0G;AAC1G,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAa5F","sourcesContent":["export type PluginLogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nexport type PluginLogFields = Readonly<Record<string, unknown>>;\n\nexport interface PluginLogger {\n\tdebug(message: string, fields?: PluginLogFields): void;\n\tinfo(message: string, fields?: PluginLogFields): void;\n\twarn(message: string, fields?: PluginLogFields): void;\n\terror(message: string, fields?: PluginLogFields): void;\n\tchild(scope: string): PluginLogger;\n}\n\nexport interface PluginLogIdentity {\n\tid: string;\n\tversion: string;\n}\n\nexport interface PluginLogEntry {\n\tlevel: PluginLogLevel;\n\tplugin: PluginLogIdentity;\n\tscope?: string;\n\tmessage: string;\n\tfields?: PluginLogFields;\n}\n\nexport type PluginLogSink = (entry: PluginLogEntry) => void;\n\nlet pluginLogSink: PluginLogSink | undefined;\n\n/** Host-only: install the sink used by build-bound plugin loggers. */\nexport function __setPluginLogSink(sink: PluginLogSink | undefined): void {\n\tpluginLogSink = sink;\n}\n\nfunction joinScope(parent: string | undefined, child: string): string {\n\tconst normalized = child.trim();\n\tif (!normalized) throw new Error(\"Plugin logger scope must not be empty\");\n\treturn parent ? `${parent}.${normalized}` : normalized;\n}\n\nfunction emit(\n\tplugin: PluginLogIdentity,\n\tscope: string | undefined,\n\tlevel: PluginLogLevel,\n\tmessage: string,\n\tfields: PluginLogFields | undefined,\n): void {\n\tif (!pluginLogSink) throw new Error(\"Vetta plugin log sink is not installed\");\n\tpluginLogSink({\n\t\tlevel,\n\t\tplugin,\n\t\t...(scope ? { scope } : {}),\n\t\tmessage,\n\t\t...(fields ? { fields } : {}),\n\t});\n}\n\n/** Build-tool entry point. Plugin authors import the bound facade from `@vetta-org/plugin-sdk/logger`. */\nexport function __createPluginLogger(plugin: PluginLogIdentity, scope?: string): PluginLogger {\n\tconst identity = Object.freeze({ id: plugin.id, version: plugin.version });\n\tconst write = (level: PluginLogLevel, message: string, fields?: PluginLogFields): void => {\n\t\temit(identity, scope, level, message, fields);\n\t};\n\tconst logger: PluginLogger = {\n\t\tdebug: (message, fields) => write(\"debug\", message, fields),\n\t\tinfo: (message, fields) => write(\"info\", message, fields),\n\t\twarn: (message, fields) => write(\"warn\", message, fields),\n\t\terror: (message, fields) => write(\"error\", message, fields),\n\t\tchild: (childScope) => __createPluginLogger(identity, joinScope(scope, childScope)),\n\t};\n\treturn Object.freeze(logger);\n}\n"]}
@@ -0,0 +1,38 @@
1
+ let pluginLogSink;
2
+ /** Host-only: install the sink used by build-bound plugin loggers. */
3
+ export function __setPluginLogSink(sink) {
4
+ pluginLogSink = sink;
5
+ }
6
+ function joinScope(parent, child) {
7
+ const normalized = child.trim();
8
+ if (!normalized)
9
+ throw new Error("Plugin logger scope must not be empty");
10
+ return parent ? `${parent}.${normalized}` : normalized;
11
+ }
12
+ function emit(plugin, scope, level, message, fields) {
13
+ if (!pluginLogSink)
14
+ throw new Error("Vetta plugin log sink is not installed");
15
+ pluginLogSink({
16
+ level,
17
+ plugin,
18
+ ...(scope ? { scope } : {}),
19
+ message,
20
+ ...(fields ? { fields } : {}),
21
+ });
22
+ }
23
+ /** Build-tool entry point. Plugin authors import the bound facade from `@vetta-org/plugin-sdk/logger`. */
24
+ export function __createPluginLogger(plugin, scope) {
25
+ const identity = Object.freeze({ id: plugin.id, version: plugin.version });
26
+ const write = (level, message, fields) => {
27
+ emit(identity, scope, level, message, fields);
28
+ };
29
+ const logger = {
30
+ debug: (message, fields) => write("debug", message, fields),
31
+ info: (message, fields) => write("info", message, fields),
32
+ warn: (message, fields) => write("warn", message, fields),
33
+ error: (message, fields) => write("error", message, fields),
34
+ child: (childScope) => __createPluginLogger(identity, joinScope(scope, childScope)),
35
+ };
36
+ return Object.freeze(logger);
37
+ }
38
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AA2BA,IAAI,aAAwC,CAAC;AAE7C,sEAAsE;AACtE,MAAM,UAAU,kBAAkB,CAAC,IAA+B,EAAQ;IACzE,aAAa,GAAG,IAAI,CAAC;AAAA,CACrB;AAED,SAAS,SAAS,CAAC,MAA0B,EAAE,KAAa,EAAU;IACrE,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;AAAA,CACvD;AAED,SAAS,IAAI,CACZ,MAAyB,EACzB,KAAyB,EACzB,KAAqB,EACrB,OAAe,EACf,MAAmC,EAC5B;IACP,IAAI,CAAC,aAAa;QAAE,MAAM,IAAI,KAAK,CAAC,wCAA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K,EAAE,UAAU,CAAC,CAAC;KACnF,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAAA,CAC7B","sourcesContent":["export type PluginLogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nexport type PluginLogFields = Readonly<Record<string, unknown>>;\n\nexport interface PluginLogger {\n\tdebug(message: string, fields?: PluginLogFields): void;\n\tinfo(message: string, fields?: PluginLogFields): void;\n\twarn(message: string, fields?: PluginLogFields): void;\n\terror(message: string, fields?: PluginLogFields): void;\n\tchild(scope: string): PluginLogger;\n}\n\nexport interface PluginLogIdentity {\n\tid: string;\n\tversion: string;\n}\n\nexport interface PluginLogEntry {\n\tlevel: PluginLogLevel;\n\tplugin: PluginLogIdentity;\n\tscope?: string;\n\tmessage: string;\n\tfields?: PluginLogFields;\n}\n\nexport type PluginLogSink = (entry: PluginLogEntry) => void;\n\nlet pluginLogSink: PluginLogSink | undefined;\n\n/** Host-only: install the sink used by build-bound plugin loggers. */\nexport function __setPluginLogSink(sink: PluginLogSink | undefined): void {\n\tpluginLogSink = sink;\n}\n\nfunction joinScope(parent: string | undefined, child: string): string {\n\tconst normalized = child.trim();\n\tif (!normalized) throw new Error(\"Plugin logger scope must not be empty\");\n\treturn parent ? `${parent}.${normalized}` : normalized;\n}\n\nfunction emit(\n\tplugin: PluginLogIdentity,\n\tscope: string | undefined,\n\tlevel: PluginLogLevel,\n\tmessage: string,\n\tfields: PluginLogFields | undefined,\n): void {\n\tif (!pluginLogSink) throw new Error(\"Vetta plugin log sink is not installed\");\n\tpluginLogSink({\n\t\tlevel,\n\t\tplugin,\n\t\t...(scope ? { scope } : {}),\n\t\tmessage,\n\t\t...(fields ? { fields } : {}),\n\t});\n}\n\n/** Build-tool entry point. Plugin authors import the bound facade from `@vetta-org/plugin-sdk/logger`. */\nexport function __createPluginLogger(plugin: PluginLogIdentity, scope?: string): PluginLogger {\n\tconst identity = Object.freeze({ id: plugin.id, version: plugin.version });\n\tconst write = (level: PluginLogLevel, message: string, fields?: PluginLogFields): void => {\n\t\temit(identity, scope, level, message, fields);\n\t};\n\tconst logger: PluginLogger = {\n\t\tdebug: (message, fields) => write(\"debug\", message, fields),\n\t\tinfo: (message, fields) => write(\"info\", message, fields),\n\t\twarn: (message, fields) => write(\"warn\", message, fields),\n\t\terror: (message, fields) => write(\"error\", message, fields),\n\t\tchild: (childScope) => __createPluginLogger(identity, joinScope(scope, childScope)),\n\t};\n\treturn Object.freeze(logger);\n}\n"]}
@@ -134,7 +134,7 @@ export declare const PluginNetworkManifestSchema: import("@sinclair/typebox").TO
134
134
  export declare const PluginBrowserManifestSchema: import("@sinclair/typebox").TObject<{
135
135
  allowedHosts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
136
136
  }>;
137
- export declare const PluginPermissionSchema: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"agent.command.run" | "agent.command.spawn" | "agent.continuation.register" | "agent.hookHandler.execute" | "agent.hooks.register" | "agent.mcp.control" | "agent.runtime.configure" | "agent.session.read" | "agent.session.write" | "agent.skills.control" | "agent.state.read" | "agent.state.write" | "agent.systemPrompt.fullControl" | "agent.systemPrompt.read" | "agent.systemPrompt.write" | "agent.toolHandler.execute" | "agent.tools.control" | "agent.tools.register" | "ai.complete" | "ai.models.list" | "ai.ocr.provider.register" | "ai.ocr.recognize" | "app.actionHandler.execute" | "app.actions.register" | "browser.attach" | "browser.interact" | "browser.open" | "browser.profile.persist" | "browser.read" | "browser.runtime.manage" | "capture.offscreen" | "conversation.draft.read" | "fs.read" | "fs.write" | "media.generate" | "media.provider.register" | "models.manage" | "network.fetch" | "secrets.read" | "secrets.write" | "settings.read" | "settings.write" | "shell.openExternal" | "storage.read" | "storage.write" | "ui.file-explorer.context-menu" | "ui.file-explorer.decorations" | "ui.file-explorer.toolbar" | "ui.shortcuts.register" | "ui.slot.ability-detail" | "ui.slot.activity-tab" | "ui.slot.file-preview" | "ui.slot.global" | "ui.slot.input-action" | "ui.slot.message" | "ui.slot.new-session-context" | "ui.slot.tool-call" | "ui.slot.turn-card" | "ui.slot.workspace-view" | "workspace.read">[]>;
137
+ export declare const PluginPermissionSchema: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"agent.command.run" | "agent.command.spawn" | "agent.continuation.register" | "agent.hookHandler.execute" | "agent.hooks.register" | "agent.mcp.control" | "agent.runtime.configure" | "agent.session.read" | "agent.session.write" | "agent.skills.control" | "agent.state.read" | "agent.state.write" | "agent.systemPrompt.fullControl" | "agent.systemPrompt.read" | "agent.systemPrompt.write" | "agent.toolHandler.execute" | "agent.tools.control" | "agent.tools.register" | "ai.complete" | "ai.models.list" | "ai.ocr.provider.register" | "ai.ocr.recognize" | "app.actionHandler.execute" | "app.actions.register" | "browser.attach" | "browser.interact" | "browser.open" | "browser.profile.persist" | "browser.read" | "browser.runtime.manage" | "capture.offscreen" | "conversation.draft.read" | "fs.read" | "fs.write" | "media.generate" | "media.provider.register" | "models.manage" | "network.fetch" | "secrets.read" | "secrets.write" | "settings.read" | "settings.write" | "shell.openExternal" | "storage.read" | "storage.write" | "terminal.run" | "ui.file-explorer.context-menu" | "ui.file-explorer.decorations" | "ui.file-explorer.toolbar" | "ui.shortcuts.register" | "ui.slot.ability-detail" | "ui.slot.activity-tab" | "ui.slot.bottom-panel" | "ui.slot.file-preview" | "ui.slot.global" | "ui.slot.input-action" | "ui.slot.message" | "ui.slot.new-session-context" | "ui.slot.tool-call" | "ui.slot.turn-card" | "ui.slot.workspace-view" | "workspace.read">[]>;
138
138
  export declare const PluginMcpStdioServerConfigSchema: import("@sinclair/typebox").TObject<{
139
139
  disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
140
140
  autoApprove: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
@@ -714,7 +714,7 @@ export declare const PluginManifestSchema: import("@sinclair/typebox").TObject<{
714
714
  }>>>;
715
715
  }>>;
716
716
  styles: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
717
- permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"agent.command.run" | "agent.command.spawn" | "agent.continuation.register" | "agent.hookHandler.execute" | "agent.hooks.register" | "agent.mcp.control" | "agent.runtime.configure" | "agent.session.read" | "agent.session.write" | "agent.skills.control" | "agent.state.read" | "agent.state.write" | "agent.systemPrompt.fullControl" | "agent.systemPrompt.read" | "agent.systemPrompt.write" | "agent.toolHandler.execute" | "agent.tools.control" | "agent.tools.register" | "ai.complete" | "ai.models.list" | "ai.ocr.provider.register" | "ai.ocr.recognize" | "app.actionHandler.execute" | "app.actions.register" | "browser.attach" | "browser.interact" | "browser.open" | "browser.profile.persist" | "browser.read" | "browser.runtime.manage" | "capture.offscreen" | "conversation.draft.read" | "fs.read" | "fs.write" | "media.generate" | "media.provider.register" | "models.manage" | "network.fetch" | "secrets.read" | "secrets.write" | "settings.read" | "settings.write" | "shell.openExternal" | "storage.read" | "storage.write" | "ui.file-explorer.context-menu" | "ui.file-explorer.decorations" | "ui.file-explorer.toolbar" | "ui.shortcuts.register" | "ui.slot.ability-detail" | "ui.slot.activity-tab" | "ui.slot.file-preview" | "ui.slot.global" | "ui.slot.input-action" | "ui.slot.message" | "ui.slot.new-session-context" | "ui.slot.tool-call" | "ui.slot.turn-card" | "ui.slot.workspace-view" | "workspace.read">[]>>>;
717
+ permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"agent.command.run" | "agent.command.spawn" | "agent.continuation.register" | "agent.hookHandler.execute" | "agent.hooks.register" | "agent.mcp.control" | "agent.runtime.configure" | "agent.session.read" | "agent.session.write" | "agent.skills.control" | "agent.state.read" | "agent.state.write" | "agent.systemPrompt.fullControl" | "agent.systemPrompt.read" | "agent.systemPrompt.write" | "agent.toolHandler.execute" | "agent.tools.control" | "agent.tools.register" | "ai.complete" | "ai.models.list" | "ai.ocr.provider.register" | "ai.ocr.recognize" | "app.actionHandler.execute" | "app.actions.register" | "browser.attach" | "browser.interact" | "browser.open" | "browser.profile.persist" | "browser.read" | "browser.runtime.manage" | "capture.offscreen" | "conversation.draft.read" | "fs.read" | "fs.write" | "media.generate" | "media.provider.register" | "models.manage" | "network.fetch" | "secrets.read" | "secrets.write" | "settings.read" | "settings.write" | "shell.openExternal" | "storage.read" | "storage.write" | "terminal.run" | "ui.file-explorer.context-menu" | "ui.file-explorer.decorations" | "ui.file-explorer.toolbar" | "ui.shortcuts.register" | "ui.slot.ability-detail" | "ui.slot.activity-tab" | "ui.slot.bottom-panel" | "ui.slot.file-preview" | "ui.slot.global" | "ui.slot.input-action" | "ui.slot.message" | "ui.slot.new-session-context" | "ui.slot.tool-call" | "ui.slot.turn-card" | "ui.slot.workspace-view" | "workspace.read">[]>>>;
718
718
  network: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
719
719
  allowedHosts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
720
720
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-schema.d.ts","sourceRoot":"","sources":["../src/manifest-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMtD,eAAO,MAAM,cAAc,qCAKzB,CAAC;AAEH,eAAO,MAAM,mBAAmB,qCAK9B,CAAC;AAEH,eAAO,MAAM,uBAAuB,qCAKlC,CAAC;AAEH,eAAO,MAAM,wBAAwB,yEAAsC,CAAC;AAW5E,eAAO,MAAM,+BAA+B;;;;;;;;;;;;EAgB3C,CAAC;AAQF,eAAO,MAAM,2BAA2B;;;IAItC,qGAAqG;;EAItG,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;QANtC,qGAAqG;;;EAYtG,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;QAK5C,4DAA4D;;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/E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC3E,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,gCAAgC,CAAC,CAAC;AACzF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACnF,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAC/F,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACnF,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC3F,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACvF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAC/F,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG,WAAW,CAAC;AACtE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACnF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC","sourcesContent":["import { Type, type Static } from \"@sinclair/typebox\";\nimport { SkillSurfaceVisibilitySchema, SkillVisibilitySchema } from \"@vetta-org/capability-sdk\";\nimport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\n\nconst NON_WHITESPACE_PATTERN = \"\\\\S\";\n\nexport const PluginIdSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 64,\n\tpattern: \"^[a-z0-9][a-z0-9._-]{0,63}$\",\n\tdescription: \"Stable lowercase plugin identifier.\",\n});\n\nexport const PluginVersionSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 64,\n\tpattern: \"^[a-zA-Z0-9][a-zA-Z0-9._+-]{0,63}$\",\n\tdescription: \"Plugin version without path separators.\",\n});\n\nexport const PluginCommandNameSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 64,\n\tpattern: \"^[a-zA-Z0-9][a-zA-Z0-9._+-]{0,63}$\",\n\tdescription: \"Bare executable name declared by the plugin.\",\n});\n\nexport const PluginCommandNamesSchema = Type.Array(PluginCommandNameSchema);\n\nconst PluginCliCommandSchema = Type.Object(\n\t{\n\t\tcommand: PluginCommandNameSchema,\n\t\targs: Type.Optional(Type.Array(Type.String(), { maxItems: 64 })),\n\t\ttimeoutMs: Type.Optional(Type.Number({ minimum: 1_000, maximum: 30 * 60_000 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginCliProviderManifestSchema = Type.Object(\n\t{\n\t\tid: PluginIdSchema,\n\t\tcommand: PluginCommandNameSchema,\n\t\tprobe: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\targs: Type.Optional(Type.Array(Type.String(), { maxItems: 64 })),\n\t\t\t\t\ttimeoutMs: Type.Optional(Type.Number({ minimum: 1_000, maximum: 120_000 })),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: false },\n\t\t\t),\n\t\t),\n\t\tinstall: PluginCliCommandSchema,\n\t},\n\t{ additionalProperties: false },\n);\n\nconst PluginServiceArchiveSchema = Type.Union([\n\tType.Literal(\"file\"),\n\tType.Literal(\"zip\"),\n\tType.Literal(\"tar.gz\"),\n]);\n\nexport const PluginServiceArtifactSchema = Type.Object(\n\t{\n\t\tsha256: Type.String({ pattern: \"^[a-f0-9]{64}$\" }),\n\t\tarchive: PluginServiceArchiveSchema,\n\t\t/** Relative file (archive=file) or directory (archive=zip/tar.gz) below the managed runtime root. */\n\t\tdestination: Type.String({ minLength: 1, maxLength: 512 }),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginServicePlatformSchema = Type.Object(\n\t{\n\t\texecutable: Type.String({ minLength: 1, maxLength: 512 }),\n\t\tartifacts: Type.Array(PluginServiceArtifactSchema, { minItems: 1, maxItems: 8 }),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginServiceProviderManifestSchema = Type.Object(\n\t{\n\t\tid: PluginIdSchema,\n\t\truntime: Type.Object(\n\t\t\t{\n\t\t\t\t/** `managed-binary` is the backwards-compatible default. */\n\t\t\t\tkind: Type.Optional(Type.Union([Type.Literal(\"managed-binary\"), Type.Literal(\"host-node\")])),\n\t\t\t\tversion: PluginVersionSchema,\n\t\t\t\t/** Entry script relative to the installed runtime (required for host-node). */\n\t\t\t\tentry: Type.Optional(Type.String({ minLength: 1, maxLength: 512 })),\n\t\t\t\tplatforms: Type.Record(\n\t\t\t\t\tType.String({ pattern: \"^(win32|darwin|linux)-(x64|arm64)$\" }),\n\t\t\t\t\tPluginServicePlatformSchema,\n\t\t\t\t),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\tcredentials: Type.Optional(\n\t\t\tType.Array(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tid: PluginIdSchema,\n\t\t\t\t\t\tbytes: Type.Optional(Type.Integer({ minimum: 16, maximum: 64 })),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t\t{ minItems: 1, maxItems: 8 },\n\t\t\t),\n\t\t),\n\t\ttemplates: Type.Optional(\n\t\t\tType.Array(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tsource: Type.String({ minLength: 1, maxLength: 512 }),\n\t\t\t\t\t\tdestination: Type.String({ minLength: 1, maxLength: 512 }),\n\t\t\t\t\t\t/** create preserves a data file; render regenerates a cache file on every start. */\n\t\t\t\t\t\tmode: Type.Union([Type.Literal(\"create\"), Type.Literal(\"render\")]),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t\t{ minItems: 1, maxItems: 16 },\n\t\t\t),\n\t\t),\n\t\tprocess: Type.Object(\n\t\t\t{\n\t\t\t\targs: Type.Optional(Type.Array(Type.String(), { maxItems: 64 })),\n\t\t\t\tenv: Type.Optional(Type.Record(Type.String({ minLength: 1 }), Type.String())),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\thealth: Type.Object(\n\t\t\t{\n\t\t\t\tpath: Type.String({ minLength: 1, maxLength: 1_024, pattern: \"^/[^/]*\" }),\n\t\t\t\tcredentialId: Type.Optional(PluginIdSchema),\n\t\t\t\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1_000, maximum: 120_000 })),\n\t\t\t\treadiness: Type.Optional(\n\t\t\t\t\tType.Object({ mode: Type.Literal(\"plugin\") }, { additionalProperties: false }),\n\t\t\t\t),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginProvidersManifestSchema = Type.Object(\n\t{\n\t\tcli: Type.Optional(Type.Array(PluginCliProviderManifestSchema, { minItems: 1, maxItems: 16 })),\n\t\tservices: Type.Optional(Type.Array(PluginServiceProviderManifestSchema, { minItems: 1, maxItems: 8 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginNetworkManifestSchema = Type.Object(\n\t{\n\t\tallowedHosts: Type.Array(Type.String({ minLength: 1, maxLength: 253, pattern: NON_WHITESPACE_PATTERN }), {\n\t\t\tminItems: 1,\n\t\t\tmaxItems: 128,\n\t\t}),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginBrowserManifestSchema = Type.Object(\n\t{\n\t\tallowedHosts: Type.Array(Type.String({ minLength: 1, maxLength: 253, pattern: NON_WHITESPACE_PATTERN }), {\n\t\t\tminItems: 1,\n\t\t\tmaxItems: 128,\n\t\t}),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginPermissionSchema = Type.Union(\n\tPLUGIN_PERMISSIONS.map((permission) => Type.Literal(permission)),\n\t{ description: \"Host capability requested by the plugin.\" },\n);\n\nconst NonWhitespaceStringSchema = Type.String({ pattern: NON_WHITESPACE_PATTERN });\nconst OptionalAgentModesSchema = Type.Optional(\n\tType.Union([NonWhitespaceStringSchema, Type.Array(NonWhitespaceStringSchema)]),\n);\nconst StringRecordSchema = Type.Record(Type.String(), Type.String());\n\nconst PluginMcpCommonProperties = {\n\tdisabled: Type.Optional(Type.Boolean()),\n\tautoApprove: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\tstartupTimeout: Type.Optional(Type.Number()),\n\tdebug: Type.Optional(Type.Boolean()),\n\tdisplayName: Type.Optional(Type.String()),\n\tdescription: Type.Optional(Type.String()),\n\tagent_mode: OptionalAgentModesSchema,\n};\n\nexport const PluginMcpStdioServerConfigSchema = Type.Object(\n\t{\n\t\t...PluginMcpCommonProperties,\n\t\ttype: Type.Optional(Type.Literal(\"stdio\")),\n\t\tcommand: NonWhitespaceStringSchema,\n\t\targs: Type.Optional(Type.Array(Type.String())),\n\t\tenv: Type.Optional(StringRecordSchema),\n\t\tcwd: Type.Optional(Type.String()),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginMcpHttpServerConfigSchema = Type.Object(\n\t{\n\t\t...PluginMcpCommonProperties,\n\t\ttype: Type.Literal(\"http\"),\n\t\turl: NonWhitespaceStringSchema,\n\t\theaders: Type.Optional(StringRecordSchema),\n\t\toauthClientId: Type.Optional(Type.String()),\n\t\toauthDeviceFlow: Type.Optional(Type.Boolean()),\n\t\toauthScopes: Type.Optional(Type.String()),\n\t},\n\t{ additionalProperties: true },\n);\n\n/** HTTP MCP served by one of this plugin's managed local services. */\nexport const PluginMcpServiceServerConfigSchema = Type.Object(\n\t{\n\t\t...PluginMcpCommonProperties,\n\t\ttype: Type.Literal(\"service\"),\n\t\tserviceId: PluginIdSchema,\n\t\tpath: Type.String({ pattern: \"^/[^/]*\" }),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginMcpServerConfigSchema = Type.Union([\n\tPluginMcpStdioServerConfigSchema,\n\tPluginMcpHttpServerConfigSchema,\n\tPluginMcpServiceServerConfigSchema,\n]);\n\nconst PluginMcpServerMapSchema = Type.Record(\n\tType.String({ pattern: NON_WHITESPACE_PATTERN }),\n\tPluginMcpServerConfigSchema,\n\t{ additionalProperties: false },\n);\n\nexport const PluginSkillPresentationRuleSchema = Type.Object(\n\t{\n\t\tdefaultVisibility: Type.Optional(SkillVisibilitySchema),\n\t\tsurfaces: Type.Optional(SkillSurfaceVisibilitySchema),\n\t\tdisplayName: Type.Optional(NonWhitespaceStringSchema),\n\t\tdisplayDescription: Type.Optional(NonWhitespaceStringSchema),\n\t},\n\t{ additionalProperties: false },\n);\nexport const PluginSkillPresentationSchema = Type.Object(\n\t{\n\t\tdefaultVisibility: Type.Optional(SkillVisibilitySchema),\n\t\tsurfaces: Type.Optional(SkillSurfaceVisibilitySchema),\n\t\tskills: Type.Optional(Type.Record(NonWhitespaceStringSchema, PluginSkillPresentationRuleSchema)),\n\t},\n\t{ additionalProperties: false },\n);\n\n/** 角色 slug。跨插件引用的唯一词汇表,格式与智能体 id 一致。 */\nexport const PluginAgentRoleSchema = Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" });\n\n/**\n * 宿主认识的角色词表。\n *\n * **不是白名单**:写表外的角色照样能被解析,只是团队编辑器里没有现成的槽位选择器。列在这里\n * 的角色由预置插件供货,因此任何一台装机上都解析得到,第三方插件可以放心引用。\n */\nexport const BUILTIN_PLUGIN_AGENT_ROLES = [\n\t\"master\",\n\t\"developer\",\n\t\"researcher\",\n\t\"auditor\",\n\t\"business\",\n\t\"designer\",\n] as const;\n\nexport type BuiltinPluginAgentRole = (typeof BUILTIN_PLUGIN_AGENT_ROLES)[number];\n\n/** 插件贡献的智能体(blueprint)。人设、头像、职责都由插件提供,宿主只负责铺档案。 */\nexport const PluginAgentProfileManifestSchema = Type.Object(\n\t{\n\t\t/** 插件内唯一;全局 id 由宿主拼成 `plugin:<pluginId>:<id>`。 */\n\t\tid: Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" }),\n\t\t/** 支持 `%key%` 占位,按插件 locales 解析。 */\n\t\tname: NonWhitespaceStringSchema,\n\t\tdescription: Type.Optional(Type.String({ maxLength: 2_000 })),\n\t\t/** @ 提及用的短名;缺省用 `id`。 */\n\t\tmentionHandle: Type.Optional(Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" })),\n\t\t/** 插件包内的相对路径,指向头像图片。 */\n\t\tavatar: Type.Optional(NonWhitespaceStringSchema),\n\t\t/** 插件包内的相对路径,指向系统提示词 Markdown。与 `systemPrompt` 二选一。 */\n\t\tsystemPromptPath: Type.Optional(NonWhitespaceStringSchema),\n\t\tsystemPrompt: Type.Optional(Type.String({ maxLength: 64_000 })),\n\t\t/**\n\t\t * `all`(默认)继承宿主全部已启用能力;`own` 只用本插件的能力。\n\t\t * 两种模式下本插件的能力都强制激活,用户关不掉。\n\t\t */\n\t\tabilities: Type.Optional(Type.Union([Type.Literal(\"all\"), Type.Literal(\"own\")])),\n\t\t/**\n\t\t * 本智能体接管的历史 blueprint id。\n\t\t *\n\t\t * 用于「人设从别处迁进插件」:宿主解析不到这些 id 时折算到本智能体,回填时也据此\n\t\t * 认领用户已有的同角色档案,而不是再铺一份新的。宿主因此不必知道是哪个插件接管了\n\t\t * 哪个老角色。\n\t\t */\n\t\tlegacyIds: Type.Optional(Type.Array(NonWhitespaceStringSchema, { maxItems: 16 })),\n\t\t/**\n\t\t * 本智能体能顶的角色 slug(≤ 8 个)。\n\t\t *\n\t\t * 声明了角色,别的插件就能用 `teams[].members[].role` 槽位引用到它,而不必知道它属于\n\t\t * 哪个插件。这是提供方唯一要做的事——被谁引用、引用几次,提供方都不需要知道。\n\t\t */\n\t\troles: Type.Optional(Type.Array(PluginAgentRoleSchema, { maxItems: 8 })),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * 插件贡献的团队成员。`agent` 与 `role` 二选一,必须恰好写一个。\n *\n * - `agent`:**实体引用**。`<agentId>` 指本插件的智能体,`<pluginId>/<agentId>` 指别的插件的。\n * - `role`:**角色槽位**。只声明「这里需要一个什么角色」,由宿主在全部已启用插件里解析。\n *\n * 推荐用角色槽位:消费方只耦合到一个角色名,提供方换人、换插件、被第三方取代都不影响它,\n * 用户还能把槽位改绑到自己调教过的智能体。实体引用留给「就是要那个人」的场合。\n *\n * 跨插件引用不再被拒,但它带来的「提供方可能不在」由 `optional` 兜底,而不是让整支团队消失。\n */\nexport const PluginAgentTeamMemberManifestSchema = Type.Object(\n\t{\n\t\tagent: Type.Optional(NonWhitespaceStringSchema),\n\t\trole: Type.Optional(PluginAgentRoleSchema),\n\t\tresponsibility: Type.String({ maxLength: 2_000 }),\n\t\t/**\n\t\t * 解析不到这名成员时,是否照常发布这支团队。\n\t\t *\n\t\t * 缺省值按引用方式走:本插件的实体引用为 `false`(自己的东西缺了就是配置错误),跨插件\n\t\t * 实体引用与角色槽位为 `true`(提供方本来就可能不在场)。\n\t\t */\n\t\toptional: Type.Optional(Type.Boolean()),\n\t\t/**\n\t\t * 这名成员在本团队里的任务书:追加在它本体人格之后的交待。\n\t\t *\n\t\t * 与 `responsibility` 分工不同:后者是一句全队可见的职责摘要(进共享名册),这里是只给\n\t\t * 这名成员看的做事方式。**跨插件引用时尤其有用**——任务书挂在你的团队上,不碰对方的\n\t\t * 人设,所以你可以把别的插件的设计师拉进来并交待清楚本团队怎么干,而它在别处照旧。\n\t\t *\n\t\t * 与 `instructionsPath` 二选一。队长的任务书写在团队的 `workflow` 里,不要在这里重复。\n\t\t */\n\t\tinstructions: Type.Optional(Type.String({ maxLength: 64_000 })),\n\t\t/** 插件包内的相对路径,指向任务书 Markdown。与 `instructions` 二选一。 */\n\t\tinstructionsPath: Type.Optional(NonWhitespaceStringSchema),\n\t},\n\t{ additionalProperties: false },\n);\n\n/** 插件贡献的团队。第一个成员即队长,也是用户在会话里唯一的对话入口。 */\nexport const PluginAgentTeamManifestSchema = Type.Object(\n\t{\n\t\tid: Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" }),\n\t\tname: NonWhitespaceStringSchema,\n\t\tdescription: Type.Optional(Type.String({ maxLength: 2_000 })),\n\t\tmembers: Type.Array(PluginAgentTeamMemberManifestSchema, { minItems: 1, maxItems: 32 }),\n\t\t/** 队长的团队任务书:把这支团队的固定流水线写死。与 `workflowPath` 二选一。 */\n\t\tworkflow: Type.Optional(Type.String({ maxLength: 64_000 })),\n\t\tworkflowPath: Type.Optional(NonWhitespaceStringSchema),\n\t\t/** 本团队接管的历史团队 id,语义同 `agents[].legacyIds`。 */\n\t\tlegacyIds: Type.Optional(Type.Array(NonWhitespaceStringSchema, { maxItems: 16 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginAgentManifestSchema = Type.Object(\n\t{\n\t\tsystemPrompt: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\tpromptPaths: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: true },\n\t\t\t),\n\t\t),\n\t\tskillPaths: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\tskillPresentation: Type.Optional(PluginSkillPresentationSchema),\n\t\tagents: Type.Optional(Type.Array(PluginAgentProfileManifestSchema, { maxItems: 32 })),\n\t\tteams: Type.Optional(Type.Array(PluginAgentTeamManifestSchema, { maxItems: 32 })),\n\t\tmcpServers: Type.Optional(Type.Union([NonWhitespaceStringSchema, PluginMcpServerMapSchema])),\n\t\ttoolPolicy: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\tallow: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\t\t\t\tdeny: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: true },\n\t\t\t),\n\t\t),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginModuleFederationManifestSchema = Type.Object(\n\t{\n\t\tremoteName: Type.String({ pattern: \"^[A-Za-z_$][A-Za-z0-9_$-]{0,63}$\" }),\n\t\texpose: Type.String({ pattern: \"^\\\\./(?!.*\\\\.\\\\.)(?!.*\\\\\\\\).+$\" }),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginManifestSchema = Type.Object(\n\t{\n\t\tid: PluginIdSchema,\n\t\tname: NonWhitespaceStringSchema,\n\t\tversion: PluginVersionSchema,\n\t\tpluginApiVersion: NonWhitespaceStringSchema,\n\t\tentry: NonWhitespaceStringSchema,\n\t\tmoduleFederation: PluginModuleFederationManifestSchema,\n\t\tagent: Type.Optional(PluginAgentManifestSchema),\n\t\tproviders: Type.Optional(PluginProvidersManifestSchema),\n\t\tstyles: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\tpermissions: Type.Optional(Type.Array(PluginPermissionSchema)),\n\t\tnetwork: Type.Optional(PluginNetworkManifestSchema),\n\t\tbrowser: Type.Optional(PluginBrowserManifestSchema),\n\t\tcommands: Type.Optional(PluginCommandNamesSchema),\n\t\tdescription: Type.Optional(Type.String()),\n\t\tauthor: Type.Optional(Type.String()),\n\t\ticon: Type.Optional(NonWhitespaceStringSchema),\n\t\tguidingWords: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\tdefaultLocale: Type.Optional(\n\t\t\tType.String({ minLength: 2, maxLength: 16, pattern: \"^[a-zA-Z][a-zA-Z0-9-]{1,15}$\" }),\n\t\t),\n\t\tcontributionMode: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\thardIsolation: Type.Optional(Type.Boolean()),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: true },\n\t\t\t),\n\t\t),\n\t\tagent_mode: OptionalAgentModesSchema,\n\t},\n\t{\n\t\t$id: \"PluginManifest\",\n\t\tadditionalProperties: true,\n\t\tdescription: \"Vetta desktop plugin manifest (plugin.json).\",\n\t},\n);\n\nexport type PluginMcpServerConfig = Static<typeof PluginMcpServerConfigSchema>;\nexport type PluginAgentManifest = Static<typeof PluginAgentManifestSchema>;\nexport type PluginAgentProfileManifest = Static<typeof PluginAgentProfileManifestSchema>;\nexport type PluginAgentTeamManifest = Static<typeof PluginAgentTeamManifestSchema>;\nexport type PluginAgentTeamMemberManifest = Static<typeof PluginAgentTeamMemberManifestSchema>;\nexport type PluginSkillPresentation = Static<typeof PluginSkillPresentationSchema>;\nexport type PluginSkillPresentationRule = Static<typeof PluginSkillPresentationRuleSchema>;\nexport type PluginCliProviderManifest = Static<typeof PluginCliProviderManifestSchema>;\nexport type PluginServiceArtifact = Static<typeof PluginServiceArtifactSchema>;\nexport type PluginServicePlatform = Static<typeof PluginServicePlatformSchema>;\nexport type PluginServiceProviderManifest = Static<typeof PluginServiceProviderManifestSchema>;\nexport type PluginServiceRuntimeKind = \"managed-binary\" | \"host-node\";\nexport type PluginProvidersManifest = Static<typeof PluginProvidersManifestSchema>;\nexport type PluginNetworkManifest = Static<typeof PluginNetworkManifestSchema>;\nexport type PluginBrowserManifest = Static<typeof PluginBrowserManifestSchema>;\nexport type PluginManifestInput = Static<typeof PluginManifestSchema>;\nexport type PluginManifest = PluginManifestInput;\n"]}
1
+ {"version":3,"file":"manifest-schema.d.ts","sourceRoot":"","sources":["../src/manifest-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMtD,eAAO,MAAM,cAAc,qCAKzB,CAAC;AAEH,eAAO,MAAM,mBAAmB,qCAK9B,CAAC;AAEH,eAAO,MAAM,uBAAuB,qCAKlC,CAAC;AAEH,eAAO,MAAM,wB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/E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC","sourcesContent":["import { Type, type Static } from \"@sinclair/typebox\";\nimport { SkillSurfaceVisibilitySchema, SkillVisibilitySchema } from \"@vetta-org/capability-sdk\";\nimport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\n\nconst NON_WHITESPACE_PATTERN = \"\\\\S\";\n\nexport const PluginIdSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 64,\n\tpattern: \"^[a-z0-9][a-z0-9._-]{0,63}$\",\n\tdescription: \"Stable lowercase plugin identifier.\",\n});\n\nexport const PluginVersionSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 64,\n\tpattern: \"^[a-zA-Z0-9][a-zA-Z0-9._+-]{0,63}$\",\n\tdescription: \"Plugin version without path separators.\",\n});\n\nexport const PluginCommandNameSchema = Type.String({\n\tminLength: 1,\n\tmaxLength: 64,\n\tpattern: \"^[a-zA-Z0-9][a-zA-Z0-9._+-]{0,63}$\",\n\tdescription: \"Bare executable name declared by the plugin.\",\n});\n\nexport const PluginCommandNamesSchema = Type.Array(PluginCommandNameSchema);\n\nconst PluginCliCommandSchema = Type.Object(\n\t{\n\t\tcommand: PluginCommandNameSchema,\n\t\targs: Type.Optional(Type.Array(Type.String(), { maxItems: 64 })),\n\t\ttimeoutMs: Type.Optional(Type.Number({ minimum: 1_000, maximum: 30 * 60_000 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginCliProviderManifestSchema = Type.Object(\n\t{\n\t\tid: PluginIdSchema,\n\t\tcommand: PluginCommandNameSchema,\n\t\tprobe: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\targs: Type.Optional(Type.Array(Type.String(), { maxItems: 64 })),\n\t\t\t\t\ttimeoutMs: Type.Optional(Type.Number({ minimum: 1_000, maximum: 120_000 })),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: false },\n\t\t\t),\n\t\t),\n\t\tinstall: PluginCliCommandSchema,\n\t},\n\t{ additionalProperties: false },\n);\n\nconst PluginServiceArchiveSchema = Type.Union([\n\tType.Literal(\"file\"),\n\tType.Literal(\"zip\"),\n\tType.Literal(\"tar.gz\"),\n]);\n\nexport const PluginServiceArtifactSchema = Type.Object(\n\t{\n\t\tsha256: Type.String({ pattern: \"^[a-f0-9]{64}$\" }),\n\t\tarchive: PluginServiceArchiveSchema,\n\t\t/** Relative file (archive=file) or directory (archive=zip/tar.gz) below the managed runtime root. */\n\t\tdestination: Type.String({ minLength: 1, maxLength: 512 }),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginServicePlatformSchema = Type.Object(\n\t{\n\t\texecutable: Type.String({ minLength: 1, maxLength: 512 }),\n\t\tartifacts: Type.Array(PluginServiceArtifactSchema, { minItems: 1, maxItems: 8 }),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginServiceProviderManifestSchema = Type.Object(\n\t{\n\t\tid: PluginIdSchema,\n\t\truntime: Type.Object(\n\t\t\t{\n\t\t\t\t/** `managed-binary` is the backwards-compatible default. */\n\t\t\t\tkind: Type.Optional(Type.Union([Type.Literal(\"managed-binary\"), Type.Literal(\"host-node\")])),\n\t\t\t\tversion: PluginVersionSchema,\n\t\t\t\t/** Entry script relative to the installed runtime (required for host-node). */\n\t\t\t\tentry: Type.Optional(Type.String({ minLength: 1, maxLength: 512 })),\n\t\t\t\tplatforms: Type.Record(\n\t\t\t\t\tType.String({ pattern: \"^(win32|darwin|linux)-(x64|arm64)$\" }),\n\t\t\t\t\tPluginServicePlatformSchema,\n\t\t\t\t),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\tcredentials: Type.Optional(\n\t\t\tType.Array(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tid: PluginIdSchema,\n\t\t\t\t\t\tbytes: Type.Optional(Type.Integer({ minimum: 16, maximum: 64 })),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t\t{ minItems: 1, maxItems: 8 },\n\t\t\t),\n\t\t),\n\t\ttemplates: Type.Optional(\n\t\t\tType.Array(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tsource: Type.String({ minLength: 1, maxLength: 512 }),\n\t\t\t\t\t\tdestination: Type.String({ minLength: 1, maxLength: 512 }),\n\t\t\t\t\t\t/** create preserves a data file; render regenerates a cache file on every start. */\n\t\t\t\t\t\tmode: Type.Union([Type.Literal(\"create\"), Type.Literal(\"render\")]),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t\t{ minItems: 1, maxItems: 16 },\n\t\t\t),\n\t\t),\n\t\tprocess: Type.Object(\n\t\t\t{\n\t\t\t\targs: Type.Optional(Type.Array(Type.String(), { maxItems: 64 })),\n\t\t\t\tenv: Type.Optional(Type.Record(Type.String({ minLength: 1 }), Type.String())),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\thealth: Type.Object(\n\t\t\t{\n\t\t\t\tpath: Type.String({ minLength: 1, maxLength: 1_024, pattern: \"^/[^/]*\" }),\n\t\t\t\tcredentialId: Type.Optional(PluginIdSchema),\n\t\t\t\ttimeoutMs: Type.Optional(Type.Integer({ minimum: 1_000, maximum: 120_000 })),\n\t\t\t\treadiness: Type.Optional(\n\t\t\t\t\tType.Object({ mode: Type.Literal(\"plugin\") }, { additionalProperties: false }),\n\t\t\t\t),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginProvidersManifestSchema = Type.Object(\n\t{\n\t\tcli: Type.Optional(Type.Array(PluginCliProviderManifestSchema, { minItems: 1, maxItems: 16 })),\n\t\tservices: Type.Optional(Type.Array(PluginServiceProviderManifestSchema, { minItems: 1, maxItems: 8 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginNetworkManifestSchema = Type.Object(\n\t{\n\t\tallowedHosts: Type.Array(Type.String({ minLength: 1, maxLength: 253, pattern: NON_WHITESPACE_PATTERN }), {\n\t\t\tminItems: 1,\n\t\t\tmaxItems: 128,\n\t\t}),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginBrowserManifestSchema = Type.Object(\n\t{\n\t\tallowedHosts: Type.Array(Type.String({ minLength: 1, maxLength: 253, pattern: NON_WHITESPACE_PATTERN }), {\n\t\t\tminItems: 1,\n\t\t\tmaxItems: 128,\n\t\t}),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginPermissionSchema = Type.Union(\n\tPLUGIN_PERMISSIONS.map((permission) => Type.Literal(permission)),\n\t{ description: \"Host capability requested by the plugin.\" },\n);\n\nconst NonWhitespaceStringSchema = Type.String({ pattern: NON_WHITESPACE_PATTERN });\nconst OptionalAgentModesSchema = Type.Optional(\n\tType.Union([NonWhitespaceStringSchema, Type.Array(NonWhitespaceStringSchema)]),\n);\nconst StringRecordSchema = Type.Record(Type.String(), Type.String());\n\nconst PluginMcpCommonProperties = {\n\tdisabled: Type.Optional(Type.Boolean()),\n\tautoApprove: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\tstartupTimeout: Type.Optional(Type.Number()),\n\tdebug: Type.Optional(Type.Boolean()),\n\tdisplayName: Type.Optional(Type.String()),\n\tdescription: Type.Optional(Type.String()),\n\tagent_mode: OptionalAgentModesSchema,\n};\n\nexport const PluginMcpStdioServerConfigSchema = Type.Object(\n\t{\n\t\t...PluginMcpCommonProperties,\n\t\ttype: Type.Optional(Type.Literal(\"stdio\")),\n\t\tcommand: NonWhitespaceStringSchema,\n\t\targs: Type.Optional(Type.Array(Type.String())),\n\t\tenv: Type.Optional(StringRecordSchema),\n\t\tcwd: Type.Optional(Type.String()),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginMcpHttpServerConfigSchema = Type.Object(\n\t{\n\t\t...PluginMcpCommonProperties,\n\t\ttype: Type.Literal(\"http\"),\n\t\turl: NonWhitespaceStringSchema,\n\t\theaders: Type.Optional(StringRecordSchema),\n\t\toauthClientId: Type.Optional(Type.String()),\n\t\toauthDeviceFlow: Type.Optional(Type.Boolean()),\n\t\toauthScopes: Type.Optional(Type.String()),\n\t},\n\t{ additionalProperties: true },\n);\n\n/** HTTP MCP served by one of this plugin's managed local services. */\nexport const PluginMcpServiceServerConfigSchema = Type.Object(\n\t{\n\t\t...PluginMcpCommonProperties,\n\t\ttype: Type.Literal(\"service\"),\n\t\tserviceId: PluginIdSchema,\n\t\tpath: Type.String({ pattern: \"^/[^/]*\" }),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginMcpServerConfigSchema = Type.Union([\n\tPluginMcpStdioServerConfigSchema,\n\tPluginMcpHttpServerConfigSchema,\n\tPluginMcpServiceServerConfigSchema,\n]);\n\nconst PluginMcpServerMapSchema = Type.Record(\n\tType.String({ pattern: NON_WHITESPACE_PATTERN }),\n\tPluginMcpServerConfigSchema,\n\t{ additionalProperties: false },\n);\n\nexport const PluginSkillPresentationRuleSchema = Type.Object(\n\t{\n\t\tdefaultVisibility: Type.Optional(SkillVisibilitySchema),\n\t\tsurfaces: Type.Optional(SkillSurfaceVisibilitySchema),\n\t\tdisplayName: Type.Optional(NonWhitespaceStringSchema),\n\t\tdisplayDescription: Type.Optional(NonWhitespaceStringSchema),\n\t},\n\t{ additionalProperties: false },\n);\nexport const PluginSkillPresentationSchema = Type.Object(\n\t{\n\t\tdefaultVisibility: Type.Optional(SkillVisibilitySchema),\n\t\tsurfaces: Type.Optional(SkillSurfaceVisibilitySchema),\n\t\tskills: Type.Optional(Type.Record(NonWhitespaceStringSchema, PluginSkillPresentationRuleSchema)),\n\t},\n\t{ additionalProperties: false },\n);\n\n/** 角色 slug。跨插件引用的唯一词汇表,格式与智能体 id 一致。 */\nexport const PluginAgentRoleSchema = Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" });\n\n/**\n * 宿主认识的角色词表。\n *\n * **不是白名单**:写表外的角色照样能被解析,只是团队编辑器里没有现成的槽位选择器。列在这里\n * 的角色由预置插件供货,因此任何一台装机上都解析得到,第三方插件可以放心引用。\n */\nexport const BUILTIN_PLUGIN_AGENT_ROLES = [\n\t\"master\",\n\t\"developer\",\n\t\"researcher\",\n\t\"auditor\",\n\t\"business\",\n\t\"designer\",\n] as const;\n\nexport type BuiltinPluginAgentRole = (typeof BUILTIN_PLUGIN_AGENT_ROLES)[number];\n\n/** 插件贡献的智能体(blueprint)。人设、头像、职责都由插件提供,宿主只负责铺档案。 */\nexport const PluginAgentProfileManifestSchema = Type.Object(\n\t{\n\t\t/** 插件内唯一;全局 id 由宿主拼成 `plugin:<pluginId>:<id>`。 */\n\t\tid: Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" }),\n\t\t/** 支持 `%key%` 占位,按插件 locales 解析。 */\n\t\tname: NonWhitespaceStringSchema,\n\t\tdescription: Type.Optional(Type.String({ maxLength: 2_000 })),\n\t\t/** @ 提及用的短名;缺省用 `id`。 */\n\t\tmentionHandle: Type.Optional(Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" })),\n\t\t/** 插件包内的相对路径,指向头像图片。 */\n\t\tavatar: Type.Optional(NonWhitespaceStringSchema),\n\t\t/** 插件包内的相对路径,指向系统提示词 Markdown。与 `systemPrompt` 二选一。 */\n\t\tsystemPromptPath: Type.Optional(NonWhitespaceStringSchema),\n\t\tsystemPrompt: Type.Optional(Type.String({ maxLength: 64_000 })),\n\t\t/**\n\t\t * `all`(默认)继承宿主全部已启用能力;`own` 只用本插件的能力。\n\t\t * 两种模式下本插件的能力都强制激活,用户关不掉。\n\t\t */\n\t\tabilities: Type.Optional(Type.Union([Type.Literal(\"all\"), Type.Literal(\"own\")])),\n\t\t/**\n\t\t * 本智能体接管的历史 blueprint id。\n\t\t *\n\t\t * 用于「人设从别处迁进插件」:宿主解析不到这些 id 时折算到本智能体,回填时也据此\n\t\t * 认领用户已有的同角色档案,而不是再铺一份新的。宿主因此不必知道是哪个插件接管了\n\t\t * 哪个老角色。\n\t\t */\n\t\tlegacyIds: Type.Optional(Type.Array(NonWhitespaceStringSchema, { maxItems: 16 })),\n\t\t/**\n\t\t * 本智能体能顶的角色 slug(≤ 8 个)。\n\t\t *\n\t\t * 声明了角色,别的插件就能用 `teams[].members[].role` 槽位引用到它,而不必知道它属于\n\t\t * 哪个插件。这是提供方唯一要做的事——被谁引用、引用几次,提供方都不需要知道。\n\t\t */\n\t\troles: Type.Optional(Type.Array(PluginAgentRoleSchema, { maxItems: 8 })),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * 插件贡献的团队成员。`agent` 与 `role` 二选一,必须恰好写一个。\n *\n * - `agent`:**实体引用**。`<agentId>` 指本插件的智能体,`<pluginId>/<agentId>` 指别的插件的。\n * - `role`:**角色槽位**。只声明「这里需要一个什么角色」,由宿主在全部已启用插件里解析。\n *\n * 推荐用角色槽位:消费方只耦合到一个角色名,提供方换人、换插件、被第三方取代都不影响它,\n * 用户还能把槽位改绑到自己调教过的智能体。实体引用留给「就是要那个人」的场合。\n *\n * 跨插件引用不再被拒,但它带来的「提供方可能不在」由 `optional` 兜底,而不是让整支团队消失。\n */\nexport const PluginAgentTeamMemberManifestSchema = Type.Object(\n\t{\n\t\tagent: Type.Optional(NonWhitespaceStringSchema),\n\t\trole: Type.Optional(PluginAgentRoleSchema),\n\t\tresponsibility: Type.String({ maxLength: 2_000 }),\n\t\t/**\n\t\t * 解析不到这名成员时,是否照常发布这支团队。\n\t\t *\n\t\t * 缺省值按引用方式走:本插件的实体引用为 `false`(自己的东西缺了就是配置错误),跨插件\n\t\t * 实体引用与角色槽位为 `true`(提供方本来就可能不在场)。\n\t\t */\n\t\toptional: Type.Optional(Type.Boolean()),\n\t\t/**\n\t\t * 这名成员在本团队里的任务书:追加在它本体人格之后的交待。\n\t\t *\n\t\t * 与 `responsibility` 分工不同:后者是一句全队可见的职责摘要(进共享名册),这里是只给\n\t\t * 这名成员看的做事方式。**跨插件引用时尤其有用**——任务书挂在你的团队上,不碰对方的\n\t\t * 人设,所以你可以把别的插件的设计师拉进来并交待清楚本团队怎么干,而它在别处照旧。\n\t\t *\n\t\t * 与 `instructionsPath` 二选一。队长的任务书写在团队的 `workflow` 里,不要在这里重复。\n\t\t */\n\t\tinstructions: Type.Optional(Type.String({ maxLength: 64_000 })),\n\t\t/** 插件包内的相对路径,指向任务书 Markdown。与 `instructions` 二选一。 */\n\t\tinstructionsPath: Type.Optional(NonWhitespaceStringSchema),\n\t},\n\t{ additionalProperties: false },\n);\n\n/** 插件贡献的团队。第一个成员即队长,也是用户在会话里唯一的对话入口。 */\nexport const PluginAgentTeamManifestSchema = Type.Object(\n\t{\n\t\tid: Type.String({ pattern: \"^[a-z0-9][a-z0-9-]{0,63}$\" }),\n\t\tname: NonWhitespaceStringSchema,\n\t\tdescription: Type.Optional(Type.String({ maxLength: 2_000 })),\n\t\tmembers: Type.Array(PluginAgentTeamMemberManifestSchema, { minItems: 1, maxItems: 32 }),\n\t\t/** 队长的团队任务书:把这支团队的固定流水线写死。与 `workflowPath` 二选一。 */\n\t\tworkflow: Type.Optional(Type.String({ maxLength: 64_000 })),\n\t\tworkflowPath: Type.Optional(NonWhitespaceStringSchema),\n\t\t/** 本团队接管的历史团队 id,语义同 `agents[].legacyIds`。 */\n\t\tlegacyIds: Type.Optional(Type.Array(NonWhitespaceStringSchema, { maxItems: 16 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const PluginAgentManifestSchema = Type.Object(\n\t{\n\t\tsystemPrompt: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\tpromptPaths: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: true },\n\t\t\t),\n\t\t),\n\t\tskillPaths: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\tskillPresentation: Type.Optional(PluginSkillPresentationSchema),\n\t\tagents: Type.Optional(Type.Array(PluginAgentProfileManifestSchema, { maxItems: 32 })),\n\t\tteams: Type.Optional(Type.Array(PluginAgentTeamManifestSchema, { maxItems: 32 })),\n\t\tmcpServers: Type.Optional(Type.Union([NonWhitespaceStringSchema, PluginMcpServerMapSchema])),\n\t\ttoolPolicy: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\tallow: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\t\t\t\tdeny: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: true },\n\t\t\t),\n\t\t),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginModuleFederationManifestSchema = Type.Object(\n\t{\n\t\tremoteName: Type.String({ pattern: \"^[A-Za-z_$][A-Za-z0-9_$-]{0,63}$\" }),\n\t\texpose: Type.String({ pattern: \"^\\\\./(?!.*\\\\.\\\\.)(?!.*\\\\\\\\).+$\" }),\n\t},\n\t{ additionalProperties: true },\n);\n\nexport const PluginManifestSchema = Type.Object(\n\t{\n\t\tid: PluginIdSchema,\n\t\tname: NonWhitespaceStringSchema,\n\t\tversion: PluginVersionSchema,\n\t\tpluginApiVersion: NonWhitespaceStringSchema,\n\t\tentry: NonWhitespaceStringSchema,\n\t\tmoduleFederation: PluginModuleFederationManifestSchema,\n\t\tagent: Type.Optional(PluginAgentManifestSchema),\n\t\tproviders: Type.Optional(PluginProvidersManifestSchema),\n\t\tstyles: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\tpermissions: Type.Optional(Type.Array(PluginPermissionSchema)),\n\t\tnetwork: Type.Optional(PluginNetworkManifestSchema),\n\t\tbrowser: Type.Optional(PluginBrowserManifestSchema),\n\t\tcommands: Type.Optional(PluginCommandNamesSchema),\n\t\tdescription: Type.Optional(Type.String()),\n\t\tauthor: Type.Optional(Type.String()),\n\t\ticon: Type.Optional(NonWhitespaceStringSchema),\n\t\tguidingWords: Type.Optional(Type.Array(NonWhitespaceStringSchema)),\n\t\tdefaultLocale: Type.Optional(\n\t\t\tType.String({ minLength: 2, maxLength: 16, pattern: \"^[a-zA-Z][a-zA-Z0-9-]{1,15}$\" }),\n\t\t),\n\t\tcontributionMode: Type.Optional(\n\t\t\tType.Object(\n\t\t\t\t{\n\t\t\t\t\thardIsolation: Type.Optional(Type.Boolean()),\n\t\t\t\t},\n\t\t\t\t{ additionalProperties: true },\n\t\t\t),\n\t\t),\n\t\tagent_mode: OptionalAgentModesSchema,\n\t},\n\t{\n\t\t$id: \"PluginManifest\",\n\t\tadditionalProperties: true,\n\t\tdescription: \"Vetta desktop plugin manifest (plugin.json).\",\n\t},\n);\n\nexport type PluginMcpServerConfig = Static<typeof PluginMcpServerConfigSchema>;\nexport type PluginAgentManifest = Static<typeof PluginAgentManifestSchema>;\nexport type PluginAgentProfileManifest = Static<typeof PluginAgentProfileManifestSchema>;\nexport type PluginAgentTeamManifest = Static<typeof PluginAgentTeamManifestSchema>;\nexport type PluginAgentTeamMemberManifest = Static<typeof PluginAgentTeamMemberManifestSchema>;\nexport type PluginSkillPresentation = Static<typeof PluginSkillPresentationSchema>;\nexport type PluginSkillPresentationRule = Static<typeof PluginSkillPresentationRuleSchema>;\nexport type PluginCliProviderManifest = Static<typeof PluginCliProviderManifestSchema>;\nexport type PluginServiceArtifact = Static<typeof PluginServiceArtifactSchema>;\nexport type PluginServicePlatform = Static<typeof PluginServicePlatformSchema>;\nexport type PluginServiceProviderManifest = Static<typeof PluginServiceProviderManifestSchema>;\nexport type PluginServiceRuntimeKind = \"managed-binary\" | \"host-node\";\nexport type PluginProvidersManifest = Static<typeof PluginProvidersManifestSchema>;\nexport type PluginNetworkManifest = Static<typeof PluginNetworkManifestSchema>;\nexport type PluginBrowserManifest = Static<typeof PluginBrowserManifestSchema>;\nexport type PluginManifestInput = Static<typeof PluginManifestSchema>;\nexport type PluginManifest = PluginManifestInput;\n"]}
package/dist/media.d.ts CHANGED
@@ -87,6 +87,17 @@ export interface PluginMediaGenerationModeCapability {
87
87
  aspectRatioPolicy?: "configurable" | "input-derived";
88
88
  audioGeneration?: "none" | "always" | "optional";
89
89
  }
90
+ export interface PluginMediaGenerationModelDescriptor {
91
+ id: string;
92
+ displayName?: string;
93
+ sourceId?: string;
94
+ sourceDisplayName?: string;
95
+ modes: readonly PluginMediaGenerationMode[];
96
+ aspectRatios?: readonly string[];
97
+ /** Provider-defined stable option ids; consumers must not infer pixel dimensions from their names. */
98
+ resolutions?: readonly string[];
99
+ defaultResolution?: string;
100
+ }
90
101
  export type PluginMediaCapability = {
91
102
  operation: "generate";
92
103
  kind: "image" | "video";
@@ -96,6 +107,10 @@ export type PluginMediaCapability = {
96
107
  resolutions?: readonly string[];
97
108
  /** Preferred option when the consumer has no supported persisted resolution. */
98
109
  defaultResolution?: string;
110
+ /** Optional per-model catalog. Missing means this is a legacy provider with provider-level capabilities only. */
111
+ models?: readonly PluginMediaGenerationModelDescriptor[];
112
+ /** Model used when a consumer does not send modelId. */
113
+ defaultModelId?: string;
99
114
  durationsSeconds?: readonly number[];
100
115
  modeCapabilities?: readonly PluginMediaGenerationModeCapability[];
101
116
  } | {
@@ -146,6 +161,11 @@ export interface PluginMediaTransferResponse<T = unknown> {
146
161
  }
147
162
  export interface PluginMediaProviderHandlerContext {
148
163
  readonly invocationId: string;
164
+ /** Reads an input that belongs to this invocation without exposing its backing path. */
165
+ readInput(inputId: string): Promise<{
166
+ mimeType: string;
167
+ data: Uint8Array;
168
+ }>;
149
169
  uploadInput<T = unknown>(inputId: string, request: PluginMediaInputUploadRequest): Promise<PluginMediaTransferResponse<T>>;
150
170
  }
151
171
  export type PluginMediaProviderArtifactSource = {
@@ -1 +1 @@
1
- {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,C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ACnD,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC3B;AAED,MAAM,WAAW,+BAA+B;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC/C,MAAM,CACL,OAAO,EAAE,gCAAgC,EACzC,OAAO,EAAE,iCAAiC,GACxC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACnC,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACpG,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACvG;AAED,MAAM,WAAW,cAAc;IAC9B,gBAAgB,CAAC,YAAY,EAAE,+BAA+B,GAAG,UAAU,CAAC;IAC5E,aAAa,IAAI,OAAO,CAAC,SAAS,6BAA6B,EAAE,CAAC,CAAC;IACnE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;IACrD,MAAM,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACnE","sourcesContent":["import type { PluginArtifactRef } from \"./artifacts.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginJob, PluginJobFailure } from \"./jobs.js\";\n\nexport type PluginMediaKind = \"image\" | \"video\" | \"audio\" | \"document\";\nexport type PluginMediaOutputKind = \"image\" | \"video\" | \"audio\";\nexport type PluginMediaOperation = \"generate\" | \"compose\" | \"transcode\";\n\nexport type PluginMediaGenerationMode =\n\t| \"text-to-image\"\n\t| \"image-to-image\"\n\t| \"text-to-video\"\n\t| \"image-to-video\"\n\t| \"video-to-video\"\n\t| \"reference-to-video\";\n\nexport type PluginMediaErrorCode =\n\t| \"unauthenticated\"\n\t| \"provider-unavailable\"\n\t| \"operation-unsupported\"\n\t| \"invalid-request\"\n\t| \"not-entitled\"\n\t| \"quota-exhausted\"\n\t| \"content-rejected\"\n\t| \"provider-timeout\"\n\t| \"provider-failed\"\n\t| \"cancelled\";\n\nexport interface PluginMediaFailure extends PluginJobFailure {\n\tcode: PluginMediaErrorCode;\n}\n\nexport class PluginMediaError extends Error {\n\treadonly code: PluginMediaErrorCode;\n\treadonly retryable: boolean;\n\n\tconstructor(failure: PluginMediaFailure) {\n\t\tsuper(failure.message);\n\t\tthis.name = \"PluginMediaError\";\n\t\tthis.code = failure.code;\n\t\tthis.retryable = failure.retryable;\n\t}\n}\n\nexport interface PluginMediaDimensions {\n\twidth: number;\n\theight: number;\n}\n\nexport type PluginMediaInputSource =\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaInput {\n\tid?: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n\tsource: PluginMediaInputSource;\n}\n\nexport interface PluginMediaOutput {\n\tkind: PluginMediaOutputKind;\n\tmimeType: string;\n\tdimensions?: PluginMediaDimensions;\n\tfps?: number;\n\tdurationSeconds?: number;\n\tvideoCodec?: string;\n\taudioCodec?: string;\n}\n\nexport interface PluginMediaArtifact extends PluginArtifactRef {\n\tkind: PluginMediaOutputKind;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n}\n\nexport interface PluginMediaGenerateRequest {\n\toperation: \"generate\";\n\tproviderId: string;\n\tkind: \"image\" | \"video\";\n\tmode: PluginMediaGenerationMode;\n\tprompt: string;\n\tmodelId?: string;\n\tdimensions?: PluginMediaDimensions;\n\taspectRatio?: string;\n\tresolution?: string;\n\tdurationSeconds?: number;\n\tinputs?: readonly PluginMediaInput[];\n}\n\nexport interface PluginMediaComposeRequest {\n\toperation: \"compose\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport interface PluginMediaTranscodeRequest {\n\toperation: \"transcode\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport type PluginMediaSubmitRequest =\n\t| PluginMediaGenerateRequest\n\t| PluginMediaComposeRequest\n\t| PluginMediaTranscodeRequest;\n\nexport interface PluginMediaGenerationInputSlot {\n\trole: string;\n\tkinds: readonly PluginMediaKind[];\n\tminItems: number;\n\tmaxItems: number;\n}\n\nexport interface PluginMediaGenerationModeCapability {\n\tmode: PluginMediaGenerationMode;\n\tinputs: readonly PluginMediaGenerationInputSlot[];\n\tminTotalItems?: number;\n\tmaxTotalItems?: number;\n\taspectRatioPolicy?: \"configurable\" | \"input-derived\";\n\taudioGeneration?: \"none\" | \"always\" | \"optional\";\n}\n\nexport type PluginMediaCapability =\n\t| {\n\t\t\toperation: \"generate\";\n\t\t\tkind: \"image\" | \"video\";\n\t\t\tmodes: readonly PluginMediaGenerationMode[];\n\t\t\taspectRatios?: readonly string[];\n\t\t\t/** Provider-defined stable option ids; consumers must not infer pixel dimensions from their names. */\n\t\t\tresolutions?: readonly string[];\n\t\t\t/** Preferred option when the consumer has no supported persisted resolution. */\n\t\t\tdefaultResolution?: string;\n\t\t\tdurationsSeconds?: readonly number[];\n\t\t\tmodeCapabilities?: readonly PluginMediaGenerationModeCapability[];\n\t }\n\t| {\n\t\t\toperation: \"compose\";\n\t\t\tdocumentMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t }\n\t| {\n\t\t\toperation: \"transcode\";\n\t\t\tinputMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t };\n\nexport interface PluginMediaProviderDescriptor {\n\t/** Host-qualified provider id. */\n\tid: string;\n\tdisplayName?: string;\n\townerId: string;\n\tprotocolVersion: number;\n\tcapabilities: readonly PluginMediaCapability[];\n}\n\nexport type PluginMediaJob = Omit<PluginJob<PluginMediaArtifact>, \"error\"> & {\n\terror?: PluginMediaFailure;\n};\n\n/** A media input exposed to its provider without revealing its storage location. */\nexport interface PluginMediaProviderInput {\n\tid: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n}\n\ntype ProviderRequest<Request extends PluginMediaSubmitRequest> = Omit<Request, \"providerId\" | \"inputs\"> & {\n\treadonly inputs: readonly PluginMediaProviderInput[];\n};\n\nexport type PluginMediaProviderSubmitRequest =\n\tPluginMediaSubmitRequest extends infer Request\n\t\t? Request extends PluginMediaSubmitRequest\n\t\t\t? ProviderRequest<Request>\n\t\t\t: never\n\t\t: never;\n\nexport interface PluginMediaInputUploadRequest {\n\turl: string;\n\tfieldName: string;\n\tfileName?: string;\n\tfields?: Record<string, string>;\n\theaders?: Record<string, string>;\n\ttimeoutMs?: number;\n}\n\nexport interface PluginMediaTransferResponse<T = unknown> {\n\tok: boolean;\n\tstatus: number;\n\tstatusText: string;\n\theaders: Record<string, string>;\n\tbody: T;\n}\n\nexport interface PluginMediaProviderHandlerContext {\n\treadonly invocationId: string;\n\tuploadInput<T = unknown>(\n\t\tinputId: string,\n\t\trequest: PluginMediaInputUploadRequest,\n\t): Promise<PluginMediaTransferResponse<T>>;\n}\n\nexport type PluginMediaProviderArtifactSource =\n\t| { type: \"remote-url\"; url: string; headers?: Record<string, string> }\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaProviderArtifact {\n\tkind: PluginMediaOutputKind;\n\tmimeType?: string;\n\tname?: string;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n\tsource: PluginMediaProviderArtifactSource;\n}\n\nexport interface PluginMediaProviderJob {\n\tid: string;\n\tstatus: PluginMediaJob[\"status\"];\n\tprogress?: number;\n\tartifacts?: readonly PluginMediaProviderArtifact[];\n\terror?: PluginMediaFailure;\n}\n\nexport interface PluginMediaProviderRegistration {\n\tid: string;\n\tdisplayName?: string;\n\tcapabilities: readonly PluginMediaCapability[];\n\tsubmit(\n\t\trequest: PluginMediaProviderSubmitRequest,\n\t\tcontext: PluginMediaProviderHandlerContext,\n\t): Promise<PluginMediaProviderJob>;\n\tgetJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n\tcancelJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n}\n\nexport interface PluginMediaApi {\n\tregisterProvider(registration: PluginMediaProviderRegistration): Disposable;\n\tlistProviders(): Promise<readonly PluginMediaProviderDescriptor[]>;\n\tonProvidersChanged(listener: () => void): Disposable;\n\tsubmit(request: PluginMediaSubmitRequest): Promise<PluginMediaJob>;\n}\n"]}
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AACvE,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAExE,MAAM,MAAM,yBAAyB,GAClC,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,oBAAoB,CAAC;AAExB,MAAM,MAAM,oBAAoB,GAC7B,iBAAiB,GACjB,sBAAsB,GACtB,uBAAuB,GACvB,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,WAAW,CAAC;AAEf,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC3D,IAAI,EAAE,oBAAoB,CAAC;CAC3B;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IAC1C,Q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A+B;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC/C,MAAM,CACL,OAAO,EAAE,gCAAgC,EACzC,OAAO,EAAE,iCAAiC,GACxC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACnC,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACpG,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACvG;AAED,MAAM,WAAW,cAAc;IAC9B,gBAAgB,CAAC,YAAY,EAAE,+BAA+B,GAAG,UAAU,CAAC;IAC5E,aAAa,IAAI,OAAO,CAAC,SAAS,6BAA6B,EAAE,CAAC,CAAC;IACnE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,UAAU,CAAC;IACrD,MAAM,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACnE","sourcesContent":["import type { PluginArtifactRef } from \"./artifacts.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginJob, PluginJobFailure } from \"./jobs.js\";\n\nexport type PluginMediaKind = \"image\" | \"video\" | \"audio\" | \"document\";\nexport type PluginMediaOutputKind = \"image\" | \"video\" | \"audio\";\nexport type PluginMediaOperation = \"generate\" | \"compose\" | \"transcode\";\n\nexport type PluginMediaGenerationMode =\n\t| \"text-to-image\"\n\t| \"image-to-image\"\n\t| \"text-to-video\"\n\t| \"image-to-video\"\n\t| \"video-to-video\"\n\t| \"reference-to-video\";\n\nexport type PluginMediaErrorCode =\n\t| \"unauthenticated\"\n\t| \"provider-unavailable\"\n\t| \"operation-unsupported\"\n\t| \"invalid-request\"\n\t| \"not-entitled\"\n\t| \"quota-exhausted\"\n\t| \"content-rejected\"\n\t| \"provider-timeout\"\n\t| \"provider-failed\"\n\t| \"cancelled\";\n\nexport interface PluginMediaFailure extends PluginJobFailure {\n\tcode: PluginMediaErrorCode;\n}\n\nexport class PluginMediaError extends Error {\n\treadonly code: PluginMediaErrorCode;\n\treadonly retryable: boolean;\n\n\tconstructor(failure: PluginMediaFailure) {\n\t\tsuper(failure.message);\n\t\tthis.name = \"PluginMediaError\";\n\t\tthis.code = failure.code;\n\t\tthis.retryable = failure.retryable;\n\t}\n}\n\nexport interface PluginMediaDimensions {\n\twidth: number;\n\theight: number;\n}\n\nexport type PluginMediaInputSource =\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaInput {\n\tid?: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n\tsource: PluginMediaInputSource;\n}\n\nexport interface PluginMediaOutput {\n\tkind: PluginMediaOutputKind;\n\tmimeType: string;\n\tdimensions?: PluginMediaDimensions;\n\tfps?: number;\n\tdurationSeconds?: number;\n\tvideoCodec?: string;\n\taudioCodec?: string;\n}\n\nexport interface PluginMediaArtifact extends PluginArtifactRef {\n\tkind: PluginMediaOutputKind;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n}\n\nexport interface PluginMediaGenerateRequest {\n\toperation: \"generate\";\n\tproviderId: string;\n\tkind: \"image\" | \"video\";\n\tmode: PluginMediaGenerationMode;\n\tprompt: string;\n\tmodelId?: string;\n\tdimensions?: PluginMediaDimensions;\n\taspectRatio?: string;\n\tresolution?: string;\n\tdurationSeconds?: number;\n\tinputs?: readonly PluginMediaInput[];\n}\n\nexport interface PluginMediaComposeRequest {\n\toperation: \"compose\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport interface PluginMediaTranscodeRequest {\n\toperation: \"transcode\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport type PluginMediaSubmitRequest =\n\t| PluginMediaGenerateRequest\n\t| PluginMediaComposeRequest\n\t| PluginMediaTranscodeRequest;\n\nexport interface PluginMediaGenerationInputSlot {\n\trole: string;\n\tkinds: readonly PluginMediaKind[];\n\tminItems: number;\n\tmaxItems: number;\n}\n\nexport interface PluginMediaGenerationModeCapability {\n\tmode: PluginMediaGenerationMode;\n\tinputs: readonly PluginMediaGenerationInputSlot[];\n\tminTotalItems?: number;\n\tmaxTotalItems?: number;\n\taspectRatioPolicy?: \"configurable\" | \"input-derived\";\n\taudioGeneration?: \"none\" | \"always\" | \"optional\";\n}\n\nexport interface PluginMediaGenerationModelDescriptor {\n\tid: string;\n\tdisplayName?: string;\n\tsourceId?: string;\n\tsourceDisplayName?: string;\n\tmodes: readonly PluginMediaGenerationMode[];\n\taspectRatios?: readonly string[];\n\t/** Provider-defined stable option ids; consumers must not infer pixel dimensions from their names. */\n\tresolutions?: readonly string[];\n\tdefaultResolution?: string;\n}\n\nexport type PluginMediaCapability =\n\t| {\n\t\t\toperation: \"generate\";\n\t\t\tkind: \"image\" | \"video\";\n\t\t\tmodes: readonly PluginMediaGenerationMode[];\n\t\t\taspectRatios?: readonly string[];\n\t\t\t/** Provider-defined stable option ids; consumers must not infer pixel dimensions from their names. */\n\t\t\tresolutions?: readonly string[];\n\t\t\t/** Preferred option when the consumer has no supported persisted resolution. */\n\t\t\tdefaultResolution?: string;\n\t\t\t/** Optional per-model catalog. Missing means this is a legacy provider with provider-level capabilities only. */\n\t\t\tmodels?: readonly PluginMediaGenerationModelDescriptor[];\n\t\t\t/** Model used when a consumer does not send modelId. */\n\t\t\tdefaultModelId?: string;\n\t\t\tdurationsSeconds?: readonly number[];\n\t\t\tmodeCapabilities?: readonly PluginMediaGenerationModeCapability[];\n\t }\n\t| {\n\t\t\toperation: \"compose\";\n\t\t\tdocumentMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t }\n\t| {\n\t\t\toperation: \"transcode\";\n\t\t\tinputMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t };\n\nexport interface PluginMediaProviderDescriptor {\n\t/** Host-qualified provider id. */\n\tid: string;\n\tdisplayName?: string;\n\townerId: string;\n\tprotocolVersion: number;\n\tcapabilities: readonly PluginMediaCapability[];\n}\n\nexport type PluginMediaJob = Omit<PluginJob<PluginMediaArtifact>, \"error\"> & {\n\terror?: PluginMediaFailure;\n};\n\n/** A media input exposed to its provider without revealing its storage location. */\nexport interface PluginMediaProviderInput {\n\tid: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n}\n\ntype ProviderRequest<Request extends PluginMediaSubmitRequest> = Omit<Request, \"providerId\" | \"inputs\"> & {\n\treadonly inputs: readonly PluginMediaProviderInput[];\n};\n\nexport type PluginMediaProviderSubmitRequest =\n\tPluginMediaSubmitRequest extends infer Request\n\t\t? Request extends PluginMediaSubmitRequest\n\t\t\t? ProviderRequest<Request>\n\t\t\t: never\n\t\t: never;\n\nexport interface PluginMediaInputUploadRequest {\n\turl: string;\n\tfieldName: string;\n\tfileName?: string;\n\tfields?: Record<string, string>;\n\theaders?: Record<string, string>;\n\ttimeoutMs?: number;\n}\n\nexport interface PluginMediaTransferResponse<T = unknown> {\n\tok: boolean;\n\tstatus: number;\n\tstatusText: string;\n\theaders: Record<string, string>;\n\tbody: T;\n}\n\nexport interface PluginMediaProviderHandlerContext {\n\treadonly invocationId: string;\n\t/** Reads an input that belongs to this invocation without exposing its backing path. */\n\treadInput(inputId: string): Promise<{ mimeType: string; data: Uint8Array }>;\n\tuploadInput<T = unknown>(\n\t\tinputId: string,\n\t\trequest: PluginMediaInputUploadRequest,\n\t): Promise<PluginMediaTransferResponse<T>>;\n}\n\nexport type PluginMediaProviderArtifactSource =\n\t| { type: \"remote-url\"; url: string; headers?: Record<string, string> }\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaProviderArtifact {\n\tkind: PluginMediaOutputKind;\n\tmimeType?: string;\n\tname?: string;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n\tsource: PluginMediaProviderArtifactSource;\n}\n\nexport interface PluginMediaProviderJob {\n\tid: string;\n\tstatus: PluginMediaJob[\"status\"];\n\tprogress?: number;\n\tartifacts?: readonly PluginMediaProviderArtifact[];\n\terror?: PluginMediaFailure;\n}\n\nexport interface PluginMediaProviderRegistration {\n\tid: string;\n\tdisplayName?: string;\n\tcapabilities: readonly PluginMediaCapability[];\n\tsubmit(\n\t\trequest: PluginMediaProviderSubmitRequest,\n\t\tcontext: PluginMediaProviderHandlerContext,\n\t): Promise<PluginMediaProviderJob>;\n\tgetJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n\tcancelJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n}\n\nexport interface PluginMediaApi {\n\tregisterProvider(registration: PluginMediaProviderRegistration): Disposable;\n\tlistProviders(): Promise<readonly PluginMediaProviderDescriptor[]>;\n\tonProvidersChanged(listener: () => void): Disposable;\n\tsubmit(request: PluginMediaSubmitRequest): Promise<PluginMediaJob>;\n}\n"]}
package/dist/media.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"media.js","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAgCA,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACjC,IAAI,CAAuB;IAC3B,SAAS,CAAU;IAE5B,YAAY,OAA2B,EAAE;QACxC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAAA,CACnC;CACD","sourcesContent":["import type { PluginArtifactRef } from \"./artifacts.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginJob, PluginJobFailure } from \"./jobs.js\";\n\nexport type PluginMediaKind = \"image\" | \"video\" | \"audio\" | \"document\";\nexport type PluginMediaOutputKind = \"image\" | \"video\" | \"audio\";\nexport type PluginMediaOperation = \"generate\" | \"compose\" | \"transcode\";\n\nexport type PluginMediaGenerationMode =\n\t| \"text-to-image\"\n\t| \"image-to-image\"\n\t| \"text-to-video\"\n\t| \"image-to-video\"\n\t| \"video-to-video\"\n\t| \"reference-to-video\";\n\nexport type PluginMediaErrorCode =\n\t| \"unauthenticated\"\n\t| \"provider-unavailable\"\n\t| \"operation-unsupported\"\n\t| \"invalid-request\"\n\t| \"not-entitled\"\n\t| \"quota-exhausted\"\n\t| \"content-rejected\"\n\t| \"provider-timeout\"\n\t| \"provider-failed\"\n\t| \"cancelled\";\n\nexport interface PluginMediaFailure extends PluginJobFailure {\n\tcode: PluginMediaErrorCode;\n}\n\nexport class PluginMediaError extends Error {\n\treadonly code: PluginMediaErrorCode;\n\treadonly retryable: boolean;\n\n\tconstructor(failure: PluginMediaFailure) {\n\t\tsuper(failure.message);\n\t\tthis.name = \"PluginMediaError\";\n\t\tthis.code = failure.code;\n\t\tthis.retryable = failure.retryable;\n\t}\n}\n\nexport interface PluginMediaDimensions {\n\twidth: number;\n\theight: number;\n}\n\nexport type PluginMediaInputSource =\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaInput {\n\tid?: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n\tsource: PluginMediaInputSource;\n}\n\nexport interface PluginMediaOutput {\n\tkind: PluginMediaOutputKind;\n\tmimeType: string;\n\tdimensions?: PluginMediaDimensions;\n\tfps?: number;\n\tdurationSeconds?: number;\n\tvideoCodec?: string;\n\taudioCodec?: string;\n}\n\nexport interface PluginMediaArtifact extends PluginArtifactRef {\n\tkind: PluginMediaOutputKind;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n}\n\nexport interface PluginMediaGenerateRequest {\n\toperation: \"generate\";\n\tproviderId: string;\n\tkind: \"image\" | \"video\";\n\tmode: PluginMediaGenerationMode;\n\tprompt: string;\n\tmodelId?: string;\n\tdimensions?: PluginMediaDimensions;\n\taspectRatio?: string;\n\tresolution?: string;\n\tdurationSeconds?: number;\n\tinputs?: readonly PluginMediaInput[];\n}\n\nexport interface PluginMediaComposeRequest {\n\toperation: \"compose\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport interface PluginMediaTranscodeRequest {\n\toperation: \"transcode\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport type PluginMediaSubmitRequest =\n\t| PluginMediaGenerateRequest\n\t| PluginMediaComposeRequest\n\t| PluginMediaTranscodeRequest;\n\nexport interface PluginMediaGenerationInputSlot {\n\trole: string;\n\tkinds: readonly PluginMediaKind[];\n\tminItems: number;\n\tmaxItems: number;\n}\n\nexport interface PluginMediaGenerationModeCapability {\n\tmode: PluginMediaGenerationMode;\n\tinputs: readonly PluginMediaGenerationInputSlot[];\n\tminTotalItems?: number;\n\tmaxTotalItems?: number;\n\taspectRatioPolicy?: \"configurable\" | \"input-derived\";\n\taudioGeneration?: \"none\" | \"always\" | \"optional\";\n}\n\nexport type PluginMediaCapability =\n\t| {\n\t\t\toperation: \"generate\";\n\t\t\tkind: \"image\" | \"video\";\n\t\t\tmodes: readonly PluginMediaGenerationMode[];\n\t\t\taspectRatios?: readonly string[];\n\t\t\t/** Provider-defined stable option ids; consumers must not infer pixel dimensions from their names. */\n\t\t\tresolutions?: readonly string[];\n\t\t\t/** Preferred option when the consumer has no supported persisted resolution. */\n\t\t\tdefaultResolution?: string;\n\t\t\tdurationsSeconds?: readonly number[];\n\t\t\tmodeCapabilities?: readonly PluginMediaGenerationModeCapability[];\n\t }\n\t| {\n\t\t\toperation: \"compose\";\n\t\t\tdocumentMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t }\n\t| {\n\t\t\toperation: \"transcode\";\n\t\t\tinputMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t };\n\nexport interface PluginMediaProviderDescriptor {\n\t/** Host-qualified provider id. */\n\tid: string;\n\tdisplayName?: string;\n\townerId: string;\n\tprotocolVersion: number;\n\tcapabilities: readonly PluginMediaCapability[];\n}\n\nexport type PluginMediaJob = Omit<PluginJob<PluginMediaArtifact>, \"error\"> & {\n\terror?: PluginMediaFailure;\n};\n\n/** A media input exposed to its provider without revealing its storage location. */\nexport interface PluginMediaProviderInput {\n\tid: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n}\n\ntype ProviderRequest<Request extends PluginMediaSubmitRequest> = Omit<Request, \"providerId\" | \"inputs\"> & {\n\treadonly inputs: readonly PluginMediaProviderInput[];\n};\n\nexport type PluginMediaProviderSubmitRequest =\n\tPluginMediaSubmitRequest extends infer Request\n\t\t? Request extends PluginMediaSubmitRequest\n\t\t\t? ProviderRequest<Request>\n\t\t\t: never\n\t\t: never;\n\nexport interface PluginMediaInputUploadRequest {\n\turl: string;\n\tfieldName: string;\n\tfileName?: string;\n\tfields?: Record<string, string>;\n\theaders?: Record<string, string>;\n\ttimeoutMs?: number;\n}\n\nexport interface PluginMediaTransferResponse<T = unknown> {\n\tok: boolean;\n\tstatus: number;\n\tstatusText: string;\n\theaders: Record<string, string>;\n\tbody: T;\n}\n\nexport interface PluginMediaProviderHandlerContext {\n\treadonly invocationId: string;\n\tuploadInput<T = unknown>(\n\t\tinputId: string,\n\t\trequest: PluginMediaInputUploadRequest,\n\t): Promise<PluginMediaTransferResponse<T>>;\n}\n\nexport type PluginMediaProviderArtifactSource =\n\t| { type: \"remote-url\"; url: string; headers?: Record<string, string> }\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaProviderArtifact {\n\tkind: PluginMediaOutputKind;\n\tmimeType?: string;\n\tname?: string;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n\tsource: PluginMediaProviderArtifactSource;\n}\n\nexport interface PluginMediaProviderJob {\n\tid: string;\n\tstatus: PluginMediaJob[\"status\"];\n\tprogress?: number;\n\tartifacts?: readonly PluginMediaProviderArtifact[];\n\terror?: PluginMediaFailure;\n}\n\nexport interface PluginMediaProviderRegistration {\n\tid: string;\n\tdisplayName?: string;\n\tcapabilities: readonly PluginMediaCapability[];\n\tsubmit(\n\t\trequest: PluginMediaProviderSubmitRequest,\n\t\tcontext: PluginMediaProviderHandlerContext,\n\t): Promise<PluginMediaProviderJob>;\n\tgetJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n\tcancelJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n}\n\nexport interface PluginMediaApi {\n\tregisterProvider(registration: PluginMediaProviderRegistration): Disposable;\n\tlistProviders(): Promise<readonly PluginMediaProviderDescriptor[]>;\n\tonProvidersChanged(listener: () => void): Disposable;\n\tsubmit(request: PluginMediaSubmitRequest): Promise<PluginMediaJob>;\n}\n"]}
1
+ {"version":3,"file":"media.js","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAgCA,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACjC,IAAI,CAAuB;IAC3B,SAAS,CAAU;IAE5B,YAAY,OAA2B,EAAE;QACxC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAAA,CACnC;CACD","sourcesContent":["import type { PluginArtifactRef } from \"./artifacts.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginJob, PluginJobFailure } from \"./jobs.js\";\n\nexport type PluginMediaKind = \"image\" | \"video\" | \"audio\" | \"document\";\nexport type PluginMediaOutputKind = \"image\" | \"video\" | \"audio\";\nexport type PluginMediaOperation = \"generate\" | \"compose\" | \"transcode\";\n\nexport type PluginMediaGenerationMode =\n\t| \"text-to-image\"\n\t| \"image-to-image\"\n\t| \"text-to-video\"\n\t| \"image-to-video\"\n\t| \"video-to-video\"\n\t| \"reference-to-video\";\n\nexport type PluginMediaErrorCode =\n\t| \"unauthenticated\"\n\t| \"provider-unavailable\"\n\t| \"operation-unsupported\"\n\t| \"invalid-request\"\n\t| \"not-entitled\"\n\t| \"quota-exhausted\"\n\t| \"content-rejected\"\n\t| \"provider-timeout\"\n\t| \"provider-failed\"\n\t| \"cancelled\";\n\nexport interface PluginMediaFailure extends PluginJobFailure {\n\tcode: PluginMediaErrorCode;\n}\n\nexport class PluginMediaError extends Error {\n\treadonly code: PluginMediaErrorCode;\n\treadonly retryable: boolean;\n\n\tconstructor(failure: PluginMediaFailure) {\n\t\tsuper(failure.message);\n\t\tthis.name = \"PluginMediaError\";\n\t\tthis.code = failure.code;\n\t\tthis.retryable = failure.retryable;\n\t}\n}\n\nexport interface PluginMediaDimensions {\n\twidth: number;\n\theight: number;\n}\n\nexport type PluginMediaInputSource =\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaInput {\n\tid?: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n\tsource: PluginMediaInputSource;\n}\n\nexport interface PluginMediaOutput {\n\tkind: PluginMediaOutputKind;\n\tmimeType: string;\n\tdimensions?: PluginMediaDimensions;\n\tfps?: number;\n\tdurationSeconds?: number;\n\tvideoCodec?: string;\n\taudioCodec?: string;\n}\n\nexport interface PluginMediaArtifact extends PluginArtifactRef {\n\tkind: PluginMediaOutputKind;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n}\n\nexport interface PluginMediaGenerateRequest {\n\toperation: \"generate\";\n\tproviderId: string;\n\tkind: \"image\" | \"video\";\n\tmode: PluginMediaGenerationMode;\n\tprompt: string;\n\tmodelId?: string;\n\tdimensions?: PluginMediaDimensions;\n\taspectRatio?: string;\n\tresolution?: string;\n\tdurationSeconds?: number;\n\tinputs?: readonly PluginMediaInput[];\n}\n\nexport interface PluginMediaComposeRequest {\n\toperation: \"compose\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport interface PluginMediaTranscodeRequest {\n\toperation: \"transcode\";\n\tproviderId: string;\n\tinputs: readonly PluginMediaInput[];\n\toutput: PluginMediaOutput;\n}\n\nexport type PluginMediaSubmitRequest =\n\t| PluginMediaGenerateRequest\n\t| PluginMediaComposeRequest\n\t| PluginMediaTranscodeRequest;\n\nexport interface PluginMediaGenerationInputSlot {\n\trole: string;\n\tkinds: readonly PluginMediaKind[];\n\tminItems: number;\n\tmaxItems: number;\n}\n\nexport interface PluginMediaGenerationModeCapability {\n\tmode: PluginMediaGenerationMode;\n\tinputs: readonly PluginMediaGenerationInputSlot[];\n\tminTotalItems?: number;\n\tmaxTotalItems?: number;\n\taspectRatioPolicy?: \"configurable\" | \"input-derived\";\n\taudioGeneration?: \"none\" | \"always\" | \"optional\";\n}\n\nexport interface PluginMediaGenerationModelDescriptor {\n\tid: string;\n\tdisplayName?: string;\n\tsourceId?: string;\n\tsourceDisplayName?: string;\n\tmodes: readonly PluginMediaGenerationMode[];\n\taspectRatios?: readonly string[];\n\t/** Provider-defined stable option ids; consumers must not infer pixel dimensions from their names. */\n\tresolutions?: readonly string[];\n\tdefaultResolution?: string;\n}\n\nexport type PluginMediaCapability =\n\t| {\n\t\t\toperation: \"generate\";\n\t\t\tkind: \"image\" | \"video\";\n\t\t\tmodes: readonly PluginMediaGenerationMode[];\n\t\t\taspectRatios?: readonly string[];\n\t\t\t/** Provider-defined stable option ids; consumers must not infer pixel dimensions from their names. */\n\t\t\tresolutions?: readonly string[];\n\t\t\t/** Preferred option when the consumer has no supported persisted resolution. */\n\t\t\tdefaultResolution?: string;\n\t\t\t/** Optional per-model catalog. Missing means this is a legacy provider with provider-level capabilities only. */\n\t\t\tmodels?: readonly PluginMediaGenerationModelDescriptor[];\n\t\t\t/** Model used when a consumer does not send modelId. */\n\t\t\tdefaultModelId?: string;\n\t\t\tdurationsSeconds?: readonly number[];\n\t\t\tmodeCapabilities?: readonly PluginMediaGenerationModeCapability[];\n\t }\n\t| {\n\t\t\toperation: \"compose\";\n\t\t\tdocumentMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t }\n\t| {\n\t\t\toperation: \"transcode\";\n\t\t\tinputMimeTypes: readonly string[];\n\t\t\toutputMimeTypes: readonly string[];\n\t };\n\nexport interface PluginMediaProviderDescriptor {\n\t/** Host-qualified provider id. */\n\tid: string;\n\tdisplayName?: string;\n\townerId: string;\n\tprotocolVersion: number;\n\tcapabilities: readonly PluginMediaCapability[];\n}\n\nexport type PluginMediaJob = Omit<PluginJob<PluginMediaArtifact>, \"error\"> & {\n\terror?: PluginMediaFailure;\n};\n\n/** A media input exposed to its provider without revealing its storage location. */\nexport interface PluginMediaProviderInput {\n\tid: string;\n\trole?: string;\n\tkind: PluginMediaKind;\n\tmimeType?: string;\n}\n\ntype ProviderRequest<Request extends PluginMediaSubmitRequest> = Omit<Request, \"providerId\" | \"inputs\"> & {\n\treadonly inputs: readonly PluginMediaProviderInput[];\n};\n\nexport type PluginMediaProviderSubmitRequest =\n\tPluginMediaSubmitRequest extends infer Request\n\t\t? Request extends PluginMediaSubmitRequest\n\t\t\t? ProviderRequest<Request>\n\t\t\t: never\n\t\t: never;\n\nexport interface PluginMediaInputUploadRequest {\n\turl: string;\n\tfieldName: string;\n\tfileName?: string;\n\tfields?: Record<string, string>;\n\theaders?: Record<string, string>;\n\ttimeoutMs?: number;\n}\n\nexport interface PluginMediaTransferResponse<T = unknown> {\n\tok: boolean;\n\tstatus: number;\n\tstatusText: string;\n\theaders: Record<string, string>;\n\tbody: T;\n}\n\nexport interface PluginMediaProviderHandlerContext {\n\treadonly invocationId: string;\n\t/** Reads an input that belongs to this invocation without exposing its backing path. */\n\treadInput(inputId: string): Promise<{ mimeType: string; data: Uint8Array }>;\n\tuploadInput<T = unknown>(\n\t\tinputId: string,\n\t\trequest: PluginMediaInputUploadRequest,\n\t): Promise<PluginMediaTransferResponse<T>>;\n}\n\nexport type PluginMediaProviderArtifactSource =\n\t| { type: \"remote-url\"; url: string; headers?: Record<string, string> }\n\t| { type: \"plugin-blob\"; blobId: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport interface PluginMediaProviderArtifact {\n\tkind: PluginMediaOutputKind;\n\tmimeType?: string;\n\tname?: string;\n\twidth?: number;\n\theight?: number;\n\tdurationSeconds?: number;\n\tsource: PluginMediaProviderArtifactSource;\n}\n\nexport interface PluginMediaProviderJob {\n\tid: string;\n\tstatus: PluginMediaJob[\"status\"];\n\tprogress?: number;\n\tartifacts?: readonly PluginMediaProviderArtifact[];\n\terror?: PluginMediaFailure;\n}\n\nexport interface PluginMediaProviderRegistration {\n\tid: string;\n\tdisplayName?: string;\n\tcapabilities: readonly PluginMediaCapability[];\n\tsubmit(\n\t\trequest: PluginMediaProviderSubmitRequest,\n\t\tcontext: PluginMediaProviderHandlerContext,\n\t): Promise<PluginMediaProviderJob>;\n\tgetJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n\tcancelJob?(jobId: string, context: PluginMediaProviderHandlerContext): Promise<PluginMediaProviderJob>;\n}\n\nexport interface PluginMediaApi {\n\tregisterProvider(registration: PluginMediaProviderRegistration): Disposable;\n\tlistProviders(): Promise<readonly PluginMediaProviderDescriptor[]>;\n\tonProvidersChanged(listener: () => void): Disposable;\n\tsubmit(request: PluginMediaSubmitRequest): Promise<PluginMediaJob>;\n}\n"]}
package/dist/models.d.ts CHANGED
@@ -3,6 +3,10 @@ export interface PluginModelDefinition {
3
3
  name?: string;
4
4
  api?: string;
5
5
  reasoning?: boolean;
6
+ /** Provider-native choices; omitted or empty uses the host's API preset. */
7
+ reasoningLevels?: string[];
8
+ /** Used when no user choice exists; otherwise the first declared level wins. */
9
+ defaultReasoningLevel?: string;
6
10
  contextWindow?: number;
7
11
  maxTokens?: number;
8
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC/B,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3F;;;;;;;;;;;OAWG;IACH,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC;CACzE","sourcesContent":["export interface PluginModelDefinition {\n\tid: string;\n\tname?: string;\n\tapi?: string;\n\treasoning?: boolean;\n\tcontextWindow?: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginModelProviderConfig {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: PluginModelDefinition[];\n}\n\n/** Reconciles the complete set of provider ids owned by the calling plugin. */\nexport interface PluginModelsApi {\n\treplaceOwnedProviders(providers: Record<string, PluginModelProviderConfig>): Promise<void>;\n\t/**\n\t * Reads back what the host currently holds for this plugin, keyed by the same\n\t * local provider ids `replaceOwnedProviders` accepts.\n\t *\n\t * `replaceOwnedProviders` deletes by omission, so a plugin that cannot read its\n\t * own published state can only clobber it — every write has to reconstruct the\n\t * whole truth from whatever its (often eventually consistent) upstream happens\n\t * to report at that instant. Read this first and reconcile against it, so a\n\t * model that is merely not visible yet is not mistaken for one the user lost.\n\t *\n\t * `apiKey` comes back masked; supply the real credential on the next write.\n\t */\n\tlistOwnedProviders(): Promise<Record<string, PluginModelProviderConfig>>;\n}\n"]}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC/B,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3F;;;;;;;;;;;OAWG;IACH,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC;CACzE","sourcesContent":["export interface PluginModelDefinition {\n\tid: string;\n\tname?: string;\n\tapi?: string;\n\treasoning?: boolean;\n\t/** Provider-native choices; omitted or empty uses the host's API preset. */\n\treasoningLevels?: string[];\n\t/** Used when no user choice exists; otherwise the first declared level wins. */\n\tdefaultReasoningLevel?: string;\n\tcontextWindow?: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginModelProviderConfig {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: PluginModelDefinition[];\n}\n\n/** Reconciles the complete set of provider ids owned by the calling plugin. */\nexport interface PluginModelsApi {\n\treplaceOwnedProviders(providers: Record<string, PluginModelProviderConfig>): Promise<void>;\n\t/**\n\t * Reads back what the host currently holds for this plugin, keyed by the same\n\t * local provider ids `replaceOwnedProviders` accepts.\n\t *\n\t * `replaceOwnedProviders` deletes by omission, so a plugin that cannot read its\n\t * own published state can only clobber it — every write has to reconstruct the\n\t * whole truth from whatever its (often eventually consistent) upstream happens\n\t * to report at that instant. Read this first and reconcile against it, so a\n\t * model that is merely not visible yet is not mistaken for one the user lost.\n\t *\n\t * `apiKey` comes back masked; supply the real credential on the next write.\n\t */\n\tlistOwnedProviders(): Promise<Record<string, PluginModelProviderConfig>>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginModelDefinition {\n\tid: string;\n\tname?: string;\n\tapi?: string;\n\treasoning?: boolean;\n\tcontextWindow?: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginModelProviderConfig {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: PluginModelDefinition[];\n}\n\n/** Reconciles the complete set of provider ids owned by the calling plugin. */\nexport interface PluginModelsApi {\n\treplaceOwnedProviders(providers: Record<string, PluginModelProviderConfig>): Promise<void>;\n\t/**\n\t * Reads back what the host currently holds for this plugin, keyed by the same\n\t * local provider ids `replaceOwnedProviders` accepts.\n\t *\n\t * `replaceOwnedProviders` deletes by omission, so a plugin that cannot read its\n\t * own published state can only clobber it — every write has to reconstruct the\n\t * whole truth from whatever its (often eventually consistent) upstream happens\n\t * to report at that instant. Read this first and reconcile against it, so a\n\t * model that is merely not visible yet is not mistaken for one the user lost.\n\t *\n\t * `apiKey` comes back masked; supply the real credential on the next write.\n\t */\n\tlistOwnedProviders(): Promise<Record<string, PluginModelProviderConfig>>;\n}\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginModelDefinition {\n\tid: string;\n\tname?: string;\n\tapi?: string;\n\treasoning?: boolean;\n\t/** Provider-native choices; omitted or empty uses the host's API preset. */\n\treasoningLevels?: string[];\n\t/** Used when no user choice exists; otherwise the first declared level wins. */\n\tdefaultReasoningLevel?: string;\n\tcontextWindow?: number;\n\tmaxTokens?: number;\n}\n\nexport interface PluginModelProviderConfig {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: PluginModelDefinition[];\n}\n\n/** Reconciles the complete set of provider ids owned by the calling plugin. */\nexport interface PluginModelsApi {\n\treplaceOwnedProviders(providers: Record<string, PluginModelProviderConfig>): Promise<void>;\n\t/**\n\t * Reads back what the host currently holds for this plugin, keyed by the same\n\t * local provider ids `replaceOwnedProviders` accepts.\n\t *\n\t * `replaceOwnedProviders` deletes by omission, so a plugin that cannot read its\n\t * own published state can only clobber it — every write has to reconstruct the\n\t * whole truth from whatever its (often eventually consistent) upstream happens\n\t * to report at that instant. Read this first and reconcile against it, so a\n\t * model that is merely not visible yet is not mistaken for one the user lost.\n\t *\n\t * `apiKey` comes back masked; supply the real credential on the next write.\n\t */\n\tlistOwnedProviders(): Promise<Record<string, PluginModelProviderConfig>>;\n}\n"]}