@xpert-ai/plugin-sdk 3.19.0 → 3.21.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 +124 -0
- package/README.md +55 -0
- package/RESOURCE-CARDS-VALIDATION.md +51 -0
- package/RESOURCE-CARDS.md +361 -0
- package/TOOL-IMAGES.md +85 -0
- package/agent-results.cjs.default.js +1 -0
- package/agent-results.cjs.js +20 -0
- package/agent-results.cjs.mjs +2 -0
- package/agent-results.d.ts +1 -0
- package/agent-results.esm.js +4 -0
- package/index.cjs.js +494 -115
- package/index.esm.js +444 -114
- package/model-provider.cjs.js +45 -68
- package/model-provider.esm.js +46 -64
- package/package.json +8 -2
- package/results.cjs.js +50 -0
- package/results.esm.js +46 -0
- package/src/agent-results.d.ts +2 -0
- package/src/index.d.ts +3 -0
- package/src/lib/agent/handoff/agent-chat.contract.d.ts +10 -1
- package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +319 -0
- package/src/lib/agent/handoff/index.d.ts +1 -0
- package/src/lib/agent/index.d.ts +1 -0
- package/src/lib/agent/middleware/index.d.ts +1 -0
- package/src/lib/agent/middleware/model-requirements.d.ts +9 -0
- package/src/lib/agent/middleware/strategy.interface.d.ts +4 -0
- package/src/lib/agent/middleware/types.d.ts +7 -0
- package/src/lib/agent/resource-card.d.ts +3 -0
- package/src/lib/agent/runtime/activity.d.ts +6 -0
- package/src/lib/agent/runtime/capability.d.ts +13 -5
- package/src/lib/agent/runtime/cli-model-profile.d.ts +62 -0
- package/src/lib/agent/runtime/dispatch.d.ts +517 -0
- package/src/lib/agent/runtime/execution-runner.d.ts +66 -0
- package/src/lib/agent/runtime/index.d.ts +7 -0
- package/src/lib/agent/runtime/model-execution.d.ts +15 -0
- package/src/lib/agent/runtime/results.d.ts +335 -0
- package/src/lib/agent/runtime/strategy.d.ts +3 -0
- package/src/lib/agent/runtime/task-wait.d.ts +35 -0
- package/src/lib/agent/runtime/types.d.ts +35 -11
- package/src/lib/agent-plugin/import-default-agent-plugins.command.d.ts +6 -0
- package/src/lib/ai-model/ai-model-provider.interface.d.ts +2 -0
- package/src/lib/ai-model/ai-model.d.ts +2 -0
- package/src/lib/ai-model/index.d.ts +3 -0
- package/src/lib/ai-model/llm.d.ts +4 -2
- package/src/lib/ai-model/native-model.d.ts +22 -0
- package/src/lib/ai-model/realtime.d.ts +36 -0
- package/src/lib/ai-model/token-usage.d.ts +13 -0
- package/src/lib/core/context/request-context.d.ts +1 -0
- package/src/lib/mcp/app.d.ts +4 -1
- package/src/lib/project-task/index.d.ts +8 -1
- package/src/lib/project-type/index.d.ts +8 -1
- package/src/lib/rag/capability/index.d.ts +5 -0
- package/src/lib/{runtime/capabilities → rag/capability}/knowledge-document-visual-assets.d.ts +2 -2
- package/src/lib/rag/capability/knowledge-upload-sessions.d.ts +71 -0
- package/src/lib/{runtime/capabilities → rag/capability}/knowledgebase-documents.d.ts +9 -1
- package/src/lib/{runtime/capabilities → rag/capability}/knowledgebase.d.ts +4 -0
- package/src/lib/rag/index.d.ts +1 -0
- package/src/lib/resource-card-provider/index.d.ts +3 -0
- package/src/lib/resource-card-provider/provider.decorator.d.ts +4 -0
- package/src/lib/resource-card-provider/provider.registry.d.ts +14 -0
- package/src/lib/resource-card-provider/types.d.ts +36 -0
- package/src/lib/resource-card.d.ts +6 -0
- package/src/lib/runtime/capabilities/index.d.ts +1 -4
- package/src/lib/runtime/capabilities/project-provisioning.d.ts +10 -0
- package/src/lib/runtime/capabilities/tool-images.d.ts +24 -0
- package/src/lib/runtime/capabilities/workspace-files.d.ts +8 -2
- package/src/lib/sandbox/execution-environment.d.ts +2 -0
- package/src/lib/sandbox/execution.d.ts +10 -0
- package/src/lib/sandbox/managed-service.d.ts +1 -0
- /package/src/lib/{runtime/capabilities → rag/capability}/knowledge-graph.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
2
|
-
import type { ProjectTaskGraph, ProjectTaskGraphChange, ProjectTaskExecutionTarget, TXpertProjectTaskStatus } from '@xpert-ai/contracts';
|
|
2
|
+
import type { ProjectTaskGraph, ProjectTaskGraphChange, ProjectTaskExecutionTarget, ProjectTaskTypeDefinition, TXpertProjectTaskStatus } from '@xpert-ai/contracts';
|
|
3
3
|
import { BaseStrategyRegistry } from '../strategy';
|
|
4
4
|
import type { ProjectAccessActor } from '../runtime/capabilities/project-access';
|
|
5
5
|
export interface ProjectTaskContext {
|
|
@@ -10,7 +10,11 @@ export interface ProjectTaskProjection {
|
|
|
10
10
|
key: string;
|
|
11
11
|
title: string;
|
|
12
12
|
status: TXpertProjectTaskStatus;
|
|
13
|
+
/** Completion percentage (0–100), independent of status. Omit to preserve; null clears it. */
|
|
14
|
+
progress?: number | null;
|
|
13
15
|
kind: 'task' | 'summary' | 'milestone';
|
|
16
|
+
/** Registered business type; omitted values preserve legacy persisted types. Null explicitly clears it. */
|
|
17
|
+
taskType?: string | null;
|
|
14
18
|
parentKey?: string;
|
|
15
19
|
predecessorKeys: string[];
|
|
16
20
|
diagnostic?: string;
|
|
@@ -37,6 +41,8 @@ export interface ProjectTaskSnapshot {
|
|
|
37
41
|
}
|
|
38
42
|
export interface IProjectTaskProvider {
|
|
39
43
|
readonly key: string;
|
|
44
|
+
/** Presentation declarations belong to this provider and never contain executable icon code. */
|
|
45
|
+
readonly taskTypes?: readonly ProjectTaskTypeDefinition[];
|
|
40
46
|
/** Return null when the project is not owned by this provider. Always scope domain reads. */
|
|
41
47
|
snapshot(context: ProjectTaskContext): Promise<ProjectTaskSnapshot | null>;
|
|
42
48
|
/** Called after projection commits; retries must be idempotent. Never start work here. */
|
|
@@ -45,6 +51,7 @@ export interface IProjectTaskProvider {
|
|
|
45
51
|
taskId: string;
|
|
46
52
|
}>): Promise<void>;
|
|
47
53
|
}
|
|
54
|
+
export type { ProjectTaskIconName, ProjectTaskTypeDefinition, ProjectTaskTypePresentation } from '@xpert-ai/contracts';
|
|
48
55
|
export declare const PROJECT_TASK_PROVIDER = "PROJECT_TASK_PROVIDER";
|
|
49
56
|
export declare const ProjectTaskProvider: (key: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
50
57
|
export declare class ProjectTaskProviderRegistry extends BaseStrategyRegistry<IProjectTaskProvider> {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
2
|
-
import type { XpertProjectTypeRef } from '@xpert-ai/contracts';
|
|
2
|
+
import type { XpertProjectTypeRef, ConversationResourceCard } from '@xpert-ai/contracts';
|
|
3
3
|
import { BaseStrategyRegistry } from '../strategy';
|
|
4
|
+
export type { XpertProjectTypeRef, ConversationResourceCard };
|
|
4
5
|
export interface ProjectTypeContext extends XpertProjectTypeRef {
|
|
5
6
|
tenantId: string;
|
|
6
7
|
organizationId?: string | null;
|
|
@@ -29,6 +30,11 @@ export interface ConversationProjectCreation {
|
|
|
29
30
|
conversationId: string;
|
|
30
31
|
workspaceId: string;
|
|
31
32
|
name: string;
|
|
33
|
+
/** Present only for a human-confirmed setup; the application validates its own configuration. */
|
|
34
|
+
confirmation?: {
|
|
35
|
+
id: string;
|
|
36
|
+
configuration: object;
|
|
37
|
+
};
|
|
32
38
|
/**
|
|
33
39
|
* Persist only application records through this writer. The host creates the
|
|
34
40
|
* platform Project and binds the conversation in the same transaction. Do not
|
|
@@ -54,6 +60,7 @@ export interface IProjectTypeProvider {
|
|
|
54
60
|
createForConversation?(context: ProjectTypeContext, input: ConversationProjectCreation): Promise<ProjectTypeBinding & {
|
|
55
61
|
name: string;
|
|
56
62
|
status: 'active';
|
|
63
|
+
resourceCards?: ConversationResourceCard[];
|
|
57
64
|
}>;
|
|
58
65
|
}
|
|
59
66
|
export declare const PROJECT_TYPE_PROVIDER = "PROJECT_TYPE_PROVIDER";
|
package/src/lib/{runtime/capabilities → rag/capability}/knowledge-document-visual-assets.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RuntimeIdentityScope } from '
|
|
2
|
-
import type { WorkspaceFilesApi, WorkspacePortableFileReference } from '
|
|
1
|
+
import type { RuntimeIdentityScope } from '../../runtime/runtime-scope';
|
|
2
|
+
import type { WorkspaceFilesApi, WorkspacePortableFileReference } from '../../runtime/capabilities/workspace-files';
|
|
3
3
|
export type KnowledgeDocumentVisualCandidateReason = 'same_block' | 'same_chunk' | 'same_page' | 'adjacent_page' | 'visual_summary_match' | 'visual_only_fallback';
|
|
4
4
|
export type KnowledgeDocumentVisualTextAnchor = {
|
|
5
5
|
page?: number;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** Persisted upload progress within one knowledgebase; completion does not imply document import or processing. */
|
|
2
|
+
export type KnowledgeUploadSession = {
|
|
3
|
+
/** Host-generated session UUID, used together with the owning knowledgebaseId. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Display file name; not a storage path. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Expected total file size in bytes. */
|
|
8
|
+
size: number;
|
|
9
|
+
/** Host-selected part size in bytes; only the final part may be shorter. */
|
|
10
|
+
chunkSize: number;
|
|
11
|
+
/** Persisted zero-based part indexes, sorted in ascending order; gaps identify missing parts. */
|
|
12
|
+
received: number[];
|
|
13
|
+
/** Lowercase hexadecimal SHA-256 of each received part, keyed by its decimal index. */
|
|
14
|
+
partHashes: Record<string, string>;
|
|
15
|
+
/** True after complete() verifies all expected parts and records the whole-file hash. */
|
|
16
|
+
complete: boolean;
|
|
17
|
+
/** Lowercase hexadecimal SHA-256 of the whole file, available after successful completion. */
|
|
18
|
+
sha256?: string;
|
|
19
|
+
};
|
|
20
|
+
/** Server-only staged uploads exposed through Documents.uploads. Every operation revalidates Knowledge write access. */
|
|
21
|
+
export interface KnowledgeUploadSessionsApi {
|
|
22
|
+
/**
|
|
23
|
+
* Create a new upload session without creating or processing a document.
|
|
24
|
+
* size is the total byte count (positive, currently at most 2 GiB); use the returned chunkSize for part boundaries.
|
|
25
|
+
*/
|
|
26
|
+
create(input: {
|
|
27
|
+
knowledgebaseId: string;
|
|
28
|
+
name: string;
|
|
29
|
+
size: number;
|
|
30
|
+
}): Promise<KnowledgeUploadSession>;
|
|
31
|
+
/** Read persisted progress and part hashes to resume an existing session, including after a server restart. */
|
|
32
|
+
status(input: {
|
|
33
|
+
knowledgebaseId: string;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
}): Promise<KnowledgeUploadSession>;
|
|
36
|
+
/**
|
|
37
|
+
* Persist one zero-based part; parts may arrive out of order.
|
|
38
|
+
* buffer must match the expected part length and sha256 must be its lowercase hexadecimal SHA-256.
|
|
39
|
+
* Retrying identical bytes is safe; conflicting bytes for an existing index are rejected.
|
|
40
|
+
*/
|
|
41
|
+
append(input: {
|
|
42
|
+
knowledgebaseId: string;
|
|
43
|
+
sessionId: string;
|
|
44
|
+
index: number;
|
|
45
|
+
buffer: Buffer;
|
|
46
|
+
sha256: string;
|
|
47
|
+
}): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Verify all parts and their lengths, then record the whole-file SHA-256 and mark the session complete.
|
|
50
|
+
* Incomplete uploads fail; repeated completion is safe. Does not import documents or start processing.
|
|
51
|
+
*/
|
|
52
|
+
complete(input: {
|
|
53
|
+
knowledgebaseId: string;
|
|
54
|
+
sessionId: string;
|
|
55
|
+
}): Promise<KnowledgeUploadSession>;
|
|
56
|
+
/**
|
|
57
|
+
* Read bytes from a completed upload, including ranges that cross part boundaries, for streaming ZIP readers.
|
|
58
|
+
* offset is zero-based; length is nonnegative, at most chunkSize, and offset + length must not exceed size.
|
|
59
|
+
*/
|
|
60
|
+
read(input: {
|
|
61
|
+
knowledgebaseId: string;
|
|
62
|
+
sessionId: string;
|
|
63
|
+
offset: number;
|
|
64
|
+
length: number;
|
|
65
|
+
}): Promise<Buffer>;
|
|
66
|
+
/** Delete an existing session and its staged bytes; previously imported documents are unaffected. */
|
|
67
|
+
remove(input: {
|
|
68
|
+
knowledgebaseId: string;
|
|
69
|
+
sessionId: string;
|
|
70
|
+
}): Promise<void>;
|
|
71
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type I18nObject, type DocumentTextParserConfig, type DocumentSheetParserConfig, JSONValue } from '@xpert-ai/contracts';
|
|
2
|
-
import type { WorkspacePortableFileReference } from '
|
|
2
|
+
import type { WorkspacePortableFileReference } from '../../runtime/capabilities/workspace-files';
|
|
3
|
+
import type { KnowledgeUploadSessionsApi } from './knowledge-upload-sessions';
|
|
3
4
|
export type KnowledgebaseDocumentFile = {
|
|
4
5
|
buffer: Buffer;
|
|
5
6
|
originalname?: string;
|
|
@@ -60,6 +61,9 @@ export type KnowledgebaseListDocumentsInput = {
|
|
|
60
61
|
page?: number;
|
|
61
62
|
pageSize?: number;
|
|
62
63
|
search?: string;
|
|
64
|
+
/** Literal substring search; paths include the logical folder and imported originalRelativePath. */
|
|
65
|
+
searchFields?: Array<'name' | 'path'>;
|
|
66
|
+
mimeTypes?: string[];
|
|
63
67
|
includeFolders?: boolean;
|
|
64
68
|
/** List direct children of this folder. Use null for the knowledgebase root. */
|
|
65
69
|
parentId?: string | null;
|
|
@@ -110,6 +114,8 @@ export type KnowledgebaseUploadedFile = {
|
|
|
110
114
|
};
|
|
111
115
|
export type KnowledgebaseCreateDocumentsInput = {
|
|
112
116
|
knowledgebaseId: string;
|
|
117
|
+
/** Retry key, scoped to this Knowledge base. Repeated creation returns the original documents. */
|
|
118
|
+
idempotencyKey?: string;
|
|
113
119
|
documents: KnowledgebaseDocumentDraft[];
|
|
114
120
|
parserConfig?: KnowledgebaseDocumentParserConfig;
|
|
115
121
|
metadata?: KnowledgebaseDocumentMetadata;
|
|
@@ -266,6 +272,8 @@ export type KnowledgebaseProcessingOptionsResult = {
|
|
|
266
272
|
parserConfig: DocumentTextParserConfig & Partial<DocumentSheetParserConfig>;
|
|
267
273
|
};
|
|
268
274
|
export interface KnowledgebaseDocumentsApi {
|
|
275
|
+
/** Stage resumable uploads without starting document processing. */
|
|
276
|
+
readonly uploads: KnowledgeUploadSessionsApi;
|
|
269
277
|
getProcessingOptions(input: KnowledgebaseProcessingOptionsInput): Promise<KnowledgebaseProcessingOptionsResult>;
|
|
270
278
|
readText(input: KnowledgebaseReadTextInput): Promise<KnowledgebaseReadTextResult>;
|
|
271
279
|
/** Missing/stale conversion snapshots fail explicitly; this never falls back to indexed chunks. */
|
|
@@ -31,6 +31,8 @@ export type KnowledgebaseSearchResult = {
|
|
|
31
31
|
diagnostics: KnowledgeFilterDiagnostics[];
|
|
32
32
|
};
|
|
33
33
|
export type KnowledgebaseListInput = {
|
|
34
|
+
/** Tenant-owned public libraries, readable by tenant members. */
|
|
35
|
+
scope?: 'workspace' | 'tenant';
|
|
34
36
|
workspaceId?: string | null;
|
|
35
37
|
published?: boolean;
|
|
36
38
|
limit?: number;
|
|
@@ -135,6 +137,8 @@ export type KnowledgebaseProvisioningSpec = {
|
|
|
135
137
|
};
|
|
136
138
|
};
|
|
137
139
|
export type KnowledgebaseEnsureInput = {
|
|
140
|
+
/** Tenant provisioning requires SUPER_ADMIN already in tenant request scope; workspaceId supplies model discovery only. */
|
|
141
|
+
scope?: 'workspace' | 'tenant';
|
|
138
142
|
workspaceId: string;
|
|
139
143
|
namespace: string;
|
|
140
144
|
/**
|
package/src/lib/rag/index.d.ts
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResourceCardType } from './types';
|
|
2
|
+
export declare const RESOURCE_CARD_PROVIDER = "RESOURCE_CARD_PROVIDER";
|
|
3
|
+
/** Register exact resource types whose message cards opt in to live refresh. */
|
|
4
|
+
export declare const ResourceCardProvider: (...resources: ResourceCardType[]) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type OnModuleDestroy } from '@nestjs/common';
|
|
2
|
+
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
3
|
+
import { BaseStrategyRegistry } from '../strategy';
|
|
4
|
+
import type { IResourceCardProvider, ResourceCardType } from './types';
|
|
5
|
+
export declare class ResourceCardProviderRegistry extends BaseStrategyRegistry<IResourceCardProvider> implements OnModuleDestroy {
|
|
6
|
+
private readonly resourceLogger;
|
|
7
|
+
private subscription?;
|
|
8
|
+
constructor(discovery: DiscoveryService, reflector: Reflector);
|
|
9
|
+
onModuleInit(): void;
|
|
10
|
+
onModuleDestroy(): void;
|
|
11
|
+
remove(scopeKey: string, pluginName: string): void;
|
|
12
|
+
upsert(instance: unknown): void;
|
|
13
|
+
find(resource: ResourceCardType, organizationId?: string): IResourceCardProvider | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ConversationResourceCard } from '@xpert-ai/contracts';
|
|
2
|
+
export interface ResourceCardType {
|
|
3
|
+
namespace: string;
|
|
4
|
+
type: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ResourceCardContext {
|
|
7
|
+
tenantId: string;
|
|
8
|
+
organizationId?: string | null;
|
|
9
|
+
userId: string;
|
|
10
|
+
conversationId: string;
|
|
11
|
+
threadId: string;
|
|
12
|
+
projectId?: string | null;
|
|
13
|
+
/** Stop external reads when the host's observation deadline expires. */
|
|
14
|
+
signal: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
export interface ResourceCardReadRequest {
|
|
17
|
+
/** Opaque correlation key. Echo it; never choose another message binding. */
|
|
18
|
+
key: string;
|
|
19
|
+
card: ConversationResourceCard;
|
|
20
|
+
messageId: string;
|
|
21
|
+
executionId?: string;
|
|
22
|
+
}
|
|
23
|
+
export type ResourceCardResolution = {
|
|
24
|
+
key: string;
|
|
25
|
+
} & ({
|
|
26
|
+
status: 'resolved';
|
|
27
|
+
card: ConversationResourceCard;
|
|
28
|
+
} | {
|
|
29
|
+
status: 'unavailable';
|
|
30
|
+
reason: 'forbidden' | 'not_found';
|
|
31
|
+
});
|
|
32
|
+
/** Optional live presentation of committed resources; never starts work or changes business state. */
|
|
33
|
+
export interface IResourceCardProvider {
|
|
34
|
+
/** Recheck resource access for the host-supplied actor and return one result per request. */
|
|
35
|
+
resolveMany(context: ResourceCardContext, requests: readonly ResourceCardReadRequest[]): Promise<readonly ResourceCardResolution[]>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
2
|
+
import { type ConversationResourceCard } from '@xpert-ai/contracts';
|
|
3
|
+
export { createResourceCardContent, parseResourceCard, resourceCardId } from '@xpert-ai/contracts';
|
|
4
|
+
export type { ConversationResourceCard, ResourceCardContent, ResourceCardField, ResourceCardFile, ResourceCardFileReference, ResourceCardImage, ResourceCardOpenTarget, ResourceCardScalar, TMessageContentResourceCard } from '@xpert-ai/contracts';
|
|
5
|
+
/** Call after the business mutation commits. A display failure must not retry that mutation. */
|
|
6
|
+
export declare function emitResourceCard(card: ConversationResourceCard, config?: RunnableConfig): Promise<void>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export * from './knowledgebase';
|
|
2
|
-
export * from './knowledge-graph';
|
|
3
|
-
export * from './knowledgebase-documents';
|
|
4
|
-
export * from './knowledge-document-visual-assets';
|
|
5
1
|
export * from './actor-token';
|
|
6
2
|
export * from './artifacts';
|
|
7
3
|
export * from './workspace-files';
|
|
8
4
|
export * from './sandbox-jobs';
|
|
9
5
|
export * from './project-provisioning';
|
|
10
6
|
export * from './project-access';
|
|
7
|
+
export * from './tool-images';
|
|
@@ -38,6 +38,16 @@ export type ProjectEnsureResult = {
|
|
|
38
38
|
};
|
|
39
39
|
/** Host API exposed to plugins that own one-to-one business Project mappings. */
|
|
40
40
|
export interface ProjectProvisioningApi {
|
|
41
|
+
/** App-only confirmation of a pending conversation's first Project; never moves an existing binding. */
|
|
42
|
+
confirmConversation?(input: {
|
|
43
|
+
conversationId: string;
|
|
44
|
+
xpertId: string;
|
|
45
|
+
confirmationId: string;
|
|
46
|
+
name: string;
|
|
47
|
+
configuration: object;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
projectId: string;
|
|
50
|
+
}>;
|
|
41
51
|
/** Create or reconcile a Chat Project without changing its caller-supplied id. */
|
|
42
52
|
ensure(input: ProjectEnsureInput): Promise<ProjectEnsureResult>;
|
|
43
53
|
/** Owner-only physical deletion of an archived plugin-bound Project and its workspace. */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BaseMessage } from '@langchain/core/messages';
|
|
2
|
+
import type { ToolOutputImageAttachment, ToolOutputPresentation } from '@xpert-ai/chatkit-types';
|
|
3
|
+
import type { ModelRequirements } from '../../agent/middleware/model-requirements';
|
|
4
|
+
export type { ToolOutputImageAttachment, ToolOutputPresentation } from '@xpert-ai/chatkit-types';
|
|
5
|
+
export type ToolImageModelInput = {
|
|
6
|
+
messages: BaseMessage[];
|
|
7
|
+
requirements?: ModelRequirements;
|
|
8
|
+
};
|
|
9
|
+
/** Images stay in immutable Artifacts; tool results and graph checkpoints contain references only. */
|
|
10
|
+
export interface ToolImagesApi {
|
|
11
|
+
/** Host identity, conversation and Workspace scope are bound to the current execution. */
|
|
12
|
+
save(input: {
|
|
13
|
+
buffer: Buffer;
|
|
14
|
+
mimeType: ToolOutputImageAttachment['mimeType'];
|
|
15
|
+
title: string;
|
|
16
|
+
}): Promise<ToolOutputPresentation>;
|
|
17
|
+
/**
|
|
18
|
+
* Project the current complete tool round into one outbound model request. Names identify tools
|
|
19
|
+
* whose successful result must contain an image presentation; error results remain text.
|
|
20
|
+
* Never persist the returned messages. Merge requirements into the request with mergeModelRequirements.
|
|
21
|
+
*/
|
|
22
|
+
prepareModelInput(messages: BaseMessage[], toolNames: readonly string[]): Promise<ToolImageModelInput>;
|
|
23
|
+
}
|
|
24
|
+
export declare const ToolImagesRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<ToolImagesApi>;
|
|
@@ -253,9 +253,13 @@ export interface WorkspaceFilesApi {
|
|
|
253
253
|
* file without reading its bytes into the API process.
|
|
254
254
|
*/
|
|
255
255
|
resolveFile(input: WorkspaceFileReference): Promise<WorkspaceFile>;
|
|
256
|
-
/**
|
|
256
|
+
/**
|
|
257
|
+
* Read raw bytes from an explicitly scoped workspace file reference.
|
|
258
|
+
* Missing paths or an uninitialized volume root reject with `error.code === 'ENOENT'`
|
|
259
|
+
* in-process; other validation/access failures must not be treated as missing files.
|
|
260
|
+
*/
|
|
257
261
|
readBuffer(input: WorkspaceFileReference): Promise<WorkspaceFileBuffer>;
|
|
258
|
-
/** Delete an explicitly scoped workspace file. */
|
|
262
|
+
/** Delete an explicitly scoped workspace file; missing paths/roots reject with code ENOENT in-process. */
|
|
259
263
|
deleteFile(input: WorkspaceFileReference): Promise<void>;
|
|
260
264
|
/**
|
|
261
265
|
* Normalize a runtime locator into a portable, scope-aware reference without
|
|
@@ -267,6 +271,8 @@ export interface WorkspaceFilesApi {
|
|
|
267
271
|
*
|
|
268
272
|
* This is the preferred API for plugin tools that receive `/workspace/...`
|
|
269
273
|
* paths from sandbox commands.
|
|
274
|
+
* After resolving the locator, missing paths/roots reject with code ENOENT in-process.
|
|
275
|
+
* Callers must not infer missing files from localized validation or access errors.
|
|
270
276
|
*/
|
|
271
277
|
readRuntimeBuffer(input: WorkspaceFileLocator): Promise<WorkspaceRuntimeFileBuffer>;
|
|
272
278
|
/**
|
|
@@ -6,5 +6,7 @@ export interface SandboxExecutionEnvironment {
|
|
|
6
6
|
readonly shellState?: 'per-command' | 'persistent';
|
|
7
7
|
readonly persistentDirectories?: readonly string[];
|
|
8
8
|
readonly canInstallSystemPackages?: boolean;
|
|
9
|
+
/** Explicit opt-in capabilities implemented by this execution backend. */
|
|
10
|
+
readonly capabilities?: readonly string[];
|
|
9
11
|
readonly desktop?: boolean;
|
|
10
12
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export interface SandboxExecutionOptions {
|
|
2
|
+
/** Trusted host correlation/capabilities, never part of the model-visible command schema. */
|
|
3
|
+
executionScope?: SandboxExecutionScope;
|
|
2
4
|
timeoutMs?: number;
|
|
3
5
|
maxOutputBytes?: number;
|
|
4
6
|
/** Request cancellation; the backend must implement guest process termination. */
|
|
5
7
|
signal?: AbortSignal;
|
|
6
8
|
}
|
|
7
9
|
export interface ResolvedSandboxExecutionOptions {
|
|
10
|
+
executionScope?: SandboxExecutionScope;
|
|
8
11
|
timeoutMs: number;
|
|
9
12
|
maxOutputBytes: number;
|
|
10
13
|
signal?: AbortSignal;
|
|
@@ -28,3 +31,10 @@ export declare function formatSandboxTimeout(timeoutMs: number): string;
|
|
|
28
31
|
export declare function buildSandboxTimeoutMessage(subject: string, timeoutMs: number): string;
|
|
29
32
|
export declare function appendSandboxMessage(output: string, message: string): string;
|
|
30
33
|
export declare function resolveSandboxExecutionOptions(options?: SandboxExecutionOptions, defaults?: SandboxExecutionOptions): ResolvedSandboxExecutionOptions;
|
|
34
|
+
export interface SandboxExecutionScope {
|
|
35
|
+
parentExecutionId: string;
|
|
36
|
+
conversationId: string;
|
|
37
|
+
toolCallId: string;
|
|
38
|
+
/** Environment capabilities selected by the Assistant's middleware configuration. */
|
|
39
|
+
capabilities: readonly string[];
|
|
40
|
+
}
|
|
@@ -50,6 +50,7 @@ export type SandboxManagedServiceRestartOptions = {
|
|
|
50
50
|
export type SandboxManagedServiceStartResult = SandboxManagedServiceStateChange;
|
|
51
51
|
export interface SandboxManagedServiceAdapter {
|
|
52
52
|
getServiceLogs(options: SandboxManagedServiceLogsOptions): MaybePromise<TSandboxManagedServiceLogs>;
|
|
53
|
+
/** Inspect existing services only; do not create or recover a runtime during discovery. */
|
|
53
54
|
listServices(options: SandboxManagedServiceListOptions): MaybePromise<SandboxManagedServiceListResult>;
|
|
54
55
|
restartService(options: SandboxManagedServiceRestartOptions): MaybePromise<SandboxManagedServiceStartResult>;
|
|
55
56
|
startService(options: SandboxManagedServiceStartOptions): MaybePromise<SandboxManagedServiceStartResult>;
|
|
File without changes
|