@xpert-ai/plugin-sdk 3.23.0 → 3.25.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.
Files changed (88) hide show
  1. package/_object_without_properties_loose.cjs.js +16 -0
  2. package/_object_without_properties_loose.esm.js +14 -0
  3. package/analytics-result.cjs.js +212 -0
  4. package/analytics-result.esm.js +201 -0
  5. package/analytics.cjs.default.js +1 -0
  6. package/analytics.cjs.js +17 -0
  7. package/analytics.cjs.mjs +2 -0
  8. package/analytics.d.ts +1 -0
  9. package/analytics.esm.js +2 -0
  10. package/artifact-document.cjs.default.js +1 -0
  11. package/artifact-document.cjs.js +581 -0
  12. package/artifact-document.cjs.mjs +2 -0
  13. package/artifact-document.d.ts +1 -0
  14. package/artifact-document.esm.js +563 -0
  15. package/data-workbench.cjs.js +23 -6
  16. package/data-workbench.esm.js +23 -6
  17. package/docs/README.md +8 -0
  18. package/docs/analytics.md +108 -0
  19. package/docs/artifact-documents.md +74 -0
  20. package/docs/artifact-drafts.md +24 -0
  21. package/docs/artifact-presentations.md +43 -0
  22. package/docs/json-encoded-schema.md +19 -0
  23. package/docs/mcp-client.md +63 -0
  24. package/docs/provider-credential-validation.md +34 -0
  25. package/docs/rest-client.md +24 -0
  26. package/docs/workspace-dataset-pipelines.md +120 -0
  27. package/docs/workspace-file-tools.md +66 -0
  28. package/index.cjs.js +555 -108
  29. package/index.esm.js +573 -172
  30. package/model-provider-toolset.cjs.js +1 -1
  31. package/model-provider-toolset.esm.js +1 -1
  32. package/model-provider.cjs.js +47 -1
  33. package/model-provider.esm.js +41 -2
  34. package/package.json +14 -2
  35. package/src/analytics.d.ts +3 -0
  36. package/src/artifact-document.d.ts +5 -0
  37. package/src/index.d.ts +2 -0
  38. package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +80 -80
  39. package/src/lib/agent/middleware/capabilities/assistant-task.d.ts +36 -1
  40. package/src/lib/agent/runtime/dispatch.d.ts +284 -284
  41. package/src/lib/agent/runtime/index.d.ts +1 -0
  42. package/src/lib/agent/runtime/pipeline-scope.d.ts +110 -0
  43. package/src/lib/agent/runtime/types.d.ts +4 -2
  44. package/src/lib/ai-model/ai-model-provider.interface.d.ts +3 -1
  45. package/src/lib/ai-model/utils/limits.d.ts +4 -2
  46. package/src/lib/artifact-document/dependencies.d.ts +101 -0
  47. package/src/lib/artifact-document/host.d.ts +30 -0
  48. package/src/lib/artifact-document/protocol.d.ts +60 -0
  49. package/src/lib/artifact-document/runtime.d.ts +4 -0
  50. package/src/lib/artifact-document/sha256.d.ts +2 -0
  51. package/src/lib/artifact-presentation/index.d.ts +35 -0
  52. package/src/lib/core/index.d.ts +1 -0
  53. package/src/lib/core/json-encoded-schema.d.ts +15 -0
  54. package/src/lib/data/analytics/analytics-payload.d.ts +3 -0
  55. package/src/lib/data/analytics/analytics-provider.d.ts +74 -0
  56. package/src/lib/data/analytics/analytics-result.d.ts +4 -0
  57. package/src/lib/data/analytics/analytics.registry.d.ts +10 -0
  58. package/src/lib/data/analytics/analytics.schema.d.ts +206 -0
  59. package/src/lib/data/analytics/index.d.ts +5 -0
  60. package/src/lib/data/datasource/index.d.ts +1 -0
  61. package/src/lib/data/datasource/types.d.ts +1 -1
  62. package/src/lib/data/datasource/workbench-adapter.d.ts +11 -1
  63. package/src/lib/data/datasource/workbench-sql.d.ts +12 -0
  64. package/src/lib/project-pipeline/adapters.d.ts +87 -0
  65. package/src/lib/project-pipeline/capability.d.ts +100 -0
  66. package/src/lib/project-pipeline/index.d.ts +5 -0
  67. package/src/lib/project-pipeline/projection.d.ts +71 -0
  68. package/src/lib/project-pipeline/registry.d.ts +509 -0
  69. package/src/lib/project-pipeline/runtime-registry.d.ts +45 -0
  70. package/src/lib/project-pipeline/scoped-registry.d.ts +10 -0
  71. package/src/lib/project-task/index.d.ts +6 -0
  72. package/src/lib/project-type/index.d.ts +17 -1
  73. package/src/lib/rag/types.d.ts +1 -1
  74. package/src/lib/runtime/capabilities/artifact-drafts.d.ts +29 -0
  75. package/src/lib/runtime/capabilities/artifacts.d.ts +12 -0
  76. package/src/lib/runtime/capabilities/index.d.ts +3 -0
  77. package/src/lib/runtime/capabilities/mcp-client-runtime.d.ts +41 -0
  78. package/src/lib/runtime/capabilities/rest-client-runtime.d.ts +34 -0
  79. package/src/lib/runtime/capabilities/sandbox-jobs.d.ts +36 -2
  80. package/src/lib/runtime/index.d.ts +2 -0
  81. package/src/lib/runtime/mutation-evidence.d.ts +7 -0
  82. package/src/lib/runtime/workspace-file-tools.d.ts +11 -0
  83. package/src/lib/sandbox/file-edits.d.ts +4 -0
  84. package/src/lib/sandbox/protocol.d.ts +7 -1
  85. package/src/lib/sandbox/runtime-provider.d.ts +4 -0
  86. package/src/lib/sandbox/sandbox.d.ts +2 -8
  87. package/src/lib/tool-provider/adapters.d.ts +1 -1
  88. package/src/lib/tool-provider/types.d.ts +2 -0
