@xpert-ai/plugin-sdk 3.27.0 → 3.29.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/collaboration-client.cjs.js +31 -5
- package/collaboration-client.esm.js +31 -5
- package/data-workbench.cjs.js +0 -679
- package/data-workbench.esm.js +1 -676
- package/docs/artifact-presentations.md +2 -0
- package/docs/artifact-types.md +97 -0
- package/docs/data-workbench.md +37 -0
- package/index.cjs.js +481 -49
- package/index.esm.js +469 -49
- package/model-provider.cjs.js +7 -1
- package/model-provider.esm.js +7 -2
- package/package.json +2 -2
- package/src/data-workbench.d.ts +0 -2
- package/src/index.d.ts +2 -0
- package/src/lib/agent/handoff/types.d.ts +5 -0
- package/src/lib/agent/middleware/capabilities/assistant-task.d.ts +6 -1
- package/src/lib/agent/middleware/capabilities/execution-observability.d.ts +26 -0
- package/src/lib/agent/middleware/capabilities/index.d.ts +1 -0
- package/src/lib/agent/runtime/capability.d.ts +4 -0
- package/src/lib/agent/runtime/cli-model-profile.d.ts +1 -1
- package/src/lib/agent/runtime/execution-runner.d.ts +11 -0
- package/src/lib/agent/runtime/index.d.ts +2 -0
- package/src/lib/agent/runtime/managed.d.ts +94 -0
- package/src/lib/agent/runtime/process-supervisor.d.ts +1 -0
- package/src/lib/agent/runtime/strategy.d.ts +14 -0
- package/src/lib/agent/runtime/types.d.ts +30 -1
- package/src/lib/ai-model/native-model.d.ts +5 -1
- package/src/lib/artifact-type/definition.schema.d.ts +119 -0
- package/src/lib/artifact-type/index.d.ts +91 -0
- package/src/lib/artifact-type/registry.d.ts +25 -0
- package/src/lib/assistant-capability/index.d.ts +1 -0
- package/src/lib/assistant-capability/middleware.d.ts +10 -0
- package/src/lib/collaboration/types.d.ts +5 -0
- package/src/lib/content-resource/catalog.d.ts +88 -0
- package/src/lib/content-resource/editor-compatibility.d.ts +3 -0
- package/src/lib/content-resource/editor.d.ts +35 -3
- package/src/lib/content-resource/index.d.ts +3 -0
- package/src/lib/data/datasource/adapter.strategy.d.ts +3 -0
- package/src/lib/data/datasource/index.d.ts +0 -2
- package/src/lib/data/datasource/strategy.interface.d.ts +5 -1
- package/src/lib/data/datasource/types.d.ts +2 -2
- package/src/lib/data/datasource/workbench.d.ts +4 -3
- package/src/lib/execution-control/context.d.ts +7 -0
- package/src/lib/execution-control/index.d.ts +2 -0
- package/src/lib/managed-queue/index.d.ts +12 -0
- package/src/lib/runtime/capabilities/artifact-drafts.d.ts +10 -1
- package/src/lib/runtime/capabilities/artifact-library.d.ts +52 -0
- package/src/lib/runtime/capabilities/artifacts.d.ts +15 -0
- package/src/lib/runtime/capabilities/index.d.ts +1 -0
- package/src/lib/runtime/capabilities/mcp-client-runtime.d.ts +2 -0
- package/src/lib/runtime/capabilities/sandbox-jobs.d.ts +12 -3
- package/src/lib/sandbox/file-edit-command.d.ts +2 -0
- package/src/lib/sandbox/file-edit-diff.d.ts +1 -0
- package/src/lib/sandbox/protocol.d.ts +13 -1
- package/src/lib/sandbox/runtime-provider.d.ts +12 -0
- package/src/lib/data/datasource/workbench-adapter.d.ts +0 -51
- package/src/lib/data/datasource/workbench-pagination.d.ts +0 -6
- package/src/lib/data/datasource/workbench-sql-lexer.d.ts +0 -11
- package/src/lib/data/datasource/workbench-sql-syntax.d.ts +0 -3
- package/src/lib/data/datasource/workbench-sql.d.ts +0 -20
|
@@ -104,8 +104,20 @@ export interface EditResult {
|
|
|
104
104
|
* External backends set null (already persisted to disk/S3/database/etc).
|
|
105
105
|
*/
|
|
106
106
|
filesUpdate?: Record<string, FileData> | null;
|
|
107
|
-
/** Number of replacements
|
|
107
|
+
/** Number of matched replacements processed, including unchanged replacements. */
|
|
108
108
|
occurrences?: number;
|
|
109
|
+
/** Lines in the old/new arguments, before multiplying by occurrences. Empty text has zero lines. */
|
|
110
|
+
oldLines?: number;
|
|
111
|
+
newLines?: number;
|
|
112
|
+
/** Whether this edit changed the file's text. */
|
|
113
|
+
changed?: boolean;
|
|
114
|
+
/** Whole-file line additions/deletions computed in memory, independently of argument sizes. */
|
|
115
|
+
diff?: {
|
|
116
|
+
removed: number;
|
|
117
|
+
added: number;
|
|
118
|
+
};
|
|
119
|
+
/** Missing statistics do not turn a successful write into an error. */
|
|
120
|
+
diffUnavailable?: 'comparison_budget_exceeded' | 'diff_unavailable';
|
|
109
121
|
/** Metadata for the edit operation, attached to the ToolMessage */
|
|
110
122
|
metadata?: Record<string, unknown>;
|
|
111
123
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SandboxRuntimeTarget, SandboxRuntimeEvidence } from '@xpert-ai/contracts';
|
|
2
|
+
export type { SandboxRuntimeTarget, SandboxRuntimeEvidence } from '@xpert-ai/contracts';
|
|
1
3
|
/** Per-execution limits applied to the Runtime Definition's fixed Runner command. */
|
|
2
4
|
export type SandboxRuntimeExecutionOptions = {
|
|
3
5
|
timeoutMs?: number;
|
|
@@ -81,6 +83,8 @@ export type SandboxRuntimeSecurity = {
|
|
|
81
83
|
};
|
|
82
84
|
/** Isolation guarantees a Provider advertises before it can be selected. */
|
|
83
85
|
export type SandboxRuntimeProviderCapabilities = {
|
|
86
|
+
/** Versioned original-target control and actual execution receipts. */
|
|
87
|
+
executionControl?: 1;
|
|
84
88
|
isolation: 'process' | 'hardened';
|
|
85
89
|
ephemeral: boolean;
|
|
86
90
|
resourceLimits: boolean;
|
|
@@ -156,6 +160,8 @@ export type SandboxRuntimeVolume = {
|
|
|
156
160
|
};
|
|
157
161
|
/** Fully resolved policy used to create or reattach one ephemeral Job Runtime. */
|
|
158
162
|
export type SandboxRuntimeCreateOptions = {
|
|
163
|
+
/** Host-persisted identity, prepared before create; never replace it with a new target. */
|
|
164
|
+
controlTarget?: SandboxRuntimeTarget;
|
|
159
165
|
tenantId: string;
|
|
160
166
|
workFor: {
|
|
161
167
|
type: 'job';
|
|
@@ -178,6 +184,7 @@ export type SandboxRuntimeCreateOptions = {
|
|
|
178
184
|
};
|
|
179
185
|
/** Persisted evidence required to destroy a Runtime even after Provider reload. */
|
|
180
186
|
export type SandboxRuntimeDestroyOptions = {
|
|
187
|
+
controlTarget?: SandboxRuntimeTarget;
|
|
181
188
|
tenantId: string;
|
|
182
189
|
workFor: {
|
|
183
190
|
type: 'job';
|
|
@@ -229,4 +236,9 @@ export interface ISandboxRuntimeProvider {
|
|
|
229
236
|
create(options: SandboxRuntimeCreateOptions): Promise<SandboxRuntimeInstance>;
|
|
230
237
|
/** Idempotently reclaims a Runtime by persisted scope, Binding, and runtimeRef evidence. */
|
|
231
238
|
destroy(options: SandboxRuntimeDestroyOptions): Promise<void>;
|
|
239
|
+
/** Resolve identity without starting business work; control never calls create/execute. */
|
|
240
|
+
prepareControl?(options: SandboxRuntimeDestroyOptions & {
|
|
241
|
+
generation: string;
|
|
242
|
+
}): Promise<SandboxRuntimeTarget>;
|
|
243
|
+
control?(target: SandboxRuntimeTarget, action: 'inspect' | 'stop'): Promise<SandboxRuntimeEvidence>;
|
|
232
244
|
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Why this exists: existing SQL Workbench plugins share this SDK implementation.
|
|
3
|
-
* Validation, quoting, pagination, metadata and transaction SQL couple it to PostgreSQL/MySQL/Doris.
|
|
4
|
-
* TODO: move those behaviors into plugin-owned implementations of DatabaseWorkbenchAdapter;
|
|
5
|
-
* retain SDK interfaces/result types and dialect-independent execution helpers for reuse.
|
|
6
|
-
* Migrate existing callers with equivalent read-only/security tests before removing legacy guards.
|
|
7
|
-
* Host authorization/execution limits and generic Dataset/Binding must remain independent of dialects.
|
|
8
|
-
*/
|
|
9
|
-
import type { DatabaseCapabilities, DatabaseEngine, DatabaseImportInput, DatabaseImportReceipt, DatabaseLocation, DatabaseObjectDetail, DatabaseObjectPage, DatabaseObjectRef, DatabaseQueryInput, DatabaseResult, DatabaseValue, DatabaseWorkbenchAdapter } from './workbench';
|
|
10
|
-
export interface WorkbenchTransport {
|
|
11
|
-
execute(sql: string, parameters: DatabaseValue[], options: {
|
|
12
|
-
timeoutMs: number;
|
|
13
|
-
maxRows: number;
|
|
14
|
-
signal?: AbortSignal;
|
|
15
|
-
}): Promise<DatabaseResult>;
|
|
16
|
-
close(): Promise<void>;
|
|
17
|
-
importRows?(input: DatabaseImportInput, signal?: AbortSignal): Promise<DatabaseImportReceipt>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* One adapter per physical connection. A host session must not share it across users.
|
|
21
|
-
* @deprecated Legacy SDK-owned SQL dialects. New plugins should implement DatabaseWorkbenchAdapter
|
|
22
|
-
* with plugin-owned dialect behavior. Retained for compatibility with existing plugins.
|
|
23
|
-
*/
|
|
24
|
-
export declare class SqlDatabaseWorkbenchAdapter implements DatabaseWorkbenchAdapter {
|
|
25
|
-
readonly engine: DatabaseEngine;
|
|
26
|
-
private readonly transport;
|
|
27
|
-
private readonly initial;
|
|
28
|
-
private version?;
|
|
29
|
-
private transactionOpen;
|
|
30
|
-
private busy;
|
|
31
|
-
private closed;
|
|
32
|
-
constructor(engine: DatabaseEngine, transport: WorkbenchTransport, initial?: DatabaseLocation);
|
|
33
|
-
private quote;
|
|
34
|
-
private ref;
|
|
35
|
-
private assertLocation;
|
|
36
|
-
private raw;
|
|
37
|
-
capabilities(): Promise<DatabaseCapabilities>;
|
|
38
|
-
locations(): Promise<DatabaseLocation[]>;
|
|
39
|
-
objects(input: DatabaseLocation & {
|
|
40
|
-
search?: string;
|
|
41
|
-
page?: number;
|
|
42
|
-
pageSize?: number;
|
|
43
|
-
}): Promise<DatabaseObjectPage>;
|
|
44
|
-
describe(object: DatabaseObjectRef): Promise<DatabaseObjectDetail>;
|
|
45
|
-
query(input: DatabaseQueryInput, signal?: AbortSignal): Promise<DatabaseResult>;
|
|
46
|
-
explain(input: Omit<DatabaseQueryInput, 'mode'>, signal?: AbortSignal): Promise<DatabaseResult>;
|
|
47
|
-
transaction(action: 'begin' | 'commit' | 'rollback'): Promise<void>;
|
|
48
|
-
importRows(input: DatabaseImportInput, signal?: AbortSignal): Promise<DatabaseImportReceipt>;
|
|
49
|
-
cancel(): Promise<void>;
|
|
50
|
-
close(): Promise<void>;
|
|
51
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DatabaseValue } from './workbench';
|
|
2
|
-
/** Apply a page to a MySQL result without turning its (possibly duplicate) output names into table columns. */
|
|
3
|
-
export declare function paginateMysqlQuery(sql: string, parameters: DatabaseValue[], limit: number, offset: number): {
|
|
4
|
-
sql: string;
|
|
5
|
-
parameters: DatabaseValue[];
|
|
6
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface SqlToken {
|
|
2
|
-
text: string;
|
|
3
|
-
start: number;
|
|
4
|
-
end: number;
|
|
5
|
-
kind: 'word' | 'number' | 'symbol' | 'identifier' | 'literal';
|
|
6
|
-
}
|
|
7
|
-
/** Mask comments and quoted content without changing source offsets. Shared by guards and pagination. */
|
|
8
|
-
export declare function lexWorkbenchSql(source: string): {
|
|
9
|
-
masked: string;
|
|
10
|
-
tokens: SqlToken[];
|
|
11
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface SqlStatement {
|
|
2
|
-
sql: string;
|
|
3
|
-
words: string[];
|
|
4
|
-
effect: 'read' | 'write' | 'unsupported';
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Mixed-dialect Workbench policy. New adapters should own dialect-aware statement
|
|
8
|
-
* validation. Existing callers must retain this guard until an equivalent replacement is in place.
|
|
9
|
-
*/
|
|
10
|
-
export declare function splitWorkbenchSql(source: string): SqlStatement[];
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Uses the legacy mixed-dialect policy. New adapters should enforce read-only execution
|
|
13
|
-
* with dialect-aware validation and database permissions. Keep this guard until safely migrated.
|
|
14
|
-
*/
|
|
15
|
-
export declare function requireReadStatement(sql: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Built-in engine switch. New adapters should own dialect-specific identifier quoting
|
|
18
|
-
* while preserving identifier validation and escaping.
|
|
19
|
-
*/
|
|
20
|
-
export declare function quoteDatabaseIdentifier(name: string, engine: 'doris' | 'mysql' | 'postgres'): string;
|