@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,75 +1,71 @@
|
|
|
1
1
|
import { TranscriptSegment } from './media';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* When has enough new been said to go looking again?
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* This is the *whole* decision behind a live-listening assistant, and deliberately pure: no model,
|
|
6
|
+
* no clock, no store. Comms decides *when* (here), the ai app decides *what*.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* The two traps the thresholds below cover:
|
|
9
9
|
*
|
|
10
|
-
* - **
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - **
|
|
14
|
-
*
|
|
10
|
+
* - **Too often.** The transcribe route is hit every ~3 seconds per active call. Without a floor
|
|
11
|
+
* that is 20 search rounds a minute per call, most of them returning the same answer because one
|
|
12
|
+
* word was added.
|
|
13
|
+
* - **Too eager.** "Ja." and "Klopt." are new utterances but not a new topic. So not only time
|
|
14
|
+
* counts, but whether the query has really shifted.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* The comparison runs against the previously **executed** query, not against the previous window:
|
|
17
|
+
* otherwise the topic slides along with the window and it fires forever.
|
|
18
18
|
*/
|
|
19
|
-
/**
|
|
19
|
+
/** How much conversation goes into the query. Older than this is no longer what it is about. */
|
|
20
20
|
export declare const CADENCE_WINDOW_MS = 60000;
|
|
21
|
-
/**
|
|
21
|
+
/** Lower bound between two rounds, however much was said. */
|
|
22
22
|
export declare const CADENCE_FLOOR_MS = 8000;
|
|
23
|
-
/**
|
|
23
|
+
/** Fewer than this many new final utterances is not a new topic yet. */
|
|
24
24
|
export declare const CADENCE_MIN_NEW_SEGMENTS = 2;
|
|
25
|
-
/**
|
|
25
|
+
/** Below this share of new words it is still about the same thing. */
|
|
26
26
|
export declare const CADENCE_MIN_NOVELTY = 0.4;
|
|
27
|
-
/**
|
|
27
|
+
/** The individual words a query rests on: lowercase, no noise, no duplicates. */
|
|
28
28
|
export declare function extractTerms(text: string): string[];
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* Which part of what it is about right now has not been looked up yet? 1 is entirely new, 0 is
|
|
31
|
+
* exactly the same question.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* eenzijdig: staat er iets nieuws op tafel?
|
|
33
|
+
* Deliberately asymmetric, and not Jaccard. The window grows while the previous query stays put,
|
|
34
|
+
* and Jaccard punishes that growth: the longer a conversation stays on one topic, the lower the
|
|
35
|
+
* symmetric overlap gets, until it fires anyway — exactly the "fires forever" bug the comparison
|
|
36
|
+
* had to prevent. The question that counts is one-sided: is there something new on the table?
|
|
38
37
|
*/
|
|
39
38
|
export declare function novelty(current: readonly string[], previous: readonly string[]): number;
|
|
40
39
|
/**
|
|
41
|
-
*
|
|
40
|
+
* The last ~60 seconds of spoken text, cleaned up.
|
|
42
41
|
*
|
|
43
|
-
*
|
|
44
|
-
* `startedAt`/`endedAt`
|
|
45
|
-
*
|
|
46
|
-
* betrouwbaar, en dat is alles wat een venster nodig heeft.
|
|
42
|
+
* The window is measured from the **last utterance**, not from the server clock: a segment's
|
|
43
|
+
* `startedAt`/`endedAt` come from the transcription provider and need not share an origin with
|
|
44
|
+
* `Date.now()` here. Their difference *is* reliable, and that is all a window needs.
|
|
47
45
|
*
|
|
48
|
-
*
|
|
46
|
+
* Partial segments stay out: those still change while you read them.
|
|
49
47
|
*/
|
|
50
48
|
export declare function buildWindow(segments: readonly TranscriptSegment[], windowMs?: number): {
|
|
51
49
|
text: string;
|
|
52
50
|
segmentCount: number;
|
|
53
51
|
};
|
|
54
52
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* geheugen maar een venster: wat eruit valt mag opnieuw verschijnen.
|
|
53
|
+
* How many shown keys we keep. A half-hour call can produce hundreds and the row is rewritten
|
|
54
|
+
* whole on every flush, so this is not memory but a window: what falls out may appear again.
|
|
58
55
|
*/
|
|
59
56
|
export declare const MAX_SHOWN_KEYS = 60;
|
|
60
57
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* scherm staan.
|
|
58
|
+
* What this conversation has already been shown, plus what just came in — deduplicated and
|
|
59
|
+
* bounded. The oldest keys fall out, because the newest are the cards on screen right now.
|
|
64
60
|
*/
|
|
65
61
|
export declare function mergeShownKeys(existing: readonly string[], shown: readonly string[], max?: number): string[];
|
|
66
|
-
/**
|
|
62
|
+
/** What was kept from the previous round. Empty means "never looked yet". */
|
|
67
63
|
export interface CadenceState {
|
|
68
|
-
/**
|
|
64
|
+
/** Server clock of the previous round — only for the floor. */
|
|
69
65
|
lastTriggerAt?: number;
|
|
70
|
-
/**
|
|
66
|
+
/** Number of final utterances at that moment — only for "how much was added". */
|
|
71
67
|
lastSegmentCount?: number;
|
|
72
|
-
/**
|
|
68
|
+
/** The previously executed query, which the topic shift is measured against. */
|
|
73
69
|
lastQueryTerms?: string[];
|
|
74
70
|
}
|
|
75
71
|
export type CadenceDecision = {
|
|
@@ -82,8 +78,8 @@ export type CadenceDecision = {
|
|
|
82
78
|
segmentCount: number;
|
|
83
79
|
};
|
|
84
80
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
81
|
+
* Four gates, cheap to expensive — the first one that stays shut is the answer. `reason` exists so
|
|
82
|
+
* a conversation yielding nothing can be explained without a debugger.
|
|
87
83
|
*/
|
|
88
84
|
export declare function decideCadence(input: {
|
|
89
85
|
segments: readonly TranscriptSegment[];
|
package/dist/platform/ui.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export interface ModalConfig {
|
|
|
5
5
|
id: string;
|
|
6
6
|
displayName: string;
|
|
7
7
|
resource: string;
|
|
8
|
-
size?:
|
|
9
|
-
position?:
|
|
8
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
9
|
+
position?: "center" | "top" | "bottom" | "left" | "right" | "corner" | "sidebar";
|
|
10
10
|
props?: Record<string, any>;
|
|
11
11
|
hideHeader?: boolean;
|
|
12
12
|
}
|
|
@@ -22,7 +22,7 @@ export interface DockConfig {
|
|
|
22
22
|
id: string;
|
|
23
23
|
displayName: string;
|
|
24
24
|
resource: string;
|
|
25
|
-
size?:
|
|
25
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
26
26
|
props?: Record<string, any>;
|
|
27
27
|
hideHeader?: boolean;
|
|
28
28
|
/**
|
|
@@ -98,7 +98,7 @@ export interface SettingsPageConfig {
|
|
|
98
98
|
export interface ToastConfig {
|
|
99
99
|
id: string;
|
|
100
100
|
title?: string;
|
|
101
|
-
type:
|
|
101
|
+
type: "success" | "error" | "warning" | "info";
|
|
102
102
|
message?: string;
|
|
103
103
|
duration?: number;
|
|
104
104
|
/**
|
|
@@ -117,14 +117,14 @@ export interface ToastConfig {
|
|
|
117
117
|
label: string;
|
|
118
118
|
onClick: () => void;
|
|
119
119
|
/** Visual emphasis of the action button. Defaults to `secondary`. */
|
|
120
|
-
variant?:
|
|
120
|
+
variant?: "primary" | "secondary";
|
|
121
121
|
}[];
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Well-known context kinds, kept for autocomplete; any app may declare its own
|
|
125
125
|
* kind (e.g. "contact") via a context provider, so the type stays open.
|
|
126
126
|
*/
|
|
127
|
-
export type ExtensionContext =
|
|
127
|
+
export type ExtensionContext = "global" | "call" | "interaction" | (string & {});
|
|
128
128
|
export interface ExtensionConfig {
|
|
129
129
|
id: string;
|
|
130
130
|
slot: string;
|
package/dist/text/endpoint.d.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One normalisation for communication endpoints — phone numbers, e-mail addresses
|
|
3
|
-
* and the lookup keys built from them.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* spread over eylo-voip, microsoft and three comms services, plus a sixth variant
|
|
7
|
-
* with `+31` hardcoded. None of them turned a national number into an international
|
|
8
|
-
* one, so `0882112121` never matched `+31882112121`. Every lookup key in the platform
|
|
9
|
-
* has to be produced here, or the write side and the read side drift apart and the
|
|
10
|
-
* index is worthless.
|
|
3
|
+
* and the lookup keys built from them. Every lookup key in the platform must be
|
|
4
|
+
* produced here, or the write and read sides drift apart and the index is worthless
|
|
5
|
+
* (ad-hoc copies never mapped `0882112121` onto `+31882112121`).
|
|
11
6
|
*
|
|
12
7
|
* Deliberately dependency-free: `libphonenumber-js` is ~145 kB for a rule we express
|
|
13
|
-
* in a table.
|
|
14
|
-
*
|
|
15
|
-
* callers keep the raw value for display.
|
|
8
|
+
* in a table. Cost: we validate plausible lengths, not per-country number plans — so
|
|
9
|
+
* we reject implausible input instead of forcing it; callers keep the raw value for display.
|
|
16
10
|
*/
|
|
17
11
|
/** A dialling plan entry: enough to normalise, not enough to validate a number plan. */
|
|
18
12
|
export interface PhoneRegion {
|
|
@@ -40,17 +34,9 @@ export declare const DEFAULT_PHONE_REGION = "NL";
|
|
|
40
34
|
export declare function looksLikeEmail(value: string | undefined | null): boolean;
|
|
41
35
|
/**
|
|
42
36
|
* Turn any written form of a phone number into `+<callingCode><nsn>`, or `null` when
|
|
43
|
-
* it cannot be resolved without guessing.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* |---|---|
|
|
47
|
-
* | `+31 88 211 2121` | `+31882112121` |
|
|
48
|
-
* | `0031882112121` | `+31882112121` |
|
|
49
|
-
* | `088 211 2121` (region NL) | `+31882112121` |
|
|
50
|
-
* | `882112121` | `null` — ambiguous, we do not guess |
|
|
51
|
-
*
|
|
52
|
-
* Resolution order for the region: an explicit `+` or `00` wins, then `defaultRegion`
|
|
53
|
-
* (the organisation setting, or the region of the channel the call came in on).
|
|
37
|
+
* it cannot be resolved without guessing (a bare `882112121` is ambiguous → null).
|
|
38
|
+
* Region resolution: explicit `+`/`00` wins, then `defaultRegion` (organisation
|
|
39
|
+
* setting, or the region of the receiving channel).
|
|
54
40
|
*/
|
|
55
41
|
export declare function toE164(raw: string | undefined | null, defaultRegion?: string): string | null;
|
|
56
42
|
/**
|
|
@@ -86,11 +72,9 @@ export declare const PUBLIC_EMAIL_DOMAINS: Set<string>;
|
|
|
86
72
|
/** True when a domain is consumer mail and must never identify a company. */
|
|
87
73
|
export declare function isPublicEmailDomain(domain: string | undefined | null): boolean;
|
|
88
74
|
/**
|
|
89
|
-
* Does normalising this scheme need a phone region?
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* is a cross-app round trip, while an e-mail address has no region at all. A mail-only
|
|
93
|
-
* lookup that resolves the region anyway pays for four internal RPCs it never uses.
|
|
75
|
+
* Does normalising this scheme need a phone region? Check before resolving one:
|
|
76
|
+
* the region lives on the organisation, so fetching it is a cross-app round trip
|
|
77
|
+
* a mail-only lookup would pay for nothing.
|
|
94
78
|
*/
|
|
95
79
|
export declare function needsPhoneRegion(scheme: string | undefined | null): boolean;
|
|
96
80
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencxh/domain",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.173.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"typecheck": "tsc --noEmit",
|
|
23
23
|
"test": "vitest",
|
|
24
24
|
"test:run": "vitest run",
|
|
25
|
-
"test:watch": "vitest --watch"
|
|
25
|
+
"test:watch": "vitest --watch",
|
|
26
|
+
"lint": "biome check ."
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"typescript": "6.0.3",
|