@@ -4,8 +4,8 @@ var modelProvider = require('./model-provider.cjs.js');
4
4
  require('./_extends.cjs.js');
5
5
  require('@xpert-ai/contracts');
6
6
  require('@nestjs/common');
7
- require('@langchain/core/tools');
8
7
  require('zod/v3');
8
+ require('@langchain/core/tools');
9
9
 
10
10
 
11
11
 
@@ -2,5 +2,5 @@ export { M as ModelProviderBuiltinToolset } from './model-provider.esm.js';
2
2
  import './_extends.esm.js';
3
3
  import '@xpert-ai/contracts';
4
4
  import '@nestjs/common';
5
- import '@langchain/core/tools';
6
5
  import 'zod/v3';
6
+ import '@langchain/core/tools';
@@ -3,8 +3,8 @@
3
3
  var _extends = require('./_extends.cjs.js');
4
4
  var contracts = require('@xpert-ai/contracts');
5
5
  var common = require('@nestjs/common');
6
- var tools = require('@langchain/core/tools');
7
6
  var v3 = require('zod/v3');
7
+ var tools = require('@langchain/core/tools');
8
8
 
9
9
  function createRuntimeCapability(id, options = {}) {
10
10
  return Object.freeze({
@@ -198,6 +198,10 @@ const ArtifactsRuntimeCapability = createRuntimeCapability('platform.artifacts',
198
198
  description: 'Create, version, preview, download, share, archive, and delete platform-managed plugin and Agent artifacts.'
199
199
  });
200
200
 
201
+ const ArtifactDraftsRuntimeCapability = createRuntimeCapability('platform.artifact-drafts', {
202
+ description: 'Persist working copies with optimistic concurrency; atomically publish a confirmed revision as an immutable Artifact version.'
203
+ });
204
+
201
205
  /** Stable source identifier for portable workspace file references. */ const WORKSPACE_FILES_SOURCE = 'platform.workspace.files';
202
206
  const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
203
207
  description: 'Upload, understand, search parsed chunks, resolve, read, and delete files in Xpert workspace volumes.'
@@ -211,6 +215,7 @@ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.worksp
211
215
  'SANDBOX_VERSION_MISMATCH',
212
216
  'SANDBOX_CAPACITY_UNAVAILABLE',
213
217
  'SANDBOX_START_FAILED',
218
+ 'SANDBOX_INVOCATION_FAILED',
214
219
  'BROWSER_LAUNCH_FAILED',
215
220
  'EXPORT_TIMEOUT',
216
221
  'EXPORT_OOM',
@@ -220,6 +225,12 @@ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.worksp
220
225
  'SANDBOX_CANCELLED'
221
226
  ];
222
227
  /** Line prefix used by trusted Actions to report structured, provider-neutral progress. */ const SANDBOX_JOB_PROGRESS_PREFIX = 'XPERT_SANDBOX_PROGRESS ';
228
+ /**
229
+ * Stdout frame: prefix + JSON { id, operation, payload } + newline.
230
+ * Core writes { id, value } to <workspaceRoot>/invocations/<id>.json after validation.
231
+ * IDs are unique per attempt and restricted to 1–64 ASCII letters, digits, '_' or '-'.
232
+ * The bridge has no network endpoint and gives the script no host credentials.
233
+ */ const SANDBOX_JOB_INVOCATION_PREFIX = 'XPERT_SANDBOX_INVOKE ';
223
234
  /** Error carrying retry policy and Job identity across plugin queue handlers. */ class SandboxJobRuntimeError extends Error {
224
235
  constructor(code, message, retryable, jobId){
225
236
  super(message);
@@ -254,6 +265,34 @@ const ToolImagesRuntimeCapability = createRuntimeCapability('platform.tool-image
254
265
  description: 'Save scoped immutable tool images and materialize verified pixels for one model request.'
255
266
  });
256
267
 
268
+ const McpClientRuntimeCapability = createRuntimeCapability('platform.mcp.client', {
269
+ description: 'Governed MCP client access using existing connections and viewer credentials; read-only tools initially.'
270
+ });
271
+
272
+ const RestClientRuntimeCapability = createRuntimeCapability('platform.rest.client', {
273
+ description: 'Governed JSON access through saved OpenAPI connections and platform-managed authentication.'
274
+ });
275
+
276
+ /** Portable Agent input; filesystem containment and authorization remain with the host. */ const workspaceRelativeFilePathSchema = v3.z.string().min(1).max(1024).refine((value)=>!/[\\\x00-\x1f\x7f]/.test(value) && !/^[A-Za-z]:/.test(value) && value.split('/').every((part)=>part.length > 0 && part === part.trim() && part !== '.' && part !== '..'), 'Use a workspace-relative file path with non-empty segments; no absolute paths, traversal or surrounding whitespace.');
277
+ /** Host-owned metadata lets plugins observe file intent without guessing tool names. */ const workspaceFileMutationMetadata = {
278
+ workspaceFileOperation: {
279
+ type: 'mutation',
280
+ pathArgument: 'file_path'
281
+ }
282
+ };
283
+ const mutationMetadata = v3.z.object({
284
+ workspaceFileOperation: v3.z.object({
285
+ type: v3.z.literal('mutation'),
286
+ pathArgument: v3.z.string().min(1)
287
+ })
288
+ });
289
+ function workspaceFileMutationPath(metadata, args) {
290
+ const descriptor = mutationMetadata.safeParse(metadata);
291
+ if (!descriptor.success) return undefined;
292
+ const path = workspaceRelativeFilePathSchema.safeParse(args[descriptor.data.workspaceFileOperation.pathArgument]);
293
+ return path.success ? path.data : undefined;
294
+ }
295
+
257
296
  /**
258
297
  * Shared host-runtime plumbing for built-in tools backed by a configured model provider.
259
298
  * Provider request/response semantics remain owned by each plugin.
@@ -370,17 +409,21 @@ function normalizeWorkspaceScope(scope) {
370
409
 
371
410
  exports.ActorTokenRuntimeCapability = ActorTokenRuntimeCapability;
372
411
  exports.ActorTokenRuntimeFactoryCapability = ActorTokenRuntimeFactoryCapability;
412
+ exports.ArtifactDraftsRuntimeCapability = ArtifactDraftsRuntimeCapability;
373
413
  exports.ArtifactsRuntimeCapability = ArtifactsRuntimeCapability;
374
414
  exports.BaseTool = BaseTool;
375
415
  exports.BaseToolset = BaseToolset;
376
416
  exports.BuiltinToolset = BuiltinToolset;
377
417
  exports.DefaultRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
418
+ exports.McpClientRuntimeCapability = McpClientRuntimeCapability;
378
419
  exports.ModelProviderBuiltinToolset = ModelProviderBuiltinToolset;
379
420
  exports.ProjectAccessRuntimeCapability = ProjectAccessRuntimeCapability;
380
421
  exports.ProjectProvisioningRuntimeCapability = ProjectProvisioningRuntimeCapability;
381
422
  exports.RUNTIME_CAPABILITY_PROVIDER = RUNTIME_CAPABILITY_PROVIDER;
423
+ exports.RestClientRuntimeCapability = RestClientRuntimeCapability;
382
424
  exports.RuntimeCapabilityProvider = RuntimeCapabilityProvider;
383
425
  exports.SANDBOX_JOB_ERROR_CODES = SANDBOX_JOB_ERROR_CODES;
426
+ exports.SANDBOX_JOB_INVOCATION_PREFIX = SANDBOX_JOB_INVOCATION_PREFIX;
384
427
  exports.SANDBOX_JOB_PROGRESS_PREFIX = SANDBOX_JOB_PROGRESS_PREFIX;
385
428
  exports.SandboxJobRuntimeError = SandboxJobRuntimeError;
386
429
  exports.SandboxJobsRuntimeCapability = SandboxJobsRuntimeCapability;
@@ -390,3 +433,6 @@ exports.WorkspaceFilesRuntimeCapability = WorkspaceFilesRuntimeCapability;
390
433
  exports.XPERT_RUNTIME_CAPABILITIES_TOKEN = XPERT_RUNTIME_CAPABILITIES_TOKEN;
391
434
  exports.createRuntimeCapability = createRuntimeCapability;
392
435
  exports.isSandboxJobRuntimeError = isSandboxJobRuntimeError;
436
+ exports.workspaceFileMutationMetadata = workspaceFileMutationMetadata;
437
+ exports.workspaceFileMutationPath = workspaceFileMutationPath;
438
+ exports.workspaceRelativeFilePathSchema = workspaceRelativeFilePathSchema;
@@ -1,8 +1,8 @@
1
1
  import { _ as _extends } from './_extends.esm.js';
2
2
  import { AiModelTypeEnum } from '@xpert-ai/contracts';
3
3
  import { SetMetadata, Logger } from '@nestjs/common';
4
- import { BaseToolkit, StructuredTool } from '@langchain/core/tools';
5
4
  import { z } from 'zod/v3';
5
+ import { BaseToolkit, StructuredTool } from '@langchain/core/tools';
6
6
 
7
7
  function createRuntimeCapability(id, options = {}) {
8
8
  return Object.freeze({
@@ -196,6 +196,10 @@ const ArtifactsRuntimeCapability = createRuntimeCapability('platform.artifacts',
196
196
  description: 'Create, version, preview, download, share, archive, and delete platform-managed plugin and Agent artifacts.'
197
197
  });
198
198
 
199
+ const ArtifactDraftsRuntimeCapability = createRuntimeCapability('platform.artifact-drafts', {
200
+ description: 'Persist working copies with optimistic concurrency; atomically publish a confirmed revision as an immutable Artifact version.'
201
+ });
202
+
199
203
  /** Stable source identifier for portable workspace file references. */ const WORKSPACE_FILES_SOURCE = 'platform.workspace.files';
200
204
  const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
201
205
  description: 'Upload, understand, search parsed chunks, resolve, read, and delete files in Xpert workspace volumes.'
@@ -209,6 +213,7 @@ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.worksp
209
213
  'SANDBOX_VERSION_MISMATCH',
210
214
  'SANDBOX_CAPACITY_UNAVAILABLE',
211
215
  'SANDBOX_START_FAILED',
216
+ 'SANDBOX_INVOCATION_FAILED',
212
217
  'BROWSER_LAUNCH_FAILED',
213
218
  'EXPORT_TIMEOUT',
214
219
  'EXPORT_OOM',
@@ -218,6 +223,12 @@ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.worksp
218
223
  'SANDBOX_CANCELLED'
219
224
  ];
220
225
  /** Line prefix used by trusted Actions to report structured, provider-neutral progress. */ const SANDBOX_JOB_PROGRESS_PREFIX = 'XPERT_SANDBOX_PROGRESS ';
226
+ /**
227
+ * Stdout frame: prefix + JSON { id, operation, payload } + newline.
228
+ * Core writes { id, value } to <workspaceRoot>/invocations/<id>.json after validation.
229
+ * IDs are unique per attempt and restricted to 1–64 ASCII letters, digits, '_' or '-'.
230
+ * The bridge has no network endpoint and gives the script no host credentials.
231
+ */ const SANDBOX_JOB_INVOCATION_PREFIX = 'XPERT_SANDBOX_INVOKE ';
221
232
  /** Error carrying retry policy and Job identity across plugin queue handlers. */ class SandboxJobRuntimeError extends Error {
222
233
  constructor(code, message, retryable, jobId){
223
234
  super(message);
@@ -252,6 +263,34 @@ const ToolImagesRuntimeCapability = createRuntimeCapability('platform.tool-image
252
263
  description: 'Save scoped immutable tool images and materialize verified pixels for one model request.'
253
264
  });
254
265
 
266
+ const McpClientRuntimeCapability = createRuntimeCapability('platform.mcp.client', {
267
+ description: 'Governed MCP client access using existing connections and viewer credentials; read-only tools initially.'
268
+ });
269
+
270
+ const RestClientRuntimeCapability = createRuntimeCapability('platform.rest.client', {
271
+ description: 'Governed JSON access through saved OpenAPI connections and platform-managed authentication.'
272
+ });
273
+
274
+ /** Portable Agent input; filesystem containment and authorization remain with the host. */ const workspaceRelativeFilePathSchema = z.string().min(1).max(1024).refine((value)=>!/[\\\x00-\x1f\x7f]/.test(value) && !/^[A-Za-z]:/.test(value) && value.split('/').every((part)=>part.length > 0 && part === part.trim() && part !== '.' && part !== '..'), 'Use a workspace-relative file path with non-empty segments; no absolute paths, traversal or surrounding whitespace.');
275
+ /** Host-owned metadata lets plugins observe file intent without guessing tool names. */ const workspaceFileMutationMetadata = {
276
+ workspaceFileOperation: {
277
+ type: 'mutation',
278
+ pathArgument: 'file_path'
279
+ }
280
+ };
281
+ const mutationMetadata = z.object({
282
+ workspaceFileOperation: z.object({
283
+ type: z.literal('mutation'),
284
+ pathArgument: z.string().min(1)
285
+ })
286
+ });
287
+ function workspaceFileMutationPath(metadata, args) {
288
+ const descriptor = mutationMetadata.safeParse(metadata);
289
+ if (!descriptor.success) return undefined;
290
+ const path = workspaceRelativeFilePathSchema.safeParse(args[descriptor.data.workspaceFileOperation.pathArgument]);
291
+ return path.success ? path.data : undefined;
292
+ }
293
+
255
294
  /**
256
295
  * Shared host-runtime plumbing for built-in tools backed by a configured model provider.
257
296
  * Provider request/response semantics remain owned by each plugin.
@@ -366,4 +405,4 @@ function normalizeWorkspaceScope(scope) {
366
405
  } : {});
367
406
  }
368
407
 
369
- export { ActorTokenRuntimeCapability as A, BuiltinToolset as B, DefaultRuntimeCapabilityRegistry as D, ModelProviderBuiltinToolset as M, ProjectAccessRuntimeCapability as P, RUNTIME_CAPABILITY_PROVIDER as R, SANDBOX_JOB_ERROR_CODES as S, ToolImagesRuntimeCapability as T, WorkspaceFilesRuntimeCapability as W, XPERT_RUNTIME_CAPABILITIES_TOKEN as X, ActorTokenRuntimeFactoryCapability as a, ArtifactsRuntimeCapability as b, createRuntimeCapability as c, BaseTool as d, BaseToolset as e, ProjectProvisioningRuntimeCapability as f, RuntimeCapabilityProvider as g, SANDBOX_JOB_PROGRESS_PREFIX as h, SandboxJobRuntimeError as i, SandboxJobsRuntimeCapability as j, WORKSPACE_FILES_SOURCE as k, isSandboxJobRuntimeError as l };
408
+ export { ActorTokenRuntimeCapability as A, BuiltinToolset as B, DefaultRuntimeCapabilityRegistry as D, ModelProviderBuiltinToolset as M, ProjectAccessRuntimeCapability as P, RUNTIME_CAPABILITY_PROVIDER as R, SANDBOX_JOB_ERROR_CODES as S, ToolImagesRuntimeCapability as T, WorkspaceFilesRuntimeCapability as W, XPERT_RUNTIME_CAPABILITIES_TOKEN as X, ActorTokenRuntimeFactoryCapability as a, ArtifactDraftsRuntimeCapability as b, createRuntimeCapability as c, ArtifactsRuntimeCapability as d, BaseTool as e, BaseToolset as f, McpClientRuntimeCapability as g, ProjectProvisioningRuntimeCapability as h, RestClientRuntimeCapability as i, RuntimeCapabilityProvider as j, SANDBOX_JOB_INVOCATION_PREFIX as k, SANDBOX_JOB_PROGRESS_PREFIX as l, SandboxJobRuntimeError as m, SandboxJobsRuntimeCapability as n, WORKSPACE_FILES_SOURCE as o, isSandboxJobRuntimeError as p, workspaceFileMutationPath as q, workspaceRelativeFilePathSchema as r, workspaceFileMutationMetadata as w };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/plugin-sdk",
3
- "version": "3.23.0",
3
+ "version": "3.25.0",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,6 +12,12 @@
12
12
  "main": "./index.cjs.js",
13
13
  "module": "./index.esm.js",
14
14
  "exports": {
15
+ "./analytics": {
16
+ "module": "./analytics.esm.js",
17
+ "types": "./analytics.d.ts",
18
+ "import": "./analytics.cjs.mjs",
19
+ "default": "./analytics.cjs.js"
20
+ },
15
21
  "./package.json": "./package.json",
16
22
  ".": {
17
23
  "module": "./index.esm.js",
@@ -31,6 +37,12 @@
31
37
  "import": "./data-workbench.cjs.mjs",
32
38
  "default": "./data-workbench.cjs.js"
33
39
  },
40
+ "./artifact-document": {
41
+ "module": "./artifact-document.esm.js",
42
+ "types": "./artifact-document.d.ts",
43
+ "import": "./artifact-document.cjs.mjs",
44
+ "default": "./artifact-document.cjs.js"
45
+ },
34
46
  "./collaboration-client": {
35
47
  "module": "./collaboration-client.esm.js",
36
48
  "types": "./collaboration-client.d.ts",
@@ -62,7 +74,7 @@
62
74
  },
63
75
  "dependencies": {
64
76
  "@langchain/openai": "0.6.9",
65
- "@xpert-ai/contracts": "3.22.0",
77
+ "@xpert-ai/contracts": "3.25.0",
66
78
  "express": "^4.22.1",
67
79
  "js-tiktoken": "^1.0.21"
68
80
  },
@@ -0,0 +1,3 @@
1
+ /** Browser-safe Dataset/Binding validation; no registry or Nest runtime imports. */
2
+ export * from './lib/data/analytics/analytics.schema';
3
+ export * from './lib/data/analytics/analytics-result';
@@ -0,0 +1,5 @@
1
+ /** Browser-safe host for untrusted HTML; no Nest, credentials or provider implementations. */
2
+ export * from './lib/artifact-document/protocol';
3
+ export * from './lib/artifact-document/runtime';
4
+ export * from './lib/artifact-document/host';
5
+ export * from './lib/artifact-document/dependencies';
package/src/index.d.ts CHANGED
@@ -26,10 +26,12 @@ export * from './lib/sandbox/index';
26
26
  export * from './lib/managed-connection/index';
27
27
  export * from './lib/managed-queue/index';
28
28
  export * from './lib/view-extension/index';
29
+ export * from './lib/artifact-presentation/index';
29
30
  export * from './lib/collaboration/index';
30
31
  export * from './lib/evolution/index';
31
32
  export * from './lib/mcp/index';
32
33
  export * from './lib/tool-provider/index';
33
34
  export * from './lib/project-type/index';
34
35
  export * from './lib/project-task/index';
36
+ export * from './lib/project-pipeline';
35
37
  export * from './lib/agent-plugin/import-default-agent-plugins.command';
@@ -14,38 +14,38 @@ export declare const agentRuntimeEventSchema: z.ZodDiscriminatedUnion<"kind", [z
14
14
  completed: z.ZodNumber;
15
15
  total: z.ZodNumber;
16
16
  }, "strict", z.ZodTypeAny, {
17
- completed?: number;
18
- total?: number;
17
+ completed: number;
18
+ total: number;
19
19
  }, {
20
- completed?: number;
21
- total?: number;
20
+ completed: number;
21
+ total: number;
22
22
  }>, {
23
- completed?: number;
24
- total?: number;
23
+ completed: number;
24
+ total: number;
25
25
  }, {
26
- completed?: number;
27
- total?: number;
26
+ completed: number;
27
+ total: number;
28
28
  }>>;
29
29
  }, "strict", z.ZodTypeAny, {
30
- source?: "executor" | "host";
31
- startedAt?: string;
32
- summary?: string;
30
+ source: "executor" | "host";
31
+ observedAt: string;
32
+ startedAt?: string | undefined;
33
+ summary?: string | undefined;
34
+ phase?: string | undefined;
33
35
  steps?: {
34
- completed?: number;
35
- total?: number;
36
- };
37
- observedAt?: string;
38
- phase?: string;
36
+ completed: number;
37
+ total: number;
38
+ } | undefined;
39
39
  }, {
40
- source?: "executor" | "host";
41
- startedAt?: string;
42
- summary?: string;
40
+ source: "executor" | "host";
41
+ observedAt: string;
42
+ startedAt?: string | undefined;
43
+ summary?: string | undefined;
44
+ phase?: string | undefined;
43
45
  steps?: {
44
- completed?: number;
45
- total?: number;
46
- };
47
- observedAt?: string;
48
- phase?: string;
46
+ completed: number;
47
+ total: number;
48
+ } | undefined;
49
49
  }>;
