@opencxh/domain 1.82.0 → 1.84.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-conversation/index.d.ts +1 -0
- package/dist/entities/ai-conversation/types.d.ts +25 -0
- package/dist/entities/ai-message/types.d.ts +2 -2
- package/dist/entities/ai-profile/types.d.ts +13 -0
- package/dist/entities/contact/provider.d.ts +9 -0
- package/dist/entities/mcp/types.d.ts +79 -1
- package/dist/index.d.ts +2 -0
- package/dist/platform/communication.d.ts +7 -0
- package/dist/platform/context.d.ts +22 -0
- package/dist/platform/storage.d.ts +31 -11
- package/dist/platform/ui.d.ts +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type AIConversationVisibility = "shared" | "personal";
|
|
2
|
+
/**
|
|
3
|
+
* A single assistant conversation (thread). Grouped into the tools-panel tabs by
|
|
4
|
+
* `scopeKey`; messages, runs and thread-continuity key on the conversation id.
|
|
5
|
+
*
|
|
6
|
+
* - `shared` → tied to the scope, visible to everyone who may see that scope
|
|
7
|
+
* (e.g. the interaction's team). `ownerUserId` is unset.
|
|
8
|
+
* - `personal` → private to `ownerUserId`, even within a shared scope.
|
|
9
|
+
*
|
|
10
|
+
* The scope-owning app declares whether a scope's anchor conversation is shared.
|
|
11
|
+
*/
|
|
12
|
+
export interface AIConversation {
|
|
13
|
+
id: string;
|
|
14
|
+
organizationId: string;
|
|
15
|
+
/** "workspace:<userId>" | "interaction:<id>" | future kinds like "contact:<id>". */
|
|
16
|
+
scopeKey: string;
|
|
17
|
+
visibility: AIConversationVisibility;
|
|
18
|
+
/** Set when `visibility === "personal"`. */
|
|
19
|
+
ownerUserId?: string;
|
|
20
|
+
title: string;
|
|
21
|
+
/** "auto" = the scope-anchor conversation; "user" = opened via the + button. */
|
|
22
|
+
origin: "auto" | "user";
|
|
23
|
+
createdAt: number;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
}
|
|
@@ -10,7 +10,7 @@ export interface AIMessageOutput {
|
|
|
10
10
|
export interface AIMessage {
|
|
11
11
|
id: string;
|
|
12
12
|
organizationId: string;
|
|
13
|
-
|
|
13
|
+
conversationId: string;
|
|
14
14
|
sender: "user" | "assistant" | "system";
|
|
15
15
|
timestamp: number;
|
|
16
16
|
input: AIMessageInput;
|
|
@@ -27,7 +27,7 @@ export interface AIMessage {
|
|
|
27
27
|
* systemPrompt/enabledTools from it.
|
|
28
28
|
*/
|
|
29
29
|
export interface AIMessageAskPayload {
|
|
30
|
-
|
|
30
|
+
conversationId: string;
|
|
31
31
|
input: AIMessageInput;
|
|
32
32
|
profileId: string;
|
|
33
33
|
previousExternalId?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OwnerScope } from '../contact/types';
|
|
1
2
|
export interface PredefinedPrompt {
|
|
2
3
|
name: string;
|
|
3
4
|
prompt: string;
|
|
@@ -5,6 +6,12 @@ export interface PredefinedPrompt {
|
|
|
5
6
|
export interface AIProfile<T extends Record<string, any> = Record<string, any>> {
|
|
6
7
|
id: string;
|
|
7
8
|
organizationId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Who may use this profile. Company-wide (`org`) or bound to a `team`; profiles
|
|
11
|
+
* are never personal. Optional only during the migration window - the server
|
|
12
|
+
* defaults new profiles to `org` and backfills existing ones.
|
|
13
|
+
*/
|
|
14
|
+
ownerScope?: OwnerScope;
|
|
8
15
|
name: string;
|
|
9
16
|
description?: string;
|
|
10
17
|
accountId: string;
|
|
@@ -15,4 +22,10 @@ export interface AIProfile<T extends Record<string, any> = Record<string, any>>
|
|
|
15
22
|
predefinedPrompts?: PredefinedPrompt[];
|
|
16
23
|
/** Namespaced tool names this profile may use (default: none enabled). */
|
|
17
24
|
enabledTools?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Whether the acting user's PERSONAL MCP tools (their own per-user connections)
|
|
27
|
+
* are available on this profile, on top of the admin-curated `enabledTools`.
|
|
28
|
+
* "off" (default) = strictly the curated set; "allow" = also include personal.
|
|
29
|
+
*/
|
|
30
|
+
personalTools?: "off" | "allow";
|
|
18
31
|
}
|
|
@@ -4,6 +4,15 @@ export interface ContactSearchQuery {
|
|
|
4
4
|
text?: string;
|
|
5
5
|
scope?: OwnerScope[];
|
|
6
6
|
limit?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Channels whose identities the search should cover. The composer passes the
|
|
9
|
+
* one acting channel; the intent starter passes every channel the user can
|
|
10
|
+
* act as. Providers search each identity they own among these and merge —
|
|
11
|
+
* e.g. Microsoft searches the relevant people of every shared mailbox in the
|
|
12
|
+
* list. Order matters: providers may cap the fan-out, so pass most-relevant
|
|
13
|
+
* first.
|
|
14
|
+
*/
|
|
15
|
+
channelIds?: string[];
|
|
7
16
|
}
|
|
8
17
|
export interface ContactProvider {
|
|
9
18
|
id: string;
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/** How the AI server authenticates to an MCP server. */
|
|
2
|
+
export type McpAuthMode = "header" | "oauth";
|
|
3
|
+
/** Whether an OAuth-authenticated MCP server uses one shared org account or one per user. */
|
|
4
|
+
export type McpOAuthAccountScope = "user" | "org";
|
|
5
|
+
/**
|
|
6
|
+
* Client-facing OAuth view for an MCP server. Never carries the client secret
|
|
7
|
+
* or tokens — those live server-side (entity `oauth.client` / ManagedAccount).
|
|
8
|
+
*/
|
|
9
|
+
export interface McpOAuthClientView {
|
|
10
|
+
scope: McpOAuthAccountScope;
|
|
11
|
+
/** Requested scopes (optional override of discovered/default scopes). */
|
|
12
|
+
scopes?: string[];
|
|
13
|
+
/** OAuth client_id (manual config or Dynamic Client Registration result). Not secret. */
|
|
14
|
+
clientId?: string;
|
|
15
|
+
/** True when a manual client secret is stored (masked; never sent raw). */
|
|
16
|
+
hasClientSecret?: boolean;
|
|
17
|
+
/** True when an account exists for the relevant scope/user. */
|
|
18
|
+
connected?: boolean;
|
|
19
|
+
/** Health of that account: "connected" (usable), or needs re-auth ("expired"/"error"). */
|
|
20
|
+
status?: "connected" | "expired" | "error";
|
|
21
|
+
}
|
|
1
22
|
/** Configuration for an external MCP (Model Context Protocol) server, per organization. */
|
|
2
23
|
export interface McpServerConfig {
|
|
3
24
|
id: string;
|
|
@@ -6,7 +27,64 @@ export interface McpServerConfig {
|
|
|
6
27
|
/** Only Streamable HTTP transport is supported for server-side connections. */
|
|
7
28
|
transport: "http";
|
|
8
29
|
url: string;
|
|
9
|
-
/** Optional auth/extra headers sent on connect (e.g. `Authorization`). */
|
|
30
|
+
/** Optional auth/extra headers sent on connect (e.g. `Authorization`). Header-mode only. */
|
|
10
31
|
headers?: Record<string, string>;
|
|
11
32
|
enabled: boolean;
|
|
33
|
+
/** How we authenticate to this server. Defaults to "header" for back-compat. */
|
|
34
|
+
authMode?: McpAuthMode;
|
|
35
|
+
/** OAuth settings, present when `authMode === "oauth"`. */
|
|
36
|
+
oauth?: McpOAuthClientView;
|
|
37
|
+
/**
|
|
38
|
+
* Owner of this server DEFINITION: absent/null = org-defined (admin-managed),
|
|
39
|
+
* set = a user's own custom personal server. Governs who may edit/delete it and
|
|
40
|
+
* where it is visible; orthogonal to `oauth.scope` (which is about credentials).
|
|
41
|
+
*/
|
|
42
|
+
ownerUserId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Org-defined servers only: users may connect this personally (the "catalog").
|
|
45
|
+
* Only meaningful together with `oauth.scope === "user"`.
|
|
46
|
+
*/
|
|
47
|
+
personalConnect?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Write-only OAuth fields accepted by create/update (not part of the read view).
|
|
51
|
+
* `clientSecret` is masked on read, mirroring the header-secret pattern.
|
|
52
|
+
*/
|
|
53
|
+
export interface McpServerOAuthInput {
|
|
54
|
+
scope?: McpOAuthAccountScope;
|
|
55
|
+
scopes?: string[];
|
|
56
|
+
clientId?: string;
|
|
57
|
+
clientSecret?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A curated, platform-maintained connector template shown in the admin "add from
|
|
61
|
+
* catalog" picker. Selecting one pre-fills the create endpoint (no secrets - these
|
|
62
|
+
* providers support Dynamic Client Registration). Not persisted; served read-only.
|
|
63
|
+
*/
|
|
64
|
+
export interface McpCatalogEntry {
|
|
65
|
+
key: string;
|
|
66
|
+
name: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
/** Grouping label for the catalog picker (e.g. "Project management"). */
|
|
69
|
+
category?: string;
|
|
70
|
+
iconUrl?: string;
|
|
71
|
+
docsUrl?: string;
|
|
72
|
+
url: string;
|
|
73
|
+
authMode: McpAuthMode;
|
|
74
|
+
oauth?: {
|
|
75
|
+
scope?: McpOAuthAccountScope;
|
|
76
|
+
scopes?: string[];
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** Body accepted by the create/update endpoints (write shape, distinct from the read view). */
|
|
80
|
+
export interface McpServerInput {
|
|
81
|
+
name?: string;
|
|
82
|
+
url?: string;
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
/** Header-mode secrets; masked values mean "unchanged". */
|
|
85
|
+
headers?: Record<string, string>;
|
|
86
|
+
authMode?: McpAuthMode;
|
|
87
|
+
oauth?: McpServerOAuthInput;
|
|
88
|
+
/** Org-defined servers: mark as personally connectable (catalog membership). */
|
|
89
|
+
personalConnect?: boolean;
|
|
12
90
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './entities/kb';
|
|
|
3
3
|
export * from './entities/topic';
|
|
4
4
|
export * from './entities/ai-account';
|
|
5
5
|
export * from './entities/ai-context';
|
|
6
|
+
export * from './entities/ai-conversation';
|
|
6
7
|
export * from './entities/ai-message';
|
|
7
8
|
export * from './entities/ai-profile';
|
|
8
9
|
export * from './entities/mcp';
|
|
@@ -24,6 +25,7 @@ export * from './platform/ai-tools';
|
|
|
24
25
|
export * from './platform/api';
|
|
25
26
|
export * from './platform/common';
|
|
26
27
|
export * from './platform/capabilities';
|
|
28
|
+
export * from './platform/context';
|
|
27
29
|
export * from './platform/communication';
|
|
28
30
|
export * from './platform/federated';
|
|
29
31
|
export * from './platform/intents';
|
|
@@ -5,6 +5,13 @@ export interface Session {
|
|
|
5
5
|
providerId: string;
|
|
6
6
|
direction: 'inbound' | 'outbound';
|
|
7
7
|
remoteIdentity: string;
|
|
8
|
+
/**
|
|
9
|
+
* Number of remote participants, when the provider can report it. Used by
|
|
10
|
+
* transcript labeling: with more than one remote party the audio is a single
|
|
11
|
+
* mixed stream, so `remoteIdentity` can't be trusted to name the speaker and
|
|
12
|
+
* the label falls back to a generic one. Absent/1 = single remote party.
|
|
13
|
+
*/
|
|
14
|
+
remoteParticipantCount?: number;
|
|
8
15
|
state: SessionState;
|
|
9
16
|
startTime?: number;
|
|
10
17
|
hasVideo: boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host context resolved for the tools-panel. Any app can contribute one via the
|
|
3
|
+
* `context.collect` service; the shell picks the highest-priority non-null claim
|
|
4
|
+
* for the current route and falls back to `{ kind: "global", scopeKey:
|
|
5
|
+
* "workspace:<userId>" }` when no app claims it.
|
|
6
|
+
*
|
|
7
|
+
* `kind` drives tool visibility (`ExtensionConfig.contexts`); `scopeKey` groups
|
|
8
|
+
* the assistant's conversations; `shared` marks the scope's anchor conversation
|
|
9
|
+
* as team-shared.
|
|
10
|
+
*/
|
|
11
|
+
export interface HostContext {
|
|
12
|
+
kind: string;
|
|
13
|
+
scopeKey: string;
|
|
14
|
+
/** The scope's anchor conversation is shared with everyone who may see the scope. */
|
|
15
|
+
shared?: boolean;
|
|
16
|
+
/** Default title for the anchor conversation. */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Highest wins when multiple apps claim the same route. */
|
|
19
|
+
priority?: number;
|
|
20
|
+
/** Extra data providers attach (e.g. interaction, activities, transcripts). */
|
|
21
|
+
slices?: Record<string, unknown>;
|
|
22
|
+
}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
+
import { OwnerScope } from '../entities/contact/types';
|
|
2
|
+
/**
|
|
3
|
+
* A virtual folder: a named, scoped root that binds to a storage backend
|
|
4
|
+
* (a StorageAccount on a storage provider) at a base path. Its `ownerScope`
|
|
5
|
+
* decides who can see and use it (personal / team / org). Files live inside it.
|
|
6
|
+
*
|
|
7
|
+
* Kept named `VirtualMount` for continuity with existing consumers (ui-kit
|
|
8
|
+
* StorageInput, platform-api); surfaced to users as a "folder".
|
|
9
|
+
*/
|
|
1
10
|
export interface VirtualMount {
|
|
2
11
|
id: string;
|
|
12
|
+
organizationId?: string;
|
|
3
13
|
name: string;
|
|
14
|
+
/** Storage provider id (e.g. base64("s3:storage")). */
|
|
4
15
|
providerId: string;
|
|
16
|
+
/** StorageAccount id backing this folder. Falls back to the provider default when omitted. */
|
|
17
|
+
accountId?: string;
|
|
5
18
|
basePath: string;
|
|
6
|
-
|
|
19
|
+
/** Who may see and use this folder. */
|
|
20
|
+
ownerScope: OwnerScope;
|
|
7
21
|
metadata?: Record<string, any>;
|
|
22
|
+
createdAt?: number;
|
|
23
|
+
updatedAt?: number;
|
|
8
24
|
}
|
|
9
25
|
export interface FilePointer {
|
|
10
26
|
id: string;
|
|
@@ -19,15 +35,19 @@ export interface FilePointer {
|
|
|
19
35
|
createdAt?: number;
|
|
20
36
|
tags?: string[];
|
|
21
37
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export interface FilePolicy {
|
|
38
|
+
/**
|
|
39
|
+
* A linked storage backend account (credentials to an S3 bucket, an FTP host, …).
|
|
40
|
+
* Backed by the canonical ManagedAccount store, mirroring the AI app's account
|
|
41
|
+
* pattern. Secrets never reach the UI — this is the public view.
|
|
42
|
+
*/
|
|
43
|
+
export interface StorageAccount {
|
|
30
44
|
id: string;
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
organizationId: string;
|
|
46
|
+
/** Account-provider id, e.g. base64("s3:account"). */
|
|
47
|
+
providerId: string;
|
|
48
|
+
displayName: string;
|
|
49
|
+
/** Whether this is the org's default account for its provider. */
|
|
50
|
+
isDefault?: boolean;
|
|
51
|
+
/** Provider-specific, non-secret fields (region, bucket, basePath, …). */
|
|
52
|
+
metadata?: Record<string, any>;
|
|
33
53
|
}
|
package/dist/platform/ui.d.ts
CHANGED
|
@@ -57,7 +57,11 @@ export interface ToastConfig {
|
|
|
57
57
|
variant?: 'primary' | 'secondary';
|
|
58
58
|
}[];
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Well-known context kinds, kept for autocomplete; any app may declare its own
|
|
62
|
+
* kind (e.g. "contact") via a context provider, so the type stays open.
|
|
63
|
+
*/
|
|
64
|
+
export type ExtensionContext = 'global' | 'call' | 'interaction' | (string & {});
|
|
61
65
|
export interface ExtensionConfig {
|
|
62
66
|
id: string;
|
|
63
67
|
slot: string;
|