@opencxh/domain 1.50.0 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/ai-message/types.d.ts +9 -5
- package/dist/entities/ai-profile/types.d.ts +2 -0
- package/dist/entities/mcp/index.d.ts +1 -0
- package/dist/entities/mcp/types.d.ts +12 -0
- package/dist/entities/shopify/index.d.ts +1 -0
- package/dist/entities/shopify/types.d.ts +68 -0
- package/dist/index.d.ts +3 -0
- package/dist/platform/ai-tools.d.ts +41 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ToolTraceEntry } from '../../platform/ai-tools';
|
|
1
2
|
export interface AIMessageInput {
|
|
2
3
|
text: string;
|
|
3
4
|
type: "text";
|
|
@@ -17,16 +18,19 @@ export interface AIMessage {
|
|
|
17
18
|
accountId?: string;
|
|
18
19
|
model?: string;
|
|
19
20
|
externalId?: string;
|
|
21
|
+
/** Tools the assistant invoked while producing this message (final, persisted trace). */
|
|
22
|
+
toolTrace?: ToolTraceEntry[];
|
|
20
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Profile-driven ask payload. The selected profile is the source of truth, so
|
|
26
|
+
* the client sends only `profileId`; the server resolves account/model/
|
|
27
|
+
* systemPrompt/enabledTools from it.
|
|
28
|
+
*/
|
|
21
29
|
export interface AIMessageAskPayload {
|
|
22
30
|
interactionId: string;
|
|
23
31
|
input: AIMessageInput;
|
|
24
|
-
|
|
25
|
-
accountId: string;
|
|
32
|
+
profileId: string;
|
|
26
33
|
previousExternalId?: string;
|
|
27
|
-
providerConfig?: Record<string, any>;
|
|
28
|
-
instructions?: string;
|
|
29
|
-
systemPrompt?: string;
|
|
30
34
|
context?: Record<string, any>;
|
|
31
35
|
}
|
|
32
36
|
export interface AIMessageAskResponse {
|
|
@@ -13,4 +13,6 @@ export interface AIProfile<T extends Record<string, any> = Record<string, any>>
|
|
|
13
13
|
systemPrompt: string;
|
|
14
14
|
contextIds?: string[];
|
|
15
15
|
predefinedPrompts?: PredefinedPrompt[];
|
|
16
|
+
/** Namespaced tool names this profile may use (default: none enabled). */
|
|
17
|
+
enabledTools?: string[];
|
|
16
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Configuration for an external MCP (Model Context Protocol) server, per organization. */
|
|
2
|
+
export interface McpServerConfig {
|
|
3
|
+
id: string;
|
|
4
|
+
organizationId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** Only Streamable HTTP transport is supported for server-side connections. */
|
|
7
|
+
transport: "http";
|
|
8
|
+
url: string;
|
|
9
|
+
/** Optional auth/extra headers sent on connect (e.g. `Authorization`). */
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shopify DTO's — gedeeld tussen de shopify-server (mapping uit Admin API),
|
|
3
|
+
* platform-api (typed client) en de frontend-tool. Geen Shopify-SDK-types
|
|
4
|
+
* lekken naar consumers; dit is de smalle, stabiele contractlaag.
|
|
5
|
+
*/
|
|
6
|
+
export interface ShopifyCustomer {
|
|
7
|
+
id: string;
|
|
8
|
+
firstName?: string;
|
|
9
|
+
lastName?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
phone?: string;
|
|
12
|
+
ordersCount?: number;
|
|
13
|
+
totalSpent?: string;
|
|
14
|
+
currency?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ShopifyLineItem {
|
|
17
|
+
title: string;
|
|
18
|
+
variantTitle?: string;
|
|
19
|
+
quantity: number;
|
|
20
|
+
price: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ShopifyTracking {
|
|
23
|
+
company?: string;
|
|
24
|
+
number?: string;
|
|
25
|
+
url?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ShopifyAddress {
|
|
28
|
+
name?: string;
|
|
29
|
+
address1?: string;
|
|
30
|
+
address2?: string;
|
|
31
|
+
zip?: string;
|
|
32
|
+
city?: string;
|
|
33
|
+
province?: string;
|
|
34
|
+
country?: string;
|
|
35
|
+
phone?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ShopifyOrder {
|
|
38
|
+
id: string;
|
|
39
|
+
/** Human order-name, bv. "#1001". */
|
|
40
|
+
name: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
financialStatus?: string;
|
|
43
|
+
fulfillmentStatus?: string;
|
|
44
|
+
totalPrice: string;
|
|
45
|
+
currency: string;
|
|
46
|
+
lineItems: ShopifyLineItem[];
|
|
47
|
+
shippingAddress?: ShopifyAddress;
|
|
48
|
+
tracking: ShopifyTracking[];
|
|
49
|
+
note?: string;
|
|
50
|
+
/** Deep-link naar de order in de Shopify-admin (nieuw tabblad). */
|
|
51
|
+
adminUrl: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ShopifyOrderEvent {
|
|
54
|
+
id: string;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
/** Mensvriendelijke omschrijving van het event. */
|
|
57
|
+
message: string;
|
|
58
|
+
/** Shopify "verb" (bv. "confirmed", "fulfilled", "sale"). */
|
|
59
|
+
verb?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ShopifyLookupResult {
|
|
62
|
+
/** False = geen verbonden/enabled shop voor deze org (admin moet koppelen). */
|
|
63
|
+
connected: boolean;
|
|
64
|
+
customer: ShopifyCustomer | null;
|
|
65
|
+
/** Deep-link naar de klant in de Shopify-admin. */
|
|
66
|
+
customerAdminUrl?: string;
|
|
67
|
+
orders: ShopifyOrder[];
|
|
68
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './entities/ai-account';
|
|
|
5
5
|
export * from './entities/ai-context';
|
|
6
6
|
export * from './entities/ai-message';
|
|
7
7
|
export * from './entities/ai-profile';
|
|
8
|
+
export * from './entities/mcp';
|
|
8
9
|
export * from './entities/channel';
|
|
9
10
|
export * from './entities/communication';
|
|
10
11
|
export * from './entities/contact';
|
|
@@ -15,8 +16,10 @@ export * from './entities/task';
|
|
|
15
16
|
export * from './entities/note';
|
|
16
17
|
export * from './entities/team';
|
|
17
18
|
export * from './entities/organization';
|
|
19
|
+
export * from './entities/shopify';
|
|
18
20
|
export * from './entities/transcript';
|
|
19
21
|
export * from './entities/user';
|
|
22
|
+
export * from './platform/ai-tools';
|
|
20
23
|
export * from './platform/api';
|
|
21
24
|
export * from './platform/common';
|
|
22
25
|
export * from './platform/capabilities';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-agnostic tool-use contracts for the AI assistant.
|
|
3
|
+
*
|
|
4
|
+
* A tool is described once in this neutral shape; each AI provider adapter
|
|
5
|
+
* translates it to/from its own native function-calling format. Tools can come
|
|
6
|
+
* from internal apps (via the "ai-tool" provider role) or external MCP servers —
|
|
7
|
+
* both surface through the same {@link AiTool} shape.
|
|
8
|
+
*/
|
|
9
|
+
/** JSON-Schema object describing a tool's arguments. */
|
|
10
|
+
export interface AiToolParameterSchema {
|
|
11
|
+
type: "object";
|
|
12
|
+
properties: Record<string, unknown>;
|
|
13
|
+
required?: string[];
|
|
14
|
+
}
|
|
15
|
+
/** A callable tool advertised to the model. */
|
|
16
|
+
export interface AiTool {
|
|
17
|
+
/** Namespaced, model-facing name, e.g. `kb__kb_search` or `mcp__<server>__<tool>`. */
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
parameters: AiToolParameterSchema;
|
|
21
|
+
}
|
|
22
|
+
/** A model's request to call a tool. */
|
|
23
|
+
export interface AiToolCall {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
arguments: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
/** The result of executing a tool call, fed back to the model. */
|
|
29
|
+
export interface AiToolResult {
|
|
30
|
+
id: string;
|
|
31
|
+
content: string;
|
|
32
|
+
isError?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Returned by an app's `GET /provider/ai-tools/describe`. */
|
|
35
|
+
export type AiToolDescriptor = AiTool;
|
|
36
|
+
/** One step in the assistant's tool-use trace, persisted on the message. */
|
|
37
|
+
export interface ToolTraceEntry {
|
|
38
|
+
call: AiToolCall;
|
|
39
|
+
state: "running" | "done" | "error";
|
|
40
|
+
result?: AiToolResult;
|
|
41
|
+
}
|