runline 0.12.0 → 0.13.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/plugins/_shared/googleSchemas.js +23 -0
- package/dist/plugins/gmail/src/index.js +168 -184
- package/dist/plugins/googleAppsScript/src/index.js +88 -43
- package/dist/plugins/googleCalendar/src/index.js +307 -250
- package/dist/plugins/googleContacts/src/index.js +134 -145
- package/dist/plugins/googleDocs/src/documents.js +27 -38
- package/dist/plugins/googleDocs/src/formatting.js +49 -47
- package/dist/plugins/googleDocs/src/images.js +21 -26
- package/dist/plugins/googleDocs/src/shared.js +55 -0
- package/dist/plugins/googleDocs/src/structure.js +98 -123
- package/dist/plugins/googleDocs/src/tables.js +92 -154
- package/dist/plugins/googleDocs/src/tabs.js +24 -23
- package/dist/plugins/googleDocs/src/text.js +97 -136
- package/dist/plugins/googleDrive/src/index.js +414 -408
- package/dist/plugins/googleImage/src/index.js +13 -16
- package/dist/plugins/googleSheets/src/index.js +504 -339
- package/dist/plugins/googleSlides/src/index.js +85 -72
- package/dist/plugins/googleTasks/src/index.js +82 -92
- package/dist/plugins/shiftLabs/src/index.js +6 -0
- package/dist/plugins/shiftLabs/src/shared.js +2 -0
- package/dist/plugins/shiftLabs/src/transcription.js +203 -0
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as t from "typebox";
|
|
2
|
+
import { buildLocation, compact, DocumentInput, extractDocumentId, HexColor, hexToRgbF, LOCATION_REQUIREMENT, LocationInput, location, PositivePoints, runBatchUpdate, SegmentInput, STRICT_OBJECT, TableLocationInput, } from "./shared.js";
|
|
3
|
+
const PositiveSpan = t.Integer({ minimum: 1 });
|
|
2
4
|
function tableStartLocation(p) {
|
|
3
5
|
return location(p.tableStartIndex, p.segmentId, p.tabId);
|
|
4
6
|
}
|
|
@@ -16,15 +18,12 @@ export function registerTablesActions(rl) {
|
|
|
16
18
|
rl.registerAction("document.insertTable", {
|
|
17
19
|
access: "write",
|
|
18
20
|
description: "Insert an empty table with the given dimensions.",
|
|
19
|
-
inputSchema: {
|
|
20
|
-
|
|
21
|
-
rows:
|
|
22
|
-
columns:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
segmentId: { type: "string", required: false },
|
|
26
|
-
tabId: { type: "string", required: false },
|
|
27
|
-
},
|
|
21
|
+
inputSchema: t.Object({
|
|
22
|
+
...DocumentInput,
|
|
23
|
+
rows: PositiveSpan,
|
|
24
|
+
columns: PositiveSpan,
|
|
25
|
+
...LocationInput,
|
|
26
|
+
}, { ...STRICT_OBJECT, anyOf: LOCATION_REQUIREMENT }),
|
|
28
27
|
async execute(input, ctx) {
|
|
29
28
|
const p = (input ?? {});
|
|
30
29
|
const documentId = extractDocumentId(p.document);
|
|
@@ -41,23 +40,11 @@ export function registerTablesActions(rl) {
|
|
|
41
40
|
rl.registerAction("document.insertTableRow", {
|
|
42
41
|
access: "write",
|
|
43
42
|
description: "Insert a table row above or below a cell in an existing table.",
|
|
44
|
-
inputSchema: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
description: "Document index where the table begins",
|
|
50
|
-
},
|
|
51
|
-
rowIndex: { type: "number", required: true },
|
|
52
|
-
columnIndex: { type: "number", required: true },
|
|
53
|
-
insertBelow: {
|
|
54
|
-
type: "boolean",
|
|
55
|
-
required: false,
|
|
56
|
-
description: "default: false (insert above)",
|
|
57
|
-
},
|
|
58
|
-
segmentId: { type: "string", required: false },
|
|
59
|
-
tabId: { type: "string", required: false },
|
|
60
|
-
},
|
|
43
|
+
inputSchema: t.Object({
|
|
44
|
+
...DocumentInput,
|
|
45
|
+
...TableLocationInput,
|
|
46
|
+
insertBelow: t.Optional(t.Boolean()),
|
|
47
|
+
}, STRICT_OBJECT),
|
|
61
48
|
async execute(input, ctx) {
|
|
62
49
|
const p = (input ?? {});
|
|
63
50
|
const documentId = extractDocumentId(p.document);
|
|
@@ -72,14 +59,7 @@ export function registerTablesActions(rl) {
|
|
|
72
59
|
rl.registerAction("document.deleteTableRow", {
|
|
73
60
|
access: "write",
|
|
74
61
|
description: "Delete a specific row from a table.",
|
|
75
|
-
inputSchema: {
|
|
76
|
-
document: { type: "string", required: true },
|
|
77
|
-
tableStartIndex: { type: "number", required: true },
|
|
78
|
-
rowIndex: { type: "number", required: true },
|
|
79
|
-
columnIndex: { type: "number", required: true },
|
|
80
|
-
segmentId: { type: "string", required: false },
|
|
81
|
-
tabId: { type: "string", required: false },
|
|
82
|
-
},
|
|
62
|
+
inputSchema: t.Object({ ...DocumentInput, ...TableLocationInput }, STRICT_OBJECT),
|
|
83
63
|
async execute(input, ctx) {
|
|
84
64
|
const p = (input ?? {});
|
|
85
65
|
const documentId = extractDocumentId(p.document);
|
|
@@ -93,19 +73,11 @@ export function registerTablesActions(rl) {
|
|
|
93
73
|
rl.registerAction("document.insertTableColumn", {
|
|
94
74
|
access: "write",
|
|
95
75
|
description: "Insert a column left or right of a cell.",
|
|
96
|
-
inputSchema: {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
insertRight: {
|
|
102
|
-
type: "boolean",
|
|
103
|
-
required: false,
|
|
104
|
-
description: "default: false (insert left)",
|
|
105
|
-
},
|
|
106
|
-
segmentId: { type: "string", required: false },
|
|
107
|
-
tabId: { type: "string", required: false },
|
|
108
|
-
},
|
|
76
|
+
inputSchema: t.Object({
|
|
77
|
+
...DocumentInput,
|
|
78
|
+
...TableLocationInput,
|
|
79
|
+
insertRight: t.Optional(t.Boolean()),
|
|
80
|
+
}, STRICT_OBJECT),
|
|
109
81
|
async execute(input, ctx) {
|
|
110
82
|
const p = (input ?? {});
|
|
111
83
|
const documentId = extractDocumentId(p.document);
|
|
@@ -120,14 +92,7 @@ export function registerTablesActions(rl) {
|
|
|
120
92
|
rl.registerAction("document.deleteTableColumn", {
|
|
121
93
|
access: "write",
|
|
122
94
|
description: "Delete a specific column from a table.",
|
|
123
|
-
inputSchema: {
|
|
124
|
-
document: { type: "string", required: true },
|
|
125
|
-
tableStartIndex: { type: "number", required: true },
|
|
126
|
-
rowIndex: { type: "number", required: true },
|
|
127
|
-
columnIndex: { type: "number", required: true },
|
|
128
|
-
segmentId: { type: "string", required: false },
|
|
129
|
-
tabId: { type: "string", required: false },
|
|
130
|
-
},
|
|
95
|
+
inputSchema: t.Object({ ...DocumentInput, ...TableLocationInput }, STRICT_OBJECT),
|
|
131
96
|
async execute(input, ctx) {
|
|
132
97
|
const p = (input ?? {});
|
|
133
98
|
const documentId = extractDocumentId(p.document);
|
|
@@ -141,30 +106,28 @@ export function registerTablesActions(rl) {
|
|
|
141
106
|
rl.registerAction("document.updateTableCellStyle", {
|
|
142
107
|
access: "write",
|
|
143
108
|
description: "Apply table-cell styling (background color, borders, padding) to a contiguous span of cells. Pass either a single cell via `tableStartLocation+rowIndex+columnIndex`, or a range via `tableStartLocation+rowSpan+columnSpan`.",
|
|
144
|
-
inputSchema: {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
required:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
tabId: { type: "string", required: false },
|
|
167
|
-
},
|
|
109
|
+
inputSchema: t.Object({
|
|
110
|
+
...DocumentInput,
|
|
111
|
+
...TableLocationInput,
|
|
112
|
+
rowSpan: t.Optional(PositiveSpan),
|
|
113
|
+
columnSpan: t.Optional(PositiveSpan),
|
|
114
|
+
backgroundColorHex: t.Optional(HexColor),
|
|
115
|
+
paddingLeftPt: t.Optional(PositivePoints),
|
|
116
|
+
paddingRightPt: t.Optional(PositivePoints),
|
|
117
|
+
paddingTopPt: t.Optional(PositivePoints),
|
|
118
|
+
paddingBottomPt: t.Optional(PositivePoints),
|
|
119
|
+
contentAlignment: t.Optional(t.Union([t.Literal("TOP"), t.Literal("MIDDLE"), t.Literal("BOTTOM")])),
|
|
120
|
+
}, {
|
|
121
|
+
...STRICT_OBJECT,
|
|
122
|
+
anyOf: [
|
|
123
|
+
{ required: ["backgroundColorHex"] },
|
|
124
|
+
{ required: ["paddingLeftPt"] },
|
|
125
|
+
{ required: ["paddingRightPt"] },
|
|
126
|
+
{ required: ["paddingTopPt"] },
|
|
127
|
+
{ required: ["paddingBottomPt"] },
|
|
128
|
+
{ required: ["contentAlignment"] },
|
|
129
|
+
],
|
|
130
|
+
}),
|
|
168
131
|
async execute(input, ctx) {
|
|
169
132
|
const p = (input ?? {});
|
|
170
133
|
const documentId = extractDocumentId(p.document);
|
|
@@ -222,16 +185,12 @@ export function registerTablesActions(rl) {
|
|
|
222
185
|
rl.registerAction("document.mergeTableCells", {
|
|
223
186
|
access: "write",
|
|
224
187
|
description: "Merge a contiguous block of cells in a table.",
|
|
225
|
-
inputSchema: {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
columnSpan: { type: "number", required: true },
|
|
232
|
-
segmentId: { type: "string", required: false },
|
|
233
|
-
tabId: { type: "string", required: false },
|
|
234
|
-
},
|
|
188
|
+
inputSchema: t.Object({
|
|
189
|
+
...DocumentInput,
|
|
190
|
+
...TableLocationInput,
|
|
191
|
+
rowSpan: PositiveSpan,
|
|
192
|
+
columnSpan: PositiveSpan,
|
|
193
|
+
}, STRICT_OBJECT),
|
|
235
194
|
async execute(input, ctx) {
|
|
236
195
|
const p = (input ?? {});
|
|
237
196
|
const documentId = extractDocumentId(p.document);
|
|
@@ -255,16 +214,12 @@ export function registerTablesActions(rl) {
|
|
|
255
214
|
rl.registerAction("document.unmergeTableCells", {
|
|
256
215
|
access: "write",
|
|
257
216
|
description: "Unmerge a previously merged block of cells.",
|
|
258
|
-
inputSchema: {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
columnSpan: { type: "number", required: true },
|
|
265
|
-
segmentId: { type: "string", required: false },
|
|
266
|
-
tabId: { type: "string", required: false },
|
|
267
|
-
},
|
|
217
|
+
inputSchema: t.Object({
|
|
218
|
+
...DocumentInput,
|
|
219
|
+
...TableLocationInput,
|
|
220
|
+
rowSpan: PositiveSpan,
|
|
221
|
+
columnSpan: PositiveSpan,
|
|
222
|
+
}, STRICT_OBJECT),
|
|
268
223
|
async execute(input, ctx) {
|
|
269
224
|
const p = (input ?? {});
|
|
270
225
|
const documentId = extractDocumentId(p.document);
|
|
@@ -288,32 +243,26 @@ export function registerTablesActions(rl) {
|
|
|
288
243
|
rl.registerAction("document.updateTableColumnProperties", {
|
|
289
244
|
access: "write",
|
|
290
245
|
description: "Update table column properties such as width for selected columns or all columns.",
|
|
291
|
-
inputSchema: {
|
|
292
|
-
|
|
293
|
-
tableStartIndex: {
|
|
294
|
-
columnIndices: {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
required:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
required: false,
|
|
312
|
-
description: "Field mask. Defaults to fields implied by supplied properties.",
|
|
313
|
-
},
|
|
314
|
-
segmentId: { type: "string", required: false },
|
|
315
|
-
tabId: { type: "string", required: false },
|
|
316
|
-
},
|
|
246
|
+
inputSchema: t.Object({
|
|
247
|
+
...DocumentInput,
|
|
248
|
+
tableStartIndex: t.Integer({ minimum: 0 }),
|
|
249
|
+
columnIndices: t.Optional(t.Array(t.Integer({ minimum: 0 }), { minItems: 1 })),
|
|
250
|
+
widthPt: t.Optional(PositivePoints),
|
|
251
|
+
widthType: t.Optional(t.Union([
|
|
252
|
+
t.Literal("WIDTH_TYPE_UNSPECIFIED"),
|
|
253
|
+
t.Literal("EVENLY_DISTRIBUTED"),
|
|
254
|
+
t.Literal("FIXED_WIDTH"),
|
|
255
|
+
])),
|
|
256
|
+
fields: t.Optional(t.String({ minLength: 1 })),
|
|
257
|
+
...SegmentInput,
|
|
258
|
+
}, {
|
|
259
|
+
...STRICT_OBJECT,
|
|
260
|
+
anyOf: [
|
|
261
|
+
{ required: ["widthPt"] },
|
|
262
|
+
{ required: ["widthType"] },
|
|
263
|
+
{ required: ["fields"] },
|
|
264
|
+
],
|
|
265
|
+
}),
|
|
317
266
|
async execute(input, ctx) {
|
|
318
267
|
const p = (input ?? {});
|
|
319
268
|
const documentId = extractDocumentId(p.document);
|
|
@@ -344,23 +293,17 @@ export function registerTablesActions(rl) {
|
|
|
344
293
|
rl.registerAction("document.updateTableRowStyle", {
|
|
345
294
|
access: "write",
|
|
346
295
|
description: "Update table row style such as minimum row height for selected rows or all rows.",
|
|
347
|
-
inputSchema: {
|
|
348
|
-
|
|
349
|
-
tableStartIndex: {
|
|
350
|
-
rowIndices: {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
required: false,
|
|
359
|
-
description: "Field mask. Defaults to fields implied by supplied properties.",
|
|
360
|
-
},
|
|
361
|
-
segmentId: { type: "string", required: false },
|
|
362
|
-
tabId: { type: "string", required: false },
|
|
363
|
-
},
|
|
296
|
+
inputSchema: t.Object({
|
|
297
|
+
...DocumentInput,
|
|
298
|
+
tableStartIndex: t.Integer({ minimum: 0 }),
|
|
299
|
+
rowIndices: t.Optional(t.Array(t.Integer({ minimum: 0 }), { minItems: 1 })),
|
|
300
|
+
minRowHeightPt: t.Optional(PositivePoints),
|
|
301
|
+
fields: t.Optional(t.String({ minLength: 1 })),
|
|
302
|
+
...SegmentInput,
|
|
303
|
+
}, {
|
|
304
|
+
...STRICT_OBJECT,
|
|
305
|
+
anyOf: [{ required: ["minRowHeightPt"] }, { required: ["fields"] }],
|
|
306
|
+
}),
|
|
364
307
|
async execute(input, ctx) {
|
|
365
308
|
const p = (input ?? {});
|
|
366
309
|
const documentId = extractDocumentId(p.document);
|
|
@@ -386,17 +329,12 @@ export function registerTablesActions(rl) {
|
|
|
386
329
|
rl.registerAction("document.pinTableHeaderRows", {
|
|
387
330
|
access: "write",
|
|
388
331
|
description: "Pin or unpin header rows in a table.",
|
|
389
|
-
inputSchema: {
|
|
390
|
-
|
|
391
|
-
tableStartIndex: {
|
|
392
|
-
pinnedHeaderRowsCount: {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
description: "Use 0 to unpin all header rows.",
|
|
396
|
-
},
|
|
397
|
-
segmentId: { type: "string", required: false },
|
|
398
|
-
tabId: { type: "string", required: false },
|
|
399
|
-
},
|
|
332
|
+
inputSchema: t.Object({
|
|
333
|
+
...DocumentInput,
|
|
334
|
+
tableStartIndex: t.Integer({ minimum: 0 }),
|
|
335
|
+
pinnedHeaderRowsCount: t.Integer({ minimum: 0 }),
|
|
336
|
+
...SegmentInput,
|
|
337
|
+
}, STRICT_OBJECT),
|
|
400
338
|
async execute(input, ctx) {
|
|
401
339
|
const p = (input ?? {});
|
|
402
340
|
const documentId = extractDocumentId(p.document);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as t from "typebox";
|
|
2
|
+
import { compact, DocumentInput, extractDocumentId, runBatchUpdate, STRICT_OBJECT, } from "./shared.js";
|
|
2
3
|
function tabProperties(p) {
|
|
3
4
|
return compact({
|
|
4
5
|
tabId: p.tabId,
|
|
@@ -11,12 +12,12 @@ export function registerTabActions(rl) {
|
|
|
11
12
|
rl.registerAction("document.addDocumentTab", {
|
|
12
13
|
access: "write",
|
|
13
14
|
description: "Add a Google Docs document tab, optionally at an index or under a parent tab.",
|
|
14
|
-
inputSchema: {
|
|
15
|
-
|
|
16
|
-
title: {
|
|
17
|
-
index: {
|
|
18
|
-
parentTabId: {
|
|
19
|
-
},
|
|
15
|
+
inputSchema: t.Object({
|
|
16
|
+
...DocumentInput,
|
|
17
|
+
title: t.Optional(t.String({ minLength: 1 })),
|
|
18
|
+
index: t.Optional(t.Integer({ minimum: 0 })),
|
|
19
|
+
parentTabId: t.Optional(t.String({ minLength: 1 })),
|
|
20
|
+
}, STRICT_OBJECT),
|
|
20
21
|
async execute(input, ctx) {
|
|
21
22
|
const p = (input ?? {});
|
|
22
23
|
const documentId = extractDocumentId(p.document);
|
|
@@ -28,10 +29,7 @@ export function registerTabActions(rl) {
|
|
|
28
29
|
rl.registerAction("document.deleteTab", {
|
|
29
30
|
access: "write",
|
|
30
31
|
description: "Delete a Google Docs document tab by tab ID. Child tabs are deleted too.",
|
|
31
|
-
inputSchema: {
|
|
32
|
-
document: { type: "string", required: true },
|
|
33
|
-
tabId: { type: "string", required: true },
|
|
34
|
-
},
|
|
32
|
+
inputSchema: t.Object({ ...DocumentInput, tabId: t.String({ minLength: 1 }) }, STRICT_OBJECT),
|
|
35
33
|
async execute(input, ctx) {
|
|
36
34
|
const p = (input ?? {});
|
|
37
35
|
const documentId = extractDocumentId(p.document);
|
|
@@ -43,18 +41,21 @@ export function registerTabActions(rl) {
|
|
|
43
41
|
rl.registerAction("document.updateDocumentTabProperties", {
|
|
44
42
|
access: "write",
|
|
45
43
|
description: "Update Google Docs tab properties such as title, index, or parent tab.",
|
|
46
|
-
inputSchema: {
|
|
47
|
-
|
|
48
|
-
tabId: {
|
|
49
|
-
title: {
|
|
50
|
-
index: {
|
|
51
|
-
parentTabId: {
|
|
52
|
-
fields: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
inputSchema: t.Object({
|
|
45
|
+
...DocumentInput,
|
|
46
|
+
tabId: t.String({ minLength: 1 }),
|
|
47
|
+
title: t.Optional(t.String({ minLength: 1 })),
|
|
48
|
+
index: t.Optional(t.Integer({ minimum: 0 })),
|
|
49
|
+
parentTabId: t.Optional(t.String({ minLength: 1 })),
|
|
50
|
+
fields: t.Optional(t.String({ minLength: 1 })),
|
|
51
|
+
}, {
|
|
52
|
+
...STRICT_OBJECT,
|
|
53
|
+
anyOf: [
|
|
54
|
+
{ required: ["title"] },
|
|
55
|
+
{ required: ["index"] },
|
|
56
|
+
{ required: ["parentTabId"] },
|
|
57
|
+
],
|
|
58
|
+
}),
|
|
58
59
|
async execute(input, ctx) {
|
|
59
60
|
const p = (input ?? {});
|
|
60
61
|
const documentId = extractDocumentId(p.document);
|