@anchrd/colab-sdk 0.1.50 → 0.1.52
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/action-blocks/action-blocks.d.ts +57 -0
- package/dist/action-blocks/action-blocks.js +42 -0
- package/dist/actions/actions.d.ts +28 -0
- package/dist/actions/actions.js +11 -1
- package/dist/conversations/conversations.d.ts +566 -0
- package/dist/conversations/conversations.js +191 -0
- package/dist/dictations/dictations.d.ts +8 -0
- package/dist/dictations/dictations.js +12 -0
- package/dist/error/error.d.ts +2 -0
- package/dist/error/error.js +2 -0
- package/dist/goals/goals.d.ts +20 -0
- package/dist/grammar/grammar.d.ts +3 -0
- package/dist/grammar/grammar.js +11 -0
- package/dist/machines/machines.d.ts +1 -0
- package/dist/messages/messages.d.ts +69 -1
- package/dist/messages/messages.js +91 -7
- package/dist/nodes/nodes.d.ts +1 -0
- package/dist/nodes/nodes.js +11 -1
- package/dist/operators/operators.d.ts +89 -137
- package/dist/operators/operators.js +19 -43
- package/dist/sdk.d.ts +5 -2
- package/dist/sdk.js +5 -2
- package/dist/users/users.d.ts +5 -0
- package/dist/users/users.js +3 -0
- package/dist/written/written.d.ts +4 -0
- package/dist/written/written.js +6 -1
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const actionBlockLanguage = "colab";
|
|
3
|
+
export declare const ActionButton: z.ZodUnion<readonly [z.ZodObject<{
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
column: z.ZodString;
|
|
6
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
7
|
+
label: z.ZodString;
|
|
8
|
+
field: z.ZodString;
|
|
9
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
10
|
+
}, z.core.$strict>]>;
|
|
11
|
+
export type ActionButton = z.infer<typeof ActionButton>;
|
|
12
|
+
export declare const ButtonsBlock: z.ZodObject<{
|
|
13
|
+
buttons: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
14
|
+
label: z.ZodString;
|
|
15
|
+
column: z.ZodString;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
label: z.ZodString;
|
|
18
|
+
field: z.ZodString;
|
|
19
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
20
|
+
}, z.core.$strict>]>>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export type ButtonsBlock = z.infer<typeof ButtonsBlock>;
|
|
23
|
+
export declare const ChoiceBlock: z.ZodObject<{
|
|
24
|
+
choice: z.ZodString;
|
|
25
|
+
options: z.ZodArray<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type ChoiceBlock = z.infer<typeof ChoiceBlock>;
|
|
28
|
+
export declare const ChecklistBlock: z.ZodObject<{
|
|
29
|
+
checklist: z.ZodString;
|
|
30
|
+
items: z.ZodArray<z.ZodString>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export type ChecklistBlock = z.infer<typeof ChecklistBlock>;
|
|
33
|
+
export declare const InputBlock: z.ZodObject<{
|
|
34
|
+
input: z.ZodString;
|
|
35
|
+
label: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
export type InputBlock = z.infer<typeof InputBlock>;
|
|
38
|
+
export declare const ActionBlock: z.ZodUnion<readonly [z.ZodObject<{
|
|
39
|
+
buttons: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
40
|
+
label: z.ZodString;
|
|
41
|
+
column: z.ZodString;
|
|
42
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
43
|
+
label: z.ZodString;
|
|
44
|
+
field: z.ZodString;
|
|
45
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
46
|
+
}, z.core.$strict>]>>;
|
|
47
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
48
|
+
choice: z.ZodString;
|
|
49
|
+
options: z.ZodArray<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
51
|
+
checklist: z.ZodString;
|
|
52
|
+
items: z.ZodArray<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
54
|
+
input: z.ZodString;
|
|
55
|
+
label: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strict>]>;
|
|
57
|
+
export type ActionBlock = z.infer<typeof ActionBlock>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// The blocks an AI writes into a text so that Colab draws buttons and fields (E270, #1215, Nodes ›
|
|
3
|
+
// Aufgabe › Knöpfe im Text). A block is a fenced code block with the language `colab` holding YAML;
|
|
4
|
+
// AI, export and search read it as text. A fixed catalog of four, each a strict object: an unknown
|
|
5
|
+
// or misspelled key fails the schema, and such a block stays an ordinary code block that does nothing.
|
|
6
|
+
//
|
|
7
|
+
// A block acts on the card its text belongs to (in a chat: the chat's node) and names columns and
|
|
8
|
+
// fields by their names, as an AI reads them over MCP; a column may also be named by its id.
|
|
9
|
+
export const actionBlockLanguage = "colab";
|
|
10
|
+
const Text = z.string().trim().min(1).max(200);
|
|
11
|
+
// Two buttons, options or points of the same text could not be told apart, on screen or in the card.
|
|
12
|
+
const distinct = (texts) => new Set(texts.map((text) => text.toLowerCase())).size === texts.length;
|
|
13
|
+
const ColumnRef = Text.describe("A column of the card's board, by its name or its `column_…` id.");
|
|
14
|
+
const FieldRef = Text.describe("A field of the card's kind, by its name.");
|
|
15
|
+
const ColumnButton = z.strictObject({ label: Text, column: ColumnRef });
|
|
16
|
+
const FieldButton = z.strictObject({
|
|
17
|
+
label: Text,
|
|
18
|
+
field: FieldRef,
|
|
19
|
+
value: z.union([Text, z.number().finite()]),
|
|
20
|
+
});
|
|
21
|
+
export const ActionButton = z.union([ColumnButton, FieldButton]);
|
|
22
|
+
// One or several buttons side by side; the first is the primary one.
|
|
23
|
+
export const ButtonsBlock = z.strictObject({
|
|
24
|
+
buttons: z
|
|
25
|
+
.array(ActionButton)
|
|
26
|
+
.min(1)
|
|
27
|
+
.max(4)
|
|
28
|
+
.refine((buttons) => distinct(buttons.map((button) => button.label))),
|
|
29
|
+
});
|
|
30
|
+
// One of several, saved at once into a select or text field.
|
|
31
|
+
export const ChoiceBlock = z.strictObject({
|
|
32
|
+
choice: FieldRef,
|
|
33
|
+
options: z.array(Text).min(2).max(10).refine(distinct),
|
|
34
|
+
});
|
|
35
|
+
// Points ticked in a checklist field, matched by their text.
|
|
36
|
+
export const ChecklistBlock = z.strictObject({
|
|
37
|
+
checklist: FieldRef,
|
|
38
|
+
items: z.array(Text).min(1).max(20).refine(distinct),
|
|
39
|
+
});
|
|
40
|
+
// A text or number field, with a label above it (the field's name without one).
|
|
41
|
+
export const InputBlock = z.strictObject({ input: FieldRef, label: Text.optional() });
|
|
42
|
+
export const ActionBlock = z.union([ButtonsBlock, ChoiceBlock, ChecklistBlock, InputBlock]);
|
|
@@ -61,6 +61,7 @@ export declare const ActionChat: z.ZodObject<{
|
|
|
61
61
|
machine: "machine";
|
|
62
62
|
human: "human";
|
|
63
63
|
}>>;
|
|
64
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
65
|
machine: z.ZodNullable<z.ZodObject<{
|
|
65
66
|
kind: z.ZodEnum<{
|
|
66
67
|
operator: "operator";
|
|
@@ -77,6 +78,12 @@ export declare const ActionChat: z.ZodObject<{
|
|
|
77
78
|
}, z.core.$strip>;
|
|
78
79
|
line: z.ZodString;
|
|
79
80
|
topic: z.ZodNullable<z.ZodString>;
|
|
81
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
82
|
+
attachmentId: z.ZodTemplateLiteral<`attachment_${string}`>;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
mediaType: z.ZodString;
|
|
85
|
+
size: z.ZodNumber;
|
|
86
|
+
}, z.core.$strip>>>;
|
|
80
87
|
createdAt: z.ZodISODateTime;
|
|
81
88
|
}, z.core.$strip>;
|
|
82
89
|
}, z.core.$strip>;
|
|
@@ -212,6 +219,7 @@ export declare const ActionItem: z.ZodObject<{
|
|
|
212
219
|
machine: "machine";
|
|
213
220
|
human: "human";
|
|
214
221
|
}>>;
|
|
222
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
215
223
|
machine: z.ZodNullable<z.ZodObject<{
|
|
216
224
|
kind: z.ZodEnum<{
|
|
217
225
|
operator: "operator";
|
|
@@ -228,6 +236,12 @@ export declare const ActionItem: z.ZodObject<{
|
|
|
228
236
|
}, z.core.$strip>;
|
|
229
237
|
line: z.ZodString;
|
|
230
238
|
topic: z.ZodNullable<z.ZodString>;
|
|
239
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
|
+
attachmentId: z.ZodTemplateLiteral<`attachment_${string}`>;
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
mediaType: z.ZodString;
|
|
243
|
+
size: z.ZodNumber;
|
|
244
|
+
}, z.core.$strip>>>;
|
|
231
245
|
createdAt: z.ZodISODateTime;
|
|
232
246
|
}, z.core.$strip>;
|
|
233
247
|
}, z.core.$strip>>;
|
|
@@ -742,6 +756,7 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
742
756
|
machine: "machine";
|
|
743
757
|
human: "human";
|
|
744
758
|
}>>;
|
|
759
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
745
760
|
machine: z.ZodNullable<z.ZodObject<{
|
|
746
761
|
kind: z.ZodEnum<{
|
|
747
762
|
operator: "operator";
|
|
@@ -758,6 +773,12 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
758
773
|
}, z.core.$strip>;
|
|
759
774
|
line: z.ZodString;
|
|
760
775
|
topic: z.ZodNullable<z.ZodString>;
|
|
776
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
777
|
+
attachmentId: z.ZodTemplateLiteral<`attachment_${string}`>;
|
|
778
|
+
name: z.ZodString;
|
|
779
|
+
mediaType: z.ZodString;
|
|
780
|
+
size: z.ZodNumber;
|
|
781
|
+
}, z.core.$strip>>>;
|
|
761
782
|
createdAt: z.ZodISODateTime;
|
|
762
783
|
}, z.core.$strip>;
|
|
763
784
|
}, z.core.$strip>>;
|
|
@@ -1025,6 +1046,7 @@ export declare const ActionList: z.ZodObject<{
|
|
|
1025
1046
|
machine: "machine";
|
|
1026
1047
|
human: "human";
|
|
1027
1048
|
}>>;
|
|
1049
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1028
1050
|
machine: z.ZodNullable<z.ZodObject<{
|
|
1029
1051
|
kind: z.ZodEnum<{
|
|
1030
1052
|
operator: "operator";
|
|
@@ -1041,6 +1063,12 @@ export declare const ActionList: z.ZodObject<{
|
|
|
1041
1063
|
}, z.core.$strip>;
|
|
1042
1064
|
line: z.ZodString;
|
|
1043
1065
|
topic: z.ZodNullable<z.ZodString>;
|
|
1066
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1067
|
+
attachmentId: z.ZodTemplateLiteral<`attachment_${string}`>;
|
|
1068
|
+
name: z.ZodString;
|
|
1069
|
+
mediaType: z.ZodString;
|
|
1070
|
+
size: z.ZodNumber;
|
|
1071
|
+
}, z.core.$strip>>>;
|
|
1044
1072
|
createdAt: z.ZodISODateTime;
|
|
1045
1073
|
}, z.core.$strip>;
|
|
1046
1074
|
}, z.core.$strip>>;
|
package/dist/actions/actions.js
CHANGED
|
@@ -5,7 +5,7 @@ import { GadgetLevel } from "../gadgets/gadgets.js";
|
|
|
5
5
|
import { packages } from "../grammar/grammar.js";
|
|
6
6
|
import { Digest, InstructionsLink, Known, KnownText } from "../instructions/instructions.js";
|
|
7
7
|
import { Limit as PageSize } from "../list-input.js";
|
|
8
|
-
import { MessageAuthor, MessageId } from "../messages/messages.js";
|
|
8
|
+
import { AttachmentId, MessageAuthor, MessageId } from "../messages/messages.js";
|
|
9
9
|
import { BoardShownKind, NodeId, NodeKindRead, NodePath } from "../nodes/nodes.js";
|
|
10
10
|
import { OperatorRunId } from "../operators/operators.js";
|
|
11
11
|
import { SkillOffer } from "../skills/skills.js";
|
|
@@ -59,6 +59,16 @@ export const ActionChat = z.object({
|
|
|
59
59
|
// Its topic (#994, E223); null for the general one (Allgemein). Read it with
|
|
60
60
|
// intelligence_message_list and topic.
|
|
61
61
|
topic: z.string().nullable(),
|
|
62
|
+
// The files it carries (#1210, E265): read each with intelligence_chat_attachment_get. Optional
|
|
63
|
+
// only for the readers' sake: the server always names them.
|
|
64
|
+
attachments: z
|
|
65
|
+
.array(z.object({
|
|
66
|
+
attachmentId: AttachmentId,
|
|
67
|
+
name: z.string(),
|
|
68
|
+
mediaType: z.string(),
|
|
69
|
+
size: z.number().int(),
|
|
70
|
+
}))
|
|
71
|
+
.optional(),
|
|
62
72
|
createdAt: z.iso.datetime(),
|
|
63
73
|
}),
|
|
64
74
|
});
|