@opencxh/domain 1.172.1 → 1.173.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.
Files changed (84) 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 +64 -35
  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 +5 -5
  11. package/dist/entities/ai-conversation/types.d.ts +12 -12
  12. package/dist/entities/ai-profile/types.d.ts +14 -21
  13. package/dist/entities/ai-settings/types.d.ts +12 -13
  14. package/dist/entities/analytics/index.d.ts +4 -4
  15. package/dist/entities/analytics/source.d.ts +1 -1
  16. package/dist/entities/analytics/usage.d.ts +23 -28
  17. package/dist/entities/artifact/blocks.d.ts +54 -69
  18. package/dist/entities/artifact/markdown.d.ts +2 -3
  19. package/dist/entities/artifact/types.d.ts +46 -54
  20. package/dist/entities/assignment/types.d.ts +76 -90
  21. package/dist/entities/channel/index.d.ts +1 -1
  22. package/dist/entities/channel/signature.d.ts +8 -9
  23. package/dist/entities/communication/index.d.ts +1 -1
  24. package/dist/entities/contact/index.d.ts +1 -1
  25. package/dist/entities/custom-field-def/types.d.ts +14 -14
  26. package/dist/entities/external-identity/types.d.ts +45 -50
  27. package/dist/entities/interaction/index.d.ts +1 -1
  28. package/dist/entities/interaction/types.d.ts +44 -47
  29. package/dist/entities/live-lens/types.d.ts +39 -44
  30. package/dist/entities/mcp/types.d.ts +53 -57
  31. package/dist/entities/memory/alias.d.ts +7 -7
  32. package/dist/entities/memory/browse.d.ts +21 -21
  33. package/dist/entities/memory/ingest.d.ts +24 -28
  34. package/dist/entities/memory/item.d.ts +53 -58
  35. package/dist/entities/memory/kind.d.ts +25 -25
  36. package/dist/entities/memory/query.d.ts +49 -51
  37. package/dist/entities/playbook/actor.d.ts +17 -17
  38. package/dist/entities/playbook/assignment.d.ts +54 -63
  39. package/dist/entities/playbook/index.d.ts +2 -2
  40. package/dist/entities/playbook/labels.d.ts +4 -4
  41. package/dist/entities/playbook/trigger-vars.d.ts +17 -15
  42. package/dist/entities/playbook/types.d.ts +174 -303
  43. package/dist/entities/resource-reminder/types.d.ts +8 -9
  44. package/dist/entities/time-entry/duration.d.ts +11 -11
  45. package/dist/entities/time-entry/types.d.ts +59 -59
  46. package/dist/entities/time-entry/work-type.d.ts +21 -24
  47. package/dist/entities/topic/examples.d.ts +26 -27
  48. package/dist/entities/topic/scope.d.ts +11 -12
  49. package/dist/entities/topic/types.d.ts +26 -28
  50. package/dist/entities/user/types.d.ts +24 -28
  51. package/dist/entities/webhook/types.d.ts +6 -6
  52. package/dist/entities/work/activity.d.ts +36 -0
  53. package/dist/entities/work/index.d.ts +1 -0
  54. package/dist/entities/work/keys.d.ts +25 -26
  55. package/dist/entities/work/ladder.d.ts +48 -52
  56. package/dist/entities/work/types.d.ts +108 -114
  57. package/dist/index.cjs +6 -6
  58. package/dist/index.d.ts +29 -28
  59. package/dist/index.js +1416 -1258
  60. package/dist/platform/account.d.ts +34 -38
  61. package/dist/platform/ai-tools.d.ts +48 -52
  62. package/dist/platform/api.d.ts +9 -10
  63. package/dist/platform/author.d.ts +7 -9
  64. package/dist/platform/capabilities.d.ts +3 -3
  65. package/dist/platform/communication.d.ts +163 -204
  66. package/dist/platform/context.d.ts +8 -8
  67. package/dist/platform/identity.d.ts +16 -19
  68. package/dist/platform/kernel.d.ts +1 -1
  69. package/dist/platform/manifest.d.ts +2 -2
  70. package/dist/platform/media.d.ts +13 -15
  71. package/dist/platform/permission.d.ts +39 -0
  72. package/dist/platform/permission.test.d.ts +1 -0
  73. package/dist/platform/presence.d.ts +30 -30
  74. package/dist/platform/provider.d.ts +14 -15
  75. package/dist/platform/resource-source.d.ts +43 -45
  76. package/dist/platform/resource.d.ts +17 -23
  77. package/dist/platform/scope.d.ts +35 -61
  78. package/dist/platform/services.d.ts +4 -4
  79. package/dist/platform/storage.d.ts +1 -1
  80. package/dist/platform/sync-source.d.ts +196 -216
  81. package/dist/platform/transcript-cadence.d.ts +37 -41
  82. package/dist/platform/ui.d.ts +6 -6
  83. package/dist/text/endpoint.d.ts +11 -27
  84. package/package.json +3 -2
@@ -2,26 +2,26 @@ import { InteractionParticipant } from '../../platform/communication';
2
2
  import { ActivityType, InteractionStatus } from '../activity/types';
