@xpert-ai/plugin-sdk 3.34.0 → 3.36.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 (66) hide show
  1. package/agent-results.cjs.js +5 -1
  2. package/agent-results.esm.js +2 -2
  3. package/analytics-result.cjs.js +64 -27
  4. package/analytics-result.esm.js +62 -28
  5. package/analytics.cjs.js +157 -15
  6. package/analytics.esm.js +154 -17
  7. package/artifact-document.cjs.js +9 -3
  8. package/artifact-document.esm.js +9 -3
  9. package/collaboration-client.cjs.js +274 -140
  10. package/collaboration-client.esm.js +273 -141
  11. package/docs/README.md +23 -0
  12. package/index.cjs.js +214 -9
  13. package/index.esm.js +193 -15
  14. package/model-provider.cjs.js +8 -0
  15. package/model-provider.esm.js +7 -1
  16. package/package.json +8 -2
  17. package/remote-component.cjs.default.js +1 -0
  18. package/remote-component.cjs.js +143 -0
  19. package/remote-component.cjs.mjs +2 -0
  20. package/remote-component.d.ts +1 -0
  21. package/remote-component.esm.js +139 -0
  22. package/results.cjs.js +2 -6
  23. package/results.esm.js +2 -6
  24. package/src/analytics.d.ts +2 -0
  25. package/src/collaboration-client.d.ts +1 -0
  26. package/src/index.d.ts +1 -0
  27. package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +24 -24
  28. package/src/lib/agent/middleware/strategy.interface.d.ts +2 -0
  29. package/src/lib/agent/runtime/capability.d.ts +2 -0
  30. package/src/lib/agent/runtime/cli-model-profile.d.ts +14 -1
  31. package/src/lib/agent/runtime/dispatch.d.ts +298 -75
  32. package/src/lib/agent/runtime/execution-runner.d.ts +24 -5
  33. package/src/lib/agent/runtime/pipeline-scope.d.ts +4 -4
  34. package/src/lib/agent/runtime/results.d.ts +16 -219
  35. package/src/lib/agent/runtime/strategy.d.ts +3 -0
  36. package/src/lib/agent/runtime/types.d.ts +21 -0
  37. package/src/lib/agent-event/index.d.ts +55 -0
  38. package/src/lib/agent-event/journal.d.ts +30 -0
  39. package/src/lib/artifact-document/dependencies.d.ts +13 -13
  40. package/src/lib/artifact-document/protocol.d.ts +2 -2
  41. package/src/lib/artifact-document/scheduler.d.ts +3 -0
  42. package/src/lib/assistant-capability/middleware.d.ts +2 -1
  43. package/src/lib/collaboration/client.d.ts +6 -59
  44. package/src/lib/collaboration/index.d.ts +1 -0
  45. package/src/lib/collaboration/operations-client.d.ts +23 -0
  46. package/src/lib/collaboration/presence.d.ts +36 -0
  47. package/src/lib/collaboration/provider.registry.d.ts +2 -2
  48. package/src/lib/collaboration/transport.d.ts +24 -0
  49. package/src/lib/collaboration/types.d.ts +57 -5
  50. package/src/lib/content-resource/catalog.d.ts +23 -1
  51. package/src/lib/content-resource/editor.d.ts +36 -1
  52. package/src/lib/data/analytics/analysis-evidence.d.ts +757 -0
  53. package/src/lib/data/analytics/analytics-certification.d.ts +64 -0
  54. package/src/lib/data/analytics/analytics-provider.d.ts +9 -0
  55. package/src/lib/data/analytics/analytics-value.d.ts +5 -0
  56. package/src/lib/data/analytics/index.d.ts +1 -0
  57. package/src/lib/evolution/runtime-capability.d.ts +1 -0
  58. package/src/lib/project-pipeline/adapters.d.ts +9 -2
  59. package/src/lib/project-pipeline/registry.d.ts +53 -50
  60. package/src/lib/project-task/acceptance.d.ts +29 -0
  61. package/src/lib/project-task/index.d.ts +6 -0
  62. package/src/lib/runtime/capabilities/index.d.ts +2 -0
  63. package/src/lib/runtime/capabilities/plugin-test-access.d.ts +14 -0
  64. package/src/lib/runtime/capabilities/project-configuration.d.ts +166 -0
  65. package/src/lib/view-extension/provider.interface.d.ts +51 -0
  66. package/src/remote-component.d.ts +13 -0
