@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,8 +1,8 @@
1
+ export * from './dashboard';
1
2
  export * from './dimensions';
2
- export * from './metric';
3
3
  export * from './fact';
4
- export * from './source';
5
- export * from './report';
6
- export * from './dashboard';
4
+ export * from './metric';
7
5
  export * from './period';
6
+ export * from './report';
7
+ export * from './source';
8
8
  export * from './usage';
@@ -1,7 +1,7 @@
1
1
  import { DashboardDef, LocaleBundle } from './dashboard';
2
2
  import { DimensionDefinition } from './dimensions';
3
- import { MetricDefinition } from './metric';
4
3
  import { Grain, MetricFact } from './fact';
4
+ import { MetricDefinition } from './metric';
5
5
  /**
6
6
  * Source discovery + ingest — the app↔app contract.
7
7
  *
@@ -1,36 +1,32 @@
1
1
  import { MetricDefinition } from './metric';
2
2
  /**
3
- * Gedeeld vocabulaire voor verbruik — wat een app aan externe middelen opmaakt.
3
+ * Shared vocabulary for usage — what an app spends on external resources.
4
4
  *
5
- * Bewust géén centrale usage-tabel. Apps bezitten hun eigen ruwe rijen (dat is
6
- * hoe de rest van de analytics-keten al werkt) en rollen die zelf op. Een
7
- * centrale tabel zou apps die de data al hebben — een voip-app heeft z'n
8
- * gesprekken al staan — dwingen alles dubbel weg te schrijven.
5
+ * Deliberately no central usage table. Apps own their own raw rows (which is how the rest of the
6
+ * analytics chain already works) and roll those up themselves. A central table would force apps
7
+ * that already have the data — a voip app already has its calls — to write everything twice.
9
8
  *
10
- * Wat hier wél gedeeld wordt is de *taal*: dezelfde assen en dezelfde
11
- * metric-naamgeving, zodat AI-tokens en belminuten naast elkaar in één
12
- * dashboard passen en je ze op `provider` tegen elkaar kunt afzetten.
9
+ * What *is* shared is the *language*: the same axes and the same metric naming, so AI tokens and
10
+ * call minutes fit side by side in one dashboard and can be compared on `provider`.
13
11
  *
14
- * Een app die verbruik wil rapporteren:
15
- * 1. rolt z'n eigen rijen op met `FactAccumulator` (platform-api)
16
- * 2. emit op de assen hieronder + de core-dimensie `provider`
17
- * 3. declareert `usageMetrics("voip", [{ unit: "call_minutes", ... }])`
18
- * in z'n `/analytics/describe`
12
+ * An app that wants to report usage:
13
+ * 1. rolls its own rows up with `FactAccumulator` (platform-api)
14
+ * 2. emits on the axes below plus the core dimension `provider`
15
+ * 3. declares `usageMetrics("voip", [{ unit: "call_minutes", ... }])` in its `/analytics/describe`
19
16
  */
20
17
  /**
21
- * Waar het verbruik in wordt uitgedrukt. Open string — een app mag een eigen
22
- * eenheid declareren; deze staan hier omdat ze naar verwachting terugkomen.
18
+ * What usage is expressed in. An open string — an app may declare a unit of its own; these are
19
+ * here because they are expected to recur.
23
20
  */
24
21
  export type UsageUnit = "input_tokens" | "output_tokens" | "cached_input_tokens" | "requests" | "seconds" | "bytes" | (string & {});
25
22
  /**
26
- * Verbruiksdimensies die meerdere apps delen. Aanvullend op de core-dimensie
27
- * `provider` (welke leverancier), die hiervoor al bestond.
23
+ * Usage dimensions shared by several apps. On top of the core dimension `provider` (which vendor),
24
+ * which already existed.
28
25
  *
29
- * `resource` — het specifieke ding dat verbruikt is: een model-id bij AI, een
30
- * lijn of nummer bij voip, een bucket bij opslag.
31
- * `origin` — de functie die het verbruik veroorzaakte: een gesprek, een
32
- * playbook, een samenvatting. Beantwoordt "waar gaat het geld heen", wat een
33
- * andere vraag is dan "bij wie".
26
+ * `resource` — the specific thing consumed: a model id for AI, a line or number for voip, a bucket
27
+ * for storage.
28
+ * `origin` — the function that caused the usage: a conversation, a playbook, a summary. Answers
29
+ * "where does the money go", a different question from "with whom".
34
30
  */
