@xpert-ai/plugin-sdk 3.38.1 → 3.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,9 @@ The Cloud application opts in through `provideArtifactPresentationCommands()` in
32
32
 
33
33
  ## Browser protocol
34
34
 
35
- The generic component hosts the entry in an opaque `sandbox="allow-scripts"` iframe with no-network CSP. It accepts remote-component protocol v1 `ready`, `requestData` and `executeAction` messages only. The host validates the exact source window and instance ID, and relays only declared read operations with the server-resolved target. It exposes no file, navigation, client-command or authoring channels and never sends credentials to the iframe. Theme and locale changes resend `init` for the same instance; providers must handle it without resetting the selected resource or reloading unchanged data. Changing the share route cancels in-flight requests and creates a new instance.
35
+ The generic component hosts the entry in an opaque iframe with no-network CSP. Its sandbox defaults to `allow-scripts`. For authenticated shares, pass the same trusted `{ allowDownloads }` policy to `authenticatedArtifactPresentation(policy)` and to the document mount. When enabled, the outer iframe and the embedded document both receive `allow-downloads`. Plugins supporting older host SDKs can fall back to `{ mode: 'authenticated' }` when the helper is unavailable. Raw artifact file access follows `sharing.allowDownload`.
36
+
37
+ The viewer accepts remote-component protocol v1 `ready`, `requestData` and `executeAction` messages only. The host validates the exact source window and instance ID, and relays only declared read operations with the server-resolved target. It exposes no file, navigation, client-command or authoring channels and never sends credentials to the iframe. Theme and locale changes resend `init` for the same instance; providers must handle it without resetting the selected resource or reloading unchanged data. Changing the share route cancels in-flight requests and creates a new instance.
36
38
 
37
39
  Bundle assets into the entry or immutable application package. External scripts, network fetches, forms, frames to network URLs and direct parent access are unavailable. Reuse Artifact document dependency snapshots for version-pinned HTML libraries.
38
40
 
package/index.cjs.js CHANGED
@@ -7209,13 +7209,18 @@ exports.ArtifactPresentationRegistry = __decorate([
7209
7209
  descriptor: v3.z.boolean(),
7210
7210
  shareKey: v3.z.string().min(1).optional()
7211
7211
  }).strict().optional(),
