@xpert-ai/plugin-sdk 3.15.2 → 3.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @xpert-ai/plugin-sdk
|
|
2
2
|
|
|
3
|
+
## 3.15.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 693806f: workspace files
|
|
8
|
+
- Updated dependencies [693806f]
|
|
9
|
+
- @xpert-ai/contracts@3.15.5
|
|
10
|
+
|
|
11
|
+
## 3.15.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- bdcb73b: handoff messages
|
|
16
|
+
- Updated dependencies [bdcb73b]
|
|
17
|
+
- @xpert-ai/contracts@3.15.4
|
|
18
|
+
|
|
3
19
|
## 3.15.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/index.cjs.js
CHANGED
|
@@ -2767,6 +2767,7 @@ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platfor
|
|
|
2767
2767
|
description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
|
|
2768
2768
|
});
|
|
2769
2769
|
|
|
2770
|
+
/** Stable source identifier for portable workspace file references. */ const WORKSPACE_FILES_SOURCE = 'platform.workspace.files';
|
|
2770
2771
|
const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
|
|
2771
2772
|
description: 'Upload, understand, read, and delete raw files in Xpert workspace volumes.'
|
|
2772
2773
|
});
|
|
@@ -4742,6 +4743,7 @@ exports.VectorStoreStrategy = VectorStoreStrategy;
|
|
|
4742
4743
|
exports.ViewExtensionProvider = ViewExtensionProvider;
|
|
4743
4744
|
exports.WORKFLOW_NODE_STRATEGY = WORKFLOW_NODE_STRATEGY;
|
|
4744
4745
|
exports.WORKFLOW_TRIGGER_STRATEGY = WORKFLOW_TRIGGER_STRATEGY;
|
|
4746
|
+
exports.WORKSPACE_FILES_SOURCE = WORKSPACE_FILES_SOURCE;
|
|
4745
4747
|
exports.WorkflowNodeStrategy = WorkflowNodeStrategy;
|
|
4746
4748
|
exports.WorkflowTriggerStrategy = WorkflowTriggerStrategy;
|
|
4747
4749
|
exports.WorkspaceFilesRuntimeCapability = WorkspaceFilesRuntimeCapability;
|
package/index.esm.js
CHANGED
|
@@ -2747,6 +2747,7 @@ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platfor
|
|
|
2747
2747
|
description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
|
|
2748
2748
|
});
|
|
2749
2749
|
|
|
2750
|
+
/** Stable source identifier for portable workspace file references. */ const WORKSPACE_FILES_SOURCE = 'platform.workspace.files';
|
|
2750
2751
|
const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
|
|
2751
2752
|
description: 'Upload, understand, read, and delete raw files in Xpert workspace volumes.'
|
|
2752
2753
|
});
|
|
@@ -4587,4 +4588,4 @@ function escapeHtmlAttribute(value) {
|
|
|
4587
4588
|
|
|
4588
4589
|
const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
|
|
4589
4590
|
|
|
4590
|
-
export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CONNECTION_COMMAND_ROUTER_TOKEN, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, 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, DefaultRuntimeCapabilityRegistry as DefaultAgentMiddlewareRuntimeCapabilityRegistry, DefaultRuntimeCapabilityRegistry, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, 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, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KNOWLEDGE_STRATEGY, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, 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, PluginJobProcessor, PluginWebhookAuth, PluginWebhookAuthGuard, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, 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, 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, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, renderRemoteReactIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveTenantGlobalScopeKey, runWithRequestContext, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage };
|
|
4591
|
+
export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CONNECTION_COMMAND_ROUTER_TOKEN, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, 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, DefaultRuntimeCapabilityRegistry as DefaultAgentMiddlewareRuntimeCapabilityRegistry, DefaultRuntimeCapabilityRegistry, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, 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, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KNOWLEDGE_STRATEGY, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, 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, PluginJobProcessor, PluginWebhookAuth, PluginWebhookAuthGuard, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, 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, 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, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WORKSPACE_FILES_SOURCE, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, renderRemoteReactIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveTenantGlobalScopeKey, runWithRequestContext, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage };
|
package/package.json
CHANGED
|
@@ -79,6 +79,8 @@ export interface HandoffMessageHeaders extends Record<string, string> {
|
|
|
79
79
|
source?: RunSource;
|
|
80
80
|
requestedLane?: LaneName;
|
|
81
81
|
integrationId?: string;
|
|
82
|
+
policyTimeoutMs?: string;
|
|
83
|
+
policyIdleTimeoutMs?: string;
|
|
82
84
|
}
|
|
83
85
|
/**
|
|
84
86
|
* Processor execution policy: declared by the Processor, executed uniformly by the Dispatcher.
|
|
@@ -86,11 +88,14 @@ export interface HandoffMessageHeaders extends Record<string, string> {
|
|
|
86
88
|
export interface ProcessorPolicy {
|
|
87
89
|
lane: LaneName;
|
|
88
90
|
timeoutMs?: number;
|
|
91
|
+
idleTimeoutMs?: number;
|
|
89
92
|
}
|
|
90
93
|
export interface ProcessContext {
|
|
91
94
|
runId: string;
|
|
92
95
|
traceId: string;
|
|
93
96
|
abortSignal: AbortSignal;
|
|
97
|
+
heartbeat?: (reason?: string) => void;
|
|
98
|
+
getAbortReason?: () => string | undefined;
|
|
94
99
|
/**
|
|
95
100
|
* Optional local-process event channel for queue waiters (e.g. SSE connection awaiting this message).
|
|
96
101
|
* This is intentionally process-local and best-effort.
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
/** Logical workspace volume catalog supported by plugin-facing file APIs. */
|
|
1
2
|
export type WorkspaceFileCatalog = 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts';
|
|
3
|
+
/** Stable source identifier for portable workspace file references. */
|
|
4
|
+
export declare const WORKSPACE_FILES_SOURCE: "platform.workspace.files";
|
|
5
|
+
/**
|
|
6
|
+
* Scope fields used to resolve a workspace Volume.
|
|
7
|
+
*
|
|
8
|
+
* Explicit APIs can provide catalog plus the matching id directly. Runtime-aware
|
|
9
|
+
* APIs usually receive these fields from the current Agent execution context.
|
|
10
|
+
*/
|
|
2
11
|
export type WorkspaceFileScope = {
|
|
3
12
|
tenantId?: string | null;
|
|
4
13
|
userId?: string | null;
|
|
@@ -10,6 +19,12 @@ export type WorkspaceFileScope = {
|
|
|
10
19
|
xpertId?: string | null;
|
|
11
20
|
isolateByUser?: boolean | null;
|
|
12
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Input for uploading raw bytes into an explicitly scoped workspace Volume.
|
|
24
|
+
*
|
|
25
|
+
* Use `writeRuntimeBuffer()` instead when a plugin writes into the current Agent
|
|
26
|
+
* runtime workspace and wants the platform to infer project/Xpert scope.
|
|
27
|
+
*/
|
|
13
28
|
export type WorkspaceUploadBufferInput = WorkspaceFileScope & {
|
|
14
29
|
buffer: Buffer;
|
|
15
30
|
originalName: string;
|
|
@@ -19,9 +34,54 @@ export type WorkspaceUploadBufferInput = WorkspaceFileScope & {
|
|
|
19
34
|
fileName?: string | null;
|
|
20
35
|
metadata?: Record<string, unknown>;
|
|
21
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Scoped reference to an existing workspace file.
|
|
39
|
+
*
|
|
40
|
+
* `filePath` is always a Volume-relative path, not a sandbox absolute path such
|
|
41
|
+
* as `/workspace/...` and not a host/API-process filesystem path.
|
|
42
|
+
*/
|
|
22
43
|
export type WorkspaceFileReference = WorkspaceFileScope & {
|
|
23
44
|
filePath: string;
|
|
24
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Agent-facing locator for a file in the current runtime workspace.
|
|
48
|
+
*
|
|
49
|
+
* Callers may provide sandbox paths such as `/workspace/report.docx`,
|
|
50
|
+
* workspace-relative paths such as `report.docx`, or metadata aliases commonly
|
|
51
|
+
* produced by tool calls.
|
|
52
|
+
*/
|
|
53
|
+
export type WorkspaceRuntimeFileDescriptor = {
|
|
54
|
+
path?: string | null;
|
|
55
|
+
filePath?: string | null;
|
|
56
|
+
workspacePath?: string | null;
|
|
57
|
+
originalName?: string | null;
|
|
58
|
+
name?: string | null;
|
|
59
|
+
mimeType?: string | null;
|
|
60
|
+
mimetype?: string | null;
|
|
61
|
+
size?: number | null;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Persistable workspace file reference produced by the platform.
|
|
65
|
+
*
|
|
66
|
+
* Unlike a sandbox absolute path, this reference carries enough scope metadata
|
|
67
|
+
* to read the same file later from queues, callbacks, or async jobs.
|
|
68
|
+
*/
|
|
69
|
+
export type WorkspacePortableFileReference = WorkspaceFileReference & {
|
|
70
|
+
source: typeof WORKSPACE_FILES_SOURCE;
|
|
71
|
+
workspacePath: string;
|
|
72
|
+
originalName?: string | null;
|
|
73
|
+
name?: string | null;
|
|
74
|
+
mimeType?: string | null;
|
|
75
|
+
size?: number | null;
|
|
76
|
+
};
|
|
77
|
+
/** Input accepted by runtime-aware workspace file APIs. */
|
|
78
|
+
export type WorkspaceFileLocator = string | WorkspaceRuntimeFileDescriptor | WorkspacePortableFileReference;
|
|
79
|
+
/**
|
|
80
|
+
* Metadata returned by workspace file operations.
|
|
81
|
+
*
|
|
82
|
+
* `filePath` is the stable Volume-relative path. `workspacePath` is the
|
|
83
|
+
* runtime/sandbox-facing path when one is available.
|
|
84
|
+
*/
|
|
25
85
|
export type WorkspaceFile = {
|
|
26
86
|
name: string;
|
|
27
87
|
filePath: string;
|
|
@@ -34,9 +94,34 @@ export type WorkspaceFile = {
|
|
|
34
94
|
scopeId?: string;
|
|
35
95
|
metadata?: Record<string, unknown>;
|
|
36
96
|
};
|
|
97
|
+
/** Workspace file metadata plus raw file bytes. */
|
|
37
98
|
export type WorkspaceFileBuffer = WorkspaceFile & {
|
|
38
99
|
buffer: Buffer;
|
|
39
100
|
};
|
|
101
|
+
/** Workspace file bytes plus the portable reference used to retrieve them. */
|
|
102
|
+
export type WorkspaceRuntimeFileBuffer = WorkspaceFileBuffer & {
|
|
103
|
+
reference: WorkspacePortableFileReference;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Runtime-aware write input for bytes created by tools or plugins.
|
|
107
|
+
*
|
|
108
|
+
* If a path is provided, it is interpreted as a workspace path in the scoped
|
|
109
|
+
* runtime, not as a host/API-process filesystem path.
|
|
110
|
+
*/
|
|
111
|
+
export type WorkspaceRuntimeWriteInput = WorkspaceFileScope & WorkspaceRuntimeFileDescriptor & {
|
|
112
|
+
buffer: Buffer;
|
|
113
|
+
originalName?: string | null;
|
|
114
|
+
folder?: string | null;
|
|
115
|
+
fileName?: string | null;
|
|
116
|
+
metadata?: Record<string, unknown>;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Input for registering an existing workspace file with the file-understanding
|
|
120
|
+
* pipeline.
|
|
121
|
+
*
|
|
122
|
+
* The file must already exist in the scoped workspace Volume identified by
|
|
123
|
+
* `filePath` and the scope fields.
|
|
124
|
+
*/
|
|
40
125
|
export type WorkspaceUnderstandFileInput = WorkspaceFileReference & {
|
|
41
126
|
originalName?: string | null;
|
|
42
127
|
mimeType?: string | null;
|
|
@@ -52,6 +137,7 @@ export type WorkspaceUnderstandFileInput = WorkspaceFileReference & {
|
|
|
52
137
|
metadata?: Record<string, unknown>;
|
|
53
138
|
runInline?: boolean | null;
|
|
54
139
|
};
|
|
140
|
+
/** File-understanding asset metadata created from a workspace file. */
|
|
55
141
|
export type WorkspaceUnderstoodFile = WorkspaceFile & {
|
|
56
142
|
id: string;
|
|
57
143
|
fileId: string;
|
|
@@ -65,10 +151,37 @@ export type WorkspaceUnderstoodFile = WorkspaceFile & {
|
|
|
65
151
|
capabilities?: string[];
|
|
66
152
|
summary?: string;
|
|
67
153
|
};
|
|
154
|
+
/**
|
|
155
|
+
* Runtime capability contract for reading, writing, uploading, deleting, and
|
|
156
|
+
* understanding files in Xpert workspace Volumes.
|
|
157
|
+
*/
|
|
68
158
|
export interface WorkspaceFilesApi {
|
|
159
|
+
/** Upload raw bytes into an explicitly scoped workspace Volume. */
|
|
69
160
|
uploadBuffer(input: WorkspaceUploadBufferInput): Promise<WorkspaceFile>;
|
|
161
|
+
/** Register an existing workspace file with the platform understanding pipeline. */
|
|
70
162
|
understandFile(input: WorkspaceUnderstandFileInput): Promise<WorkspaceUnderstoodFile>;
|
|
163
|
+
/** Read raw bytes from an explicitly scoped workspace file reference. */
|
|
71
164
|
readBuffer(input: WorkspaceFileReference): Promise<WorkspaceFileBuffer>;
|
|
165
|
+
/** Delete an explicitly scoped workspace file. */
|
|
72
166
|
deleteFile(input: WorkspaceFileReference): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Normalize a runtime locator into a portable, scope-aware reference without
|
|
169
|
+
* reading the file bytes.
|
|
170
|
+
*/
|
|
171
|
+
resolveRuntimeReference(input: WorkspaceFileLocator): Promise<WorkspacePortableFileReference>;
|
|
172
|
+
/**
|
|
173
|
+
* Read bytes from a runtime locator using the current Agent workspace scope.
|
|
174
|
+
*
|
|
175
|
+
* This is the preferred API for plugin tools that receive `/workspace/...`
|
|
176
|
+
* paths from sandbox commands.
|
|
177
|
+
*/
|
|
178
|
+
readRuntimeBuffer(input: WorkspaceFileLocator): Promise<WorkspaceRuntimeFileBuffer>;
|
|
179
|
+
/**
|
|
180
|
+
* Write bytes into the current runtime workspace and return a portable
|
|
181
|
+
* reference suitable for delayed processing or queue retries.
|
|
182
|
+
*/
|
|
183
|
+
writeRuntimeBuffer(input: WorkspaceRuntimeWriteInput): Promise<WorkspaceFile & {
|
|
184
|
+
reference: WorkspacePortableFileReference;
|
|
185
|
+
}>;
|
|
73
186
|
}
|
|
74
187
|
export declare const WorkspaceFilesRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<WorkspaceFilesApi>;
|