@xpert-ai/plugin-sdk 3.9.0-beta.3 → 3.9.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.
- package/CHANGELOG.md +9 -2
- package/index.cjs.js +19 -3
- package/index.esm.js +18 -4
- package/package.json +1 -1
- package/src/lib/agent/middleware/strategy.interface.d.ts +1 -0
- package/src/lib/sandbox/index.d.ts +1 -0
- package/src/lib/sandbox/sandbox.interface.d.ts +26 -0
- package/src/lib/sandbox/terminal.d.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# @xpert-ai/plugin-sdk
|
|
2
2
|
|
|
3
|
-
## 3.9.0
|
|
3
|
+
## 3.9.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 4dcf5b5: add sso in plugin sdk
|
|
8
|
+
- 7fff870: beta 2
|
|
9
|
+
- c76facd: beta v
|
|
10
|
+
- 5b5c8ef: Updates
|
|
8
11
|
- Updated dependencies [4dcf5b5]
|
|
9
|
-
|
|
12
|
+
- Updated dependencies [7fff870]
|
|
13
|
+
- Updated dependencies [c76facd]
|
|
14
|
+
- Updated dependencies [5b5c8ef]
|
|
15
|
+
- @xpert-ai/contracts@3.9.0
|
|
16
|
+
- @xpert-ai/ocap-core@3.9.0
|
|
10
17
|
|
|
11
18
|
## 3.9.0-beta.2
|
|
12
19
|
|
package/index.cjs.js
CHANGED
|
@@ -2944,14 +2944,14 @@ function resolveSandboxExecutionOptions(options, defaults = DEFAULT_SANDBOX_SHEL
|
|
|
2944
2944
|
*
|
|
2945
2945
|
* @param backend - Backend instance to check
|
|
2946
2946
|
* @returns True if the backend implements SandboxBackendProtocol
|
|
2947
|
-
*/ function isObjectLike(value) {
|
|
2947
|
+
*/ function isObjectLike$1(value) {
|
|
2948
2948
|
return typeof value === 'object' && value !== null;
|
|
2949
2949
|
}
|
|
2950
2950
|
function isSandboxBackend(backend) {
|
|
2951
|
-
return isObjectLike(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
|
|
2951
|
+
return isObjectLike$1(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
|
|
2952
2952
|
}
|
|
2953
2953
|
function resolveSandboxBackend(sandbox) {
|
|
2954
|
-
if (!isObjectLike(sandbox)) {
|
|
2954
|
+
if (!isObjectLike$1(sandbox)) {
|
|
2955
2955
|
return null;
|
|
2956
2956
|
}
|
|
2957
2957
|
const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
|
|
@@ -3880,6 +3880,20 @@ exports.SandboxProviderRegistry = __decorate([
|
|
|
3880
3880
|
])
|
|
3881
3881
|
], exports.SandboxProviderRegistry);
|
|
3882
3882
|
|
|
3883
|
+
function isObjectLike(value) {
|
|
3884
|
+
return typeof value === 'object' && value !== null;
|
|
3885
|
+
}
|
|
3886
|
+
function isSandboxTerminalAdapter(value) {
|
|
3887
|
+
return isObjectLike(value) && typeof Reflect.get(value, 'open') === 'function';
|
|
3888
|
+
}
|
|
3889
|
+
function resolveSandboxTerminalAdapter(sandbox) {
|
|
3890
|
+
if (!isObjectLike(sandbox)) {
|
|
3891
|
+
return null;
|
|
3892
|
+
}
|
|
3893
|
+
const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
|
|
3894
|
+
return isSandboxTerminalAdapter(candidate) ? candidate : null;
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3883
3897
|
const VIEW_EXTENSION_PROVIDER = 'VIEW_EXTENSION_PROVIDER';
|
|
3884
3898
|
const ViewExtensionProvider = (providerKey)=>common.applyDecorators(common.SetMetadata(VIEW_EXTENSION_PROVIDER, providerKey), common.SetMetadata(STRATEGY_META_KEY, VIEW_EXTENSION_PROVIDER));
|
|
3885
3899
|
|
|
@@ -4052,6 +4066,7 @@ exports.getRequestContext = getRequestContext;
|
|
|
4052
4066
|
exports.getRequiredPermissionOperation = getRequiredPermissionOperation;
|
|
4053
4067
|
exports.isRemoteFile = isRemoteFile;
|
|
4054
4068
|
exports.isSandboxBackend = isSandboxBackend;
|
|
4069
|
+
exports.isSandboxTerminalAdapter = isSandboxTerminalAdapter;
|
|
4055
4070
|
exports.isStructuredMessageType = isStructuredMessageType;
|
|
4056
4071
|
exports.loadYamlFile = loadYamlFile;
|
|
4057
4072
|
exports.mergeCredentials = mergeCredentials;
|
|
@@ -4059,6 +4074,7 @@ exports.mergeParentChildChunks = mergeParentChildChunks;
|
|
|
4059
4074
|
exports.normalizeContextSize = normalizeContextSize;
|
|
4060
4075
|
exports.resolveSandboxBackend = resolveSandboxBackend;
|
|
4061
4076
|
exports.resolveSandboxExecutionOptions = resolveSandboxExecutionOptions;
|
|
4077
|
+
exports.resolveSandboxTerminalAdapter = resolveSandboxTerminalAdapter;
|
|
4062
4078
|
exports.runWithRequestContext = runWithRequestContext;
|
|
4063
4079
|
exports.secondsToMilliseconds = secondsToMilliseconds;
|
|
4064
4080
|
exports.sumTokenUsage = sumTokenUsage;
|
package/index.esm.js
CHANGED
|
@@ -2923,14 +2923,14 @@ function resolveSandboxExecutionOptions(options, defaults = DEFAULT_SANDBOX_SHEL
|
|
|
2923
2923
|
*
|
|
2924
2924
|
* @param backend - Backend instance to check
|
|
2925
2925
|
* @returns True if the backend implements SandboxBackendProtocol
|
|
2926
|
-
*/ function isObjectLike(value) {
|
|
2926
|
+
*/ function isObjectLike$1(value) {
|
|
2927
2927
|
return typeof value === 'object' && value !== null;
|
|
2928
2928
|
}
|
|
2929
2929
|
function isSandboxBackend(backend) {
|
|
2930
|
-
return isObjectLike(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
|
|
2930
|
+
return isObjectLike$1(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
|
|
2931
2931
|
}
|
|
2932
2932
|
function resolveSandboxBackend(sandbox) {
|
|
2933
|
-
if (!isObjectLike(sandbox)) {
|
|
2933
|
+
if (!isObjectLike$1(sandbox)) {
|
|
2934
2934
|
return null;
|
|
2935
2935
|
}
|
|
2936
2936
|
const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
|
|
@@ -3859,6 +3859,20 @@ SandboxProviderRegistry = __decorate([
|
|
|
3859
3859
|
])
|
|
3860
3860
|
], SandboxProviderRegistry);
|
|
3861
3861
|
|
|
3862
|
+
function isObjectLike(value) {
|
|
3863
|
+
return typeof value === 'object' && value !== null;
|
|
3864
|
+
}
|
|
3865
|
+
function isSandboxTerminalAdapter(value) {
|
|
3866
|
+
return isObjectLike(value) && typeof Reflect.get(value, 'open') === 'function';
|
|
3867
|
+
}
|
|
3868
|
+
function resolveSandboxTerminalAdapter(sandbox) {
|
|
3869
|
+
if (!isObjectLike(sandbox)) {
|
|
3870
|
+
return null;
|
|
3871
|
+
}
|
|
3872
|
+
const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
|
|
3873
|
+
return isSandboxTerminalAdapter(candidate) ? candidate : null;
|
|
3874
|
+
}
|
|
3875
|
+
|
|
3862
3876
|
const VIEW_EXTENSION_PROVIDER = 'VIEW_EXTENSION_PROVIDER';
|
|
3863
3877
|
const ViewExtensionProvider = (providerKey)=>applyDecorators(SetMetadata(VIEW_EXTENSION_PROVIDER, providerKey), SetMetadata(STRATEGY_META_KEY, VIEW_EXTENSION_PROVIDER));
|
|
3864
3878
|
|
|
@@ -3899,4 +3913,4 @@ ViewExtensionProviderRegistry = __decorate([
|
|
|
3899
3913
|
|
|
3900
3914
|
const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
|
|
3901
3915
|
|
|
3902
|
-
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, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, 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, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, 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, LLMUsage, LargeLanguageModel, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_METADATA, PLUGIN_METADATA_KEY, 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, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, 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, WrapWorkflowNodeExecutionCommand, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, resolveSandboxBackend, resolveSandboxExecutionOptions, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
|
|
3916
|
+
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, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, 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, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, 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, LLMUsage, LargeLanguageModel, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_METADATA, PLUGIN_METADATA_KEY, 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, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, 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, WrapWorkflowNodeExecutionCommand, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isSandboxTerminalAdapter, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxTerminalAdapter, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ export * from './sandbox';
|
|
|
4
4
|
export * from './sandbox.decorator';
|
|
5
5
|
export * from './sandbox.interface';
|
|
6
6
|
export * from './sandbox.registry';
|
|
7
|
+
export * from './terminal';
|
|
7
8
|
export * from './sandbox.interface';
|
|
8
9
|
export * from './sandbox.decorator';
|
|
9
10
|
export * from './sandbox.registry';
|
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
import { TSandboxProviderMeta, TSandboxWorkForType } from '@xpert-ai/contracts';
|
|
2
2
|
import { SandboxBackendProtocol } from './protocol';
|
|
3
|
+
export type SandboxWorkspaceBinding = {
|
|
4
|
+
/**
|
|
5
|
+
* Host-side bind source used by containerized sandboxes.
|
|
6
|
+
*/
|
|
7
|
+
bindSource?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Mount target inside the sandbox container, such as `/workspace`.
|
|
10
|
+
*/
|
|
11
|
+
containerMountPath?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Server-visible canonical volume root.
|
|
14
|
+
*/
|
|
15
|
+
volumeRoot: string;
|
|
16
|
+
/**
|
|
17
|
+
* Concrete sandbox-visible working path derived from the mapped workspace root.
|
|
18
|
+
*/
|
|
19
|
+
workspacePath: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sandbox-visible workspace root that corresponds to `volumeRoot`.
|
|
22
|
+
*/
|
|
23
|
+
workspaceRoot: string;
|
|
24
|
+
};
|
|
3
25
|
export type SandboxProviderCreateOptions = {
|
|
4
26
|
/**
|
|
5
27
|
* Working space directory for the sandbox instance
|
|
6
28
|
*/
|
|
7
29
|
workingDirectory?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Explicit mapping between the server-visible volume root and the sandbox-visible workspace root.
|
|
32
|
+
*/
|
|
33
|
+
workspaceBinding?: SandboxWorkspaceBinding;
|
|
8
34
|
/**
|
|
9
35
|
* Canonical sandbox environment identifier that owns the container lifecycle.
|
|
10
36
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TSandboxConfigurable } from '@xpert-ai/contracts';
|
|
2
|
+
import type { MaybePromise } from './protocol';
|
|
3
|
+
export type SandboxTerminalExit = {
|
|
4
|
+
exitCode: number | null;
|
|
5
|
+
signal?: number | null;
|
|
6
|
+
};
|
|
7
|
+
export type SandboxTerminalOpenOptions = {
|
|
8
|
+
cols: number;
|
|
9
|
+
rows: number;
|
|
10
|
+
onExit: (event: SandboxTerminalExit) => void;
|
|
11
|
+
onOutput: (data: string) => void;
|
|
12
|
+
};
|
|
13
|
+
export interface SandboxTerminalSession {
|
|
14
|
+
close(): MaybePromise<void>;
|
|
15
|
+
resize(cols: number, rows: number): MaybePromise<void>;
|
|
16
|
+
write(data: string): MaybePromise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface SandboxTerminalAdapter {
|
|
19
|
+
open(options: SandboxTerminalOpenOptions): MaybePromise<SandboxTerminalSession>;
|
|
20
|
+
}
|
|
21
|
+
export declare function isSandboxTerminalAdapter(value: unknown): value is SandboxTerminalAdapter;
|
|
22
|
+
export declare function resolveSandboxTerminalAdapter(sandbox: TSandboxConfigurable | SandboxTerminalAdapter | null | undefined | unknown): SandboxTerminalAdapter | null;
|