@@ -35,10 +35,10 @@ export declare const projectPipelineInvocationScopeSchema: z.ZodEffects<z.ZodObj
35
35
  generation: number;
36
36
  }>;
37
37
  }, "strict", z.ZodTypeAny, {
38
+ projectId?: string;
38
39
  userId?: string;
39
40
  organizationId?: string;
40
41
  tenantId?: string;
41
- projectId?: string;
42
42
  workspaceId?: string;
43
43
  callerType?: "project_pipeline";
44
44
  callerAgentKey?: "pipeline_node";
@@ -53,10 +53,10 @@ export declare const projectPipelineInvocationScopeSchema: z.ZodEffects<z.ZodObj
53
53
  generation: number;
54
54
  };
55
55
  }, {
56
+ projectId?: string;
56
57
  userId?: string;
57
58
  organizationId?: string;
58
59
  tenantId?: string;
59
- projectId?: string;
60
60
  workspaceId?: string;
61
61
  callerType?: "project_pipeline";
62
62
  callerAgentKey?: "pipeline_node";
@@ -71,10 +71,10 @@ export declare const projectPipelineInvocationScopeSchema: z.ZodEffects<z.ZodObj
71
71
  generation: number;
72
72
  };
73
73
  }>, {
74
+ projectId?: string;
74
75
  userId?: string;
75
76
  organizationId?: string;
76
77
  tenantId?: string;
77
- projectId?: string;
78
78
  workspaceId?: string;
79
79
  callerType?: "project_pipeline";
80
80
  callerAgentKey?: "pipeline_node";
@@ -89,10 +89,10 @@ export declare const projectPipelineInvocationScopeSchema: z.ZodEffects<z.ZodObj
89
89
  generation: number;
90
90
  };
91
91
  }, {
92
+ projectId?: string;
92
93
  userId?: string;
93
94
  organizationId?: string;
94
95
  tenantId?: string;
95
- projectId?: string;
96
96
  workspaceId?: string;
97
97
  callerType?: "project_pipeline";
98
98
  callerAgentKey?: "pipeline_node";
@@ -2,7 +2,7 @@ import { z } from 'zod/v3';
2
2
  import { type AgentOutputDelivery } from '@xpert-ai/contracts';
3
3
  /** Opt in to the host's authorized, on-demand result View from middleware metadata. */
4
4
  export declare const AGENT_TASK_RESULTS_FEATURE = "agent_task_results";
5
- export { agentResultPathSchema, agentOutputDeliverySchema, type AgentOutputDelivery } from '@xpert-ai/contracts';
5
+ export { agentResultPathSchema, agentOutputDeliverySchema, agentDeliveryRecoverySchema, type AgentDeliveryRecovery, type AgentOutputDelivery } from '@xpert-ai/contracts';
6
6
  /** Machine-readable result kind; file declarations are not committed artifacts or download grants. */
7
7
  export declare const agentResultItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8
8
  type: z.ZodLiteral<"analysis">;
@@ -93,224 +93,21 @@ export declare const agentResultItemSchema: z.ZodDiscriminatedUnion<"type", [z.Z
93
93
  summary?: string;
94
94
  }>]>;
95
95
  export type AgentResultItem = z.output<typeof agentResultItemSchema>;
