@opencxh/domain 1.131.0 → 1.133.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/activity/blocks.d.ts +109 -0
- package/dist/entities/activity/blocks.test.d.ts +1 -0
- package/dist/entities/activity/catalog.d.ts +123 -0
- package/dist/entities/activity/catalog.test.d.ts +1 -0
- package/dist/entities/activity/descriptor.d.ts +88 -0
- package/dist/entities/activity/descriptor.test.d.ts +1 -0
- package/dist/entities/activity/index.d.ts +4 -0
- package/dist/entities/activity/preview.d.ts +13 -2
- package/dist/entities/activity/resolve.d.ts +64 -0
- package/dist/entities/interaction/types.d.ts +19 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +837 -347
- package/dist/platform/sdk.d.ts +8 -1
- package/package.json +1 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ActivityText } from './descriptor';
|
|
2
|
+
/**
|
|
3
|
+
* De blokken waaruit een gedeclareerde tijdlijnrij is opgebouwd.
|
|
4
|
+
*
|
|
5
|
+
* Geleend van Slack's Block Kit: dezelfde namen en dezelfde grammatica, zodat iemand die
|
|
6
|
+
* ooit een Slack-app bouwde ze herkent — en wij schrijven Block Kit zelf al
|
|
7
|
+
* (`apps/slack/server/src/thread/context-blocks.ts`). Maar niet de hele catalogus: Block
|
|
8
|
+
* Kit telt inmiddels 21 bloktypes, waarvan de invoervelden-helft een compleet
|
|
9
|
+
* formuliersysteem is dat we al hebben in `ui-kit`'s `Form`.
|
|
10
|
+
*
|
|
11
|
+
* De scheiding die dat mogelijk maakt: **de blokken beschrijven de binnenkant van de rij,
|
|
12
|
+
* de descriptor-semantiek de buitenkant.** Uitlijning op `direction`, de avatar, de
|
|
13
|
+
* groepering van opeenvolgende bubbels en de tijdstempel blijven van de host — Block Kit
|
|
14
|
+
* kent die begrippen niet, want daar is een bericht een losstaande kaart.
|
|
15
|
+
*/
|
|
16
|
+
/** Semantische kleur. Geen vrije kleuren, zodat dark mode en de tokens blijven kloppen. */
|
|
17
|
+
export type ActivityTone = "info" | "success" | "warning" | "destructive";
|
|
18
|
+
export interface ActivityBadge {
|
|
19
|
+
text: ActivityText;
|
|
20
|
+
tone?: ActivityTone;
|
|
21
|
+
}
|
|
22
|
+
export interface ActivityAction {
|
|
23
|
+
/** Stabiel binnen de rij; routeert de klik en laat de host één knop hertekenen. */
|
|
24
|
+
action_id: string;
|
|
25
|
+
text: ActivityText;
|
|
26
|
+
/**
|
|
27
|
+
* De route waar de klik heen gaat, `"<app>.<scope>.<route>"`.
|
|
28
|
+
*
|
|
29
|
+
* Let op: `sdk.http.invoke` maakt van elke `.` een URL-`/`. Een id met punten hoort dus
|
|
30
|
+
* in {@link params} en niet in de action zelf.
|
|
31
|
+
*/
|
|
32
|
+
invoke: string;
|
|
33
|
+
/** Paden in de activity; de host leest ze uit en stuurt ze als body mee. */
|
|
34
|
+
params?: Record<string, string>;
|
|
35
|
+
style?: "primary" | "secondary" | "destructive";
|
|
36
|
+
}
|
|
37
|
+
export interface ActivityListItem {
|
|
38
|
+
text: ActivityText;
|
|
39
|
+
subtext?: ActivityText;
|
|
40
|
+
accessory?: ActivityBadge;
|
|
41
|
+
}
|
|
42
|
+
export type ActivityBlock = {
|
|
43
|
+
block_id?: string;
|
|
44
|
+
type: "header";
|
|
45
|
+
text: ActivityText;
|
|
46
|
+
subtitle?: ActivityText;
|
|
47
|
+
} | {
|
|
48
|
+
block_id?: string;
|
|
49
|
+
type: "section";
|
|
50
|
+
text?: ActivityText;
|
|
51
|
+
/** Tweekoloms sleutel/waarde. */
|
|
52
|
+
fields?: {
|
|
53
|
+
label: ActivityText;
|
|
54
|
+
value: ActivityText;
|
|
55
|
+
}[];
|
|
56
|
+
/** Het rechterslot. Voorlopig alleen een badge — een knop hoort in `actions`. */
|
|
57
|
+
accessory?: ActivityBadge;
|
|
58
|
+
} | {
|
|
59
|
+
block_id?: string;
|
|
60
|
+
type: "context";
|
|
61
|
+
text: ActivityText;
|
|
62
|
+
icon?: string;
|
|
63
|
+
} | {
|
|
64
|
+
block_id?: string;
|
|
65
|
+
type: "divider";
|
|
66
|
+
} | {
|
|
67
|
+
block_id?: string;
|
|
68
|
+
type: "image";
|
|
69
|
+
url: string;
|
|
70
|
+
alt: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Een rij per item. Kwam erbij door `ProposedActionCard` om te zetten: die toont een
|
|
74
|
+
* regel per voorgestelde actie, en `section.fields` is een rooster dat dat niet kan.
|
|
75
|
+
* Ticketregels en orderregels lopen op hetzelfde aan.
|
|
76
|
+
*/
|
|
77
|
+
| {
|
|
78
|
+
block_id?: string;
|
|
79
|
+
type: "list";
|
|
80
|
+
items: ActivityListItem[];
|
|
81
|
+
} | {
|
|
82
|
+
block_id?: string;
|
|
83
|
+
type: "actions";
|
|
84
|
+
elements: ActivityAction[];
|
|
85
|
+
}
|
|
86
|
+
/** Alleen aanzetten; de host tekent `activity.attachments` en regelt het downloaden. */
|
|
87
|
+
| {
|
|
88
|
+
block_id?: string;
|
|
89
|
+
type: "attachments";
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Een tijdlijnrij van vijftig blokken breekt de feed. Slack hanteert 50 per bericht; een
|
|
93
|
+
* rij in een lijst verdraagt minder, want hij staat tussen tientallen andere.
|
|
94
|
+
*/
|
|
95
|
+
export declare const MAX_BLOCKS = 10;
|
|
96
|
+
export declare const MAX_FIELDS = 10;
|
|
97
|
+
export declare const MAX_LIST_ITEMS = 10;
|
|
98
|
+
export declare const MAX_ACTIONS = 5;
|
|
99
|
+
/**
|
|
100
|
+
* Snoeit een gedeclareerde blokkenlijst tot iets wat de feed veilig kan tekenen.
|
|
101
|
+
*
|
|
102
|
+
* Weigeren en niet afkappen zou de hele rij laten verdwijnen om één slecht blok; dit laat
|
|
103
|
+
* de rest staan. Draait bij het samenstellen van de catalogus, zodat een verkeerde
|
|
104
|
+
* declaratie één keer gemeld wordt in plaats van bij elke render.
|
|
105
|
+
*
|
|
106
|
+
* `onDrop` krijgt te horen wat er wegviel — stil snoeien maakt "waarom staat mijn knop er
|
|
107
|
+
* niet?" onbeantwoordbaar.
|
|
108
|
+
*/
|
|
109
|
+
export declare function normalizeBlocks(blocks: unknown, onDrop?: (reason: string) => void): ActivityBlock[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Activity, ActivityType } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Eén plek die beschrijft wat een activity-type *betekent* en hoe het als tekst leest.
|
|
4
|
+
*
|
|
5
|
+
* Waarom dit bestaat: dezelfde vraag stond zes keer los in de codebase — "is dit een echt
|
|
6
|
+
* bericht?" in `summarize`, in `lastMessagePreview`, in `attentionScore`, in
|
|
7
|
+
* `reply-to-interaction`, in de analytics-rollup en in de playbook-dry-run, elke keer met
|
|
8
|
+
* nét een andere lijst. Een nieuw type moest dus op zes plekken worden bijgeschreven, en
|
|
9
|
+
* een vergeten plek faalt *stil*: het type verdwijnt uit de focus-score of uit de
|
|
10
|
+
* analytics zonder dat er iets kapotgaat.
|
|
11
|
+
*
|
|
12
|
+
* Daarnaast werd de kanaalsoort geraden uit het type-voorvoegsel (`startsWith("EMAIL")`),
|
|
13
|
+
* op de server én — als losse regex — in de playbook-editor.
|
|
14
|
+
*
|
|
15
|
+
* Deze catalogus is bewust een platte declaratie en geen gedragslaag: hij beantwoordt
|
|
16
|
+
* vragen over een type, hij voert niets uit. De tekstfuncties zijn letterlijk verplaatst
|
|
17
|
+
* uit `preview.ts` en `TimelineEvent.tsx`, niet herschreven — de uitvoer is byte-identiek.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Wat voor soort ding is dit op de tijdlijn?
|
|
21
|
+
*
|
|
22
|
+
* - `message` — een bericht van of aan de tegenpartij, met een leesbare body.
|
|
23
|
+
* - `note` — interne tekst, zichtbaar voor collega's maar niet voor de tegenpartij.
|
|
24
|
+
* - `artifact` — meegeleverde inhoud die geen bericht is (bestand, transcript).
|
|
25
|
+
* - `event` — een gebeurtenis zonder eigen inhoud (gesprek gestart, status gewijzigd).
|
|
26
|
+
*/
|
|
27
|
+
export type ActivityShape = "message" | "note" | "artifact" | "event";
|
|
28
|
+
/** Kanaalsoort, voorheen geraden uit het type-voorvoegsel. */
|
|
29
|
+
export type ActivityChannelKind = "mail" | "chat" | "voice" | "video";
|
|
30
|
+
/** De arm van de `Activity`-union die bij precies dit type hoort. */
|
|
31
|
+
type ActivityOf<T extends ActivityType> = Extract<Activity, {
|
|
32
|
+
type: T;
|
|
33
|
+
}>;
|
|
34
|
+
interface ActivityTypeInfo<T extends ActivityType = ActivityType> {
|
|
35
|
+
shape: ActivityShape;
|
|
36
|
+
channelKind?: ActivityChannelKind;
|
|
37
|
+
/** Lucide-icoonnaam, gedeeld door web en mobiel. */
|
|
38
|
+
icon: string;
|
|
39
|
+
/**
|
|
40
|
+
* Kan een mens hierop antwoorden? Een interne notitie draagt wél tekst maar is geen
|
|
41
|
+
* antwoordbaar bericht — daarom een eigen vlag en niet afgeleid van `shape`.
|
|
42
|
+
*/
|
|
43
|
+
replyable?: boolean;
|
|
44
|
+
/** Telt mee als in-/uitgaand bericht in de analytics-rollup. */
|
|
45
|
+
countsAs?: "inbound_message" | "outbound_message";
|
|
46
|
+
/**
|
|
47
|
+
* Draagt dit type door mensen geschreven tekst die de moeite waard is om aan een model
|
|
48
|
+
* te voeren? Ruimer dan `shape === "message"`: een transcript is een artifact maar wel
|
|
49
|
+
* leesbare inhoud.
|
|
50
|
+
*/
|
|
51
|
+
carriesText?: boolean;
|
|
52
|
+
/** Door de engine zelf geschreven; mag geen nieuwe playbook-run openen. */
|
|
53
|
+
playbookAuthored?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Verschijnt in de trigger-keuzelijst van playbooks en webhooks.
|
|
56
|
+
*
|
|
57
|
+
* Niet elk type is een zinnig startsignaal: op "gesprek in de wacht" wil niemand een
|
|
58
|
+
* playbook hangen. Dit zijn exact de vijf die de builder tot nu toe hardcodeerde, nu op
|
|
59
|
+
* de plek waar een app zijn eigen type er ook aan toe kan voegen.
|
|
60
|
+
*/
|
|
61
|
+
triggerable?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Vertaalsleutel voor de naam in een keuzelijst. Alleen nodig zodra een type
|
|
64
|
+
* {@link triggerable} is — pas dan moet iemand het bij naam kunnen kiezen.
|
|
65
|
+
*/
|
|
66
|
+
displayNameKey?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Eigen component voor de feed, als `"<app>:<Resource>"`.
|
|
69
|
+
*
|
|
70
|
+
* Bewust hetzelfde veld dat een externe app straks in zijn descriptor zet: onze eigen
|
|
71
|
+
* rijke types (mail, chat, notitie, ...) lopen daarmee door precies dezelfde resolver
|
|
72
|
+
* als een helpdesk-app die `helpdesk:TicketActivity` meebrengt. Zou dit een aparte
|
|
73
|
+
* lijst in de comms-app zijn, dan zou dat pad alleen door vreemde apps gedragen worden
|
|
74
|
+
* en zouden de gaten erin pas bij de eerste externe bouwer opvallen.
|
|
75
|
+
*
|
|
76
|
+
* Spiegelt `TransportConfig.ui.canvas`, dat op dezelfde manier naar
|
|
77
|
+
* `communication:CallCanvas` wijst.
|
|
78
|
+
*/
|
|
79
|
+
component?: `${string}:${string}`;
|
|
80
|
+
/** Regel voor de inboxlijst. Verplaatst uit `preview.ts`. */
|
|
81
|
+
snippet?: (activity: ActivityOf<T>) => string;
|
|
82
|
+
/** Regel voor de tijdlijn. Verplaatst uit `TimelineEvent.tsx`. */
|
|
83
|
+
timeline?: (activity: ActivityOf<T>, authorName: string) => string;
|
|
84
|
+
/** Deelnameknop op de tijdlijnregel. Verplaatst uit `TimelineEvent.tsx`. */
|
|
85
|
+
joinUrl?: (activity: ActivityOf<T>) => string | undefined;
|
|
86
|
+
}
|
|
87
|
+
export declare function stripHtml(input: string): string;
|
|
88
|
+
type Catalog = {
|
|
89
|
+
[T in ActivityType]: ActivityTypeInfo<T>;
|
|
90
|
+
};
|
|
91
|
+
export declare const ACTIVITY_CATALOG: Catalog;
|
|
92
|
+
/** Onbekende types (van een app die zijn type nog niet declareert) geven `undefined`. */
|
|
93
|
+
export declare function activityTypeInfo(type: string): ActivityTypeInfo | undefined;
|
|
94
|
+
/** Lucide-icoonnaam; `circle` voor onbekende types. */
|
|
95
|
+
export declare function activityIconOf(type: string): string;
|
|
96
|
+
/** `mail` | `chat` | `voice` | `video`, of `undefined` voor een levenscyclus-event. */
|
|
97
|
+
export declare function channelKindOf(type: string): ActivityChannelKind | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Draagt dit type een bericht of een interne notitie — iets wat een mens schreef en wat
|
|
100
|
+
* als "het gesprek" telt? Sluit transcripten uit; die zijn wel tekst, maar geen bericht.
|
|
101
|
+
*/
|
|
102
|
+
export declare function isMessageType(type: string): boolean;
|
|
103
|
+
/** Kan een mens hierop antwoorden? Notities niet — die gaan nergens heen. */
|
|
104
|
+
export declare function isReplyableType(type: string): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Leesbare inhoud voor een model: berichten, notities én transcripten. Ruimer dan
|
|
107
|
+
* {@link isMessageType}, en dat verschil is opzettelijk — zie de dry-run van playbooks.
|
|
108
|
+
*/
|
|
109
|
+
export declare function carriesText(type: string): boolean;
|
|
110
|
+
/** Telt mee als in- of uitgaand bericht in de analytics-rollup. */
|
|
111
|
+
export declare function messageCountsAs(type: string): "inbound_message" | "outbound_message" | undefined;
|
|
112
|
+
/** Door de playbook-engine zelf geschreven; mag geen nieuwe run openen. */
|
|
113
|
+
export declare function isPlaybookAuthoredType(type: string): boolean;
|
|
114
|
+
/** De inboxlijst-regel, of `""` wanneer het type er geen heeft. */
|
|
115
|
+
export declare function activitySnippet(activity: Activity): string;
|
|
116
|
+
/**
|
|
117
|
+
* De tijdlijnregel. Valt terug op het ontstreepte type — precies wat de feed vandaag doet
|
|
118
|
+
* voor elk type zonder eigen tekst.
|
|
119
|
+
*/
|
|
120
|
+
export declare function activityTimelineText(activity: Activity, authorName: string): string;
|
|
121
|
+
/** Deelnamelink op de tijdlijnregel, wanneer het type er een draagt. */
|
|
122
|
+
export declare function activityJoinUrl(activity: Activity): string | undefined;
|
|
123
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { LocaleBundle } from '../analytics/dashboard';
|
|
2
|
+
import { ActivityBlock } from './blocks';
|
|
3
|
+
import { ActivityChannelKind, ActivityShape } from './catalog';
|
|
4
|
+
/**
|
|
5
|
+
* Wat een app over zijn eigen activity-soort declareert.
|
|
6
|
+
*
|
|
7
|
+
* Dit is de JSON-tegenhanger van `ActivityTypeInfo`: dezelfde vragen, maar over de draad.
|
|
8
|
+
* Waar de ingebouwde catalogus functies gebruikt voor zijn teksten, gebruikt een
|
|
9
|
+
* gedeclareerd type een vertaalsleutel plus parameters — een functie overleeft geen
|
|
10
|
+
* HTTP-hop, en een letterlijke zin is niet te vertalen.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Een stuk tekst in een descriptor.
|
|
14
|
+
*
|
|
15
|
+
* Twee vormen, omdat er twee soorten tekst zijn:
|
|
16
|
+
*
|
|
17
|
+
* - **chrome** — door de app geschreven ("Ticket #{number} aangemaakt"). Vertaalbaar, dus
|
|
18
|
+
* een sleutel met parameters. De plaatshouders staan ín de vertaalde zin, zodat de
|
|
19
|
+
* woordvolgorde per taal mag verschillen; zou je de tekst eromheen plakken, dan is dat
|
|
20
|
+
* precies wat er stukgaat.
|
|
21
|
+
* - **data** — door een mens getypt (het onderwerp van het ticket). Valt niets te
|
|
22
|
+
* vertalen, dus een pad naar de waarde in de activity.
|
|
23
|
+
*
|
|
24
|
+
* `format` bepaalt of de weergave de tekst als platte tekst neemt of door de rijke
|
|
25
|
+
* renderer haalt. Nooit geraden: het staat op het tekstobject zelf.
|
|
26
|
+
*/
|
|
27
|
+
export type ActivityText = string | {
|
|
28
|
+
key: string;
|
|
29
|
+
params?: Record<string, string>;
|
|
30
|
+
format?: "plain" | "rich";
|
|
31
|
+
} | {
|
|
32
|
+
value: string;
|
|
33
|
+
format?: "plain" | "rich";
|
|
34
|
+
};
|
|
35
|
+
export interface ActivityTypeDescriptor {
|
|
36
|
+
/** Plat en app-geprefixt, bv. `HELPDESK_TICKET_ADDED`. */
|
|
37
|
+
type: string;
|
|
38
|
+
/** Vertaalsleutel voor de naam van dit type (keuzelijsten, filters). */
|
|
39
|
+
displayNameKey: string;
|
|
40
|
+
/** Lucide-icoonnaam; werkt op web en native. */
|
|
41
|
+
icon?: string;
|
|
42
|
+
shape: ActivityShape;
|
|
43
|
+
channelKind?: ActivityChannelKind;
|
|
44
|
+
replyable?: boolean;
|
|
45
|
+
countsAs?: "inbound_message" | "outbound_message";
|
|
46
|
+
carriesText?: boolean;
|
|
47
|
+
/** Verschijnt in de trigger-keuzelijst van playbooks en webhooks. */
|
|
48
|
+
triggerable?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* De regel voor de inboxlijst, de zoekindex en de assistent. **Altijd platte tekst**,
|
|
51
|
+
* los van hoe de rij eruitziet: opmaak hier lekt naar plekken die geen opmaak kunnen.
|
|
52
|
+
*/
|
|
53
|
+
text?: ActivityText;
|
|
54
|
+
/**
|
|
55
|
+
* Declaratieve blokken voor de feed. Rendert op web én mobiel, want er komt geen bundel
|
|
56
|
+
* aan te pas — en de host houdt de uitlijning, de avatar en de tijdstempel.
|
|
57
|
+
*/
|
|
58
|
+
render?: ActivityBlock[];
|
|
59
|
+
/**
|
|
60
|
+
* Eigen component voor de feed, `"<app>:<Resource>"`. **Alleen web**: op native bestaat
|
|
61
|
+
* geen module federation, dus daar zakt de rij terug naar {@link render} of {@link text}.
|
|
62
|
+
*/
|
|
63
|
+
component?: `${string}:${string}`;
|
|
64
|
+
}
|
|
65
|
+
/** Wat de comms-app aan de client teruggeeft: de gedeclareerde types plus hun vertalingen. */
|
|
66
|
+
export interface ActivityTypeCatalog {
|
|
67
|
+
types: ActivityTypeDescriptor[];
|
|
68
|
+
locales: LocaleBundle;
|
|
69
|
+
}
|
|
70
|
+
/** Wat een `activity-source` op `GET /provider/activity-types/describe` teruggeeft. */
|
|
71
|
+
export interface ActivityTypeSourceDescription {
|
|
72
|
+
types: ActivityTypeDescriptor[];
|
|
73
|
+
locales?: LocaleBundle;
|
|
74
|
+
}
|
|
75
|
+
/** Leest `payload.number` / `author.name` uit een object; geeft "" als het pad niet bestaat. */
|
|
76
|
+
export declare function readPath(source: unknown, path: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Lost een `ActivityText` op tegen een activity.
|
|
79
|
+
*
|
|
80
|
+
* Geeft `null` terug wanneer er niets te tonen is, zodat de aanroeper kan terugvallen in
|
|
81
|
+
* plaats van een lege regel te tekenen.
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveActivityText(text: ActivityText | undefined, activity: unknown, translate: (key: string, params?: Record<string, string>) => string): string | null;
|
|
84
|
+
/** De parameters die een `ActivityText` uit de activity leest — voor een opgeslagen preview. */
|
|
85
|
+
export declare function activityTextParams(text: ActivityText | undefined, activity: unknown): {
|
|
86
|
+
key: string;
|
|
87
|
+
params: Record<string, string>;
|
|
88
|
+
} | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { ActivityPreview } from '../interaction/types';
|
|
2
|
+
import { ActivityTypeDescriptor } from './descriptor';
|
|
2
3
|
import { Activity } from './types';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* De regel die in de inboxlijst onder de afzender staat.
|
|
6
|
+
*
|
|
7
|
+
* De per-type tekst zelf staat in {@link ACTIVITY_CATALOG}, niet hier: dezelfde vraag
|
|
8
|
+
* werd op zes plekken los beantwoord en dreef uit elkaar. Hier blijft alleen wat écht
|
|
9
|
+
* over de *preview* gaat — de lengtegrens en de velden die op de interactie belanden.
|
|
10
|
+
*
|
|
11
|
+
* `descriptor` is er voor types die een app zelf meebracht. Die dragen een vertaalsleutel
|
|
12
|
+
* in plaats van een zin, en die sleutel wordt méé opgeslagen: de preview wordt eenmalig
|
|
13
|
+
* server-side berekend, maar elke lezer heeft zijn eigen taal.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildActivityPreview(activity: Activity, descriptor?: ActivityTypeDescriptor): ActivityPreview;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ActivityChannelKind, ActivityShape } from './catalog';
|
|
2
|
+
import { ActivityBlock } from './blocks';
|
|
3
|
+
import { ActivityTypeDescriptor } from './descriptor';
|
|
4
|
+
import { Activity } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Eén antwoord over een activity-type, ongeacht of het van ons is of van een app.
|
|
7
|
+
*
|
|
8
|
+
* De ingebouwde catalogus en een gedeclareerde descriptor beschrijven hetzelfde, maar in
|
|
9
|
+
* een andere vorm: de eerste gebruikt functies (die geen HTTP-hop overleven), de tweede
|
|
10
|
+
* vertaalsleutels. Deze laag vlakt dat verschil af, zodat de feed, de inboxlijst en de
|
|
11
|
+
* playbook-builder niet elk hun eigen "is het van ons of niet?"-tak krijgen — precies de
|
|
12
|
+
* tweedeling die dit hele traject wilde vermijden.
|
|
13
|
+
*
|
|
14
|
+
* Ingebouwd wint bij een botsing. Een app die `EMAIL_RECEIVED` claimt kan de mailweergave
|
|
15
|
+
* dus niet kapen.
|
|
16
|
+
*/
|
|
17
|
+
export interface ResolvedActivityType {
|
|
18
|
+
type: string;
|
|
19
|
+
shape: ActivityShape;
|
|
20
|
+
channelKind?: ActivityChannelKind;
|
|
21
|
+
icon: string;
|
|
22
|
+
replyable: boolean;
|
|
23
|
+
countsAs?: "inbound_message" | "outbound_message";
|
|
24
|
+
carriesText: boolean;
|
|
25
|
+
triggerable: boolean;
|
|
26
|
+
component?: string;
|
|
27
|
+
/** True voor de 41 types die het platform zelf meebrengt. */
|
|
28
|
+
builtIn: boolean;
|
|
29
|
+
/** De sleutel voor de naam in keuzelijsten; aanwezig zodra een type triggerbaar is. */
|
|
30
|
+
displayNameKey?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Vertaalfunctie voor sleutels uit een meegeleverde locale-bundel. */
|
|
33
|
+
export type Translate = (key: string, params?: Record<string, string>) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Een opzoeker over de ingebouwde types plus wat apps declareerden.
|
|
36
|
+
*
|
|
37
|
+
* Bewust een expliciet object en geen module-globale registry: op de server leeft elke
|
|
38
|
+
* request in zijn eigen module-instantie, dus een geregistreerde lijst zou daar nooit
|
|
39
|
+
* geraakt worden — en dat zou onzichtbaar zijn.
|
|
40
|
+
*/
|
|
41
|
+
export declare class ActivityTypeRegistry {
|
|
42
|
+
private readonly translate;
|
|
43
|
+
private readonly declared;
|
|
44
|
+
constructor(descriptors?: ActivityTypeDescriptor[], translate?: Translate);
|
|
45
|
+
get(type: string): ResolvedActivityType | undefined;
|
|
46
|
+
/** Alles wat als trigger aangeboden mag worden, ingebouwd en gedeclareerd. */
|
|
47
|
+
triggerable(): ResolvedActivityType[];
|
|
48
|
+
/**
|
|
49
|
+
* De tijdlijnregel. Ingebouwd komt uit de catalogus, gedeclareerd uit `text` + de
|
|
50
|
+
* meegeleverde vertaling. Zonder bruikbare tekst valt het terug op de ontstreepte
|
|
51
|
+
* typenaam — dezelfde regel die de feed altijd al toonde voor onbekende types.
|
|
52
|
+
*/
|
|
53
|
+
timelineText(activity: Activity, authorName: string): string;
|
|
54
|
+
/** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
|
|
55
|
+
snippet(activity: Activity): string;
|
|
56
|
+
/** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
|
|
57
|
+
descriptor(type: string): ActivityTypeDescriptor | undefined;
|
|
58
|
+
/** De declaratieve blokken van een type, als het er heeft. */
|
|
59
|
+
blocks(type: string): ActivityBlock[] | undefined;
|
|
60
|
+
/** De vertaler die bij deze registry hoort, voor het oplossen van blokteksten. */
|
|
61
|
+
get translator(): Translate;
|
|
62
|
+
}
|
|
63
|
+
/** De lege registry: alleen de ingebouwde types. Voor code die (nog) geen catalogus laadt. */
|
|
64
|
+
export declare const BUILT_IN_ONLY: ActivityTypeRegistry;
|
|
@@ -2,11 +2,29 @@ import { InteractionParticipant } from '../../platform/communication';
|
|
|
2
2
|
import { ActivityType } from '../activity/types';
|
|
3
3
|
export interface ActivityPreview {
|
|
4
4
|
activityId: string;
|
|
5
|
-
type
|
|
5
|
+
/** Ook een door een app gedeclareerd type; de union houdt alleen de autocomplete. */
|
|
6
|
+
type: ActivityType | (string & {});
|
|
7
|
+
/**
|
|
8
|
+
* De regel zoals de server hem kon maken. Voor ingebouwde types is dit de tekst zelf;
|
|
9
|
+
* voor een gedeclareerd type de al opgeloste versie in de org-taal.
|
|
10
|
+
*
|
|
11
|
+
* Server-consumenten (zoek, assistent, analytics) hebben geen gebruikerstaal en lezen
|
|
12
|
+
* dit veld. De client geeft de voorkeur aan {@link snippetKey}.
|
|
13
|
+
*/
|
|
6
14
|
snippet: string;
|
|
7
15
|
authorName: string;
|
|
8
16
|
direction: "inbound" | "outbound" | "internal" | "none";
|
|
9
17
|
createdAt: number;
|
|
18
|
+
/**
|
|
19
|
+
* Vertaalsleutel plus al uitgelezen parameters, voor types die er een declareerden.
|
|
20
|
+
*
|
|
21
|
+
* De preview wordt éénmalig op de server berekend en opgeslagen, maar elke lezer heeft
|
|
22
|
+
* zijn eigen taal. Door de sleutel te bewaren in plaats van alleen de zin kan de
|
|
23
|
+
* inboxlijst hem in de taal van de kijker tekenen. (De ingebouwde snippets zijn nu nog
|
|
24
|
+
* hardcoded Nederlands — dezelfde constructie lost dat later op.)
|
|
25
|
+
*/
|
|
26
|
+
snippetKey?: string;
|
|
27
|
+
snippetParams?: Record<string, string>;
|
|
10
28
|
}
|
|
11
29
|
/** Query for the interaction search endpoint (POST /search/interaction). */
|
|
12
30
|
export interface InteractionSearchQuery {
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=140;function T(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim()}function Y(e){const n=e.trim();return n.length<=m?n:n.slice(0,m-1).trimEnd()+"…"}function d(e){if(!e||e<0)return"";const n=Math.floor(e/60),t=Math.floor(e%60);return`${n}:${t.toString().padStart(2,"0")}`}function j(e){switch(e.type){case"EMAIL_RECEIVED":case"EMAIL_SENT":{const n=e.payload,t=n.bodySnippet?.trim()||T(n.body??"");return n.subject?`${n.subject} — ${t}`:t}case"CHAT_MESSAGE_SENT":case"CHAT_MESSAGE_RECEIVED":return e.payload.text??"";case"CHAT_RENAMED":return`Hernoemd naar "${e.payload.newName}"`;case"CHAT_MEMBER_JOINED":return`${e.payload.members.map(n=>n.name).join(", ")} toegevoegd`;case"CHAT_MEMBER_LEFT":return`${e.payload.members.map(n=>n.name).join(", ")} verlaten`;case"CHAT_CALL_STARTED":return"Gesprek gestart";case"CHAT_CALL_ENDED":return`Gesprek beëindigd${e.payload.duration?` (${d(e.payload.duration)})`:""}`;case"CHAT_EVENT":return e.payload.text??e.payload.eventType;case"VOICE_CALL_STARTED":case"VIDEO_CALL_STARTED":return"Gesprek gestart";case"VOICE_CALL_ANSWERED":case"VIDEO_CALL_ANSWERED":return"Gesprek aangenomen";case"VOICE_CALL_HOLD":case"VIDEO_CALL_HOLD":return"In de wacht";case"VOICE_CALL_UNHOLD":case"VIDEO_CALL_UNHOLD":return"Hervat";case"VOICE_CALL_ENDED":case"VIDEO_CALL_ENDED":return`Gesprek beëindigd${e.payload.duration?` (${d(e.payload.duration)})`:""}`;case"VOICE_CALL_MISSED":case"VIDEO_CALL_MISSED":return"Gemiste oproep";case"VOICE_CALL_FAILED":case"VIDEO_CALL_FAILED":return"Gesprek mislukt";case"VOICE_CALL_VOICEMAIL":return e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen";case"TRANSCRIPT_ADDED":return(e.payload.segments??[]).map(n=>n.text).join(" ");case"AI_MESSAGE_ADDED":return e.payload.output?.text??e.payload.input?.text??"";case"AI_ACTION_PROPOSED":return`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`;case"PLAYBOOK_STARTED":return`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`;case"PLAYBOOK_COMPLETED":return"Playbook afgerond";case"PLAYBOOK_ESCALATED":return"Playbook geëscaleerd naar een mens";case"MEETING_SCHEDULED":return`Vergadering gepland: ${e.payload.title}`;case"MEETING_STARTED":return`Vergadering gestart: ${e.payload.title}`;case"MEETING_ENDED":return`Vergadering beëindigd${e.payload.duration?` (${d(e.payload.duration)})`:""}`;case"MEETING_PARTICIPANT_JOINED":return`${e.payload.name} deelgenomen`;case"MEETING_PARTICIPANT_LEFT":return`${e.payload.name} verlaten`;case"COMMENT_ADDED":return e.payload.text??"";case"FILE_UPLOADED":return`Bestand: ${e.payload.fileName}`;case"INTERACTION_CREATED":return"Interactie aangemaakt";case"INTERACTION_STATUS_CHANGED":return`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`;case"INTERACTION_ASSIGNED":return"Interactie toegewezen";default:return""}}function K(e){return{activityId:e.id,type:e.type,snippet:Y(j(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now()}}function z(e,n,t=[]){const r=e.createdAt;if(!r)return[];const a=new Set(t);return e.author.type==="user"&&e.author.id&&a.add(e.author.id),Object.entries(n).filter(([i,o])=>o>=r&&!a.has(i)).map(([i])=>i)}function q(e){return e.createdAt??0}const X=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function J(e){const n=[];for(const t of Object.keys(e))for(const r of Object.keys(e[t]))n.push({lang:t,key:r,value:e[t][r]});return n}function p(e){return e<10?`0${e}`:`${e}`}function D(e,n){const t=new Date(e),r=`${t.getUTCFullYear()}-${p(t.getUTCMonth()+1)}-${p(t.getUTCDate())}`;return n==="day"?r:`${r}T${p(t.getUTCHours())}`}function h(e,n){const t=new Date(e);return t.setUTCMinutes(0,0,0),n==="day"&&t.setUTCHours(0),t.getTime()}const Q=36e5,Z=864e5;function ee(e,n,t){const r=t==="hour"?Q:Z,a=[];for(let i=h(e,t);i<=n;i+=r)a.push(D(i,t));return a}const N=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],R=N.map(e=>e.id);function O(e,n){return`${e}.usage.${n}`}function ne(e,n){return n.map(t=>({id:O(e,t.unit),label:t.label,category:"Verbruik",valueType:t.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...R,...t.extraDimensions??[],"time"]}))}function te(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const re=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],ae={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function C(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function ie(e){if(typeof e!="string")return;const n=e.trim();if(n==="org")return{kind:"org"};const t=n.indexOf(":");if(t<=0)return;const r=n.slice(0,t),a=n.slice(t+1).trim();if(a){if(r==="user")return{kind:"user",userId:a};if(r==="team")return{kind:"team",teamId:a}}}function L(e){return C(e)}function oe(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function se(e){return L(e)}const y=["done","escalated","failed","timed_out","stopped"],U=["awaiting_approval","awaiting_reply"];function P(e){return y.includes(e)}function le(e){return P(e)}function ce(e){return U.includes(e)}const f=[{id:"openai",label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",label:"Anthropic",capabilities:["chat"],defaultModel:"claude-haiku-4-5",baseUrl:"https://api.anthropic.com/v1"},{id:"elevenlabs",label:"ElevenLabs",capabilities:["transcription"],baseUrl:"https://api.elevenlabs.io/v1"},{id:"moonshot",label:"Moonshot (Kimi)",capabilities:["chat"],defaultModel:"kimi-k3",baseUrl:"https://api.moonshot.ai/v1"},{id:"deepseek",label:"DeepSeek",capabilities:["chat"],defaultModel:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1"},{id:"groq",label:"Groq",capabilities:["chat"],defaultModel:"openai/gpt-oss-120b",baseUrl:"https://api.groq.com/openai/v1"},{id:"mistral",label:"Mistral",capabilities:["chat"],defaultModel:"mistral-large-latest",baseUrl:"https://api.mistral.ai/v1"},{id:"openrouter",label:"OpenRouter",capabilities:["chat"],defaultModel:"openrouter/auto",baseUrl:"https://openrouter.ai/api/v1"},{id:"ollama",label:"Ollama (self-hosted)",capabilities:["chat"],defaultModel:"llama3.3"},{id:"openai-compatible",label:"OpenAI-compatible (eigen endpoint)",capabilities:["chat"],defaultModel:"default"}];function c(e){return f.find(n=>n.id===e)}function ue(e){return c(e)?.label??e}function de(e,n="gpt-5-mini"){return c(e)?.defaultModel??n}function pe(e){return f.filter(n=>n.capabilities.includes(e))}function Ee(e){const n=c(e);return!!n&&!n.baseUrl}const fe=new Set(["mail","message"]);function k(e,n){const t=e.settings?.signatures?.[n];return!t||!t.enabled||!t.body||t.body.trim()===""?null:t}function ge(e,n,t,r="html"){if(!e)return t;const a=k(e,n);return a?`${t}${r==="text"?`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=10,d=10,m=10,f=5,ue=new Set(["header","section","context","divider","image","list","actions","attachments"]);function b(e){if(typeof e=="string")return e.length>0;if(!e||typeof e!="object")return!1;const t=e;return typeof t.key=="string"||typeof t.value=="string"}function pe(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=T){t("more than "+T+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const a=i;if(!ue.has(a.type)){t("unknown block type "+String(a.type));continue}switch(a.type){case"header":if(!b(a.text)){t("a header without text");continue}break;case"context":if(!b(a.text)){t("a context block without text");continue}break;case"image":if(!a.url||!a.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(a.fields)&&a.fields.length>d&&(t("more than "+d+" fields in a section"),a.fields=a.fields.slice(0,d));break;case"list":if(!Array.isArray(a.items)||a.items.length===0){t("a list without items");continue}a.items.length>m&&(t("more than "+m+" list items"),a.items=a.items.slice(0,m));break;case"actions":{const r=Array.isArray(a.elements)?a.elements:[],o=r.filter(l=>l&&l.action_id&&l.invoke&&b(l.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>f&&t("more than "+f+" actions"),a.elements=o.slice(0,f);break}}n.push(a)}return n}function K(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim()}function u(e){if(!e||e<0)return"";const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function v(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function I(e){return e?.split("@")?.[0]||e||""}function p(e){return e.map(t=>t.name).join(", ")}function C(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const c={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${I(e.payload.from)}`:`Outbound call started — ${I(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,t)=>`Call answered — ${t}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,t)=>`Call on hold — ${t}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${u(e.payload.duration)})`:""}`,timeline:e=>`Call ended${v(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${I(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${u(e.payload.duration)})`:""}`,timeline:()=>"Video call ended"},VIDEO_CALL_MISSED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gemiste oproep",timeline:()=>"Missed video call"},VIDEO_CALL_FAILED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek mislukt",timeline:()=>"Video call failed"},EMAIL_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.EMAIL_RECEIVED",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:O},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:O},CHAT_MESSAGE_SENT:{shape:"message",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:e=>e.payload.text??""},CHAT_MESSAGE_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.CHAT_MESSAGE_RECEIVED",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:e=>e.payload.text??""},CHAT_MEMBER_JOINED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${p(e.payload.members)} toegevoegd`,timeline:e=>{const t=p(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${t} joined the chat${n}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${p(e.payload.members)} verlaten`,timeline:e=>{const t=p(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${t} left the chat${n}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${C(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${u(e.payload.duration)})`:""}`,timeline:e=>`${C(e.payload.callType)} ended${v(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(t=>t.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${u(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,t)=>`${t} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,t)=>`${t} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,t)=>`Interaction started by ${t}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,t)=>`Status changed to ${e.payload.toStatus} by ${t}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,t)=>`Assigned by ${t}`}};function O(e){const t=e.payload,n=t.bodySnippet?.trim()||K(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function s(e){return c[e]}function de(e){return s(e)?.icon??"circle"}function me(e){return s(e)?.channelKind}function fe(e){const t=s(e)?.shape;return t==="message"||t==="note"}function ge(e){return s(e)?.replyable===!0}function Ee(e){return s(e)?.carriesText===!0}function he(e){return s(e)?.countsAs}function ye(e){return s(e)?.playbookAuthored===!0}function w(e){const t=s(e.type)?.snippet;return t?t(e):""}function Ae(e,t){const n=s(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function be(e){const t=s(e.type)?.joinUrl;return t?t(e):void 0}function E(e,t){let n=e;for(const i of t.split(".")){if(n==null||typeof n!="object")return"";n=n[i]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function h(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return E(t,e.value)||null;const i={};for(const[r,o]of Object.entries(e.params??{}))i[r]=E(t,o);const a=n(e.key,i);return a===e.key?null:a}function V(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[i,a]of Object.entries(e.params??{}))n[i]=E(t,a);return{key:e.key,params:n}}const Ie=e=>e;function R(e){const t=c[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function D(e){return{type:e.type,shape:e.shape,channelKind:e.channelKind,icon:e.icon||"circle",replyable:e.replyable===!0,countsAs:e.countsAs,carriesText:e.carriesText===!0,triggerable:e.triggerable===!0,component:e.component,builtIn:!1,displayNameKey:e.displayNameKey}}class B{constructor(t=[],n=Ie){this.translate=n;for(const i of t)i?.type&&(i.type in c||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(t){if(t in c)return R(t);const n=this.declared.get(t);return n?D(n):void 0}triggerable(){const t=Object.keys(c).filter(i=>c[i].triggerable).map(R),n=[...this.declared.values()].map(D).filter(i=>i.triggerable);return[...t,...n]}timelineText(t,n){const i=c[t.type];if(i?.timeline)return i.timeline(t,n);const a=this.declared.get(t.type);return h(a?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=c[t.type];if(n?.snippet)return n.snippet(t);const i=this.declared.get(t.type);return h(i?.text,t,this.translate)??""}descriptor(t){return this.declared.get(t)}blocks(t){const n=this.declared.get(t)?.render;return n?.length?n:void 0}get translator(){return this.translate}}const _e=new B,L=140;function Te(e){const t=e.trim();return t.length<=L?t:t.slice(0,L-1).trimEnd()+"…"}function Se(e,t){const n=V(t?.text,e),i=t?h(t.text,e,a=>a):null;return{activityId:e.id,type:e.type,snippet:Te(i??w(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function Me(e,t,n=[]){const i=e.createdAt;if(!i)return[];const a=new Set(n);return e.author.type==="user"&&e.author.id&&a.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=i&&!a.has(r)).map(([r])=>r)}function Ne(e){return e.createdAt??0}const ve=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function Ce(e){const t=[];for(const n of Object.keys(e))for(const i of Object.keys(e[n]))t.push({lang:n,key:i,value:e[n][i]});return t}function _(e){return e<10?`0${e}`:`${e}`}function H(e,t){const n=new Date(e),i=`${n.getUTCFullYear()}-${_(n.getUTCMonth()+1)}-${_(n.getUTCDate())}`;return t==="day"?i:`${i}T${_(n.getUTCHours())}`}function j(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const Oe=36e5,Re=864e5;function De(e,t,n){const i=n==="hour"?Oe:Re,a=[];for(let r=j(e,n);r<=t;r+=i)a.push(H(r,n));return a}const F=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],W=F.map(e=>e.id);function Y(e,t){return`${e}.usage.${t}`}function Le(e,t){return t.map(n=>({id:Y(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...W,...n.extraDimensions??[],"time"]}))}function ke(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Ue=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],xe={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function X(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function $e(e){if(typeof e!="string")return;const t=e.trim();if(t==="org")return{kind:"org"};const n=t.indexOf(":");if(n<=0)return;const i=t.slice(0,n),a=t.slice(n+1).trim();if(a){if(i==="user")return{kind:"user",userId:a};if(i==="team")return{kind:"team",teamId:a}}}function z(e){return X(e)}function Pe(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function Ge(e){return z(e)}const q=["done","escalated","failed","timed_out","stopped"],J=["awaiting_approval","awaiting_reply"];function Q(e){return q.includes(e)}function Ke(e){return Q(e)}function we(e){return J.includes(e)}const M=[{id:"openai",label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",label:"Anthropic",capabilities:["chat"],defaultModel:"claude-haiku-4-5",baseUrl:"https://api.anthropic.com/v1"},{id:"elevenlabs",label:"ElevenLabs",capabilities:["transcription"],baseUrl:"https://api.elevenlabs.io/v1"},{id:"moonshot",label:"Moonshot (Kimi)",capabilities:["chat"],defaultModel:"kimi-k3",baseUrl:"https://api.moonshot.ai/v1"},{id:"deepseek",label:"DeepSeek",capabilities:["chat"],defaultModel:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1"},{id:"groq",label:"Groq",capabilities:["chat"],defaultModel:"openai/gpt-oss-120b",baseUrl:"https://api.groq.com/openai/v1"},{id:"mistral",label:"Mistral",capabilities:["chat"],defaultModel:"mistral-large-latest",baseUrl:"https://api.mistral.ai/v1"},{id:"openrouter",label:"OpenRouter",capabilities:["chat"],defaultModel:"openrouter/auto",baseUrl:"https://openrouter.ai/api/v1"},{id:"ollama",label:"Ollama (self-hosted)",capabilities:["chat"],defaultModel:"llama3.3"},{id:"openai-compatible",label:"OpenAI-compatible (eigen endpoint)",capabilities:["chat"],defaultModel:"default"}];function y(e){return M.find(t=>t.id===e)}function Ve(e){return y(e)?.label??e}function Be(e,t="gpt-5-mini"){return y(e)?.defaultModel??t}function He(e){return M.filter(t=>t.capabilities.includes(e))}function je(e){const t=y(e);return!!t&&!t.baseUrl}const Fe=new Set(["mail","message"]);function Z(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function We(e,t,n,i="html"){if(!e)return n;const a=Z(e,t);return a?`${n}${i==="text"?`
|
|
2
2
|
|
|
3
|
-
`:
|
|
4
|
-
`);for(let
|
|
5
|
-
`).trim();return e}function
|
|
6
|
-
`),
|
|
7
|
-
`),
|
|
3
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${a.body}`:n}function Ye(e){return e.endpoints??[]}const Xe=e=>!!e.assignedUserId||!!e.assignedInboxId,ze=e=>e.status==="closed",qe=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Je=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Qe(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const Ze=2e3,et=500,tt=12e3,nt=4e3,ee=["contact","company"];function it(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return ee.includes(t)}const A={NL:{callingCode:"31",trunkPrefix:"0",nsnMin:7,nsnMax:9},BE:{callingCode:"32",trunkPrefix:"0",nsnMin:8,nsnMax:9},LU:{callingCode:"352",nsnMin:6,nsnMax:9},DE:{callingCode:"49",trunkPrefix:"0",nsnMin:6,nsnMax:13},FR:{callingCode:"33",trunkPrefix:"0",nsnMin:9,nsnMax:9},GB:{callingCode:"44",trunkPrefix:"0",nsnMin:9,nsnMax:10},IE:{callingCode:"353",trunkPrefix:"0",nsnMin:7,nsnMax:9},ES:{callingCode:"34",nsnMin:9,nsnMax:9},PT:{callingCode:"351",nsnMin:9,nsnMax:9},IT:{callingCode:"39",nsnMin:6,nsnMax:11},AT:{callingCode:"43",trunkPrefix:"0",nsnMin:7,nsnMax:13},CH:{callingCode:"41",trunkPrefix:"0",nsnMin:9,nsnMax:9},DK:{callingCode:"45",nsnMin:8,nsnMax:8},SE:{callingCode:"46",trunkPrefix:"0",nsnMin:7,nsnMax:13},NO:{callingCode:"47",nsnMin:8,nsnMax:8},FI:{callingCode:"358",trunkPrefix:"0",nsnMin:5,nsnMax:12},PL:{callingCode:"48",nsnMin:9,nsnMax:9},US:{callingCode:"1",nsnMin:10,nsnMax:10},CA:{callingCode:"1",nsnMin:10,nsnMax:10}},te="NL",at=15,rt=8,ot=Array.from(new Set(Object.values(A).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function k(e){if(e)return A[e.trim().toUpperCase()]}function g(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function U(e){if(e.length>at)return null;for(const t of ot){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const i of Object.values(A)){if(i.callingCode!==t)continue;const a=i.trunkPrefix,r=a&&n.startsWith(a)?n.slice(a.length):n;if(g(r,i))return`+${t}${r}`}return null}return e.length<rt?null:`+${e}`}function st(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const i=t.indexOf("@");return i>=0&&(t=t.slice(0,i)),t.trim()}function lt(e){if(!e)return!1;const t=e.indexOf("@");if(t<=0)return!1;const n=e.slice(0,t).trim();return!/^[+\d\s().-]+$/.test(n)}function S(e,t){if(!e)return null;const n=st(e);if(!n)return null;const i=n.startsWith("+"),a=n.replace(/\D/g,"");if(!a)return null;if(i)return U(a);if(a.startsWith("00"))return U(a.slice(2));const r=k(t)??k(te);if(!r)return null;const o=r.trunkPrefix;if(o&&a.startsWith(o)){const l=a.slice(o.length);return g(l,r)?`+${r.callingCode}${l}`:null}if(a.startsWith(r.callingCode)){const l=a.slice(r.callingCode.length);if(g(l,r))return`+${r.callingCode}${l}`}return!o&&g(a,r)?`+${r.callingCode}${a}`:null}function ct(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function N(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const i=t.slice(0,n).split("+")[0],a=t.slice(n+1);return!i||!a.includes(".")?null:`${i}@${a}`}function ut(e){const t=N(e);return t?t.slice(t.lastIndexOf("@")+1):null}const pt=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function ne(e){if(!e)return null;const t=e.trim().toLowerCase().replace(/\.$/,"").split(".").filter(Boolean);if(t.length<2)return null;const n=t.slice(-2).join(".");return pt.has(n)&&t.length>=3?t.slice(-3).join("."):n}const ie=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","hotmail.nl","hotmail.be","hotmail.co.uk","live.com","live.nl","live.be","msn.com","yahoo.com","yahoo.co.uk","ymail.com","icloud.com","me.com","mac.com","aol.com","gmx.net","gmx.de","web.de","protonmail.com","proton.me","pm.me","tutanota.com","zoho.com","mail.com","ziggo.nl","kpnmail.nl","planet.nl","home.nl","casema.nl","chello.nl","xs4all.nl","telfort.nl","hetnet.nl","zonnet.nl","upcmail.nl","quicknet.nl","telenet.be","skynet.be","proximus.be","scarlet.be"]);function dt(e){const t=ne(e);return t?ie.has(t):!1}function mt(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function ft(e,t,n){if(!e||!t)return null;const i=e.trim().toLowerCase();if(i==="tel"||i==="sms"||i==="whatsapp"){const r=S(t,n);return r?`tel:${r}`:null}if(i==="fax"){const r=S(t,n);return r?`fax:${r}`:null}if(i==="mailto"||i==="email"){const r=N(t);return r?`mailto:${r}`:null}const a=t.trim().toLowerCase();return a?`${i}:${a}`:null}const gt=[/<blockquote/i,/class="?gmail_quote/i,/id="?[^"]*divRplyFwdMsg/i,/id="?[^"]*mail-editor-reference-message-container/i,/-{3,}\s*Original Message\s*-{3,}/i,/\n_{5,}\s*\n/,/\bOn\b[\s\S]{0,200}?\bwrote:/i],x=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,Et=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function ht(e){const t=e.split(`
|
|
4
|
+
`);for(let n=0;n<t.length;n++)if(Et.test(t[n])||x.test(t[n])&&t.slice(n+1,n+4).some(i=>x.test(i)))return t.slice(0,n).join(`
|
|
5
|
+
`).trim();return e}function $(e){let t=e;return t=t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),t=t.replace(/<br\s*\/?>/gi,`
|
|
6
|
+
`),t=t.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi,`
|
|
7
|
+
`),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function P(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&#(\d+);/g,(t,n)=>String.fromCharCode(Number(n))).replace(/&/gi,"&")}function G(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
8
8
|
`).replace(/\n{3,}/g,`
|
|
9
9
|
|
|
10
|
-
`).trim()}function
|
|
10
|
+
`).trim()}function yt(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of gt){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let i=G(P($(n)));return i||(i=G(P($(e)))),ht(i)||i}const At=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,bt=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function It(e,t){return!!(e&&At.test(e)||t&&bt.test(t))}const ae=3,re=600;function _t(e,t){return e>=ae||t>=re}function oe(e,t){const n=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},a=t.intents.filter(o=>!n.has(o.intent)).map(o=>St(o,i[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return a;const r=new Set(a.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(a.push(o),r.add(o.intent));return a}function se(e,t){const n={};for(const i of e.intents){if(!i.togglable)continue;const a=t?.[i.intent];n[i.intent]=a??i.defaultEnabled??!0}return n}function Tt(e,t){const n=se(e,t);return Object.entries(n).filter(([,i])=>!i).map(([i])=>i)}function St(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function Mt(e,t){const n=[];for(const i of e){if(!i.enabled)continue;const a=t[i.providerId];if(a)for(const r of oe(i,a))n.push({channel:i,description:a,capability:r})}return n}function Nt(e,t){return t.filter(n=>n.capability.intent===e)}function le(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function vt(e,t){return le(e.scheme,t)}function Ct(e,t,n){const i=[];for(const a of e)for(const r of n)r.capability.intent===t&&r.capability.targetSchemes.includes(a.scheme)&&i.push({channelIntent:r,endpoint:a});return i}var ce=(e=>(e.MAILTO="mailto",e.SIP="sip",e.TEL="tel",e.WEBHOOK="webhook",e.USERNAME="username",e.ID="id",e.CUSTOM="custom",e.URL="url",e.TELEGRAM="telegram",e.WHATSAPP="whatsapp",e.MESSENGER="messenger",e.INSTAGRAM="instagram",e.VIBER="viber",e.SMS="sms",e.FAX="fax",e.TEAMS="teams",e.CALENDAR="calendar",e))(ce||{});const Ot="message_window",Rt="message_templates",Dt={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Lt=(e,t)=>({intent:e,...t}),kt="folder_management",Ut="remote_search",xt={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},$t=9e4,Pt="installation-id";exports.ACTIVITY_CATALOG=c;exports.AI_VENDORS=M;exports.ActivityTypeRegistry=B;exports.BUILT_IN_ONLY=_e;exports.CLASSIFY_VARS=xe;exports.CORE_DIMENSIONS=ve;exports.CommunicationScheme=ce;exports.DEFAULT_MEMORY_BUDGET=nt;exports.DEFAULT_PHONE_REGION=te;exports.FEATURE_FOLDER_MANAGEMENT=kt;exports.FEATURE_REMOTE_SEARCH=Ut;exports.INSTALLATION_HEADER=Pt;exports.InteractionParticipantRole=Dt;exports.MAX_ACTIONS=f;exports.MAX_BLOCKS=T;exports.MAX_FIELDS=d;exports.MAX_LIST_ITEMS=m;exports.MAX_MEMORY_BUDGET=tt;exports.MAX_MEMORY_CHARS=Ze;exports.MIN_MEMORY_BUDGET=et;exports.PAUSED_RUN_STATUSES=J;exports.PHONE_REGIONS=A;exports.PRESENCE_ONLINE_WINDOW_MS=$t;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Rt;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Ot;exports.PUBLIC_EMAIL_DOMAINS=ie;exports.RELATED_SUBJECT_KINDS=ee;exports.SIGNATURE_INTENTS=Fe;exports.SUMMARY_MIN_LAST_CHARS=re;exports.SUMMARY_MIN_MESSAGES=ae;exports.TERMINAL_RUN_STATUSES=q;exports.TRIGGER_VARS=Ue;exports.UNSUPPORTED=xt;exports.USAGE_DIMENSIONS=F;exports.USAGE_DIMENSION_IDS=W;exports.actingIdentityKey=z;exports.activityIconOf=de;exports.activityJoinUrl=be;exports.activitySnippet=w;exports.activityTextParams=V;exports.activityTimelineText=Ae;exports.activityTimestamp=Ne;exports.activityTypeInfo=s;exports.actorKey=Ge;exports.aiVendorDefaultModel=Be;exports.aiVendorLabel=Ve;exports.aiVendorNeedsBaseUrl=je;exports.aiVendorsWith=He;exports.applySignature=We;exports.buildActivityPreview=Se;exports.buildChannelIntents=Mt;exports.carriesText=Ee;exports.channelKindOf=me;exports.cleanMessageText=yt;exports.defineIntent=Lt;exports.disabledIntentsFromCapabilities=Tt;exports.emailDomain=ut;exports.endpointKey=ft;exports.filterByEndpoint=vt;exports.filterByIntent=Nt;exports.filterByTargetScheme=le;exports.findAiVendor=y;exports.flattenLocales=Ce;exports.floorToPeriod=j;exports.formatActingIdentity=X;exports.formatPeriod=H;exports.getActivitySeenUserIds=Me;exports.getContactEndpoints=Ye;exports.getShortTitle=Je;exports.getUrgencyScore=qe;exports.humanizeAction=ke;exports.isAssigned=Xe;exports.isClosed=ze;exports.isInteractionUnseen=Qe;exports.isLikelyBulk=It;exports.isMessageType=fe;exports.isPaused=we;exports.isPlaybookAuthoredType=ye;exports.isPublicEmailDomain=dt;exports.isReplyableType=ge;exports.isRetryable=Ke;exports.isTerminal=Q;exports.isThreadLongEnough=_t;exports.looksLikeEmail=lt;exports.matchContactToIntents=Ct;exports.messageCountsAs=he;exports.needsPhoneRegion=mt;exports.normalizeBlocks=pe;exports.normalizeEmail=N;exports.parseActingIdentity=$e;exports.periodsInRange=De;exports.phoneSuffix=ct;exports.playbookActor=Pe;exports.readPath=E;exports.registrableDomain=ne;exports.relatedByDefault=it;exports.resolveAccountCapabilities=se;exports.resolveActivityText=h;exports.resolveChannelIntents=oe;exports.resolveSignature=Z;exports.stripHtml=K;exports.toE164=S;exports.usageMetricId=Y;exports.usageMetrics=Le;
|