@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.
- package/dist/entities/activity/blocks.d.ts +30 -30
- package/dist/entities/activity/catalog.d.ts +63 -86
- package/dist/entities/activity/descriptor.d.ts +31 -32
- package/dist/entities/activity/index.d.ts +2 -2
- package/dist/entities/activity/preview.d.ts +7 -7
- package/dist/entities/activity/resolve.d.ts +37 -38
- package/dist/entities/activity/types.d.ts +64 -35
- package/dist/entities/ai-account/types.d.ts +3 -3
- package/dist/entities/ai-account/vendors.d.ts +25 -32
- package/dist/entities/ai-budget/types.d.ts +5 -5
- package/dist/entities/ai-conversation/types.d.ts +12 -12
- package/dist/entities/ai-profile/types.d.ts +14 -21
- package/dist/entities/ai-settings/types.d.ts +12 -13
- package/dist/entities/analytics/index.d.ts +4 -4
- package/dist/entities/analytics/source.d.ts +1 -1
- package/dist/entities/analytics/usage.d.ts +23 -28
- package/dist/entities/artifact/blocks.d.ts +54 -69
- package/dist/entities/artifact/markdown.d.ts +2 -3
- package/dist/entities/artifact/types.d.ts +46 -54
- package/dist/entities/assignment/types.d.ts +76 -90
- package/dist/entities/channel/index.d.ts +1 -1
- package/dist/entities/channel/signature.d.ts +8 -9
- package/dist/entities/communication/index.d.ts +1 -1
- package/dist/entities/contact/index.d.ts +1 -1
- package/dist/entities/custom-field-def/types.d.ts +14 -14
- package/dist/entities/external-identity/types.d.ts +45 -50
- package/dist/entities/interaction/index.d.ts +1 -1
- package/dist/entities/interaction/types.d.ts +44 -47
- package/dist/entities/live-lens/types.d.ts +39 -44
- package/dist/entities/mcp/types.d.ts +53 -57
- package/dist/entities/memory/alias.d.ts +7 -7
- package/dist/entities/memory/browse.d.ts +21 -21
- package/dist/entities/memory/ingest.d.ts +24 -28
- package/dist/entities/memory/item.d.ts +53 -58
- package/dist/entities/memory/kind.d.ts +25 -25
- package/dist/entities/memory/query.d.ts +49 -51
- package/dist/entities/playbook/actor.d.ts +17 -17
- package/dist/entities/playbook/assignment.d.ts +54 -63
- package/dist/entities/playbook/index.d.ts +2 -2
- package/dist/entities/playbook/labels.d.ts +4 -4
- package/dist/entities/playbook/trigger-vars.d.ts +17 -15
- package/dist/entities/playbook/types.d.ts +174 -303
- package/dist/entities/resource-reminder/types.d.ts +8 -9
- package/dist/entities/time-entry/duration.d.ts +11 -11
- package/dist/entities/time-entry/types.d.ts +59 -59
- package/dist/entities/time-entry/work-type.d.ts +21 -24
- package/dist/entities/topic/examples.d.ts +26 -27
- package/dist/entities/topic/scope.d.ts +11 -12
- package/dist/entities/topic/types.d.ts +26 -28
- package/dist/entities/user/types.d.ts +24 -28
- package/dist/entities/webhook/types.d.ts +6 -6
- package/dist/entities/work/activity.d.ts +36 -0
- package/dist/entities/work/index.d.ts +1 -0
- package/dist/entities/work/keys.d.ts +25 -26
- package/dist/entities/work/ladder.d.ts +48 -52
- package/dist/entities/work/types.d.ts +108 -114
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +29 -28
- package/dist/index.js +1416 -1258
- package/dist/platform/account.d.ts +34 -38
- package/dist/platform/ai-tools.d.ts +48 -52
- package/dist/platform/api.d.ts +9 -10
- package/dist/platform/author.d.ts +7 -9
- package/dist/platform/capabilities.d.ts +3 -3
- package/dist/platform/communication.d.ts +163 -204
- package/dist/platform/context.d.ts +8 -8
- package/dist/platform/identity.d.ts +16 -19
- package/dist/platform/kernel.d.ts +1 -1
- package/dist/platform/manifest.d.ts +2 -2
- package/dist/platform/media.d.ts +13 -15
- package/dist/platform/permission.d.ts +39 -0
- package/dist/platform/permission.test.d.ts +1 -0
- package/dist/platform/presence.d.ts +30 -30
- package/dist/platform/provider.d.ts +14 -15
- package/dist/platform/resource-source.d.ts +43 -45
- package/dist/platform/resource.d.ts +17 -23
- package/dist/platform/scope.d.ts +35 -61
- package/dist/platform/services.d.ts +4 -4
- package/dist/platform/storage.d.ts +1 -1
- package/dist/platform/sync-source.d.ts +196 -216
- package/dist/platform/transcript-cadence.d.ts +37 -41
- package/dist/platform/ui.d.ts +6 -6
- package/dist/text/endpoint.d.ts +11 -27
- package/package.json +3 -2
|
@@ -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
|
-
*
|
|
3
|
+
* Shared vocabulary for usage — what an app spends on external resources.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
*
|
|
11
|
-
*
|
|
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
|
-
*
|
|
15
|
-
* 1.
|
|
16
|
-
* 2.
|
|
17
|
-
* 3.
|
|
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
|
-
*
|
|
22
|
-
*
|
|
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
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* Usage dimensions shared by several apps. On top of the core dimension `provider` (which vendor),
|
|
24
|
+
* which already existed.
|
|
28
25
|
*
|
|
29
|
-
* `resource` —
|
|
30
|
-
*
|
|
31
|
-
* `origin` —
|
|
32
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
42
|
+
/** Defaults to `count` — tokens, requests and bytes are all counts. */
|
|
47
43
|
valueType?: MetricDefinition["valueType"];
|
|
48
|
-
/** Extra
|
|
44
|
+
/** Extra axes on top of provider/resource/origin/time. */
|
|
49
45
|
extraDimensions?: string[];
|
|
50
46
|
}
|
|
51
47
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
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
|
-
*
|
|
2
|
+
* The blocks an artifact is built from.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* (`../activity/blocks.ts`).
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
-
*
|
|
12
|
-
* bewezen heeft:
|
|
10
|
+
* What is carried over is that file's *discipline*, because it proved itself:
|
|
13
11
|
*
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* -
|
|
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
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
30
|
+
* One line in a list.
|
|
41
31
|
*
|
|
42
|
-
* `lead`
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
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
|
-
/**
|
|
43
|
+
/** Numbers right. Left by default. */
|
|
55
44
|
align?: "left" | "right";
|
|
56
45
|
}
|
|
57
46
|
export interface ArtifactKpiItem {
|
|
58
|
-
/**
|
|
47
|
+
/** Already formatted by the writer ("1u 12m", "184", "-12%"). */
|
|
59
48
|
value: string;
|
|
60
49
|
label: string;
|
|
61
|
-
/**
|
|
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
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
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
|
-
/**
|
|
109
|
+
/** Hard upper bound on the serialized body. */
|
|
121
110
|
export declare const ARTIFACT_MAX_BODY_BYTES: number;
|
|
122
111
|
/**
|
|
123
|
-
*
|
|
112
|
+
* Schemes a link in an artifact may carry.
|
|
124
113
|
*
|
|
125
|
-
* `javascript:`
|
|
126
|
-
*
|
|
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
|
-
*
|
|
119
|
+
* Makes one piece of inline markdown safe while keeping it readable.
|
|
132
120
|
*
|
|
133
|
-
*
|
|
121
|
+
* Three interventions, in this order:
|
|
134
122
|
*
|
|
135
|
-
* 1. **Inline
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
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
|
-
*
|
|
134
|
+
* Prunes a written block list down to something a renderer can safely draw.
|
|
148
135
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
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`
|
|
154
|
-
*
|
|
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
|
-
/**
|
|
143
|
+
/** How many bytes this body costs on the wire. */
|
|
158
144
|
export declare function artifactBodyBytes(blocks: ArtifactBlock[]): number;
|
|
159
145
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
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
|
-
*
|
|
4
|
-
*
|
|
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;
|
|
@@ -2,26 +2,24 @@ import { ToolSource } from '../../platform/ai-tools';
|
|
|
2
2
|
import { OwnerScope } from '../scope/types';
|
|
3
3
|
import { ArtifactBlock } from './blocks';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* An artifact: a finished, shareable snapshot document the assistant produces while querying the
|
|
6
|
+
* platform.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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
|
-
/**
|
|
14
|
+
/** Which nav bucket the artifact falls under and which glyph it gets. */
|
|
16
15
|
export type ArtifactKind = "document" | "table" | "summary";
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
17
|
+
* What a share recipient may do.
|
|
19
18
|
*
|
|
20
|
-
* `commenter`
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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
|
-
/**
|
|
47
|
+
/** Who may see it explicitly, on top of the scope. */
|
|
55
48
|
shares: ArtifactShare[];
|
|
56
49
|
/**
|
|
57
|
-
*
|
|
50
|
+
* Flattened mirror of {@link shares} (`user:<id>` / `team:<id>`).
|
|
58
51
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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
|
-
*
|
|
68
|
-
*
|
|
59
|
+
* The kinds of source the current version consulted ("interaction", "analytics", "memory"),
|
|
60
|
+
* deduplicated.
|
|
69
61
|
*
|
|
70
|
-
*
|
|
71
|
-
* {@link Artifact.shareKeys}:
|
|
72
|
-
*
|
|
73
|
-
*
|
|
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
|
-
/**
|
|
69
|
+
/** The assistant conversation it came out of, when it came about that way. */
|
|
78
70
|
conversationId?: string;
|
|
79
|
-
/**
|
|
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… —
|
|
80
|
+
/** 1, 2, 3… — ascending, never reused. */
|
|
89
81
|
n: number;
|
|
90
|
-
/**
|
|
82
|
+
/** Why this version exists: "Eerste generatie", "Ingekort op verzoek". */
|
|
91
83
|
label: string;
|
|
92
84
|
format: ArtifactFormat;
|
|
93
85
|
runtime: ArtifactRuntime;
|
|
94
|
-
/**
|
|
86
|
+
/** The content itself, when `format === "blocks"`. */
|
|
95
87
|
body?: ArtifactBlock[];
|
|
96
|
-
/**
|
|
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
|
-
*
|
|
93
|
+
* What the assistant consulted when it wrote this.
|
|
102
94
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
111
|
+
* The flat, searchable form of a share list.
|
|
120
112
|
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
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
|
-
/**
|
|
117
|
+
/** The keys this user can find shared artifacts with. */
|
|
126
118
|
export declare function shareKeysForViewer(userId: string, teamIds: string[]): string[];
|
|
127
|
-
/**
|
|
119
|
+
/** The deduplicated source kinds, in the order they occurred. */
|
|
128
120
|
export declare function toolSourceKinds(sources: ToolSource[] | undefined): string[];
|