96
- /** Explicit final response envelope shared by adapters; ordinary prose is never classified heuristically. */
97
- export declare const agentTaskResultSchema: z.ZodEffects<z.ZodObject<{
98
- version: z.ZodLiteral<1>;
99
- summary: z.ZodString;
100
- items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
101
- type: z.ZodLiteral<"analysis">;
102
- id: z.ZodString;
103
- title: z.ZodString;
104
- summary: z.ZodString;
105
- }, "strict", z.ZodTypeAny, {
106
- type?: "analysis";
107
- id?: string;
108
- title?: string;
109
- summary?: string;
110
- }, {
111
- type?: "analysis";
112
- id?: string;
113
- title?: string;
114
- summary?: string;
115
- }>, z.ZodObject<{
116
- type: z.ZodLiteral<"changes">;
117
- files: z.ZodArray<z.ZodObject<{
118
- path: z.ZodEffects<z.ZodString, string, string>;
119
- change: z.ZodEnum<["created", "modified", "deleted"]>;
120
- }, "strict", z.ZodTypeAny, {
121
- path?: string;
122
- change?: "created" | "modified" | "deleted";
123
- }, {
124
- path?: string;
125
- change?: "created" | "modified" | "deleted";
126
- }>, "many">;
127
- id: z.ZodString;
128
- title: z.ZodString;
129
- summary: z.ZodString;
130
- }, "strict", z.ZodTypeAny, {
131
- type?: "changes";
132
- id?: string;
133
- title?: string;
134
- summary?: string;
135
- files?: {
136
- path?: string;
137
- change?: "created" | "modified" | "deleted";
138
- }[];
139
- }, {
140
- type?: "changes";
141
- id?: string;
142
- title?: string;
143
- summary?: string;
144
- files?: {
145
- path?: string;
146
- change?: "created" | "modified" | "deleted";
147
- }[];
148
- }>, z.ZodObject<{
149
- type: z.ZodLiteral<"tests">;
150
- status: z.ZodEnum<["passed", "failed", "skipped"]>;
151
- command: z.ZodOptional<z.ZodString>;
152
- id: z.ZodString;
153
- title: z.ZodString;
154
- summary: z.ZodString;
155
- }, "strict", z.ZodTypeAny, {
156
- type?: "tests";
157
- status?: "passed" | "failed" | "skipped";
158
- id?: string;
159
- title?: string;
160
- summary?: string;
161
- command?: string;
162
- }, {
163
- type?: "tests";
164
- status?: "passed" | "failed" | "skipped";
165
- id?: string;
166
- title?: string;
167
- summary?: string;
168
- command?: string;
169
- }>, z.ZodObject<{
170
- type: z.ZodLiteral<"file">;
171
- path: z.ZodEffects<z.ZodString, string, string>;
172
- id: z.ZodString;
173
- title: z.ZodString;
174
- summary: z.ZodString;
175
- }, "strict", z.ZodTypeAny, {
176
- type?: "file";
177
- path?: string;
178
- id?: string;
179
- title?: string;
180
- summary?: string;
181
- }, {
182
- type?: "file";
183
- path?: string;
184
- id?: string;
185
- title?: string;
186
- summary?: string;
187
- }>]>, "many">;
188
- }, "strict", z.ZodTypeAny, {
189
- summary?: string;
190
- version?: 1;
191
- items?: ({
192
- type?: "analysis";
193
- id?: string;
194
- title?: string;
195
- summary?: string;
196
- } | {
197
- type?: "changes";
198
- id?: string;
199
- title?: string;
200
- summary?: string;
201
- files?: {
202
- path?: string;
203
- change?: "created" | "modified" | "deleted";
204
- }[];
205
- } | {
206
- type?: "tests";
207
- status?: "passed" | "failed" | "skipped";
208
- id?: string;
209
- title?: string;
210
- summary?: string;
211
- command?: string;
212
- } | {
213
- type?: "file";
214
- path?: string;
215
- id?: string;
216
- title?: string;
217
- summary?: string;
218
- })[];
219
- }, {
220
- summary?: string;
221
- version?: 1;
222
- items?: ({
223
- type?: "analysis";
224
- id?: string;
225
- title?: string;
226
- summary?: string;
227
- } | {
228
- type?: "changes";
229
- id?: string;
230
- title?: string;
231
- summary?: string;
232
- files?: {
233
- path?: string;
234
- change?: "created" | "modified" | "deleted";
235
- }[];
236
- } | {
237
- type?: "tests";
238
- status?: "passed" | "failed" | "skipped";
239
- id?: string;
240
- title?: string;
241
- summary?: string;
242
- command?: string;
243
- } | {
244
- type?: "file";
245
- path?: string;
246
- id?: string;
247
- title?: string;
248
- summary?: string;
249
- })[];
250
- }>, {
251
- summary?: string;
252
- version?: 1;
253
- items?: ({
254
- type?: "analysis";
255
- id?: string;
256
- title?: string;
257
- summary?: string;
258
- } | {
259
- type?: "changes";
260
- id?: string;
261
- title?: string;
262
- summary?: string;
263
- files?: {
264
- path?: string;
265
- change?: "created" | "modified" | "deleted";
266
- }[];
267
- } | {
268
- type?: "tests";
269
- status?: "passed" | "failed" | "skipped";
270
- id?: string;
271
- title?: string;
272
- summary?: string;
273
- command?: string;
274
- } | {
275
- type?: "file";
276
- path?: string;
277
- id?: string;
278
- title?: string;
279
- summary?: string;
280
- })[];
281
- }, {
282
- summary?: string;
283
- version?: 1;
284
- items?: ({
285
- type?: "analysis";
286
- id?: string;
287
- title?: string;
288
- summary?: string;
289
- } | {
290
- type?: "changes";
291
- id?: string;
292
- title?: string;
293
- summary?: string;
294
- files?: {
295
- path?: string;
296
- change?: "created" | "modified" | "deleted";
297
- }[];
298
- } | {
299
- type?: "tests";
300
- status?: "passed" | "failed" | "skipped";
301
- id?: string;
302
- title?: string;
303
- summary?: string;
304
- command?: string;
305
- } | {
306
- type?: "file";
307
- path?: string;
308
- id?: string;
309
- title?: string;
310
- summary?: string;
311
- })[];
312
- }>;
313
- export type AgentTaskResult = z.output<typeof agentTaskResultSchema>;
96
+ /** Report bytes are transported independently of artifact quotas and business acceptance. */
97
+ export declare const AGENT_TASK_REPORT_MAX_BYTES: number;
98
+ export type AgentTaskReport = {
99
+ text: string;
100
+ sha256: string;
101
+ };
102
+ export type AgentReportDelivery = {
103
+ status: 'completed';
104
+ sha256: string;
105
+ path?: string;
106
+ } | {
107
+ status: 'failed';
108
+ code: 'report_unavailable' | 'report_empty' | 'report_too_large';
109
+ path?: string;
110
+ };
314
111
  /** Persist only after the platform has committed the artifact; never accept an ID invented by a model. */