50
50
  version: z.ZodLiteral<1>;
51
51
  invocationId: z.ZodString;
@@ -56,53 +56,53 @@ export declare const agentRuntimeEventSchema: z.ZodDiscriminatedUnion<"kind", [z
56
56
  projectTaskId: z.ZodString;
57
57
  taskExecutionId: z.ZodString;
58
58
  }, "strict", z.ZodTypeAny, {
59
- projectId?: string;
60
- projectTaskId?: string;
61
- taskExecutionId?: string;
59
+ projectId: string;
60
+ projectTaskId: string;
61
+ taskExecutionId: string;
62
62
  }, {
63
- projectId?: string;
64
- projectTaskId?: string;
65
- taskExecutionId?: string;
63
+ projectId: string;
64
+ projectTaskId: string;
65
+ taskExecutionId: string;
66
66
  }>>;
67
67
  }, "strict", z.ZodTypeAny, {
68
68
  version?: 1;
69
69
  kind?: "progress";
70
- projectTask?: {
71
- projectId?: string;
72
- projectTaskId?: string;
73
- taskExecutionId?: string;
74
- };
75
70
  progress?: {
76
- source?: "executor" | "host";
77
- startedAt?: string;
78
- summary?: string;
71
+ source: "executor" | "host";
72
+ observedAt: string;
73
+ startedAt?: string | undefined;
74
+ summary?: string | undefined;
75
+ phase?: string | undefined;
79
76
  steps?: {
80
- completed?: number;
81
- total?: number;
82
- };
83
- observedAt?: string;
84
- phase?: string;
77
+ completed: number;
78
+ total: number;
79
+ } | undefined;
80
+ };
81
+ projectTask?: {
82
+ projectId: string;
83
+ projectTaskId: string;
84
+ taskExecutionId: string;
85
85
  };