3
3
  export interface ActivityPreview {
4
4
  activityId: string;
5
- /** Ook een door een app gedeclareerd type; de union houdt alleen de autocomplete. */
5
+ /** Also an app-declared type; the union only keeps the autocomplete. */
6
6
  type: ActivityType | (string & {});
7
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.
8
+ * The line as the server could build it. For built-in types this is the text itself; for a
9
+ * declared type the already-resolved version in the org language.
10
10
  *
11
- * Server-consumenten (zoek, assistent, analytics) hebben geen gebruikerstaal en lezen
12
- * dit veld. De client geeft de voorkeur aan {@link snippetKey}.
11
+ * Server consumers (search, assistant, analytics) have no user language and read this field.
12
+ * The client prefers {@link snippetKey}.
13
13
  */
14
14
  snippet: string;
15
15
  authorName: string;
16
16
  direction: "inbound" | "outbound" | "internal" | "none";
17
17
  createdAt: number;
18
18
  /**
19
- * Vertaalsleutel plus al uitgelezen parameters, voor types die er een declareerden.
19
+ * Translation key plus already-extracted parameters, for types that declared one.
20
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.)
21
+ * The preview is computed and stored once on the server, but every reader has their own
22
+ * language. Keeping the key instead of only the sentence lets the inbox list draw it in the
23
+ * viewer's language. (The built-in snippets are still hardcoded Dutch — the same construction
24
+ * fixes that later.)
25
25
  */
26
26
  snippetKey?: string;
27
27
  snippetParams?: Record<string, string>;
@@ -70,49 +70,47 @@ export interface Interaction {
70
70
  assignedTopicId?: string;
71
71
  channelId?: string;
72
72
  /**
73
- * Afgeleide match-sleutel `<scheme>:<resource>` van het channel-adres.
74
- * Stabiel over channel-relink heen (nieuwe channelId, zelfde adres), zodat de
75
- * koppeling met het channel niet verloren gaat. Server-side afgeleid uit
76
- * `channel.addressUri`.
73
+ * Derived match key `<scheme>:<resource>` of the channel address. Stable across a channel relink
74
+ * (new channelId, same address), so the link with the channel is not lost. Derived server-side
75
+ * from `channel.addressUri`.
77
76
  */
78
77
  channelUriKey?: string;
79
78
  title: string;
80
- /** Eén definitie, gedeeld met `INTERACTION_STATUS_CHANGED`, zodat de tijdlijn elke
81
- * overgang kan vastleggen die dit veld kan maken. */
79
+ /** One definition, shared with `INTERACTION_STATUS_CHANGED`, so the timeline can record every
80
+ * transition this field can make. */
82
81
  status: InteractionStatus;
83
82
  /**
84
- * UX-shape van de interactie. "thread" = email-stijl met aparte replyable
85
- * berichten (inline reply per activity). "conversation" = chat-stijl met
86
- * doorlopende stream en één bottom-composer. Backend mag dit zetten; bij
87
- * afwezigheid leidt de frontend het af uit `remoteParty.scheme`.
83
+ * UX shape of the interaction. "thread" = email style with separately replyable messages (inline
84
+ * reply per activity). "conversation" = chat style with a continuous stream and one bottom
85
+ * composer. The backend may set this; when absent the frontend derives it from
86
+ * `remoteParty.scheme`.
88
87
  */
89
88
  shape?: "thread" | "conversation";
90
89
  priority: "urgent" | "high" | "normal" | "low";
91
90
  /**
92
- * "Headline" tegenpartij — voor 1-1 (mail/sms/direct chat) de enige
93
- * counterparty; voor group-chats/meetings de groep- of meeting-Uri.
91
+ * "Headline" counterparty — for 1-1 (mail/sms/direct chat) the only counterparty; for group
92
+ * chats and meetings the group or meeting Uri.
94
93
  */
95
94
  remoteParty: InteractionParticipant;
96
95
  /**
97
- * Alle deelnemers behalve het eigen channel. Optioneel voor backward-
98
- * compatibility met bestaande interacties; voor 1-1 mag leeg of
99
- * `[remoteParty]` zijn (UI valt terug op `remoteParty`). Voor group-chats
100
- * en meetings hier de volledige lijst inclusief rollen (cc/bcc/organizer/…).
96
+ * Every participant except our own channel. Optional for backward compatibility with existing
97
+ * interactions; for 1-1 it may be empty or `[remoteParty]` (the UI falls back to
98
+ * `remoteParty`). For group chats and meetings the full list here, roles included
99
+ * (cc/bcc/organizer/…).
101
100
  */
102
101
  participants?: InteractionParticipant[];
103
102
  /**
104
- * Canonieke identiteitssleutels van de tegenpartij — de andere helft van `channelUriKey`,
105
- * dat onze eigen kant canonicaliseert. Geïndexeerd, zodat "elk gesprek met dit adres, dit
106
- * nummer of dit domein" een indexvraag is en geen scan.
103
+ * Canonical identity keys of the counterparty — the other half of `channelUriKey`, which
104
+ * canonicalizes our own side. Indexed, so "every conversation with this address, this number or
105
+ * this domain" is an index question and not a scan.
107
106
  *
108
- * Bevat `mailto:`/`tel:`-sleutels, een `domain:<registreerbaar>`-pseudosleutel voor
109
- * niet-publieke e-maildomeinen, en `company:<id>`/`contact:<id>` wanneer een mens een
110
- * koppeling expliciet heeft gelegd.
107
+ * Holds `mailto:`/`tel:` keys, a `domain:<registrable>` pseudo key for non-public email domains,
108
+ * and `company:<id>`/`contact:<id>` when a person made a link explicitly.
111
109
  *
112
- * **Een sleutel wordt nooit onwaar.** "Dit adres kwam voor in dit gesprek" blijft altijd
113
- * gelden, terwijl een afgeleide `companyId` onwaar wordt zodra iemand een bedrijf aanmaakt,
114
- * samenvoegt of corrigeert — en dan backfill zou vragen. Los een identiteit bij het lezen op
115
- * naar zijn sleutels en het antwoord omvat ook gesprekken van vóór die identiteit bestond.
110
+ * **A key never becomes false.** "This address appeared in this conversation" always keeps
111
+ * holding, whereas a derived `companyId` becomes false as soon as someone creates, merges or
112
+ * corrects a company — and would then demand a backfill. Resolve an identity to its keys at read
113
+ * time and the answer also covers conversations from before that identity existed.
116
114
  */
117
115
  partyKeys?: string[];
118
116
  source?: InteractionSource;
@@ -129,16 +127,15 @@ export interface Interaction {
129
127
  lastActivityAt?: number;
130
128
  lastActivityPreview?: ActivityPreview;
131
129
  /**
132
- * Epoch-ms van de eerste uitgaande reactie op deze interactie. Eenmalig gezet door
133
- * `applyActivityToInteraction` bij de eerste outbound-activity; drijft de first-response-time
134
- * analytics-metric (firstResponseAt - createdAt). Afwezig = nog geen reactie.
130
+ * Epoch ms of the first outgoing reply to this interaction. Set once by
131
+ * `applyActivityToInteraction` on the first outbound activity; drives the first-response-time
132
+ * analytics metric (firstResponseAt - createdAt). Absent = no reply yet.
135
133
  */
136
134
  firstResponseAt?: number;
137
135
  /**
138
- * Provider-side folder waar deze thread onder gearchiveerd staat (mail).
139
- * Gezet door de sync (folder-membership van already-engaged threads) en door
140
- * `folder.move`. Drijft de Folders-nav-filter en de two-way move. Afwezig =
141
- * niet in een specifieke folder (of provider zonder folder-capability).
136
+ * Provider-side folder this thread is archived under (mail). Set by the sync (folder membership
137
+ * of already-engaged threads) and by `folder.move`. Drives the Folders nav filter and the two-way
138
+ * move. Absent = not in a specific folder (or a provider without folder capability).
142
139
  */
143
140
  folderRef?: {
144
141
  channelId: string;
@@ -146,10 +143,10 @@ export interface Interaction {
146
143
  name: string;
147
144
  };
148
145
  /**
149
- * Epoch-ms tot wanneer de interactie gesnoozed is. Zolang `snoozedTill > now`
150
- * wordt de interactie uit de lijst gefilterd (status is dan "snoozed"). Een
151
- * cron-job wekt verlopen snoozes: zet status terug naar "open", bumpt
152
- * `lastActivityAt` en wist `snoozedTill` (op null). `null`/afwezig = niet gesnoozed.
146
+ * Epoch ms until which the interaction is snoozed. While `snoozedTill > now` the interaction is
147
+ * filtered out of the list (its status is then "snoozed"). A cron job wakes expired snoozes: sets
148
+ * status back to "open", bumps `lastActivityAt` and clears `snoozedTill` (to null). `null`/absent
149
+ * = not snoozed.
153
150
  */
154
151
  snoozedTill?: number | null;
155
152
  }
@@ -1,79 +1,74 @@
1
- import { OwnerScope } from '../scope/types';
2
1
  import { ConditionStep, ForEachStep, LookupStep, ParallelStep, Step } from '../playbook/types';
2
+ import { OwnerScope } from '../scope/types';
3
3
  /**
4
- * Een **leesbaan**: wat er meeleest tijdens een levend gesprek, en aan wie het iets toont.
5
- *
6
- * **Waarom dit een eigen entity is en geen playbook met een `stream`-trigger.** Dat was het:
7
- * `PlaybookTrigger` had een arm `{ kind: "stream" }` met opzet zonder velden, en zo'n rij deed
8
- * daarna niets van wat een playbook doet — geen run, geen job, geen lock, geen goedkeuringspoort,
9
- * geen `finalizeRun`. `live-assist` bouwde met de hand een `RunContext` en riep `executeFlow`
10
- * direct aan.
4
+ * A **read lane**: what listens along during a live conversation, and who it shows something to.
11
5
  *
12
- * De prijs stond in de velden: `autonomy`, `agentId`, `procedure`, `stats`, `lastRunAt` en
13
- * `debounceMs` waren voor zo'n rij allemaal betekenisloos, en `steps` mocht maar vier van de tien
14
- * staptypes bevatten. Iedere lezer van `Playbook` moest dus impliciet weten of hij naar een
15
- * automatisering of naar een leesbaan keek, met twee functies in domain als vangnet en een
16
- * tabel-scan-plus-cache als selectie.
6
+ * **Why this is its own entity and not a playbook with a `stream` trigger.** It used to be one:
7
+ * `PlaybookTrigger` had a deliberately field-less `{ kind: "stream" }` arm, and such a row then did
8
+ * none of what a playbook does — no run, no job, no lock, no approval gate, no `finalizeRun`.
17
9
  *
18
- * Definities horen gescheiden te zijn naar hun **runtime**, niet naar hun editor. Een leesbaan
19
- * heeft geen run, dus is het geen playbook.
10
+ * The price was in the fields: `autonomy`, `agentId`, `procedure`, `stats`, `lastRunAt` and
11
+ * `debounceMs` were all meaningless for such a row, and `steps` could hold only four of the ten
12
+ * step types. Every reader of `Playbook` had to implicitly know whether it was looking at an
13
+ * automation or at a read lane.
20
14
  *
21
- * Wat hij deelt met een playbook is de **staptaal** en de executor — niet de tabel.
15
+ * Definitions belong separated by their **runtime**, not by their editor. A read lane has no run,
16
+ * so it is not a playbook. What it shares with a playbook is the **step language** and the
17
+ * executor — not the table.
22
18
  */
23
19
  /**
24
- * Wat een leesbaan mag doen: opzoeken, kiezen, en dat desnoods parallel of per item.
20
+ * What a read lane may do: look up, choose, and do so in parallel or per item if needed.
25
21
  *
26
- * Dit is een **echt subtype** van {@link Step} en geen lijst met toegestane namen. Alles wat
27
- * schrijft (`action`), een model kost (`classify`, `generate`, `agent`) of kan pauzeren
28
- * (`wait-for-*`) valt erbuiten — en pauzeren kán hier ook niet, want er is geen rij om op te
29
- * hervatten.
22
+ * This is a **real subtype** of {@link Step} and not a list of allowed names. Anything that writes
23
+ * (`action`), costs a model call (`classify`, `generate`, `agent`) or can pause (`wait-for-*`) is
24
+ * outside it — and pausing cannot work here anyway, because there is no row to resume on.
30
25
  *
31
- * Dat het een type is en geen controle is de winst: een leesbaan die zou schrijven is nu een
32
- * typefout bij het bouwen, in plaats van een validatie die pas bij het opslaan (of erger: bij de
33
- * eerste ronde, tijdens een telefoongesprek) iets zegt.
26
+ * That it is a type and not a check is the win: a read lane that would write is now a type error
27
+ * while building, instead of a validation speaking up at save time (or worse: on the first round,
28
+ * during a phone call).
34
29
  *
35
- * Wie tijdens een gesprek iets wíl laten schrijven, doet dat met een playbook op een
36
- * `activity`-trigger. Die heeft een run, een eigenaar en een goedkeuringspoort.
30
+ * Anyone who *does* want something written during a call uses a playbook on an `activity` trigger.
31
+ * That one has a run, an owner and an approval gate.
37
32
  */
38
33
  export type ReadStep = LookupStep | ConditionStep | ForEachStep<ReadStep> | ParallelStep<ReadStep>;
39
- /** De staptypes die een leesbaan mag bevatten — de runtime-tegenhanger van {@link ReadStep}. */
34
+ /** The step types a read lane may hold — the runtime counterpart of {@link ReadStep}. */
40
35
  export declare const READ_STEP_TYPES: readonly string[];
41
36
  export interface LiveLens {
42
37
  id: string;
43
38
  organizationId: string;
44
- /** Voor wie deze baan loopt. De werkmodus selecteert de team-banen; zie {@link selectLenses}. */
39
+ /** Who this lane runs for. The work mode selects the team lanes; see {@link selectLenses}. */
45
40
  ownerScope: OwnerScope;
46
41
  name: string;
47
42
  description?: string;
48
43
  enabled: boolean;
49
- /** Wat er opgezocht wordt. Alleen lezen — zie {@link ReadStep}. */
44
+ /** What gets looked up. Read-only — see {@link ReadStep}. */
50
45
  steps: ReadStep[];
51
46
  createdBy: string;
52
47
  }
53
48
  /**
54
- * Waarom deze stappenlijst geen leesbaan mag zijn, of `null` als hij het mag.
49
+ * Why this step list may not be a read lane, or `null` when it may.
55
50
  *
56
- * Nodig ondanks {@link ReadStep}, want een `POST` levert JSON en daar helpt een type niet: dit is
57
- * de poort bij het **opslaan**. Hij draaide voorheen bij élke ronde, elke acht seconden per lopend
58
- * gesprek, om een eigenschap te controleren die bij het opslaan al vaststond.
51
+ * Needed despite {@link ReadStep}, because a `POST` delivers JSON and a type does not help there:
52
+ * this is the gate at **save** time. It used to run on *every* round, every eight seconds per live
53
+ * call, to check a property that was already settled at save time.
59
54
  *
60
- * Een reden en geen boolean, omdat een geweigerde baan anders stil niets doet — precies de klasse
61
- * fout die "ik heb hem aangezet en er komt niets" onbeantwoordbaar maakt.
55
+ * A reason and not a boolean, because a refused lane otherwise silently does nothing — exactly the
56
+ * class of bug that makes "I switched it on and nothing comes" unanswerable.
62
57
  */
63
58
  export declare function readStepError(steps: readonly Step[]): string | null;
64
59
  /**
65
- * De leesbanen die bij déze medewerker op dít moment horen.
60
+ * The read lanes belonging to *this* agent at *this* moment.
66
61
  *
67
- * De werkmodus is wat een team-baan selecteert: zonder die keuze zouden bij iemand die in Sales
68
- * én Support zit beide baansets tegelijk meelezen — het probleem waarvoor de werkmodus bestaat.
69
- * Persoonlijke en org-brede banen staan er los van.
62
+ * The work mode is what selects a team lane: without that choice, someone in both Sales and
63
+ * Support would have both lane sets listening at once — the problem the work mode exists for.
64
+ * Personal and org-wide lanes are independent of it.
70
65
  *
71
- * Merk op dat de *acting identity* van een ronde altijd de medewerker zelf is, ook bij een team-
72
- * of org-brede baan: hij ziet tijdens zijn eigen gesprek nooit meer dan hij mag zien. De eigenaar
73
- * bepaalt hier alleen wélke banen er lopen.
66
+ * Note that the *acting identity* of a round is always the agent themselves, also for a team or
67
+ * org-wide lane: during their own call they never see more than they may see. The owner only
68
+ * decides *which* lanes run.
74
69
  *
75
- * Geen `skipped`-uitkomst meer: die bestond om een baan te melden die niet mocht meelezen, en dat
76
- * kan niet meer bestaan — `readStepError` weigert hem bij het opslaan.
70
+ * No `skipped` outcome any more: that existed to report a lane not allowed to listen, which can no
71
+ * longer exist — `readStepError` refuses it at save time.
77
72
  */
78
73
  export declare function selectLenses<T extends Pick<LiveLens, "enabled" | "ownerScope">>(lenses: readonly T[], lens: {
79
74
  userId: string;
@@ -1,40 +1,39 @@
1
1
  /** How the AI server authenticates to an MCP server. */
2
2
  export type McpAuthMode = "header" | "oauth";
3
3
  /**
4
- * @deprecated Gebruik {@link McpCredentialScope}. Blijft één release staan omdat bestaande
5
- * rijen `oauth.scope` dragen; `mcpCredentialScope()` leest beide.
4
+ * @deprecated Use {@link McpCredentialScope}. Stays one release because existing rows carry
5
+ * `oauth.scope`; `mcpCredentialScope()` reads both.
6
6
  */
7
7
  export type McpOAuthAccountScope = "user" | "org";
8
8
  /**
9
- * **Hoe deze connector aan zijn credential komt:** één gedeeld organisatie-credential, of
10
- * iedereen brengt zijn eigen mee.
9
+ * **How this connector gets its credential:** one shared organisation credential, or everyone
10
+ * brings their own.
11
11
  *
12
- * Dit is de tweede van de drie scope-vragen, en de enige die op de connector hoort:
12
+ * The second of the three scope questions, and the only one belonging on the connector:
13
13
  *
14
- * | Vraag | Waar |
14
+ * | Question | Where |
15
15
  * |---|---|
16
- * | Van wie is deze *rij*? | `ownerUserId` / `ManagedAccount.userId` (afwezig = gedeeld) |
17
- * | Hoe komt hij aan een credential? | **`credentialScope`** — hier |
18
- * | Met wie is de *resource* gedeeld? | `ownerScope` op contacten, werkitems, geheugens |
16
+ * | Whose *row* is this? | `ownerUserId` / `ManagedAccount.userId` (absent = shared) |
17
+ * | How does it get a credential? | **`credentialScope`** — here |
18
+ * | Who is the *resource* shared with? | `ownerScope` on contacts, work items, memories |
19
19
  *
20
- * Het is een **configuratiekeuze van de organisatie**, geen eigenschap van de vendor: dezelfde
21
- * MCP-server kan met één service-account of met een token per gebruiker draaien. Hij hoort dus op
22
- * de connectorrij, want daar woont configuratie.
20
+ * It is a **configuration choice of the organisation**, not a property of the vendor: the same MCP
21
+ * server can run on one service account or on a token per user. So it belongs on the connector
22
+ * row, where configuration lives.
23
23
  *
24
- * De consequentie die hem belangrijk maakt: **een onbemande run (sync, cron, playbook) heeft geen
25
- * handelende gebruiker en kan dus nooit bij een `"per-user"`-credential.** Dat is vooraf te
26
- * controleren en uit te leggen, in plaats van te eindigen als een ronde die nul tools zag.
24
+ * The consequence that makes it matter: **an unattended run (sync, cron, playbook) has no acting
25
+ * user and can therefore never reach a `"per-user"` credential.** That is checkable and
26
+ * explainable up front, instead of ending as a round that saw zero tools.
27
27
  *
28
- * `personalConnect` is hier expliciet géén onderdeel van: dat is een *permissie* (mag een lid zijn
29
- * eigen token aan een beheerder-gedefinieerde server hangen), niet een scope. Alleen zinvol samen
30
- * met `"per-user"`.
28
+ * `personalConnect` is explicitly not part of this: that is a *permission* (may a member hang
29
+ * their own token on an admin-defined server), not a scope. Only meaningful with `"per-user"`.
31
30
  */
32
31
  export type McpCredentialScope = "shared" | "per-user";
33
32
  /**
34
- * De credential-scope van een server, met terugval op de oude velden.
33
+ * A server's credential scope, falling back to the old fields.
35
34
  *
36
- * Bestaande rijen dragen `oauth.scope`; nieuwe dragen `credentialScope`. Eén functie zodat
37
- * "wie brengt het token mee" nergens twee keer wordt uitgerekend.
35
+ * Existing rows carry `oauth.scope`; new ones carry `credentialScope`. One function, so "who
36
+ * brings the token" is never computed twice.
38
37
  */
39
38
  export declare function mcpCredentialScope(server: {
40
39
  credentialScope?: McpCredentialScope;
@@ -44,12 +43,11 @@ export declare function mcpCredentialScope(server: {
44
43
  };
45
44
  }): McpCredentialScope;
46
45
  /**
47
- * De naamconventie van een MCP-tool, op één plek.
46
+ * The naming convention of an MCP tool, in one place.
48
47
  *
49
- * Een tool heet `mcp__<connectorId>__<toolnaam>`. Het connector-id is per organisatie
50
- * willekeurig, dus een app kan de naam niet hardcoderen — maar zodra hij het id *heeft*
51
- * (bijvoorbeeld omdat de koppeling het expliciet bewaart) is dit een pure string en is er
52
- * geen enkele lookup nodig.
48
+ * A tool is called `mcp__<connectorId>__<toolname>`. The connector id is arbitrary per
49
+ * organisation, so an app cannot hardcode the name — but once it *has* the id (because the
50
+ * connection stores it explicitly, say) this is a pure string and no lookup is needed at all.
53
51
  */
54
52
  export declare function mcpToolPrefix(connectorId: string): string;
55
53
  /**
@@ -75,11 +73,11 @@ export interface McpServerConfig {
75
73
  organizationId: string;
76
74
  name: string;
77
75
  /**
78
- * De catalogus-sleutel waar deze verbinding uit komt, als hint voor pickers.
76
+ * The catalog key this connection came from, as a hint for pickers.
79
77
  *
80
- * Stond wél op de write-body maar niet op de read view, en dáárom moest het "welke verbinding is
81
- * Asana"-antwoord server-side verzonnen worden: een client kón het niet zien. Nu wel, en dan is
82
- * voorfilteren gewoon een `filter` in de UI.
78
+ * It was on the write body but not on the read view, which is why the "which connection is
79
+ * Asana" answer had to be invented server-side: a client could not see it. Now it can, and
80
+ * pre-filtering is just a `filter` in the UI.
83
81
  */
84
82
  catalogKey?: string;
85
83
  /** Only Streamable HTTP transport is supported for server-side connections. */
@@ -93,21 +91,21 @@ export interface McpServerConfig {
93
91
  /** OAuth settings, present when `authMode === "oauth"`. */
94
92
  oauth?: McpOAuthClientView;
95
93
  /**
96
- * Hoe deze connector aan zijn credential komt. Afwezig op oude rijen — lees hem altijd via
97
- * {@link mcpCredentialScope}, nooit rechtstreeks.
94
+ * How this connector gets its credential. Absent on old rows — always read it through
95
+ * {@link mcpCredentialScope}, never directly.
98
96
  */
99
97
  credentialScope?: McpCredentialScope;
100
98
  /**
101
- * Van wie is deze RIJ: afwezig = door de organisatie gedefinieerd (beheerder), gezet = de
102
- * eigen custom server van die gebruiker. Bepaalt wie hem mag wijzigen en waar hij zichtbaar
103
- * is — los van {@link McpCredentialScope}, dat over het credential gaat.
99
+ * Whose ROW this is: absent = defined by the organisation (an admin), set = that user's own
100
+ * custom server. Decides who may change it and where it is visible — separate from
101
+ * {@link McpCredentialScope}, which is about the credential.
104
102
  */
105
103
  ownerUserId?: string;
106
104
  /**
107
- * PERMISSIE, geen scope: mag een lid zijn eigen credential hangen aan deze door de
108
- * organisatie gedefinieerde server (de "catalogus")? Alleen zinvol bij
109
- * `credentialScope === "per-user"`. Bewust niet afgeleid — dat zou het recht stil
110
- * verruimen voor servers waar de beheerder het juist niet toestond.
105
+ * A PERMISSION, not a scope: may a member hang their own credential on this
106
+ * organisation-defined server (the "catalog")? Only meaningful with
107
+ * `credentialScope === "per-user"`. Deliberately not derived — that would silently widen the
108
+ * right for servers where the admin did not allow it.
111
109
  */
112
110
  personalConnect?: boolean;
113
111
  }
@@ -140,33 +138,32 @@ export interface McpCatalogEntry {
140
138
  scope?: McpOAuthAccountScope;
141
139
  scopes?: string[];
142
140
  };
143
- /** De voorgestelde default bij het toevoegen. Afwezig = afleiden uit `oauth.scope`. */
141
+ /** The suggested default when adding. Absent = derive from `oauth.scope`. */
144
142
  credentialScope?: McpCredentialScope;
145
143
  }
146
144
  /**
147
- * Wat een app over een **gekozen** connector mag weten.
145
+ * What an app may know about a **chosen** connector.
148
146
  *
149
- * Dit is een preflight, geen zoekopdracht: je komt hier met een id dat iemand bij het
150
- * configureren heeft vastgelegd, en de vraag is alleen "kan ik hem nog gebruiken". Een lookup
151
- * op primary key, dus deterministisch van constructie — anders dan de eerdere zoekopdracht op
152
- * catalogus-sleutel, die bij twee kandidaten een willekeurige winnaar koos.
147
+ * A preflight, not a search: you arrive with an id someone recorded while configuring, and the
148
+ * question is only "can I still use it". A lookup on primary key, so deterministic by
149
+ * construction — unlike the earlier search by catalog key, which picked an arbitrary winner
150
+ * whenever there were two candidates.
153
151
  */
154
152
  export interface McpConnectorDescribe {
155
153
  id: string;
156
154
  name: string;
157
- /** Alleen als hij uit de catalogus komt. */
155
+ /** Only when it came from the catalog. */
158
156
  catalogKey?: string;
159
157
  enabled: boolean;
160
158
  credentialScope: McpCredentialScope;
161
159
  /**
162
- * Er bestaat een gedeeld organisatie-credential.
160
+ * A shared organisation credential exists.
163
161
  *
164
- * De enige vorm die een onbemande run kan gebruiken: die heeft geen handelende gebruiker en
165
- * kan dus niet bij een persoonlijk token. `false` bij een `"per-user"`-connector, ook als
166
- * tien mensen persoonlijk verbonden zijn.
162
+ * The only form an unattended run can use: it has no acting user and so cannot reach a personal
163
+ * token. `false` on a `"per-user"` connector, even when ten people are personally connected.
167
164
  */
168
165
  sharedCredential: boolean;
169
- /** `mcp__<id>__`, hetzelfde als {@link mcpToolPrefix} — meegegeven zodat de beller niets rekent. */
166
+ /** `mcp__<id>__`, same as {@link mcpToolPrefix} — passed along so the caller computes nothing. */
170
167
  toolPrefix: string;
171
168
  }
172
169
  /** Body accepted by the create/update endpoints (write shape, distinct from the read view). */
@@ -174,13 +171,12 @@ export interface McpServerInput {
174
171
  name?: string;
175
172
  url?: string;
176
173
  /**
177
- * De catalogus-sleutel waar dit uit komt ({@link McpCatalogEntry.key}).
174
+ * The catalog key this came from ({@link McpCatalogEntry.key}).
178
175
  *
179
- * **Een hint, geen resolutie.** Hij filtert de connector-picker ("welke van jouw
180
- * verbindingen is Asana") en voedt de "al toegevoegd"-status in de catalogus. Wie een
181
- * connector nodig heeft bewaart het connector-**id** expliciet en gebruikt
182
- * {@link mcpToolPrefix} — een zoekopdracht op key kan bij twee kandidaten geen winnaar
183
- * kiezen en heeft dat eerder ook niet gedaan.
176
+ * **A hint, not a resolution.** It filters the connector picker ("which of your connections is
177
+ * Asana") and feeds the "already added" status in the catalog. Anything needing a connector
178
+ * stores the connector **id** explicitly and uses {@link mcpToolPrefix} — a search by key cannot
179
+ * pick a winner with two candidates, and never could.
184
180
  */
185
181
  catalogKey?: string;
186
182
  enabled?: boolean;
@@ -1,19 +1,19 @@
1
1
  import { MemorySubjectKey } from './item';
2
2
  /**
3
- * Twee subjects die hetzelfde blijken te zijn (een merge van interacties, later een echte
4
- * identiteitslaag). Het geheugen verhuist niet: de alias wordt bij het lezen opgelost.
3
+ * Two subjects that turn out to be the same (a merge of interactions, later a real identity
4
+ * layer). The memory does not move: the alias is resolved at read time.
5
5
  *
6
- * **Eén niveau diep by construction**: een alias wiens `canonical` zelf een alias is wordt
7
- * geweigerd bij het schrijven. Resolutie is daarmee twee queries en nooit recursief — geen
8
- * cyclus-detectie, geen diepte-limiet, geen verrassing op het hete pad.
6
+ * **One level deep by construction**: an alias whose `canonical` is itself an alias is refused at
7
+ * write time. Resolution is therefore two queries and never recursive — no cycle detection, no
8
+ * depth limit, no surprise on the hot path.
9
9
  */
10
10
  export interface MemorySubjectAlias {
11
11
  id: string;
12
12
  organizationId: string;
13
- /** Het subject dat is opgegaan in `canonical`. Unique per org. */
13
+ /** The subject that was absorbed into `canonical`. Unique per org. */
14
14
  subject: MemorySubjectKey;
15
15
  canonical: MemorySubjectKey;
16
- /** De app die de samenvoeging meldde. */
16
+ /** The app that reported the merge. */
17
17
  source: string;
18
18
  createdAt?: number;
19
19
  }
@@ -1,38 +1,38 @@
1
1
  import { MemoryItem, MemoryKindId, MemoryVisibility } from './item';
2
2
  /**
3
- * Het beheer-contract: **alles** wat er in het geheugen van deze organisatie staat, plat.
3
+ * The admin contract: **everything** in this organisation's memory, flat.
4
4
  *
5
- * Bewust géén tweede `MemoryQuery`. Dat contract is de retrieval-engine — ranking, embeddings,
6
- * tekenbudget, autorisatie per subject — en beantwoordt "wat is hier relevant". Deze vraagt
7
- * "wat staat er". Dezelfde route zou beide slechter doen: de engine moet mogen wegfilteren wat
8
- * niet scoort, en een beheerpagina mag juist niets stilhouden.
5
+ * Deliberately not a second `MemoryQuery`. That contract is the retrieval engine — ranking,
6
+ * embeddings, character budget, authorization per subject — and answers "what is relevant here".
7
+ * This one asks "what is there". One route would do both worse: the engine must be allowed to
8
+ * filter out what does not score, and an admin page must keep nothing quiet.
9
9
  */
10
10
  export interface MemoryBrowseQuery {
11
- /** Exacte soort. Leeg = alle. */
11
+ /** Exact kind. Empty = all of them. */
12
12
  kind?: MemoryKindId;
13
- /** Schrijvende app (`ai`, `comms`, `context`, …). */
13
+ /** Writing app (`ai`, `comms`, `context`, …). */
14
14
  source?: string;
15
- /** Het deel vóór de `:` van het subject — `interaction`, `contact`, `company`. */
15
+ /** The part before the subject's `:` — `interaction`, `contact`, `company`. */
16
16
  subjectKind?: string;
17
- /** Exact subject, bv. `contact:c_9`. Wint van {@link subjectKind}. */
17
+ /** Exact subject, e.g. `contact:c_9`. Beats {@link subjectKind}. */
18
18
  subject?: string;
19
19
  visibility?: MemoryVisibility;
20
- /** Alleen items met `occurredAt >= since` (ms). */
20
+ /** Only items with `occurredAt >= since` (ms). */
21
21
  since?: number;
22
- /** Scan-cap. Geklemd op {@link MAX_MEMORY_BROWSE}. */
22
+ /** Scan cap. Clamped to {@link MAX_MEMORY_BROWSE}. */
23
23
  limit?: number;
24
24
  }
25
25
  /**
26
- * Harde bovengrens op één beheer-scan.
26
+ * Hard upper bound on one admin scan.
27
27
  *
28
- * Er is geen full-text-operator in deze datastore, dus vrij zoeken gebeurt ná het ophalen. Zonder
29
- * cap zou een organisatie met tienduizenden items haar hele geheugen door één response persen.
30
- * Wordt de cap geraakt, dan zegt {@link MemoryBrowseResult.truncated} dat — stil afkappen op een
31
- * pagina die "alles" belooft is de ene fout die hier niet mag.
28
+ * There is no full-text operator in this datastore, so free search happens after fetching. Without
29
+ * a cap an organisation with tens of thousands of items would squeeze its whole memory through one
30
+ * response. When the cap is hit, {@link MemoryBrowseResult.truncated} says so — silently
31
+ * truncating on a page promising "everything" is the one mistake not allowed here.
32
32
  */
33
33
  export declare const MAX_MEMORY_BROWSE = 1000;
34
34
  export interface MemoryBrowseFacets {
35
- /** Bronnen die in deze scan voorkomen, met hun aantal. Aflopend. */
35
+ /** Sources occurring in this scan, with their count. Descending. */
36
36
  sources: Array<{
37
37
  value: string;
38
38
  count: number;
@@ -48,13 +48,13 @@ export interface MemoryBrowseFacets {
48
48
  }
49
49
  export interface MemoryBrowseResult {
50
50
  items: MemoryItem[];
51
- /** Hoeveel rijen het structurele filter opleverde (== `items.length`, of de cap). */
51
+ /** How many rows the structural filter yielded (== `items.length`, or the cap). */
52
52
  scanned: number;
53
- /** Cap geraakt: er is méér dan dit. Verfijn het filter. */
53
+ /** Cap hit: there is more than this. Narrow the filter. */
54
54
  truncated?: boolean;
55
55
  /**
56
- * Wat er in deze scan te kiezen valt. Afgeleid uit de scan en niet uit een `DISTINCT`, want
57
- * die bestaat hier niet — bij `truncated` zijn dit dus de facetten van het zichtbare deel.
56
+ * What there is to choose in this scan. Derived from the scan and not from a `DISTINCT`, which
57
+ * does not exist here — so on `truncated` these are the facets of the visible part.
58
58
  */
59
59
  facets: MemoryBrowseFacets;
60
60
  }