@xpert-ai/plugin-sdk 3.35.0 → 3.37.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/agent-results.cjs.js +5 -3
- package/agent-results.esm.js +2 -2
- package/analytics-result.cjs.js +64 -27
- package/analytics-result.esm.js +62 -28
- package/analytics.cjs.js +157 -15
- package/analytics.esm.js +154 -17
- package/artifact-document.cjs.js +9 -3
- package/artifact-document.esm.js +9 -3
- package/collaboration-client.cjs.js +274 -140
- package/collaboration-client.esm.js +273 -141
- package/docs/README.md +23 -0
- package/index.cjs.js +227 -10
- package/index.esm.js +198 -13
- package/package.json +8 -2
- package/remote-component.cjs.default.js +1 -0
- package/remote-component.cjs.js +143 -0
- package/remote-component.cjs.mjs +2 -0
- package/remote-component.d.ts +1 -0
- package/remote-component.esm.js +139 -0
- package/results.cjs.js +2 -14
- package/results.esm.js +2 -12
- package/src/analytics.d.ts +2 -0
- package/src/collaboration-client.d.ts +1 -0
- package/src/index.d.ts +1 -0
- package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +24 -24
- package/src/lib/agent/middleware/strategy.interface.d.ts +4 -0
- package/src/lib/agent/runtime/capability.d.ts +2 -0
- package/src/lib/agent/runtime/cli-model-profile.d.ts +14 -1
- package/src/lib/agent/runtime/dispatch.d.ts +79 -79
- package/src/lib/agent/runtime/execution-runner.d.ts +19 -10
- package/src/lib/agent/runtime/pipeline-scope.d.ts +4 -4
- package/src/lib/agent/runtime/results.d.ts +14 -234
- package/src/lib/agent/runtime/types.d.ts +19 -0
- package/src/lib/agent-event/index.d.ts +89 -0
- package/src/lib/agent-event/journal.d.ts +30 -0
- package/src/lib/artifact-document/dependencies.d.ts +3 -3
- package/src/lib/artifact-document/protocol.d.ts +2 -2
- package/src/lib/artifact-document/scheduler.d.ts +3 -0
- package/src/lib/artifact-type/definition.schema.d.ts +11 -39
- package/src/lib/assistant-capability/middleware.d.ts +2 -1
- package/src/lib/channel/strategy.interface.d.ts +20 -0
- package/src/lib/collaboration/client.d.ts +6 -59
- package/src/lib/collaboration/index.d.ts +1 -0
- package/src/lib/collaboration/operations-client.d.ts +23 -0
- package/src/lib/collaboration/presence.d.ts +36 -0
- package/src/lib/collaboration/provider.registry.d.ts +2 -2
- package/src/lib/collaboration/transport.d.ts +24 -0
- package/src/lib/collaboration/types.d.ts +57 -5
- package/src/lib/content-resource/catalog.d.ts +40 -2
- package/src/lib/content-resource/editor.d.ts +36 -1
- package/src/lib/data/analytics/analysis-evidence.d.ts +757 -0
- package/src/lib/data/analytics/analytics-certification.d.ts +64 -0
- package/src/lib/data/analytics/analytics-provider.d.ts +9 -0
- package/src/lib/data/analytics/analytics-value.d.ts +5 -0
- package/src/lib/data/analytics/index.d.ts +1 -0
- package/src/lib/evolution/runtime-capability.d.ts +1 -0
- package/src/lib/project-pipeline/adapters.d.ts +9 -2
- package/src/lib/project-pipeline/registry.d.ts +59 -48
- package/src/lib/project-task/acceptance.d.ts +13 -1
- package/src/lib/project-task/index.d.ts +4 -2
- package/src/lib/runtime/capabilities/project-configuration.d.ts +2 -0
- package/src/lib/view-extension/index.d.ts +1 -0
- package/src/lib/view-extension/provider.interface.d.ts +51 -0
- package/src/lib/view-extension/workbench-decision.d.ts +10 -0
- package/src/remote-component.d.ts +13 -0
|
@@ -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,241 +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
|
-
/**
|
|
97
|
-
export declare const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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>;
|
|
314
|
-
/** Bound structured report transfer independently of the host's artifact-export quota. */
|
|
315
|
-
export declare const AGENT_TASK_RESULT_FILE_MAX_BYTES: number;
|
|
316
|
-
/** Explicit final submission of an envelope file. Its digest pins bytes, not a business verdict. */
|
|
317
|
-
export declare const agentTaskResultFileSchema: z.ZodObject<{
|
|
318
|
-
version: z.ZodLiteral<1>;
|
|
319
|
-
path: z.ZodEffects<z.ZodString, string, string>;
|
|
320
|
-
sha256: z.ZodString;
|
|
321
|
-
}, "strict", z.ZodTypeAny, {
|
|
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;
|
|
322
105
|
path?: string;
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
106
|
+
} | {
|
|
107
|
+
status: 'failed';
|
|
108
|
+
code: 'report_unavailable' | 'report_empty' | 'report_too_large';
|
|
326
109
|
path?: string;
|
|
327
|
-
|
|
328
|
-
sha256?: string;
|
|
329
|
-
}>;
|
|
330
|
-
export type AgentTaskResultFile = z.output<typeof agentTaskResultFileSchema>;
|
|
110
|
+
};
|
|
331
111
|
/** Persist only after the platform has committed the artifact; never accept an ID invented by a model. */
|
|
332
112
|
export interface AgentResultArtifact {
|
|
333
113
|
id: string;
|
|
@@ -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. */
|
|
@@ -184,6 +201,8 @@ export interface AgentInvocation extends AgentRuntimeObservation {
|
|
|
184
201
|
/** Host timestamps in ISO 8601 format. */
|
|
185
202
|
createdAt: string;
|
|
186
203
|
updatedAt: string;
|
|
204
|
+
/** First host-confirmed terminal observation; delivery recovery does not extend runtime. Absent on old records. */
|
|
205
|
+
completedAt?: string;
|
|
187
206
|
}
|
|
188
207
|
/** Checks confirmed completion; unknown remains non-terminal. */
|
|
189
208
|
export declare function isAgentInvocationTerminal(status: AgentInvocationStatus): boolean;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { HumanDecisionInput, HumanDecisionResult, PrivateDecisionReply, AgentOutputPresentation, AgentOutputReference, 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 AgentEventFollowUp {
|
|
33
|
+
submitPrivateDecision?(reply: PrivateDecisionReply): Promise<HumanDecisionResult | {
|
|
34
|
+
status: 'unrelated';
|
|
35
|
+
}>;
|
|
36
|
+
wake(input: {
|
|
37
|
+
conversationId: string;
|
|
38
|
+
prompt: string;
|
|
39
|
+
threadId?: string;
|
|
40
|
+
agentKey?: string;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
/** A bound source hands off committed domain outputs and resolves them for the original recipient. */
|
|
44
|
+
export interface AgentOutputSource {
|
|
45
|
+
submitDecision?(context: AgentEventContext, input: HumanDecisionInput, origin: 'workbench' | 'lark'): Promise<HumanDecisionResult>;
|
|
46
|
+
readonly kinds: readonly {
|
|
47
|
+
key: string;
|
|
48
|
+
label: {
|
|
49
|
+
en_US: string;
|
|
50
|
+
zh_Hans: string;
|
|
51
|
+
};
|
|
52
|
+
}[];
|
|
53
|
+
/** Return due, unacknowledged references belonging to this binding and recipient, up to the requested limit. */
|
|
54
|
+
listPending(context: AgentEventContext, limit: number): Promise<AgentOutputReference[]>;
|
|
55
|
+
/** Confirm the host's committed message ID idempotently. A different ID for the same result is a conflict. */
|
|
56
|
+
acknowledge(context: AgentEventContext, ref: AgentOutputReference, messageId: string): Promise<void | 'conflict'>;
|
|
57
|
+
/** Keep the reference pending. A timestamp postpones this item; null isolates an immutable conflict. */
|
|
58
|
+
defer(context: AgentEventContext, ref: AgentOutputReference, retryAt: string | null): Promise<void>;
|
|
59
|
+
/** Recheck current domain access and relevance before returning any recipient-visible content. */
|
|
60
|
+
resolveForRecipient(context: AgentEventContext, ref: AgentOutputReference): Promise<AgentOutputPresentation>;
|
|
61
|
+
}
|
|
62
|
+
export { humanDecisionInputSchema, humanDecisionSchema, type HumanDecisionInput, type HumanDecisionResult, type HumanDecision, type PrivateDecisionCard, type PrivateDecisionReply } from '@xpert-ai/contracts';
|
|
63
|
+
export type { AgentOutputReference, AgentOutputPresentation } from '@xpert-ai/contracts';
|
|
64
|
+
export interface PluginAgentEventSource {
|
|
65
|
+
readonly outputs?: AgentOutputSource;
|
|
66
|
+
readonly key: string;
|
|
67
|
+
readonly protocolVersion: 1;
|
|
68
|
+
readonly eventTypes: readonly AgentEventTypeDefinition[];
|
|
69
|
+
/** Authorized title matches within this binding. The host intersects these with its visible receipts. */
|
|
70
|
+
searchTitles?(context: AgentEventContext, term: string): Promise<({
|
|
71
|
+
subject: string;
|
|
72
|
+
} | {
|
|
73
|
+
result: {
|
|
74
|
+
kind: string;
|
|
75
|
+
key: string;
|
|
76
|
+
};
|
|
77
|
+
})[]>;
|
|
78
|
+
describe?(context: AgentEventContext, event: PluginAgentEvent, decision: EventDecision | null, options?: {
|
|
79
|
+
includeConversation: boolean;
|
|
80
|
+
}): Promise<AgentEventPresentation | null>;
|
|
81
|
+
/** Changes the capture policy only for an authorized source and revision. */
|
|
82
|
+
configure(context: AgentEventContext, enabled: boolean): Promise<void>;
|
|
83
|
+
drain(context: AgentEventContext, publisher: AgentEventPublisher, limit: number): Promise<{
|
|
84
|
+
more: boolean;
|
|
85
|
+
}>;
|
|
86
|
+
/** The host binds the wake to this receipt and actor. Call only for a committed, still applicable follow-up. */
|
|
87
|
+
handle(context: AgentEventContext, delivery: AgentEventDelivery, followUp?: AgentEventFollowUp): Promise<EventDecision>;
|
|
88
|
+
}
|
|
89
|
+
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 {};
|
|
@@ -75,23 +75,23 @@ export declare const artifactDocumentDependencyAssets: z.ZodArray<z.ZodEffects<z
|
|
|
75
75
|
source: z.ZodString;
|
|
76
76
|
}, "strict", z.ZodTypeAny, {
|
|
77
77
|
id?: string;
|
|
78
|
+
source?: string;
|
|
78
79
|
version?: string;
|
|
79
80
|
sha256?: string;
|
|
80
|
-
source?: string;
|
|
81
81
|
format?: "classic-script";
|
|
82
82
|
global?: string;
|
|
83
83
|
}, {
|
|
84
84
|
id?: string;
|
|
85
|
+
source?: string;
|
|
85
86
|
version?: string;
|
|
86
87
|
sha256?: string;
|
|
87
|
-
source?: string;
|
|
88
88
|
format?: "classic-script";
|
|
89
89
|
global?: string;
|
|
90
90
|
}>, ArtifactDocumentDependencyAsset, {
|
|
91
91
|
id?: string;
|
|
92
|
+
source?: string;
|
|
92
93
|
version?: string;
|
|
93
94
|
sha256?: string;
|
|
94
|
-
source?: string;
|
|
95
95
|
format?: "classic-script";
|
|
96
96
|
global?: string;
|
|
97
97
|
}>, "many">;
|
|
@@ -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;
|
|
@@ -9,18 +9,11 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
|
|
|
9
9
|
size: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
alt: z.ZodOptional<z.ZodString>;
|
|
11
11
|
style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
value?: string;
|
|
14
|
-
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
12
|
+
}, "strip", z.ZodTypeAny, import("@xpert-ai/contracts").IconDefinition, {
|
|
15
13
|
size?: number;
|
|
16
14
|
color?: string;
|
|
17
|
-
alt?: string;
|
|
18
|
-
style?: Record<string, string>;
|
|
19
|
-
}, {
|
|
20
|
-
value?: string;
|
|
21
15
|
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
22
|
-
|
|
23
|
-
color?: string;
|
|
16
|
+
value?: string;
|
|
24
17
|
alt?: string;
|
|
25
18
|
style?: Record<string, string>;
|
|
26
19
|
}>>;
|
|
@@ -119,14 +112,7 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
|
|
|
119
112
|
collection?: {
|
|
120
113
|
allowCopy?: boolean;
|
|
121
114
|
};
|
|
122
|
-
icon?:
|
|
123
|
-
value?: string;
|
|
124
|
-
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
125
|
-
size?: number;
|
|
126
|
-
color?: string;
|
|
127
|
-
alt?: string;
|
|
128
|
-
style?: Record<string, string>;
|
|
129
|
-
};
|
|
115
|
+
icon?: import("@xpert-ai/contracts").IconDefinition;
|
|
130
116
|
content?: {
|
|
131
117
|
mimeTypes?: string[];
|
|
132
118
|
maxBytes?: number;
|
|
@@ -164,10 +150,10 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
|
|
|
164
150
|
allowCopy?: boolean;
|
|
165
151
|
};
|
|
166
152
|
icon?: {
|
|
167
|
-
value?: string;
|
|
168
|
-
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
169
153
|
size?: number;
|
|
170
154
|
color?: string;
|
|
155
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
156
|
+
value?: string;
|
|
171
157
|
alt?: string;
|
|
172
158
|
style?: Record<string, string>;
|
|
173
159
|
};
|
|
@@ -207,14 +193,7 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
|
|
|
207
193
|
collection?: {
|
|
208
194
|
allowCopy?: boolean;
|
|
209
195
|
};
|
|
210
|
-
icon?:
|
|
211
|
-
value?: string;
|
|
212
|
-
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
213
|
-
size?: number;
|
|
214
|
-
color?: string;
|
|
215
|
-
alt?: string;
|
|
216
|
-
style?: Record<string, string>;
|
|
217
|
-
};
|
|
196
|
+
icon?: import("@xpert-ai/contracts").IconDefinition;
|
|
218
197
|
content?: {
|
|
219
198
|
mimeTypes?: string[];
|
|
220
199
|
maxBytes?: number;
|
|
@@ -252,10 +231,10 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
|
|
|
252
231
|
allowCopy?: boolean;
|
|
253
232
|
};
|
|
254
233
|
icon?: {
|
|
255
|
-
value?: string;
|
|
256
|
-
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
257
234
|
size?: number;
|
|
258
235
|
color?: string;
|
|
236
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
237
|
+
value?: string;
|
|
259
238
|
alt?: string;
|
|
260
239
|
style?: Record<string, string>;
|
|
261
240
|
};
|
|
@@ -295,14 +274,7 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
|
|
|
295
274
|
collection?: {
|
|
296
275
|
allowCopy?: boolean;
|
|
297
276
|
};
|
|
298
|
-
icon?:
|
|
299
|
-
value?: string;
|
|
300
|
-
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
301
|
-
size?: number;
|
|
302
|
-
color?: string;
|
|
303
|
-
alt?: string;
|
|
304
|
-
style?: Record<string, string>;
|
|
305
|
-
};
|
|
277
|
+
icon?: import("@xpert-ai/contracts").IconDefinition;
|
|
306
278
|
content?: {
|
|
307
279
|
mimeTypes?: string[];
|
|
308
280
|
maxBytes?: number;
|
|
@@ -340,10 +312,10 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.Z
|
|
|
340
312
|
allowCopy?: boolean;
|
|
341
313
|
};
|
|
342
314
|
icon?: {
|
|
343
|
-
value?: string;
|
|
344
|
-
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
345
315
|
size?: number;
|
|
346
316
|
color?: string;
|
|
317
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
318
|
+
value?: string;
|
|
347
319
|
alt?: string;
|
|
348
320
|
style?: Record<string, string>;
|
|
349
321
|
};
|
|
@@ -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;
|
|
@@ -225,6 +225,26 @@ export interface IChatChannel<TConfig = any, TEvent = any> {
|
|
|
225
225
|
* @returns Send result
|
|
226
226
|
*/
|
|
227
227
|
sendText(ctx: TChatContext, content: string): Promise<TChatSendResult>;
|
|
228
|
+
/** Verify the bound account in this installation. The app-specific ID is never supplied by the model. */
|
|
229
|
+
resolvePrivateDestination?(integration: IIntegration, subjectId: string): Promise<{
|
|
230
|
+
appId: string;
|
|
231
|
+
recipient: string;
|
|
232
|
+
} | null>;
|
|
233
|
+
/** Send to the verified private recipient using the host's attempt ID. Return unknown when acceptance is uncertain. */
|
|
234
|
+
sendPrivateDecision?(integration: IIntegration, recipient: string, card: import('@xpert-ai/contracts').PrivateDecisionCard, attemptId: string): Promise<{
|
|
235
|
+
status: 'accepted';
|
|
236
|
+
messageId: string;
|
|
237
|
+
chatId: string;
|
|
238
|
+
} | {
|
|
239
|
+
status: 'failed' | 'unknown';
|
|
240
|
+
}>;
|
|
241
|
+
updatePrivateDecision?(integration: IIntegration, messageId: string, status: import('@xpert-ai/contracts').PrivateDecisionFeedbackStatus, choiceLabel: string): Promise<void>;
|
|
242
|
+
sendPrivateNotification?(integration: IIntegration, recipient: string, text: string, attemptId: string): Promise<{
|
|
243
|
+
status: 'accepted';
|
|
244
|
+
messageId: string;
|
|
245
|
+
} | {
|
|
246
|
+
status: 'failed' | 'unknown';
|
|
247
|
+
}>;
|
|
228
248
|
/**
|
|
229
249
|
* Send Markdown message
|
|
230
250
|
*
|