86
86
  invocationId?: string;
87
87
  revision?: number;
88
88
  }, {
89
89
  version?: 1;
90
90
  kind?: "progress";
91
- projectTask?: {
92
- projectId?: string;
93
- projectTaskId?: string;
94
- taskExecutionId?: string;
95
- };
96
91
  progress?: {
97
- source?: "executor" | "host";
98
- startedAt?: string;
99
- summary?: string;
92
+ source: "executor" | "host";
93
+ observedAt: string;
94
+ startedAt?: string | undefined;
95
+ summary?: string | undefined;
96
+ phase?: string | undefined;
100
97
  steps?: {
101
- completed?: number;
102
- total?: number;
103
- };
104
- observedAt?: string;
105
- phase?: string;
98
+ completed: number;
99
+ total: number;
100
+ } | undefined;
101
+ };
102
+ projectTask?: {
103
+ projectId: string;
104
+ projectTaskId: string;
105
+ taskExecutionId: string;
106
106
  };
107
107
  invocationId?: string;
108
108
  revision?: number;
@@ -118,22 +118,22 @@ export declare const agentRuntimeEventSchema: z.ZodDiscriminatedUnion<"kind", [z
118
118
  projectTaskId: z.ZodString;
119
119
  taskExecutionId: z.ZodString;
120
120
  }, "strict", z.ZodTypeAny, {
121
- projectId?: string;
122
- projectTaskId?: string;
123
- taskExecutionId?: string;
121
+ projectId: string;
122
+ projectTaskId: string;
123
+ taskExecutionId: string;
124
124
  }, {
125
- projectId?: string;
126
- projectTaskId?: string;
127
- taskExecutionId?: string;
125
+ projectId: string;
126
+ projectTaskId: string;
127
+ taskExecutionId: string;
128
128
  }>>;