35
31
  export declare const USAGE_DIMENSIONS: {
36
32
  id: string;
@@ -38,19 +34,18 @@ export declare const USAGE_DIMENSIONS: {
38
34
  labelSource: "raw";
39
35
  }[];
40
36
  export declare const USAGE_DIMENSION_IDS: string[];
41
- /** Metric-id volgens de gedeelde conventie: `<app>.usage.<unit>`. */
37
+ /** Metric id following the shared convention: `<app>.usage.<unit>`. */
42
38
  export declare function usageMetricId(app: string, unit: UsageUnit): string;
43
39
  export interface UsageMetricSpec {
44
40
  unit: UsageUnit;
45
41
  label: string;
46
- /** Default `count` — tokens, requests en bytes zijn allemaal tellingen. */
42
+ /** Defaults to `count` — tokens, requests and bytes are all counts. */
47
43
  valueType?: MetricDefinition["valueType"];
48
- /** Extra assen bovenop provider/resource/origin/time. */
44
+ /** Extra axes on top of provider/resource/origin/time. */
49
45
  extraDimensions?: string[];
50
46
  }
51
47
  /**
52
- * Bouwt de `MetricDefinition`s voor een app z'n verbruiksmetrics, met overal
53
- * dezelfde assen. Scheelt elke app dezelfde zes regels boilerplate en zorgt dat
54
- * de definities niet per app uiteenlopen.
48
+ * Builds the `MetricDefinition`s for an app's usage metrics, with the same axes everywhere. Saves
49
+ * every app the same six lines of boilerplate and keeps the definitions from drifting per app.
55
50
  */
56
51
  export declare function usageMetrics(app: string, specs: UsageMetricSpec[]): MetricDefinition[];
@@ -1,49 +1,38 @@
1
1
  /**
2
- * De blokken waaruit een artefact is opgebouwd.
2
+ * The blocks an artifact is built from.
3
3
  *
4
- * Dit is een **document**-vocabulaire, niet het rij-vocabulaire van de tijdlijn
5
- * (`../activity/blocks.ts`). Die twee lijken op elkaar en zijn het bewust niet:
6
- * een tijdlijnrij staat tussen tientallen andere en mag daarom maar tien blokken
7
- * tellen, kent geen alinea's of koppen, en zijn tekstknopen zijn *paden* in een
8
- * activity. Een artefact is een document — het heeft koppen, alinea's, een tabel
9
- * en een KPI-rij, en zijn tekst is gewoon tekst.
4
+ * This is a **document** vocabulary, not the row vocabulary of the timeline
5
+ * (`../activity/blocks.ts`). Those two look alike and deliberately are not: a timeline row sits
6
+ * among dozens of others and may therefore hold only ten blocks, has no paragraphs or headings,
7
+ * and its text nodes are *paths* into an activity. An artifact is a document — it has headings,
8
+ * paragraphs, a table and a KPI row, and its text is just text.
10
9
  *
11
- * Wat wél overgenomen is, is de *discipline* van dat bestand, omdat die zich
12
- * bewezen heeft:
10
+ * What is carried over is that file's *discipline*, because it proved itself:
13
11
  *
14
- * - een optionele `block_id`, zodat een blok aan te wijzen is zonder het hele
15
- * document te herschrijven;
16
- * - {@link normalizeArtifactBlocks} **snoeit in plaats van te weigeren** — één
17
- * slecht blok mag geen heel document laten verdwijnen — en meldt élke drop,
18
- * want stil snoeien maakt "waarom staat mijn tabel er niet?" onbeantwoordbaar;
19
- * - onbekende bloktypes worden overgeslagen, zodat een nieuwere schrijver naast
20
- * een oudere renderer kan bestaan;
21
- * - alleen semantische tonen, geen vrije kleuren, zodat dark mode blijft kloppen.
12
+ * - an optional `block_id`, so a block can be pointed at without rewriting the whole document;
13
+ * - {@link normalizeArtifactBlocks} **prunes instead of refusing** — one bad block must not make a
14
+ * whole document disappear — and reports *every* drop, because silent pruning makes "why is my
15
+ * table missing?" unanswerable;
16
+ * - unknown block types are skipped, so a newer writer can coexist with an older renderer;
17
+ * - semantic tones only, no free colours, so dark mode keeps working.
22
18
  *
23
- * ## De inerte grens
24
- *
25
- * Een artefact is opgeslagen data, geen programma. Dat is hier een eigenschap van
26
- * het *model* en niet de uitkomst van een filter achteraf:
27
- *
28
- * - Blokteksten zijn **markdown, nooit HTML**. De renderer geeft ze aan ui-kit's
29
- * `RichText` met `as="markdown"`, en die tak (react-markdown + remark-gfm) emit
30
- * geen rauwe HTML. Een `<script>` in de tekst komt dus als letterlijke tekens op
31
- * het scherm. Daarom strippen we hier géén tags: dat zou "a < b" slopen zonder
32
- * iets te winnen.
33
- * - Wat we wél strippen is het enige dat markdown zélf gevaarlijk maakt: een link
34
- * naar een schema buiten {@link ALLOWED_LINK_SCHEMES}, en inline afbeeldingen.
35
- * Zie {@link sanitizeInline}.
19
+ * **The inert boundary.** An artifact is stored data, not a program, and that is a property of the
20
+ * *model* rather than the outcome of a filter afterwards. Block texts are **markdown, never
21
+ * HTML**: the renderer hands them to ui-kit's `RichText` with `as="markdown"`, and that branch
22
+ * (react-markdown + remark-gfm) emits no raw HTML, so a `<script>` in the text reaches the screen
23
+ * as literal characters. Hence no tag stripping here — that would break "a < b" and win nothing.
24
+ * What *is* stripped is the only thing markdown itself makes dangerous: a link to a scheme outside
25
+ * {@link ALLOWED_LINK_SCHEMES}, and inline images. See {@link sanitizeInline}.
36
26
  */
37
- /** Semantische kleur. Geen vrije kleuren, zodat dark mode en de tokens kloppen. */
27
+ /** Semantic colour. No free colours, so dark mode and the tokens keep working. */
38
28
  export type ArtifactTone = "info" | "success" | "warning" | "destructive";
39
29
  /**
40
- * Een regel in een opsomming.
30
+ * One line in a list.
41
31
  *
42
- * `lead` bestaat omdat een bevindingenlijst zijn kern vetgedrukt vooropzet
43
- * ("**Yealink-storingen domineren.** 14 van de 184 gesprekken..."). Zonder eigen
44
- * veld moet de schrijver daar markdown-sterretjes voor verzinnen op een plek waar
45
- * de opmaak juist vastligt — en dan is het aan de tekst te zien of iemand het
46
- * vergeten is.
32
+ * `lead` exists because a findings list puts its point up front in bold ("**Yealink outages
33
+ * dominate.** 14 of the 184 calls..."). Without a field of its own the writer has to invent
34
+ * markdown asterisks in a place where the formatting is supposed to be fixed — and then the text
35
+ * shows whether someone forgot.
47
36
  */
48
37
  export interface ArtifactListItem {
49
38
  lead?: string;
@@ -51,14 +40,14 @@ export interface ArtifactListItem {
51
40
  }
52
41
  export interface ArtifactTableColumn {
53
42
  label: string;
54
- /** Getallen rechts. Default links. */
43
+ /** Numbers right. Left by default. */
55
44
  align?: "left" | "right";
56
45
  }
57
46
  export interface ArtifactKpiItem {
58
- /** Al opgemaakt door de schrijver ("1u 12m", "184", "-12%"). */
47
+ /** Already formatted by the writer ("1u 12m", "184", "-12%"). */
59
48
  value: string;
60
49
  label: string;
61
- /** Alleen zetten als dit getal opvalt; een tint op elke tegel is behang. */
50
+ /** Only set when this number stands out; a tint on every tile is wallpaper. */
62
51
  tone?: ArtifactTone;
63
52
  }
64
53
  export type ArtifactBlock = {
@@ -106,9 +95,9 @@ export type ArtifactBlock = {
106
95
  };
107
96
  export type ArtifactBlockType = ArtifactBlock["type"];
108
97
  /**
109
- * Plafonds. Ruimer dan de tijdlijn (die staat op 10 blokken) omdat dit een
110
- * document is, maar niet ongelimiteerd: de body reist als JSON door hetzelfde
111
- * invoke-kanaal als al het andere en staat straks in één kolom.
98
+ * Ceilings. Wider than the timeline (which sits at 10 blocks) because this is a document, but not
99
+ * unlimited: the body travels as JSON through the same invoke channel as everything else and ends
100
+ * up in a single column.
112
101
  */
113
102
  export declare const ARTIFACT_MAX_BLOCKS = 200;
114
103
  export declare const ARTIFACT_MAX_LIST_ITEMS = 100;
@@ -117,49 +106,45 @@ export declare const ARTIFACT_MAX_TABLE_COLUMNS = 12;
117
106
  export declare const ARTIFACT_MAX_KPI_ITEMS = 4;
118
107
  export declare const ARTIFACT_MAX_TEXT_LEN = 4000;
119
108
  export declare const ARTIFACT_MAX_CELL_LEN = 500;
120
- /** Harde bovengrens op de geserialiseerde body. */
109
+ /** Hard upper bound on the serialized body. */
121
110
  export declare const ARTIFACT_MAX_BODY_BYTES: number;
122
111
  /**
123
- * Schema's die een link in een artefact mag dragen.
112
+ * Schemes a link in an artifact may carry.
124
113
  *
125
- * `javascript:` en `data:` staan er niet bij, en dat is de hele reden dat deze
126
- * lijst bestaat: die twee zijn de enige manier waarop markdown iets uitvoerbaars
127
- * het document in krijgt.
114
+ * `javascript:` and `data:` are not among them, and that is the entire reason this list exists:
115
+ * those two are the only way markdown gets something executable into the document.
128
116
  */
129
117
  export declare const ALLOWED_LINK_SCHEMES: readonly ["http:", "https:", "mailto:", "tel:"];
130
118
  /**
131
- * Maakt één stuk inline markdown veilig en houdt hem leesbaar.
119
+ * Makes one piece of inline markdown safe while keeping it readable.
132
120
  *
133
- * Drie ingrepen, in deze volgorde:
121
+ * Three interventions, in this order:
134
122
  *
135
- * 1. **Inline afbeeldingen verdwijnen**, met hun alt-tekst als vervanging. Er is
136
- * in deze versie geen `image`-blok, juist omdat dit product geen publiek
137
- * laadbare URL kent (bytes komen als base64 door het invoke-kanaal). Een
138
- * inline `![](…)` zou dat gat langs de achterdeur openzetten en bovendien een
139
- * externe host laten weten wie het document opent.
140
- * 2. **Links naar een verboden schema worden platte tekst** — het label blijft
141
- * staan. Weggooien van het label zou de zin stukmaken om de link.
142
- * 3. **Referentiedefinities naar een verboden schema verdwijnen.** Zonder deze
143
- * stap ontsnapt `[klik][x]` met `[x]: javascript:…` eronder aan stap 2.
123
+ * 1. **Inline images disappear**, with their alt text as replacement. This version has no `image`
124
+ * block precisely because the product has no publicly loadable URL (bytes come through the
125
+ * invoke channel as base64). An inline `![](…)` would open that gap through the back door and
126
+ * tell an external host who opens the document.
127
+ * 2. **Links to a forbidden scheme become plain text** — the label stays. Dropping the label would
128
+ * break the sentence over the link.
129
+ * 3. **Reference definitions to a forbidden scheme disappear.** Without this step `[click][x]`
130
+ * with `[x]: javascript:…` below it escapes step 2.
144
131
  */
145
132
  export declare function sanitizeInline(text: string): string;
146
133
  /**
147
- * Snoeit een geschreven blokkenlijst tot iets wat een renderer veilig kan tekenen.
134
+ * Prunes a written block list down to something a renderer can safely draw.
148
135
  *
149
- * Geeft altijd **nieuwe** objecten terug: de invoer komt van een model of van een
150
- * API-client, en de gesaniteerde tekst hoort niet in het origineel terug te
151
- * lekken.
136
+ * Always returns **new** objects: the input comes from a model or an API client, and the sanitized
137
+ * text must not leak back into the original.
152
138
  *
153
- * `onDrop` hoort te loggen of terug te koppelen aan de schrijver — een tool die
154
- * zijn tabel kwijtraakt omdat hij nul kolommen meestuurde, moet dat kunnen horen.
139
+ * `onDrop` should log or report back to the writer — a tool losing its table because it sent zero
140
+ * columns has to be able to hear that.
155
141
  */
156
142
  export declare function normalizeArtifactBlocks(blocks: unknown, onDrop?: (reason: string) => void): ArtifactBlock[];
157
- /** Hoeveel bytes deze body op de wire kost. */
143
+ /** How many bytes this body costs on the wire. */
158
144
  export declare function artifactBodyBytes(blocks: ArtifactBlock[]): number;
159
145
  /**
160
- * Een korte samenvatting van wat erin zit, voor de miniatuur op een kaart en voor
161
- * wat de assistent te zien krijgt als hij een artefact wil bijwerken zonder de
162
- * hele body te lezen.
146
+ * A short summary of what is inside, for the thumbnail on a card and for what the assistant sees
147
+ * when it wants to update an artifact without reading the whole body.
163
148
  */
164
149
  export declare function artifactOutline(blocks: ArtifactBlock[]): {
165
150
  blocks: number;
@@ -1,7 +1,6 @@
1
1
  import { ArtifactBlock } from './blocks';
2
2
  /**
3
- * Het hele document als markdown. `title` komt er als H1 boven te staan wanneer
4
- * de blokken er zelf geen dragen — een export zonder titel is niet terug te
5
- * vinden in een downloadmap.
3
+ * The whole document as markdown. `title` goes on top as an H1 when the blocks carry none
4
+ * themselves — an export without a title cannot be found back in a downloads folder.
6
5
  */
7
6
  export declare function artifactToMarkdown(blocks: ArtifactBlock[], title?: string): string;
@@ -1,27 +1,25 @@
1
1
  import { ToolSource } from '../../platform/ai-tools';
2
- import { OwnerScope } from '../contact/types';
2
+ import { OwnerScope } from '../scope/types';
3
3
  import { ArtifactBlock } from './blocks';
4
4
  /**
5
- * Een artefact: een afgerond, deelbaar snapshot-document dat de assistent maakt
6
- * terwijl hij het platform bevraagt.
5
+ * An artifact: a finished, shareable snapshot document the assistant produces while querying the
6
+ * platform.
7
7
  *
8
- * De veiligheidsredenering waar dit hele model op rust, in één zin: **de AI
9
- * gebruikt tools tijdens het genereren, het artefact gebruikt geen tools tijdens
10
- * het bekijken.** Alle tooltoegang zit aan de generatiekant, in de agent die we
11
- * al draaien en al vertrouwen. Wat bij de kijker landt is data. Daarom is delen
12
- * veilig zonder cross-user-executierisico, en daarom hoeft er voor dit genre
13
- * geen sandbox te zijn.
8
+ * The safety argument this whole model rests on, in one sentence: **the AI uses tools while
9
+ * generating, the artifact uses no tools while being viewed.** All tool access sits on the
10
+ * generation side, in the agent we already run and already trust. What lands with the viewer is
11
+ * data. That is why sharing is safe without cross-user execution risk, and why this genre needs no
12
+ * sandbox.
14
13
  */
15
- /** Waar het artefact in de nav onder valt en welk glyph hij krijgt. */
14
+ /** Which nav bucket the artifact falls under and which glyph it gets. */
16
15
  export type ArtifactKind = "document" | "table" | "summary";
17
16
  /**
18
- * Wat een gedeelde ontvanger mag.
17
+ * What a share recipient may do.
19
18
  *
20
- * `commenter` leest en mag het gekoppelde assistent-gesprek voeren — hij kan dus
21
- * wél een nieuwe versie láten maken, maar niet zelf de titel of het deelmodel
22
- * omzetten. Dat is bewust: het gesprek is de manier waarop je met een artefact
23
- * werkt, en dat afknijpen zou de feature halveren voor iedereen behalve de
24
- * eigenaar.
19
+ * `commenter` reads and may carry the linked assistant conversation — so they can have a new
20
+ * version made, but cannot change the title or the sharing themselves. Deliberate: the conversation
21
+ * is how you work with an artifact, and choking that would halve the feature for everyone but the
22
+ * owner.
25
23
  */
26
24
  export type ArtifactShareRole = "viewer" | "commenter" | "owner";
27
25
  export interface ArtifactShare {
@@ -29,20 +27,15 @@ export interface ArtifactShare {
29
27
  id: string;
30
28
  role: ArtifactShareRole;
31
29
  }
32
- /**
33
- * `"blocks"` nu; `"html"` in de fase waarin de assistent vrije, gesaniteerde
34
- * opmaak mag schrijven.
35
- */
30
+ /** `"blocks"` today; `"html"` in the phase where the assistant may write free, sanitized markup. */
36
31
  export type ArtifactFormat = "blocks" | "html";
37
32
  /**
38
- * De sandbox-naad, en de enige plek waar het inerte en het latere interactieve
39
- * pad uit elkaar lopen.
33
+ * The sandbox seam, and the only place where the inert and the later interactive path diverge.
40
34
  *
41
- * Generatie, opslag, deelmodel en de Drive-omgeving zijn voor beide identiek —
42
- * alleen de laatste stap in de renderlaag verschilt: gesaniteerde inerte inhoud
43
- * in onze eigen DOM, of levende code binnen een iframe-grens. De renderer weigert
44
- * vandaag alles wat niet `"inert"` is, zodat een rij die ooit iets anders draagt
45
- * niet stilzwijgend als veilig getekend wordt.
35
+ * Generation, storage, sharing and the Drive surroundings are identical for both — only the last
36
+ * step in the render layer differs: sanitized inert content in our own DOM, or live code inside an
37
+ * iframe boundary. The renderer today refuses anything that is not `"inert"`, so a row that ever
38
+ * carries something else is not silently drawn as safe.
46
39
  */
47
40
  export type ArtifactRuntime = "inert" | "sandboxed";
48
41
  export interface Artifact {
@@ -51,32 +44,31 @@ export interface Artifact {
51
44
  title: string;
52
45
  kind: ArtifactKind;
53
46
  ownerScope: OwnerScope;
54
- /** Wie hem expliciet mag zien, náást de scope. */
47
+ /** Who may see it explicitly, on top of the scope. */
55
48
  shares: ArtifactShare[];
56
49
  /**
57
- * Platgeslagen spiegel van {@link shares} (`user:<id>` / `team:<id>`).
50
+ * Flattened mirror of {@link shares} (`user:<id>` / `team:<id>`).
58
51
  *
59
- * Geen duplicatie maar de enige manier om erop te kunnen zoeken: je kunt niet
60
- * in een array van objecten queryen. Dezelfde vorm als `Contact.keys` en
61
- * `Interaction.partyKeys` — platslaan bij het schrijven, één `$in` bij het
62
- * lezen. Bouw hem altijd met {@link buildShareKeys}, nooit met de hand.
52
+ * Not duplication but the only way to search on it: you cannot query inside an array of objects.
53
+ * The same shape as `Contact.keys` and `Interaction.partyKeys` — flatten at write time, one `$in`
54
+ * at read time. Always build it with {@link buildShareKeys}, never by hand.
63
55
  */
64
56
  shareKeys: string[];
65
57
  currentVersion: number;
66
58
  /**
67
- * De soorten bronnen die de huidige versie raadpleegde ("interaction",
68
- * "analytics", "memory"), ontdubbeld.
59
+ * The kinds of source the current version consulted ("interaction", "analytics", "memory"),
60
+ * deduplicated.
69
61
  *
70
- * Afgeleid en meegeschreven bij elke versie, om dezelfde reden als
71
- * {@link Artifact.shareKeys}: de lijstpagina wil ze als chips tonen en laadt
72
- * geen versies. Zonder dit veld zou die kolom altijd leeg zijn, of zou elke
73
- * lijstweergave een versie-fetch per rij kosten.
62
+ * Derived and written along with every version, for the same reason as
63
+ * {@link Artifact.shareKeys}: the list page wants to show them as chips and loads no versions.
64
+ * Without this field that column would always be empty, or every list view would cost a version
65
+ * fetch per row.
74
66
  */
75
67
  sourceKinds?: string[];
76
68
  createdBy: string;
77
- /** Het assistent-gesprek waaruit hij ontstond, als hij zo ontstaan is. */
69
+ /** The assistant conversation it came out of, when it came about that way. */
78
70
  conversationId?: string;
79
- /** Dossiersleutels: `interaction:<id>`, `company:<id>`, `contact:<id>`. */
71
+ /** File keys: `interaction:<id>`, `company:<id>`, `contact:<id>`. */
80
72
  keys?: string[];
81
73
  createdAt?: number;
82
74
  updatedAt?: number;
@@ -85,30 +77,30 @@ export interface ArtifactVersion {
85
77
  id: string;
86
78
  organizationId: string;
87
79
  artifactId: string;
88
- /** 1, 2, 3… — oplopend, nooit hergebruikt. */
80
+ /** 1, 2, 3… — ascending, never reused. */
89
81
  n: number;
90
- /** Waarom deze versie bestaat: "Eerste generatie", "Ingekort op verzoek". */
82
+ /** Why this version exists: "Eerste generatie", "Ingekort op verzoek". */
91
83
  label: string;
92
84
  format: ArtifactFormat;
93
85
  runtime: ArtifactRuntime;
94
- /** De inhoud zelf, als `format === "blocks"`. */
86
+ /** The content itself, when `format === "blocks"`. */
95
87
  body?: ArtifactBlock[];
96
- /** De naad naar de storage-provider, als `format === "html"`. Nu altijd leeg. */
88
+ /** The seam to the storage provider, when `format === "html"`. Always empty today. */
97
89
  storageRef?: {
98
90
  fileId: string;
99
91
  };
100
92
  /**
101
- * Wat de assistent raadpleegde toen hij dit schreef.
93
+ * What the assistant consulted when it wrote this.
102
94
  *
103
- * Hergebruikt {@link ToolSource} uit het tool-contract, want het is precies
104
- * hetzelfde begrip: geraadpleegd, niet geciteerd. Een generatie die vijf
105
- * gesprekken las noemt er vijf, ook als de tekst er één gebruikte.
95
+ * Reuses {@link ToolSource} from the tool contract, because it is exactly the same concept:
96
+ * consulted, not cited. A generation that read five conversations names five, even if the text
97
+ * used one.
106
98
  */
107
99
  sources?: ToolSource[];
108
100
  createdBy: string;
109
101
  createdAt?: number;
110
102
  }
111
- /** Wat een detailpagina in één keer nodig heeft. */
103
+ /** What a detail page needs in one go. */
112
104
  export interface ArtifactWithVersion {
113
105
  artifact: Artifact;
114
106
  version: ArtifactVersion;
@@ -116,13 +108,13 @@ export interface ArtifactWithVersion {
116
108
  export declare const shareKeyForUser: (userId: string) => string;
117
109
  export declare const shareKeyForTeam: (teamId: string) => string;
118
110
  /**
119
- * De platte, doorzoekbare vorm van een deellijst.
111
+ * The flat, searchable form of a share list.
120
112
  *
121
- * Gedupliceerd en gesorteerd zodat twee gelijke deellijsten dezelfde sleutels
122
- * geven — anders lijkt een opslag zonder wijziging toch een wijziging.
113
+ * Deduplicated and sorted so two equal share lists yield the same keys — otherwise a save without
114
+ * a change still looks like a change.
123
115
  */
124
116
  export declare function buildShareKeys(shares: ArtifactShare[] | undefined): string[];
125
- /** De sleutels waarmee deze gebruiker gedeelde artefacten kan vinden. */
117
+ /** The keys this user can find shared artifacts with. */
126
118
  export declare function shareKeysForViewer(userId: string, teamIds: string[]): string[];
127
- /** De ontdubbelde bronsoorten, in de volgorde waarin ze voorkwamen. */
119
+ /** The deduplicated source kinds, in the order they occurred. */
128
120
  export declare function toolSourceKinds(sources: ToolSource[] | undefined): string[];