@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
|
@@ -2,36 +2,36 @@ import { ActingIdentity } from '../../platform/identity';
|
|
|
2
2
|
import { toActingIdentity } from '../scope/actor';
|
|
3
3
|
import { OwnerScope } from '../scope/types';
|
|
4
4
|
/**
|
|
5
|
-
* `ownerScope` **is**
|
|
6
|
-
*
|
|
5
|
+
* `ownerScope` **is** a playbook's actor: there is no separate `runAs` field. Visibility, working
|
|
6
|
+
* area and attribution therefore all follow from the same field.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* On the storage side the personal variant is called `personal` (as with every other entity), on
|
|
9
|
+
* the execution side `user` (as with every other acting identity). This function is that
|
|
10
|
+
* translation, and the only place it belongs.
|
|
11
11
|
*/
|
|
12
12
|
export declare const playbookActor: typeof toActingIdentity;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Who this run acts for.
|
|
15
15
|
*
|
|
16
|
-
* **
|
|
17
|
-
* {@link playbookActor}
|
|
16
|
+
* **Two different questions, and the whole reason this function exists next to
|
|
17
|
+
* {@link playbookActor}:**
|
|
18
18
|
*
|
|
19
|
-
* - *
|
|
20
|
-
* - *
|
|
19
|
+
* - *who acts* — the agent, when one is designated;
|
|
20
|
+
* - *who may manage this* — `ownerScope`, and that stays with humans.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
* `ownerScope: { kind: "personal", userId }`
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Leaning both on one field looked attractive, because an agent is a user and
|
|
23
|
+
* `ownerScope: { kind: "personal", userId }` yields exactly the right actor. But `ownerScope` also
|
|
24
|
+
* decides who may edit, and then no human could change an agent's playbook any more — the agent
|
|
25
|
+
* itself never logs in.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* Without an `agentId` nothing changes: the actor is the scope's, exactly as before.
|
|
28
28
|
*/
|
|
29
29
|
export declare function runActor(playbook: {
|
|
30
30
|
agentId?: string | null;
|
|
31
31
|
ownerScope: OwnerScope;
|
|
32
32
|
}): ActingIdentity;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
34
|
+
* Stable key for grouping actors. Ten playbooks of the same team should cost one authorization
|
|
35
|
+
* call, not ten.
|
|
36
36
|
*/
|
|
37
37
|
export declare function actorKey(actor: ActingIdentity): string;
|
|
@@ -1,123 +1,114 @@
|
|
|
1
1
|
import { LocaleBundle } from '../analytics/dashboard';
|
|
2
2
|
import { PlaybookTrigger } from './types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Assigning as the wake-up call — the surface on which an **assignment** exists.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* The action that starts the work already exists in every app that knows work: **you assign
|
|
7
|
+
* something to someone.** Assign it to a user with `type: "agent"` and that is the start signal,
|
|
8
|
+
* and the engine puts an assignment there. (An assignment is an entity of its own — see
|
|
9
|
+
* {@link Assignment}.)
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* This is a federation and not a list in the ai app. Only comms knows a conversation can be
|
|
12
|
+
* assigned and that `INTERACTION_ASSIGNED` announces it; only a task app knows that of a task. The
|
|
13
|
+
* hub should not know — the same separation the memory catalog (`memory-source`) and the analytics
|
|
14
|
+
* catalog already make. Template: `apps/context/server/src/memory/catalog.ts`.
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* geheugen-catalogus (`memory-source`) en de analytics-catalogus al maken. Mal:
|
|
19
|
-
* `apps/context/server/src/memory/catalog.ts`.
|
|
20
|
-
*
|
|
21
|
-
* **Er komt geen nieuw wekmechanisme.** Een toewijzing is al een activity, dus de bestaande
|
|
22
|
-
* `activity`-poort levert hem af; deze module voegt alleen de vraag toe die de engine zelf niet
|
|
23
|
-
* kan beantwoorden: *"is dit aan míjn agent toegewezen?"*
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* Eén soort werk dat aan een agent toegewezen kan worden, gedeclareerd door de app die het
|
|
27
|
-
* bezit.
|
|
16
|
+
* **No new wake mechanism.** An assignment is already an activity, so the existing `activity` gate
|
|
17
|
+
* delivers it; this module only adds the question the engine cannot answer itself: *"is this
|
|
18
|
+
* assigned to my agent?"*
|
|
28
19
|
*/
|
|
20
|
+
/** One kind of work assignable to an agent, declared by the app that owns it. */
|
|
29
21
|
export interface AssignmentTargetKind {
|
|
30
22
|
/**
|
|
31
|
-
* `<app>.<
|
|
32
|
-
*
|
|
23
|
+
* `<app>.<thing>` — the prefix is the owner, the same convention as `memory_kind` and the file
|
|
24
|
+
* keys. Two apps can never claim the same kind this way.
|
|
33
25
|
*/
|
|
34
26
|
id: string;
|
|
35
27
|
label: string;
|
|
36
28
|
description?: string;
|
|
37
29
|
/**
|
|
38
|
-
*
|
|
30
|
+
* The activity types this app announces "this is assigned" with.
|
|
39
31
|
*
|
|
40
|
-
*
|
|
41
|
-
* type
|
|
42
|
-
*
|
|
32
|
+
* Declared and not guessed: the engine only sees a type string go by, and only the source knows
|
|
33
|
+
* which type *is* an assignment. A guessed prefix would silently pick the wrong type as soon as
|
|
34
|
+
* an app brings its own kind.
|
|
43
35
|
*/
|
|
44
36
|
activityTypes: string[];
|
|
45
37
|
/**
|
|
46
|
-
*
|
|
47
|
-
* (`"payload.userId"`).
|
|
38
|
+
* Where on the activity the assignee's userId sits, as a dot path (`"payload.userId"`).
|
|
48
39
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
40
|
+
* A path and not a fixed key, because the payload belongs to the source. Comms sets
|
|
41
|
+
* `payload.userId`; another app may set `payload.assignee.id` without the hub changing.
|
|
51
42
|
*/
|
|
52
43
|
assigneePath: string;
|
|
53
|
-
/**
|
|
44
|
+
/** Set by the hub after the fan-out, not by the source. */
|
|
54
45
|
origin?: "app";
|
|
55
46
|
}
|
|
56
47
|
/**
|
|
57
|
-
* Bare payload
|
|
58
|
-
* (
|
|
48
|
+
* Bare payload of `GET /provider/assignment/describe` — not wrapped in `ResponseFactory`
|
|
49
|
+
* (template: `MemorySourceDescription`).
|
|
59
50
|
*/
|
|
60
51
|
export interface AssignmentSourceDescription {
|
|
61
|
-
/**
|
|
52
|
+
/** The declaring app (== `manifest.name` == `req.source.app`). */
|
|
62
53
|
source: string;
|
|
63
54
|
targets: AssignmentTargetKind[];
|
|
64
|
-
/**
|
|
55
|
+
/** Flat LIST, like {@link LocaleBundle}; see there why that shape stays. */
|
|
65
56
|
locales?: LocaleBundle;
|
|
66
57
|
}
|
|
67
|
-
/**
|
|
58
|
+
/** The composed catalog the hub hands to the builder. */
|
|
68
59
|
export interface AssignmentCatalog {
|
|
69
60
|
targets: AssignmentTargetKind[];
|
|
70
|
-
/**
|
|
61
|
+
/** Sources that took part in the fan-out (for "who provides this?"). */
|
|
71
62
|
sources: string[];
|
|
72
63
|
locales: LocaleBundle;
|
|
73
64
|
}
|
|
74
65
|
/**
|
|
75
|
-
*
|
|
66
|
+
* The value at a dot path, or `undefined`.
|
|
76
67
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
68
|
+
* Its own mini reader and not `resolveRef` from the engine: that one lives in the ai app and knows
|
|
69
|
+
* the `$` convention, while a bare path from an app declaration is read here. Stops at the first
|
|
70
|
+
* non-object, so a path running through `null` yields `undefined` instead of throwing.
|
|
80
71
|
*/
|
|
81
72
|
export declare function valueAtPath(source: unknown, path: string): unknown;
|
|
82
73
|
/**
|
|
83
|
-
*
|
|
74
|
+
* The target kind this activity type announces, and the target kind with this id.
|
|
84
75
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
76
|
+
* Two readers, one list: the engine arrives with a type ("what is this?"), the builder and the
|
|
77
|
+
* validation with an id ("does this kind exist?").
|
|
87
78
|
*/
|
|
88
79
|
export declare function targetForActivityType(catalog: Pick<AssignmentCatalog, "targets">, activityType: string): AssignmentTargetKind | undefined;
|
|
89
80
|
export declare function targetById(catalog: Pick<AssignmentCatalog, "targets">, id: string | undefined): AssignmentTargetKind | undefined;
|
|
90
|
-
/** Is
|
|
81
|
+
/** Is this a trigger waiting on an assignment? */
|
|
91
82
|
export declare function isAssignmentTrigger(trigger: PlaybookTrigger | undefined): trigger is Extract<PlaybookTrigger, {
|
|
92
83
|
kind: "assignment";
|
|
93
84
|
}>;
|
|
94
85
|
/**
|
|
95
|
-
*
|
|
86
|
+
* Why this assignment does *not* start a run of this playbook, or `null` when it does.
|
|
96
87
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* agent
|
|
88
|
+
* A reason and not a boolean, for the same reason as `triggerMismatch`: a trigger that does not
|
|
89
|
+
* match leaves no run behind, so there is no trace to look into. "I gave this conversation to the
|
|
90
|
+
* agent and nothing happens" has to be answerable.
|
|
100
91
|
*
|
|
101
|
-
*
|
|
92
|
+
* Pure, which is why the four gates live here instead of in the job:
|
|
102
93
|
*
|
|
103
|
-
* 1. **
|
|
104
|
-
*
|
|
105
|
-
* 2. **
|
|
106
|
-
*
|
|
107
|
-
* 3. **
|
|
108
|
-
* 4. **
|
|
109
|
-
*
|
|
110
|
-
*
|
|
94
|
+
* 1. **No agent** ⇒ never. "Assigned to whom?" has no answer then, and without this gate such a
|
|
95
|
+
* playbook would fire on *every* assignment by *anyone*.
|
|
96
|
+
* 2. **Unknown target kind** ⇒ never, and it says which. That is the case "the app that declared
|
|
97
|
+
* this is disabled or not answering", and that must not be silence.
|
|
98
|
+
* 3. **Assigned to someone else** ⇒ not this playbook. This is the core comparison.
|
|
99
|
+
* 4. **The agent assigned it to itself** ⇒ not again. Without this gate a procedure that assigns
|
|
100
|
+
* (`update_interaction`) is a loop waking itself: the lifecycle activity carries no `runId`, so
|
|
101
|
+
* the existing loop damping does not see it.
|
|
111
102
|
*/
|
|
112
103
|
export declare function assignmentMismatch(input: {
|
|
113
104
|
trigger: PlaybookTrigger | undefined;
|
|
114
|
-
/** `Playbook.agentId` —
|
|
105
|
+
/** `Playbook.agentId` — the userId of the agent executing this playbook. */
|
|
115
106
|
agentId?: string | null;
|
|
116
|
-
/**
|
|
107
|
+
/** The target kind from the catalog belonging to this playbook, when found. */
|
|
117
108
|
target?: AssignmentTargetKind;
|
|
118
109
|
activityType: string;
|
|
119
|
-
/**
|
|
110
|
+
/** Who this was assigned to, read via `target.assigneePath`. */
|
|
120
111
|
assigneeUserId?: string;
|
|
121
|
-
/**
|
|
112
|
+
/** Who did the assigning, when it was a user. */
|
|
122
113
|
authorUserId?: string;
|
|
123
114
|
}): string | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Readable name of an action/tool for a human: `tool:communication__update_interaction` becomes
|
|
3
|
+
* `communication · update interaction`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Shared, because the proposal card in comms already had this helper while the run timeline in the
|
|
6
|
+
* AI app printed the raw id — so there you literally read
|
|
7
7
|
* `voorstel: tool:mcp__jira__create_issue`.
|
|
8
8
|
*/
|
|
9
9
|
export declare function humanizeAction(action: string): string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The variables the engine puts under `vars.trigger` on an activity trigger.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
* beide kanten geïmporteerd, kan niet opnieuw uiteenlopen.
|
|
4
|
+
* A contract between `buildTriggerVars` (server) and the variable picker (builder). Those two had
|
|
5
|
+
* drifted apart: the picker offered `trigger.fromEmail` and `trigger.channel` — which do not
|
|
6
|
+
* exist — and lacked `subject`, `textRaw`, `direction`, `authorType` and `activityId`. Every path
|
|
7
|
+
* it offered therefore yielded `undefined`. One list, imported on both sides, cannot drift again.
|
|
9
8
|
*/
|
|
10
9
|
export declare const TRIGGER_VARS: readonly [{
|
|
11
10
|
readonly name: "text";
|
|
@@ -28,6 +27,9 @@ export declare const TRIGGER_VARS: readonly [{
|
|
|
28
27
|
}, {
|
|
29
28
|
readonly name: "interactionId";
|
|
30
29
|
readonly type: "string";
|
|
30
|
+
}, {
|
|
31
|
+
readonly name: "itemId";
|
|
32
|
+
readonly type: "string";
|
|
31
33
|
}, {
|
|
32
34
|
readonly name: "activityId";
|
|
33
35
|
readonly type: "string";
|
|
@@ -57,17 +59,17 @@ export declare const TRIGGER_VARS: readonly [{
|
|
|
57
59
|
readonly type: "string";
|
|
58
60
|
}];
|
|
59
61
|
/**
|
|
60
|
-
*
|
|
62
|
+
* What a classify step **yields** per mode — the contract `runClassify` honours.
|
|
61
63
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* `
|
|
65
|
-
* `
|
|
66
|
-
*
|
|
64
|
+
* Here as a type and not only as a list, because {@link CLASSIFY_VARS} should follow from it. That
|
|
65
|
+
* list had drifted from reality, exactly as `TRIGGER_VARS` had before: `question` offered
|
|
66
|
+
* `confidence` (does not exist, the adapter gives `answer` + `reasoning`) and `topics` lacked
|
|
67
|
+
* `topicId` and `reasoning`. A path the picker offers that yields `undefined` is silently broken —
|
|
68
|
+
* hence the adapter being held against it in `ai/classify.test.ts`.
|
|
67
69
|
*/
|
|
68
70
|
export interface ClassifyTopicsResult {
|
|
69
71
|
topicId: string;
|
|
70
|
-
/**
|
|
72
|
+
/** Name of the topic, or `null` with `"none"`. */
|
|
71
73
|
topic: string | null;
|
|
72
74
|
confidence: number;
|
|
73
75
|
reasoning?: string;
|
|
@@ -76,9 +78,9 @@ export interface ClassifyQuestionResult {
|
|
|
76
78
|
answer: boolean;
|
|
77
79
|
reasoning?: string;
|
|
78
80
|
}
|
|
79
|
-
/**
|
|
81
|
+
/** The self-defined fields from `ClassifyStep.fields`; the shape belongs to the author. */
|
|
80
82
|
export type ClassifyExtractResult = Record<string, unknown>;
|
|
81
|
-
/**
|
|
83
|
+
/** The variables a classify step yields, per mode. Follows the types above. */
|
|
82
84
|
export declare const CLASSIFY_VARS: {
|
|
83
85
|
readonly topics: readonly [{
|
|
84
86
|
readonly name: "topicId";
|