@acorex-platform/module-ai-management-client 0.0.20
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/fesm2022/acorex-platform-module-ai-management-client-agent-registry-tool-configurator-widget-column.component-BHdDG8z0.mjs +44 -0
- package/fesm2022/acorex-platform-module-ai-management-client-agent-registry-tool-configurator-widget-column.component-BHdDG8z0.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client-agent-registry-tool-configurator-widget-edit.component-CMsc3P9O.mjs +259 -0
- package/fesm2022/acorex-platform-module-ai-management-client-agent-registry-tool-configurator-widget-edit.component-CMsc3P9O.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client-assist-delegated-agent-configurator-widget-column.component-CWUhBvpf.mjs +62 -0
- package/fesm2022/acorex-platform-module-ai-management-client-assist-delegated-agent-configurator-widget-column.component-CWUhBvpf.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client-assist-delegated-agent-configurator-widget-edit.component-Dmi8vzfr.mjs +293 -0
- package/fesm2022/acorex-platform-module-ai-management-client-assist-delegated-agent-configurator-widget-edit.component-Dmi8vzfr.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client-contracts.mjs +1038 -0
- package/fesm2022/acorex-platform-module-ai-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client-list-ai-command-registry-catalog.query-DHfiKVa2.mjs +106 -0
- package/fesm2022/acorex-platform-module-ai-management-client-list-ai-command-registry-catalog.query-DHfiKVa2.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client-list-ai-query-registry-catalog.query-BX0uU1YX.mjs +107 -0
- package/fesm2022/acorex-platform-module-ai-management-client-list-ai-query-registry-catalog.query-BX0uU1YX.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client-list-output-contract-transcript-segments.query-BQXySOH_.mjs +54 -0
- package/fesm2022/acorex-platform-module-ai-management-client-list-output-contract-transcript-segments.query-BQXySOH_.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-ai-management-client.mjs +3642 -0
- package/fesm2022/acorex-platform-module-ai-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-ai-management-client-contracts.d.ts +896 -0
- package/types/acorex-platform-module-ai-management-client.d.ts +797 -0
|
@@ -0,0 +1,896 @@
|
|
|
1
|
+
import { AXPMultiLanguageString, AXPOutputTranscriptSegmentId, AXPFileListItem, AXPContextDefinition, AXPAgentOutputKind, AXPMetaData } from '@acorex-platform/framework-shared/core';
|
|
2
|
+
import { AXPEntityModel } from '@acorex-platform/framework-shared/entity';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Edition / feature flags for AI Management.
|
|
6
|
+
* `ManageCatalog` is Platform Console only (Intelligence config menu).
|
|
7
|
+
*/
|
|
8
|
+
declare const AXPAiManagementFeatureKeys: {
|
|
9
|
+
/** Configuration → Intelligence (agents, assists, models, endpoints, rules). */
|
|
10
|
+
readonly ManageCatalog: "AiManagement:Feature:ManageCatalog";
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* AI Management menu keys.
|
|
15
|
+
* Pattern: AiManagement:Menu:{Path}
|
|
16
|
+
*/
|
|
17
|
+
declare const AXPAiManagementMenuKeys: {
|
|
18
|
+
/** Configuration > AI Management (models, assists) */
|
|
19
|
+
readonly AiManagementConfig: "Common:Menu:Configuration:AiManagement";
|
|
20
|
+
/** OpenAI-compatible HTTP endpoints (base URL + API key). */
|
|
21
|
+
readonly OpenAiEndpoints: "AiManagement:Menu:OpenAiEndpoints";
|
|
22
|
+
/** List of AI models (from providers). */
|
|
23
|
+
readonly Models: "AiManagement:Menu:Models";
|
|
24
|
+
/** List of Assists. */
|
|
25
|
+
readonly Assists: "AiManagement:Menu:Assists";
|
|
26
|
+
/** Delegated specialist agents (supervisor routing). */
|
|
27
|
+
readonly Agents: "AiManagement:Menu:Agents";
|
|
28
|
+
/** Reusable system-prompt rules (Markdown fragments). */
|
|
29
|
+
readonly Rules: "AiManagement:Menu:Rules";
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Administration capabilities used by this module.
|
|
34
|
+
* Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
|
|
35
|
+
*/
|
|
36
|
+
declare const AXPAdministrationPermissionKeys: {
|
|
37
|
+
readonly Access: "Administration:Permission:Access";
|
|
38
|
+
readonly MaintainUsersAndRoles: "Administration:Permission:MaintainUsersAndRoles";
|
|
39
|
+
readonly ManageSessions: "Administration:Permission:ManageSessions";
|
|
40
|
+
readonly MaintainPolicies: "Administration:Permission:MaintainPolicies";
|
|
41
|
+
readonly ViewIntegrations: "Administration:Permission:ViewIntegrations";
|
|
42
|
+
readonly MaintainConnections: "Administration:Permission:MaintainConnections";
|
|
43
|
+
readonly MaintainWorkflows: "Administration:Permission:MaintainWorkflows";
|
|
44
|
+
readonly ManageWorkflowActions: "Administration:Permission:ManageWorkflowActions";
|
|
45
|
+
readonly ViewRules: "Administration:Permission:ViewRules";
|
|
46
|
+
readonly MaintainRules: "Administration:Permission:MaintainRules";
|
|
47
|
+
readonly ManageRuleActions: "Administration:Permission:ManageRuleActions";
|
|
48
|
+
readonly MaintainAi: "Administration:Permission:MaintainAi";
|
|
49
|
+
readonly UseAiAssist: "Administration:Permission:UseAiAssist";
|
|
50
|
+
readonly MaintainDashboards: "Administration:Permission:MaintainDashboards";
|
|
51
|
+
readonly ViewJobs: "Administration:Permission:ViewJobs";
|
|
52
|
+
readonly ManageJobActions: "Administration:Permission:ManageJobActions";
|
|
53
|
+
readonly ViewObservability: "Administration:Permission:ViewObservability";
|
|
54
|
+
readonly MaintainObservability: "Administration:Permission:MaintainObservability";
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Dynamic assist access permissions (`Assist.{name}.Use`) as children of UseAiAssist.
|
|
58
|
+
* Parent Assist.Use maps to {@link AXPAdministrationPermissionKeys.UseAiAssist}.
|
|
59
|
+
*/
|
|
60
|
+
declare const AXMAiAssistPermissionKeys: {
|
|
61
|
+
readonly Use: "Administration:Permission:UseAiAssist";
|
|
62
|
+
readonly useForAssist: (assistName: string) => string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated Prefer {@link AXPAdministrationPermissionKeys}.
|
|
66
|
+
* Legacy nested shape kept so existing imports compile during migration.
|
|
67
|
+
*/
|
|
68
|
+
declare const AXMPermissionsKeys: {
|
|
69
|
+
readonly AiManagement: {
|
|
70
|
+
readonly Management: "Administration:Permission:MaintainAi";
|
|
71
|
+
readonly Assist: {
|
|
72
|
+
readonly Use: "Administration:Permission:UseAiAssist";
|
|
73
|
+
readonly useForAssist: (assistName: string) => string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* AI Management setting keys.
|
|
80
|
+
* Pattern: AiManagement:Setting:{Path}
|
|
81
|
+
*/
|
|
82
|
+
declare const AXPAiManagementSettings: {
|
|
83
|
+
/** Assist primary key (`id`) used when no assist is explicitly selected (tenant-scoped). */
|
|
84
|
+
readonly DefaultAssistId: "AiManagement:Setting:DefaultAssistId";
|
|
85
|
+
/**
|
|
86
|
+
* System instructions prepended to every assist/agent chat system prompt in {@link AXPAiEngine}.
|
|
87
|
+
* Empty string means no global layer (default).
|
|
88
|
+
*/
|
|
89
|
+
readonly GlobalSystemPrompt: "AiManagement:Setting:GlobalSystemPrompt";
|
|
90
|
+
readonly Providers: {
|
|
91
|
+
readonly Gemini: {
|
|
92
|
+
readonly ApiKey: "AiManagement:Setting:Providers.Gemini.ApiKey";
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare const RootConfig: {
|
|
98
|
+
config: {
|
|
99
|
+
i18n: string;
|
|
100
|
+
module: string;
|
|
101
|
+
route: string;
|
|
102
|
+
};
|
|
103
|
+
module: {
|
|
104
|
+
name: string;
|
|
105
|
+
route: string;
|
|
106
|
+
title: string;
|
|
107
|
+
icon: string;
|
|
108
|
+
};
|
|
109
|
+
entities: {
|
|
110
|
+
model: {
|
|
111
|
+
name: string;
|
|
112
|
+
fullName: string;
|
|
113
|
+
title: string;
|
|
114
|
+
titlePlural: string;
|
|
115
|
+
icon: string;
|
|
116
|
+
};
|
|
117
|
+
assist: {
|
|
118
|
+
name: string;
|
|
119
|
+
fullName: string;
|
|
120
|
+
title: string;
|
|
121
|
+
titlePlural: string;
|
|
122
|
+
icon: string;
|
|
123
|
+
};
|
|
124
|
+
agent: {
|
|
125
|
+
name: string;
|
|
126
|
+
fullName: string;
|
|
127
|
+
title: string;
|
|
128
|
+
titlePlural: string;
|
|
129
|
+
icon: string;
|
|
130
|
+
};
|
|
131
|
+
openAiEndpoint: {
|
|
132
|
+
name: string;
|
|
133
|
+
fullName: string;
|
|
134
|
+
title: string;
|
|
135
|
+
titlePlural: string;
|
|
136
|
+
icon: string;
|
|
137
|
+
};
|
|
138
|
+
rule: {
|
|
139
|
+
name: string;
|
|
140
|
+
fullName: string;
|
|
141
|
+
title: string;
|
|
142
|
+
titlePlural: string;
|
|
143
|
+
icon: string;
|
|
144
|
+
};
|
|
145
|
+
mcpServer: {
|
|
146
|
+
name: string;
|
|
147
|
+
fullName: string;
|
|
148
|
+
title: string;
|
|
149
|
+
titlePlural: string;
|
|
150
|
+
icon: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/** Denormalized {@link AiRule} snapshot on assist/agent rows (multi-lookup expose). */
|
|
156
|
+
interface AXMAiManagementRuleRef {
|
|
157
|
+
id: string;
|
|
158
|
+
/** Unique programmatic key used by the engine (`includeRules` / `excludeRules`). */
|
|
159
|
+
name: string;
|
|
160
|
+
title: AXPMultiLanguageString;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Persisted AiRule catalog row — reusable system-prompt fragments referenced by name.
|
|
164
|
+
*/
|
|
165
|
+
interface AXMAiManagementRuleEntityModel extends AXPEntityModel<string> {
|
|
166
|
+
/** Programmatic key (e.g. `markdown`); referenced from assist/agent `rules` and engine run options. */
|
|
167
|
+
name: string;
|
|
168
|
+
title: AXPMultiLanguageString;
|
|
169
|
+
description?: AXPMultiLanguageString;
|
|
170
|
+
/** Rule body merged into the engine system prompt when the rule is included. */
|
|
171
|
+
markdown: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Persisted AiAgent catalog row (entity storage shape).
|
|
176
|
+
*/
|
|
177
|
+
interface AXMAiManagementAgentEntityModel extends AXPEntityModel<string> {
|
|
178
|
+
name: string;
|
|
179
|
+
title: AXPMultiLanguageString;
|
|
180
|
+
description?: AXPMultiLanguageString;
|
|
181
|
+
/**
|
|
182
|
+
* Supervisor routing: when the main assist should call this delegated specialist (`agent:<id>` tool).
|
|
183
|
+
* Merged into the tool description at runtime — not used in specialist sub-runs.
|
|
184
|
+
*/
|
|
185
|
+
/** Plain-text routing for the supervisor LLM (tool description); not localized. */
|
|
186
|
+
supervisorWhenToUse?: string;
|
|
187
|
+
/** Supervisor routing: intents or turns where this specialist must not be used. */
|
|
188
|
+
supervisorWhenNotToUse?: string;
|
|
189
|
+
/** Optional chaining hints (e.g. call platform-entity before widget-form-layout). */
|
|
190
|
+
supervisorChainsWith?: string;
|
|
191
|
+
/** Optional intent keywords for admin UI and compact routing summaries. */
|
|
192
|
+
supervisorIntentTags?: string[] | null;
|
|
193
|
+
systemPrompt?: string;
|
|
194
|
+
/** Selected {@link AiRule} catalog ids (multi-lookup value field). */
|
|
195
|
+
ruleIds?: string[] | null;
|
|
196
|
+
/** Denormalized rule rows from multi-lookup expose (`title` = display, `name` = engine key). */
|
|
197
|
+
rules?: AXMAiManagementRuleRef[] | null;
|
|
198
|
+
/** Transcript segment preset id (`text` | `node` | `followUp`); resolved via segment providers at runtime. */
|
|
199
|
+
outputContract?: AXPOutputTranscriptSegmentId | string | null;
|
|
200
|
+
modelEntityId?: string | null;
|
|
201
|
+
commandIds?: unknown;
|
|
202
|
+
queryIds?: unknown;
|
|
203
|
+
/** Linked {@link McpServer} catalog ids for external MCP tools. */
|
|
204
|
+
mcpServerIds?: string[] | null;
|
|
205
|
+
maxSteps?: number;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Aligns with {@link AXPAiPlanningMode} in ai-engine.types (avoid circular imports). */
|
|
209
|
+
type AXMAiManagementAssistPlanningMode = 'off' | 'once' | 'when-needed';
|
|
210
|
+
/**
|
|
211
|
+
* Persisted Assist catalog row.
|
|
212
|
+
*/
|
|
213
|
+
interface AXMAiManagementAssistEntityModel extends AXPEntityModel<string> {
|
|
214
|
+
name: string;
|
|
215
|
+
title: AXPMultiLanguageString;
|
|
216
|
+
description?: AXPMultiLanguageString;
|
|
217
|
+
professionImageUrl?: string;
|
|
218
|
+
planningMode?: AXMAiManagementAssistPlanningMode;
|
|
219
|
+
modelId: string;
|
|
220
|
+
/** Denormalized lookup snapshot when the row is expanded for list/detail. */
|
|
221
|
+
aiModel?: {
|
|
222
|
+
id?: string;
|
|
223
|
+
title?: AXPMultiLanguageString;
|
|
224
|
+
name?: string;
|
|
225
|
+
};
|
|
226
|
+
initialMessages?: string | null;
|
|
227
|
+
/** Suggested first user messages shown in chat before the user sends anything. */
|
|
228
|
+
starterPrompts?: {
|
|
229
|
+
text: AXPMultiLanguageString;
|
|
230
|
+
}[] | null;
|
|
231
|
+
systemPrompt?: string;
|
|
232
|
+
/** Default output contract for runs using this assist (overridden by agent or run input). */
|
|
233
|
+
outputContract?: any;
|
|
234
|
+
/** Selected {@link AiRule} catalog ids (multi-lookup value field). */
|
|
235
|
+
ruleIds?: string[] | null;
|
|
236
|
+
/** Denormalized rule rows from multi-lookup expose (`title` = display, `name` = engine key). */
|
|
237
|
+
rules?: AXMAiManagementRuleRef[] | null;
|
|
238
|
+
/** Knowledge-base attachments (PDF and image formats) for this assist. */
|
|
239
|
+
knowledgeFiles?: AXPFileListItem[] | null;
|
|
240
|
+
/** Command registry bindings the assist may call directly in the same session. */
|
|
241
|
+
commandIds?: unknown;
|
|
242
|
+
/** Query registry bindings the assist may call directly in the same session. */
|
|
243
|
+
queryIds?: unknown;
|
|
244
|
+
/** Linked {@link McpServer} catalog ids for external MCP tools. */
|
|
245
|
+
mcpServerIds?: string[] | null;
|
|
246
|
+
delegatedAgents?: {
|
|
247
|
+
agent: {
|
|
248
|
+
type?: string;
|
|
249
|
+
options?: Record<string, unknown>;
|
|
250
|
+
};
|
|
251
|
+
}[] | null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Aligns with {@link AXPAiChatTransport} in ai-engine.types (avoid circular imports). */
|
|
255
|
+
type AXMAiManagementModelChatTransport = 'openai' | 'gemini' | 'demis';
|
|
256
|
+
type AXMAiManagementModelPurposeSlug = 'chat' | 'vision' | 'image' | 'speech' | 'tts' | 'video';
|
|
257
|
+
/**
|
|
258
|
+
* Persisted AI model catalog row.
|
|
259
|
+
*/
|
|
260
|
+
interface AXMAiManagementModelEntityModel extends AXPEntityModel<string> {
|
|
261
|
+
title: AXPMultiLanguageString;
|
|
262
|
+
description?: AXPMultiLanguageString;
|
|
263
|
+
/** Vendor API model id (exact string sent to the provider). */
|
|
264
|
+
name: string;
|
|
265
|
+
modelPurposes?: AXMAiManagementModelPurposeSlug[];
|
|
266
|
+
chatTransport: AXMAiManagementModelChatTransport;
|
|
267
|
+
openAiEndpointId?: string | null;
|
|
268
|
+
maxContextTokens?: number;
|
|
269
|
+
maxOutputTokens?: number;
|
|
270
|
+
maxInputTokens?: number;
|
|
271
|
+
inputPricePerMillion?: number;
|
|
272
|
+
outputPricePerMillion?: number;
|
|
273
|
+
cachedInputPricePerMillion?: number;
|
|
274
|
+
openAiEndpointIsDisabled?: boolean;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
type AXMAiManagementMcpServerTransport = 'http' | 'sse';
|
|
278
|
+
/**
|
|
279
|
+
* Persisted external MCP server catalog row.
|
|
280
|
+
*/
|
|
281
|
+
interface AXMAiManagementMcpServerEntityModel extends AXPEntityModel<string> {
|
|
282
|
+
name: string;
|
|
283
|
+
title: string;
|
|
284
|
+
transport: AXMAiManagementMcpServerTransport;
|
|
285
|
+
url: string;
|
|
286
|
+
apiKey?: string | null;
|
|
287
|
+
isDisabled?: boolean;
|
|
288
|
+
/** Optional prefix applied to tool names exposed to the AI engine. */
|
|
289
|
+
toolPrefix?: string | null;
|
|
290
|
+
/** When set, only these upstream MCP tool names may be called. */
|
|
291
|
+
allowedToolNames?: string[] | null;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Persisted OpenAI-compatible endpoint row.
|
|
296
|
+
*/
|
|
297
|
+
interface AXMAiManagementOpenAiEndpointEntityModel extends AXPEntityModel<string> {
|
|
298
|
+
title: AXPMultiLanguageString;
|
|
299
|
+
description?: AXPMultiLanguageString;
|
|
300
|
+
apiBase: string;
|
|
301
|
+
apiKey?: string | null;
|
|
302
|
+
/**
|
|
303
|
+
* When false, chat completions use a single non-streaming JSON response (no SSE).
|
|
304
|
+
* Omitted or true keeps streaming, which matches most cloud OpenAI-compatible APIs.
|
|
305
|
+
*/
|
|
306
|
+
stream?: boolean;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
declare const AXM_AI_PLATFORM_RUNTIME_CONTEXT_DEFINITIONS: AXPContextDefinition[];
|
|
310
|
+
|
|
311
|
+
/** @see {@link AXPAgentOutputKind} */
|
|
312
|
+
type AXPAiAgentOutputKind = AXPAgentOutputKind;
|
|
313
|
+
/** @see {@link AXPOutputTranscriptSegmentId} */
|
|
314
|
+
type AXPAiOutputTranscriptSegment = AXPOutputTranscriptSegmentId;
|
|
315
|
+
/**
|
|
316
|
+
* Minimal JSON-Schema-like object for native provider hints and local validation.
|
|
317
|
+
*/
|
|
318
|
+
interface AXPAiJsonSchemaLike {
|
|
319
|
+
type?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
320
|
+
properties?: Record<string, AXPAiJsonSchemaLike>;
|
|
321
|
+
items?: AXPAiJsonSchemaLike | AXPAiJsonSchemaLike[];
|
|
322
|
+
required?: string[];
|
|
323
|
+
enum?: unknown[];
|
|
324
|
+
additionalProperties?: boolean | AXPAiJsonSchemaLike;
|
|
325
|
+
description?: string;
|
|
326
|
+
[key: string]: unknown;
|
|
327
|
+
}
|
|
328
|
+
/** Provider-native structured output hint (OpenAI `response_format`, Gemini `responseMimeType`). */
|
|
329
|
+
type AXPAiResponseFormat = {
|
|
330
|
+
type: 'text';
|
|
331
|
+
} | {
|
|
332
|
+
type: 'json_object';
|
|
333
|
+
} | {
|
|
334
|
+
type: 'json_schema';
|
|
335
|
+
schema: AXPAiJsonSchemaLike;
|
|
336
|
+
name?: string;
|
|
337
|
+
strict?: boolean;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Catalog row contract for specialist final output (separate from domain `systemPrompt`).
|
|
341
|
+
* Field paths align with agent/assist entity `outputContract` JSON.
|
|
342
|
+
*/
|
|
343
|
+
interface AXPAiAgentOutputContract {
|
|
344
|
+
kind: AXPAiAgentOutputKind;
|
|
345
|
+
/**
|
|
346
|
+
* When `kind` is `object`: `text` = generic JSON object as text; `node` = inner widget node in chat;
|
|
347
|
+
* `followUp` = `{"type":"followUp","content":[...]}` envelope.
|
|
348
|
+
*/
|
|
349
|
+
transcriptSegment?: AXPAiOutputTranscriptSegment;
|
|
350
|
+
instruction?: string;
|
|
351
|
+
schemaSummary?: string;
|
|
352
|
+
schema?: AXPAiJsonSchemaLike;
|
|
353
|
+
schemaName?: string;
|
|
354
|
+
schemaStrict?: boolean;
|
|
355
|
+
validationCommandName?: string;
|
|
356
|
+
structuredRetries?: number;
|
|
357
|
+
providerResponseFormat?: AXPAiResponseFormat;
|
|
358
|
+
}
|
|
359
|
+
/** Default structured retry count when `structuredRetries` is omitted on structured kinds. */
|
|
360
|
+
declare const AXPAI_AGENT_OUTPUT_CONTRACT_DEFAULT_STRUCTURED_RETRIES = 2;
|
|
361
|
+
declare function parseJsonSchemaLike(raw: unknown): AXPAiJsonSchemaLike | undefined;
|
|
362
|
+
declare function parseResponseFormat(raw: unknown): AXPAiResponseFormat | undefined;
|
|
363
|
+
/** Resolved transcript mapping for an object contract (defaults to `text`). */
|
|
364
|
+
declare function resolveOutputTranscriptSegment(contract: AXPAiAgentOutputContract): AXPAiOutputTranscriptSegment;
|
|
365
|
+
/**
|
|
366
|
+
* Normalizes persisted `outputContract` (object or JSON string from entity forms).
|
|
367
|
+
* Returns `null` when absent or invalid (engine treats as implicit `string`).
|
|
368
|
+
*/
|
|
369
|
+
declare function parseAgentOutputContract(raw: unknown): AXPAiAgentOutputContract | null;
|
|
370
|
+
/** Resolved contract for engine (never null; defaults to string). */
|
|
371
|
+
declare function resolveAgentOutputContract(raw: unknown): AXPAiAgentOutputContract;
|
|
372
|
+
declare function axpAiAgentOutputContractUsesStructuredFinalize(contract: AXPAiAgentOutputContract): boolean;
|
|
373
|
+
/** Structured kinds omit the string role baseline (Markdown prose hint) in the mock engine. */
|
|
374
|
+
declare function axpAiAgentOutputContractOmitsRoleBaseline(contract: AXPAiAgentOutputContract): boolean;
|
|
375
|
+
declare function axpAiAgentOutputContractStructuredRetryCap(contract: AXPAiAgentOutputContract): number;
|
|
376
|
+
|
|
377
|
+
type AXPAiChatTransport = 'openai' | 'gemini' | 'demis';
|
|
378
|
+
/**
|
|
379
|
+
* Live platform context for AI runs: keys match {@link AXPContextDefinition.name}, values are opaque.
|
|
380
|
+
* Built by {@link AXPAiPlatformRuntimeContextBuilder}. Display facts go into the system prompt; identity ids are not included.
|
|
381
|
+
*/
|
|
382
|
+
type AXPAiPlatformRuntimeContext = Record<string, unknown>;
|
|
383
|
+
/**
|
|
384
|
+
* Effective Assist entity row (chat policy, prompts, delegated routing).
|
|
385
|
+
* Fields are partial except `id` because API payloads may omit unused slices.
|
|
386
|
+
*/
|
|
387
|
+
type AXPAiEffectiveAssistRow = Partial<Omit<AXMAiManagementAssistEntityModel, 'id'>> & {
|
|
388
|
+
id: string;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Effective AiAgent catalog row for UI and engine requests.
|
|
392
|
+
* Engine-specific fields are normalized in connectivity (mock / API).
|
|
393
|
+
*/
|
|
394
|
+
type AXPAiEffectiveAgentRow = Partial<Omit<AXMAiManagementAgentEntityModel, 'id'>> & {
|
|
395
|
+
id: string;
|
|
396
|
+
outputContract?: AXPAiAgentOutputContract | null;
|
|
397
|
+
};
|
|
398
|
+
interface AXPAiChatModelListRequest {
|
|
399
|
+
assistId?: string | null;
|
|
400
|
+
directAgentId?: string | null;
|
|
401
|
+
}
|
|
402
|
+
interface AXPAiChatModelListItem {
|
|
403
|
+
id: string;
|
|
404
|
+
name: string;
|
|
405
|
+
title: string;
|
|
406
|
+
/** `modelPurposes` from the catalog row (provided by the API). */
|
|
407
|
+
modelPurposes?: string[];
|
|
408
|
+
chatTransport?: string;
|
|
409
|
+
maxContextTokens?: number;
|
|
410
|
+
inputPricePerMillion?: number;
|
|
411
|
+
outputPricePerMillion?: number;
|
|
412
|
+
cachedInputPricePerMillion?: number;
|
|
413
|
+
}
|
|
414
|
+
interface AXPAiChatTextResponse {
|
|
415
|
+
type: 'text';
|
|
416
|
+
content: string;
|
|
417
|
+
}
|
|
418
|
+
/** Model reasoning / planning segment; paired with {@link AXPAiChatTextResponse} in assistant messages. */
|
|
419
|
+
interface AXPAiChatThinkResponse {
|
|
420
|
+
type: 'think';
|
|
421
|
+
content: string;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Stored binary in tenant file storage (user attachment or assistant/tool output replay).
|
|
425
|
+
* MIME type and display name are resolved from {@link fileId} via file storage — not carried on the segment.
|
|
426
|
+
*/
|
|
427
|
+
interface AXPAiChatFileResponse {
|
|
428
|
+
type: 'file';
|
|
429
|
+
content: {
|
|
430
|
+
fileId: string;
|
|
431
|
+
/** When true, UI offers download; default false (inline preview / playback). Set by the model when the user asks for a downloadable file. */
|
|
432
|
+
isDownloadable?: boolean;
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
interface AXPAiChatNodeResponse {
|
|
436
|
+
type: 'node';
|
|
437
|
+
content: unknown;
|
|
438
|
+
}
|
|
439
|
+
interface AXPAiChatFollowUpCommand {
|
|
440
|
+
name: string;
|
|
441
|
+
options?: unknown;
|
|
442
|
+
}
|
|
443
|
+
interface AXPAiChatFollowUpItem {
|
|
444
|
+
text: string | AXPMultiLanguageString;
|
|
445
|
+
command: AXPAiChatFollowUpCommand;
|
|
446
|
+
}
|
|
447
|
+
interface AXPAiChatFollowUpResponse {
|
|
448
|
+
type: 'followUp';
|
|
449
|
+
content: AXPAiChatFollowUpItem[];
|
|
450
|
+
}
|
|
451
|
+
interface AXPAiChatToolInvocationContent {
|
|
452
|
+
command: string;
|
|
453
|
+
arguments: unknown;
|
|
454
|
+
}
|
|
455
|
+
interface AXPAiChatToolAssistantResponse {
|
|
456
|
+
type: 'tool';
|
|
457
|
+
content: AXPAiChatToolInvocationContent;
|
|
458
|
+
callId?: string;
|
|
459
|
+
/** Provider-specific replay data (e.g. Gemini `thought_signature` under a provider-owned metadata key). */
|
|
460
|
+
metadata?: AXPMetaData;
|
|
461
|
+
}
|
|
462
|
+
interface AXPAiChatAgentAssistantResponse {
|
|
463
|
+
type: 'agent';
|
|
464
|
+
content: AXPAiChatToolInvocationContent;
|
|
465
|
+
callId?: string;
|
|
466
|
+
metadata?: AXPMetaData;
|
|
467
|
+
}
|
|
468
|
+
interface AXPAiChatToolResultResponse {
|
|
469
|
+
type: 'tool_result';
|
|
470
|
+
callId: string;
|
|
471
|
+
content: unknown;
|
|
472
|
+
}
|
|
473
|
+
/** Segments a delegated specialist returns to the supervisor (replayable in UI). */
|
|
474
|
+
type AXPAiDelegatedAgentResultSegment = AXPAiChatTextResponse | AXPAiChatThinkResponse | AXPAiChatFileResponse | AXPAiChatNodeResponse | AXPAiChatFollowUpResponse;
|
|
475
|
+
/** Tool-role `agent_result` body from the engine (normalized by connectivity). */
|
|
476
|
+
interface AXPAiDelegatedAgentResultPayload {
|
|
477
|
+
success: boolean;
|
|
478
|
+
error?: string;
|
|
479
|
+
data?: {
|
|
480
|
+
agentName?: string;
|
|
481
|
+
agentId?: string;
|
|
482
|
+
responses: AXPAiDelegatedAgentResultSegment[];
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
interface AXPAiChatAgentResultResponse {
|
|
486
|
+
type: 'agent_result';
|
|
487
|
+
callId: string;
|
|
488
|
+
name?: string;
|
|
489
|
+
content: AXPAiDelegatedAgentResultPayload;
|
|
490
|
+
}
|
|
491
|
+
type AXPAiChatResponse = AXPAiChatTextResponse | AXPAiChatThinkResponse | AXPAiChatFileResponse | AXPAiChatNodeResponse | AXPAiChatFollowUpResponse | AXPAiChatToolAssistantResponse | AXPAiChatAgentAssistantResponse | AXPAiChatToolResultResponse | AXPAiChatAgentResultResponse;
|
|
492
|
+
/**
|
|
493
|
+
* One chat line in the persisted transcript (`user` / `assistant` / `system` / `tool`).
|
|
494
|
+
*/
|
|
495
|
+
interface AXPAiChatMessage {
|
|
496
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
497
|
+
responses: AXPAiChatResponse[];
|
|
498
|
+
name?: string;
|
|
499
|
+
/** Ephemeral delegated sub-run reflection (excluded from user-facing replay). */
|
|
500
|
+
delegatedReflection?: boolean;
|
|
501
|
+
}
|
|
502
|
+
interface AXPAiToolCall {
|
|
503
|
+
id: string;
|
|
504
|
+
name: string;
|
|
505
|
+
arguments: unknown;
|
|
506
|
+
metadata?: AXPMetaData;
|
|
507
|
+
}
|
|
508
|
+
interface AXPAiEngineUsageTotals {
|
|
509
|
+
promptTokens: number;
|
|
510
|
+
completionTokens: number;
|
|
511
|
+
totalTokens: number;
|
|
512
|
+
cachedPromptTokens?: number;
|
|
513
|
+
}
|
|
514
|
+
interface AXPAiEngineLastProviderPayload {
|
|
515
|
+
messages: AXPAiChatMessage[];
|
|
516
|
+
toolCalls?: AXPAiToolCall[];
|
|
517
|
+
/** Platform-neutral usage from the Vercel adapter. Engine must not parse vendor `rawResponse`. */
|
|
518
|
+
usage?: AXPAiEngineUsageTotals;
|
|
519
|
+
rawResponse?: unknown;
|
|
520
|
+
}
|
|
521
|
+
/** Serializable {@link AXPAiEngineRunOptions} passed to a delegated specialist sub-run (debug export). */
|
|
522
|
+
interface AXPAiDelegatedAgentTranscriptRunInput {
|
|
523
|
+
delegationCallId: string;
|
|
524
|
+
agentId: string;
|
|
525
|
+
agentName?: string;
|
|
526
|
+
specialistArguments: unknown;
|
|
527
|
+
run: Omit<AXPAiEngineRunOptions, 'onRunEvent'>;
|
|
528
|
+
}
|
|
529
|
+
interface AXPAiDelegatedAgentTranscriptEntry {
|
|
530
|
+
agentName?: string;
|
|
531
|
+
messages: AXPAiChatMessage[];
|
|
532
|
+
runInput?: AXPAiDelegatedAgentTranscriptRunInput;
|
|
533
|
+
/** Provider API model id used for this specialist sub-run (e.g. `gpt-5`). */
|
|
534
|
+
modelLabel?: string;
|
|
535
|
+
}
|
|
536
|
+
interface AXPAiDelegatedNestedToolCallContext {
|
|
537
|
+
delegationCallId: string;
|
|
538
|
+
agentId: string;
|
|
539
|
+
agentName?: string;
|
|
540
|
+
}
|
|
541
|
+
type AXPAiEngineRunEvent = {
|
|
542
|
+
type: 'assistant_stream_reset';
|
|
543
|
+
} | {
|
|
544
|
+
type: 'assistant_stream_delta';
|
|
545
|
+
delta: string;
|
|
546
|
+
segment?: 'text' | 'think';
|
|
547
|
+
} | {
|
|
548
|
+
type: 'tool_call_start';
|
|
549
|
+
call: AXPAiToolCall;
|
|
550
|
+
} | {
|
|
551
|
+
type: 'tool_call_end';
|
|
552
|
+
call: AXPAiToolCall;
|
|
553
|
+
resultMessage: AXPAiChatMessage;
|
|
554
|
+
/** Present when the tool was a delegated specialist — available immediately after the sub-run finishes. */
|
|
555
|
+
delegatedTranscript?: AXPAiDelegatedAgentTranscriptEntry;
|
|
556
|
+
} | {
|
|
557
|
+
type: 'delegated_agent_nested_tool_call_start';
|
|
558
|
+
ctx: AXPAiDelegatedNestedToolCallContext;
|
|
559
|
+
call: AXPAiToolCall;
|
|
560
|
+
} | {
|
|
561
|
+
type: 'delegated_agent_nested_tool_call_end';
|
|
562
|
+
ctx: AXPAiDelegatedNestedToolCallContext;
|
|
563
|
+
call: AXPAiToolCall;
|
|
564
|
+
resultMessage: AXPAiChatMessage;
|
|
565
|
+
} | {
|
|
566
|
+
type: 'delegated_agent_nested_stream_reset';
|
|
567
|
+
ctx: AXPAiDelegatedNestedToolCallContext;
|
|
568
|
+
} | {
|
|
569
|
+
type: 'delegated_agent_nested_stream_delta';
|
|
570
|
+
ctx: AXPAiDelegatedNestedToolCallContext;
|
|
571
|
+
delta: string;
|
|
572
|
+
} | {
|
|
573
|
+
type: 'delegated_agent_reflection_phase';
|
|
574
|
+
active: boolean;
|
|
575
|
+
};
|
|
576
|
+
interface AXPAiEngineRunOptions {
|
|
577
|
+
messages: AXPAiChatMessage[];
|
|
578
|
+
assistId?: string;
|
|
579
|
+
demisSessionUuid?: string;
|
|
580
|
+
directAgentId?: string;
|
|
581
|
+
modelEntityId?: string;
|
|
582
|
+
modelId?: string;
|
|
583
|
+
maxSteps?: number;
|
|
584
|
+
maxTokens?: number;
|
|
585
|
+
temperature?: number;
|
|
586
|
+
planningMode?: 'off' | 'once' | 'when-needed';
|
|
587
|
+
includeRules?: string[];
|
|
588
|
+
excludeRules?: string[];
|
|
589
|
+
/** Adds delegated specialists for this run only (AiAgent catalog `id` or programmatic `name`). */
|
|
590
|
+
includeAgents?: string[];
|
|
591
|
+
/** Removes delegated specialists for this run (matches catalog `id` or `name`, case-insensitive). */
|
|
592
|
+
excludeAgents?: string[];
|
|
593
|
+
platformRuntimeContext?: AXPAiPlatformRuntimeContext | null;
|
|
594
|
+
outputContract?: AXPAiAgentOutputContract;
|
|
595
|
+
onRunEvent?: (event: AXPAiEngineRunEvent) => void;
|
|
596
|
+
/** When aborted, provider streams and multi-step loops should stop promptly. */
|
|
597
|
+
abortSignal?: AbortSignal;
|
|
598
|
+
}
|
|
599
|
+
interface AXPAiEngineRunResult {
|
|
600
|
+
messages: AXPAiChatMessage[];
|
|
601
|
+
lastProviderResult?: AXPAiEngineLastProviderPayload;
|
|
602
|
+
usageTotals?: AXPAiEngineUsageTotals;
|
|
603
|
+
delegatedTranscriptsByCallId?: Record<string, AXPAiDelegatedAgentTranscriptEntry>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
type AXPAiChatResult = AXPAiEngineLastProviderPayload;
|
|
607
|
+
type AXPAiChatToolChoice = 'auto' | 'none' | {
|
|
608
|
+
type: 'tool';
|
|
609
|
+
name: string;
|
|
610
|
+
};
|
|
611
|
+
interface AXPAiToolSchema {
|
|
612
|
+
name: string;
|
|
613
|
+
description: string;
|
|
614
|
+
parameters: Record<string, unknown>;
|
|
615
|
+
}
|
|
616
|
+
interface AXPAiChatOptionsDemis {
|
|
617
|
+
/** Demisco bearer token; when omitted the server loads tenant settings. */
|
|
618
|
+
bearerToken?: string;
|
|
619
|
+
/** Demisco `agent_uuid` (`/core/agent/chat/` body field). */
|
|
620
|
+
agentUuid?: string;
|
|
621
|
+
/** Demisco `session_uuid` for server-side conversation history. */
|
|
622
|
+
sessionUuid?: string;
|
|
623
|
+
/** Demisco transcribe `language` form field (e.g. `FA`, `EN`). */
|
|
624
|
+
transcribeLanguage?: string;
|
|
625
|
+
/** Catalog model id for inline audio transcription before chat. */
|
|
626
|
+
speechModelEntityId?: string;
|
|
627
|
+
}
|
|
628
|
+
interface AXPAiChatOptions {
|
|
629
|
+
messages: AXPAiChatMessage[];
|
|
630
|
+
/** Catalog model entity id — preferred; adapter resolves credentials server-side. */
|
|
631
|
+
modelEntityId?: string;
|
|
632
|
+
/** API model id override; when omitted, resolved from `modelEntityId`. */
|
|
633
|
+
modelId?: string | {
|
|
634
|
+
value?: string;
|
|
635
|
+
};
|
|
636
|
+
/** Catalog transport metadata for runtime context only — not for credential loading. */
|
|
637
|
+
chatTransport?: AXPAiChatTransport;
|
|
638
|
+
/** @deprecated Adapter resolves credentials from `modelEntityId`; do not pass from Engine. */
|
|
639
|
+
openAi?: {
|
|
640
|
+
apiBase: string;
|
|
641
|
+
apiKey: string;
|
|
642
|
+
stream?: boolean;
|
|
643
|
+
};
|
|
644
|
+
/** @deprecated Adapter resolves credentials from `modelEntityId`; do not pass from Engine. */
|
|
645
|
+
geminiApiKey?: string;
|
|
646
|
+
/** @deprecated Demis runtime is disabled; kept for contract compatibility. */
|
|
647
|
+
demis?: AXPAiChatOptionsDemis;
|
|
648
|
+
tools?: AXPAiToolSchema[];
|
|
649
|
+
toolChoice?: AXPAiChatToolChoice;
|
|
650
|
+
maxTokens?: number;
|
|
651
|
+
temperature?: number;
|
|
652
|
+
stream?: boolean;
|
|
653
|
+
responseFormat?: AXPAiResponseFormat;
|
|
654
|
+
onStreamDelta?: (delta: string) => void;
|
|
655
|
+
/** Cancels in-flight generateText / streamText when aborted. */
|
|
656
|
+
abortSignal?: AbortSignal;
|
|
657
|
+
/**
|
|
658
|
+
* AI SDK `runtimeContext` — run metadata that must not be added to the model prompt
|
|
659
|
+
* (ids, transport, catalog keys). Not used to execute tools.
|
|
660
|
+
*/
|
|
661
|
+
runtimeContext?: Record<string, string>;
|
|
662
|
+
/**
|
|
663
|
+
* Unused for execution. SDK tools have no `execute`; ToolCoordinator runs tools.
|
|
664
|
+
* Kept only so the adapter can forward a payload if present — do not add `tool.execute`.
|
|
665
|
+
*/
|
|
666
|
+
toolsContext?: Record<string, string>;
|
|
667
|
+
}
|
|
668
|
+
interface AXPAiExtractDocumentTextOptions {
|
|
669
|
+
/** Catalog model entity id — preferred; adapter resolves credentials server-side. */
|
|
670
|
+
modelEntityId?: string;
|
|
671
|
+
modelId?: string | {
|
|
672
|
+
value?: string;
|
|
673
|
+
};
|
|
674
|
+
chatTransport?: AXPAiChatTransport;
|
|
675
|
+
/** @deprecated Adapter resolves from `modelEntityId`. */
|
|
676
|
+
openAi?: {
|
|
677
|
+
apiBase: string;
|
|
678
|
+
apiKey: string;
|
|
679
|
+
};
|
|
680
|
+
/** @deprecated Adapter resolves from `modelEntityId`. */
|
|
681
|
+
geminiApiKey?: string;
|
|
682
|
+
/** Agent catalog prompt. Omitted or empty: no system message is sent. */
|
|
683
|
+
systemPrompt?: string;
|
|
684
|
+
userInstruction: string;
|
|
685
|
+
mimeType: string;
|
|
686
|
+
/** Raw document bytes from file storage. */
|
|
687
|
+
bytes: Uint8Array;
|
|
688
|
+
filename?: string;
|
|
689
|
+
}
|
|
690
|
+
interface AXPAiGenerateImageOptions {
|
|
691
|
+
modelEntityId?: string;
|
|
692
|
+
chatTransport?: AXPAiChatTransport;
|
|
693
|
+
catalogApiModelName?: string;
|
|
694
|
+
prompt: string;
|
|
695
|
+
size?: string;
|
|
696
|
+
openAi?: {
|
|
697
|
+
apiBase: string;
|
|
698
|
+
apiKey: string;
|
|
699
|
+
};
|
|
700
|
+
geminiApiKey?: string;
|
|
701
|
+
}
|
|
702
|
+
interface AXPAiGenerateVideoOptions {
|
|
703
|
+
modelEntityId?: string;
|
|
704
|
+
chatTransport?: AXPAiChatTransport;
|
|
705
|
+
catalogApiModelName?: string;
|
|
706
|
+
prompt: string;
|
|
707
|
+
aspectRatio?: string;
|
|
708
|
+
duration?: number;
|
|
709
|
+
openAi?: {
|
|
710
|
+
apiBase: string;
|
|
711
|
+
apiKey: string;
|
|
712
|
+
};
|
|
713
|
+
geminiApiKey?: string;
|
|
714
|
+
}
|
|
715
|
+
interface AXPAiTranscribeSpeechOptions {
|
|
716
|
+
modelEntityId?: string;
|
|
717
|
+
chatTransport?: AXPAiChatTransport;
|
|
718
|
+
catalogApiModelName?: string;
|
|
719
|
+
audioBytes: ArrayBuffer;
|
|
720
|
+
mimeType: string;
|
|
721
|
+
fileName?: string;
|
|
722
|
+
language?: string;
|
|
723
|
+
openAi?: {
|
|
724
|
+
apiBase: string;
|
|
725
|
+
apiKey: string;
|
|
726
|
+
};
|
|
727
|
+
geminiApiKey?: string;
|
|
728
|
+
}
|
|
729
|
+
interface AXPAiSynthesizeSpeechOptions {
|
|
730
|
+
modelEntityId?: string;
|
|
731
|
+
chatTransport?: AXPAiChatTransport;
|
|
732
|
+
catalogApiModelName?: string;
|
|
733
|
+
text: string;
|
|
734
|
+
voice?: string;
|
|
735
|
+
responseFormat?: string;
|
|
736
|
+
openAi?: {
|
|
737
|
+
apiBase: string;
|
|
738
|
+
apiKey: string;
|
|
739
|
+
};
|
|
740
|
+
geminiApiKey?: string;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
interface AXPAiSdkChatContextBundle {
|
|
744
|
+
runtimeContext?: Record<string, string>;
|
|
745
|
+
toolsContext?: Record<string, string>;
|
|
746
|
+
promptAddendum: string;
|
|
747
|
+
}
|
|
748
|
+
declare const AXP_AI_SDK_TOOL_CONTEXT_JSON_SCHEMA: Record<string, unknown>;
|
|
749
|
+
/**
|
|
750
|
+
* Turns registered AI-capable context definitions + live values into the
|
|
751
|
+
* `## Platform runtime` system-prompt block. Identity ids are never assembled into values.
|
|
752
|
+
*/
|
|
753
|
+
declare function formatAxpAiPlatformRuntimePrompt(platformRuntimeContext: AXPAiPlatformRuntimeContext | null | undefined, definitions: readonly AXPContextDefinition[] | null | undefined): string;
|
|
754
|
+
declare function buildAxpAiSdkChatContextBundle(input: {
|
|
755
|
+
platformRuntimeContext?: AXPAiPlatformRuntimeContext | null;
|
|
756
|
+
contextDefinitions?: readonly AXPContextDefinition[] | null;
|
|
757
|
+
runId?: string;
|
|
758
|
+
assistId?: string;
|
|
759
|
+
agentId?: string;
|
|
760
|
+
agentName?: string;
|
|
761
|
+
chatTransport?: string;
|
|
762
|
+
modelEntityId?: string;
|
|
763
|
+
demisSessionUuid?: string;
|
|
764
|
+
}): AXPAiSdkChatContextBundle;
|
|
765
|
+
declare function attachAxpAiSdkChatContext<T extends AXPAiChatOptions>(options: T, bundle: AXPAiSdkChatContextBundle): T;
|
|
766
|
+
interface AXPAiPlatformRuntimeContextSources {
|
|
767
|
+
userDisplayName?: string;
|
|
768
|
+
tenantTitle?: string;
|
|
769
|
+
applicationTitle?: string;
|
|
770
|
+
locale?: string;
|
|
771
|
+
calendarSystem?: string;
|
|
772
|
+
timeZone?: string;
|
|
773
|
+
country?: string;
|
|
774
|
+
notes?: string;
|
|
775
|
+
now?: Date;
|
|
776
|
+
}
|
|
777
|
+
declare function formatAxpAiPlatformRuntimeLocalDateTime(now: Date, ianaTimeZone?: string): string;
|
|
778
|
+
declare function assembleAxpAiPlatformRuntimeContext(sources: AXPAiPlatformRuntimeContextSources): AXPAiPlatformRuntimeContext;
|
|
779
|
+
|
|
780
|
+
interface ResolveEffectiveOutputContractInput {
|
|
781
|
+
/** Highest priority: per engine run (programmatic / automation). */
|
|
782
|
+
runtime?: AXPAiAgentOutputContract | unknown | null;
|
|
783
|
+
/** Assist `run` / `show` input. */
|
|
784
|
+
input?: AXPAiAgentOutputContract | unknown | null;
|
|
785
|
+
/** Active AiAgent catalog row. */
|
|
786
|
+
agent?: AXPAiAgentOutputContract | unknown | null;
|
|
787
|
+
/** Active Assist catalog row. */
|
|
788
|
+
assist?: AXPAiAgentOutputContract | unknown | null;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Resolves the effective output contract for one engine turn.
|
|
792
|
+
*
|
|
793
|
+
* Priority: runtime > input > agent > assist > `{ kind: 'string' }`.
|
|
794
|
+
*/
|
|
795
|
+
declare function resolveEffectiveOutputContract(params: ResolveEffectiveOutputContractInput): AXPAiAgentOutputContract;
|
|
796
|
+
|
|
797
|
+
/** Default structured retry count for a contract kind when `structuredRetries` is omitted. */
|
|
798
|
+
declare function defaultRetriesForKind(kind: AXPAiAgentOutputKind): number;
|
|
799
|
+
/**
|
|
800
|
+
* Maps an effective output contract to a provider request hint.
|
|
801
|
+
* Explicit {@link AXPAiAgentOutputContract.providerResponseFormat} wins; otherwise derived from `kind` + `schema`.
|
|
802
|
+
*/
|
|
803
|
+
declare function deriveProviderResponseFormat(contract: AXPAiAgentOutputContract): AXPAiResponseFormat | undefined;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* JSON Schema hint for {@link AXPWidgetNode} roots returned by layout specialists.
|
|
807
|
+
* Intentionally permissive (`additionalProperties`) — strict validation runs via
|
|
808
|
+
* `AiFormbuilder:ValidateLayoutJsonForAi` when configured on the agent contract.
|
|
809
|
+
*/
|
|
810
|
+
declare const AXP_WIDGET_NODE_JSON_SCHEMA: AXPAiJsonSchemaLike;
|
|
811
|
+
/** JSON Schema for the followUp transcript envelope (`type` + `content` chips). */
|
|
812
|
+
declare const AXP_FOLLOW_UP_ENVELOPE_JSON_SCHEMA: AXPAiJsonSchemaLike;
|
|
813
|
+
/** Built-in JSON Schema for known transcript segments when the contract omits `schema`. */
|
|
814
|
+
declare function resolveBuiltinSchemaForOutputContract(contract: AXPAiAgentOutputContract): AXPAiJsonSchemaLike | undefined;
|
|
815
|
+
|
|
816
|
+
type AXPAiChatStructuredOutputGate = {
|
|
817
|
+
responseFormat?: AXPAiResponseFormat;
|
|
818
|
+
hasTools?: boolean;
|
|
819
|
+
toolChoice?: 'auto' | 'none' | {
|
|
820
|
+
type: 'tool';
|
|
821
|
+
name: string;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
/**
|
|
825
|
+
* Native structured output (AI SDK `output` / provider schema) must not run on tool-calling
|
|
826
|
+
* turns — only when tools are absent or explicitly disabled (`toolChoice: 'none'`).
|
|
827
|
+
*/
|
|
828
|
+
declare function axpAiShouldApplyChatStructuredOutput(params: AXPAiChatStructuredOutputGate): boolean;
|
|
829
|
+
declare function axpAiTryParseJsonValueFromAssistantText(text: string): unknown | undefined;
|
|
830
|
+
/** True when assistant `text` duplicates a structured segment already attached as `node` / `followUp`. */
|
|
831
|
+
declare function axpAiTextDuplicatesStructuredSegment(text: string, segment: 'node' | 'followUp'): boolean;
|
|
832
|
+
|
|
833
|
+
/** Prefix for supervisor-delegated specialist tools (`${AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX}${agentId}`). */
|
|
834
|
+
declare const AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX: "agent:";
|
|
835
|
+
declare function axpAiSupervisorAgentToolName(agentCatalogId: string): string;
|
|
836
|
+
declare function axpAiParseSupervisorAgentToolName(toolName: string): string | null;
|
|
837
|
+
declare function axpAiChatTextMessage(role: AXPAiChatMessage['role'], text: string): AXPAiChatMessage;
|
|
838
|
+
declare function axpAiChatToolResultMessage(callId: string, content: unknown, toolName?: string): AXPAiChatMessage;
|
|
839
|
+
declare function axpAiChatMessageGetText(message: AXPAiChatMessage): string;
|
|
840
|
+
declare function axpAiNormalizeHandlerResultToToolBody(handlerResult: unknown): unknown;
|
|
841
|
+
|
|
842
|
+
type AXPAiEngineWireEvent = AXPAiEngineRunEvent | {
|
|
843
|
+
type: 'run_started';
|
|
844
|
+
runId: string;
|
|
845
|
+
} | {
|
|
846
|
+
type: 'frontend_tool_call';
|
|
847
|
+
runId: string;
|
|
848
|
+
call: AXPAiToolCall;
|
|
849
|
+
} | {
|
|
850
|
+
type: 'run_completed';
|
|
851
|
+
result: AXPAiEngineRunResult;
|
|
852
|
+
} | {
|
|
853
|
+
type: 'run_failed';
|
|
854
|
+
error: string;
|
|
855
|
+
};
|
|
856
|
+
type AXPAiEngineRunRequest = Omit<AXPAiEngineRunOptions, 'onRunEvent'>;
|
|
857
|
+
|
|
858
|
+
type AXPAiExtractDocumentKind = 'image' | 'pdf' | 'text' | 'unsupported';
|
|
859
|
+
/**
|
|
860
|
+
* Classifies a document for AI text extraction (image OCR, PDF file part, or UTF-8 text).
|
|
861
|
+
* Does not include Office formats.
|
|
862
|
+
*/
|
|
863
|
+
declare function classifyAiExtractDocument(mimeType: string | undefined | null, filename?: string | null): AXPAiExtractDocumentKind;
|
|
864
|
+
declare function canAiExtractDocument(mimeType: string | undefined | null, filename?: string | null): boolean;
|
|
865
|
+
|
|
866
|
+
declare const AIMANAGEMENT_CHAT_GENERATE_IMAGE_COMMAND_KEY = "AiManagement:ChatGenerateImage";
|
|
867
|
+
declare const AIMANAGEMENT_CHAT_TRANSCRIBE_SPEECH_COMMAND_KEY = "AiManagement:ChatTranscribeSpeech";
|
|
868
|
+
declare const AIMANAGEMENT_CHAT_SYNTHESIZE_SPEECH_COMMAND_KEY = "AiManagement:ChatSynthesizeSpeech";
|
|
869
|
+
declare const AIMANAGEMENT_EXTRACT_DOCUMENT_TEXT_COMMAND_KEY = "AiManagement:ExtractDocumentText";
|
|
870
|
+
declare const AIMANAGEMENT_STRUCTURED_TEXT_COMPLETION_COMMAND_KEY = "AiManagement:StructuredTextCompletion";
|
|
871
|
+
|
|
872
|
+
declare const AXMAiManagementTransportKeys: {
|
|
873
|
+
readonly Engine: {
|
|
874
|
+
readonly Run: "AiManagement:Engine:Run";
|
|
875
|
+
readonly SubmitToolResult: "AiManagement:Engine:SubmitToolResult";
|
|
876
|
+
};
|
|
877
|
+
readonly ConversationAssist: {
|
|
878
|
+
readonly Subscribe: "ConversationManagement:Assist:Subscribe";
|
|
879
|
+
readonly AssistSync: "ConversationManagement:Assist:AssistSync";
|
|
880
|
+
readonly RetryAssist: "ConversationManagement:Assist:RetryAssist";
|
|
881
|
+
readonly CancelAssist: "ConversationManagement:Assist:CancelAssist";
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
type AXMAiModelPurposeSlug = 'chat' | 'vision' | 'image' | 'speech' | 'tts' | 'video';
|
|
886
|
+
declare function readModelPurposes(row: Record<string, unknown> | null | undefined): string[];
|
|
887
|
+
declare function modelRowHasPurpose(row: Record<string, unknown> | null | undefined, purpose: AXMAiModelPurposeSlug): boolean;
|
|
888
|
+
declare function isChatPurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
889
|
+
|
|
890
|
+
declare function parseChatTransport(raw: unknown): AXPAiChatTransport | undefined;
|
|
891
|
+
|
|
892
|
+
declare function axpAiChatMessagesFromProviderAssistant(text: string, toolCalls?: AXPAiToolCall[]): AXPAiChatMessage[];
|
|
893
|
+
declare function axcResolveAiMlOrPlainString(value: unknown, locale?: string): string;
|
|
894
|
+
|
|
895
|
+
export { AIMANAGEMENT_CHAT_GENERATE_IMAGE_COMMAND_KEY, AIMANAGEMENT_CHAT_SYNTHESIZE_SPEECH_COMMAND_KEY, AIMANAGEMENT_CHAT_TRANSCRIBE_SPEECH_COMMAND_KEY, AIMANAGEMENT_EXTRACT_DOCUMENT_TEXT_COMMAND_KEY, AIMANAGEMENT_STRUCTURED_TEXT_COMPLETION_COMMAND_KEY, AXMAiAssistPermissionKeys, AXMAiManagementTransportKeys, AXMPermissionsKeys, AXM_AI_PLATFORM_RUNTIME_CONTEXT_DEFINITIONS, AXPAI_AGENT_OUTPUT_CONTRACT_DEFAULT_STRUCTURED_RETRIES, AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX, AXPAdministrationPermissionKeys, AXPAiManagementFeatureKeys, AXPAiManagementMenuKeys, AXPAiManagementSettings, AXP_AI_SDK_TOOL_CONTEXT_JSON_SCHEMA, AXP_FOLLOW_UP_ENVELOPE_JSON_SCHEMA, AXP_WIDGET_NODE_JSON_SCHEMA, RootConfig, assembleAxpAiPlatformRuntimeContext, attachAxpAiSdkChatContext, axcResolveAiMlOrPlainString, axpAiAgentOutputContractOmitsRoleBaseline, axpAiAgentOutputContractStructuredRetryCap, axpAiAgentOutputContractUsesStructuredFinalize, axpAiChatMessageGetText, axpAiChatMessagesFromProviderAssistant, axpAiChatTextMessage, axpAiChatToolResultMessage, axpAiNormalizeHandlerResultToToolBody, axpAiParseSupervisorAgentToolName, axpAiShouldApplyChatStructuredOutput, axpAiSupervisorAgentToolName, axpAiTextDuplicatesStructuredSegment, axpAiTryParseJsonValueFromAssistantText, buildAxpAiSdkChatContextBundle, canAiExtractDocument, classifyAiExtractDocument, defaultRetriesForKind, deriveProviderResponseFormat, formatAxpAiPlatformRuntimeLocalDateTime, formatAxpAiPlatformRuntimePrompt, isChatPurposeModelRow, modelRowHasPurpose, parseAgentOutputContract, parseChatTransport, parseJsonSchemaLike, parseResponseFormat, readModelPurposes, resolveAgentOutputContract, resolveBuiltinSchemaForOutputContract, resolveEffectiveOutputContract, resolveOutputTranscriptSegment };
|
|
896
|
+
export type { AXMAiManagementAgentEntityModel, AXMAiManagementAssistEntityModel, AXMAiManagementAssistPlanningMode, AXMAiManagementMcpServerEntityModel, AXMAiManagementMcpServerTransport, AXMAiManagementModelChatTransport, AXMAiManagementModelEntityModel, AXMAiManagementModelPurposeSlug, AXMAiManagementOpenAiEndpointEntityModel, AXMAiManagementRuleEntityModel, AXMAiManagementRuleRef, AXMAiModelPurposeSlug, AXPAiAgentOutputContract, AXPAiAgentOutputKind, AXPAiChatAgentAssistantResponse, AXPAiChatAgentResultResponse, AXPAiChatFileResponse, AXPAiChatFollowUpCommand, AXPAiChatFollowUpItem, AXPAiChatFollowUpResponse, AXPAiChatMessage, AXPAiChatModelListItem, AXPAiChatModelListRequest, AXPAiChatNodeResponse, AXPAiChatOptions, AXPAiChatOptionsDemis, AXPAiChatResponse, AXPAiChatResult, AXPAiChatStructuredOutputGate, AXPAiChatTextResponse, AXPAiChatThinkResponse, AXPAiChatToolAssistantResponse, AXPAiChatToolChoice, AXPAiChatToolInvocationContent, AXPAiChatToolResultResponse, AXPAiChatTransport, AXPAiDelegatedAgentResultPayload, AXPAiDelegatedAgentResultSegment, AXPAiDelegatedAgentTranscriptEntry, AXPAiDelegatedAgentTranscriptRunInput, AXPAiDelegatedNestedToolCallContext, AXPAiEffectiveAgentRow, AXPAiEffectiveAssistRow, AXPAiEngineLastProviderPayload, AXPAiEngineRunEvent, AXPAiEngineRunOptions, AXPAiEngineRunRequest, AXPAiEngineRunResult, AXPAiEngineUsageTotals, AXPAiEngineWireEvent, AXPAiExtractDocumentKind, AXPAiExtractDocumentTextOptions, AXPAiGenerateImageOptions, AXPAiGenerateVideoOptions, AXPAiJsonSchemaLike, AXPAiOutputTranscriptSegment, AXPAiPlatformRuntimeContext, AXPAiPlatformRuntimeContextSources, AXPAiResponseFormat, AXPAiSdkChatContextBundle, AXPAiSynthesizeSpeechOptions, AXPAiToolCall, AXPAiToolSchema, AXPAiTranscribeSpeechOptions, ResolveEffectiveOutputContractInput };
|