@xpert-ai/contracts 3.38.0 → 3.38.1
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/index.cjs.js +41 -13
- package/index.esm.js +34 -14
- package/package.json +2 -2
- package/src/ai/chat-event.model.d.ts +2 -1
- package/src/ai/chat-message-envelope.model.d.ts +2 -1
- package/src/ai/chat-message.model.d.ts +1 -1
- package/src/ai/chat.model.d.ts +12 -3
- package/src/ai/index.d.ts +1 -0
- package/src/ai/template-lifecycle.model.d.ts +2 -2
- package/src/ai/xpert-agent-execution.model.d.ts +3 -0
- package/src/plugin-application.d.ts +83 -0
package/index.cjs.js
CHANGED
|
@@ -418,7 +418,7 @@ function _object_spread$v(target) {
|
|
|
418
418
|
}
|
|
419
419
|
return target;
|
|
420
420
|
}
|
|
421
|
-
function ownKeys$
|
|
421
|
+
function ownKeys$p(object, enumerableOnly) {
|
|
422
422
|
var keys = Object.keys(object);
|
|
423
423
|
if (Object.getOwnPropertySymbols) {
|
|
424
424
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -426,12 +426,12 @@ function ownKeys$o(object, enumerableOnly) {
|
|
|
426
426
|
}
|
|
427
427
|
return keys;
|
|
428
428
|
}
|
|
429
|
-
function _object_spread_props$
|
|
429
|
+
function _object_spread_props$p(target, source) {
|
|
430
430
|
source = source != null ? source : {};
|
|
431
431
|
if (Object.getOwnPropertyDescriptors) {
|
|
432
432
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
433
433
|
} else {
|
|
434
|
-
ownKeys$
|
|
434
|
+
ownKeys$p(Object(source)).forEach(function(key) {
|
|
435
435
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
436
436
|
});
|
|
437
437
|
}
|
|
@@ -454,7 +454,7 @@ var appPlatformAppSchema = v3.z.object({
|
|
|
454
454
|
configurationRef: key$3,
|
|
455
455
|
dependsOn: v3.z.array(key$3).max(32).default([])
|
|
456
456
|
}).strict().transform(function(app) {
|
|
457
|
-
return _object_spread_props$
|
|
457
|
+
return _object_spread_props$p(_object_spread$v({}, app), {
|
|
458
458
|
key: app.key,
|
|
459
459
|
required: app.required,
|
|
460
460
|
configurationRef: app.configurationRef,
|
|
@@ -2153,7 +2153,7 @@ function _object_spread$u(target) {
|
|
|
2153
2153
|
}
|
|
2154
2154
|
return target;
|
|
2155
2155
|
}
|
|
2156
|
-
function ownKeys$
|
|
2156
|
+
function ownKeys$o(object, enumerableOnly) {
|
|
2157
2157
|
var keys = Object.keys(object);
|
|
2158
2158
|
if (Object.getOwnPropertySymbols) {
|
|
2159
2159
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2161,12 +2161,12 @@ function ownKeys$n(object, enumerableOnly) {
|
|
|
2161
2161
|
}
|
|
2162
2162
|
return keys;
|
|
2163
2163
|
}
|
|
2164
|
-
function _object_spread_props$
|
|
2164
|
+
function _object_spread_props$o(target, source) {
|
|
2165
2165
|
source = source != null ? source : {};
|
|
2166
2166
|
if (Object.getOwnPropertyDescriptors) {
|
|
2167
2167
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2168
2168
|
} else {
|
|
2169
|
-
ownKeys$
|
|
2169
|
+
ownKeys$o(Object(source)).forEach(function(key) {
|
|
2170
2170
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2171
2171
|
});
|
|
2172
2172
|
}
|
|
@@ -2194,7 +2194,7 @@ function parseSelectionSet(value) {
|
|
|
2194
2194
|
if (plugins !== undefined && (!isObject(plugins) || !("nodeKeys" in plugins) || !isStringList(plugins.nodeKeys))) return null;
|
|
2195
2195
|
if (subAgents !== undefined && (!isObject(subAgents) || !("nodeKeys" in subAgents) || !isStringList(subAgents.nodeKeys))) return null;
|
|
2196
2196
|
if (connectors !== undefined && (!isObject(connectors) || !("bindingIds" in connectors) || !isStringList(connectors.bindingIds))) return null;
|
|
2197
|
-
return _object_spread$u(_object_spread_props$
|
|
2197
|
+
return _object_spread$u(_object_spread_props$o(_object_spread$u({}, value), {
|
|
2198
2198
|
skills: skills === undefined ? {
|
|
2199
2199
|
ids: []
|
|
2200
2200
|
} : skills,
|
|
@@ -2213,7 +2213,7 @@ function parsePromptCapabilitySelection(value) {
|
|
|
2213
2213
|
var selection = parseSelectionSet(value);
|
|
2214
2214
|
var recommended = "recommended" in value && value.recommended != null ? parseSelectionSet(value.recommended) : undefined;
|
|
2215
2215
|
if (!selection || recommended === null) return null;
|
|
2216
|
-
return _object_spread$u(_object_spread_props$
|
|
2216
|
+
return _object_spread$u(_object_spread_props$o(_object_spread$u({}, selection), {
|
|
2217
2217
|
mode: "allowlist"
|
|
2218
2218
|
}), "inheritUnselected" in value && typeof value.inheritUnselected === "boolean" ? {
|
|
2219
2219
|
inheritUnselected: value.inheritUnselected
|
|
@@ -2265,7 +2265,7 @@ function parsePromptCapabilityConfig(value) {
|
|
|
2265
2265
|
}
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
|
-
return _object_spread_props$
|
|
2268
|
+
return _object_spread_props$o(_object_spread$u({}, value), {
|
|
2269
2269
|
type: "expert_scoped_capabilities",
|
|
2270
2270
|
version: 1,
|
|
2271
2271
|
defaults: defaults,
|
|
@@ -2432,15 +2432,35 @@ function _object_spread$t(target) {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
return target;
|
|
2434
2434
|
}
|
|
2435
|
+
function ownKeys$n(object, enumerableOnly) {
|
|
2436
|
+
var keys = Object.keys(object);
|
|
2437
|
+
if (Object.getOwnPropertySymbols) {
|
|
2438
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2439
|
+
keys.push.apply(keys, symbols);
|
|
2440
|
+
}
|
|
2441
|
+
return keys;
|
|
2442
|
+
}
|
|
2443
|
+
function _object_spread_props$n(target, source) {
|
|
2444
|
+
source = source != null ? source : {};
|
|
2445
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
2446
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2447
|
+
} else {
|
|
2448
|
+
ownKeys$n(Object(source)).forEach(function(key) {
|
|
2449
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
return target;
|
|
2453
|
+
}
|
|
2435
2454
|
var CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = "follow_up_consumed";
|
|
2436
2455
|
var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
|
|
2437
2456
|
var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
|
|
2438
2457
|
var CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED = "thread_goal_updated";
|
|
2439
2458
|
var CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED = "thread_goal_cleared";
|
|
2440
2459
|
function createConversationTitleSummaryEvent(event) {
|
|
2441
|
-
return _object_spread$t({
|
|
2442
|
-
type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
|
|
2443
|
-
|
|
2460
|
+
return _object_spread_props$n(_object_spread$t({}, event), {
|
|
2461
|
+
type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY,
|
|
2462
|
+
presentation: "runtime"
|
|
2463
|
+
});
|
|
2444
2464
|
}
|
|
2445
2465
|
function createFollowUpConsumedEvent(event) {
|
|
2446
2466
|
return _object_spread$t({
|
|
@@ -16524,10 +16544,18 @@ Object.defineProperty(exports, "createResourceCardContent", {
|
|
|
16524
16544
|
enumerable: true,
|
|
16525
16545
|
get: function () { return chatkitTypes.createResourceCardContent; }
|
|
16526
16546
|
});
|
|
16547
|
+
Object.defineProperty(exports, "hasRuntimePresentation", {
|
|
16548
|
+
enumerable: true,
|
|
16549
|
+
get: function () { return chatkitTypes.hasRuntimePresentation; }
|
|
16550
|
+
});
|
|
16527
16551
|
Object.defineProperty(exports, "isResourceCardContent", {
|
|
16528
16552
|
enumerable: true,
|
|
16529
16553
|
get: function () { return chatkitTypes.isResourceCardContent; }
|
|
16530
16554
|
});
|
|
16555
|
+
Object.defineProperty(exports, "isRuntimeAgentExecution", {
|
|
16556
|
+
enumerable: true,
|
|
16557
|
+
get: function () { return chatkitTypes.isRuntimeAgentExecution; }
|
|
16558
|
+
});
|
|
16531
16559
|
Object.defineProperty(exports, "parseResourceCard", {
|
|
16532
16560
|
enumerable: true,
|
|
16533
16561
|
get: function () { return chatkitTypes.parseResourceCard; }
|
package/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod/v3';
|
|
|
2
2
|
import { z as z$1 } from 'zod';
|
|
3
3
|
import ShortUniqueId from 'short-unique-id';
|
|
4
4
|
import { parseResourceCardContent, upsertResourceCardContent, parseFileActivityContent, upsertFileActivityContent, isFileActivityContent, isResourceCardContent } from '@xpert-ai/chatkit-types';
|
|
5
|
-
export { createResourceCardContent, isResourceCardContent, parseResourceCard, parseResourceCardContent, resourceCardId, upsertResourceCardContent } from '@xpert-ai/chatkit-types';
|
|
5
|
+
export { createResourceCardContent, hasRuntimePresentation, isResourceCardContent, isRuntimeAgentExecution, parseResourceCard, parseResourceCardContent, resourceCardId, upsertResourceCardContent } from '@xpert-ai/chatkit-types';
|
|
6
6
|
export { viewContextEventSchema } from './context-event.esm.js';
|
|
7
7
|
|
|
8
8
|
var key$6 = z.string().min(1).max(256).refine(function(value) {
|
|
@@ -417,7 +417,7 @@ function _object_spread$v(target) {
|
|
|
417
417
|
}
|
|
418
418
|
return target;
|
|
419
419
|
}
|
|
420
|
-
function ownKeys$
|
|
420
|
+
function ownKeys$p(object, enumerableOnly) {
|
|
421
421
|
var keys = Object.keys(object);
|
|
422
422
|
if (Object.getOwnPropertySymbols) {
|
|
423
423
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -425,12 +425,12 @@ function ownKeys$o(object, enumerableOnly) {
|
|
|
425
425
|
}
|
|
426
426
|
return keys;
|
|
427
427
|
}
|
|
428
|
-
function _object_spread_props$
|
|
428
|
+
function _object_spread_props$p(target, source) {
|
|
429
429
|
source = source != null ? source : {};
|
|
430
430
|
if (Object.getOwnPropertyDescriptors) {
|
|
431
431
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
432
432
|
} else {
|
|
433
|
-
ownKeys$
|
|
433
|
+
ownKeys$p(Object(source)).forEach(function(key) {
|
|
434
434
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
435
435
|
});
|
|
436
436
|
}
|
|
@@ -453,7 +453,7 @@ var appPlatformAppSchema = z.object({
|
|
|
453
453
|
configurationRef: key$3,
|
|
454
454
|
dependsOn: z.array(key$3).max(32).default([])
|
|
455
455
|
}).strict().transform(function(app) {
|
|
456
|
-
return _object_spread_props$
|
|
456
|
+
return _object_spread_props$p(_object_spread$v({}, app), {
|
|
457
457
|
key: app.key,
|
|
458
458
|
required: app.required,
|
|
459
459
|
configurationRef: app.configurationRef,
|
|
@@ -2152,7 +2152,7 @@ function _object_spread$u(target) {
|
|
|
2152
2152
|
}
|
|
2153
2153
|
return target;
|
|
2154
2154
|
}
|
|
2155
|
-
function ownKeys$
|
|
2155
|
+
function ownKeys$o(object, enumerableOnly) {
|
|
2156
2156
|
var keys = Object.keys(object);
|
|
2157
2157
|
if (Object.getOwnPropertySymbols) {
|
|
2158
2158
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2160,12 +2160,12 @@ function ownKeys$n(object, enumerableOnly) {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
return keys;
|
|
2162
2162
|
}
|
|
2163
|
-
function _object_spread_props$
|
|
2163
|
+
function _object_spread_props$o(target, source) {
|
|
2164
2164
|
source = source != null ? source : {};
|
|
2165
2165
|
if (Object.getOwnPropertyDescriptors) {
|
|
2166
2166
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2167
2167
|
} else {
|
|
2168
|
-
ownKeys$
|
|
2168
|
+
ownKeys$o(Object(source)).forEach(function(key) {
|
|
2169
2169
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2170
2170
|
});
|
|
2171
2171
|
}
|
|
@@ -2193,7 +2193,7 @@ function parseSelectionSet(value) {
|
|
|
2193
2193
|
if (plugins !== undefined && (!isObject(plugins) || !("nodeKeys" in plugins) || !isStringList(plugins.nodeKeys))) return null;
|
|
2194
2194
|
if (subAgents !== undefined && (!isObject(subAgents) || !("nodeKeys" in subAgents) || !isStringList(subAgents.nodeKeys))) return null;
|
|
2195
2195
|
if (connectors !== undefined && (!isObject(connectors) || !("bindingIds" in connectors) || !isStringList(connectors.bindingIds))) return null;
|
|
2196
|
-
return _object_spread$u(_object_spread_props$
|
|
2196
|
+
return _object_spread$u(_object_spread_props$o(_object_spread$u({}, value), {
|
|
2197
2197
|
skills: skills === undefined ? {
|
|
2198
2198
|
ids: []
|
|
2199
2199
|
} : skills,
|
|
@@ -2212,7 +2212,7 @@ function parsePromptCapabilitySelection(value) {
|
|
|
2212
2212
|
var selection = parseSelectionSet(value);
|
|
2213
2213
|
var recommended = "recommended" in value && value.recommended != null ? parseSelectionSet(value.recommended) : undefined;
|
|
2214
2214
|
if (!selection || recommended === null) return null;
|
|
2215
|
-
return _object_spread$u(_object_spread_props$
|
|
2215
|
+
return _object_spread$u(_object_spread_props$o(_object_spread$u({}, selection), {
|
|
2216
2216
|
mode: "allowlist"
|
|
2217
2217
|
}), "inheritUnselected" in value && typeof value.inheritUnselected === "boolean" ? {
|
|
2218
2218
|
inheritUnselected: value.inheritUnselected
|
|
@@ -2264,7 +2264,7 @@ function parsePromptCapabilityConfig(value) {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
}
|
|
2266
2266
|
}
|
|
2267
|
-
return _object_spread_props$
|
|
2267
|
+
return _object_spread_props$o(_object_spread$u({}, value), {
|
|
2268
2268
|
type: "expert_scoped_capabilities",
|
|
2269
2269
|
version: 1,
|
|
2270
2270
|
defaults: defaults,
|
|
@@ -2431,15 +2431,35 @@ function _object_spread$t(target) {
|
|
|
2431
2431
|
}
|
|
2432
2432
|
return target;
|
|
2433
2433
|
}
|
|
2434
|
+
function ownKeys$n(object, enumerableOnly) {
|
|
2435
|
+
var keys = Object.keys(object);
|
|
2436
|
+
if (Object.getOwnPropertySymbols) {
|
|
2437
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2438
|
+
keys.push.apply(keys, symbols);
|
|
2439
|
+
}
|
|
2440
|
+
return keys;
|
|
2441
|
+
}
|
|
2442
|
+
function _object_spread_props$n(target, source) {
|
|
2443
|
+
source = source != null ? source : {};
|
|
2444
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
2445
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2446
|
+
} else {
|
|
2447
|
+
ownKeys$n(Object(source)).forEach(function(key) {
|
|
2448
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2449
|
+
});
|
|
2450
|
+
}
|
|
2451
|
+
return target;
|
|
2452
|
+
}
|
|
2434
2453
|
var CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = "follow_up_consumed";
|
|
2435
2454
|
var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
|
|
2436
2455
|
var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
|
|
2437
2456
|
var CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED = "thread_goal_updated";
|
|
2438
2457
|
var CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED = "thread_goal_cleared";
|
|
2439
2458
|
function createConversationTitleSummaryEvent(event) {
|
|
2440
|
-
return _object_spread$t({
|
|
2441
|
-
type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
|
|
2442
|
-
|
|
2459
|
+
return _object_spread_props$n(_object_spread$t({}, event), {
|
|
2460
|
+
type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY,
|
|
2461
|
+
presentation: "runtime"
|
|
2462
|
+
});
|
|
2443
2463
|
}
|
|
2444
2464
|
function createFollowUpConsumedEvent(event) {
|
|
2445
2465
|
return _object_spread$t({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/contracts",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.1",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@octokit/types": "13.10.0",
|
|
39
39
|
"@types/json-schema": "^7.0.15",
|
|
40
|
-
"@xpert-ai/chatkit-types": "~0.24.
|
|
40
|
+
"@xpert-ai/chatkit-types": "~0.24.1",
|
|
41
41
|
"zod-to-json-schema": "^3.25.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -9,8 +9,9 @@ export declare const CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED: "thread_goal_cleared";
|
|
|
9
9
|
export type TConversationTitleSummaryEvent = TChatEventMessage & {
|
|
10
10
|
id?: string;
|
|
11
11
|
type: typeof CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
|
|
12
|
+
presentation: 'runtime';
|
|
12
13
|
};
|
|
13
|
-
export declare function createConversationTitleSummaryEvent(event: Omit<TConversationTitleSummaryEvent, 'type'>): TConversationTitleSummaryEvent;
|
|
14
|
+
export declare function createConversationTitleSummaryEvent(event: Omit<TConversationTitleSummaryEvent, 'type' | 'presentation'>): TConversationTitleSummaryEvent;
|
|
14
15
|
export declare function createFollowUpConsumedEvent(event: Omit<TFollowUpConsumedEvent, 'type'>): TFollowUpConsumedEvent;
|
|
15
16
|
export declare function createThreadGoalUpdatedEvent(goal: IThreadGoal, updatedAt?: string | Date): TThreadGoalUpdatedEvent;
|
|
16
17
|
export declare function createThreadGoalClearedEvent(event: Omit<TThreadGoalClearedEvent, 'type' | 'updatedAt'> & {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TChatActivityPresentation } from '@xpert-ai/chatkit-types';
|
|
1
2
|
/** Provenance is descriptive, never an execution principal or an authorization grant. */
|
|
2
3
|
export type TChatMessageSource = {
|
|
3
4
|
type: 'user';
|
|
@@ -22,7 +23,7 @@ export type TChatMessageSource = {
|
|
|
22
23
|
taskId: string;
|
|
23
24
|
};
|
|
24
25
|
/** Presentation does not change model roles or remove input from execution/retry history. */
|
|
25
|
-
export type TChatMessagePresentation = 'message' |
|
|
26
|
+
export type TChatMessagePresentation = 'message' | TChatActivityPresentation;
|
|
26
27
|
/** Host-created provenance, persisted in ChatMessage.messageEnvelope. */
|
|
27
28
|
export interface TChatMessageEnvelope {
|
|
28
29
|
version: 1;
|
|
@@ -70,7 +70,7 @@ export interface IChatMessage extends IBasePerTenantAndOrganizationEntityModel,
|
|
|
70
70
|
/** Copied execution history is display-only and must not restore live tool sessions. */
|
|
71
71
|
historical?: boolean;
|
|
72
72
|
/** Owned snapshot for a branch whose original execution may later be deleted. */
|
|
73
|
-
historicalAgentRuns?: import('./
|
|
73
|
+
historicalAgentRuns?: import('./chat.model').TStoredChatAgentRuns | null;
|
|
74
74
|
/**
|
|
75
75
|
* @deprecated Chat attachments now use `fileAssets`. This field is kept only
|
|
76
76
|
* for historical messages that stored raw StorageFile handles.
|
package/src/ai/chat.model.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TChatConversationStatus } from './chat-activity.model';
|
|
2
2
|
export type { TChatConversationStatus, IChatConversationUnreadXpertSummary, IChatConversationUnreadSnapshot } from './chat-activity.model';
|
|
3
3
|
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
4
|
-
import { IXpertAgentExecution } from './xpert-agent-execution.model';
|
|
4
|
+
import { type TChatAgentRunSummary, IXpertAgentExecution } from './xpert-agent-execution.model';
|
|
5
5
|
import { IXpert } from './xpert.model';
|
|
6
6
|
import { I18nObject } from '../types';
|
|
7
7
|
import { CopilotChatMessage, CopilotMessageGroup, IChatMessage } from './chat-message.model';
|
|
@@ -12,7 +12,7 @@ import { IXpertTask } from './xpert-task.model';
|
|
|
12
12
|
import { TToolCall } from '../agent';
|
|
13
13
|
import { TInterrupt } from '../agent/interrupt';
|
|
14
14
|
import { IUser } from '../user.model';
|
|
15
|
-
import type { RuntimeCapabilitiesSelection } from '@xpert-ai/chatkit-types';
|
|
15
|
+
import type { RuntimeCapabilitiesSelection, TChatActivityPresentation } from '@xpert-ai/chatkit-types';
|
|
16
16
|
export type TChatConversationOptions = {
|
|
17
17
|
/** First Project binding is deferred until a human submits the application's setup App. */
|
|
18
18
|
projectCreation?: {
|
|
@@ -52,6 +52,15 @@ export type TChatCheckpointReference = {
|
|
|
52
52
|
checkpointNs: string;
|
|
53
53
|
checkpointId: string;
|
|
54
54
|
};
|
|
55
|
+
/** Version 1 contains only the executions visible in the transcript. */
|
|
56
|
+
export type TChatAgentRunSnapshot = {
|
|
57
|
+
version: 1;
|
|
58
|
+
runs: TChatAgentRunSummary[];
|
|
59
|
+
};
|
|
60
|
+
/** Unversioned branch snapshots may contain unclassified or explicitly marked executions. */
|
|
61
|
+
export type TStoredChatAgentRuns = TChatAgentRunSnapshot | (TChatAgentRunSummary & {
|
|
62
|
+
presentation?: TChatActivityPresentation;
|
|
63
|
+
})[];
|
|
55
64
|
export type TChatInputCheckpoint = {
|
|
56
65
|
version: 1;
|
|
57
66
|
checkpoint: TChatCheckpointReference | null;
|
|
@@ -77,7 +86,7 @@ export type TChatOutputCheckpoint = {
|
|
|
77
86
|
messagePathHash?: string;
|
|
78
87
|
/** Access must be checked again before linking these assets to a new conversation. */
|
|
79
88
|
fileAssetIds?: string[];
|
|
80
|
-
agentRuns?:
|
|
89
|
+
agentRuns?: TStoredChatAgentRuns;
|
|
81
90
|
};
|
|
82
91
|
/** Copy the source thread's ancestor path through afterMessageId, inclusive. */
|
|
83
92
|
export type TConversationBranchRequest = {
|
package/src/ai/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const STATE_VARIABLE_HUMAN = "human";
|
|
|
3
3
|
export * from './prompt-workflow-capabilities.model';
|
|
4
4
|
export { ChatMessageEventTypeEnum, ChatMessageStepCategory, ChatMessageTypeEnum } from './ai.model';
|
|
5
5
|
export type * from '@xpert-ai/chatkit-types';
|
|
6
|
+
export { hasRuntimePresentation, isRuntimeAgentExecution } from '@xpert-ai/chatkit-types';
|
|
6
7
|
export type { IconDefinition, IconType } from '../types';
|
|
7
8
|
export type { TChatRequest } from './xpert-chat.model';
|
|
8
9
|
export type { ProjectSelection } from './project-selection.model';
|
|
@@ -43,12 +43,12 @@ export declare const templateUpgradeInputSchema: z.ZodObject<{
|
|
|
43
43
|
revision?: string;
|
|
44
44
|
sourceHash?: string;
|
|
45
45
|
targetTemplateId?: string;
|
|
46
|
-
choices?: Partial<Record<"runtime" | "instructions" | "
|
|
46
|
+
choices?: Partial<Record<"runtime" | "instructions" | "definition" | "presentation", "replace" | "keep">>;
|
|
47
47
|
}, {
|
|
48
48
|
revision?: string;
|
|
49
49
|
sourceHash?: string;
|
|
50
50
|
targetTemplateId?: string;
|
|
51
|
-
choices?: Partial<Record<"runtime" | "instructions" | "
|
|
51
|
+
choices?: Partial<Record<"runtime" | "instructions" | "definition" | "presentation", "replace" | "keep">>;
|
|
52
52
|
}>;
|
|
53
53
|
export type TemplateUpgradeInput = z.output<typeof templateUpgradeInputSchema>;
|
|
54
54
|
export interface TemplateUpgradeSource {
|
|
@@ -6,6 +6,7 @@ import { TSensitiveOperation } from './chat.model';
|
|
|
6
6
|
import { WorkflowNodeTypeEnum } from './xpert-workflow.model';
|
|
7
7
|
import type { IModelUsageDetails } from './model-usage.model';
|
|
8
8
|
import type { TAvatar } from '../types';
|
|
9
|
+
import type { TChatActivityPresentation } from '@xpert-ai/chatkit-types';
|
|
9
10
|
export type TXpertExecution = {
|
|
10
11
|
category?: TXpertTeamNodeType;
|
|
11
12
|
type?: WorkflowNodeTypeEnum | string;
|
|
@@ -113,6 +114,8 @@ export declare enum XpertAgentExecutionStatusEnum {
|
|
|
113
114
|
INTERRUPTED = "interrupted"
|
|
114
115
|
}
|
|
115
116
|
export type TAgentExecutionMetadata = {
|
|
117
|
+
/** Runtime-only executions are omitted from the conversation transcript. */
|
|
118
|
+
presentation?: TChatActivityPresentation;
|
|
116
119
|
/** Host-created result continuation; its inbox claim proves the originating execution. */
|
|
117
120
|
runtimeContinuation?: {
|
|
118
121
|
/** Durable runtime inbox entry whose claim identifies this continuation and its source invocation. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { JSONValue } from './core.model';
|
|
2
|
+
import type { AnalyticsBinding, AnalyticsSourceSummary } from './analytics/analytics-query.model';
|
|
1
3
|
import type { AiModelTypeEnum } from './agent';
|
|
2
4
|
import type { ModelSelectionMetadata } from './ai/copilot-model.model';
|
|
3
5
|
import type { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
|
@@ -86,6 +88,81 @@ export interface PluginMarketplaceAppAssistantSuite {
|
|
|
86
88
|
/** Published in the same workspace without granting coordinator delegation. */
|
|
87
89
|
standaloneAssistants?: PluginMarketplaceAppAssistantDefinition[];
|
|
88
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Declares how an application obtains its analytics bindings from a model chosen during setup.
|
|
93
|
+
* The host matches each recipe to an analytics field by key. The provider interprets the recipe.
|
|
94
|
+
*/
|
|
95
|
+
export interface ApplicationAnalyticsSetup {
|
|
96
|
+
kind: 'connection-model';
|
|
97
|
+
providerId: string;
|
|
98
|
+
recipes: Record<string, JSONValue>;
|
|
99
|
+
/** The host passes this versioned bundle only to the registered provider, never to the renderer. */
|
|
100
|
+
bootstrap?: {
|
|
101
|
+
key: string;
|
|
102
|
+
version: string;
|
|
103
|
+
modes: Array<{
|
|
104
|
+
id: string;
|
|
105
|
+
label: I18nObject;
|
|
106
|
+
}>;
|
|
107
|
+
bundle: JSONValue;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Declares one choice an organization makes when configuring an application.
|
|
112
|
+
* The kind determines how the host collects and validates the value. Keep the key stable across
|
|
113
|
+
* versions so existing installations can still resolve their saved selections.
|
|
114
|
+
*/
|
|
115
|
+
export type ApplicationSetupField = {
|
|
116
|
+
kind: 'members';
|
|
117
|
+
key: string;
|
|
118
|
+
label: I18nObject;
|
|
119
|
+
optional?: boolean;
|
|
120
|
+
} | {
|
|
121
|
+
kind: 'analytics';
|
|
122
|
+
key: string;
|
|
123
|
+
label: I18nObject;
|
|
124
|
+
providerId: string;
|
|
125
|
+
requiredNumericFields?: string[];
|
|
126
|
+
};
|
|
127
|
+
/** An organization's saved configuration for one application, keyed by its declared setup fields. */
|
|
128
|
+
export interface OrganizationApplicationSettings {
|
|
129
|
+
/** Submit the revision read from the form so concurrent edits can be detected. Zero denotes an unsaved configuration. */
|
|
130
|
+
revision: number;
|
|
131
|
+
members: Record<string, string[]>;
|
|
132
|
+
queries: Record<string, AnalyticsBinding>;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Host response for initializing or editing an application in the current organization.
|
|
136
|
+
* It pairs saved values with the members and sources available to the caller. When model setup
|
|
137
|
+
* is offered, the client can also obtain query bindings by previewing a model.
|
|
138
|
+
*/
|
|
139
|
+
export interface OrganizationApplicationSetupForm {
|
|
140
|
+
modelSetup?: {
|
|
141
|
+
kind: 'connection-model';
|
|
142
|
+
bootstrap?: {
|
|
143
|
+
modes: Array<{
|
|
144
|
+
id: string;
|
|
145
|
+
label: I18nObject;
|
|
146
|
+
}>;
|
|
147
|
+
version: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
settings: OrganizationApplicationSettings;
|
|
151
|
+
users: Array<{
|
|
152
|
+
id: string;
|
|
153
|
+
label: string;
|
|
154
|
+
}>;
|
|
155
|
+
sources: AnalyticsSourceSummary[];
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Installation metadata a project plugin can use to resolve the coordinator, role Assistants
|
|
159
|
+
* and organization settings for its application. Callers still check access to each resource they use.
|
|
160
|
+
*/
|
|
161
|
+
export interface ProjectApplicationBindings {
|
|
162
|
+
coordinatorId: string;
|
|
163
|
+
roles: Record<string, string>;
|
|
164
|
+
settings: OrganizationApplicationSettings;
|
|
165
|
+
}
|
|
89
166
|
/**
|
|
90
167
|
* Declarative, host-owned initialization contract for a trusted plugin App.
|
|
91
168
|
* The host only executes this contract from a loaded plugin contribution.
|
|
@@ -102,6 +179,10 @@ export interface PluginMarketplaceAppConfig {
|
|
|
102
179
|
scope: PluginApplicationScope | PluginApplicationScope[];
|
|
103
180
|
assistantTemplateKey: string;
|
|
104
181
|
assistantSuite?: PluginMarketplaceAppAssistantSuite;
|
|
182
|
+
/** Fields the host presents when an organization initializes or edits this application. */
|
|
183
|
+
organizationSetup?: ApplicationSetupField[];
|
|
184
|
+
/** Optional model-based setup for the analytics fields declared in organizationSetup. */
|
|
185
|
+
analyticsSetup?: ApplicationAnalyticsSetup;
|
|
105
186
|
workspace: {
|
|
106
187
|
mode: 'dedicated';
|
|
107
188
|
name: string | I18nObject;
|
|
@@ -266,6 +347,8 @@ export interface PluginApplicationDetail {
|
|
|
266
347
|
* are derived exclusively from the authenticated request context.
|
|
267
348
|
*/
|
|
268
349
|
export interface PluginApplicationInitializeInput {
|
|
350
|
+
/** Selections from the organization's setup form, including the revision the caller edited. */
|
|
351
|
+
organizationSettings?: OrganizationApplicationSettings;
|
|
269
352
|
installationScope?: PluginApplicationScope;
|
|
270
353
|
pluginName: string;
|
|
271
354
|
appName: string;
|