@acorex/modules 21.0.0-next.53 → 21.0.0-next.55
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/ai-management/README.md +3 -2
- package/fesm2022/{acorex-modules-ai-management-agent.entity-D6-0_Ms3.mjs → acorex-modules-ai-management-agent.entity-X51GLTdi.mjs} +69 -6
- package/fesm2022/acorex-modules-ai-management-agent.entity-X51GLTdi.mjs.map +1 -0
- package/fesm2022/{acorex-modules-ai-management-assist.entity-CnyoIO-Z.mjs → acorex-modules-ai-management-assist.entity-2h5KE9UH.mjs} +58 -4
- package/fesm2022/acorex-modules-ai-management-assist.entity-2h5KE9UH.mjs.map +1 -0
- package/fesm2022/acorex-modules-ai-management-rule.entity-CQNx4QEB.mjs +121 -0
- package/fesm2022/acorex-modules-ai-management-rule.entity-CQNx4QEB.mjs.map +1 -0
- package/fesm2022/acorex-modules-ai-management.mjs +864 -945
- package/fesm2022/acorex-modules-ai-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-conversation-acorex-modules-conversation-Bnjyq-wp.mjs → acorex-modules-conversation-acorex-modules-conversation-UNhA-qi5.mjs} +71 -41
- package/fesm2022/acorex-modules-conversation-acorex-modules-conversation-UNhA-qi5.mjs.map +1 -0
- package/fesm2022/{acorex-modules-conversation-assist-delegated-agent-detail-popup.component-Df5LmYZI.mjs → acorex-modules-conversation-assist-delegated-agent-detail-popup.component-Be58gcns.mjs} +6 -6
- package/fesm2022/acorex-modules-conversation-assist-delegated-agent-detail-popup.component-Be58gcns.mjs.map +1 -0
- package/fesm2022/{acorex-modules-conversation-comments-page.component-BXI4smIr.mjs → acorex-modules-conversation-comments-page.component-3XBLeMW8.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-comments-page.component-BXI4smIr.mjs.map → acorex-modules-conversation-comments-page.component-3XBLeMW8.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-conversation-send-assist-chat-message.command-B5qJnpCK.mjs → acorex-modules-conversation-send-assist-chat-message.command-CSu-lJuu.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-send-assist-chat-message.command-B5qJnpCK.mjs.map → acorex-modules-conversation-send-assist-chat-message.command-CSu-lJuu.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-conversation-start-assist-chat.command-DI3LAaDF.mjs → acorex-modules-conversation-start-assist-chat.command-CyoncQB1.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-start-assist-chat.command-DI3LAaDF.mjs.map → acorex-modules-conversation-start-assist-chat.command-CyoncQB1.mjs.map} +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-modules-ai-management.d.ts +721 -582
- package/types/acorex-modules-conversation.d.ts +2 -0
- package/fesm2022/acorex-modules-ai-management-agent.entity-D6-0_Ms3.mjs.map +0 -1
- package/fesm2022/acorex-modules-ai-management-assist.entity-CnyoIO-Z.mjs.map +0 -1
- package/fesm2022/acorex-modules-conversation-acorex-modules-conversation-Bnjyq-wp.mjs.map +0 -1
- package/fesm2022/acorex-modules-conversation-assist-delegated-agent-detail-popup.component-Df5LmYZI.mjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { OnInit, OnDestroy } from '@angular/core';
|
|
3
3
|
import * as i1 from '@acorex/platform/core';
|
|
4
|
-
import {
|
|
4
|
+
import { AXPMultiLanguageString, AXPFileListItem, AXPModuleManifest, AXPDataSourceDefinitionProvider, AXPDataSourceDefinition } from '@acorex/platform/core';
|
|
5
5
|
import * as i2 from '@acorex/platform/layout/widgets';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { AXPEntityModel, AXPEntityDefinitionLoader, AXPEntityPreloadEntity, AXPEntityService } from '@acorex/platform/layout/entity';
|
|
7
|
+
import { AXPOutputTranscriptSegmentId, AXPAgentOutputKind, AXPAgentOutputContract, AXPJsonSchemaLike, AXPAgentResponseFormat, AXPEntity, AXPMenuProvider, AXPMenuProviderContext, AXPFileStorageService } from '@acorex/platform/common';
|
|
8
8
|
import { AXPPermissionDefinitionProvider, AXPPermissionDefinitionProviderContext } from '@acorex/platform/auth';
|
|
9
9
|
|
|
10
10
|
declare class AXMAiManagementModule {
|
|
@@ -13,439 +13,25 @@ declare class AXMAiManagementModule {
|
|
|
13
13
|
static ɵinj: i0.ɵɵInjectorDeclaration<AXMAiManagementModule>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Validates parsed JSON from the assistant. Return the validated value (possibly narrowed), or throw with a message
|
|
22
|
-
* the pipeline can send back to the model on retry.
|
|
23
|
-
*/
|
|
24
|
-
type AXPAiStructuredValidator<T = unknown> = (parsed: unknown) => T | Promise<T>;
|
|
25
|
-
/**
|
|
26
|
-
* Thrown when {@link AXPAiAssistRunInput.expectStructuredOutput} is true but the assistant output could not be
|
|
27
|
-
* parsed and optionally validated after all attempts.
|
|
28
|
-
*/
|
|
29
|
-
declare class AXPAiStructuredOutputError extends Error {
|
|
30
|
-
/** 1-based count of engine runs performed for this structured-output session. */
|
|
31
|
-
readonly attempts: number;
|
|
32
|
-
/** Truncated snapshot of the last assistant plain text (for debugging). */
|
|
33
|
-
readonly lastAssistantText: string;
|
|
34
|
-
/** Human-readable validation or parse failure detail. */
|
|
35
|
-
readonly validationMessage: string;
|
|
36
|
-
/** Why the pipeline stopped. */
|
|
37
|
-
readonly code?: 'duplicate_assistant_output' | 'validation_exhausted';
|
|
38
|
-
constructor(options: {
|
|
39
|
-
message: string;
|
|
40
|
-
attempts: number;
|
|
41
|
-
lastAssistantText: string;
|
|
42
|
-
validationMessage: string;
|
|
43
|
-
cause?: unknown;
|
|
44
|
-
code?: 'duplicate_assistant_output' | 'validation_exhausted';
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
/** One persisted user attachment (same storage contract as the AI chat composer). */
|
|
48
|
-
interface AXPAiAssistUserMediaAttachment {
|
|
49
|
-
/** `image` / `audio` / `file` (PDF, text, spreadsheets, and other document MIME types). */
|
|
50
|
-
kind: 'image' | 'audio' | 'file';
|
|
51
|
-
fileId: string;
|
|
52
|
-
mimeType: string;
|
|
53
|
-
name?: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Payload when submitting the assist prompt box (text, optional target assist/agent, optional media).
|
|
57
|
-
*/
|
|
58
|
-
interface AXPAiAssistPromptSubmitPayload {
|
|
59
|
-
prompt: string;
|
|
60
|
-
assistId?: string;
|
|
61
|
-
directAgentId?: string;
|
|
62
|
-
userMediaAttachments: AXPAiAssistUserMediaAttachment[];
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Optional structured hints for a single assist run (serialized into the user message by the implementation).
|
|
66
|
-
*/
|
|
67
|
-
interface AXPAiAssistRunContext {
|
|
68
|
-
/** Short bullet hints appended to the prompt for the model. */
|
|
69
|
-
hints?: string[];
|
|
70
|
-
/** Extra system-level instruction for this run (implementation may emit a system message). */
|
|
71
|
-
systemInstruction?: string;
|
|
72
|
-
/** Arbitrary structured payload (JSON-serialized in the user message when present). */
|
|
73
|
-
structuredContext?: unknown;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Input for the AI assist `run` API (implemented in ai-management).
|
|
77
|
-
*/
|
|
78
|
-
interface AXPAiAssistRunInput {
|
|
79
|
-
prompt: string;
|
|
80
|
-
/**
|
|
81
|
-
* Optional images, audio, or documents (`fileId` from tenant storage). When non-empty, the implementation builds one multimodal
|
|
82
|
-
* user message (same shape as the AI chat composer) plus the serialized prompt body as text segments.
|
|
83
|
-
*/
|
|
84
|
-
userMediaAttachments?: AXPAiAssistUserMediaAttachment[];
|
|
85
|
-
context?: AXPAiAssistRunContext;
|
|
86
|
-
/**
|
|
87
|
-
* Catalog assist id. When omitted together with {@link directAgentId}, the platform default assist is used.
|
|
88
|
-
*/
|
|
89
|
-
assistId?: string;
|
|
90
|
-
directAgentId?: string;
|
|
91
|
-
maxSteps?: number;
|
|
92
|
-
temperature?: number;
|
|
93
|
-
/**
|
|
94
|
-
* Max completion tokens for this engine run (when the provider supports it). Structured JSON runs apply a higher
|
|
95
|
-
* default unless {@link structuredOutputMaxTokens} is set.
|
|
96
|
-
*/
|
|
97
|
-
maxTokens?: number;
|
|
98
|
-
/** When true, implementation tries to parse assistant text as JSON into {@link AXPAiAssistRunResult.structured}. */
|
|
99
|
-
expectStructuredOutput?: boolean;
|
|
100
|
-
/** Extra instruction appended so the model returns JSON (used when {@link expectStructuredOutput} is true). */
|
|
101
|
-
structuredOutputInstruction?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Shallow merge over built-in platform runtime context fields (see ai-management implementation).
|
|
104
|
-
*/
|
|
105
|
-
platformRuntimeNotes?: Record<string, unknown>;
|
|
106
|
-
/**
|
|
107
|
-
* Max extra engine turns after the first response when structured output is invalid (default {@link AXPAiAssistDefaultMaxStructuredRetries}).
|
|
108
|
-
* Total attempts = 1 + maxStructuredRetries.
|
|
109
|
-
*/
|
|
110
|
-
maxStructuredRetries?: number;
|
|
111
|
-
/** Optional schema or domain validation after JSON parse. */
|
|
112
|
-
structuredValidator?: AXPAiStructuredValidator;
|
|
113
|
-
/**
|
|
114
|
-
* When false, only one engine run is performed; invalid structured output throws {@link AXPAiStructuredOutputError}.
|
|
115
|
-
* When true (default for {@link expectStructuredOutput}), invalid output triggers follow-up user messages in the same transcript.
|
|
116
|
-
*/
|
|
117
|
-
retryOnInvalidStructure?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Optional description of the expected JSON shape (TypeScript-style or JSON schema summary), appended to the first
|
|
120
|
-
* user message and to retry prompts so the model stays aligned and retries are more accurate.
|
|
121
|
-
*/
|
|
122
|
-
structuredOutputSchemaSummary?: string;
|
|
123
|
-
/**
|
|
124
|
-
* Overrides {@link maxTokens} for {@link expectStructuredOutput} runs only. Prefer setting this or leaving defaults so
|
|
125
|
-
* the implementation can apply {@link AXPAiAssistDefaultStructuredMaxTokens} and avoid truncated JSON.
|
|
126
|
-
*/
|
|
127
|
-
structuredOutputMaxTokens?: number;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Result of the AI assist `run` API.
|
|
131
|
-
*/
|
|
132
|
-
interface AXPAiAssistRunResult {
|
|
133
|
-
/** Primary assistant reply text (extracted from the engine transcript). */
|
|
134
|
-
text: string;
|
|
135
|
-
/**
|
|
136
|
-
* Present when {@link AXPAiAssistRunInput.expectStructuredOutput} is true: validated structured payload
|
|
137
|
-
* (parse + optional {@link AXPAiAssistRunInput.structuredValidator}). On failure the implementation throws
|
|
138
|
-
* {@link AXPAiStructuredOutputError} instead of returning.
|
|
139
|
-
*/
|
|
140
|
-
structured?: unknown;
|
|
141
|
-
/**
|
|
142
|
-
* When {@link AXPAiAssistRunInput.expectStructuredOutput} is false: engine usage / provider payload for that single run.
|
|
143
|
-
* When true: {@link AXPAiAssistStructuredOutputRunRaw} with per-attempt usage and totals for debugging.
|
|
144
|
-
*/
|
|
145
|
-
raw?: unknown;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Token usage for a single engine run; numeric fields align with {@link AXPAiEngineUsageTotals} in this module
|
|
149
|
-
* for stable client-side debugging contracts.
|
|
150
|
-
*/
|
|
151
|
-
interface AXPAiAssistTokenUsageSnapshot {
|
|
152
|
-
promptTokens: number;
|
|
153
|
-
completionTokens: number;
|
|
154
|
-
totalTokens: number;
|
|
155
|
-
cachedPromptTokens?: number;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* One engine execution within a structured-output session.
|
|
159
|
-
*/
|
|
160
|
-
interface AXPAiAssistStructuredOutputAttemptRecord {
|
|
161
|
-
/** 1-based index of this engine run. */
|
|
162
|
-
attemptIndex: number;
|
|
163
|
-
/** Usage reported for this run only. */
|
|
164
|
-
usage?: AXPAiAssistTokenUsageSnapshot;
|
|
165
|
-
/** Whether a last-provider payload was present for this run. */
|
|
166
|
-
hasLastProviderResult: boolean;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Explicit `raw` shape for {@link AXPAiAssistRunResult} when {@link AXPAiAssistRunInput.expectStructuredOutput} is true.
|
|
170
|
-
*/
|
|
171
|
-
interface AXPAiAssistStructuredOutputRunRaw {
|
|
172
|
-
kind: 'structured-output';
|
|
173
|
-
/** One entry per engine call (`runEngine` / structured-output retries). */
|
|
174
|
-
attempts: AXPAiAssistStructuredOutputAttemptRecord[];
|
|
175
|
-
/** Cumulative usage across all attempts. */
|
|
176
|
-
totalUsage?: AXPAiAssistTokenUsageSnapshot;
|
|
177
|
-
/** Count of engine runs in this session (same as the last `attemptIndex`). */
|
|
178
|
-
finalAttempt: number;
|
|
179
|
-
lastProviderResult?: unknown;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Typical max width of the prompt box column inside the bottom overlay (maps to `contentMaxWidthPx`).
|
|
183
|
-
*/
|
|
184
|
-
type AXPAiAssistPopupSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
185
|
-
/**
|
|
186
|
-
* Indeterminate loading dialog shown while the prompt box executes an assist run after Send (model work /
|
|
187
|
-
* structured-output retries).
|
|
188
|
-
*/
|
|
189
|
-
interface AXPAiAssistRunLoadingDialogSpec {
|
|
190
|
-
title: string;
|
|
191
|
-
text: string;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Options for the AI assist `show` prompt API: same run-related fields as {@link AXPAiAssistRunInput} except `prompt`,
|
|
195
|
-
* plus UI chrome. The user-entered prompt from the surface is merged on Send.
|
|
196
|
-
*/
|
|
197
|
-
interface AXPAiAssistShowOptions {
|
|
198
|
-
/**
|
|
199
|
-
* Prompt box header; must be translated by the caller. Entity list assist uses
|
|
200
|
-
* `@extensions-ai-entity:assist.dialog-title.{type-level|selected|individual}`.
|
|
201
|
-
*/
|
|
202
|
-
title: string;
|
|
203
|
-
placeholder?: string;
|
|
204
|
-
initialPrompt?: string;
|
|
205
|
-
size?: AXPAiAssistPopupSize;
|
|
206
|
-
context?: AXPAiAssistRunContext;
|
|
207
|
-
/**
|
|
208
|
-
* Optional catalog assist. When omitted (and {@link directAgentId} is not set), the tenant/platform default assist applies.
|
|
209
|
-
*/
|
|
210
|
-
assistId?: string;
|
|
211
|
-
directAgentId?: string;
|
|
212
|
-
maxSteps?: number;
|
|
213
|
-
temperature?: number;
|
|
214
|
-
maxTokens?: number;
|
|
215
|
-
expectStructuredOutput?: boolean;
|
|
216
|
-
structuredOutputInstruction?: string;
|
|
217
|
-
platformRuntimeNotes?: Record<string, unknown>;
|
|
218
|
-
maxStructuredRetries?: number;
|
|
219
|
-
structuredValidator?: AXPAiStructuredValidator;
|
|
220
|
-
retryOnInvalidStructure?: boolean;
|
|
221
|
-
structuredOutputSchemaSummary?: string;
|
|
222
|
-
structuredOutputMaxTokens?: number;
|
|
223
|
-
/**
|
|
224
|
-
* When set, shows an indeterminate loading dialog for the duration of each submitted run until `run` settles.
|
|
225
|
-
* Callers supply translated strings.
|
|
226
|
-
*/
|
|
227
|
-
runLoadingDialog?: AXPAiAssistRunLoadingDialogSpec;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
declare const RootConfig: {
|
|
231
|
-
config: {
|
|
232
|
-
i18n: string;
|
|
233
|
-
module: string;
|
|
234
|
-
route: string;
|
|
235
|
-
};
|
|
236
|
-
module: {
|
|
237
|
-
name: string;
|
|
238
|
-
route: string;
|
|
239
|
-
title: string;
|
|
240
|
-
icon: string;
|
|
241
|
-
};
|
|
242
|
-
entities: {
|
|
243
|
-
model: {
|
|
244
|
-
name: string;
|
|
245
|
-
fullName: string;
|
|
246
|
-
title: string;
|
|
247
|
-
titlePlural: string;
|
|
248
|
-
icon: string;
|
|
249
|
-
};
|
|
250
|
-
assist: {
|
|
251
|
-
name: string;
|
|
252
|
-
fullName: string;
|
|
253
|
-
title: string;
|
|
254
|
-
titlePlural: string;
|
|
255
|
-
icon: string;
|
|
256
|
-
};
|
|
257
|
-
agent: {
|
|
258
|
-
name: string;
|
|
259
|
-
fullName: string;
|
|
260
|
-
title: string;
|
|
261
|
-
titlePlural: string;
|
|
262
|
-
icon: string;
|
|
263
|
-
};
|
|
264
|
-
openAiEndpoint: {
|
|
265
|
-
name: string;
|
|
266
|
-
fullName: string;
|
|
267
|
-
title: string;
|
|
268
|
-
titlePlural: string;
|
|
269
|
-
icon: string;
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
declare class AXMAiManagementEntityProvider implements AXPEntityDefinitionLoader {
|
|
275
|
-
preload(): AXPEntityPreloadEntity[];
|
|
276
|
-
get(moduleName: string, entityName: string): Promise<AXPEntity | null>;
|
|
277
|
-
list(): Promise<{
|
|
278
|
-
name: string;
|
|
279
|
-
module: string;
|
|
280
|
-
}[]>;
|
|
281
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiManagementEntityProvider, never>;
|
|
282
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiManagementEntityProvider>;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* AI Management Module Manifest.
|
|
287
|
-
* Defines module metadata for AI provider and API key management.
|
|
288
|
-
*/
|
|
289
|
-
declare const AiManagementManifest: AXPModuleManifest;
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* AI Management menu keys.
|
|
293
|
-
* Pattern: AiManagement:Menu:{Path}
|
|
294
|
-
*/
|
|
295
|
-
declare const AXPAiManagementMenuKeys: {
|
|
296
|
-
/** OpenAI-compatible HTTP endpoints (base URL + API key). */
|
|
297
|
-
readonly OpenAiEndpoints: "AiManagement:Menu:OpenAiEndpoints";
|
|
298
|
-
/** List of AI models (from providers). */
|
|
299
|
-
readonly Models: "AiManagement:Menu:Models";
|
|
300
|
-
/** List of Assists. */
|
|
301
|
-
readonly Assists: "AiManagement:Menu:Assists";
|
|
302
|
-
/** Delegated specialist agents (supervisor routing). */
|
|
303
|
-
readonly Agents: "AiManagement:Menu:Agents";
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
declare class AXMAiManagementMenuProvider implements AXPMenuProvider {
|
|
307
|
-
private readonly entityService;
|
|
308
|
-
provide(context: AXPMenuProviderContext): Promise<void>;
|
|
309
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiManagementMenuProvider, never>;
|
|
310
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiManagementMenuProvider>;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/** Dynamic assist access permissions (`Assist.{name}.Use`). */
|
|
314
|
-
declare const AXMAiAssistPermissionKeys: {
|
|
315
|
-
readonly Use: "AiManagement:Permission:Assist.Use";
|
|
316
|
-
readonly useForAssist: (assistName: string) => string;
|
|
317
|
-
};
|
|
318
|
-
declare const AXMPermissionsKeys: {
|
|
319
|
-
readonly AiManagement: {
|
|
320
|
-
readonly Management: "AiManagement:Permission:Management";
|
|
321
|
-
readonly Assist: {
|
|
322
|
-
readonly Use: "AiManagement:Permission:Assist.Use";
|
|
323
|
-
readonly useForAssist: (assistName: string) => string;
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
/** One assist row mapped for permission definition children. */
|
|
329
|
-
interface AXMAiAssistPermissionRow {
|
|
16
|
+
/** Denormalized {@link AiRule} snapshot on assist/agent rows (multi-lookup expose). */
|
|
17
|
+
interface AXMAiManagementRuleRef {
|
|
18
|
+
id: string;
|
|
19
|
+
/** Unique programmatic key used by the engine (`includeRules` / `excludeRules`). */
|
|
330
20
|
name: string;
|
|
331
|
-
title:
|
|
332
|
-
description?: string;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Loads assist catalog rows for dynamic permission definitions.
|
|
336
|
-
* Skips rows without a stable programmatic `name`.
|
|
337
|
-
*/
|
|
338
|
-
declare function loadAssistPermissionRows(entityService: AXPEntityService, localeId: string): Promise<AXMAiAssistPermissionRow[]>;
|
|
339
|
-
|
|
340
|
-
declare class AXMPermissionDefinitionProvider implements AXPPermissionDefinitionProvider {
|
|
341
|
-
private readonly entityService;
|
|
342
|
-
private readonly localeId;
|
|
343
|
-
define(context: AXPPermissionDefinitionProviderContext): Promise<void>;
|
|
344
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMPermissionDefinitionProvider, never>;
|
|
345
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMPermissionDefinitionProvider>;
|
|
21
|
+
title: AXPMultiLanguageString;
|
|
346
22
|
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* AI Management setting keys.
|
|
350
|
-
* Pattern: AiManagement:Setting:{Path}
|
|
351
|
-
*/
|
|
352
|
-
declare const AXPAiManagementSettings: {
|
|
353
|
-
/** Assist primary key (`id`) used when no assist is explicitly selected (tenant-scoped). */
|
|
354
|
-
readonly DefaultAssistId: "AiManagement:Setting:DefaultAssistId";
|
|
355
|
-
/**
|
|
356
|
-
* System instructions prepended to every assist/agent chat system prompt in {@link AXPAiEngine}.
|
|
357
|
-
* Empty string means no global layer (default).
|
|
358
|
-
*/
|
|
359
|
-
readonly GlobalSystemPrompt: "AiManagement:Setting:GlobalSystemPrompt";
|
|
360
|
-
readonly Providers: {
|
|
361
|
-
readonly Gemini: {
|
|
362
|
-
readonly ApiKey: "AiManagement:Setting:Providers.Gemini.ApiKey";
|
|
363
|
-
};
|
|
364
|
-
readonly Demis: {
|
|
365
|
-
readonly BearerToken: "AiManagement:Setting:Providers.Demis.BearerToken";
|
|
366
|
-
};
|
|
367
|
-
};
|
|
368
|
-
};
|
|
369
|
-
|
|
370
23
|
/**
|
|
371
|
-
*
|
|
372
|
-
* Registry name: {@link AI_MODEL_CATALOG_DATASOURCE_NAME}.
|
|
373
|
-
*/
|
|
374
|
-
declare const AI_MODEL_CATALOG_DATASOURCE_NAME = "ai-management-model-catalog";
|
|
375
|
-
/**
|
|
376
|
-
* Image-generation models only (`modelPurposes` includes `image`).
|
|
377
|
-
* Registry name: {@link AI_MODEL_IMAGE_CATALOG_DATASOURCE_NAME}.
|
|
24
|
+
* Persisted AiRule catalog row — reusable system-prompt fragments referenced by name.
|
|
378
25
|
*/
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
* Text-to-speech models only (`modelPurposes` includes `tts`).
|
|
387
|
-
* Registry name: {@link AI_MODEL_TTS_CATALOG_DATASOURCE_NAME}.
|
|
388
|
-
*/
|
|
389
|
-
declare const AI_MODEL_TTS_CATALOG_DATASOURCE_NAME = "ai-management-model-catalog-tts";
|
|
390
|
-
type AXMAiModelPurposeSlug = 'chat' | 'vision' | 'image' | 'speech' | 'tts';
|
|
391
|
-
/** Normalizes `modelPurposes` (and legacy `modelPurpose`) to unique non-empty slugs. */
|
|
392
|
-
declare function normalizeModelPurposes(row: Record<string, unknown> | null | undefined): string[];
|
|
393
|
-
declare function modelRowHasPurpose(row: Record<string, unknown> | null | undefined, purpose: AXMAiModelPurposeSlug): boolean;
|
|
394
|
-
/** Rows usable in chat / completion pickers: include `chat` or `vision`; not image/speech/tts-only. */
|
|
395
|
-
declare function isChatPurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
396
|
-
declare function isImagePurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
397
|
-
declare function isSpeechPurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
398
|
-
declare function isTtsPurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
399
|
-
declare class AXMAiModelCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
400
|
-
private readonly entityService;
|
|
401
|
-
items(): Promise<AXPDataSourceDefinition[]>;
|
|
402
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiModelCatalogDataSourceDefinition, never>;
|
|
403
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiModelCatalogDataSourceDefinition>;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/** Registry name for AiAgent catalog rows (delegated specialist definitions). */
|
|
407
|
-
declare const AI_AGENT_CATALOG_DATASOURCE_NAME = "ai-management-agent-catalog";
|
|
408
|
-
declare class AXMAiAgentCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
409
|
-
private readonly entityService;
|
|
410
|
-
items(): Promise<AXPDataSourceDefinition[]>;
|
|
411
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiAgentCatalogDataSourceDefinition, never>;
|
|
412
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiAgentCatalogDataSourceDefinition>;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
/** AI-capable command definitions for specialist registry scope (matches AiAgent entity lookup filter). */
|
|
416
|
-
declare const AI_COMMAND_REGISTRY_CATALOG_DATASOURCE_NAME = "ai-management-command-registry-catalog";
|
|
417
|
-
/** AI-capable query definitions for specialist registry scope. */
|
|
418
|
-
declare const AI_QUERY_REGISTRY_CATALOG_DATASOURCE_NAME = "ai-management-query-registry-catalog";
|
|
419
|
-
declare class AXMAiCommandRegistryCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
420
|
-
private readonly entityService;
|
|
421
|
-
items(): Promise<AXPDataSourceDefinition[]>;
|
|
422
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiCommandRegistryCatalogDataSourceDefinition, never>;
|
|
423
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiCommandRegistryCatalogDataSourceDefinition>;
|
|
424
|
-
}
|
|
425
|
-
declare class AXMAiQueryRegistryCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
426
|
-
private readonly entityService;
|
|
427
|
-
items(): Promise<AXPDataSourceDefinition[]>;
|
|
428
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiQueryRegistryCatalogDataSourceDefinition, never>;
|
|
429
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiQueryRegistryCatalogDataSourceDefinition>;
|
|
26
|
+
interface AXMAiManagementRuleEntityModel extends AXPEntityModel<string> {
|
|
27
|
+
/** Programmatic key (e.g. `markdown`); referenced from assist/agent `rules` and engine run options. */
|
|
28
|
+
name: string;
|
|
29
|
+
title: AXPMultiLanguageString;
|
|
30
|
+
description?: AXPMultiLanguageString;
|
|
31
|
+
/** Rule body merged into the engine system prompt when the rule is included. */
|
|
32
|
+
markdown: string;
|
|
430
33
|
}
|
|
431
34
|
|
|
432
|
-
/**
|
|
433
|
-
* Human-readable specialist prompt from delegated-agent tool arguments (conversation / mini-chat UI).
|
|
434
|
-
*/
|
|
435
|
-
declare function axpAiDelegatedAgentPromptPreview(argumentsValue: unknown): string;
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Recursively parses string values that look like JSON objects or arrays, then
|
|
439
|
-
* normalizes nested values the same way.
|
|
440
|
-
*
|
|
441
|
-
* LLM tool calls often stringify nested payloads (e.g. `__context__` for
|
|
442
|
-
* `Entity:Create`). Use this before passing args to the command or query service
|
|
443
|
-
* from AI paths only — not inside generic command infrastructure.
|
|
444
|
-
*
|
|
445
|
-
* @param toolName When set, command-specific AI defaults from command definitions are merged (e.g. `Entity:Create` redirect).
|
|
446
|
-
*/
|
|
447
|
-
declare function normalizeAiToolCommandArgs(value: unknown, toolName?: string): unknown;
|
|
448
|
-
|
|
449
35
|
/**
|
|
450
36
|
* Persisted AiAgent catalog row (entity storage shape).
|
|
451
37
|
*/
|
|
@@ -454,12 +40,44 @@ interface AXMAiManagementAgentEntityModel extends AXPEntityModel<string> {
|
|
|
454
40
|
title: AXPMultiLanguageString;
|
|
455
41
|
description?: AXPMultiLanguageString;
|
|
456
42
|
systemPrompt?: string;
|
|
43
|
+
/** Selected {@link AiRule} catalog ids (multi-lookup value field). */
|
|
44
|
+
ruleIds?: string[] | null;
|
|
45
|
+
/** Denormalized rule rows from multi-lookup expose (`title` = display, `name` = engine key). */
|
|
46
|
+
rules?: AXMAiManagementRuleRef[] | null;
|
|
47
|
+
/** Transcript segment preset id (`text` | `node` | `followUp`); resolved via segment providers at runtime. */
|
|
48
|
+
outputContract?: AXPOutputTranscriptSegmentId | string | null;
|
|
457
49
|
modelEntityId?: string | null;
|
|
458
|
-
|
|
50
|
+
commandIds?: unknown;
|
|
459
51
|
queryIds?: unknown;
|
|
460
52
|
maxSteps?: number;
|
|
461
53
|
}
|
|
462
54
|
|
|
55
|
+
/** @see {@link AXPAgentOutputKind} */
|
|
56
|
+
type AXPAiAgentOutputKind = AXPAgentOutputKind;
|
|
57
|
+
/** @see {@link AXPOutputTranscriptSegmentId} */
|
|
58
|
+
type AXPAiOutputTranscriptSegment = AXPOutputTranscriptSegmentId;
|
|
59
|
+
/** @see {@link AXPAgentOutputContract} */
|
|
60
|
+
type AXPAiAgentOutputContract = AXPAgentOutputContract;
|
|
61
|
+
/** @see {@link AXPJsonSchemaLike} */
|
|
62
|
+
type AXPAiJsonSchemaLike$1 = AXPJsonSchemaLike;
|
|
63
|
+
/** @see {@link AXPAgentResponseFormat} */
|
|
64
|
+
type AXPAiResponseFormat$1 = AXPAgentResponseFormat;
|
|
65
|
+
/** @see {@link AXP_AGENT_OUTPUT_CONTRACT_DEFAULT_STRUCTURED_RETRIES} */
|
|
66
|
+
declare const AXPAI_AGENT_OUTPUT_CONTRACT_DEFAULT_STRUCTURED_RETRIES = 2;
|
|
67
|
+
/** Resolved transcript mapping for an object contract (defaults to `text`). */
|
|
68
|
+
declare function resolveOutputTranscriptSegment(contract: AXPAiAgentOutputContract): AXPAiOutputTranscriptSegment;
|
|
69
|
+
/**
|
|
70
|
+
* Normalizes persisted `outputContract` (object or JSON string from entity forms).
|
|
71
|
+
* Returns `null` when absent or invalid (engine treats as implicit `string`).
|
|
72
|
+
*/
|
|
73
|
+
declare function parseAgentOutputContract(raw: unknown): AXPAiAgentOutputContract | null;
|
|
74
|
+
/** Resolved contract for engine (never null; defaults to string). */
|
|
75
|
+
declare function resolveAgentOutputContract(raw: unknown): AXPAiAgentOutputContract;
|
|
76
|
+
declare function axpAiAgentOutputContractUsesStructuredFinalize(contract: AXPAiAgentOutputContract): boolean;
|
|
77
|
+
/** Structured kinds omit the string role baseline (Markdown prose hint) in the mock engine. */
|
|
78
|
+
declare function axpAiAgentOutputContractOmitsRoleBaseline(contract: AXPAiAgentOutputContract): boolean;
|
|
79
|
+
declare function axpAiAgentOutputContractStructuredRetryCap(contract: AXPAiAgentOutputContract): number;
|
|
80
|
+
|
|
463
81
|
/** Aligns with {@link AXPAiPlanningMode} in ai-engine.types (avoid circular imports). */
|
|
464
82
|
type AXMAiManagementAssistPlanningMode = 'off' | 'once' | 'when-needed';
|
|
465
83
|
/**
|
|
@@ -484,6 +102,12 @@ interface AXMAiManagementAssistEntityModel extends AXPEntityModel<string> {
|
|
|
484
102
|
text: AXPMultiLanguageString;
|
|
485
103
|
}[] | null;
|
|
486
104
|
systemPrompt?: string;
|
|
105
|
+
/** Default output contract for runs using this assist (overridden by agent or run input). */
|
|
106
|
+
outputContract?: AXPAiAgentOutputContract;
|
|
107
|
+
/** Selected {@link AiRule} catalog ids (multi-lookup value field). */
|
|
108
|
+
ruleIds?: string[] | null;
|
|
109
|
+
/** Denormalized rule rows from multi-lookup expose (`title` = display, `name` = engine key). */
|
|
110
|
+
rules?: AXMAiManagementRuleRef[] | null;
|
|
487
111
|
/** Knowledge-base attachments (PDF and image formats) for this assist. */
|
|
488
112
|
knowledgeFiles?: AXPFileListItem[] | null;
|
|
489
113
|
delegatedAgents?: {
|
|
@@ -494,23 +118,10 @@ interface AXMAiManagementAssistEntityModel extends AXPEntityModel<string> {
|
|
|
494
118
|
}[] | null;
|
|
495
119
|
}
|
|
496
120
|
|
|
497
|
-
/** Prefix for supervisor-delegated specialist tools (`${AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX}${agentId}`). */
|
|
498
|
-
declare const AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX: "agent:";
|
|
499
|
-
/** Catalog `name` of the conversation follow-up delegated agent (engine auto-invoke). */
|
|
500
|
-
declare const AXPAI_CONVERSATION_FOLLOW_UP_AGENT_NAME: "follow-up-prompt-generator";
|
|
501
|
-
/** Default cap for main assist / direct-agent chat tool rounds (one provider call per step). */
|
|
502
|
-
declare const AXPAI_ENGINE_DEFAULT_MAX_STEPS = 16;
|
|
503
|
-
/** Default cap for delegated specialist sub-runs when the agent row has no positive `maxSteps`. */
|
|
504
|
-
declare const AXPAI_DELEGATED_AGENT_DEFAULT_MAX_STEPS = 8;
|
|
505
|
-
/** System prompt for vision OCR / document text extraction. */
|
|
506
|
-
declare const AXPAI_DOCUMENT_VISION_EXTRACTION_SYSTEM = "You are a precise document-reading assistant. Extract readable plain text from the attached file. Preserve headings and lists where obvious. If the content is unreadable, return a short explanation. Output plain text only, no markdown code fences.";
|
|
507
|
-
/** Default user line when the caller passes an empty instruction for vision extraction. */
|
|
508
|
-
declare const AXPAI_DOCUMENT_VISION_DEFAULT_USER_INSTRUCTION = "Extract all readable text from this document. Return plain text only.";
|
|
509
121
|
type AXPAiChatTransport = 'openai' | 'gemini' | 'demis';
|
|
510
|
-
type AXPAiPlanningMode = 'off' | 'once' | 'when-needed';
|
|
511
122
|
/**
|
|
512
123
|
* Snapshot of session / tenant / regional defaults injected into system prompts.
|
|
513
|
-
* Built by {@link AXPAiPlatformRuntimeContextBuilder}.
|
|
124
|
+
* Built by {@link AXPAiPlatformRuntimeContextBuilder} before calling {@link AXPAiEngine}.
|
|
514
125
|
*/
|
|
515
126
|
interface AXPAiPlatformRuntimeContext {
|
|
516
127
|
userId?: string;
|
|
@@ -527,45 +138,21 @@ interface AXPAiPlatformRuntimeContext {
|
|
|
527
138
|
currentLocalDateTime?: string;
|
|
528
139
|
notes?: string;
|
|
529
140
|
}
|
|
530
|
-
/** Who supplies a delegated `agent:<id>` tool argument at runtime. */
|
|
531
|
-
type AXPAiDelegatedParameterBinding = 'assist_locked' | 'assist_default' | 'supervisor';
|
|
532
|
-
/**
|
|
533
|
-
* Per-field policy for arguments the supervisor passes when calling a delegated specialist.
|
|
534
|
-
* Names are the tool argument keys; the runtime builds supervisor JSON Schema from this list.
|
|
535
|
-
*/
|
|
536
|
-
interface AXPAiDelegatedParameterDefinition {
|
|
537
|
-
name: string;
|
|
538
|
-
title?: string;
|
|
539
|
-
description?: string;
|
|
540
|
-
binding: AXPAiDelegatedParameterBinding;
|
|
541
|
-
/** Used when assist row has no value for an `assist_default` key (optional fallback). */
|
|
542
|
-
defaultValue?: unknown;
|
|
543
|
-
/**
|
|
544
|
-
* Optional UI grouping for property viewer / assist parameter editor (collapsible groups in one tab).
|
|
545
|
-
*/
|
|
546
|
-
group?: {
|
|
547
|
-
name: string;
|
|
548
|
-
title: string;
|
|
549
|
-
order?: number;
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
141
|
/**
|
|
553
142
|
* Effective Assist entity row (chat policy, prompts, delegated routing).
|
|
554
|
-
* Fields are partial except `id` because
|
|
143
|
+
* Fields are partial except `id` because API payloads may omit unused slices.
|
|
555
144
|
*/
|
|
556
145
|
type AXPAiEffectiveAssistRow = Partial<Omit<AXMAiManagementAssistEntityModel, 'id'>> & {
|
|
557
146
|
id: string;
|
|
558
|
-
/** Optional catalog row not persisted on the assist entity; used by mock seeds. */
|
|
559
147
|
imageModelId?: string;
|
|
560
148
|
};
|
|
561
149
|
/**
|
|
562
|
-
* Effective AiAgent catalog row
|
|
563
|
-
*
|
|
150
|
+
* Effective AiAgent catalog row for UI and engine requests.
|
|
151
|
+
* Engine-specific fields are normalized in connectivity (mock / API).
|
|
564
152
|
*/
|
|
565
153
|
type AXPAiEffectiveAgentRow = Partial<Omit<AXMAiManagementAgentEntityModel, 'id'>> & {
|
|
566
154
|
id: string;
|
|
567
|
-
|
|
568
|
-
parameterDefinitions?: AXPAiDelegatedParameterDefinition[] | null;
|
|
155
|
+
outputContract?: AXPAiAgentOutputContract | null;
|
|
569
156
|
};
|
|
570
157
|
interface AXPAiChatModelListRequest {
|
|
571
158
|
assistId?: string | null;
|
|
@@ -575,7 +162,7 @@ interface AXPAiChatModelListItem {
|
|
|
575
162
|
id: string;
|
|
576
163
|
name: string;
|
|
577
164
|
title: string;
|
|
578
|
-
/**
|
|
165
|
+
/** `modelPurposes` from the catalog row (provided by the API). */
|
|
579
166
|
modelPurposes?: string[];
|
|
580
167
|
chatTransport?: string;
|
|
581
168
|
maxContextTokens?: number;
|
|
@@ -587,14 +174,13 @@ interface AXPAiChatTextResponse {
|
|
|
587
174
|
type: 'text';
|
|
588
175
|
content: string;
|
|
589
176
|
}
|
|
590
|
-
/** Model reasoning / planning segment; paired with {@link AXPAiChatTextResponse} in assistant messages.
|
|
177
|
+
/** Model reasoning / planning segment; paired with {@link AXPAiChatTextResponse} in assistant messages. */
|
|
591
178
|
interface AXPAiChatThinkResponse {
|
|
592
179
|
type: 'think';
|
|
593
180
|
content: string;
|
|
594
181
|
}
|
|
595
182
|
/**
|
|
596
183
|
* Stored binary in tenant file storage (user attachment or assistant/tool output replay).
|
|
597
|
-
* Interpretation is by {@link AXPAiChatFileResponse.content.mimeType} (e.g. image/*, audio/*, application/pdf).
|
|
598
184
|
*/
|
|
599
185
|
interface AXPAiChatFileResponse {
|
|
600
186
|
type: 'file';
|
|
@@ -620,7 +206,6 @@ interface AXPAiChatFollowUpResponse {
|
|
|
620
206
|
type: 'followUp';
|
|
621
207
|
content: AXPAiChatFollowUpItem[];
|
|
622
208
|
}
|
|
623
|
-
/** Assistant-side tool / agent invocation segment (replay + OpenAI `tool_calls`). */
|
|
624
209
|
interface AXPAiChatToolInvocationContent {
|
|
625
210
|
command: string;
|
|
626
211
|
arguments: unknown;
|
|
@@ -640,20 +225,15 @@ interface AXPAiChatToolResultResponse {
|
|
|
640
225
|
callId: string;
|
|
641
226
|
content: unknown;
|
|
642
227
|
}
|
|
643
|
-
/**
|
|
644
|
-
* Segments a delegated specialist returns to the supervisor (replayable in UI; no tool-call shapes).
|
|
645
|
-
*/
|
|
228
|
+
/** Segments a delegated specialist returns to the supervisor (replayable in UI). */
|
|
646
229
|
type AXPAiDelegatedAgentResultSegment = AXPAiChatTextResponse | AXPAiChatThinkResponse | AXPAiChatFileResponse | AXPAiChatNodeResponse | AXPAiChatFollowUpResponse;
|
|
647
|
-
/**
|
|
648
|
-
* Tool-role {@code agent_result} JSON body: either an error or ordered {@code data.responses} from the specialist run.
|
|
649
|
-
*/
|
|
230
|
+
/** Tool-role `agent_result` body from the engine (normalized by connectivity). */
|
|
650
231
|
interface AXPAiDelegatedAgentResultPayload {
|
|
651
232
|
success: boolean;
|
|
652
233
|
error?: string;
|
|
653
234
|
data?: {
|
|
654
235
|
agentName?: string;
|
|
655
236
|
agentId?: string;
|
|
656
|
-
/** Ordered specialist output (e.g. text only, file only, node only, or mixed). */
|
|
657
237
|
responses: AXPAiDelegatedAgentResultSegment[];
|
|
658
238
|
};
|
|
659
239
|
}
|
|
@@ -666,14 +246,12 @@ interface AXPAiChatAgentResultResponse {
|
|
|
666
246
|
type AXPAiChatResponse = AXPAiChatTextResponse | AXPAiChatThinkResponse | AXPAiChatFileResponse | AXPAiChatNodeResponse | AXPAiChatFollowUpResponse | AXPAiChatToolAssistantResponse | AXPAiChatAgentAssistantResponse | AXPAiChatToolResultResponse | AXPAiChatAgentResultResponse;
|
|
667
247
|
/**
|
|
668
248
|
* One chat line in the persisted transcript (`user` / `assistant` / `system` / `tool`).
|
|
669
|
-
* Optional {@link AXPAiChatMessage.delegatedReflection} marks ephemeral delegated sub-run reflections.
|
|
670
249
|
*/
|
|
671
250
|
interface AXPAiChatMessage {
|
|
672
251
|
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
673
252
|
responses: AXPAiChatResponse[];
|
|
674
|
-
/** OpenAI `name` on tool results / some provider echoes. */
|
|
675
253
|
name?: string;
|
|
676
|
-
/**
|
|
254
|
+
/** Ephemeral delegated sub-run reflection (excluded from user-facing replay). */
|
|
677
255
|
delegatedReflection?: boolean;
|
|
678
256
|
}
|
|
679
257
|
interface AXPAiToolCall {
|
|
@@ -681,22 +259,6 @@ interface AXPAiToolCall {
|
|
|
681
259
|
name: string;
|
|
682
260
|
arguments: unknown;
|
|
683
261
|
}
|
|
684
|
-
interface AXPAiToolSchema {
|
|
685
|
-
name: string;
|
|
686
|
-
description?: string;
|
|
687
|
-
parameters: Record<string, unknown>;
|
|
688
|
-
}
|
|
689
|
-
/** Registry allow-list on an assist or agent (command ids / query ids). */
|
|
690
|
-
interface AXPAiEngineRegistryToolFields {
|
|
691
|
-
/** Same persistence shapes as {@link AXPAiEffectiveAgentRow.toolIds}. */
|
|
692
|
-
toolIds?: unknown;
|
|
693
|
-
/** Same persistence shapes as {@link AXPAiEffectiveAgentRow.queryIds}. */
|
|
694
|
-
queryIds?: unknown;
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Normalized payload from the last underlying LLM/vendor call during an engine run.
|
|
698
|
-
* Detailed chat/extract/image request types live in connectivity mock (`ai-chat-provider.types`).
|
|
699
|
-
*/
|
|
700
262
|
interface AXPAiEngineLastProviderPayload {
|
|
701
263
|
messages: AXPAiChatMessage[];
|
|
702
264
|
toolCalls?: AXPAiToolCall[];
|
|
@@ -708,7 +270,6 @@ interface AXPAiEngineUsageTotals {
|
|
|
708
270
|
totalTokens: number;
|
|
709
271
|
cachedPromptTokens?: number;
|
|
710
272
|
}
|
|
711
|
-
/** Cached specialist transcript for a supervisor `agent:*` tool_call id (mock LRU / future server mirror). */
|
|
712
273
|
interface AXPAiDelegatedAgentTranscriptEntry {
|
|
713
274
|
agentName?: string;
|
|
714
275
|
messages: AXPAiChatMessage[];
|
|
@@ -722,11 +283,7 @@ type AXPAiEngineRunEvent = {
|
|
|
722
283
|
type: 'assistant_stream_reset';
|
|
723
284
|
} | {
|
|
724
285
|
type: 'assistant_stream_delta';
|
|
725
|
-
delta: string;
|
|
726
|
-
/**
|
|
727
|
-
* `think` = planning-only stream (no tags required). Omitted or `text` = main assistant stream.
|
|
728
|
-
* Raw `delta` strings are the same as from the provider; this field is the engine’s semantic.
|
|
729
|
-
*/
|
|
286
|
+
delta: string;
|
|
730
287
|
segment?: 'text' | 'think';
|
|
731
288
|
} | {
|
|
732
289
|
type: 'tool_call_start';
|
|
@@ -758,19 +315,18 @@ type AXPAiEngineRunEvent = {
|
|
|
758
315
|
interface AXPAiEngineRunOptions {
|
|
759
316
|
messages: AXPAiChatMessage[];
|
|
760
317
|
assistId?: string;
|
|
761
|
-
/** Demisco multipart `session_uuid` when using Demis transport (optional). */
|
|
762
318
|
demisSessionUuid?: string;
|
|
763
|
-
/** Direct AiAgent thread (registry tools only); uses tenant default assist for model policy when assist id omitted. */
|
|
764
319
|
directAgentId?: string;
|
|
765
320
|
modelEntityId?: string;
|
|
766
|
-
/** Legacy catalog `name` (API id) before entity ids were used. */
|
|
767
321
|
modelId?: string;
|
|
768
322
|
maxSteps?: number;
|
|
769
323
|
maxTokens?: number;
|
|
770
324
|
temperature?: number;
|
|
771
|
-
|
|
772
|
-
|
|
325
|
+
planningMode?: 'off' | 'once' | 'when-needed';
|
|
326
|
+
includeRules?: string[];
|
|
327
|
+
excludeRules?: string[];
|
|
773
328
|
platformRuntimeContext?: AXPAiPlatformRuntimeContext | null;
|
|
329
|
+
outputContract?: AXPAiAgentOutputContract;
|
|
774
330
|
onRunEvent?: (event: AXPAiEngineRunEvent) => void;
|
|
775
331
|
}
|
|
776
332
|
interface AXPAiEngineRunResult {
|
|
@@ -779,96 +335,515 @@ interface AXPAiEngineRunResult {
|
|
|
779
335
|
usageTotals?: AXPAiEngineUsageTotals;
|
|
780
336
|
delegatedTranscriptsByCallId?: Record<string, AXPAiDelegatedAgentTranscriptEntry>;
|
|
781
337
|
}
|
|
782
|
-
|
|
338
|
+
|
|
339
|
+
interface AXPAiAssistValidationError {
|
|
340
|
+
phase: 'parse' | 'validator';
|
|
341
|
+
message: string;
|
|
342
|
+
details?: unknown;
|
|
343
|
+
}
|
|
344
|
+
interface AXPAiAssistCannotComplete {
|
|
345
|
+
reason: 'missingInput' | 'unsafe' | 'unsupported';
|
|
346
|
+
missing?: string[];
|
|
347
|
+
message?: string;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Normalized result of an assist run or structured-output pipeline session.
|
|
351
|
+
*/
|
|
352
|
+
interface AXPAiAssistExecutionResult<TData = unknown> {
|
|
353
|
+
success: boolean;
|
|
354
|
+
outputKind: AXPAiAgentOutputKind;
|
|
355
|
+
text: string;
|
|
356
|
+
data?: TData;
|
|
357
|
+
followUp?: {
|
|
358
|
+
items: AXPAiChatFollowUpItem[];
|
|
359
|
+
};
|
|
360
|
+
followUpRequired?: boolean;
|
|
361
|
+
followUpQuestion?: string;
|
|
362
|
+
validationErrors?: AXPAiAssistValidationError[];
|
|
363
|
+
cannotComplete?: AXPAiAssistCannotComplete;
|
|
364
|
+
raw?: unknown;
|
|
365
|
+
messages?: AXPAiChatMessage[];
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** Default max completion tokens when the AiModel row has no `maxOutputTokens` and the caller omits `maxTokens`. */
|
|
369
|
+
declare const AXPAiAssistDefaultStructuredMaxTokens = 128000;
|
|
370
|
+
/** Default maximum follow-up turns after the first model response when validating structured JSON (implementation may use this). */
|
|
371
|
+
declare const AXPAiAssistDefaultMaxStructuredRetries = 3;
|
|
372
|
+
/**
|
|
373
|
+
* Validates parsed JSON from the assistant. Return the validated value (possibly narrowed), or throw with a message
|
|
374
|
+
* the pipeline can send back to the model on retry.
|
|
375
|
+
*/
|
|
376
|
+
type AXPAiStructuredValidator<T = unknown> = (parsed: unknown) => T | Promise<T>;
|
|
377
|
+
/**
|
|
378
|
+
* Thrown when {@link AXPAiAssistRunInput.expectStructuredOutput} is true but the assistant output could not be
|
|
379
|
+
* parsed and optionally validated after all attempts.
|
|
380
|
+
*/
|
|
381
|
+
declare class AXPAiStructuredOutputError extends Error {
|
|
382
|
+
/** 1-based count of engine runs performed for this structured-output session. */
|
|
383
|
+
readonly attempts: number;
|
|
384
|
+
/** Truncated snapshot of the last assistant plain text (for debugging). */
|
|
385
|
+
readonly lastAssistantText: string;
|
|
386
|
+
/** Human-readable validation or parse failure detail. */
|
|
387
|
+
readonly validationMessage: string;
|
|
388
|
+
/** Why the pipeline stopped. */
|
|
389
|
+
readonly code?: 'duplicate_assistant_output' | 'validation_exhausted';
|
|
390
|
+
constructor(options: {
|
|
391
|
+
message: string;
|
|
392
|
+
attempts: number;
|
|
393
|
+
lastAssistantText: string;
|
|
394
|
+
validationMessage: string;
|
|
395
|
+
cause?: unknown;
|
|
396
|
+
code?: 'duplicate_assistant_output' | 'validation_exhausted';
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
/** One persisted user attachment (same storage contract as the AI chat composer). */
|
|
400
|
+
interface AXPAiAssistUserMediaAttachment {
|
|
401
|
+
/** `image` / `audio` / `file` (PDF, text, spreadsheets, and other document MIME types). */
|
|
402
|
+
kind: 'image' | 'audio' | 'file';
|
|
403
|
+
fileId: string;
|
|
404
|
+
mimeType: string;
|
|
405
|
+
name?: string;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Payload when submitting the assist prompt box (text, optional target assist/agent, optional media).
|
|
409
|
+
*/
|
|
410
|
+
interface AXPAiAssistPromptSubmitPayload {
|
|
411
|
+
prompt: string;
|
|
783
412
|
assistId?: string;
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
413
|
+
directAgentId?: string;
|
|
414
|
+
userMediaAttachments: AXPAiAssistUserMediaAttachment[];
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Optional structured hints for a single assist run (serialized into the user message by the implementation).
|
|
418
|
+
*/
|
|
419
|
+
interface AXPAiAssistRunContext {
|
|
420
|
+
/** Short bullet hints appended to the prompt for the model. */
|
|
421
|
+
hints?: string[];
|
|
422
|
+
/** Extra system-level instruction for this run (implementation may emit a system message). */
|
|
423
|
+
systemInstruction?: string;
|
|
424
|
+
/** Arbitrary structured payload (JSON-serialized in the user message when present). */
|
|
425
|
+
structuredContext?: unknown;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Input for the AI assist `run` API (implemented in ai-management).
|
|
429
|
+
*/
|
|
430
|
+
interface AXPAiAssistRunInput {
|
|
431
|
+
prompt: string;
|
|
432
|
+
/**
|
|
433
|
+
* Optional images, audio, or documents (`fileId` from tenant storage). When non-empty, the implementation builds one multimodal
|
|
434
|
+
* user message (same shape as the AI chat composer) plus the serialized prompt body as text segments.
|
|
435
|
+
*/
|
|
436
|
+
userMediaAttachments?: AXPAiAssistUserMediaAttachment[];
|
|
437
|
+
context?: AXPAiAssistRunContext;
|
|
438
|
+
/**
|
|
439
|
+
* Catalog assist id. When omitted together with {@link directAgentId}, the platform default assist is used.
|
|
440
|
+
*/
|
|
441
|
+
assistId?: string;
|
|
442
|
+
directAgentId?: string;
|
|
443
|
+
maxSteps?: number;
|
|
444
|
+
temperature?: number;
|
|
445
|
+
/**
|
|
446
|
+
* Max completion tokens for this engine run (when the provider supports it). Structured JSON runs apply a higher
|
|
447
|
+
* default unless {@link structuredOutputMaxTokens} is set.
|
|
448
|
+
*/
|
|
787
449
|
maxTokens?: number;
|
|
450
|
+
/**
|
|
451
|
+
* Declarative output contract for this run (preferred over legacy {@link expectStructuredOutput} flags).
|
|
452
|
+
* Resolved with agent/assist defaults via {@link resolveEffectiveOutputContract}.
|
|
453
|
+
*/
|
|
454
|
+
outputContract?: AXPAiAgentOutputContract;
|
|
455
|
+
/** When true, implementation tries to parse assistant text as JSON into {@link AXPAiAssistRunResult.structured}. */
|
|
456
|
+
expectStructuredOutput?: boolean;
|
|
457
|
+
/** Extra instruction appended so the model returns JSON (used when {@link expectStructuredOutput} is true). */
|
|
458
|
+
structuredOutputInstruction?: string;
|
|
459
|
+
/**
|
|
460
|
+
* Shallow merge over built-in platform runtime context fields (see ai-management implementation).
|
|
461
|
+
*/
|
|
462
|
+
platformRuntimeNotes?: Record<string, unknown>;
|
|
463
|
+
/**
|
|
464
|
+
* Max extra engine turns after the first response when structured output is invalid (default {@link AXPAiAssistDefaultMaxStructuredRetries}).
|
|
465
|
+
* Total attempts = 1 + maxStructuredRetries.
|
|
466
|
+
*/
|
|
467
|
+
maxStructuredRetries?: number;
|
|
468
|
+
/** Optional schema or domain validation after JSON parse. */
|
|
469
|
+
structuredValidator?: AXPAiStructuredValidator;
|
|
470
|
+
/**
|
|
471
|
+
* When false, only one engine run is performed; invalid structured output throws {@link AXPAiStructuredOutputError}.
|
|
472
|
+
* When true (default for {@link expectStructuredOutput}), invalid output triggers follow-up user messages in the same transcript.
|
|
473
|
+
*/
|
|
474
|
+
retryOnInvalidStructure?: boolean;
|
|
475
|
+
/**
|
|
476
|
+
* Optional description of the expected JSON shape (TypeScript-style or JSON schema summary), appended to the first
|
|
477
|
+
* user message and to retry prompts so the model stays aligned and retries are more accurate.
|
|
478
|
+
*/
|
|
479
|
+
structuredOutputSchemaSummary?: string;
|
|
480
|
+
/**
|
|
481
|
+
* Overrides {@link maxTokens} for {@link expectStructuredOutput} runs only. Prefer setting this or leaving defaults so
|
|
482
|
+
* the implementation can apply {@link AXPAiAssistDefaultStructuredMaxTokens} and avoid truncated JSON.
|
|
483
|
+
*/
|
|
484
|
+
structuredOutputMaxTokens?: number;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Result of the AI assist `run` API.
|
|
488
|
+
*/
|
|
489
|
+
interface AXPAiAssistRunResult {
|
|
490
|
+
/** When false, structured validation exhausted or cannotComplete (future). */
|
|
491
|
+
success?: boolean;
|
|
492
|
+
/** Effective output contract kind for this run. */
|
|
493
|
+
outputKind?: AXPAiAgentOutputKind;
|
|
494
|
+
/** Primary assistant reply text (extracted from the engine transcript). */
|
|
495
|
+
text: string;
|
|
496
|
+
/**
|
|
497
|
+
* Present when {@link AXPAiAssistRunInput.expectStructuredOutput} is true: validated structured payload
|
|
498
|
+
* (parse + optional {@link AXPAiAssistRunInput.structuredValidator}). On failure the implementation throws
|
|
499
|
+
* {@link AXPAiStructuredOutputError} instead of returning.
|
|
500
|
+
*/
|
|
501
|
+
structured?: unknown;
|
|
502
|
+
/** Same as {@link structured} when using the execution-result envelope. */
|
|
503
|
+
data?: unknown;
|
|
504
|
+
/** Validation failures when returned without throwing (reserved). */
|
|
505
|
+
validationErrors?: AXPAiAssistValidationError[];
|
|
506
|
+
/** Full normalized transcript when available. */
|
|
507
|
+
messages?: AXPAiChatMessage[];
|
|
508
|
+
/**
|
|
509
|
+
* When {@link AXPAiAssistRunInput.expectStructuredOutput} is false: engine usage / provider payload for that single run.
|
|
510
|
+
* When true: {@link AXPAiAssistStructuredOutputRunRaw} with per-attempt usage and totals for debugging.
|
|
511
|
+
*/
|
|
512
|
+
raw?: unknown;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Token usage for a single engine run; numeric fields align with {@link AXPAiEngineUsageTotals} in this module
|
|
516
|
+
* for stable client-side debugging contracts.
|
|
517
|
+
*/
|
|
518
|
+
interface AXPAiAssistTokenUsageSnapshot {
|
|
519
|
+
promptTokens: number;
|
|
520
|
+
completionTokens: number;
|
|
521
|
+
totalTokens: number;
|
|
522
|
+
cachedPromptTokens?: number;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* One engine execution within a structured-output session.
|
|
526
|
+
*/
|
|
527
|
+
interface AXPAiAssistStructuredOutputAttemptRecord {
|
|
528
|
+
/** 1-based index of this engine run. */
|
|
529
|
+
attemptIndex: number;
|
|
530
|
+
/** Usage reported for this run only. */
|
|
531
|
+
usage?: AXPAiAssistTokenUsageSnapshot;
|
|
532
|
+
/** Whether a last-provider payload was present for this run. */
|
|
533
|
+
hasLastProviderResult: boolean;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Explicit `raw` shape for {@link AXPAiAssistRunResult} when {@link AXPAiAssistRunInput.expectStructuredOutput} is true.
|
|
537
|
+
*/
|
|
538
|
+
interface AXPAiAssistStructuredOutputRunRaw {
|
|
539
|
+
kind: 'structured-output';
|
|
540
|
+
/** One entry per engine call (`runEngine` / structured-output retries). */
|
|
541
|
+
attempts: AXPAiAssistStructuredOutputAttemptRecord[];
|
|
542
|
+
/** Cumulative usage across all attempts. */
|
|
543
|
+
totalUsage?: AXPAiAssistTokenUsageSnapshot;
|
|
544
|
+
/** Count of engine runs in this session (same as the last `attemptIndex`). */
|
|
545
|
+
finalAttempt: number;
|
|
546
|
+
lastProviderResult?: unknown;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Typical max width of the prompt box column inside the bottom overlay (maps to `contentMaxWidthPx`).
|
|
550
|
+
*/
|
|
551
|
+
type AXPAiAssistPopupSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
552
|
+
/**
|
|
553
|
+
* Indeterminate loading dialog shown while the prompt box executes an assist run after Send (model work /
|
|
554
|
+
* structured-output retries).
|
|
555
|
+
*/
|
|
556
|
+
interface AXPAiAssistRunLoadingDialogSpec {
|
|
557
|
+
title: string;
|
|
558
|
+
text: string;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Options for the AI assist `show` prompt API: same run-related fields as {@link AXPAiAssistRunInput} except `prompt`,
|
|
562
|
+
* plus UI chrome. The user-entered prompt from the surface is merged on Send.
|
|
563
|
+
*/
|
|
564
|
+
interface AXPAiAssistShowOptions {
|
|
565
|
+
/**
|
|
566
|
+
* Prompt box header; must be translated by the caller. Entity list assist uses
|
|
567
|
+
* `@extensions-ai-entity:assist.dialog-title.{type-level|selected|individual}`.
|
|
568
|
+
*/
|
|
569
|
+
title: string;
|
|
570
|
+
placeholder?: string;
|
|
571
|
+
initialPrompt?: string;
|
|
572
|
+
size?: AXPAiAssistPopupSize;
|
|
573
|
+
context?: AXPAiAssistRunContext;
|
|
574
|
+
/**
|
|
575
|
+
* Optional catalog assist. When omitted (and {@link directAgentId} is not set), the tenant/platform default assist applies.
|
|
576
|
+
*/
|
|
577
|
+
assistId?: string;
|
|
578
|
+
directAgentId?: string;
|
|
579
|
+
maxSteps?: number;
|
|
788
580
|
temperature?: number;
|
|
789
|
-
|
|
581
|
+
maxTokens?: number;
|
|
582
|
+
outputContract?: AXPAiAgentOutputContract;
|
|
583
|
+
expectStructuredOutput?: boolean;
|
|
584
|
+
structuredOutputInstruction?: string;
|
|
585
|
+
platformRuntimeNotes?: Record<string, unknown>;
|
|
586
|
+
maxStructuredRetries?: number;
|
|
587
|
+
structuredValidator?: AXPAiStructuredValidator;
|
|
588
|
+
retryOnInvalidStructure?: boolean;
|
|
589
|
+
structuredOutputSchemaSummary?: string;
|
|
590
|
+
structuredOutputMaxTokens?: number;
|
|
591
|
+
/**
|
|
592
|
+
* When set, shows an indeterminate loading dialog for the duration of each submitted run until `run` settles.
|
|
593
|
+
* Callers supply translated strings.
|
|
594
|
+
*/
|
|
595
|
+
runLoadingDialog?: AXPAiAssistRunLoadingDialogSpec;
|
|
790
596
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
597
|
+
|
|
598
|
+
declare const RootConfig: {
|
|
599
|
+
config: {
|
|
600
|
+
i18n: string;
|
|
601
|
+
module: string;
|
|
602
|
+
route: string;
|
|
603
|
+
};
|
|
604
|
+
module: {
|
|
605
|
+
name: string;
|
|
606
|
+
route: string;
|
|
607
|
+
title: string;
|
|
608
|
+
icon: string;
|
|
609
|
+
};
|
|
610
|
+
entities: {
|
|
611
|
+
model: {
|
|
612
|
+
name: string;
|
|
613
|
+
fullName: string;
|
|
614
|
+
title: string;
|
|
615
|
+
titlePlural: string;
|
|
616
|
+
icon: string;
|
|
617
|
+
};
|
|
618
|
+
assist: {
|
|
619
|
+
name: string;
|
|
620
|
+
fullName: string;
|
|
621
|
+
title: string;
|
|
622
|
+
titlePlural: string;
|
|
623
|
+
icon: string;
|
|
624
|
+
};
|
|
625
|
+
agent: {
|
|
626
|
+
name: string;
|
|
627
|
+
fullName: string;
|
|
628
|
+
title: string;
|
|
629
|
+
titlePlural: string;
|
|
630
|
+
icon: string;
|
|
631
|
+
};
|
|
632
|
+
openAiEndpoint: {
|
|
633
|
+
name: string;
|
|
634
|
+
fullName: string;
|
|
635
|
+
title: string;
|
|
636
|
+
titlePlural: string;
|
|
637
|
+
icon: string;
|
|
638
|
+
};
|
|
639
|
+
rule: {
|
|
640
|
+
name: string;
|
|
641
|
+
fullName: string;
|
|
642
|
+
title: string;
|
|
643
|
+
titlePlural: string;
|
|
644
|
+
icon: string;
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
declare class AXMAiManagementEntityProvider implements AXPEntityDefinitionLoader {
|
|
650
|
+
preload(): AXPEntityPreloadEntity[];
|
|
651
|
+
get(moduleName: string, entityName: string): Promise<AXPEntity | null>;
|
|
652
|
+
list(): Promise<{
|
|
653
|
+
name: string;
|
|
654
|
+
module: string;
|
|
655
|
+
}[]>;
|
|
656
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiManagementEntityProvider, never>;
|
|
657
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiManagementEntityProvider>;
|
|
797
658
|
}
|
|
798
|
-
|
|
799
|
-
type AXPAiChatAgentResultBody = AXPAiDelegatedAgentResultPayload;
|
|
800
|
-
/**
|
|
801
|
-
* Reads a stored-file artifact from a normalized tool handler body (`{ success, data }`) or a flat `data` object.
|
|
802
|
-
*/
|
|
803
|
-
declare function axpAiExtractStoredFileArtifactFromUnknown(content: unknown): AXPAiChatFileResponse['content'] | null;
|
|
804
|
-
/**
|
|
805
|
-
* Returns the last stored-file artifact announced in any `tool` → `tool_result` segment (delegated sub-runs, main chat).
|
|
806
|
-
*/
|
|
807
|
-
declare function axpAiExtractLastStoredFileArtifactFromChatMessages(messages: AXPAiChatMessage[]): AXPAiChatFileResponse['content'] | null;
|
|
659
|
+
|
|
808
660
|
/**
|
|
809
|
-
*
|
|
810
|
-
*
|
|
661
|
+
* AI Management Module Manifest.
|
|
662
|
+
* Defines module metadata for AI provider and API key management.
|
|
811
663
|
*/
|
|
812
|
-
declare
|
|
664
|
+
declare const AiManagementManifest: AXPModuleManifest;
|
|
665
|
+
|
|
813
666
|
/**
|
|
814
|
-
*
|
|
667
|
+
* AI Management menu keys.
|
|
668
|
+
* Pattern: AiManagement:Menu:{Path}
|
|
815
669
|
*/
|
|
816
|
-
declare
|
|
670
|
+
declare const AXPAiManagementMenuKeys: {
|
|
671
|
+
/** OpenAI-compatible HTTP endpoints (base URL + API key). */
|
|
672
|
+
readonly OpenAiEndpoints: "AiManagement:Menu:OpenAiEndpoints";
|
|
673
|
+
/** List of AI models (from providers). */
|
|
674
|
+
readonly Models: "AiManagement:Menu:Models";
|
|
675
|
+
/** List of Assists. */
|
|
676
|
+
readonly Assists: "AiManagement:Menu:Assists";
|
|
677
|
+
/** Delegated specialist agents (supervisor routing). */
|
|
678
|
+
readonly Agents: "AiManagement:Menu:Agents";
|
|
679
|
+
/** Reusable system-prompt rules (Markdown fragments). */
|
|
680
|
+
readonly Rules: "AiManagement:Menu:Rules";
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
declare class AXMAiManagementMenuProvider implements AXPMenuProvider {
|
|
684
|
+
private readonly entityService;
|
|
685
|
+
provide(context: AXPMenuProviderContext): Promise<void>;
|
|
686
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiManagementMenuProvider, never>;
|
|
687
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiManagementMenuProvider>;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/** Dynamic assist access permissions (`Assist.{name}.Use`). */
|
|
691
|
+
declare const AXMAiAssistPermissionKeys: {
|
|
692
|
+
readonly Use: "AiManagement:Permission:Assist.Use";
|
|
693
|
+
readonly useForAssist: (assistName: string) => string;
|
|
694
|
+
};
|
|
695
|
+
declare const AXMPermissionsKeys: {
|
|
696
|
+
readonly AiManagement: {
|
|
697
|
+
readonly Management: "AiManagement:Permission:Management";
|
|
698
|
+
readonly Assist: {
|
|
699
|
+
readonly Use: "AiManagement:Permission:Assist.Use";
|
|
700
|
+
readonly useForAssist: (assistName: string) => string;
|
|
701
|
+
};
|
|
702
|
+
};
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
/** One assist row mapped for permission definition children. */
|
|
706
|
+
interface AXMAiAssistPermissionRow {
|
|
707
|
+
name: string;
|
|
708
|
+
title: string;
|
|
709
|
+
description?: string;
|
|
710
|
+
}
|
|
817
711
|
/**
|
|
818
|
-
*
|
|
819
|
-
*
|
|
712
|
+
* Loads assist catalog rows for dynamic permission definitions.
|
|
713
|
+
* Skips rows without a stable programmatic `name`.
|
|
820
714
|
*/
|
|
821
|
-
declare function
|
|
715
|
+
declare function loadAssistPermissionRows(entityService: AXPEntityService, localeId: string): Promise<AXMAiAssistPermissionRow[]>;
|
|
716
|
+
|
|
717
|
+
declare class AXMPermissionDefinitionProvider implements AXPPermissionDefinitionProvider {
|
|
718
|
+
private readonly entityService;
|
|
719
|
+
private readonly localeId;
|
|
720
|
+
define(context: AXPPermissionDefinitionProviderContext): Promise<void>;
|
|
721
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMPermissionDefinitionProvider, never>;
|
|
722
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMPermissionDefinitionProvider>;
|
|
723
|
+
}
|
|
724
|
+
|
|
822
725
|
/**
|
|
823
|
-
*
|
|
726
|
+
* AI Management setting keys.
|
|
727
|
+
* Pattern: AiManagement:Setting:{Path}
|
|
824
728
|
*/
|
|
825
|
-
declare
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
729
|
+
declare const AXPAiManagementSettings: {
|
|
730
|
+
/** Assist primary key (`id`) used when no assist is explicitly selected (tenant-scoped). */
|
|
731
|
+
readonly DefaultAssistId: "AiManagement:Setting:DefaultAssistId";
|
|
732
|
+
/**
|
|
733
|
+
* System instructions prepended to every assist/agent chat system prompt in {@link AXPAiEngine}.
|
|
734
|
+
* Empty string means no global layer (default).
|
|
735
|
+
*/
|
|
736
|
+
readonly GlobalSystemPrompt: "AiManagement:Setting:GlobalSystemPrompt";
|
|
737
|
+
readonly Providers: {
|
|
738
|
+
readonly Gemini: {
|
|
739
|
+
readonly ApiKey: "AiManagement:Setting:Providers.Gemini.ApiKey";
|
|
740
|
+
};
|
|
741
|
+
readonly Demis: {
|
|
742
|
+
readonly BearerToken: "AiManagement:Setting:Providers.Demis.BearerToken";
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
|
|
829
747
|
/**
|
|
830
|
-
*
|
|
831
|
-
*
|
|
832
|
-
* requiring `<think>` / `<think>` in the model output.
|
|
748
|
+
* Full AI model catalog for chat (rows that include `chat` or `vision` in `modelPurposes`).
|
|
749
|
+
* Registry name: {@link AI_MODEL_CATALOG_DATASOURCE_NAME}.
|
|
833
750
|
*/
|
|
834
|
-
declare
|
|
835
|
-
declare function axpAiChatMessagesFromProviderAssistant(text: string, toolCalls?: AXPAiToolCall[]): AXPAiChatMessage[];
|
|
836
|
-
declare function axpAiToolCallFromAssistantToolMessage(message: AXPAiChatMessage): AXPAiToolCall | null;
|
|
837
|
-
declare function axpAiChatToolResultMessage(callId: string, content: unknown, toolName?: string): AXPAiChatMessage;
|
|
838
|
-
declare function axpAiChatAgentResultMessage(callId: string, content: AXPAiDelegatedAgentResultPayload, toolName?: string): AXPAiChatMessage;
|
|
839
|
-
declare function axpAiNormalizeHandlerResultToToolBody(handlerResult: unknown): unknown;
|
|
840
|
-
declare function axpAiChatToolOrAgentResultBodyJson(message: AXPAiChatMessage): string;
|
|
751
|
+
declare const AI_MODEL_CATALOG_DATASOURCE_NAME = "ai-management-model-catalog";
|
|
841
752
|
/**
|
|
842
|
-
*
|
|
753
|
+
* Image-generation models only (`modelPurposes` includes `image`).
|
|
754
|
+
* Registry name: {@link AI_MODEL_IMAGE_CATALOG_DATASOURCE_NAME}.
|
|
843
755
|
*/
|
|
844
|
-
declare
|
|
845
|
-
declare function axpAiSupervisorAgentToolName(agentCatalogId: string): string;
|
|
846
|
-
declare function axpAiParseSupervisorAgentToolName(toolName: string): string | null;
|
|
847
|
-
declare function axpAiMergePlainAssistantTextTurn(messages: AXPAiChatMessage[]): AXPAiChatMessage[];
|
|
848
|
-
/** Normalizes one follow-up chip command object from model JSON. */
|
|
849
|
-
declare function axpAiNormalizeFollowUpCommand(raw: unknown): AXPAiChatFollowUpCommand | null;
|
|
850
|
-
/** Normalizes one follow-up chip row (`text` + `command`). */
|
|
851
|
-
declare function axpAiNormalizeFollowUpItem(raw: unknown): AXPAiChatFollowUpItem | null;
|
|
852
|
-
/** Normalizes follow-up `content` arrays; invalid rows are skipped. */
|
|
853
|
-
declare function axpAiNormalizeFollowUpContent(raw: unknown): AXPAiChatFollowUpItem[];
|
|
756
|
+
declare const AI_MODEL_IMAGE_CATALOG_DATASOURCE_NAME = "ai-management-model-catalog-image";
|
|
854
757
|
/**
|
|
855
|
-
*
|
|
758
|
+
* Speech-to-text models only (`modelPurposes` includes `speech`).
|
|
759
|
+
* Registry name: {@link AI_MODEL_SPEECH_CATALOG_DATASOURCE_NAME}.
|
|
856
760
|
*/
|
|
857
|
-
declare
|
|
761
|
+
declare const AI_MODEL_SPEECH_CATALOG_DATASOURCE_NAME = "ai-management-model-catalog-speech";
|
|
858
762
|
/**
|
|
859
|
-
*
|
|
763
|
+
* Text-to-speech models only (`modelPurposes` includes `tts`).
|
|
764
|
+
* Registry name: {@link AI_MODEL_TTS_CATALOG_DATASOURCE_NAME}.
|
|
860
765
|
*/
|
|
861
|
-
declare
|
|
862
|
-
|
|
863
|
-
|
|
766
|
+
declare const AI_MODEL_TTS_CATALOG_DATASOURCE_NAME = "ai-management-model-catalog-tts";
|
|
767
|
+
type AXMAiModelPurposeSlug = 'chat' | 'vision' | 'image' | 'speech' | 'tts';
|
|
768
|
+
/** Reads `modelPurposes` from a catalog row (API/mock must provide the array). */
|
|
769
|
+
declare function readModelPurposes(row: Record<string, unknown> | null | undefined): string[];
|
|
770
|
+
declare function modelRowHasPurpose(row: Record<string, unknown> | null | undefined, purpose: AXMAiModelPurposeSlug): boolean;
|
|
771
|
+
/** Rows usable in chat / completion pickers: include `chat` or `vision`; not image/speech/tts-only. */
|
|
772
|
+
declare function isChatPurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
773
|
+
declare function isImagePurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
774
|
+
declare function isSpeechPurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
775
|
+
declare function isTtsPurposeModelRow(row: Record<string, unknown> | null | undefined): boolean;
|
|
776
|
+
declare class AXMAiModelCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
777
|
+
private readonly entityService;
|
|
778
|
+
items(): Promise<AXPDataSourceDefinition[]>;
|
|
779
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiModelCatalogDataSourceDefinition, never>;
|
|
780
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiModelCatalogDataSourceDefinition>;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/** Registry name for AiAgent catalog rows (delegated specialist definitions). */
|
|
784
|
+
declare const AI_AGENT_CATALOG_DATASOURCE_NAME = "ai-management-agent-catalog";
|
|
785
|
+
declare class AXMAiAgentCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
786
|
+
private readonly entityService;
|
|
787
|
+
items(): Promise<AXPDataSourceDefinition[]>;
|
|
788
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiAgentCatalogDataSourceDefinition, never>;
|
|
789
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiAgentCatalogDataSourceDefinition>;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/** Registry name for transcript-segment presets ({@link AXP_OUTPUT_CONTRACT_TRANSCRIPT_SEGMENT_PROVIDER}). */
|
|
793
|
+
declare const AI_OUTPUT_CONTRACT_TRANSCRIPT_SEGMENT_DATASOURCE_NAME = "ai-management-output-contract-transcript-segment";
|
|
794
|
+
interface AXMOutputContractTranscriptSegmentDataSourceRow {
|
|
795
|
+
id: AXPOutputTranscriptSegmentId;
|
|
796
|
+
name: AXPOutputTranscriptSegmentId;
|
|
797
|
+
title: string;
|
|
798
|
+
description?: string;
|
|
799
|
+
}
|
|
800
|
+
declare class AXMOutputContractTranscriptSegmentDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
801
|
+
private readonly segmentService;
|
|
802
|
+
items(): Promise<AXPDataSourceDefinition[]>;
|
|
803
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMOutputContractTranscriptSegmentDataSourceDefinition, never>;
|
|
804
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMOutputContractTranscriptSegmentDataSourceDefinition>;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
/** AI-capable command definitions for specialist registry scope (matches AiAgent entity lookup filter). */
|
|
808
|
+
declare const AI_COMMAND_REGISTRY_CATALOG_DATASOURCE_NAME = "ai-management-command-registry-catalog";
|
|
809
|
+
/** AI-capable query definitions for specialist registry scope. */
|
|
810
|
+
declare const AI_QUERY_REGISTRY_CATALOG_DATASOURCE_NAME = "ai-management-query-registry-catalog";
|
|
811
|
+
declare class AXMAiCommandRegistryCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
812
|
+
private readonly entityService;
|
|
813
|
+
items(): Promise<AXPDataSourceDefinition[]>;
|
|
814
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiCommandRegistryCatalogDataSourceDefinition, never>;
|
|
815
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiCommandRegistryCatalogDataSourceDefinition>;
|
|
816
|
+
}
|
|
817
|
+
declare class AXMAiQueryRegistryCatalogDataSourceDefinition implements AXPDataSourceDefinitionProvider {
|
|
818
|
+
private readonly entityService;
|
|
819
|
+
items(): Promise<AXPDataSourceDefinition[]>;
|
|
820
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXMAiQueryRegistryCatalogDataSourceDefinition, never>;
|
|
821
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXMAiQueryRegistryCatalogDataSourceDefinition>;
|
|
822
|
+
}
|
|
823
|
+
|
|
864
824
|
/**
|
|
865
|
-
*
|
|
866
|
-
* lines onto the final supervisor assistant message when the model omitted them.
|
|
825
|
+
* Human-readable specialist prompt from delegated-agent tool arguments (conversation / mini-chat UI).
|
|
867
826
|
*/
|
|
868
|
-
declare function
|
|
869
|
-
|
|
870
|
-
|
|
827
|
+
declare function axpAiDelegatedAgentPromptPreview(argumentsValue: unknown): string;
|
|
828
|
+
|
|
829
|
+
/** Prefix for supervisor-delegated specialist tools (`${AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX}${agentId}`). */
|
|
830
|
+
declare const AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX: "agent:";
|
|
831
|
+
declare function axpAiParseSupervisorAgentToolName(toolName: string): string | null;
|
|
832
|
+
declare function axpAiChatTextMessage(role: AXPAiChatMessage['role'], text: string): AXPAiChatMessage;
|
|
833
|
+
declare function axpAiChatUserMessage(responses: AXPAiChatResponse[]): AXPAiChatMessage;
|
|
834
|
+
declare function axpAiChatMessageGetText(message: AXPAiChatMessage): string;
|
|
871
835
|
declare function axpAiChatMessageIsDelegatedReflectionExcluded(message: AXPAiChatMessage): boolean;
|
|
836
|
+
/** Reads typed specialist segments from a normalized {@code agent_result} payload. */
|
|
837
|
+
declare function axpAiDelegatedAgentResultSegments(payload: {
|
|
838
|
+
success?: boolean;
|
|
839
|
+
data?: {
|
|
840
|
+
responses?: AXPAiDelegatedAgentResultSegment[];
|
|
841
|
+
};
|
|
842
|
+
}): AXPAiDelegatedAgentResultSegment[];
|
|
843
|
+
/** Plain text from specialist segments (text + think) for debug / preview UI. */
|
|
844
|
+
declare function axpAiDelegatedAgentOutcomeResponsesPlainText(segments: AXPAiDelegatedAgentResultSegment[]): string;
|
|
845
|
+
declare function axpAiChatToolResultBodyJson(message: AXPAiChatMessage): string;
|
|
846
|
+
declare function axpAiChatToolOrAgentResultBodyJson(message: AXPAiChatMessage): string;
|
|
872
847
|
|
|
873
848
|
/**
|
|
874
849
|
* Strips HTML tags and decodes a few common entities for safe plain-text transcript lines.
|
|
@@ -989,6 +964,165 @@ declare function persistAiGeneratedSpeech(fileStorage: AXPFileStorageService, fi
|
|
|
989
964
|
fileId: string;
|
|
990
965
|
}>;
|
|
991
966
|
|
|
967
|
+
/**
|
|
968
|
+
* Minimal JSON-Schema-like object for native provider hints and local validation.
|
|
969
|
+
* Aligns with shapes emitted by {@link inputOptionDefinitionsToJsonSchema} in connectivity mock support.
|
|
970
|
+
*/
|
|
971
|
+
interface AXPAiJsonSchemaLike {
|
|
972
|
+
type?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
973
|
+
properties?: Record<string, AXPAiJsonSchemaLike>;
|
|
974
|
+
items?: AXPAiJsonSchemaLike | AXPAiJsonSchemaLike[];
|
|
975
|
+
required?: string[];
|
|
976
|
+
enum?: unknown[];
|
|
977
|
+
additionalProperties?: boolean | AXPAiJsonSchemaLike;
|
|
978
|
+
description?: string;
|
|
979
|
+
[key: string]: unknown;
|
|
980
|
+
}
|
|
981
|
+
/** Provider-native structured output hint (OpenAI `response_format`, Gemini `responseMimeType`). */
|
|
982
|
+
type AXPAiResponseFormat = {
|
|
983
|
+
type: 'text';
|
|
984
|
+
} | {
|
|
985
|
+
type: 'json_object';
|
|
986
|
+
} | {
|
|
987
|
+
type: 'json_schema';
|
|
988
|
+
schema: AXPAiJsonSchemaLike;
|
|
989
|
+
name?: string;
|
|
990
|
+
strict?: boolean;
|
|
991
|
+
};
|
|
992
|
+
/** Default structured retry count for a contract kind when `structuredRetries` is omitted. */
|
|
993
|
+
declare function defaultRetriesForKind(kind: AXPAiAgentOutputKind): number;
|
|
994
|
+
declare function parseResponseFormat(raw: unknown): AXPAiResponseFormat | undefined;
|
|
995
|
+
/**
|
|
996
|
+
* Maps an effective output contract to a provider request hint.
|
|
997
|
+
* Explicit {@link AXPAiAgentOutputContract.providerResponseFormat} wins; otherwise derived from `kind` + `schema`.
|
|
998
|
+
*/
|
|
999
|
+
declare function deriveProviderResponseFormat(contract: AXPAiAgentOutputContract): AXPAiResponseFormat | undefined;
|
|
1000
|
+
declare function parseJsonSchemaLike(raw: unknown): AXPAiJsonSchemaLike | undefined;
|
|
1001
|
+
|
|
1002
|
+
interface ResolveEffectiveOutputContractInput {
|
|
1003
|
+
/** Highest priority: per engine run (programmatic / automation). */
|
|
1004
|
+
runtime?: AXPAiAgentOutputContract | null;
|
|
1005
|
+
/** Assist `run` / `show` input. */
|
|
1006
|
+
input?: AXPAiAgentOutputContract | null;
|
|
1007
|
+
/** Active AiAgent catalog row. */
|
|
1008
|
+
agent?: AXPAiAgentOutputContract | unknown | null;
|
|
1009
|
+
/** Active Assist catalog row. */
|
|
1010
|
+
assist?: AXPAiAgentOutputContract | unknown | null;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Resolves the effective output contract for one engine turn.
|
|
1014
|
+
*
|
|
1015
|
+
* Priority: runtime > input > agent > assist > `{ kind: 'string' }`.
|
|
1016
|
+
*/
|
|
1017
|
+
declare function resolveEffectiveOutputContract(params: ResolveEffectiveOutputContractInput): AXPAiAgentOutputContract;
|
|
1018
|
+
|
|
1019
|
+
declare class AXPAiOutputContractResolveService {
|
|
1020
|
+
private readonly segmentService;
|
|
1021
|
+
/**
|
|
1022
|
+
* Resolves a persisted agent/assist `outputContract` value (segment id string)
|
|
1023
|
+
* or a full contract object (runtime / programmatic).
|
|
1024
|
+
*/
|
|
1025
|
+
resolveFromPersisted(raw: unknown): Promise<AXPAiAgentOutputContract | null>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Effective contract for one engine turn.
|
|
1028
|
+
* Priority: runtime > input > agent > assist > `{ kind: 'string' }`.
|
|
1029
|
+
*/
|
|
1030
|
+
resolveEffective(params: ResolveEffectiveOutputContractInput): Promise<AXPAiAgentOutputContract>;
|
|
1031
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPAiOutputContractResolveService, never>;
|
|
1032
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPAiOutputContractResolveService>;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* User follow-up appended to the transcript when structured JSON parse/validation fails.
|
|
1037
|
+
*
|
|
1038
|
+
* @param validationDetail - Parse or schema validation error text.
|
|
1039
|
+
* @param schemaSummary - Optional expected shape (e.g. TypeScript-style) to improve retry quality.
|
|
1040
|
+
* @param failurePhase - Parse failures get stronger anti-truncation wording; validator failures focus on schema/rules.
|
|
1041
|
+
*/
|
|
1042
|
+
declare function buildStructuredOutputRetryUserText(validationDetail: string, schemaSummary?: string, failurePhase?: 'parse' | 'validator'): string;
|
|
1043
|
+
|
|
1044
|
+
type StructuredAssistantValidation = {
|
|
1045
|
+
ok: true;
|
|
1046
|
+
value: unknown;
|
|
1047
|
+
} | {
|
|
1048
|
+
ok: false;
|
|
1049
|
+
errorMessage: string;
|
|
1050
|
+
failurePhase: 'parse' | 'validator';
|
|
1051
|
+
};
|
|
1052
|
+
/**
|
|
1053
|
+
* Parses JSON from assistant text (including lightweight local repair), then optionally runs a custom validator.
|
|
1054
|
+
*
|
|
1055
|
+
* @param textSegmentsFallback - When provided, each segment is tried after combined text (last segment first); helps when prose and JSON sit in separate assistant text blocks.
|
|
1056
|
+
*/
|
|
1057
|
+
declare function validateStructuredAssistantResponse(assistantPlainText: string, structuredValidator: AXPAiStructuredValidator | undefined, textSegmentsFallback?: readonly string[]): Promise<StructuredAssistantValidation>;
|
|
1058
|
+
|
|
1059
|
+
interface ContractValidationError {
|
|
1060
|
+
phase: 'parse' | 'validator';
|
|
1061
|
+
message: string;
|
|
1062
|
+
details?: unknown;
|
|
1063
|
+
}
|
|
1064
|
+
type ContractValidationResult = {
|
|
1065
|
+
ok: true;
|
|
1066
|
+
value: unknown;
|
|
1067
|
+
} | {
|
|
1068
|
+
ok: false;
|
|
1069
|
+
errors: ContractValidationError[];
|
|
1070
|
+
};
|
|
1071
|
+
interface ValidateAgainstContractCommandExecutor {
|
|
1072
|
+
execute(commandName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
1073
|
+
}
|
|
1074
|
+
interface ValidateAgainstContractParams {
|
|
1075
|
+
contract: AXPAiAgentOutputContract;
|
|
1076
|
+
assistantPlainText: string;
|
|
1077
|
+
textSegmentsFallback?: readonly string[];
|
|
1078
|
+
structuredValidator?: AXPAiStructuredValidator;
|
|
1079
|
+
commandExecutor?: ValidateAgainstContractCommandExecutor;
|
|
1080
|
+
/**
|
|
1081
|
+
* When the command returns `{ success, data: { valid, errors?, normalizedJson? } }` envelope shape.
|
|
1082
|
+
*/
|
|
1083
|
+
parseCommandEnvelope?: (raw: unknown) => {
|
|
1084
|
+
valid: boolean;
|
|
1085
|
+
errorMessage?: string;
|
|
1086
|
+
normalizedJson?: string;
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Parses assistant text and validates against contract schema, registry command, and optional custom validator.
|
|
1091
|
+
*/
|
|
1092
|
+
declare function validateAgainstContract(params: ValidateAgainstContractParams): Promise<ContractValidationResult>;
|
|
1093
|
+
|
|
1094
|
+
interface JsonSchemaMiniValidationError {
|
|
1095
|
+
path: string;
|
|
1096
|
+
message: string;
|
|
1097
|
+
}
|
|
1098
|
+
type JsonSchemaMiniValidationResult = {
|
|
1099
|
+
ok: true;
|
|
1100
|
+
} | {
|
|
1101
|
+
ok: false;
|
|
1102
|
+
errors: JsonSchemaMiniValidationError[];
|
|
1103
|
+
};
|
|
1104
|
+
/**
|
|
1105
|
+
* Validates a value against a minimal JSON Schema subset (types, required, enum, properties, items).
|
|
1106
|
+
*/
|
|
1107
|
+
declare function validateJsonSchemaMini(schema: AXPAiJsonSchemaLike, value: unknown): JsonSchemaMiniValidationResult;
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* Text segments from the last assistant message (`type: 'text'` only).
|
|
1111
|
+
* Omits `think` and `node` segments so JSON parsing is not polluted by widget envelopes or reasoning blocks stored separately.
|
|
1112
|
+
*/
|
|
1113
|
+
declare function extractLastAssistantTextSegments(messages: AXPAiChatMessage[]): string[];
|
|
1114
|
+
/**
|
|
1115
|
+
* Combined text for structured JSON extraction (text segments only).
|
|
1116
|
+
*/
|
|
1117
|
+
declare function extractLastAssistantStructuredParts(messages: AXPAiChatMessage[]): {
|
|
1118
|
+
combined: string;
|
|
1119
|
+
segments: string[];
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* Concatenated plain text from the last assistant message in the transcript (includes `node` payloads like {@link axpAiChatMessageGetText}).
|
|
1123
|
+
*/
|
|
1124
|
+
declare function extractLastAssistantPlainText(messages: AXPAiChatMessage[]): string;
|
|
1125
|
+
|
|
992
1126
|
/** Aligns with {@link AXPAiChatTransport} in ai-engine.types (avoid circular imports). */
|
|
993
1127
|
type AXMAiManagementModelChatTransport = 'openai' | 'gemini' | 'demis';
|
|
994
1128
|
type AXMAiManagementModelPurposeSlug = 'chat' | 'vision' | 'image' | 'speech' | 'tts';
|
|
@@ -1058,6 +1192,7 @@ declare abstract class AXPAiAssistService {
|
|
|
1058
1192
|
*/
|
|
1059
1193
|
declare class AXPAiManagerService extends AXPAiAssistService {
|
|
1060
1194
|
private readonly aiEngine;
|
|
1195
|
+
private readonly outputContractResolve;
|
|
1061
1196
|
private readonly entityService;
|
|
1062
1197
|
private readonly settings;
|
|
1063
1198
|
private readonly runtimeContextBuilder;
|
|
@@ -1075,6 +1210,10 @@ declare class AXPAiManagerService extends AXPAiAssistService {
|
|
|
1075
1210
|
* Resolves the assist row for chat: explicit primary key, otherwise the effective default from settings.
|
|
1076
1211
|
*/
|
|
1077
1212
|
getAssistForChat(assistId?: string | null): Promise<AXPAiEffectiveAssistRow>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Primary catalog model transport for an assist (`modelId` row).
|
|
1215
|
+
*/
|
|
1216
|
+
getAssistPrimaryChatTransport(assistId?: string | null): Promise<AXPAiChatTransport | undefined>;
|
|
1078
1217
|
/**
|
|
1079
1218
|
* Low-level engine run (chat streaming and tool orchestration).
|
|
1080
1219
|
*/
|
|
@@ -1221,5 +1360,5 @@ declare class AXMAiAssistPromptBoxComponent implements OnInit, OnDestroy {
|
|
|
1221
1360
|
static ɵcmp: i0.ɵɵComponentDeclaration<AXMAiAssistPromptBoxComponent, "axm-ai-assist-prompt-box", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "initialPrompt": { "alias": "initialPrompt"; "required": false; "isSignal": true; }; "contentMaxWidthPx": { "alias": "contentMaxWidthPx"; "required": false; "isSignal": true; }; "initialAssistId": { "alias": "initialAssistId"; "required": false; "isSignal": true; }; "initialDirectAgentId": { "alias": "initialDirectAgentId"; "required": false; "isSignal": true; }; "runPrompt": { "alias": "runPrompt"; "required": true; "isSignal": true; }; "requestClose": { "alias": "requestClose"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1222
1361
|
}
|
|
1223
1362
|
|
|
1224
|
-
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, AI_AGENT_CATALOG_DATASOURCE_NAME, AI_CHAT_ATTACHMENT_CATEGORY, AI_CHAT_ATTACHMENT_REF_TYPE, AI_CHAT_GENERATED_IMAGE_REF_TYPE, AI_CHAT_GENERATED_SPEECH_REF_TYPE, AI_COMMAND_REGISTRY_CATALOG_DATASOURCE_NAME, AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL, AI_MODEL_CATALOG_DATASOURCE_NAME, AI_MODEL_IMAGE_CATALOG_DATASOURCE_NAME, AI_MODEL_SPEECH_CATALOG_DATASOURCE_NAME, AI_MODEL_TTS_CATALOG_DATASOURCE_NAME, AI_QUERY_REGISTRY_CATALOG_DATASOURCE_NAME, AXMAiAgentCatalogDataSourceDefinition, AXMAiAssistPermissionKeys, AXMAiAssistPromptBoxComponent, AXMAiAssistPromptBoxService, AXMAiCommandRegistryCatalogDataSourceDefinition, AXMAiManagementEntityProvider, AXMAiManagementMenuProvider, AXMAiManagementModule, AXMAiModelCatalogDataSourceDefinition, AXMAiQueryRegistryCatalogDataSourceDefinition, AXMPermissionDefinitionProvider, AXMPermissionsKeys,
|
|
1225
|
-
export type { AXMAiAssistPermissionRow, AXMAiManagementAgentEntityModel, AXMAiManagementAssistEntityModel, AXMAiManagementAssistPlanningMode, AXMAiManagementModelChatTransport, AXMAiManagementModelEntityModel, AXMAiManagementModelPurposeSlug, AXMAiManagementOpenAiEndpointEntityModel, AXMAiModelPurposeSlug, AXPAiAssistPopupSize, AXPAiAssistPromptSubmitPayload, AXPAiAssistRunContext, AXPAiAssistRunInput, AXPAiAssistRunLoadingDialogSpec, AXPAiAssistRunResult, AXPAiAssistShowOptions, AXPAiAssistStructuredOutputAttemptRecord, AXPAiAssistStructuredOutputRunRaw, AXPAiAssistTokenUsageSnapshot, AXPAiAssistUserMediaAttachment,
|
|
1363
|
+
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, AI_AGENT_CATALOG_DATASOURCE_NAME, AI_CHAT_ATTACHMENT_CATEGORY, AI_CHAT_ATTACHMENT_REF_TYPE, AI_CHAT_GENERATED_IMAGE_REF_TYPE, AI_CHAT_GENERATED_SPEECH_REF_TYPE, AI_COMMAND_REGISTRY_CATALOG_DATASOURCE_NAME, AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL, AI_MODEL_CATALOG_DATASOURCE_NAME, AI_MODEL_IMAGE_CATALOG_DATASOURCE_NAME, AI_MODEL_SPEECH_CATALOG_DATASOURCE_NAME, AI_MODEL_TTS_CATALOG_DATASOURCE_NAME, AI_OUTPUT_CONTRACT_TRANSCRIPT_SEGMENT_DATASOURCE_NAME, AI_QUERY_REGISTRY_CATALOG_DATASOURCE_NAME, AXMAiAgentCatalogDataSourceDefinition, AXMAiAssistPermissionKeys, AXMAiAssistPromptBoxComponent, AXMAiAssistPromptBoxService, AXMAiCommandRegistryCatalogDataSourceDefinition, AXMAiManagementEntityProvider, AXMAiManagementMenuProvider, AXMAiManagementModule, AXMAiModelCatalogDataSourceDefinition, AXMAiQueryRegistryCatalogDataSourceDefinition, AXMOutputContractTranscriptSegmentDataSourceDefinition, AXMPermissionDefinitionProvider, AXMPermissionsKeys, AXPAI_AGENT_OUTPUT_CONTRACT_DEFAULT_STRUCTURED_RETRIES, AXPAI_SUPERVISOR_AGENT_TOOL_PREFIX, AXPAiAssistChatModelCatalogService, AXPAiAssistDefaultMaxStructuredRetries, AXPAiAssistDefaultStructuredMaxTokens, AXPAiAssistService, AXPAiChatToolRunContextService, AXPAiDefaultModelPickerService, AXPAiEngine, AXPAiManagementMenuKeys, AXPAiManagementSettings, AXPAiManagerService, AXPAiOutputContractResolveService, AXPAiPlatformRuntimeContextBuilder, AXPAiStructuredOutputError, AiManagementManifest, RootConfig, axpAiAgentOutputContractOmitsRoleBaseline, axpAiAgentOutputContractStructuredRetryCap, axpAiAgentOutputContractUsesStructuredFinalize, axpAiAssistInitialMessagesToTranscript, axpAiAssistStarterPromptLabels, axpAiAssistStarterPromptTexts, axpAiChatMessageGetText, axpAiChatMessageIsDelegatedReflectionExcluded, axpAiChatTextMessage, axpAiChatToolOrAgentResultBodyJson, axpAiChatToolResultBodyJson, axpAiChatUserMessage, axpAiDelegatedAgentOutcomeResponsesPlainText, axpAiDelegatedAgentPromptPreview, axpAiDelegatedAgentResultSegments, axpAiParseSupervisorAgentToolName, axpAiStripAssistInitialHtmlToPlain, blobOrFileFromImageResult, buildStructuredOutputRetryUserText, defaultRetriesForKind, deriveProviderResponseFormat, extractLastAssistantPlainText, extractLastAssistantStructuredParts, extractLastAssistantTextSegments, getAiChatCommandLlmParametersOverride, isChatPurposeModelRow, isImagePurposeModelRow, isSpeechPurposeModelRow, isTtsPurposeModelRow, loadAssistPermissionRows, modelRowHasPurpose, parseAgentOutputContract, parseJsonSchemaLike, parseResponseFormat, persistAiChatAttachmentImage, persistAiGeneratedImage, persistAiGeneratedSpeech, readModelPurposes, resolveAgentOutputContract, resolveEffectiveOutputContract, resolveOutputTranscriptSegment, validateAgainstContract, validateJsonSchemaMini, validateStructuredAssistantResponse };
|
|
1364
|
+
export type { AXMAiAssistPermissionRow, AXMAiManagementAgentEntityModel, AXMAiManagementAssistEntityModel, AXMAiManagementAssistPlanningMode, AXMAiManagementModelChatTransport, AXMAiManagementModelEntityModel, AXMAiManagementModelPurposeSlug, AXMAiManagementOpenAiEndpointEntityModel, AXMAiManagementRuleEntityModel, AXMAiManagementRuleRef, AXMAiModelPurposeSlug, AXMOutputContractTranscriptSegmentDataSourceRow, AXPAiAgentOutputContract, AXPAiAgentOutputKind, AXPAiAssistCannotComplete, AXPAiAssistExecutionResult, AXPAiAssistPopupSize, AXPAiAssistPromptSubmitPayload, AXPAiAssistRunContext, AXPAiAssistRunInput, AXPAiAssistRunLoadingDialogSpec, AXPAiAssistRunResult, AXPAiAssistShowOptions, AXPAiAssistStructuredOutputAttemptRecord, AXPAiAssistStructuredOutputRunRaw, AXPAiAssistTokenUsageSnapshot, AXPAiAssistUserMediaAttachment, AXPAiAssistValidationError, AXPAiChatAgentAssistantResponse, AXPAiChatAgentResultResponse, AXPAiChatFileResponse, AXPAiChatFollowUpCommand, AXPAiChatFollowUpItem, AXPAiChatFollowUpResponse, AXPAiChatMessage, AXPAiChatModelListItem, AXPAiChatModelListRequest, AXPAiChatNodeResponse, AXPAiChatResponse, AXPAiChatTextResponse, AXPAiChatThinkResponse, AXPAiChatToolAssistantResponse, AXPAiChatToolInvocationContent, AXPAiChatToolResultResponse, AXPAiChatToolRunContext, AXPAiChatTransport, AXPAiDelegatedAgentResultPayload, AXPAiDelegatedAgentResultSegment, AXPAiDelegatedAgentTranscriptEntry, AXPAiDelegatedNestedToolCallContext, AXPAiEffectiveAgentRow, AXPAiEffectiveAssistRow, AXPAiEngineLastProviderPayload, AXPAiEngineRunEvent, AXPAiEngineRunOptions, AXPAiEngineRunResult, AXPAiEngineUsageTotals, AXPAiJsonSchemaLike$1 as AXPAiJsonSchemaLike, AXPAiOutputTranscriptSegment, AXPAiPlatformRuntimeContext, AXPAiResponseFormat$1 as AXPAiResponseFormat, AXPAiStructuredValidator, AXPAiToolCall, ResolveEffectiveOutputContractInput };
|