@opencxh/domain 1.171.0 → 1.172.2

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.
Files changed (101) hide show
  1. package/dist/entities/activity/blocks.d.ts +30 -30
  2. package/dist/entities/activity/catalog.d.ts +63 -86
  3. package/dist/entities/activity/descriptor.d.ts +31 -32
  4. package/dist/entities/activity/index.d.ts +2 -2
  5. package/dist/entities/activity/preview.d.ts +7 -7
  6. package/dist/entities/activity/resolve.d.ts +37 -38
  7. package/dist/entities/activity/types.d.ts +34 -34
  8. package/dist/entities/ai-account/types.d.ts +3 -3
  9. package/dist/entities/ai-account/vendors.d.ts +25 -32
  10. package/dist/entities/ai-budget/types.d.ts +12 -8
  11. package/dist/entities/ai-conversation/types.d.ts +12 -12
  12. package/dist/entities/ai-profile/types.d.ts +21 -26
  13. package/dist/entities/ai-settings/types.d.ts +12 -13
  14. package/dist/entities/analytics/dashboard.d.ts +1 -1
  15. package/dist/entities/analytics/index.d.ts +4 -4
  16. package/dist/entities/analytics/source.d.ts +1 -1
  17. package/dist/entities/analytics/usage.d.ts +23 -28
  18. package/dist/entities/artifact/blocks.d.ts +54 -69
  19. package/dist/entities/artifact/markdown.d.ts +2 -3
  20. package/dist/entities/artifact/types.d.ts +47 -55
  21. package/dist/entities/assignment/types.d.ts +74 -88
  22. package/dist/entities/calendar-event/types.d.ts +1 -1
  23. package/dist/entities/channel/index.d.ts +1 -1
  24. package/dist/entities/channel/signature.d.ts +8 -9
  25. package/dist/entities/communication/index.d.ts +1 -1
  26. package/dist/entities/communication/message-template.d.ts +1 -1
  27. package/dist/entities/company/types.d.ts +1 -1
  28. package/dist/entities/contact/index.d.ts +1 -1
  29. package/dist/entities/contact/provider.d.ts +2 -1
  30. package/dist/entities/contact/types.d.ts +1 -10
  31. package/dist/entities/custom-field-def/types.d.ts +14 -14
  32. package/dist/entities/external-identity/types.d.ts +45 -50
  33. package/dist/entities/interaction/index.d.ts +1 -1
  34. package/dist/entities/interaction/types.d.ts +44 -47
  35. package/dist/entities/live-lens/types.d.ts +39 -44
  36. package/dist/entities/mcp/types.d.ts +53 -57
  37. package/dist/entities/memory/alias.d.ts +7 -7
  38. package/dist/entities/memory/browse.d.ts +21 -21
  39. package/dist/entities/memory/ingest.d.ts +26 -17
  40. package/dist/entities/memory/item.d.ts +53 -58
  41. package/dist/entities/memory/kind.d.ts +26 -26
  42. package/dist/entities/memory/query.d.ts +49 -51
  43. package/dist/entities/playbook/actor.d.ts +20 -19
  44. package/dist/entities/playbook/assignment.d.ts +54 -63
  45. package/dist/entities/playbook/index.d.ts +2 -2
  46. package/dist/entities/playbook/labels.d.ts +4 -4
  47. package/dist/entities/playbook/trigger-vars.d.ts +14 -15
  48. package/dist/entities/playbook/types.d.ts +173 -303
  49. package/dist/entities/resource-reminder/types.d.ts +8 -9
  50. package/dist/entities/scope/actor.d.ts +16 -0
  51. package/dist/entities/{note → scope}/index.d.ts +1 -0
  52. package/dist/entities/scope/scope.test.d.ts +1 -0
  53. package/dist/entities/scope/types.d.ts +53 -0
  54. package/dist/entities/task/types.d.ts +1 -1
  55. package/dist/entities/time-entry/duration.d.ts +11 -11
  56. package/dist/entities/time-entry/types.d.ts +60 -60
  57. package/dist/entities/time-entry/work-type.d.ts +21 -24
  58. package/dist/entities/topic/examples.d.ts +26 -27
  59. package/dist/entities/topic/scope.d.ts +11 -12
  60. package/dist/entities/topic/types.d.ts +28 -28
  61. package/dist/entities/user/types.d.ts +24 -28
  62. package/dist/entities/webhook/types.d.ts +6 -6
  63. package/dist/entities/work/keys.d.ts +25 -26
  64. package/dist/entities/work/ladder.d.ts +48 -52
  65. package/dist/entities/work/types.d.ts +109 -115
  66. package/dist/index.cjs +6 -6
  67. package/dist/index.d.ts +29 -33
  68. package/dist/index.js +1391 -1254
  69. package/dist/platform/account.d.ts +34 -38
  70. package/dist/platform/ai-tools.d.ts +48 -52
  71. package/dist/platform/api.d.ts +9 -8
  72. package/dist/platform/author.d.ts +7 -9
  73. package/dist/platform/capabilities.d.ts +3 -3
  74. package/dist/platform/communication.d.ts +163 -204
  75. package/dist/platform/context.d.ts +8 -8
  76. package/dist/platform/identity.d.ts +16 -19
  77. package/dist/platform/kernel.d.ts +1 -1
  78. package/dist/platform/manifest.d.ts +2 -2
  79. package/dist/platform/media.d.ts +13 -15
  80. package/dist/platform/permission.d.ts +39 -0
  81. package/dist/platform/permission.test.d.ts +1 -0
  82. package/dist/platform/presence.d.ts +30 -30
  83. package/dist/platform/provider.d.ts +14 -76
  84. package/dist/platform/resource-source.d.ts +43 -45
  85. package/dist/platform/resource.d.ts +17 -23
  86. package/dist/platform/scope.d.ts +36 -62
  87. package/dist/platform/services.d.ts +4 -4
  88. package/dist/platform/settings.d.ts +0 -14
  89. package/dist/platform/storage.d.ts +2 -2
  90. package/dist/platform/sync-source.d.ts +196 -216
  91. package/dist/platform/transcript-cadence.d.ts +37 -41
  92. package/dist/platform/ui.d.ts +6 -6
  93. package/dist/text/endpoint.d.ts +11 -27
  94. package/package.json +3 -5
  95. package/dist/entities/note/types.d.ts +0 -14
  96. package/dist/entities/shopify/index.d.ts +0 -1
  97. package/dist/entities/shopify/types.d.ts +0 -79
  98. package/dist/platform/lifecycle.d.ts +0 -13
  99. package/dist/platform/reactive.d.ts +0 -13
  100. package/dist/platform/sdk.d.ts +0 -182
  101. package/dist/platform/service-registry.d.ts +0 -13
