@anchrd/colab-sdk 0.1.54 → 0.1.55
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 +1 -0
- package/dist/action-blocks/action-blocks.js +22 -0
- package/dist/actions/actions.d.ts +356 -3
- package/dist/actions/actions.js +21 -3
- package/dist/boards/boards.d.ts +0 -14
- package/dist/boards/boards.js +3 -18
- package/dist/documents/documents.d.ts +2 -0
- package/dist/flows/flow-runs.d.ts +34 -0
- package/dist/flows/flow-runs.js +48 -4
- package/dist/flows/flows.d.ts +5 -0
- package/dist/flows/flows.js +3 -0
- package/dist/gadgets/gadgets.d.ts +4 -0
- package/dist/gadgets/gadgets.js +5 -0
- package/dist/goals/goals.d.ts +1 -0
- package/dist/goals/goals.js +2 -2
- package/dist/grammar/grammar.d.ts +1 -2
- package/dist/grammar/grammar.js +5 -7
- package/dist/home/home.d.ts +2 -0
- package/dist/links/links.d.ts +15 -2
- package/dist/links/links.js +25 -13
- package/dist/messages/messages.js +5 -4
- package/dist/nodes/nodes.d.ts +11 -6
- package/dist/nodes/nodes.js +11 -7
- package/dist/operators/operators.d.ts +87 -4
- package/dist/operators/operators.js +55 -2
- package/dist/processes/processes.d.ts +1999 -0
- package/dist/processes/processes.js +417 -0
- package/dist/runs/runs.d.ts +1 -200
- package/dist/runs/runs.js +3 -64
- package/dist/schedule/schedule.js +3 -3
- package/dist/sdk.d.ts +10 -11
- package/dist/sdk.js +10 -11
- package/dist/skills/skills.d.ts +1 -0
- package/dist/sources/sources.d.ts +4 -3
- package/dist/tables/tables.d.ts +114 -1
- package/dist/tables/tables.js +86 -2
- package/dist/tool.d.ts +1 -0
- package/dist/users/users.d.ts +30 -0
- package/dist/users/users.js +32 -0
- package/dist/written/written.d.ts +2 -4
- package/dist/written/written.js +2 -5
- package/package.json +2 -1
- package/dist/relations/relations.d.ts +0 -342
- package/dist/relations/relations.js +0 -129
- package/dist/types/types.d.ts +0 -181
- package/dist/types/types.js +0 -124
package/dist/tables/tables.js
CHANGED
|
@@ -34,6 +34,14 @@ export const TableColumnChange = TableColumn.extend({
|
|
|
34
34
|
export const maxTableColumns = 100;
|
|
35
35
|
// At most 100,000 data rows (E191, #980).
|
|
36
36
|
export const maxTableRows = 100_000;
|
|
37
|
+
// A table stored as a database (E283, #1276): at most 1,000,000 data rows.
|
|
38
|
+
export const maxDatabaseRows = 1_000_000;
|
|
39
|
+
// How a table keeps its rows (E283, #1276): `table`, with versions, or `database`, real columns with
|
|
40
|
+
// indexes and without versions. Both read and write alike; a database is faster on large tables.
|
|
41
|
+
export const tableStorages = ["table", "database"];
|
|
42
|
+
export const TableStorage = z
|
|
43
|
+
.enum(tableStorages)
|
|
44
|
+
.describe("How the table keeps its rows: table (the default) keeps a version of every change; database keeps no versions, holds up to 1,000,000 rows and sorts, filters, sums and groups large tables fast. Both read and write the same way.");
|
|
37
45
|
const Columns = z.array(TableColumn).min(1).max(maxTableColumns);
|
|
38
46
|
const Cells = z
|
|
39
47
|
.array(z.string())
|
|
@@ -62,6 +70,7 @@ export const TableCreateInput = z.strictObject({
|
|
|
62
70
|
columns: Columns.describe("The columns in their order, at least one, each with its name and type. They are the table's header."),
|
|
63
71
|
rows: Rows.optional().describe("The first rows, each a list of cells in the order of the columns. Send rows or csv, not both; leaving both out creates an empty table."),
|
|
64
72
|
csv: Csv.optional().describe("The first content as CSV whose header line holds exactly the names of columns, in their order. Send rows or csv, not both."),
|
|
73
|
+
storage: TableStorage.optional(),
|
|
65
74
|
idempotencyKey: IdempotencyKey,
|
|
66
75
|
});
|
|
67
76
|
export const tableFormats = ["rows", "csv"];
|
|
@@ -90,6 +99,67 @@ export const TableFilter = z.strictObject({
|
|
|
90
99
|
.max(200)
|
|
91
100
|
.describe("Only rows whose cell in this column contains this text, letter case ignored."),
|
|
92
101
|
});
|
|
102
|
+
// A filter with an operator (E283, #1276): one operator per entry, beside `contains`. In a number
|
|
103
|
+
// column a value is compared as a number, elsewhere as text with letter case ignored; an empty cell,
|
|
104
|
+
// and in a number column a cell that is no number as a whole, is never greater, less or between.
|
|
105
|
+
const FilterColumn = ColumnName.describe("The column to filter by, by its name (letter case ignored).");
|
|
106
|
+
const FilterValue = z.string().max(200);
|
|
107
|
+
// Without a column (E283 7b, #1282): the free text of a table's search, the same filter for the view
|
|
108
|
+
// and an AI. Letter case ignored as with `contains` (ASCII only).
|
|
109
|
+
export const TableTextFilter = z.strictObject({
|
|
110
|
+
contains: z
|
|
111
|
+
.string()
|
|
112
|
+
.max(200)
|
|
113
|
+
.describe("Without column: only rows that hold this text in any of their cells, letter case ignored."),
|
|
114
|
+
});
|
|
115
|
+
export const TableCondition = z.union([
|
|
116
|
+
TableFilter,
|
|
117
|
+
TableTextFilter,
|
|
118
|
+
z.strictObject({
|
|
119
|
+
column: FilterColumn,
|
|
120
|
+
equals: FilterValue.describe("Only rows whose cell equals this value: in a number column as a number (1200 equals 1200.0), elsewhere as text with letter case ignored. In a number column a cell counts as a number only as a whole (a sign, digits, at most one point): n/a, 1.234,56 or 12 kg never match a comparison."),
|
|
121
|
+
}),
|
|
122
|
+
z.strictObject({
|
|
123
|
+
column: FilterColumn,
|
|
124
|
+
notEquals: FilterValue.describe("Only rows whose cell does not equal this value; an empty cell counts as not equal."),
|
|
125
|
+
}),
|
|
126
|
+
z.strictObject({
|
|
127
|
+
column: FilterColumn,
|
|
128
|
+
greater: FilterValue.describe("Only rows whose cell is greater than this value: in a number column as a number, elsewhere as text (an ISO date compares as a date). An empty cell never matches."),
|
|
129
|
+
}),
|
|
130
|
+
z.strictObject({
|
|
131
|
+
column: FilterColumn,
|
|
132
|
+
less: FilterValue.describe("Only rows whose cell is less than this value, compared as with greater. An empty cell never matches."),
|
|
133
|
+
}),
|
|
134
|
+
z.strictObject({
|
|
135
|
+
column: FilterColumn,
|
|
136
|
+
between: z
|
|
137
|
+
.tuple([FilterValue, FilterValue])
|
|
138
|
+
.describe("Only rows whose cell lies between these two values, both included, compared as with greater. An empty cell never matches."),
|
|
139
|
+
}),
|
|
140
|
+
z.strictObject({
|
|
141
|
+
column: FilterColumn,
|
|
142
|
+
empty: z
|
|
143
|
+
.boolean()
|
|
144
|
+
.describe("true: only rows whose cell in this column is empty; false: only those with text."),
|
|
145
|
+
}),
|
|
146
|
+
]);
|
|
147
|
+
// What `aggregates` computes per group (E283, #1276).
|
|
148
|
+
export const tableAggregateFunctions = ["count", "sum", "avg", "min", "max"];
|
|
149
|
+
export const TableAggregate = z.strictObject({
|
|
150
|
+
function: z
|
|
151
|
+
.enum(tableAggregateFunctions)
|
|
152
|
+
.describe("count counts rows (with a column: its non-empty cells); sum, avg, min and max compute over the numbers of a number column, leaving out empty cells and cells that are no number as a whole (n/a, 1.234,56, 12 kg)."),
|
|
153
|
+
column: ColumnName.optional().describe("The column to compute over, by its name; required for sum, avg, min and max, which take a number column."),
|
|
154
|
+
});
|
|
155
|
+
// At most this many groups in one answer.
|
|
156
|
+
export const maxTableGroups = 1000;
|
|
157
|
+
// One group of an answer with `aggregates`: the cells of the `groupBy` columns, then one result per
|
|
158
|
+
// entry of `aggregates`, null where nothing was there to compute.
|
|
159
|
+
export const TableGroup = z.object({
|
|
160
|
+
values: z.array(z.string()),
|
|
161
|
+
results: z.array(z.number().nullable()),
|
|
162
|
+
});
|
|
93
163
|
// A page of rows (#980): up to 1,000 at a time.
|
|
94
164
|
export const RowLimit = z.coerce.number().int().min(1).max(1000);
|
|
95
165
|
export const TableGetInput = z.strictObject({
|
|
@@ -100,9 +170,17 @@ export const TableGetInput = z.strictObject({
|
|
|
100
170
|
.optional()
|
|
101
171
|
.describe("Read the rows in this order, the first entry first, on the server and over all rows; the table itself keeps its order. Over REST as JSON."),
|
|
102
172
|
filter: z
|
|
103
|
-
.preprocess(fromJson, z.array(
|
|
173
|
+
.preprocess(fromJson, z.array(TableCondition).min(1).max(10))
|
|
174
|
+
.optional()
|
|
175
|
+
.describe("Read only the rows that match every entry, on the server and over all rows. Each entry names a column and one operator: contains, equals, notEquals, greater, less, between or empty; an entry with contains and no column looks in every column. With aggregates the filter picks the rows that are computed. Over REST as JSON."),
|
|
176
|
+
groupBy: z
|
|
177
|
+
.preprocess(fromJson, z.array(ColumnName).min(1).max(3))
|
|
178
|
+
.optional()
|
|
179
|
+
.describe("With aggregates: compute them per group of rows with the same cells in these columns (up to 3), by name. Left out, one group holds every row. Over REST as JSON."),
|
|
180
|
+
aggregates: z
|
|
181
|
+
.preprocess(fromJson, z.array(TableAggregate).min(1).max(10))
|
|
104
182
|
.optional()
|
|
105
|
-
.describe("
|
|
183
|
+
.describe("Compute instead of reading rows: counts, sums, averages, minimums and maximums over the rows the filter lets through, per group of groupBy. The answer holds groups (at most 1,000, ordered by their values) and no rows. Not with sort, limit, cursor or format csv. Over REST as JSON."),
|
|
106
184
|
format: z
|
|
107
185
|
.enum(tableFormats)
|
|
108
186
|
.optional()
|
|
@@ -162,6 +240,7 @@ export const TableUpdateInput = z.strictObject({
|
|
|
162
240
|
.max(10_000)
|
|
163
241
|
.optional()
|
|
164
242
|
.describe("Positions of the rows to remove, each counted in the state of the rev you send, so they do not shift while the call runs. Applied after replace and before append."),
|
|
243
|
+
storage: TableStorage.optional().describe("Store the table as table or as database, a change of its own with the rev you read. To database: the rows are copied and the table keeps no versions from then on; its earlier versions stay readable. To table: only up to 100,000 rows, and it starts keeping versions again with a new one. A secret table stays a table."),
|
|
165
244
|
});
|
|
166
245
|
export const TableDetail = z.object({
|
|
167
246
|
tableId: TableId,
|
|
@@ -184,6 +263,10 @@ export const TableDetail = z.object({
|
|
|
184
263
|
nextCursor: z.string().nullable(),
|
|
185
264
|
})
|
|
186
265
|
.optional(),
|
|
266
|
+
// The groups of a read with `aggregates` (E283, #1276); then there are no rows.
|
|
267
|
+
groups: z.array(TableGroup).optional(),
|
|
268
|
+
// How the table keeps its rows (E283, #1276).
|
|
269
|
+
storage: TableStorage.optional(),
|
|
187
270
|
// The current version's number, as people read it ("Version 6").
|
|
188
271
|
version: z.number().int(),
|
|
189
272
|
// The state the next save sends (E70).
|
|
@@ -211,6 +294,7 @@ export const TableSaved = z.object({
|
|
|
211
294
|
columns: z.array(TableColumn),
|
|
212
295
|
// How many data rows the table holds now.
|
|
213
296
|
rowCount: z.number().int(),
|
|
297
|
+
storage: TableStorage.optional(),
|
|
214
298
|
version: z.number().int(),
|
|
215
299
|
rev: z.number().int(),
|
|
216
300
|
// Only after a change of the columns: every removed column and the positions (in the new state)
|
package/dist/tool.d.ts
CHANGED
package/dist/users/users.d.ts
CHANGED
|
@@ -222,6 +222,7 @@ export declare const UserDetail: z.ZodObject<{
|
|
|
222
222
|
roles: z.ZodNumber;
|
|
223
223
|
apps: z.ZodNumber;
|
|
224
224
|
events: z.ZodNumber;
|
|
225
|
+
machines: z.ZodNumber;
|
|
225
226
|
}, z.core.$strip>;
|
|
226
227
|
keyFacts: z.ZodNullable<z.ZodObject<{
|
|
227
228
|
start: z.ZodString;
|
|
@@ -253,6 +254,35 @@ export declare const UserTestInput: z.ZodObject<{
|
|
|
253
254
|
userId: z.ZodTemplateLiteral<`user_${string}`>;
|
|
254
255
|
}, z.core.$strict>;
|
|
255
256
|
export type UserTestInput = z.infer<typeof UserTestInput>;
|
|
257
|
+
export declare const UserArchiveInput: z.ZodObject<{
|
|
258
|
+
userId: z.ZodTemplateLiteral<`user_${string}`>;
|
|
259
|
+
}, z.core.$strict>;
|
|
260
|
+
export type UserArchiveInput = z.infer<typeof UserArchiveInput>;
|
|
261
|
+
export declare const UserRestoreInput: z.ZodObject<{
|
|
262
|
+
userId: z.ZodTemplateLiteral<`user_${string}`>;
|
|
263
|
+
}, z.core.$strict>;
|
|
264
|
+
export type UserRestoreInput = z.infer<typeof UserRestoreInput>;
|
|
265
|
+
export declare const UserPurgeInput: z.ZodObject<{
|
|
266
|
+
userId: z.ZodTemplateLiteral<`user_${string}`>;
|
|
267
|
+
}, z.core.$strict>;
|
|
268
|
+
export type UserPurgeInput = z.infer<typeof UserPurgeInput>;
|
|
269
|
+
export declare const UserPurged: z.ZodObject<{
|
|
270
|
+
userId: z.ZodTemplateLiteral<`user_${string}`>;
|
|
271
|
+
name: z.ZodString;
|
|
272
|
+
operators: z.ZodNumber;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
export type UserPurged = z.infer<typeof UserPurged>;
|
|
275
|
+
export declare const UserHoldings: z.ZodObject<{
|
|
276
|
+
responsible: z.ZodNumber;
|
|
277
|
+
credentials: z.ZodNumber;
|
|
278
|
+
mcps: z.ZodNumber;
|
|
279
|
+
tasks: z.ZodNumber;
|
|
280
|
+
grants: z.ZodNumber;
|
|
281
|
+
messages: z.ZodNumber;
|
|
282
|
+
conversations: z.ZodNumber;
|
|
283
|
+
operators: z.ZodNumber;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
export type UserHoldings = z.infer<typeof UserHoldings>;
|
|
256
286
|
export declare const UserTestResult: z.ZodObject<{
|
|
257
287
|
accepted: z.ZodBoolean;
|
|
258
288
|
cause: z.ZodOptional<z.ZodString>;
|
package/dist/users/users.js
CHANGED
|
@@ -105,6 +105,9 @@ export const UserDetail = User.extend({
|
|
|
105
105
|
roles: z.number().int(),
|
|
106
106
|
apps: z.number().int(),
|
|
107
107
|
events: z.number().int(),
|
|
108
|
+
// Machines that are not archived and name this person as their responsible, their own personal
|
|
109
|
+
// Operators left out (#1253): the question before archiving names them, and they refuse a purge.
|
|
110
|
+
machines: z.number().int(),
|
|
108
111
|
}),
|
|
109
112
|
// Null for a person, a Claude-Operator and a machine without a key. ⚠️ Never call it `key`: `/mcp`
|
|
110
113
|
// redacts a field of that name whole (`redactSecrets` in `shared`), and the AI would read
|
|
@@ -125,5 +128,34 @@ export const UserUpdateInput = z
|
|
|
125
128
|
export const UserDisableInput = z.strictObject({ userId: UserId });
|
|
126
129
|
export const UserEnableInput = z.strictObject({ userId: UserId });
|
|
127
130
|
export const UserTestInput = z.strictObject({ userId: UserId });
|
|
131
|
+
// Archiving a person, bringing them back and deleting them for good from the archive (#1253). A
|
|
132
|
+
// machine goes through `access_machine_*`; these take a person only.
|
|
133
|
+
export const UserArchiveInput = z.strictObject({ userId: UserId });
|
|
134
|
+
export const UserRestoreInput = z.strictObject({ userId: UserId });
|
|
135
|
+
export const UserPurgeInput = z.strictObject({ userId: UserId });
|
|
136
|
+
// What fell, by name (trap P334): after the purge nothing else can be read about the person.
|
|
137
|
+
// `operators` counts the personal Operators left archived without their person, the mentions the
|
|
138
|
+
// purge lets break (rule destructive).
|
|
139
|
+
export const UserPurged = z.object({
|
|
140
|
+
userId: UserId,
|
|
141
|
+
name: z.string(),
|
|
142
|
+
operators: z.number().int(),
|
|
143
|
+
});
|
|
144
|
+
// What the other packages hold of a person, asked with the id alone before the purge (#1253, E280),
|
|
145
|
+
// and the question before it. `responsible` (live nodes they answer for, `intelligence`),
|
|
146
|
+
// `credentials` and `mcps` (their own subscription token and MCPs, `operator`) refuse the purge:
|
|
147
|
+
// something would break at runtime, or a secret would stay that nobody can disconnect. The rest are
|
|
148
|
+
// mentions the purge lets break, named first (rule destructive): assigned tasks, grants, chat
|
|
149
|
+
// messages, their KI-Chats, and their personal Operators left archived.
|
|
150
|
+
export const UserHoldings = z.object({
|
|
151
|
+
responsible: z.number().int(),
|
|
152
|
+
credentials: z.number().int(),
|
|
153
|
+
mcps: z.number().int(),
|
|
154
|
+
tasks: z.number().int(),
|
|
155
|
+
grants: z.number().int(),
|
|
156
|
+
messages: z.number().int(),
|
|
157
|
+
conversations: z.number().int(),
|
|
158
|
+
operators: z.number().int(),
|
|
159
|
+
});
|
|
128
160
|
// The real result of the delivery, for the one who asked (Funktionen › E-Mails, Testmail).
|
|
129
161
|
export const UserTestResult = Delivery.extend({ to: z.string() });
|
|
@@ -12,6 +12,7 @@ export declare const Changed: z.ZodObject<{
|
|
|
12
12
|
sourceId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
13
13
|
flowId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
14
14
|
stepId: z.ZodOptional<z.ZodTemplateLiteral<`step_${string}`>>;
|
|
15
|
+
processId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
15
16
|
queryId: z.ZodOptional<z.ZodTemplateLiteral<`query_${string}`>>;
|
|
16
17
|
runId: z.ZodOptional<z.ZodTemplateLiteral<`run_${string}`>>;
|
|
17
18
|
messageId: z.ZodOptional<z.ZodTemplateLiteral<`message_${string}`>>;
|
|
@@ -41,8 +42,6 @@ export declare const Changed: z.ZodObject<{
|
|
|
41
42
|
credentialId: z.ZodOptional<z.ZodTemplateLiteral<`credential_${string}`>>;
|
|
42
43
|
mcpId: z.ZodOptional<z.ZodTemplateLiteral<`mcp_${string}`>>;
|
|
43
44
|
conversationId: z.ZodOptional<z.ZodTemplateLiteral<`conversation_${string}`>>;
|
|
44
|
-
typeId: z.ZodOptional<z.ZodTemplateLiteral<`type_${string}`>>;
|
|
45
|
-
relationId: z.ZodOptional<z.ZodTemplateLiteral<`relation_${string}`>>;
|
|
46
45
|
ref: z.ZodOptional<z.ZodString>;
|
|
47
46
|
rev: z.ZodOptional<z.ZodNumber>;
|
|
48
47
|
version: z.ZodOptional<z.ZodNumber>;
|
|
@@ -152,6 +151,7 @@ export declare const Written: z.ZodObject<{
|
|
|
152
151
|
sourceId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
153
152
|
flowId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
154
153
|
stepId: z.ZodOptional<z.ZodTemplateLiteral<`step_${string}`>>;
|
|
154
|
+
processId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
155
155
|
queryId: z.ZodOptional<z.ZodTemplateLiteral<`query_${string}`>>;
|
|
156
156
|
runId: z.ZodOptional<z.ZodTemplateLiteral<`run_${string}`>>;
|
|
157
157
|
messageId: z.ZodOptional<z.ZodTemplateLiteral<`message_${string}`>>;
|
|
@@ -181,8 +181,6 @@ export declare const Written: z.ZodObject<{
|
|
|
181
181
|
credentialId: z.ZodOptional<z.ZodTemplateLiteral<`credential_${string}`>>;
|
|
182
182
|
mcpId: z.ZodOptional<z.ZodTemplateLiteral<`mcp_${string}`>>;
|
|
183
183
|
conversationId: z.ZodOptional<z.ZodTemplateLiteral<`conversation_${string}`>>;
|
|
184
|
-
typeId: z.ZodOptional<z.ZodTemplateLiteral<`type_${string}`>>;
|
|
185
|
-
relationId: z.ZodOptional<z.ZodTemplateLiteral<`relation_${string}`>>;
|
|
186
184
|
ref: z.ZodOptional<z.ZodString>;
|
|
187
185
|
rev: z.ZodOptional<z.ZodNumber>;
|
|
188
186
|
version: z.ZodOptional<z.ZodNumber>;
|
package/dist/written/written.js
CHANGED
|
@@ -16,13 +16,11 @@ import { Missing, Reached } from "../missing/missing.js";
|
|
|
16
16
|
import { NodeId, NodeReader } from "../nodes/nodes.js";
|
|
17
17
|
import { CredentialId } from "../operators/operators.js";
|
|
18
18
|
import { ProviderId } from "../providers/providers.js";
|
|
19
|
-
import { RelationId } from "../relations/relations.js";
|
|
20
19
|
import { RoleId } from "../roles/roles.js";
|
|
21
20
|
import { RunId } from "../runs/runs.js";
|
|
22
21
|
import { FunctionId, InterfaceId, ServiceId } from "../services/services.js";
|
|
23
22
|
import { QueryId } from "../sources/sources.js";
|
|
24
23
|
import { MemberId, TeamId } from "../teams/teams.js";
|
|
25
|
-
import { TypeId } from "../types/types.js";
|
|
26
24
|
import { UserId } from "../users/users.js";
|
|
27
25
|
// What a write answers over `/mcp` (E126, #672): what it changed and what that caused, never the
|
|
28
26
|
// object it wrote. The AI sent the object itself; echoing it back filled an Operator's context with
|
|
@@ -44,6 +42,8 @@ export const Changed = z.object({
|
|
|
44
42
|
// A flow and a step of it (#1228).
|
|
45
43
|
flowId: NodeId.optional(),
|
|
46
44
|
stepId: FlowStepId.optional(),
|
|
45
|
+
// A folder that is a process (#1258), by its folder's id.
|
|
46
|
+
processId: NodeId.optional(),
|
|
47
47
|
queryId: QueryId.optional(),
|
|
48
48
|
runId: RunId.optional(),
|
|
49
49
|
messageId: MessageId.optional(),
|
|
@@ -78,9 +78,6 @@ export const Changed = z.object({
|
|
|
78
78
|
mcpId: McpId.optional(),
|
|
79
79
|
// A person's conversation with a personal Operator (#1212).
|
|
80
80
|
conversationId: idSchema("conversation").optional(),
|
|
81
|
-
// The ontology (#1124): an own type and a relation somebody set.
|
|
82
|
-
typeId: TypeId.optional(),
|
|
83
|
-
relationId: RelationId.optional(),
|
|
84
81
|
// The caller's own name for an entry of a create of many (#625).
|
|
85
82
|
ref: z.string().optional(),
|
|
86
83
|
rev: z.number().int().optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchrd/colab-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"description": "Types, Zod schemas and the service client of Colab, the contract between its UI, backends and outside services.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"ulid": "^3.0.2",
|
|
27
|
+
"yaml": "2.9.1",
|
|
27
28
|
"zod": "^4.4.3"
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const baseRelationTypes: {
|
|
3
|
-
readonly mentions: {
|
|
4
|
-
readonly from: "node";
|
|
5
|
-
readonly to: "node";
|
|
6
|
-
readonly meaning: "mentions";
|
|
7
|
-
readonly source: "text";
|
|
8
|
-
};
|
|
9
|
-
readonly refers: {
|
|
10
|
-
readonly from: "node";
|
|
11
|
-
readonly to: "node";
|
|
12
|
-
readonly meaning: "refers to";
|
|
13
|
-
readonly source: "field";
|
|
14
|
-
};
|
|
15
|
-
readonly waits: {
|
|
16
|
-
readonly from: "node";
|
|
17
|
-
readonly to: "node";
|
|
18
|
-
readonly meaning: "waits for";
|
|
19
|
-
readonly source: "dependency";
|
|
20
|
-
};
|
|
21
|
-
readonly responsible: {
|
|
22
|
-
readonly from: "actor";
|
|
23
|
-
readonly to: "node";
|
|
24
|
-
readonly meaning: "answers for";
|
|
25
|
-
readonly source: "role";
|
|
26
|
-
};
|
|
27
|
-
readonly assignee: {
|
|
28
|
-
readonly from: "actor";
|
|
29
|
-
readonly to: "node";
|
|
30
|
-
readonly meaning: "works on";
|
|
31
|
-
readonly source: "assignment";
|
|
32
|
-
};
|
|
33
|
-
readonly operator: {
|
|
34
|
-
readonly from: "actor";
|
|
35
|
-
readonly to: "node";
|
|
36
|
-
readonly meaning: "pursues";
|
|
37
|
-
readonly source: "assignment";
|
|
38
|
-
};
|
|
39
|
-
readonly grant: {
|
|
40
|
-
readonly from: "node";
|
|
41
|
-
readonly to: "actor";
|
|
42
|
-
readonly meaning: "shared with";
|
|
43
|
-
readonly source: "grant";
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export type BaseRelationType = keyof typeof baseRelationTypes;
|
|
47
|
-
export declare const BaseRelationType: z.ZodEnum<{
|
|
48
|
-
operator: "operator";
|
|
49
|
-
grant: "grant";
|
|
50
|
-
responsible: "responsible";
|
|
51
|
-
mentions: "mentions";
|
|
52
|
-
assignee: "assignee";
|
|
53
|
-
waits: "waits";
|
|
54
|
-
refers: "refers";
|
|
55
|
-
}>;
|
|
56
|
-
export declare const RelationListInput: z.ZodObject<{
|
|
57
|
-
nodeId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
58
|
-
section: z.ZodOptional<z.ZodLiteral<"shared">>;
|
|
59
|
-
}, z.core.$strict>;
|
|
60
|
-
export type RelationListInput = z.infer<typeof RelationListInput>;
|
|
61
|
-
export declare const RelationEnd: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
62
|
-
kind: z.ZodLiteral<"node">;
|
|
63
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
64
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
-
kind: z.ZodLiteral<"actor">;
|
|
66
|
-
userId: z.ZodString;
|
|
67
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
-
kind: z.ZodLiteral<"outside">;
|
|
69
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
70
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
-
kind: z.ZodLiteral<"type">;
|
|
72
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
73
|
-
}, z.core.$strip>], "kind">;
|
|
74
|
-
export type RelationEnd = z.infer<typeof RelationEnd>;
|
|
75
|
-
export declare const RelationId: z.ZodTemplateLiteral<`relation_${string}`>;
|
|
76
|
-
export type RelationId = z.infer<typeof RelationId>;
|
|
77
|
-
export declare const Relation: z.ZodObject<{
|
|
78
|
-
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
79
|
-
operator: "operator";
|
|
80
|
-
grant: "grant";
|
|
81
|
-
responsible: "responsible";
|
|
82
|
-
mentions: "mentions";
|
|
83
|
-
assignee: "assignee";
|
|
84
|
-
waits: "waits";
|
|
85
|
-
refers: "refers";
|
|
86
|
-
}>, z.ZodTemplateLiteral<`type_${string}`>]>;
|
|
87
|
-
origin: z.ZodEnum<{
|
|
88
|
-
set: "set";
|
|
89
|
-
computed: "computed";
|
|
90
|
-
}>;
|
|
91
|
-
from: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
92
|
-
kind: z.ZodLiteral<"node">;
|
|
93
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
94
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
-
kind: z.ZodLiteral<"actor">;
|
|
96
|
-
userId: z.ZodString;
|
|
97
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
-
kind: z.ZodLiteral<"outside">;
|
|
99
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
100
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
101
|
-
kind: z.ZodLiteral<"type">;
|
|
102
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
103
|
-
}, z.core.$strip>], "kind">;
|
|
104
|
-
to: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
105
|
-
kind: z.ZodLiteral<"node">;
|
|
106
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
107
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
108
|
-
kind: z.ZodLiteral<"actor">;
|
|
109
|
-
userId: z.ZodString;
|
|
110
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
-
kind: z.ZodLiteral<"outside">;
|
|
112
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
113
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
114
|
-
kind: z.ZodLiteral<"type">;
|
|
115
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
116
|
-
}, z.core.$strip>], "kind">;
|
|
117
|
-
count: z.ZodNumber;
|
|
118
|
-
relationId: z.ZodNullable<z.ZodTemplateLiteral<`relation_${string}`>>;
|
|
119
|
-
}, z.core.$strip>;
|
|
120
|
-
export type Relation = z.infer<typeof Relation>;
|
|
121
|
-
export declare const RelationActor: z.ZodObject<{
|
|
122
|
-
userId: z.ZodString;
|
|
123
|
-
name: z.ZodString;
|
|
124
|
-
kind: z.ZodEnum<{
|
|
125
|
-
machine: "machine";
|
|
126
|
-
human: "human";
|
|
127
|
-
}>;
|
|
128
|
-
}, z.core.$strip>;
|
|
129
|
-
export type RelationActor = z.infer<typeof RelationActor>;
|
|
130
|
-
export declare const RelationOutside: z.ZodObject<{
|
|
131
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
132
|
-
name: z.ZodString;
|
|
133
|
-
kind: z.ZodCatch<z.ZodEnum<{
|
|
134
|
-
unknown: "unknown";
|
|
135
|
-
file: "file";
|
|
136
|
-
folder: "folder";
|
|
137
|
-
document: "document";
|
|
138
|
-
table: "table";
|
|
139
|
-
board: "board";
|
|
140
|
-
task: "task";
|
|
141
|
-
gadget: "gadget";
|
|
142
|
-
goal: "goal";
|
|
143
|
-
skill: "skill";
|
|
144
|
-
source: "source";
|
|
145
|
-
flow: "flow";
|
|
146
|
-
}>>;
|
|
147
|
-
folderId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
148
|
-
folderName: z.ZodNullable<z.ZodString>;
|
|
149
|
-
}, z.core.$strip>;
|
|
150
|
-
export type RelationOutside = z.infer<typeof RelationOutside>;
|
|
151
|
-
export declare const RelationType: z.ZodObject<{
|
|
152
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
153
|
-
name: z.ZodString;
|
|
154
|
-
kind: z.ZodEnum<{
|
|
155
|
-
object: "object";
|
|
156
|
-
action: "action";
|
|
157
|
-
relation: "relation";
|
|
158
|
-
actor: "actor";
|
|
159
|
-
}>;
|
|
160
|
-
}, z.core.$strip>;
|
|
161
|
-
export type RelationType = z.infer<typeof RelationType>;
|
|
162
|
-
export declare const RelationAction: z.ZodObject<{
|
|
163
|
-
actionId: z.ZodString;
|
|
164
|
-
name: z.ZodString;
|
|
165
|
-
description: z.ZodString;
|
|
166
|
-
origin: z.ZodEnum<{
|
|
167
|
-
set: "set";
|
|
168
|
-
computed: "computed";
|
|
169
|
-
}>;
|
|
170
|
-
approval: z.ZodBoolean;
|
|
171
|
-
implementedBy: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
172
|
-
on: z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
173
|
-
}, z.core.$strip>;
|
|
174
|
-
export type RelationAction = z.infer<typeof RelationAction>;
|
|
175
|
-
export declare const RelationList: z.ZodObject<{
|
|
176
|
-
items: z.ZodArray<z.ZodObject<{
|
|
177
|
-
type: z.ZodUnion<readonly [z.ZodEnum<{
|
|
178
|
-
operator: "operator";
|
|
179
|
-
grant: "grant";
|
|
180
|
-
responsible: "responsible";
|
|
181
|
-
mentions: "mentions";
|
|
182
|
-
assignee: "assignee";
|
|
183
|
-
waits: "waits";
|
|
184
|
-
refers: "refers";
|
|
185
|
-
}>, z.ZodTemplateLiteral<`type_${string}`>]>;
|
|
186
|
-
origin: z.ZodEnum<{
|
|
187
|
-
set: "set";
|
|
188
|
-
computed: "computed";
|
|
189
|
-
}>;
|
|
190
|
-
from: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
191
|
-
kind: z.ZodLiteral<"node">;
|
|
192
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
193
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
-
kind: z.ZodLiteral<"actor">;
|
|
195
|
-
userId: z.ZodString;
|
|
196
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
-
kind: z.ZodLiteral<"outside">;
|
|
198
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
199
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
200
|
-
kind: z.ZodLiteral<"type">;
|
|
201
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
202
|
-
}, z.core.$strip>], "kind">;
|
|
203
|
-
to: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
204
|
-
kind: z.ZodLiteral<"node">;
|
|
205
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
206
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
-
kind: z.ZodLiteral<"actor">;
|
|
208
|
-
userId: z.ZodString;
|
|
209
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
-
kind: z.ZodLiteral<"outside">;
|
|
211
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
212
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
213
|
-
kind: z.ZodLiteral<"type">;
|
|
214
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
215
|
-
}, z.core.$strip>], "kind">;
|
|
216
|
-
count: z.ZodNumber;
|
|
217
|
-
relationId: z.ZodNullable<z.ZodTemplateLiteral<`relation_${string}`>>;
|
|
218
|
-
}, z.core.$strip>>;
|
|
219
|
-
actors: z.ZodArray<z.ZodObject<{
|
|
220
|
-
userId: z.ZodString;
|
|
221
|
-
name: z.ZodString;
|
|
222
|
-
kind: z.ZodEnum<{
|
|
223
|
-
machine: "machine";
|
|
224
|
-
human: "human";
|
|
225
|
-
}>;
|
|
226
|
-
}, z.core.$strip>>;
|
|
227
|
-
outside: z.ZodArray<z.ZodObject<{
|
|
228
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
229
|
-
name: z.ZodString;
|
|
230
|
-
kind: z.ZodCatch<z.ZodEnum<{
|
|
231
|
-
unknown: "unknown";
|
|
232
|
-
file: "file";
|
|
233
|
-
folder: "folder";
|
|
234
|
-
document: "document";
|
|
235
|
-
table: "table";
|
|
236
|
-
board: "board";
|
|
237
|
-
task: "task";
|
|
238
|
-
gadget: "gadget";
|
|
239
|
-
goal: "goal";
|
|
240
|
-
skill: "skill";
|
|
241
|
-
source: "source";
|
|
242
|
-
flow: "flow";
|
|
243
|
-
}>>;
|
|
244
|
-
folderId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
245
|
-
folderName: z.ZodNullable<z.ZodString>;
|
|
246
|
-
}, z.core.$strip>>;
|
|
247
|
-
types: z.ZodArray<z.ZodObject<{
|
|
248
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
249
|
-
name: z.ZodString;
|
|
250
|
-
kind: z.ZodEnum<{
|
|
251
|
-
object: "object";
|
|
252
|
-
action: "action";
|
|
253
|
-
relation: "relation";
|
|
254
|
-
actor: "actor";
|
|
255
|
-
}>;
|
|
256
|
-
}, z.core.$strip>>;
|
|
257
|
-
actions: z.ZodArray<z.ZodObject<{
|
|
258
|
-
actionId: z.ZodString;
|
|
259
|
-
name: z.ZodString;
|
|
260
|
-
description: z.ZodString;
|
|
261
|
-
origin: z.ZodEnum<{
|
|
262
|
-
set: "set";
|
|
263
|
-
computed: "computed";
|
|
264
|
-
}>;
|
|
265
|
-
approval: z.ZodBoolean;
|
|
266
|
-
implementedBy: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
267
|
-
on: z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>;
|
|
268
|
-
}, z.core.$strip>>;
|
|
269
|
-
nodeTypes: z.ZodArray<z.ZodObject<{
|
|
270
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
271
|
-
typeIds: z.ZodArray<z.ZodTemplateLiteral<`type_${string}`>>;
|
|
272
|
-
}, z.core.$strip>>;
|
|
273
|
-
nextCursor: z.ZodNull;
|
|
274
|
-
}, z.core.$strip>;
|
|
275
|
-
export type RelationList = z.infer<typeof RelationList>;
|
|
276
|
-
export declare const RelationSetEnd: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
277
|
-
kind: z.ZodLiteral<"node">;
|
|
278
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
279
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
280
|
-
kind: z.ZodLiteral<"actor">;
|
|
281
|
-
userId: z.ZodString;
|
|
282
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
283
|
-
kind: z.ZodLiteral<"type">;
|
|
284
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
285
|
-
}, z.core.$strict>], "kind">;
|
|
286
|
-
export type RelationSetEnd = z.infer<typeof RelationSetEnd>;
|
|
287
|
-
export declare const RelationCreateInput: z.ZodObject<{
|
|
288
|
-
type: z.ZodString;
|
|
289
|
-
from: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
290
|
-
kind: z.ZodLiteral<"node">;
|
|
291
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
292
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
293
|
-
kind: z.ZodLiteral<"actor">;
|
|
294
|
-
userId: z.ZodString;
|
|
295
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
296
|
-
kind: z.ZodLiteral<"type">;
|
|
297
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
298
|
-
}, z.core.$strict>], "kind">;
|
|
299
|
-
to: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
300
|
-
kind: z.ZodLiteral<"node">;
|
|
301
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
302
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
303
|
-
kind: z.ZodLiteral<"actor">;
|
|
304
|
-
userId: z.ZodString;
|
|
305
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
306
|
-
kind: z.ZodLiteral<"type">;
|
|
307
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
308
|
-
}, z.core.$strict>], "kind">;
|
|
309
|
-
idempotencyKey: z.ZodString;
|
|
310
|
-
}, z.core.$strict>;
|
|
311
|
-
export type RelationCreateInput = z.infer<typeof RelationCreateInput>;
|
|
312
|
-
export declare const SetRelation: z.ZodObject<{
|
|
313
|
-
relationId: z.ZodTemplateLiteral<`relation_${string}`>;
|
|
314
|
-
type: z.ZodString;
|
|
315
|
-
from: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
316
|
-
kind: z.ZodLiteral<"node">;
|
|
317
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
318
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
319
|
-
kind: z.ZodLiteral<"actor">;
|
|
320
|
-
userId: z.ZodString;
|
|
321
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
322
|
-
kind: z.ZodLiteral<"type">;
|
|
323
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
324
|
-
}, z.core.$strip>], "kind">;
|
|
325
|
-
to: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
326
|
-
kind: z.ZodLiteral<"node">;
|
|
327
|
-
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
328
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
329
|
-
kind: z.ZodLiteral<"actor">;
|
|
330
|
-
userId: z.ZodString;
|
|
331
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
332
|
-
kind: z.ZodLiteral<"type">;
|
|
333
|
-
typeId: z.ZodTemplateLiteral<`type_${string}`>;
|
|
334
|
-
}, z.core.$strip>], "kind">;
|
|
335
|
-
createdBy: z.ZodString;
|
|
336
|
-
createdAt: z.ZodISODateTime;
|
|
337
|
-
}, z.core.$strip>;
|
|
338
|
-
export type SetRelation = z.infer<typeof SetRelation>;
|
|
339
|
-
export declare const RelationRemoveInput: z.ZodObject<{
|
|
340
|
-
relationId: z.ZodTemplateLiteral<`relation_${string}`>;
|
|
341
|
-
}, z.core.$strict>;
|
|
342
|
-
export type RelationRemoveInput = z.infer<typeof RelationRemoveInput>;
|