7212
- presentation: v3.z.object({
7213
- mode: v3.z.enum([
7214
- 'file',
7215
- 'snapshot',
7216
- 'authenticated'
7217
- ])
7218
- }).strict()
7212
+ presentation: v3.z.discriminatedUnion('mode', [
7213
+ v3.z.object({
7214
+ mode: v3.z.literal('file')
7215
+ }).strict(),
7216
+ v3.z.object({
7217
+ mode: v3.z.literal('snapshot')
7218
+ }).strict(),
7219
+ v3.z.object({
7220
+ mode: v3.z.literal('authenticated'),
7221
+ allowDownloads: v3.z.boolean().optional()
7222
+ }).strict()
7223
+ ])
7219
7224
  }).strict().refine((definition)=>!definition.useGrants || definition.presentation.mode === 'authenticated', 'Group use grants require an authenticated presentation').refine((definition)=>{
7220
7225
  var _definition_sharing;
7221
7226
  return ((_definition_sharing = definition.sharing) == null ? void 0 : _definition_sharing.projectAccess) !== 'link-audience' || definition.presentation.mode === 'authenticated' && definition.sharing.accessModes.every((mode)=>[
@@ -7329,6 +7334,12 @@ exports.ArtifactTypeRegistry = __decorate([
7329
7334
 
7330
7335
  const ARTIFACT_TYPE_PROVIDER = 'XPERT_ARTIFACT_TYPE_PROVIDER';
7331
7336
  /** The loader supplies plugin identity. A contribution cannot select another plugin's namespace. */ const ArtifactTypeProvider = (resourceType)=>common.applyDecorators(common.SetMetadata(ARTIFACT_TYPE_PROVIDER, resourceType), common.SetMetadata(STRATEGY_META_KEY, ARTIFACT_TYPE_PROVIDER));
7337
+ /** Use the same trusted download policy for the share and its embedded document. */ function authenticatedArtifactPresentation({ allowDownloads }) {
7338
+ return {
7339
+ mode: 'authenticated',
7340
+ allowDownloads: allowDownloads === true
7341
+ };
7342
+ }
7332
7343
 
7333
7344
  /** Platform-owned real-time collaboration capability available to scoped plugin runtimes. */ const CollaborationRuntimeCapability = modelProvider.createRuntimeCapability('platform.collaboration', {
7334
7345
  description: 'Create, synchronize, persist, authorize, and observe platform-managed real-time collaboration documents.'
@@ -12231,6 +12242,7 @@ exports.artifactPresentationKey = artifactPresentationKey;
12231
12242
  exports.artifactTypeKey = artifactTypeKey;
12232
12243
  exports.assertPluginRegistrationOwner = assertPluginRegistrationOwner;
12233
12244
  exports.assertXpertToolProviderClaims = assertXpertToolProviderClaims;
12245
+ exports.authenticatedArtifactPresentation = authenticatedArtifactPresentation;
12234
12246
  exports.buildSandboxTimeoutMessage = buildSandboxTimeoutMessage;
12235
12247
  exports.calcTokenUsage = calcTokenUsage;
12236
12248
  exports.calculateLLMUsagePrice = calculateLLMUsagePrice;
package/index.esm.js CHANGED
@@ -7191,13 +7191,18 @@ ArtifactPresentationRegistry = __decorate([
7191
7191
  descriptor: z.boolean(),
7192
7192
  shareKey: z.string().min(1).optional()
7193
7193
  }).strict().optional(),
7194
- presentation: z.object({
7195
- mode: z.enum([
7196
- 'file',
7197
- 'snapshot',
7198
- 'authenticated'
7199
- ])
7200
- }).strict()
7194
+ presentation: z.discriminatedUnion('mode', [
7195
+ z.object({
7196
+ mode: z.literal('file')
7197
+ }).strict(),
7198
+ z.object({
7199
+ mode: z.literal('snapshot')
7200
+ }).strict(),
7201
+ z.object({
7202
+ mode: z.literal('authenticated'),
7203
+ allowDownloads: z.boolean().optional()
7204
+ }).strict()
7205
+ ])
7201
7206
  }).strict().refine((definition)=>!definition.useGrants || definition.presentation.mode === 'authenticated', 'Group use grants require an authenticated presentation').refine((definition)=>{
7202
7207
  var _definition_sharing;
7203
7208
  return ((_definition_sharing = definition.sharing) == null ? void 0 : _definition_sharing.projectAccess) !== 'link-audience' || definition.presentation.mode === 'authenticated' && definition.sharing.accessModes.every((mode)=>[
@@ -7311,6 +7316,12 @@ ArtifactTypeRegistry = __decorate([
7311
7316
 
7312
7317
  const ARTIFACT_TYPE_PROVIDER = 'XPERT_ARTIFACT_TYPE_PROVIDER';
7313
7318
  /** The loader supplies plugin identity. A contribution cannot select another plugin's namespace. */ const ArtifactTypeProvider = (resourceType)=>applyDecorators(SetMetadata(ARTIFACT_TYPE_PROVIDER, resourceType), SetMetadata(STRATEGY_META_KEY, ARTIFACT_TYPE_PROVIDER));
7319
+ /** Use the same trusted download policy for the share and its embedded document. */ function authenticatedArtifactPresentation({ allowDownloads }) {
7320
+ return {
7321
+ mode: 'authenticated',
7322
+ allowDownloads: allowDownloads === true
7323
+ };
7324
+ }
7314
7325
 
7315
7326
  /** Platform-owned real-time collaboration capability available to scoped plugin runtimes. */ const CollaborationRuntimeCapability = createRuntimeCapability('platform.collaboration', {
7316
7327
  description: 'Create, synchronize, persist, authorize, and observe platform-managed real-time collaboration documents.'
@@ -11815,4 +11826,4 @@ function agentEventDigest(value) {
11815
11826
  const AGENT_EVENT_SOURCE = 'XPERT_AGENT_EVENT_SOURCE_V1';
11816
11827
  const AgentEventSourceStrategy = (key)=>applyDecorators(SetMetadata(AGENT_EVENT_SOURCE, key), SetMetadata(STRATEGY_META_KEY, AGENT_EVENT_SOURCE));
11817
11828
 
11818
- export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_EVENT_SOURCE, AGENT_MIDDLEWARE_STRATEGY, AGENT_PROCESS_SUPERVISOR, AGENT_RUNTIME_EVENT_MESSAGE_TYPE, AGENT_RUNTIME_STRATEGY, AIModel, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PROVIDER, ARTIFACT_PRESENTATION_PROVIDER, ARTIFACT_TYPE_PROVIDER, ASSISTANT_CAPABILITY_PROVIDER, AdapterDataSourceStrategy, AgentEventSourceStrategy, AgentExecutionRunnerCapability, AgentExecutionRunnerFactoryCapability, AgentInvocationRuntimeCapability, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AgentRuntimeDeploymentCapability, AgentRuntimeFactoryCapability, AgentRuntimeRegistry, AgentRuntimeStrategy, AiModelNotFoundException, AnalyticsDefinitionAuthoringCapability, AnalyticsProvider, AnalyticsProviderError, AnalyticsProviderRegistry, AnalyticsRuntimeCapability, ArtifactPresentationProvider, ArtifactPresentationRegistry, ArtifactTypeProvider, ArtifactTypeRegistry, AssistantCapabilityProvider, AssistantCapabilityProviderRegistry, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CLI_MODEL_TOKEN_REFERENCE, COLLABORATION_DOCUMENT_PROVIDER, CONNECTION_COMMAND_ROUTER_TOKEN, CONNECTOR_STRATEGY, CONTENT_RESOURCE_PROVIDER, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CliModelProfilesCapability, CollaborationDocumentProvider, CollaborationDocumentProviderRegistry, CollaborationRuntimeCapability, CommonParameterRules, ConnectorDocumentsRuntimeCapability, ConnectorRuntimeCapability, ConnectorRuntimeFactoryCapability, ConnectorStrategyKey, ConnectorStrategyRegistry, ContentDocumentsRuntimeCapability, ContentEditorProvider, ContentEditorRegistry, ContentEditorsRuntimeCapability, ContentReferencesRuntimeCapability, ContentResourceProvider, ContentResourceProviderRegistry, ContentResourcesRuntimeCapability, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, DecoratedAgentMiddlewareStrategy, DecoratedToolsetStrategy, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, EVOLUTION_RUNTIME_SERVICE_TOKEN, EVOLUTION_TARGET_PROVIDER, EvolutionBaselineRuntimeCapability, EvolutionChangeRuntimeCapability, EvolutionRuntimeCapability, EvolutionTargetProviderRegistry, EvolutionTargetProviderStrategy, ExecutionObservabilityRuntimeCapability, ExecutionReviewRuntimeCapability, FILE_ARTIFACT_TYPE, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, FileRuntimeCapability, FileStorageProvider, FileStorageProviderRegistry, FileUploadTargetRegistry, FileUploadTargetStrategy, GLOBAL_ORGANIZATION_SCOPE, HANDOFF_PERMISSION_SERVICE_TOKEN, HANDOFF_PROCESSOR_STRATEGY, HANDOFF_QUEUE_SERVICE_TOKEN, HandoffProcessorRegistry, HandoffProcessorStrategy, IMAGE_UNDERSTANDING_STRATEGY, INTEGRATION_PERMISSION_SERVICE_TOKEN, INTEGRATION_STRATEGY, ImageGenerationModel, ImageUnderstandingRegistry, ImageUnderstandingStrategy, ImportDefaultAgentPluginsCommand, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KEYWORD_ANALYZER_STRATEGY, KNOWLEDGE_STRATEGY, KeywordAnalyzerRegistry, KeywordAnalyzerStrategy, KnowledgeDocumentVisualAssetsRuntimeCapability, KnowledgeDocumentVisualAssetsRuntimeFactoryCapability, KnowledgeGraphRuntimeCapability, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseProvisioningRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, ListAnalyticsSourcesCommand, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, MCP_CAPABILITY_CHANGE_EVENT_TYPES, MESSAGE_WIDGET_PROVIDER, MODEL_OUTPUT_VALIDATION_ERROR_CODE, MessageWidgetProvider, MessageWidgetProviderRegistry, ModelExecutionEnvironmentCapability, ModelOutputValidationError, ModelProvider, NamedProviderRegistry, ORGANIZATION_METADATA_KEY, OpenAICompatibleEmbeddings, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_VERSION_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROJECT_PIPELINE_CONTRIBUTION, PROJECT_PIPELINE_PROJECTION_PROVIDER, PROJECT_PIPELINE_RUNTIME_ADAPTER, PROJECT_TASK_PROVIDER, PROJECT_TYPE_PROVIDER, PROVIDE_AI_MODEL_LLM, PROVIDE_AI_MODEL_MODERATION, PROVIDE_AI_MODEL_RERANK, PROVIDE_AI_MODEL_SPEECH2TEXT, PROVIDE_AI_MODEL_TEXT_EMBEDDING, PROVIDE_AI_MODEL_TTS, PluginEventJournal, PluginJobProcessor, PluginWebhookAuth, PluginWebhookAuthGuard, ProjectPipelineAnalyticsRuntimeCapability, ProjectPipelineCatalogRuntimeCapability, ProjectPipelineCommandsRuntimeCapability, ProjectPipelineConfigurationRuntimeCapability, ProjectPipelineContributionRegistry, ProjectPipelineContributor, ProjectPipelineEvidenceRuntimeCapability, ProjectPipelinePortfolioRuntimeCapability, ProjectPipelineProjectionProvider, ProjectPipelineProjectionProviderRegistry, ProjectPipelineProviderActionsRuntimeCapability, ProjectPipelineRuntimeAdapterProvider, ProjectPipelineRuntimeAdapterRegistry, ProjectPipelinesRuntimeCapability, ProjectTaskProvider, ProjectTaskProviderRegistry, ProjectTasksRuntimeCapability, ProjectTypeProvider, ProjectTypeProviderRegistry, RESOURCE_CARD_EVENT, RESOURCE_CARD_PROVIDER, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, ResolveAnalyticsSourceCommand, ResolveConnectorIntegrationQuery, ResourceCardProvider, ResourceCardProviderRegistry, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_RUNTIME_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SANDBOX_WORKSPACE_MAPPER, SKILL_SOURCE_PROVIDER, SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN, SPEECH_TO_TEXT_SERVICE_TOKEN, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SYSTEM_GLOBAL_SCOPE, SandboxProviderRegistry, SandboxProviderStrategy, SandboxRuntimeProviderRegistry, SandboxRuntimeProviderStrategy, SandboxWorkspaceMapperRegistry, SandboxWorkspaceMapperStrategy, ShellModelExecutionSourceCapability, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TENANT_GLOBAL_SCOPE_PREFIX, TENANT_GLOBAL_SCOPE_SUFFIX, TEXT_SPLITTER_STRATEGY, TOOLSET_STRATEGY, TextEmbeddingModelManager, TextSplitterRegistry, TextSplitterStrategy, TextToSpeechModel, ToolsetRegistry, ToolsetStrategy, USER_PERMISSION_SERVICE_TOKEN, VECTOR_STORE_STRATEGY, VIDEO_GENERATION_PERMISSION_SERVICE_TOKEN, VIDEO_GENERATION_SERVICE_TOKEN, VIDEO_GENERATOR_FAMILIES, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, VideoGenerationModel, ViewExtensionProvider, ViewExtensionProviderRegistry, ViewMiddlewareRuntimeCapability, WIDGET_ACTION_PROVIDER, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WidgetActionProvider, WidgetActionProviderRegistry, WorkbenchDecisionCapability, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_AGENT_MIDDLEWARE_RUNTIME_TOKEN, XPERT_TOOL_METHOD_METADATA, XPERT_TOOL_PROVIDER, XPERT_TOOL_PROVIDER_METADATA, XPERT_TOOL_RESULT_FORMAT_VERSION, XpFileSystem, XpertPrompt, XpertResource, XpertResourceTemplate, XpertServerPlugin, XpertTool, XpertToolProvider, XpertToolProviderCoordinator, XpertToolProviderRegistry, agentEventDigest, agentInvocationDispatchContextSchema, agentRuntimeConsumptionStateSchema, agentRuntimeDeliveryStateSchema, agentRuntimeDeploymentSpecSchema, agentRuntimeEventMessageId, agentRuntimeEventSchema, agentRuntimeReplyTargetSchema, agentRuntimeResultClaimSchema, agentRuntimeResultConsumptionKey, als, appendSandboxMessage, applyAssistantMiddleware, applyModelConfiguration, applyModelContextSize, artifactPresentationKey, artifactTypeKey, assertConnectorDefinition, assertPluginRegistrationOwner, assertXpertToolProviderClaims, buildSandboxTimeoutMessage, calcTokenUsage, calculateLLMUsagePrice, calculateModelPrice, calculateModelUsageCharge, canonicalEvolutionJson, chunkText, countTextTokens, countTokensSafe, createI18nInstance, createMutationEvidence, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, defineMcpApp, defineMcpCapabilities, defineMcpPrompt, defineMcpResource, defineMcpResourceTemplate, definePluginRegistration, defineXpertTool, derivePluginArtifactNamespace, describeXpertToolProvider, discoverOpenAIModels, downloadRemoteFile, emitResourceCard, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, getXpertToolMethod, hasAssistantMiddleware, hashEvolutionValue, isAgentInvocationTerminal, isDevelopmentSandboxRuntimeEnvironment, isExecutionObservationSession, isFileContentEditor, isModelOutputValidationError, isModelUsagePricingConfig, isPluginArtifactNamespace, isRemoteFile, isResourceContentEditor, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStrategyInstance, isStructuredMessageType, isTenantGlobalScopeKey, isTextContentEditor, jsonEncodedSchema, knowledgebaseActions, loadYamlFile, managedAgentRuntimeSchema, mergeCredentials, mergeModelRequirements, mergeParentChildChunks, nativeModelTransport, normalizeContextSize, normalizeTokenUsage, pluginArtifactTableName, prepareToolResult, processAsyncAIGCManagedJob, projectPipelineInvocationScopeSchema, readAnalyticsProviderDiagnostic, readPluginProviderRegistrations, renderRemoteModuleIframeHtml, renderRemoteReactIframeHtml, renderRemoteVueIframeHtml, resolveModelUsagePricingSnapshot, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveStrategyMetadataTarget, resolveTenantGlobalScopeKey, resolveTokenUsage, resolveTokenUsageCandidates, resolveXpertMcpExtensions, runWithRequestContext, runtimeToolProviderComponent, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage, supportsContentModel, taskWaitReason, textTokenBoundaries, validateAnalyticsPayload };
11829
+ export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_EVENT_SOURCE, AGENT_MIDDLEWARE_STRATEGY, AGENT_PROCESS_SUPERVISOR, AGENT_RUNTIME_EVENT_MESSAGE_TYPE, AGENT_RUNTIME_STRATEGY, AIModel, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PROVIDER, ARTIFACT_PRESENTATION_PROVIDER, ARTIFACT_TYPE_PROVIDER, ASSISTANT_CAPABILITY_PROVIDER, AdapterDataSourceStrategy, AgentEventSourceStrategy, AgentExecutionRunnerCapability, AgentExecutionRunnerFactoryCapability, AgentInvocationRuntimeCapability, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AgentRuntimeDeploymentCapability, AgentRuntimeFactoryCapability, AgentRuntimeRegistry, AgentRuntimeStrategy, AiModelNotFoundException, AnalyticsDefinitionAuthoringCapability, AnalyticsProvider, AnalyticsProviderError, AnalyticsProviderRegistry, AnalyticsRuntimeCapability, ArtifactPresentationProvider, ArtifactPresentationRegistry, ArtifactTypeProvider, ArtifactTypeRegistry, AssistantCapabilityProvider, AssistantCapabilityProviderRegistry, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CLI_MODEL_TOKEN_REFERENCE, COLLABORATION_DOCUMENT_PROVIDER, CONNECTION_COMMAND_ROUTER_TOKEN, CONNECTOR_STRATEGY, CONTENT_RESOURCE_PROVIDER, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CliModelProfilesCapability, CollaborationDocumentProvider, CollaborationDocumentProviderRegistry, CollaborationRuntimeCapability, CommonParameterRules, ConnectorDocumentsRuntimeCapability, ConnectorRuntimeCapability, ConnectorRuntimeFactoryCapability, ConnectorStrategyKey, ConnectorStrategyRegistry, ContentDocumentsRuntimeCapability, ContentEditorProvider, ContentEditorRegistry, ContentEditorsRuntimeCapability, ContentReferencesRuntimeCapability, ContentResourceProvider, ContentResourceProviderRegistry, ContentResourcesRuntimeCapability, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, DecoratedAgentMiddlewareStrategy, DecoratedToolsetStrategy, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, EVOLUTION_RUNTIME_SERVICE_TOKEN, EVOLUTION_TARGET_PROVIDER, EvolutionBaselineRuntimeCapability, EvolutionChangeRuntimeCapability, EvolutionRuntimeCapability, EvolutionTargetProviderRegistry, EvolutionTargetProviderStrategy, ExecutionObservabilityRuntimeCapability, ExecutionReviewRuntimeCapability, FILE_ARTIFACT_TYPE, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, FileRuntimeCapability, FileStorageProvider, FileStorageProviderRegistry, FileUploadTargetRegistry, FileUploadTargetStrategy, GLOBAL_ORGANIZATION_SCOPE, HANDOFF_PERMISSION_SERVICE_TOKEN, HANDOFF_PROCESSOR_STRATEGY, HANDOFF_QUEUE_SERVICE_TOKEN, HandoffProcessorRegistry, HandoffProcessorStrategy, IMAGE_UNDERSTANDING_STRATEGY, INTEGRATION_PERMISSION_SERVICE_TOKEN, INTEGRATION_STRATEGY, ImageGenerationModel, ImageUnderstandingRegistry, ImageUnderstandingStrategy, ImportDefaultAgentPluginsCommand, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KEYWORD_ANALYZER_STRATEGY, KNOWLEDGE_STRATEGY, KeywordAnalyzerRegistry, KeywordAnalyzerStrategy, KnowledgeDocumentVisualAssetsRuntimeCapability, KnowledgeDocumentVisualAssetsRuntimeFactoryCapability, KnowledgeGraphRuntimeCapability, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseProvisioningRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, ListAnalyticsSourcesCommand, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, MCP_CAPABILITY_CHANGE_EVENT_TYPES, MESSAGE_WIDGET_PROVIDER, MODEL_OUTPUT_VALIDATION_ERROR_CODE, MessageWidgetProvider, MessageWidgetProviderRegistry, ModelExecutionEnvironmentCapability, ModelOutputValidationError, ModelProvider, NamedProviderRegistry, ORGANIZATION_METADATA_KEY, OpenAICompatibleEmbeddings, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_VERSION_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROJECT_PIPELINE_CONTRIBUTION, PROJECT_PIPELINE_PROJECTION_PROVIDER, PROJECT_PIPELINE_RUNTIME_ADAPTER, PROJECT_TASK_PROVIDER, PROJECT_TYPE_PROVIDER, PROVIDE_AI_MODEL_LLM, PROVIDE_AI_MODEL_MODERATION, PROVIDE_AI_MODEL_RERANK, PROVIDE_AI_MODEL_SPEECH2TEXT, PROVIDE_AI_MODEL_TEXT_EMBEDDING, PROVIDE_AI_MODEL_TTS, PluginEventJournal, PluginJobProcessor, PluginWebhookAuth, PluginWebhookAuthGuard, ProjectPipelineAnalyticsRuntimeCapability, ProjectPipelineCatalogRuntimeCapability, ProjectPipelineCommandsRuntimeCapability, ProjectPipelineConfigurationRuntimeCapability, ProjectPipelineContributionRegistry, ProjectPipelineContributor, ProjectPipelineEvidenceRuntimeCapability, ProjectPipelinePortfolioRuntimeCapability, ProjectPipelineProjectionProvider, ProjectPipelineProjectionProviderRegistry, ProjectPipelineProviderActionsRuntimeCapability, ProjectPipelineRuntimeAdapterProvider, ProjectPipelineRuntimeAdapterRegistry, ProjectPipelinesRuntimeCapability, ProjectTaskProvider, ProjectTaskProviderRegistry, ProjectTasksRuntimeCapability, ProjectTypeProvider, ProjectTypeProviderRegistry, RESOURCE_CARD_EVENT, RESOURCE_CARD_PROVIDER, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, ResolveAnalyticsSourceCommand, ResolveConnectorIntegrationQuery, ResourceCardProvider, ResourceCardProviderRegistry, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_RUNTIME_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SANDBOX_WORKSPACE_MAPPER, SKILL_SOURCE_PROVIDER, SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN, SPEECH_TO_TEXT_SERVICE_TOKEN, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SYSTEM_GLOBAL_SCOPE, SandboxProviderRegistry, SandboxProviderStrategy, SandboxRuntimeProviderRegistry, SandboxRuntimeProviderStrategy, SandboxWorkspaceMapperRegistry, SandboxWorkspaceMapperStrategy, ShellModelExecutionSourceCapability, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TENANT_GLOBAL_SCOPE_PREFIX, TENANT_GLOBAL_SCOPE_SUFFIX, TEXT_SPLITTER_STRATEGY, TOOLSET_STRATEGY, TextEmbeddingModelManager, TextSplitterRegistry, TextSplitterStrategy, TextToSpeechModel, ToolsetRegistry, ToolsetStrategy, USER_PERMISSION_SERVICE_TOKEN, VECTOR_STORE_STRATEGY, VIDEO_GENERATION_PERMISSION_SERVICE_TOKEN, VIDEO_GENERATION_SERVICE_TOKEN, VIDEO_GENERATOR_FAMILIES, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, VideoGenerationModel, ViewExtensionProvider, ViewExtensionProviderRegistry, ViewMiddlewareRuntimeCapability, WIDGET_ACTION_PROVIDER, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WidgetActionProvider, WidgetActionProviderRegistry, WorkbenchDecisionCapability, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_AGENT_MIDDLEWARE_RUNTIME_TOKEN, XPERT_TOOL_METHOD_METADATA, XPERT_TOOL_PROVIDER, XPERT_TOOL_PROVIDER_METADATA, XPERT_TOOL_RESULT_FORMAT_VERSION, XpFileSystem, XpertPrompt, XpertResource, XpertResourceTemplate, XpertServerPlugin, XpertTool, XpertToolProvider, XpertToolProviderCoordinator, XpertToolProviderRegistry, agentEventDigest, agentInvocationDispatchContextSchema, agentRuntimeConsumptionStateSchema, agentRuntimeDeliveryStateSchema, agentRuntimeDeploymentSpecSchema, agentRuntimeEventMessageId, agentRuntimeEventSchema, agentRuntimeReplyTargetSchema, agentRuntimeResultClaimSchema, agentRuntimeResultConsumptionKey, als, appendSandboxMessage, applyAssistantMiddleware, applyModelConfiguration, applyModelContextSize, artifactPresentationKey, artifactTypeKey, assertConnectorDefinition, assertPluginRegistrationOwner, assertXpertToolProviderClaims, authenticatedArtifactPresentation, buildSandboxTimeoutMessage, calcTokenUsage, calculateLLMUsagePrice, calculateModelPrice, calculateModelUsageCharge, canonicalEvolutionJson, chunkText, countTextTokens, countTokensSafe, createI18nInstance, createMutationEvidence, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, defineMcpApp, defineMcpCapabilities, defineMcpPrompt, defineMcpResource, defineMcpResourceTemplate, definePluginRegistration, defineXpertTool, derivePluginArtifactNamespace, describeXpertToolProvider, discoverOpenAIModels, downloadRemoteFile, emitResourceCard, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, getXpertToolMethod, hasAssistantMiddleware, hashEvolutionValue, isAgentInvocationTerminal, isDevelopmentSandboxRuntimeEnvironment, isExecutionObservationSession, isFileContentEditor, isModelOutputValidationError, isModelUsagePricingConfig, isPluginArtifactNamespace, isRemoteFile, isResourceContentEditor, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStrategyInstance, isStructuredMessageType, isTenantGlobalScopeKey, isTextContentEditor, jsonEncodedSchema, knowledgebaseActions, loadYamlFile, managedAgentRuntimeSchema, mergeCredentials, mergeModelRequirements, mergeParentChildChunks, nativeModelTransport, normalizeContextSize, normalizeTokenUsage, pluginArtifactTableName, prepareToolResult, processAsyncAIGCManagedJob, projectPipelineInvocationScopeSchema, readAnalyticsProviderDiagnostic, readPluginProviderRegistrations, renderRemoteModuleIframeHtml, renderRemoteReactIframeHtml, renderRemoteVueIframeHtml, resolveModelUsagePricingSnapshot, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveStrategyMetadataTarget, resolveTenantGlobalScopeKey, resolveTokenUsage, resolveTokenUsageCandidates, resolveXpertMcpExtensions, runWithRequestContext, runtimeToolProviderComponent, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage, supportsContentModel, taskWaitReason, textTokenBoundaries, validateAnalyticsPayload };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/plugin-sdk",
3
- "version": "3.38.1",
3
+ "version": "3.39.0",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@langchain/openai": "0.6.9",
83
- "@xpert-ai/contracts": "3.38.1",
83
+ "@xpert-ai/contracts": "3.39.0",
84
84
  "express": "^4.22.1",
85
85
  "js-tiktoken": "^1.0.21"
86
86
  },
@@ -1,17 +1,16 @@
1
1
  import { type ArtifactQueryState } from './scheduler';
2
+ import type { ArtifactDownloadPolicy } from '@xpert-ai/contracts';
2
3
  import { type ArtifactDocumentContext, type ArtifactDocumentQuery } from './protocol';
3
4
  import type { ArtifactDocumentDependencyAsset } from './dependencies';
4
5
  import type { ArtifactDocumentNetworkPolicy } from './network';
5
6
  /** Trusted integration callbacks. T is the plugin's cloneable result shape, independent of any chart library. */
6
- export interface ArtifactDocumentHostOptions<T> {
7
+ export interface ArtifactDocumentHostOptions<T> extends ArtifactDownloadPolicy {
7
8
  /** Complete untrusted HTML; scripts run only inside the isolated frame. */
8
9
  html: string;
9
10
  /** Exact packaged bytes pinned to this Artifact version, never URLs or library names from the document. */
10
11
  dependencies?: ArtifactDocumentDependencyAsset[];
11
12
  /** Trusted resource policy; unrestricted mode permits networking. Omit to block external resources. */
12
13
  networkPolicy?: ArtifactDocumentNetworkPolicy;
13
- /** Allow this document to initiate file downloads. Only a trusted host may opt in. */
14
- allowDownloads?: boolean;
15
14
  /** Public binding IDs and presentation defaults for this document generation. */
16
15
  context: ArtifactDocumentContext;
17
16
  /** Resolve against saved Bindings on the server with the current user's access; never execute a query definition from HTML. */
@@ -96,13 +96,28 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
96
96
  descriptor?: boolean;
97
97
  shareKey?: string;
98
98
  }>>;
99
- presentation: z.ZodObject<{
100
- mode: z.ZodEnum<["file", "snapshot", "authenticated"]>;
99
+ presentation: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
100
+ mode: z.ZodLiteral<"file">;
101
101
  }, "strict", z.ZodTypeAny, {
102
- mode?: "file" | "authenticated" | "snapshot";
102
+ mode?: "file";
103
103
  }, {
104
- mode?: "file" | "authenticated" | "snapshot";
105
- }>;
104
+ mode?: "file";
105
+ }>, z.ZodObject<{
106
+ mode: z.ZodLiteral<"snapshot">;
107
+ }, "strict", z.ZodTypeAny, {
108
+ mode?: "snapshot";
109
+ }, {
110
+ mode?: "snapshot";
111
+ }>, z.ZodObject<{
112
+ mode: z.ZodLiteral<"authenticated">;
113
+ allowDownloads: z.ZodOptional<z.ZodBoolean>;
114
+ }, "strict", z.ZodTypeAny, {
115
+ mode?: "authenticated";
116
+ allowDownloads?: boolean;
117
+ }, {
118
+ mode?: "authenticated";
119
+ allowDownloads?: boolean;
120
+ }>]>;
106
121
  }, "strict", z.ZodTypeAny, {
107
122
  title?: {
108
123
  en_US?: string;
@@ -118,7 +133,12 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
118
133
  maxBytes?: number;
119
134
  };
120
135
  presentation?: {
121
- mode?: "file" | "authenticated" | "snapshot";
136
+ mode?: "file";
137
+ } | {
138
+ mode?: "snapshot";
139
+ } | {
140
+ mode?: "authenticated";
141
+ allowDownloads?: boolean;
122
142
  };
123
143
  contentTypeId?: string;
124
144
  kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
@@ -162,7 +182,12 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
162
182
  maxBytes?: number;
163
183
  };
164
184
  presentation?: {
165
- mode?: "file" | "authenticated" | "snapshot";
185
+ mode?: "file";
186
+ } | {
187
+ mode?: "snapshot";
188
+ } | {
189
+ mode?: "authenticated";
190
+ allowDownloads?: boolean;
166
191
  };
167
192
  contentTypeId?: string;
168
193
  kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
@@ -199,7 +224,12 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
199
224
  maxBytes?: number;
200
225
  };
201
226
  presentation?: {
202
- mode?: "file" | "authenticated" | "snapshot";
227
+ mode?: "file";
228
+ } | {
229
+ mode?: "snapshot";
230
+ } | {
231
+ mode?: "authenticated";
232
+ allowDownloads?: boolean;
203
233
  };
204
234
  contentTypeId?: string;
205
235
  kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
@@ -243,7 +273,12 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
243
273
  maxBytes?: number;
244
274
  };
245
275
  presentation?: {
246
- mode?: "file" | "authenticated" | "snapshot";
276
+ mode?: "file";
277
+ } | {
278
+ mode?: "snapshot";
279
+ } | {
280
+ mode?: "authenticated";
281
+ allowDownloads?: boolean;
247
282
  };
248
283
  contentTypeId?: string;
249
284
  kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
@@ -280,7 +315,12 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
280
315
  maxBytes?: number;
281
316
  };
282
317
  presentation?: {
283
- mode?: "file" | "authenticated" | "snapshot";
318
+ mode?: "file";
319
+ } | {
320
+ mode?: "snapshot";
321
+ } | {
322
+ mode?: "authenticated";
323
+ allowDownloads?: boolean;
284
324
  };
285
325
  contentTypeId?: string;
286
326
  kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
@@ -324,7 +364,12 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
324
364
  maxBytes?: number;
325
365
  };
326
366
  presentation?: {
327
- mode?: "file" | "authenticated" | "snapshot";
367
+ mode?: "file";
368
+ } | {
369
+ mode?: "snapshot";
370
+ } | {
371
+ mode?: "authenticated";
372
+ allowDownloads?: boolean;
328
373
  };
329
374
  contentTypeId?: string;
330
375
  kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
@@ -1,4 +1,4 @@
1
- import type { ArtifactAccessMode, ArtifactKind, ArtifactLinkVersionMode, ArtifactTypeReference, IArtifactUseGrant, I18nObject, IconDefinition } from '@xpert-ai/contracts';
1
+ import type { ArtifactAccessMode, ArtifactDownloadPolicy, ArtifactKind, ArtifactLinkVersionMode, ArtifactTypeReference, IArtifactUseGrant, I18nObject, IconDefinition } from '@xpert-ai/contracts';
2
2
  import type { ContentOperation } from '../content-resource';
3
3
  import type { ArtifactLinkAccessInput } from '../runtime/capabilities/artifacts';
4
4
  export declare const ARTIFACT_TYPE_PROVIDER = "XPERT_ARTIFACT_TYPE_PROVIDER";
@@ -81,10 +81,15 @@ export interface ArtifactTypeDefinition {
81
81
  mode: 'file';
82
82
  } | {
83
83
  mode: 'snapshot';
84
- } | {
84
+ } | ({
85
85
  mode: 'authenticated';
86
- };
86
+ } & ArtifactDownloadPolicy);
87
87
  }
88
+ /** Use the same trusted download policy for the share and its embedded document. */
89
+ export declare function authenticatedArtifactPresentation({ allowDownloads }: ArtifactDownloadPolicy): {
90
+ readonly mode: "authenticated";
91
+ readonly allowDownloads: boolean;
92
+ };
88
93
  export interface ArtifactSnapshotContext {
89
94
  /** This is the export's scope, not an authenticated principal. */
90
95
  source: ArtifactTypeSource;
@@ -1,5 +1,5 @@
1
1
  import { DiscoveryService, Reflector } from '@nestjs/core';
2
- import type { I18nObject, LanguagesEnum, ModelFeature, TXpertTeamDraft, TXpertTemplate } from '@xpert-ai/contracts';
2
+ import type { AssistantCapabilityToolsetRequirement, I18nObject, LanguagesEnum, ModelFeature, TXpertTeamDraft, TXpertTemplate } from '@xpert-ai/contracts';
3
3
  import { BaseStrategyRegistry } from '../strategy';
4
4
  export { applyAssistantMiddleware, hasAssistantMiddleware } from './middleware';
5
5
  export interface AssistantCapabilityContext {
@@ -20,6 +20,8 @@ export interface IAssistantCapabilityProvider {
20
20
  readonly label: string | I18nObject;
21
21
  readonly description: string | I18nObject;
22
22
  readonly requiredModelFeatures?: ModelFeature[];
23
+ /** Existing workspace connections resolved by the host, outside the pure apply hook. */
24
+ readonly toolsets?: readonly AssistantCapabilityToolsetRequirement[];
23
25
  /** Explicitly opt into the blank Assistant creation flow. */
24
26
  readonly availableForBlankAssistant?: boolean;
25
27
  /** Opt into a simple creation switch; no additional capability-specific configuration is needed. */
@@ -4,6 +4,7 @@ import { BaseStrategyRegistry } from '../strategy';
4
4
  import type { ContentDocumentModel, ContentDocumentScope } from './document';
5
5
  import type { ContentResourceReference, ContentSourceInput } from './index';
6
6
  import type { CollaborationSessionDescriptor } from '../collaboration/types';
7
+ import type { WorkspacePortableFileReference } from '../runtime/capabilities/workspace-files';
7
8
  export { supportsContentModel } from './editor-compatibility';
8
9
  /** File codecs expose no cells, blocks or plugin-specific edit operations to the platform. */
9
10
  export interface ContentFileEditor {
@@ -23,12 +24,20 @@ export declare class ContentEditorRegistry extends BaseStrategyRegistry<IContent
23
24
  constructor(discovery: DiscoveryService, reflector: Reflector);
24
25
  getTextModel(key: string, organizationId: string): ContentDocumentModel;
25
26
  }
26
- export interface ContentEditorFile {
27
+ /** File authority belongs to a Project or a standalone Assistant; at least one identity is required. */
28
+ export type ContentFileScope = ContentDocumentScope | {
29
+ actor: ContentDocumentScope['actor'];
30
+ assistantId: string;
31
+ projectId?: never;
32
+ };
33
+ export type ContentEditorFile = (Omit<ContentDocumentScope, 'actor'> | {
34
+ assistantId: string;
35
+ projectId?: never;
36
+ }) & {
27
37
  editorKey: string;
28
- projectId: string;
29
38
  path: string;
30
39
  title: string;
31
- }
40
+ };
32
41
  /** Resource owner supplies current identity/location and owns atomic versions, independent of format. */
33
42
  export interface ContentResourceEditor {
34
43
  describe(input: ContentSourceInput): Promise<ContentEditorFile>;
@@ -53,7 +62,7 @@ export type ContentEditorInput = ContentDocumentScope & {
53
62
  source: ContentResourceReference;
54
63
  editorKey?: string;
55
64
  };
56
- export type ContentFileEditorInput = ContentDocumentScope & {
65
+ export type ContentFileEditorInput = ContentFileScope & {
57
66
  path: string;
58
67
  editorKey?: string;
59
68
  };
@@ -80,7 +89,7 @@ export interface ContentEditorResolution {
80
89
  };
81
90
  editors?: ResourceContentEditorRegistration[];
82
91
  }
83
- /** Trusted scope only. Every operation checks Project, Assistant binding and resource permissions. */
92
+ /** Trusted scope only. Every operation checks the workspace authority and resource permissions. */
84
93
  export interface ContentEditorsApi {
85
94
  /** Read resource, Project and organization editor preferences, including permission to change each scope. */
86
95
  preferences(input: ContentDocumentScope & {
@@ -105,12 +114,13 @@ export interface ContentEditorsApi {
105
114
  }>;
106
115
  /** Resolve an authorized resource to a compatible editor and host navigation, honoring editor preferences. */
107
116
  resolve(input: ContentEditorInput): Promise<ContentEditorResolution>;
108
- /** Resolve a Project path through its live resource owner, falling back to a file codec only when unmanaged. */
117
+ /** Resolve an authorized workspace path; a resource owner takes precedence over a file codec. */
109
118
  resolveFile(input: ContentFileEditorInput): Promise<ContentEditorResolution>;
110
- /** Read and validate an unmanaged Project file; revision is its current hash. Owned files must use read(). */
119
+ /** Read an authorized unmanaged workspace file; its revision is the current content hash. */
111
120
  readFile(input: ContentFileEditorInput): Promise<ContentEditorResolution & {
112
121
  buffer: Buffer;
113
122
  revision: string;
123
+ reference: WorkspacePortableFileReference;
114
124
  }>;
115
125
  /** Validate and atomically replace an unmanaged file at expectedRevision; reject owned paths and stale hashes. */
116
126
  writeFile(input: ContentFileEditorInput & {
@@ -123,6 +133,7 @@ export interface ContentEditorsApi {
123
133
  read(input: ContentEditorInput): Promise<ContentEditorResolution & {
124
134
  buffer: Buffer;
125
135
  revision: string;
136
+ reference: WorkspacePortableFileReference;
126
137
  sequence?: number;
127
138
  collaboration?: boolean;
128
139
  }>;
@@ -70,6 +70,8 @@ export interface ProjectPipelineAssistantOperation {
70
70
  /** Called after native execution and delegated result delivery settle. Return null only when the
71
71
  * assigned assistant definitively ended without the required outputs. Throw on an uncertain read. */
72
72
  collect(context: ProjectPipelineAssistantContext): Promise<Record<string, ProjectPipelineEvidenceRef> | null>;
73
+ /** Reconcile completed domain evidence for authorized recovery, without new execution or business approvals. */
74
+ reconcile?(context: ProjectPipelineAssistantContext): Promise<Record<string, ProjectPipelineEvidenceRef> | null>;
73
75
  }
74
76
  export interface ProjectPipelineRuntimeContext extends ProjectPipelineOperationContext {
75
77
  executor: {
@@ -92,6 +94,8 @@ export interface ProjectPipelineCompletionEvaluator {
92
94
  export interface ProjectPipelinePolicyEvaluator {
93
95
  /** Pure evaluation: reevaluation after a lost worker must not perform a business write. */
94
96
  evaluate(context: ProjectPipelineOperationContext): Promise<ProjectPipelinePolicyReceipt>;
97
+ /** Candidate notification audience only; it cannot authorize a decision or installation. */
98
+ decisionRecipientRoles?(candidateSelectionKey: string): readonly ProjectPipelineDecisionRecipientRole[];
95
99
  /** Required for human gates. Reauthorize the candidate selector and validate this exact decision. */
96
100
  authorizeDecision?(context: ProjectPipelineOperationContext, input: {
97
101
  candidateSelectionKey: string;
@@ -99,3 +103,11 @@ export interface ProjectPipelinePolicyEvaluator {
99
103
  evidence: ProjectPipelineEvidenceRef[];
100
104
  }): Promise<boolean>;
101
105
  }
106
+ /** Project-scoped human audience. An absent declaration produces no implicit recipients. */
107
+ export type ProjectPipelineDecisionRecipientRole =
108
+ /** The current Project owner; ownership must remain active. */
109
+ 'owner'
110
+ /** Active Project managers; global administration alone is insufficient. */
111
+ | 'manager'
112
+ /** Active Project editors; the decision policy still determines eligible outcomes. */
113
+ | 'editor';
@@ -1,4 +1,4 @@
1
- import type { ProjectPipelineConfiguration, ProjectPipelineConfigurationCheck, ProjectPipelineGraph, ProjectPipelineSummary, ProjectPipelineConfigure, ProjectPipelineStart, ProjectPipelineStartReceipt, ProjectPipelineDecision, ProjectPipelineNextRound, ProjectPipelineEvidenceRef, ProjectPipelineJsonValue, ProjectPipelineCancel, ProjectPipelineRetry, ProjectPipelineRoundSummary, ProjectPipelineCatalog, ProjectPipelineCatalogConfigure, ProjectPipelineSavedConfiguration, ProjectPipelineCatalogRequest, ProjectPipelineProviderActions, ProjectPipelineProviderActionCommand, ProjectPipelineProviderActionView, ProjectPipelineAnalytics, ProjectPipelineAnalyticsInput, ProjectPipelinePortfolio, ProjectPipelinePortfolioInput } from '@xpert-ai/contracts';
1
+ import type { ProjectPipelineConfiguration, ProjectPipelineConfigurationCheck, ProjectPipelineGraph, ProjectPipelineSummary, ProjectPipelineConfigure, ProjectPipelineStart, ProjectPipelineStartReceipt, ProjectPipelineDecision, ProjectPipelineNextRound, ProjectPipelineEvidenceRef, ProjectPipelineJsonValue, ProjectPipelineCancel, ProjectPipelineCancelReceipt, ProjectPipelineRetry, ProjectPipelineRoundSummary, ProjectPipelineCatalog, ProjectPipelineCatalogConfigure, ProjectPipelineSavedConfiguration, ProjectPipelineCatalogRequest, ProjectPipelineProviderActions, ProjectPipelineProviderActionCommand, ProjectPipelineProviderActionView, ProjectPipelineAnalytics, ProjectPipelineAnalyticsInput, ProjectPipelinePortfolio, ProjectPipelinePortfolioInput } from '@xpert-ai/contracts';
2
2
  import type { ProjectAccessActor } from '../runtime/capabilities/project-access';
3
3
  import type { ProjectPipelineProjectionLinks } from './projection';
4
4
  export interface ProjectPipelineContext {
@@ -94,7 +94,7 @@ export interface ProjectPipelineCommandsApi {
94
94
  decisionId: string;
95
95
  }>;
96
96
  nextRound(context: ProjectPipelineContext, request: ProjectPipelineNextRound): Promise<ProjectPipelineStartReceipt>;
97
- cancel(context: ProjectPipelineContext, request: ProjectPipelineCancel): Promise<ProjectPipelineStartReceipt>;
97
+ cancel(context: ProjectPipelineContext, request: ProjectPipelineCancel): Promise<ProjectPipelineCancelReceipt>;
98
98
  retry(context: ProjectPipelineContext, request: ProjectPipelineRetry): Promise<ProjectPipelineStartReceipt>;
99
99
  }
100
100
  export declare const ProjectPipelineCommandsRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelineCommandsApi>;
@@ -29,13 +29,13 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
29
29
  configurations: {
30
30
  schemaVersion: 1;
31
31
  binding: {
32
+ parameters: Record<string, import("packages/contracts/dist/src/ai/project-pipeline/primitives.schema").ProjectPipelineJsonValue>;
32
33
  templateRef: string;
33
34
  roleBindings: Record<string, {
34
35
  kind: "assistant" | "runtime_binding" | "human" | "service";
35
36
  selectionKey: string;
36
37
  requiredCapabilities?: string[] | undefined;
37
38
  }>;
38
- parameters: Record<string, import("packages/contracts/dist/src/ai/project-pipeline/primitives.schema").ProjectPipelineJsonValue>;
39
39
  executorBindings?: Record<string, {
40
40
  kind: "assistant" | "runtime_binding" | "human" | "service";
41
41
  roleKey: string;
@@ -413,7 +413,6 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
413
413
  outputs: Record<string, string>;
414
414
  })[];
415
415
  forms?: {
416
- templateRef: string;
417
416
  parameters: ({
418
417
  key: string;
419
418
  type: "boolean";
@@ -503,6 +502,7 @@ export declare class ProjectPipelineContributionRegistry extends BaseStrategyReg
503
502
  zh_Hans?: string | undefined;
504
503
  } | undefined;
505
504
  })[];
505
+ templateRef: string;
506
506
  description: {
507
507
  en_US: string;
508
508
  zh_Hans?: string | undefined;
@@ -1,8 +1,7 @@
1
1
  import { DiscoveryService, Reflector } from '@nestjs/core';
2
2
  import type { StrategySource } from '../strategy';
3
- import type { ProjectAccessActor } from '../runtime/capabilities/project-access';
4
3
  import type { ProjectPipelineSubjectResolver, ProjectPipelineEvidenceResolver, ProjectPipelineNodeHandler, ProjectPipelineCompletionEvaluator, ProjectPipelinePolicyEvaluator, ProjectPipelineValueSchema, ProjectPipelineAssistantOperation, ProjectPipelineResourceResolver, ProjectPipelineRuntimeOperation } from './adapters';
5
- import { ProjectPipelineScopedRegistry } from './scoped-registry';
4
+ import { ProjectPipelineScopedRegistry, type ProjectPipelineRegistryScope } from './scoped-registry';
6
5
  export type ProjectPipelineRuntimeAdapter = ({
7
6
  kind: 'schema';
8
7
  ref: string;
@@ -39,7 +38,7 @@ export declare const ProjectPipelineRuntimeAdapterProvider: (kind: ProjectPipeli
39
38
  export declare class ProjectPipelineRuntimeAdapterRegistry extends ProjectPipelineScopedRegistry<ProjectPipelineRuntimeAdapter> {
40
39
  constructor(discovery: DiscoveryService, reflector: Reflector);
41
40
  register(key: string, adapter: ProjectPipelineRuntimeAdapter, source: StrategySource): ProjectPipelineRuntimeAdapter;
42
- resolve<K extends ProjectPipelineRuntimeAdapter['kind']>(kind: K, ref: string, actor: ProjectAccessActor): Extract<ProjectPipelineRuntimeAdapter, {
41
+ resolve<K extends ProjectPipelineRuntimeAdapter['kind']>(kind: K, ref: string, actor: ProjectPipelineRegistryScope): Extract<ProjectPipelineRuntimeAdapter, {
43
42
  kind: K;
44
43
  }>;
45
44
  }
@@ -1,10 +1,12 @@
1
1
  import { BaseStrategyRegistry, type StrategySource } from '../strategy';
2
2
  import type { ProjectAccessActor } from '../runtime/capabilities/project-access';
3
- export declare function pipelineActorScopeKeys(actor: ProjectAccessActor): string[];
3
+ /** Registration visibility only; resolving an adapter grants no execution authority. */
4
+ export type ProjectPipelineRegistryScope = Pick<ProjectAccessActor, 'tenantId' | 'organizationId'>;
5
+ export declare function pipelineActorScopeKeys(actor: ProjectPipelineRegistryScope): string[];
4
6
  /** Public capabilities resolve from their explicit, authorized actor, never another ambient request. */
5
7
  export declare abstract class ProjectPipelineScopedRegistry<T> extends BaseStrategyRegistry<T> {
6
8
  assertCanRegister(key: string, instance: T, source: StrategySource): void;
7
9
  upsert(instance: unknown): void;
8
10
  listForActor(actor: ProjectAccessActor): T[];
9
- getForActor(key: string, actor: ProjectAccessActor): T;
11
+ getForActor(key: string, actor: ProjectPipelineRegistryScope): T;
10
12
  }