@@ -1,21 +1,19 @@
1
- export type SessionState = 'idle' | 'ringing' | 'connecting' | 'connected' | 'on_hold' | 'ended' | 'failed';
1
+ export type SessionState = "idle" | "ringing" | "connecting" | "connected" | "on_hold" | "ended" | "failed";
2
2
  /**
3
3
  * `"appName:ResourceName"` — how the platform addresses a federated resource.
4
- * Not to be confused with the read-state `ResourceRef`, which points at a
5
- * domain object rather than at a piece of UI.
4
+ * Not the read-state `ResourceRef`, which points at a domain object, not UI.
6
5
  */
7
6
  export type FederatedResourceRef = `${string}:${string}`;
8
7
  export interface Session {
9
8
  id: string;
10
9
  accountId: string;
11
10
  providerId: string;
12
- direction: 'inbound' | 'outbound';
11
+ direction: "inbound" | "outbound";
13
12
  remoteIdentity: string;
14
13
  /**
15
- * Number of remote participants, when the provider can report it. Used by
16
- * transcript labeling: with more than one remote party the audio is a single
17
- * mixed stream, so `remoteIdentity` can't be trusted to name the speaker and
18
- * the label falls back to a generic one. Absent/1 = single remote party.
14
+ * Number of remote participants, when the provider can report it. With more
15
+ * than one remote party the audio is a single mixed stream, so transcript
16
+ * labeling falls back to a generic speaker label. Absent/1 = single remote party.
19
17
  */
20
18
  remoteParticipantCount?: number;
21
19
  state: SessionState;
@@ -25,9 +23,8 @@ export interface Session {
25
23
  actions: SessionAction[];
26
24
  /**
27
25
  * Provider-supplied externalId the transcript persistence should bind to.
28
- * Server resolves this against `interaction.externalIds` (with an activity
29
- * fallback). Lets providers point at the right interaction without the
30
- * server needing to know their id shape.
26
+ * Server resolves it against `interaction.externalIds` (activity fallback),
27
+ * so providers need not know the server's id shape.
31
28
  */
32
29
  externalId?: string;
33
30
  ui: {
@@ -43,28 +40,23 @@ export interface CommsAccount<T = any> {
43
40
  organizationId: string;
44
41
  userId: string;
45
42
  config: T;
46
- status: 'registered' | 'unregistered' | 'error';
43
+ status: "registered" | "unregistered" | "error";
47
44
  /**
48
- * The channel this registration serves. Set by the transport provider from
49
- * its registration config; this is what binds an outgoing intent on a
50
- * channel to the right account when several are registered at once.
45
+ * The channel this registration serves; set by the transport provider from
46
+ * its registration config. Binds an outgoing intent on a channel to the
47
+ * right account when several are registered at once.
51
48
  */
52
49
  channelId?: string;
53
50
  }
54
51
  export interface ITransportProvider {
55
52
  readonly id: string;
56
53
  /**
57
- * The ops this provider actually carries out, when it wants to say so.
58
- *
59
- * `dispatch` is a switch, so an op it has no case for returns quietly — the
60
- * caller cannot tell "done" from "ignored". That is fine for a button the
61
- * provider's own action tray never draws, but not for something the platform
62
- * does on the user's behalf: auto-holding the previous call at a provider
63
- * without hold would park a call that stays live.
64
- *
65
- * Undeclared means unknown, and unknown is tried anyway — that is the
66
- * behaviour every provider had before this field existed. Declare it to be
67
- * skipped rather than silently no-op'd.
54
+ * The ops this provider actually carries out. `dispatch` is a switch, so an
55
+ * op without a case returns quietly — the caller cannot tell "done" from
56
+ * "ignored". Harmless for a button the provider's tray never draws, but not
57
+ * for platform-initiated ops: auto-holding at a provider without hold would
58
+ * park a call that stays live. Undeclared means unknown, and unknown is
59
+ * tried anyway (pre-existing behaviour); declare to be skipped, not no-op'd.
68
60
  */
69
61
  readonly supportedOps?: readonly TransportOpKind[];
70
62
  subscribeSessions(callback: (sessions: Session[]) => void): () => void;
@@ -73,8 +65,8 @@ export interface ITransportProvider {
73
65
  registerAccount(orgId: string, userId: string, config: any): Promise<CommsAccount>;
74
66
  unregisterAccount(accountId: string): Promise<void>;
75
67
  /**
76
- * Uniforme entry voor alle session-ops (invite/answer/hangup/hold/
77
- * transfer/dtmf/set-stream).
68
+ * Uniform entry for all session ops (invite/answer/hangup/hold/transfer/
69
+ * dtmf/set-stream).
78
70
  */
79
71
  dispatch(op: TransportOp): Promise<void>;
80
72
  }
@@ -99,29 +91,25 @@ export declare enum CommunicationScheme {
99
91
  CALENDAR = "calendar"
100
92
  }
101
93
  /**
102
- * The colour-coded channel kinds the design system defines tokens for. This is
103
- * about *how you reach someone*, not about which product delivers it: Teams and
104
- * Telegram are both `chat`, SIP and a phone number are both `tel`.
94
+ * The colour-coded channel kinds the design system defines tokens for. About
95
+ * *how you reach someone*, not which product delivers it: Teams and Telegram
96
+ * are both `chat`, SIP and a phone number are both `tel`.
105
97
  */
106
98
  export type ChannelKind = "mail" | "wa" | "chat" | "tel" | "note";
107
99
  /** Channel kind for a scheme; anything unrecognised is neutral. */
108
100
  export declare function channelKindForScheme(scheme?: string | null): ChannelKind;
109
101
  /**
110
- * How a provider wants its channel drawn.
111
- *
112
- * Two routes, mirroring how apps ship translations. `icon`/`tone`/`label` are
113
- * declarative and travel in `/provider/describe`, so they work for a provider
114
- * with no frontend at all and on any surface where no bundle is loaded yet.
115
- * `resource` is the escape hatch: a federated component (`"app:Component"`)
116
- * that renders the provider's own mark and wins once it loads.
102
+ * How a provider wants its channel drawn. Two routes: `icon`/`tone`/`label`
103
+ * are declarative and travel in `/provider/describe`, so they work without a
104
+ * frontend or loaded bundle. `resource` is the escape hatch — a federated
105
+ * component (`"app:Component"`) that renders the provider's own mark and wins once loaded.
117
106
  */
118
107
  export interface ChannelPresentation {
119
108
  /** Lucide icon name, resolved by the host's icon renderer. */
120
109
  icon?: string;
121
110
  /**
122
- * A {@link ChannelKind} to borrow that channel's colour, or any other
123
- * stable string — a provider bringing its own channel gets a colour derived
124
- * from it rather than collapsing onto the neutral tone.
111
+ * A {@link ChannelKind} to borrow that channel's colour, or any other stable
112
+ * string — a provider-owned channel gets a derived colour instead of the neutral tone.
125
113
  */
126
114
  tone?: ChannelKind | string;
127
115
  /** What to call this channel in the UI, e.g. "WhatsApp". */
@@ -130,38 +118,33 @@ export interface ChannelPresentation {
130
118
  resource?: string;
131
119
  }
132
120
  /**
133
- * Account selector for `transport: session` intents. Narrows the registered
134
- * `CommsAccount`s down to the one that should service this intent.
135
- *
136
- * `protocol` is the filter axis rather than a provider id because the two id
137
- * spaces don't line up: `channel.providerId` is the *server* provider (e.g.
138
- * eylo-voip) while `account.providerId` is the *transport* provider (e.g.
139
- * sip-provider). Which of the remaining candidates is picked is decided by the
140
- * binding on the account itself (`CommsAccount.channelId`) — `accountId` is
141
- * only a static pin for providers that have no per-channel binding.
121
+ * Account selector for `transport: session` intents — narrows registered
122
+ * `CommsAccount`s to the one servicing this intent. `protocol` is the filter
123
+ * axis rather than a provider id because the id spaces differ:
124
+ * `channel.providerId` is the *server* provider (e.g. eylo-voip),
125
+ * `account.providerId` the *transport* provider (e.g. sip-provider). The final
126
+ * pick comes from `CommsAccount.channelId`; `accountId` is only a static pin
127
+ * for providers without per-channel binding.
142
128
  */
143
129
  export interface AccountSelector {
144
130
  protocol: string;
145
131
  accountId?: string;
146
132
  }
147
133
  /**
148
- * Routing-hint voor de frontend en de comm-server: hoe wordt deze intent
149
- * uitgevoerd?
150
- *
134
+ * Routing hint for frontend and comm-server: how an intent executes.
151
135
  * - `dispatch` — server-side via comm-server `provider/dispatch/` →
152
- * `IProvider.dispatch(op)` op de provider-app's server. Dekt
153
- * message.*, attachment.*, calendar.*, contact.* ServerOps.
154
- * - `session` — client-side via `ITransportProvider.dispatch(op)` in
155
- * de browser-UA (SIP/WebRTC). Geen server-roundtrip.
136
+ * `IProvider.dispatch(op)` (message.*, attachment.*, calendar.*, contact.* ServerOps).
137
+ * - `session` — client-side via `ITransportProvider.dispatch(op)` in the
138
+ * browser UA (SIP/WebRTC); no server round-trip.
156
139
  */
157
140
  export type TransportConfig = {
158
141
  kind: "dispatch";
159
142
  /** Optional federated composer resource as "<app>:<resource>". */
160
143
  composer?: string;
161
144
  /**
162
- * When true, comms-app `interaction/compose` skips its auto-create
163
- * and lets the provider own interaction lifecycle (e.g. Teams chat
164
- * upserts on a chatId externalId).
145
+ * When true, comms-app `interaction/compose` skips its auto-create and
146
+ * the provider owns interaction lifecycle (e.g. Teams chat upserts on a
147
+ * chatId externalId).
165
148
  */
166
149
  ownsInteraction?: boolean;
167
150
  } | {
@@ -175,24 +158,23 @@ export type TransportConfig = {
175
158
  /**
176
159
  * One user-facing intent a provider/channel can perform on a target.
177
160
  * `intent` is an open string — known values (call/mail/message/video) get
178
- * default UI/labels; new ones (`schedule`, `transfer`, `record`) render as
179
- * generic actions until a provider declares specialised UI.
161
+ * default UI/labels; new ones render as generic actions until a provider
162
+ * declares specialised UI.
180
163
  */
181
164
  export interface IntentCapability {
182
165
  intent: string;
183
166
  targetSchemes: CommunicationScheme[];
184
167
  transport: TransportConfig;
185
- /** User mag deze intent aan/uit zetten per account. Default false (provider-locked). */
168
+ /** User may toggle this intent per account. Default false (provider-locked). */
186
169
  togglable?: boolean;
187
- /** Default-state als togglable=true en user nog geen keuze maakte. Default true. */
170
+ /** Default state when togglable=true and the user has not chosen. Default true. */
188
171
  defaultEnabled?: boolean;
189
- /** Optionele i18n-key voor toggle-label; UI valt anders terug op `cap_${intent}`. */
172
+ /** Optional i18n key for the toggle label; UI falls back to `cap_${intent}`. */
190
173
  labelKey?: string;
191
174
  }
192
175
  /**
193
- * Provider-level feature flag (no routing relevance). Used for things
194
- * like `call_hold`, `call_forward`, `message_reactions` that providers
195
- * advertise to feature-detect, but which are not user-pickable intents.
176
+ * Provider-level feature flag (no routing relevance) — e.g. `call_hold`,
177
+ * `message_reactions` — advertised for feature detection, not user-pickable intents.
196
178
  */
197
179
  export interface ProviderFeature {
198
180
  name: string;
@@ -208,46 +190,42 @@ export interface ProviderDescription {
208
190
  features: ProviderFeature[];
209
191
  /**
210
192
  * How this provider's channel is drawn. Optional: without it the UI falls
211
- * back to the scheme's channel kind, which is what every surface did before
212
- * providers could say anything about themselves.
193
+ * back to the scheme's channel kind.
213
194
  */
214
195
  presentation?: ChannelPresentation;
215
196
  }
216
197
  /**
217
- * Provider-feature names die de composer generiek interpreteert (geen
218
- * hardcoding per-provider). Een provider die `message_window` adverteert
219
- * heeft een tijdgebonden messaging-venster; `message_templates` betekent dat
220
- * er pre-approved templates beschikbaar zijn buiten dat venster.
198
+ * Provider-feature names the composer interprets generically (no per-provider
199
+ * hardcoding). `message_window` = time-bound messaging window;
200
+ * `message_templates` = pre-approved templates available outside that window.
221
201
  */
222
202
  export declare const PROVIDER_FEATURE_MESSAGE_WINDOW = "message_window";
223
203
  export declare const PROVIDER_FEATURE_MESSAGE_TEMPLATES = "message_templates";
224
- /**
225
- * Eén variabele in een provider-template (bv. WhatsApp HSM body-param `{{1}}`).
226
- */
204
+ /** One variable in a provider template (e.g. WhatsApp HSM body param `{{1}}`). */
227
205
  export interface ProviderMessageTemplateVariable {
228
- /** Stabiele key — voor WhatsApp de 1-based index als string ("1", "2", …). */
206
+ /** Stable key — for WhatsApp the 1-based index as string ("1", "2", …). */
229
207
  key: string;
230
- /** Optioneel voorbeeld/placeholder uit de provider. */
208
+ /** Optional example/placeholder from the provider. */
231
209
  example?: string;
232
210
  label?: string;
233
211
  }
234
212
  /**
235
- * Pre-approved provider-template (WhatsApp HSM). De composer rendert per
236
- * `variables` een invoerveld; submit stuurt `templateId` + ingevulde waarden
237
- * mee. Los van de user-gemaakte canned-reply {@link MessageTemplate}.
213
+ * Pre-approved provider template (WhatsApp HSM). The composer renders an input
214
+ * per variable; submit sends `templateId` + filled values. Distinct from the
215
+ * user-made canned-reply {@link MessageTemplate}.
238
216
  */
239
217
  export interface ProviderMessageTemplate {
240
218
  id: string;
241
219
  name: string;
242
220
  language?: string;
243
- /** Voorbeeld van de samengestelde body (variabelen als placeholders). */
221
+ /** Preview of the composed body (variables as placeholders). */
244
222
  bodyPreview?: string;
245
223
  category?: string;
246
224
  variables: ProviderMessageTemplateVariable[];
247
225
  }
248
226
  /**
249
- * Geldige tag waarmee buiten het standaard-venster tóch een vrij-tekst bericht
250
- * verstuurd mag worden (Messenger/Instagram message-tags, human-agent-tag).
227
+ * Tag that permits a free-text message outside the standard window
228
+ * (Messenger/Instagram message tags, human-agent tag).
251
229
  */
252
230
  export interface MessageTag {
253
231
  id: string;
@@ -255,18 +233,18 @@ export interface MessageTag {
255
233
  description?: string;
256
234
  }
257
235
  /**
258
- * Antwoord van `provider/message-context` (read-route op een dispatch-provider
259
- * met `message_window`/`message_templates`-features). Per interaction vertelt
260
- * dit de composer of vrij-tekst mag, en zo niet welke templates/tags er zijn.
236
+ * Response of `provider/message-context` (read route on a dispatch provider
237
+ * with `message_window`/`message_templates`). Tells the composer, per
238
+ * interaction, whether free text is allowed and otherwise which templates/tags exist.
261
239
  */
262
240
  export interface MessageContext {
263
- /** Vrij-tekst toegestaan? false ⇒ composer forceert template of tag. */
241
+ /** Free text allowed? false ⇒ composer forces a template or tag. */
264
242
  windowOpen: boolean;
265
- /** Epoch-ms waarop het venster sluit (indien open en bekend). */
243
+ /** Epoch ms when the window closes (if open and known). */
266
244
  windowExpiresAt?: number;
267
- /** Beschikbare pre-approved templates (WhatsApp). */
245
+ /** Available pre-approved templates (WhatsApp). */
268
246
  templates?: ProviderMessageTemplate[];
269
- /** Geldige message-tags (Messenger/Instagram). */
247
+ /** Valid message tags (Messenger/Instagram). */
270
248
  tags?: MessageTag[];
271
249
  }
272
250
  export interface PersonalAuthOption {
@@ -282,10 +260,10 @@ export interface PersonalAuthField {
282
260
  placeholder?: string;
283
261
  }
284
262
  /**
285
- * Describes how to connect a personal account for a provider.
286
- * - mode "redirect": user picks an option → OAuth redirect flow
287
- * - mode "form": user fills in fields → credentials submitted server-side
288
- * - mode "unavailable": provider does not support personal connections (or no options configured)
263
+ * How to connect a personal account for a provider.
264
+ * - "redirect": user picks an option → OAuth redirect flow
265
+ * - "form": user fills in fields → credentials submitted server-side
266
+ * - "unavailable": no personal connections (or no options configured)
289
267
  */
290
268
  export interface PersonalAuthDescription {
291
269
  mode: "redirect" | "form" | "unavailable";
@@ -304,27 +282,22 @@ export interface Uri {
304
282
  displayName?: string;
305
283
  }
306
284
  /**
307
- * Een Uri uitgebreid met identity-cache. Gebruikt voor remote counterparties
308
- * (afzender, ontvangers, meeting-attendees). Channels (eigen adressen) blijven
309
- * een plain `Uri`.
310
- *
311
- * - `contactId`: resolved-hint, gezet door de server tijdens ingest. UI mag
312
- * direct navigeren zonder lookup; voor live displayName/avatar blijft de
313
- * Contact-entity de autoriteit.
314
- * - `role`: rol van deze deelnemer in deze interactie. Open string; zie
315
- * `InteractionParticipantRole` voor well-known waardes per kanaal.
316
- *
317
- * Niet te verwarren met `Participant` uit `entities/communication` — dat is
318
- * een live call-session-participant (muted/speaking/etc.).
285
+ * A Uri extended with an identity cache, used for remote counterparties
286
+ * (sender, recipients, meeting attendees); channels (own addresses) stay plain `Uri`.
287
+ * `contactId` is a resolved hint set by the server during ingest — UI may
288
+ * navigate without a lookup, but the Contact entity stays the authority for
289
+ * live displayName/avatar. `role` is an open string; see
290
+ * `InteractionParticipantRole` for well-known values. Not the live
291
+ * call-session `Participant` from `entities/communication`.
319
292
  */
320
293
  export interface InteractionParticipant extends Uri {
321
294
  contactId?: string;
322
295
  role?: string;
323
296
  }
324
297
  /**
325
- * Well-known rollen voor `InteractionParticipant.role`. Open string in het
326
- * type zodat provider-specifieke rollen geen domain-PR vereisen — gebruik
327
- * deze constants wanneer het kanaal een standaardrol kent.
298
+ * Well-known roles for `InteractionParticipant.role`. The type stays an open
299
+ * string so provider-specific roles need no domain PR; use these constants
300
+ * when the channel has a standard role.
328
301
  */
329
302
  export declare const InteractionParticipantRole: {
330
303
  readonly FROM: "from";
@@ -340,27 +313,20 @@ export declare const InteractionParticipantRole: {
340
313
  readonly HOST: "host";
341
314
  readonly PARTICIPANT: "participant";
342
315
  };
343
- export type InteractionParticipantRoleValue = typeof InteractionParticipantRole[keyof typeof InteractionParticipantRole];
316
+ export type InteractionParticipantRoleValue = (typeof InteractionParticipantRole)[keyof typeof InteractionParticipantRole];
344
317
  /** Props the host passes to a provider's `ui.actionTray` resource. */
345
318
  export interface CallActionTrayProps {
346
319
  session: Session;
347
320
  account?: CommsAccount;
348
321
  /**
349
322
  * Resource currently shown in place of `ui.canvas`, or null for the canvas
350
- * itself. The canvas and the tray are separate federated resources and
351
- * cannot hold state between them, so the host holds this one value and both
352
- * sides speak the same currency they already use for `ui.canvas`: a
353
- * resource reference.
354
- *
355
- * Deliberately a reference and not an enum of known panels. A keypad or a
356
- * transfer form is not the same everywhere — a provider that transfers to a
357
- * directory rather than to a dialled number points this at its own
358
- * resource, and a provider that can do neither leaves the affordance out.
359
- * `communication:CallKeypad` and `communication:CallTransfer` are there to
360
- * be reused by any provider that wants the plain ones.
361
- *
362
- * Both are absent when the host does not support overriding the canvas; a
363
- * tray must then not offer the affordance.
323
+ * itself. Canvas and tray are separate federated resources with no shared
324
+ * state, so the host holds this one value as a resource reference.
325
+ * Deliberately a reference, not an enum of known panels: a keypad or
326
+ * transfer form differs per provider — one may transfer via a directory and
327
+ * point at its own resource; one that can't leaves the affordance out.
328
+ * `communication:CallKeypad`/`communication:CallTransfer` are reusable plain ones.
329
+ * Both props absent = host does not support overriding; tray must not offer it.
364
330
  */
365
331
  canvasOverride?: FederatedResourceRef | null;
366
332
  onCanvasOverride?: (resource: FederatedResourceRef | null) => void;
@@ -385,18 +351,16 @@ export interface RemoteStreamEvent {
385
351
  sessionId: string;
386
352
  streamId: string;
387
353
  stream: MediaStream | null;
388
- speaker?: 'local' | 'remote';
354
+ speaker?: "local" | "remote";
389
355
  label?: string;
390
356
  }
391
357
  /**
392
- * Peer-to-peer WebRTC signaling envelope. Exchanged between two users in the
393
- * same tenant to negotiate a direct call — the media (audio) flows P2P; only
394
- * these small SDP/ICE setup messages transit the server (relayed 1:1 via
395
- * `Bridge.sse.push`). Transient: never persisted.
396
- *
358
+ * Peer-to-peer WebRTC signaling envelope between two users in the same tenant.
359
+ * Media flows P2P; only these small SDP/ICE messages transit the server
360
+ * (relayed 1:1 via `Bridge.sse.push`). Transient: never persisted.
397
361
  * - `offer`/`answer` → `data` is an `RTCSessionDescriptionInit`.
398
- * - `ice` → `data` is an `RTCIceCandidateInit` (or `null` = end-of-candidates).
399
- * - `bye` → `data` omitted; the sender tore the call down.
362
+ * - `ice` → `data` is an `RTCIceCandidateInit` (or `null` = end-of-candidates).
363
+ * - `bye` → `data` omitted; the sender tore the call down.
400
364
  */
401
365
  export type WebRtcSignalKind = "offer" | "answer" | "ice" | "bye" | "request";
402
366
  /** Request body the initiator/answerer POSTs to the signaling relay. */
@@ -410,17 +374,16 @@ export interface WebRtcSignalRequest {
410
374
  /** Sender display name, so the peer can label the call UI without a lookup. */
411
375
  fromName?: string;
412
376
  /**
413
- * Which peer connection this signal belongs to. `call` (default) is an audio
414
- * session handled by the transport provider; `file` is an AirDrop-style
415
- * RTCDataChannel transfer handled by the file-beam service; `monitor` is a
416
- * one-way "listen along" forward handled by the call-monitor service. Lets
417
- * one relay serve all three without the connection types colliding.
377
+ * Which peer connection this signal belongs to: `call` (default) = audio
378
+ * session via the transport provider; `file` = RTCDataChannel transfer via
379
+ * the file-beam service; `monitor` = one-way "listen along" via the
380
+ * call-monitor service. One relay serves all three without collisions.
418
381
  */
419
382
  channel?: "call" | "file" | "monitor";
420
383
  }
421
384
  /**
422
- * Broadcast (event `webrtc:callstate`) telling the tenant whether a user is
423
- * currently on a call, so a supervisor can see who is available to listen in.
385
+ * Broadcast (event `webrtc:callstate`) telling the tenant whether a user is on
386
+ * a call, so a supervisor can see who is available to listen in.
424
387
  */
425
388
  export interface CallStateChange {
426
389
  userId: string;
@@ -428,8 +391,8 @@ export interface CallStateChange {
428
391
  }
429
392
  /**
430
393
  * One ICE server entry. Structurally a subset of the browser's `RTCIceServer`,
431
- * but kept DOM-free so the comm server can build it too (server tsconfig has no
432
- * DOM lib). The client passes these straight to `new RTCPeerConnection`.
394
+ * but kept DOM-free so the comm server (no DOM lib) can build it too. The
395
+ * client passes these straight to `new RTCPeerConnection`.
433
396
  */
434
397
  export interface IceServerConfig {
435
398
  urls: string | string[];
@@ -437,8 +400,8 @@ export interface IceServerConfig {
437
400
  credential?: string;
438
401
  }
439
402
  /**
440
- * Response of `GET /webrtc/ice`: the STUN list plus TURN servers with
441
- * short-lived (per-user, time-limited) credentials, and how long they last.
403
+ * Response of `GET /webrtc/ice`: STUN list plus TURN servers with short-lived
404
+ * per-user credentials.
442
405
  */
443
406
  export interface IceConfigResponse {
444
407
  iceServers: IceServerConfig[];
@@ -451,8 +414,8 @@ export interface WebRtcSignalEvent extends WebRtcSignalRequest {
451
414
  from: string;
452
415
  }
453
416
  /**
454
- * Helper voor compactere intent-declaraties in `/provider/describe`.
455
- * defineIntent("mail", { targetSchemes: [MAILTO], transport: { kind: "dispatch" } })
417
+ * Helper for compact intent declarations in `/provider/describe`:
418
+ * `defineIntent("mail", { targetSchemes: [MAILTO], transport: { kind: "dispatch" } })`
456
419
  */
457
420
  export declare const defineIntent: (intent: string, opts: Omit<IntentCapability, "intent">) => IntentCapability;
458
421
  export interface ExternalId {
@@ -476,27 +439,26 @@ export interface MessageBody {
476
439
  }>;
477
440
  }
478
441
  /**
479
- * Adressering-envelope voor message-ops. Mail honoreert cc/bcc;
480
- * chat/SMS gebruikt alleen `to[0]`. Providers droppen velden die ze
481
- * niet ondersteunen.
442
+ * Addressing envelope for message ops. Mail honours cc/bcc; chat/SMS uses only
443
+ * `to[0]`. Providers drop fields they don't support.
482
444
  */
483
445
  export interface RecipientList {
484
- /** 1+ primary recipients (verplicht). */
446
+ /** 1+ primary recipients (required). */
485
447
  to: Uri[];
486
- /** Carbon-copy. Alleen mail-flow. */
448
+ /** Carbon copy. Mail flow only. */
487
449
  cc?: Uri[];
488
- /** Blind carbon-copy. Alleen mail-flow. */
450
+ /** Blind carbon copy. Mail flow only. */
489
451
  bcc?: Uri[];
490
452
  }
491
453
  /**
492
- * Uitgaande bijlage zoals de client 'm aanlevert: base64-content + naam +
493
- * mime-type. `content` is kale base64 (geen `data:`-prefix). Providers embedden
494
- * de string direct (Graph `contentBytes`, Gmail MIME-part) zonder re-encode.
454
+ * Outgoing attachment as the client supplies it. `content` is bare base64 (no
455
+ * `data:` prefix); providers embed the string directly (Graph `contentBytes`,
456
+ * Gmail MIME part) without re-encoding.
495
457
  */
496
458
  export interface OutgoingAttachment {
497
459
  filename: string;
498
460
  mimeType: string;
499
- /** Kale base64, zonder `data:<mime>;base64,`-prefix. */
461
+ /** Bare base64, without `data:<mime>;base64,` prefix. */
500
462
  content: string;
501
463
  }
502
464
  export interface NoteBody {
@@ -525,9 +487,9 @@ export interface CalendarEventInput {
525
487
  };
526
488
  }
527
489
  /**
528
- * Server-side ops uitgevoerd door de provider-app's server, getriggerd
529
- * door comm-server `provider/dispatch/`. Payloads dragen IDs, geen
530
- * volledige entities — provider resolved zelf via platform-api.
490
+ * Server-side ops executed by the provider app's server, triggered by
491
+ * comm-server `provider/dispatch/`. Payloads carry IDs, not full entities —
492
+ * the provider resolves them itself via platform-api.
531
493
  */
532
494
  export type ServerOp = {
533
495
  kind: "message.new";
@@ -541,7 +503,7 @@ export type ServerOp = {
541
503
  interactionId: string;
542
504
  activityId?: string;
543
505
  body: MessageBody;
544
- /** Override van default reply-targets (bv. reply-all). */
506
+ /** Overrides the default reply targets (e.g. reply-all). */
545
507
  recipients?: RecipientList;
546
508
  } | {
547
509
  kind: "message.comment";
@@ -624,11 +586,11 @@ export type ServerOp = {
624
586
  folderName?: string;
625
587
  };
626
588
  /**
627
- * Folder-DTO's — transport-shapes voor de generieke folder-capability.
628
- * Bewust géén persisted entities: de folder-tree en previews worden live
629
- * bij de provider opgehaald (TTL-cached client-side), nooit bulk-opgeslagen.
630
- * Providers mappen hun eigen model hierop: Outlook `mailFolders`,
631
- * Gmail `labels`, IMAP `folders`.
589
+ * Folder DTOs — transport shapes for the generic folder capability.
590
+ * Deliberately NOT persisted entities: the folder tree and previews are
591
+ * fetched live from the provider (TTL-cached client-side), never bulk-stored.
592
+ * Providers map their own model onto this (Outlook `mailFolders`, Gmail
593
+ * `labels`, IMAP `folders`).
632
594
  */
633
595
  export interface FolderNode {
634
596
  id: string;
@@ -652,14 +614,14 @@ export interface FolderMessagePreview {
652
614
  }
653
615
  export interface FolderMessagePage {
654
616
  items: FolderMessagePreview[];
655
- /** Opaque provider-cursor (bv. Graph `@odata.nextLink`). Afwezig = laatste pagina. */
617
+ /** Opaque provider cursor (e.g. Graph `@odata.nextLink`). Absent = last page. */
656
618
  nextCursor?: string;
657
619
  }
658
620
  /**
659
- * Een zoekbare externe bron (channel) voor de client-fan-out. Retourneerd door
660
- * `GET /search/sources`: elke door de user toegankelijke, ingeschakelde channel
661
- * waarvan de provider `FEATURE_REMOTE_SEARCH` declareert. De client vuurt per
662
- * bron parallel een `POST /search/mailbox` af (non-blocking).
621
+ * A searchable external source (channel) for the client fan-out. Returned by
622
+ * `GET /search/sources`: every user-accessible enabled channel whose provider
623
+ * declares `FEATURE_REMOTE_SEARCH`. The client fires a parallel
624
+ * `POST /search/mailbox` per source (non-blocking).
663
625
  */
664
626
  export interface MailboxSearchSource {
665
627
  channelId: string;
@@ -667,23 +629,22 @@ export interface MailboxSearchSource {
667
629
  displayName: string;
668
630
  }
669
631
  /**
670
- * Well-known `ProviderFeature.name` voor de folder-capability. Een provider die
671
- * folder.list/messages/import/move ondersteunt zet `{ name: FEATURE_FOLDER_MANAGEMENT, value: true }`
672
- * in `describe().features`; de client toont dan de Folders-nav voor dat channel.
632
+ * Well-known `ProviderFeature.name` for the folder capability. A provider
633
+ * supporting folder.list/messages/import/move sets it true in
634
+ * `describe().features`; the client then shows the Folders nav for that channel.
673
635
  */
674
636
  export declare const FEATURE_FOLDER_MANAGEMENT = "folder_management";
675
637
  /**
676
- * Well-known `ProviderFeature.name` voor de remote-search-capability. Een provider
677
- * die `mailbox.search` ondersteunt (de externe bron zelf doorzoeken, bv. Outlook
678
- * Graph `$search` of IMAP `SEARCH`) zet `{ name: FEATURE_REMOTE_SEARCH, value: true }`
679
- * in `describe().features`. De comm-server neemt de channels van zo'n provider mee
680
- * in `GET /search/sources`; de client fan-out er parallel op via `POST /search/mailbox`.
638
+ * Well-known `ProviderFeature.name` for remote search (`mailbox.search`, e.g.
639
+ * Outlook Graph `$search` or IMAP SEARCH). The comm-server includes such
640
+ * channels in `GET /search/sources`; the client fans out via `POST /search/mailbox`.
681
641
  */
682
642
  export declare const FEATURE_REMOTE_SEARCH = "remote_search";
683
643
  /**
684
- * Result-shape voor `IProvider.dispatch` en de comm-server `dispatchToProvider`-
685
- * helper. Discriminated op `ok`. Bewust niet strict-null-discriminated zodat
686
- * narrowing ook werkt zonder strictNullChecks (root tsconfig is non-strict).
644
+ * Result shape for `IProvider.dispatch` and the comm-server
645
+ * `dispatchToProvider` helper, discriminated on `ok`. Deliberately not
646
+ * strict-null-discriminated so narrowing also works without strictNullChecks
647
+ * (root tsconfig is non-strict).
687
648
  */
688
649
  export interface ServerResult<T = unknown> {
689
650
  ok: boolean;
@@ -694,13 +655,13 @@ export interface ServerResult<T = unknown> {
694
655
  message?: string;
695
656
  }
696
657
  export declare const UNSUPPORTED: ServerResult;
697
- /**
698
- * Transport-ops uitgevoerd in de browser-UA (SIP/WebRTC), getriggerd
699
- * door de frontend via `ITransportProvider.dispatch`. Geen server-
700
- * roundtrip — directe controle over de lokale stack.
701
- */
702
658
  /** The `kind` of a {@link TransportOp} — what a provider declares support for. */
703
659
  export type TransportOpKind = TransportOp["kind"];
660
+ /**
661
+ * Transport ops executed in the browser UA (SIP/WebRTC), triggered by the
662
+ * frontend via `ITransportProvider.dispatch`. No server round-trip — direct
663
+ * control over the local stack.
664
+ */
704
665
  export type TransportOp = {
705
666
  kind: "session.invite";
706
667
  accountId: string;
@@ -757,10 +718,10 @@ export interface OAuthConfig {
757
718
  authorizeEndpoint: string;
758
719
  tokenEndpoint: string;
759
720
  clientId: string;
760
- /** Server-side only — uit provider's secret-store. Mag leeg blijven voor PKCE. */
721
+ /** Server-side only — from the provider's secret store. May stay empty for PKCE. */
761
722
  clientSecret?: string;
762
723
  scopes: string[];
763
- /** Extra params voor authorize-URL (prompt, access_type, etc.). */
724
+ /** Extra params for the authorize URL (prompt, access_type, etc.). */
764
725
  authorizeParams?: Record<string, string>;
765
726
  refresh?: {
766
727
  bufferMs?: number;
@@ -791,35 +752,33 @@ export interface FormAuthCtx {
791
752
  organizationId: string;
792
753
  }
793
754
  /**
794
- * Server-side contract per communication-provider. Provider-apps
795
- * registreren zich via `Bridge.providers.role({ type: "provider", group: "communication" })`
796
- * en exposen routes die overeenkomen met deze methods (comm-server roept ze
797
- * via Bridge.rpc aan).
798
- *
799
- * Niet bedoeld voor frontend-consumptie — frontend praat alleen met
800
- * comm-server's `provider/*` en `account/*` endpoints.
755
+ * Server-side contract per communication provider. Provider apps register via
756
+ * `Bridge.providers.role({ type: "provider", group: "communication" })` and
757
+ * expose routes matching these methods (comm-server calls them via Bridge.rpc).
758
+ * Not for frontend consumption — the frontend talks only to comm-server's
759
+ * `provider/*` and `account/*` endpoints.
801
760
  */
802
761
  export interface IProvider {
803
762
  readonly id: string;
804
763
  describe(): Promise<ProviderDescription>;
805
764
  listChannels(orgId: string, userId?: string): Promise<unknown[]>;
806
765
  /**
807
- * Comm-server vraagt provider om huidige auth-config. Reden om dit op
808
- * IProvider te houden (i.p.v. statische registratie): clientId/secret/
809
- * scopes komen vaak uit secret-store of tenant-config — niet code-statisch.
766
+ * Comm-server asks the provider for its current auth config. Kept on
767
+ * IProvider (rather than static registration) because clientId/secret/scopes
768
+ * often come from a secret store or tenant config, not code.
810
769
  */
811
770
  personalAuth(ctx: PersonalAuthCtx): Promise<PersonalAuthConfig>;
812
771
  /**
813
- * Voor `mode: "form"` — provider valideert credentials en bouwt het
814
- * Account zelf. OAuth-mode hoeft dit niet; comm-server handelt token-
815
- * exchange volledig.
772
+ * For `mode: "form"` — the provider validates credentials and builds the
773
+ * Account itself. OAuth mode doesn't need this; comm-server handles token
774
+ * exchange fully.
816
775
  */
817
776
  completeFormAuth?(fields: Record<string, string>, ctx: FormAuthCtx): Promise<{
818
777
  accountId: string;
819
778
  }>;
820
779
  /**
821
- * Post-connect hook — provider mag eigen vervolgwerk doen (bv. MS
822
- * user-connection channel-binding) NA dat het Account is opgeslagen.
780
+ * Post-connect hook — provider may do follow-up work (e.g. MS
781
+ * user-connection channel binding) AFTER the Account is saved.
823
782
  */
824
783
  onAccountConnected?(account: {
825
784
  id: string;