315
112
  export interface AgentResultArtifact {
316
113
  id: string;
@@ -1,4 +1,5 @@
1
1
  import { DiscoveryService, Reflector } from '@nestjs/core';
2
+ import type { ProjectTaskExecutionContext } from '@xpert-ai/contracts';
2
3
  import type { RuntimeCapabilityRegistry } from '../../core/runtime-capability';
3
4
  import { BaseStrategyRegistry, type StrategySource } from '../../strategy';
4
5
  import type { AgentActivityRecorder } from './activity';
@@ -15,6 +16,8 @@ export interface AgentRuntimeContext {
15
16
  /** Durable host invocation ID used to correlate provider receipts. */
16
17
  invocationId: string;
17
18
  scope: Readonly<AgentInvocationScope>;
19
+ /** Validated host task snapshot, separate from reply routing; does not grant workspace access. */
20
+ projectTask?: Readonly<ProjectTaskExecutionContext>;
18
21
  /** Cooperative cancellation; abort alone does not confirm remote termination. */
19
22
  signal?: AbortSignal;
20
23
  capabilities: RuntimeCapabilityRegistry;
@@ -90,7 +90,17 @@ export interface AgentInvocationInput {
90
90
  }
91
91
  /** Output or in-progress receipt. Check invocation status before treating it as final. */
92
92
  export interface AgentInvocationResult {
93
+ /** Optional reply content, preserved without imposing a report format; may be empty. */
93
94
  text: string;
95
+ /** The reply exceeded the transport limit; no partial text is presented as complete evidence. */
96
+ textTruncated?: boolean;
97
+ /** Present only when a report file was explicitly selected. */
98
+ report?: import('./results').AgentReportDelivery;
99
+ deliveryHistory?: Array<{
100
+ at: string;
101
+ report?: import('./results').AgentReportDelivery;
102
+ export?: AgentOutputExport;
103
+ }>;
94
104
  /** Explicit adapter-normalized findings; display kind is never inferred from prose or titles. */
95
105
  items?: AgentResultItem[];
96
106
  /** Separate delivery outcome; task success does not imply that files were exported. */
@@ -146,8 +156,15 @@ export interface AgentInvocationRequest {
146
156
  /** Optional host-owned asynchronous reply and project association; not supplied by the execution Agent. */
147
157
  dispatch?: AgentInvocationDispatchContext;
148
158
  }
159
+ /** Host supervisor causes; provider observations cannot replace a pending termination. */
160
+ export type AgentRunnerTerminationReason = 'authorization_revoked' | 'lease_expired' | 'runner_unavailable';
149
161
  /** Host-owned invocation snapshot; not an update DTO. */
150
162
  export interface AgentInvocation extends AgentRuntimeObservation {
163
+ /** Durable host stop intent. Only matching descendant-exit evidence can settle this execution. */
164
+ runnerTermination?: {
165
+ reason: AgentRunnerTerminationReason;
166
+ requestedAt: string;
167
+ };
151
168
  /** Persisted business outcome awaiting independent process completion evidence. */
152
169
  reportedOutcome?: 'succeeded' | 'failed' | 'cancelled';
153
170
  /** Pinned at admission; plugins cannot replace the original host or execution generation. */
@@ -173,6 +190,8 @@ export interface AgentInvocation extends AgentRuntimeObservation {
173
190
  activity?: ExecutionActivityCapabilities;
174
191
  /** Host startup fence; intermediate receipts are not inspected until start returns or this deadline expires. */
175
192
  startPendingUntil?: string;
193
+ /** Host-only startup owner; a stale heartbeat cannot renew another launch. */
194
+ startPendingId?: string;
176
195
  /** Host invocation ID used by inspect, cancel and respond. */
177
196
  id: string;
178
197
  /** Host-managed concurrency revision, distinct from the target version. */
@@ -182,6 +201,8 @@ export interface AgentInvocation extends AgentRuntimeObservation {
182
201
  /** Host timestamps in ISO 8601 format. */
183
202
  createdAt: string;
184
203
  updatedAt: string;
204
+ /** First host-confirmed terminal observation; delivery recovery does not extend runtime. Absent on old records. */
205
+ completedAt?: string;
185
206
  }
186
207
  /** Checks confirmed completion; unknown remains non-terminal. */
187
208
  export declare function isAgentInvocationTerminal(status: AgentInvocationStatus): boolean;
@@ -0,0 +1,55 @@
1
+ import type { AgentEventPresentation, AgentEventTypeDefinition, EventDecision, PluginAgentEvent } from '@xpert-ai/contracts';
2
+ export declare const AGENT_EVENT_SOURCE = "XPERT_AGENT_EVENT_SOURCE_V1";
3
+ export declare const AgentEventSourceStrategy: (key: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
4
+ export { agentEventRefSchema, pluginAgentEventSchema, agentEventDecisionSchema, type AgentEventPresentation, type AgentEventTypeDefinition, type AgentEventTypeDisplay, type AgentEventRef, type PluginAgentEvent, type EventDecision } from '@xpert-ai/contracts';
5
+ export type EventPublishResult = {
6
+ status: 'accepted' | 'duplicate';
7
+ receiptId: string;
8
+ } | {
9
+ status: 'rejected';
10
+ code: 'binding_changed' | 'invalid_event' | 'unsupported_version' | 'identity_conflict';
11
+ };
12
+ export interface AgentEventPublisher {
13
+ publish(event: PluginAgentEvent): Promise<EventPublishResult>;
14
+ }
15
+ export interface AgentEventContext {
16
+ readonly bindingId: string;
17
+ readonly bindingRevision: number;
18
+ readonly sourceBindingRef: string;
19
+ readonly tenantId: string;
20
+ readonly organizationId: string;
21
+ readonly workspaceId: string;
22
+ readonly projectId?: string;
23
+ readonly xpertId: string;
24
+ readonly userId: string;
25
+ readonly signal: AbortSignal;
26
+ }
27
+ export interface AgentEventDelivery {
28
+ receiptId: string;
29
+ fence: string;
30
+ event: PluginAgentEvent;
31
+ }
32
+ export interface PluginAgentEventSource {
33
+ readonly key: string;
34
+ readonly protocolVersion: 1;
35
+ readonly eventTypes: readonly AgentEventTypeDefinition[];
36
+ /** Authorized title matches within this binding. The host intersects these with its visible receipts. */
37
+ searchTitles?(context: AgentEventContext, term: string): Promise<({
38
+ subject: string;
39
+ } | {
40
+ result: {
41
+ kind: string;
42
+ key: string;
43
+ };
44
+ })[]>;
45
+ describe?(context: AgentEventContext, event: PluginAgentEvent, decision: EventDecision | null, options?: {
46
+ includeConversation: boolean;
47
+ }): Promise<AgentEventPresentation | null>;
48
+ /** Changes the capture policy only for an authorized source and revision. */
49
+ configure(context: AgentEventContext, enabled: boolean): Promise<void>;
50
+ drain(context: AgentEventContext, publisher: AgentEventPublisher, limit: number): Promise<{
51
+ more: boolean;
52
+ }>;
53
+ handle(context: AgentEventContext, delivery: AgentEventDelivery): Promise<EventDecision>;
54
+ }
55
+ export * from './journal';
@@ -0,0 +1,30 @@
1
+ import type { AgentEventContext, AgentEventDelivery, AgentEventPublisher, EventDecision, PluginAgentEvent } from './index';
2
+ export interface AgentEventSql {
3
+ query<T = unknown>(sql: string, params?: unknown[]): Promise<T>;
4
+ }
5
+ export declare function agentEventDigest(value: unknown): string;
6
+ interface Route {
7
+ binding: string;
8
+ revision: number;
9
+ enabled: boolean;
10
+ }
11
+ export interface AgentEventOrigin {
12
+ tenantId: string;
13
+ organizationId: string;
14
+ ref: string;
15
+ }
16
+ /** PostgreSQL source journal scoped to one plugin's own route and fact tables. */
17
+ export declare class PluginEventJournal {
18
+ private readonly routes;
19
+ private readonly facts;
20
+ constructor(prefix: string);
21
+ private lock;
22
+ configure(tx: AgentEventSql, ctx: AgentEventContext, enabled: boolean): Promise<void>;
23
+ route(tx: AgentEventSql, origin: AgentEventOrigin): Promise<Route>;
24
+ capture(tx: AgentEventSql, route: Route, data: Omit<PluginAgentEvent, 'bindingRevision' | 'fact'>, snapshot: unknown, factKey: string, revision: string): Promise<boolean>;
25
+ drain(db: AgentEventSql, ctx: AgentEventContext, publisher: AgentEventPublisher, limit: number): Promise<{
26
+ more: boolean;
27
+ }>;
28
+ decide(tx: AgentEventSql, ctx: AgentEventContext, delivery: AgentEventDelivery, apply: (snapshot: unknown) => Promise<EventDecision>): Promise<EventDecision>;
29
+ }
30
+ export {};
@@ -18,21 +18,21 @@ export declare const artifactDocumentDependencyLock: z.ZodEffects<z.ZodObject<{
18
18
  }, "strict", z.ZodTypeAny, {
19
19
  id?: string;
20
20
  version?: string;
21
+ sha256?: string;
21
22
  format?: "classic-script";
22
23
  global?: string;
23
- sha256?: string;
24
24
  }, {
25
25
  id?: string;
26
26
  version?: string;
27
+ sha256?: string;
27
28
  format?: "classic-script";
28
29
  global?: string;
29
- sha256?: string;
30
30
  }>, ArtifactDocumentDependencyLock, {
31
31
  id?: string;
32
32
  version?: string;
33
+ sha256?: string;
33
34
  format?: "classic-script";
34
35
  global?: string;
35
- sha256?: string;
36
36
  }>;
37
37
  export declare const artifactDocumentDependencyLocks: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
38
38
  id: z.ZodString;
@@ -43,27 +43,27 @@ export declare const artifactDocumentDependencyLocks: z.ZodEffects<z.ZodArray<z.
43
43
  }, "strict", z.ZodTypeAny, {
44
44
  id?: string;
45
45
  version?: string;
46
+ sha256?: string;
46
47
  format?: "classic-script";
47
48
  global?: string;
48
- sha256?: string;
49
49
  }, {
50
50
  id?: string;
51
51
  version?: string;
52
+ sha256?: string;
52
53
  format?: "classic-script";
53
54
  global?: string;
54
- sha256?: string;
55
55
  }>, ArtifactDocumentDependencyLock, {
56
56
  id?: string;
57
57
  version?: string;
58
+ sha256?: string;
58
59
  format?: "classic-script";
59
60
  global?: string;
60
- sha256?: string;
61
61
  }>, "many">, ArtifactDocumentDependencyLock[], {
62
62
  id?: string;
63
63
  version?: string;
64
+ sha256?: string;
64
65
  format?: "classic-script";
65
66
  global?: string;
66
- sha256?: string;
67
67
  }[]>;
68
68
  export declare const artifactDocumentDependencyAssets: z.ZodArray<z.ZodEffects<z.ZodObject<{
69
69
  id: z.ZodString;
@@ -75,25 +75,25 @@ export declare const artifactDocumentDependencyAssets: z.ZodArray<z.ZodEffects<z
75
75
  source: z.ZodString;
76
76
  }, "strict", z.ZodTypeAny, {
77
77
  id?: string;
78
- version?: string;
79
78
  source?: string;
79
+ version?: string;
80
+ sha256?: string;
80
81
  format?: "classic-script";
81
82
  global?: string;
82
- sha256?: string;
83
83
  }, {
84
84
  id?: string;
85
- version?: string;
86
85
  source?: string;
86
+ version?: string;
87
+ sha256?: string;
87
88
  format?: "classic-script";
88
89
  global?: string;
89
- sha256?: string;
90
90
  }>, ArtifactDocumentDependencyAsset, {
91
91
  id?: string;
92
- version?: string;
93
92
  source?: string;
93
+ version?: string;
94
+ sha256?: string;
94
95
  format?: "classic-script";
95
96
  global?: string;
96
- sha256?: string;
97
97
  }>, "many">;
98
98
  /** Browser/server identical verification. Integrity is not authorization: the caller owns library admission. */
99
99
  export declare function verifyArtifactDocumentDependencies(input: unknown, expected?: ArtifactDocumentDependencyLock[]): ArtifactDocumentDependencyAsset[];
@@ -16,14 +16,14 @@ export declare const artifactDocumentQuery: z.ZodObject<{
16
16
  }, "strict", z.ZodTypeAny, {
17
17
  type?: "query";
18
18
  controls?: Record<string, string | number | boolean>;
19
- requestId?: string;
20
19
  bindingId?: string;
20
+ requestId?: string;
21
21
  priority?: "interactive" | "initial" | "refresh";
22
22
  }, {
23
23
  type?: "query";
24
24
  controls?: Record<string, string | number | boolean>;
25
- requestId?: string;
26
25
  bindingId?: string;
26
+ requestId?: string;
27
27
  priority?: "interactive" | "initial" | "refresh";
28
28
  }>;
29
29
  /** Flat UI filter values keyed by declared control IDs; validated again by the backend Binding. */
@@ -1,8 +1,11 @@
1
1
  import type { ArtifactDocumentControls } from './protocol';
2
+ import type { AnalyticsQueryRequest } from '@xpert-ai/contracts';
2
3
  export type ArtifactQueryPriority = 'interactive' | 'initial' | 'refresh';
3
4
  export interface ArtifactQueryInput {
4
5
  bindingId: string;
5
6
  controls: ArtifactDocumentControls;
7
+ /** Forward to the runtime; a refresh must not coalesce with an earlier reuse request. */
8
+ cache?: AnalyticsQueryRequest['cache'];
6
9
  }
7
10
  export interface ArtifactQueryState {
8
11
  bindingId: string;
@@ -1,5 +1,5 @@
1
1
  import { type TXpertTeamDraft } from '@xpert-ai/contracts';
2
- export declare function hasAssistantMiddleware(draft: TXpertTeamDraft, provider: string): boolean;
2
+ export declare function hasAssistantMiddleware(draft: TXpertTeamDraft, provider: string, agentKey?: string): boolean;
3
3
  /** Compose only the draft graph. The platform records the contribution for safe removal.
4
4
  * No Project, permission, external resource or implicit replacement is created here. */
5
5
  export declare function applyAssistantMiddleware(draft: TXpertTeamDraft, input: {
@@ -7,4 +7,5 @@ export declare function applyAssistantMiddleware(draft: TXpertTeamDraft, input:
7
7
  key: string;
8
8
  title: string;
9
9
  instructions: string;
10
+ preserveToolConcurrency?: boolean;
10
11
  }): void;
@@ -1,28 +1,8 @@
1
- import type { ApplyCollaborationUpdateResult, CollaborationPresencePatch, CollaborationSessionDescriptor, ICollaborationActor, ICollaborationPresence } from './types';
2
- export type CollaborationTransportPayload = Record<string, unknown>;
3
- export type CollaborationTransportHandler = (payload: CollaborationTransportPayload) => void;
4
- /** Framework-neutral event transport used by the collaboration client. */
5
- export interface CollaborationTransport {
6
- readonly connected: boolean;
7
- /** Socket/session identifier for this exact browser client, when the transport exposes one. */
8
- readonly clientId?: string | null;
9
- connect(): void;
10
- disconnect(): void;
11
- emit(event: string, payload?: CollaborationTransportPayload): void;
12
- on(event: string, handler: CollaborationTransportHandler): () => void;
13
- }
14
- /** Minimal Socket.IO-compatible shape; keeps socket.io-client out of the SDK bundle. */
15
- export interface CollaborationSocketLike {
16
- readonly connected: boolean;
17
- readonly id?: string;
18
- connect(): unknown;
19
- disconnect(): unknown;
20
- emit(event: string, payload?: CollaborationTransportPayload): unknown;
21
- on(event: string, handler: CollaborationTransportHandler): unknown;
22
- off(event: string, handler: CollaborationTransportHandler): unknown;
23
- }
24
- /** Adapt a caller-owned Socket.IO client to the SDK's framework-neutral transport. */
25
- export declare function createSocketIoTransportAdapter(socket: CollaborationSocketLike): CollaborationTransport;
1
+ import type { CollaborationTransport } from './transport';
2
+ import { type CollaborationPresenceSnapshotMetadata } from './presence';
3
+ export * from './transport';
4
+ export * from './presence';
5
+ import type { ApplyCollaborationUpdateResult, CollaborationPresencePatch, CollaborationSessionDescriptor, ICollaborationPresence } from './types';
26
6
  export type CollaborationDocumentUpdateHandler = (update: Uint8Array, origin: unknown) => void;
27
7
  /** Binary CRDT operations required by the generic collaboration client. */
28
8
  export interface CollaborationBinaryDocumentAdapter {
@@ -74,41 +54,8 @@ export interface CollaborationClient {
74
54
  requestSync(): void;
75
55
  setPresence(patch: CollaborationPresencePatch): void;
76
56
  }
77
- /** Connection-specific metadata delivered with a presence snapshot. */
78
- export type CollaborationPresenceSnapshotMetadata = {
79
- selfClientId: string | null;
80
- };
81
- /** Stable, framework-neutral view of active collaboration sessions and deduplicated actors. */
82
- export type CollaborationPresenceStoreSnapshot = {
83
- selfClientId: string | null;
84
- /** Every active browser/Agent session keyed by `clientId`. */
85
- sessions: ICollaborationPresence[];
86
- /** Sessions excluding only this exact browser client. */
87
- remoteSessions: ICollaborationPresence[];
88
- /** One entry per actor identity, including the local actor when supplied. */
89
- collaborators: ICollaborationPresence[];
90
- };
91
- export type CollaborationPresenceStoreOptions = {
92
- selfActor?: ICollaborationActor | null;
93
- includeSelf?: boolean;
94
- onChange?: (snapshot: CollaborationPresenceStoreSnapshot) => void;
95
- };
96
- /** Mutable presence projection used by plugin UIs without coupling them to a framework. */
97
- export interface CollaborationPresenceStore {
98
- setSelfClientId(clientId: string | null): void;
99
- replace(items: ICollaborationPresence[], selfClientId?: string | null): void;
100
- upsert(item: ICollaborationPresence): void;
101
- remove(clientId: string): void;
102
- clear(): void;
103
- snapshot(): CollaborationPresenceStoreSnapshot;
104
- }
105
- /**
106
- * Keep per-client sessions for cursors while exposing one collaborator per stable actor identity.
107
- * This prevents a second tab owned by the same user from either duplicating or hiding that user.
108
- */
109
- export declare function createCollaborationPresenceStore(options?: CollaborationPresenceStoreOptions): CollaborationPresenceStore;
110
57
  /**
111
- * Create a collaboration client with update batching, state-vector repair, presence heartbeat,
58
+ * Create a Yjs collaboration client with update batching, state-vector repair, presence heartbeat,
112
59
  * and reconnect synchronization. The caller retains ownership of the document and transport.
113
60
  */
114
61
  export declare function createCollaborationClient(options: CollaborationClientOptions): CollaborationClient;
@@ -3,3 +3,4 @@ export * from './runtime-capability';
3
3
  export * from './provider.decorator';
4
4
  export * from './provider.registry';
5
5
  export * from './client';
6
+ export * from './operations-client';