129
129
  }, "strict", z.ZodTypeAny, {
130
130
  status?: "failed" | "succeeded" | "cancelled";
131
131
  version?: 1;
132
132
  kind?: "result";
133
133
  projectTask?: {
134
- projectId?: string;
135
- projectTaskId?: string;
136
- taskExecutionId?: string;
134
+ projectId: string;
135
+ projectTaskId: string;
136
+ taskExecutionId: string;
137
137
  };
138
138
  invocationId?: string;
139
139
  revision?: number;
@@ -142,9 +142,9 @@ export declare const agentRuntimeEventSchema: z.ZodDiscriminatedUnion<"kind", [z
142
142
  version?: 1;
143
143
  kind?: "result";
144
144
  projectTask?: {
145
- projectId?: string;
146
- projectTaskId?: string;
147
- taskExecutionId?: string;
145
+ projectId: string;
146
+ projectTaskId: string;
147
+ taskExecutionId: string;
148
148
  };
149
149
  invocationId?: string;
150
150
  revision?: number;
@@ -160,21 +160,21 @@ export declare const agentRuntimeEventSchema: z.ZodDiscriminatedUnion<"kind", [z
160
160
  projectTaskId: z.ZodString;
161
161
  taskExecutionId: z.ZodString;
162
162
  }, "strict", z.ZodTypeAny, {
163
- projectId?: string;
164
- projectTaskId?: string;
165
- taskExecutionId?: string;
163
+ projectId: string;
164
+ projectTaskId: string;
165
+ taskExecutionId: string;
166
166
  }, {
167
- projectId?: string;
168
- projectTaskId?: string;
169
- taskExecutionId?: string;
167
+ projectId: string;
168
+ projectTaskId: string;
169
+ taskExecutionId: string;
170
170
  }>>;
171
171
  }, "strict", z.ZodTypeAny, {
172
172
  version?: 1;
173
173
  kind?: "input_request";
174
174
  projectTask?: {
175
- projectId?: string;
176
- projectTaskId?: string;
177
- taskExecutionId?: string;
175
+ projectId: string;
176
+ projectTaskId: string;
177
+ taskExecutionId: string;
178
178
  };
179
179
  invocationId?: string;
180
180
  revision?: number;
@@ -183,9 +183,9 @@ export declare const agentRuntimeEventSchema: z.ZodDiscriminatedUnion<"kind", [z
183
183
  version?: 1;
184
184
  kind?: "input_request";
185
185
  projectTask?: {
186
- projectId?: string;
187
- projectTaskId?: string;
188
- taskExecutionId?: string;
186
+ projectId: string;
187
+ projectTaskId: string;
188
+ taskExecutionId: string;
189
189
  };
190
190
  invocationId?: string;
191
191
  revision?: number;
@@ -1,4 +1,4 @@
1
- import type { JSONValue, TAvatar } from '@xpert-ai/contracts';
1
+ import type { JSONValue, TAvatar, ProjectPipelineNativeSource } from '@xpert-ai/contracts';
2
2
  /** Task lifecycle snapshot. interrupted means paused; unknown does not confirm failure. */
3
3
  export type AgentMiddlewareAssistantTaskStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'interrupted' | 'unknown';
4
4
  /** Existing platform file reference; access remains subject to host authorization. */
@@ -28,6 +28,30 @@ export type AgentMiddlewareExternalAssistantExpectation = {
28
28
  templateKey: string;
29
29
  agentKey: string;
30
30
  };
31
+ export type AgentMiddlewarePublishedAgentTarget = {
32
+ requesterXpertId: string;
33
+ expectation: AgentMiddlewareExternalAssistantExpectation;
34
+ };
35
+ export type AgentMiddlewareResolvedAgent = {
36
+ xpertId: string;
37
+ workspaceId: string;
38
+ agentKey: string;
39
+ };
40
+ /** Safe capabilities of the exact accessible published Assistant; no draft or prompt content. */
41
+ export type AgentMiddlewarePublishedContext = {
42
+ primaryAgentKey: string | null;
43
+ publishedVersion: string;
44
+ templateSource: {
45
+ pluginName?: string;
46
+ templateKey: string;
47
+ } | null;
48
+ features: string[];
49
+ availableAgents: Array<{
50
+ key: string;
51
+ title?: string;
52
+ role?: string;
53
+ }>;
54
+ };
31
55
  /** Resolve the executor from the requester's required, direct published external-Assistant connections. */
32
56
  export type AgentMiddlewareAssistantTaskTarget = {
33
57
  kind: 'external_assistant';
@@ -93,6 +117,8 @@ export type AgentMiddlewareCorrelatedExecution = {
93
117
  export type AgentMiddlewareAssistantTaskInput = {
94
118
  /** Current/requesting Assistant ID; must match target.requesterXpertId when target is supplied. */
95
119
  xpertId: string;
120
+ /** Fail before dispatch if the accessible published executor changed after the caller prepared its intent. */
121
+ expectedPublishedVersion?: string;
96
122
  /** Selects the base/Primary model; child Agents retain authored models. */
97
123
  modelId?: string;
98
124
  /** Entry Agent for the current Assistant; external targets use their resolved primary Agent. */
@@ -102,6 +128,8 @@ export type AgentMiddlewareAssistantTaskInput = {
102
128
  conversationId?: string | null;
103
129
  executionId?: string | null;
104
130
  projectId?: string | null;
131
+ /** Optional Pipeline dispatch provenance. Host revalidates the lease and pins exact native identities before dispatch. */
132
+ pipelineSource?: ProjectPipelineNativeSource;
105
133
  taskId?: string;
106
134
  /** Per-run idempotency key. Otherwise correlation.operationId or executionId is used; taskId alone is insufficient. */
107
135
  clientMessageId?: string;
@@ -143,6 +171,11 @@ export type AgentMiddlewareAssistantTaskCancelResult = {
143
171
  };
144
172
  /** Host Assistant Task API. Feature-detect optional methods before calling them. */
145
173
  export interface AgentMiddlewareAssistantTaskApi {
174
+ getPublishedContext?(xpertId: string): Promise<AgentMiddlewarePublishedContext>;
175
+ /** Resolve an Agent entrypoint in an accessible published Assistant in the requester's workspace. Ambiguous matches are rejected. */
176
+ resolvePublishedAgent?(input: AgentMiddlewarePublishedAgentTarget): Promise<AgentMiddlewareResolvedAgent>;
177
+ /** Delegate a trusted plugin operation to the resolved resource with live access checks; preserve the original credential audience. */
178
+ withPublishedAgent?<T>(input: AgentMiddlewarePublishedAgentTarget, operation: (target: AgentMiddlewareResolvedAgent) => Promise<T>): Promise<T>;
146
179
  /**
147
180
  * Verify that a running native delegate is the requester's bound external role.
148
181
  *
@@ -174,6 +207,8 @@ export interface AgentMiddlewareAssistantTaskApi {
174
207
  getModels?(xpertId: string): Promise<import('@xpert-ai/contracts').TAssistantModelsResponse>;
175
208
  /** Submit once and retain the receipt; use getTaskStatus to follow asynchronous progress. */
176
209
  startTask(input: AgentMiddlewareAssistantTaskInput): Promise<AgentMiddlewareAssistantTaskResult>;
210
+ /** Pin a Pipeline task before persisting deferred work. Save the returned input unchanged; this does not start execution. */
211
+ preparePipelineTask?(input: AgentMiddlewareAssistantTaskInput): Promise<AgentMiddlewareAssistantTaskInput>;
177
212
  /** List safe binding descriptors without deployed Assistant instance IDs. */
178
213
  listExternalAssistantBindings?(input: AgentMiddlewareListExternalAssistantBindingsInput): Promise<AgentMiddlewareExternalAssistantBinding[]>;
179
214
  /** Read executions owned by the requester and its currently bound external Assistants. */