@retainer/extension 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +69 -2
- package/dist/cron.d.ts +2 -0
- package/dist/cron.js +56 -0
- package/dist/cron.js.map +1 -0
- package/dist/index.d.ts +1006 -0
- package/dist/index.js +917 -0
- package/dist/index.js.map +1 -0
- package/dist/model.d.ts +14 -0
- package/dist/model.js +25 -0
- package/dist/model.js.map +1 -0
- package/dist/nango-gmail.d.ts +56 -0
- package/dist/nango-gmail.js +244 -0
- package/dist/nango-gmail.js.map +1 -0
- package/dist/protocol.d.ts +127 -0
- package/dist/protocol.js +126 -0
- package/dist/protocol.js.map +1 -0
- package/dist/semver.d.ts +30 -0
- package/dist/semver.js +115 -0
- package/dist/semver.js.map +1 -0
- package/dist/webhook.d.ts +30 -0
- package/dist/webhook.js +61 -0
- package/dist/webhook.js.map +1 -0
- package/package.json +43 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1006 @@
|
|
|
1
|
+
export { nextOccurrence } from './cron.js';
|
|
2
|
+
export { compareVersions, newestReleases, parseServerRange, satisfiesServerRange, } from './semver.js';
|
|
3
|
+
import { type Actor } from '@retainer/shared';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/** The icons a sidebar link may name; the web app draws each. */
|
|
6
|
+
export declare const SIDEBAR_ICONS: readonly ['app', 'calendar', 'clock', 'mail', 'chart', 'file', 'users'];
|
|
7
|
+
export type SidebarIcon = (typeof SIDEBAR_ICONS)[number];
|
|
8
|
+
/** The query parameter a sidebar link carries, naming the installation, for the app's sign-in. */
|
|
9
|
+
export declare const SIDEBAR_INSTALLATION_PARAM = "retainer_installation";
|
|
10
|
+
/** Capabilities a function may declare in `uses`; open for later ones (model calls spec 11). */
|
|
11
|
+
export declare const EXTENSION_USES: readonly ['model'];
|
|
12
|
+
export type ExtensionUse = (typeof EXTENSION_USES)[number];
|
|
13
|
+
/**
|
|
14
|
+
* What approving `model` means, in plain words, wherever access is shown
|
|
15
|
+
* (model calls spec 3.1). One sentence for every release: the grant is model
|
|
16
|
+
* use, not a particular extent of it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MODEL_USE_NOTICE = "When this extension uses a model, it sends the workspace data involved to Anthropic for processing.";
|
|
19
|
+
export declare const TAMLOOT_REGISTRATION_ID = "54326882-cc28-4983-a5fe-cf0298520b68";
|
|
20
|
+
/**
|
|
21
|
+
* The installation setting that chooses what happens when the source deletes
|
|
22
|
+
* an item it imported; absent, the release's `onSourceDelete` applies.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SOURCE_DELETE_SETTING = "onSourceDelete";
|
|
25
|
+
/** What happens to imported content when the source deletes it, for these installation settings. */
|
|
26
|
+
export declare function sourceDeletePolicy(manifest: Pick<ExtensionManifest, 'onSourceDelete' | 'settings'>, settings: Record<string, unknown>): ExtensionManifest['onSourceDelete'];
|
|
27
|
+
/**
|
|
28
|
+
* Plain words for the options of the policies the platform itself applies,
|
|
29
|
+
* wherever they are chosen or shown.
|
|
30
|
+
*/
|
|
31
|
+
export declare const POLICY_OPTION_LABELS: Record<string, Record<string, string>>;
|
|
32
|
+
export type InputSchema = {
|
|
33
|
+
type: 'object' | 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'null';
|
|
34
|
+
description?: string;
|
|
35
|
+
properties?: Record<string, InputSchema>;
|
|
36
|
+
required?: string[];
|
|
37
|
+
additionalProperties?: false;
|
|
38
|
+
items?: InputSchema;
|
|
39
|
+
maxLength?: number;
|
|
40
|
+
maxItems?: number;
|
|
41
|
+
};
|
|
42
|
+
export declare const bindingKeySchema: z.ZodString;
|
|
43
|
+
export declare const functionSchema: z.ZodObject<{
|
|
44
|
+
universalId: z.ZodUUID;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
description: z.ZodString;
|
|
47
|
+
handlerDigest: z.ZodString;
|
|
48
|
+
trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
49
|
+
kind: z.ZodLiteral<"configure">;
|
|
50
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
51
|
+
kind: z.ZodLiteral<"install">;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"uninstall">;
|
|
54
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
55
|
+
kind: z.ZodLiteral<"connect">;
|
|
56
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
57
|
+
kind: z.ZodLiteral<"disconnect">;
|
|
58
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"job">;
|
|
60
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
+
kind: z.ZodLiteral<"tool">;
|
|
62
|
+
title: z.ZodString;
|
|
63
|
+
effect: z.ZodEnum<{
|
|
64
|
+
read: "read";
|
|
65
|
+
send: "send";
|
|
66
|
+
write: "write";
|
|
67
|
+
}>;
|
|
68
|
+
connection: z.ZodEnum<{
|
|
69
|
+
member: "member";
|
|
70
|
+
workspace: "workspace";
|
|
71
|
+
}>;
|
|
72
|
+
outputSchema: z.ZodType<InputSchema, unknown, z.core.$ZodTypeInternals<InputSchema, unknown>>;
|
|
73
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
74
|
+
kind: z.ZodLiteral<"route">;
|
|
75
|
+
route: z.ZodString;
|
|
76
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"serverRoute">;
|
|
78
|
+
route: z.ZodString;
|
|
79
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
80
|
+
kind: z.ZodLiteral<"schedule">;
|
|
81
|
+
cron: z.ZodString;
|
|
82
|
+
timezone: z.ZodLiteral<"UTC">;
|
|
83
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
84
|
+
kind: z.ZodLiteral<"change">;
|
|
85
|
+
binding: z.ZodString;
|
|
86
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
related: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
89
|
+
create: "create";
|
|
90
|
+
update: "update";
|
|
91
|
+
}>>>;
|
|
92
|
+
}, z.core.$strict>], "kind">;
|
|
93
|
+
inputSchema: z.ZodType<InputSchema, unknown, z.core.$ZodTypeInternals<InputSchema, unknown>>;
|
|
94
|
+
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
95
|
+
secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
97
|
+
read: "read";
|
|
98
|
+
write: "write";
|
|
99
|
+
}>>>;
|
|
100
|
+
mappedWrite: z.ZodOptional<z.ZodString>;
|
|
101
|
+
uses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
102
|
+
model: "model";
|
|
103
|
+
}>>>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
declare const bindingSchema: z.ZodObject<{
|
|
106
|
+
key: z.ZodString;
|
|
107
|
+
label: z.ZodString;
|
|
108
|
+
description: z.ZodString;
|
|
109
|
+
class: z.ZodEnum<{
|
|
110
|
+
entity: "entity";
|
|
111
|
+
event: "event";
|
|
112
|
+
}>;
|
|
113
|
+
access: z.ZodEnum<{
|
|
114
|
+
read: "read";
|
|
115
|
+
write: "write";
|
|
116
|
+
}>;
|
|
117
|
+
required: z.ZodBoolean;
|
|
118
|
+
owned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
119
|
+
match: z.ZodOptional<z.ZodString>;
|
|
120
|
+
creates: z.ZodOptional<z.ZodLiteral<true>>;
|
|
121
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
122
|
+
key: z.ZodString;
|
|
123
|
+
label: z.ZodString;
|
|
124
|
+
description: z.ZodOptional<z.ZodString>;
|
|
125
|
+
types: z.ZodArray<z.ZodEnum<{
|
|
126
|
+
address: "address";
|
|
127
|
+
boolean: "boolean";
|
|
128
|
+
date: "date";
|
|
129
|
+
date_time: "date_time";
|
|
130
|
+
emails: "emails";
|
|
131
|
+
files: "files";
|
|
132
|
+
full_name: "full_name";
|
|
133
|
+
json: "json";
|
|
134
|
+
links: "links";
|
|
135
|
+
money: "money";
|
|
136
|
+
multi_select: "multi_select";
|
|
137
|
+
number: "number";
|
|
138
|
+
phones: "phones";
|
|
139
|
+
relation: "relation";
|
|
140
|
+
select: "select";
|
|
141
|
+
text: "text";
|
|
142
|
+
}>>;
|
|
143
|
+
required: z.ZodBoolean;
|
|
144
|
+
lookup: z.ZodOptional<z.ZodLiteral<true>>;
|
|
145
|
+
owned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
146
|
+
installationOwned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
147
|
+
target: z.ZodOptional<z.ZodString>;
|
|
148
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
149
|
+
create: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
universalId: z.ZodUUID;
|
|
151
|
+
name: z.ZodString;
|
|
152
|
+
label: z.ZodString;
|
|
153
|
+
type: z.ZodEnum<{
|
|
154
|
+
address: "address";
|
|
155
|
+
boolean: "boolean";
|
|
156
|
+
date: "date";
|
|
157
|
+
date_time: "date_time";
|
|
158
|
+
emails: "emails";
|
|
159
|
+
files: "files";
|
|
160
|
+
full_name: "full_name";
|
|
161
|
+
json: "json";
|
|
162
|
+
links: "links";
|
|
163
|
+
money: "money";
|
|
164
|
+
multi_select: "multi_select";
|
|
165
|
+
number: "number";
|
|
166
|
+
phones: "phones";
|
|
167
|
+
relation: "relation";
|
|
168
|
+
select: "select";
|
|
169
|
+
text: "text";
|
|
170
|
+
}>;
|
|
171
|
+
description: z.ZodOptional<z.ZodString>;
|
|
172
|
+
isNullable: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
isUnique: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
+
isFilterable: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
isSearchable: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
value: z.ZodString;
|
|
179
|
+
label: z.ZodString;
|
|
180
|
+
}, z.core.$strict>>>;
|
|
181
|
+
targetObject: z.ZodOptional<z.ZodUUID>;
|
|
182
|
+
targetObjects: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
183
|
+
relationCardinality: z.ZodOptional<z.ZodEnum<{
|
|
184
|
+
many_to_many: "many_to_many";
|
|
185
|
+
many_to_one: "many_to_one";
|
|
186
|
+
}>>;
|
|
187
|
+
onDelete: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
cascade: "cascade";
|
|
189
|
+
set_null: "set_null";
|
|
190
|
+
}>>;
|
|
191
|
+
rollUpEvents: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
maxValues: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
}, z.core.$strict>>;
|
|
196
|
+
create: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
universalId: z.ZodUUID;
|
|
198
|
+
nameSingular: z.ZodString;
|
|
199
|
+
namePlural: z.ZodString;
|
|
200
|
+
labelSingular: z.ZodString;
|
|
201
|
+
labelPlural: z.ZodString;
|
|
202
|
+
class: z.ZodOptional<z.ZodEnum<{
|
|
203
|
+
entity: "entity";
|
|
204
|
+
event: "event";
|
|
205
|
+
}>>;
|
|
206
|
+
description: z.ZodOptional<z.ZodString>;
|
|
207
|
+
labelField: z.ZodOptional<z.ZodString>;
|
|
208
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
209
|
+
universalId: z.ZodUUID;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
label: z.ZodString;
|
|
212
|
+
type: z.ZodEnum<{
|
|
213
|
+
address: "address";
|
|
214
|
+
boolean: "boolean";
|
|
215
|
+
date: "date";
|
|
216
|
+
date_time: "date_time";
|
|
217
|
+
emails: "emails";
|
|
218
|
+
files: "files";
|
|
219
|
+
full_name: "full_name";
|
|
220
|
+
json: "json";
|
|
221
|
+
links: "links";
|
|
222
|
+
money: "money";
|
|
223
|
+
multi_select: "multi_select";
|
|
224
|
+
number: "number";
|
|
225
|
+
phones: "phones";
|
|
226
|
+
relation: "relation";
|
|
227
|
+
select: "select";
|
|
228
|
+
text: "text";
|
|
229
|
+
}>;
|
|
230
|
+
description: z.ZodOptional<z.ZodString>;
|
|
231
|
+
isNullable: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
+
isUnique: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
isFilterable: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
isSearchable: z.ZodOptional<z.ZodBoolean>;
|
|
235
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
237
|
+
value: z.ZodString;
|
|
238
|
+
label: z.ZodString;
|
|
239
|
+
}, z.core.$strict>>>;
|
|
240
|
+
targetObject: z.ZodOptional<z.ZodUUID>;
|
|
241
|
+
targetObjects: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
242
|
+
relationCardinality: z.ZodOptional<z.ZodEnum<{
|
|
243
|
+
many_to_many: "many_to_many";
|
|
244
|
+
many_to_one: "many_to_one";
|
|
245
|
+
}>>;
|
|
246
|
+
onDelete: z.ZodOptional<z.ZodEnum<{
|
|
247
|
+
cascade: "cascade";
|
|
248
|
+
set_null: "set_null";
|
|
249
|
+
}>>;
|
|
250
|
+
rollUpEvents: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
maxValues: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
}, z.core.$strict>>;
|
|
253
|
+
}, z.core.$strict>>;
|
|
254
|
+
}, z.core.$strict>>;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
export type ExtensionBinding = z.infer<typeof bindingSchema>;
|
|
257
|
+
/**
|
|
258
|
+
* Whether a field can hold a binding field's values: not an event type's core
|
|
259
|
+
* field, not the read-only side of a relation, and of a type the binding field
|
|
260
|
+
* takes. The server adds that the field is active; API clients, which see
|
|
261
|
+
* `readOnly`, add that it is writable. One rule for the server, the bundles
|
|
262
|
+
* that suggest bindings and the web form.
|
|
263
|
+
*/
|
|
264
|
+
export declare function bindableField(field: {
|
|
265
|
+
type: string;
|
|
266
|
+
coreRole?: unknown;
|
|
267
|
+
settings: {
|
|
268
|
+
isInverse?: boolean;
|
|
269
|
+
};
|
|
270
|
+
}, rule: {
|
|
271
|
+
types: readonly string[];
|
|
272
|
+
}): boolean;
|
|
273
|
+
/** The longest reason a `configure` run may save for one suggestion (configure spec 2.2). */
|
|
274
|
+
export declare const SUGGESTION_REASON_MAX = 500;
|
|
275
|
+
export declare const bindingChoicesSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
276
|
+
action: z.ZodLiteral<"skip">;
|
|
277
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
278
|
+
action: z.ZodLiteral<"existing">;
|
|
279
|
+
objects: z.ZodArray<z.ZodString>;
|
|
280
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
281
|
+
action: z.ZodLiteral<"skip">;
|
|
282
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
283
|
+
action: z.ZodLiteral<"existing">;
|
|
284
|
+
field: z.ZodString;
|
|
285
|
+
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
286
|
+
value: z.ZodString;
|
|
287
|
+
label: z.ZodString;
|
|
288
|
+
}, z.core.$strict>]>>>;
|
|
289
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
290
|
+
action: z.ZodLiteral<"create">;
|
|
291
|
+
name: z.ZodOptional<z.ZodString>;
|
|
292
|
+
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
293
|
+
value: z.ZodString;
|
|
294
|
+
label: z.ZodString;
|
|
295
|
+
}, z.core.$strict>]>>>;
|
|
296
|
+
}, z.core.$strict>], "action">>>;
|
|
297
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
298
|
+
action: z.ZodLiteral<"create">;
|
|
299
|
+
nameSingular: z.ZodOptional<z.ZodString>;
|
|
300
|
+
namePlural: z.ZodOptional<z.ZodString>;
|
|
301
|
+
labelSingular: z.ZodOptional<z.ZodString>;
|
|
302
|
+
labelPlural: z.ZodOptional<z.ZodString>;
|
|
303
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
304
|
+
action: z.ZodLiteral<"skip">;
|
|
305
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
306
|
+
action: z.ZodLiteral<"existing">;
|
|
307
|
+
field: z.ZodString;
|
|
308
|
+
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
309
|
+
value: z.ZodString;
|
|
310
|
+
label: z.ZodString;
|
|
311
|
+
}, z.core.$strict>]>>>;
|
|
312
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
313
|
+
action: z.ZodLiteral<"create">;
|
|
314
|
+
name: z.ZodOptional<z.ZodString>;
|
|
315
|
+
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
316
|
+
value: z.ZodString;
|
|
317
|
+
label: z.ZodString;
|
|
318
|
+
}, z.core.$strict>]>>>;
|
|
319
|
+
}, z.core.$strict>], "action">>>;
|
|
320
|
+
}, z.core.$strict>], "action">>;
|
|
321
|
+
export type ExtensionBindingChoices = z.infer<typeof bindingChoicesSchema>;
|
|
322
|
+
/** Later proposals take precedence, retaining suggestions for the same target. */
|
|
323
|
+
export declare function mergeBindingChoices(...proposals: (ExtensionBindingChoices | null | undefined)[]): ExtensionBindingChoices;
|
|
324
|
+
export declare const bindingWriteStampSchema: z.ZodObject<{
|
|
325
|
+
bindings_revision: z.ZodNumber;
|
|
326
|
+
objectId: z.ZodUUID;
|
|
327
|
+
fieldIds: z.ZodRecord<z.ZodString, z.ZodUUID>;
|
|
328
|
+
}, z.core.$strict>;
|
|
329
|
+
export type BindingWriteStamp = z.infer<typeof bindingWriteStampSchema>;
|
|
330
|
+
export type { ExtensionBindingPlan } from './protocol.js';
|
|
331
|
+
export declare const viewSchema: z.ZodObject<{
|
|
332
|
+
universalId: z.ZodUUID;
|
|
333
|
+
name: z.ZodString;
|
|
334
|
+
kind: z.ZodLiteral<"table">;
|
|
335
|
+
binding: z.ZodString;
|
|
336
|
+
fields: z.ZodArray<z.ZodString>;
|
|
337
|
+
}, z.core.$strict>;
|
|
338
|
+
declare const manifestSchema: z.ZodObject<{
|
|
339
|
+
manifestVersion: z.ZodLiteral<1>;
|
|
340
|
+
universalId: z.ZodUUID;
|
|
341
|
+
name: z.ZodString;
|
|
342
|
+
version: z.ZodString;
|
|
343
|
+
description: z.ZodString;
|
|
344
|
+
packageDigest: z.ZodString;
|
|
345
|
+
serverRange: z.ZodOptional<z.ZodString>;
|
|
346
|
+
serverVersions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
347
|
+
runtimeVersion: z.ZodLiteral<"node24">;
|
|
348
|
+
execution: z.ZodEnum<{
|
|
349
|
+
hosted: "hosted";
|
|
350
|
+
standalone: "standalone";
|
|
351
|
+
}>;
|
|
352
|
+
oauthClientId: z.ZodOptional<z.ZodString>;
|
|
353
|
+
sidebarLink: z.ZodOptional<z.ZodObject<{
|
|
354
|
+
label: z.ZodString;
|
|
355
|
+
icon: z.ZodEnum<{
|
|
356
|
+
app: "app";
|
|
357
|
+
calendar: "calendar";
|
|
358
|
+
chart: "chart";
|
|
359
|
+
clock: "clock";
|
|
360
|
+
file: "file";
|
|
361
|
+
mail: "mail";
|
|
362
|
+
users: "users";
|
|
363
|
+
}>;
|
|
364
|
+
path: z.ZodString;
|
|
365
|
+
}, z.core.$strict>>;
|
|
366
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
367
|
+
requestedActor: z.ZodEnum<{
|
|
368
|
+
agent: "agent";
|
|
369
|
+
integration: "integration";
|
|
370
|
+
}>;
|
|
371
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
372
|
+
read: "read";
|
|
373
|
+
write: "write";
|
|
374
|
+
}>>;
|
|
375
|
+
connection: z.ZodEnum<{
|
|
376
|
+
member: "member";
|
|
377
|
+
workspace: "workspace";
|
|
378
|
+
}>;
|
|
379
|
+
createPeople: z.ZodEnum<{
|
|
380
|
+
contacted_first: "contacted_first";
|
|
381
|
+
everyone: "everyone";
|
|
382
|
+
never: "never";
|
|
383
|
+
}>;
|
|
384
|
+
onSourceDelete: z.ZodEnum<{
|
|
385
|
+
keep: "keep";
|
|
386
|
+
retract: "retract";
|
|
387
|
+
}>;
|
|
388
|
+
lastContact: z.ZodOptional<z.ZodObject<{
|
|
389
|
+
functionIds: z.ZodArray<z.ZodUUID>;
|
|
390
|
+
events: z.ZodString;
|
|
391
|
+
destinations: z.ZodArray<z.ZodString>;
|
|
392
|
+
}, z.core.$strict>>;
|
|
393
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
394
|
+
provider: z.ZodString;
|
|
395
|
+
identity: z.ZodEnum<{
|
|
396
|
+
account: "account";
|
|
397
|
+
"global-resource": "global-resource";
|
|
398
|
+
}>;
|
|
399
|
+
verifyFunctionId: z.ZodUUID;
|
|
400
|
+
syncFunctionIds: z.ZodArray<z.ZodUUID>;
|
|
401
|
+
scanFunctionIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
402
|
+
event: z.ZodString;
|
|
403
|
+
people: z.ZodOptional<z.ZodString>;
|
|
404
|
+
revisionOrder: z.ZodEnum<{
|
|
405
|
+
integer: "integer";
|
|
406
|
+
opaque: "opaque";
|
|
407
|
+
timestamp: "timestamp";
|
|
408
|
+
}>;
|
|
409
|
+
tasks: z.ZodOptional<z.ZodString>;
|
|
410
|
+
}, z.core.$strict>>;
|
|
411
|
+
webhooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
412
|
+
route: z.ZodString;
|
|
413
|
+
verifierFunctionId: z.ZodUUID;
|
|
414
|
+
syncFunctionId: z.ZodUUID;
|
|
415
|
+
secretSetting: z.ZodString;
|
|
416
|
+
headers: z.ZodArray<z.ZodString>;
|
|
417
|
+
accountHeader: z.ZodOptional<z.ZodString>;
|
|
418
|
+
challenge: z.ZodOptional<z.ZodBoolean>;
|
|
419
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
420
|
+
}, z.core.$strict>>>;
|
|
421
|
+
settings: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
422
|
+
type: z.ZodEnum<{
|
|
423
|
+
boolean: "boolean";
|
|
424
|
+
number: "number";
|
|
425
|
+
string: "string";
|
|
426
|
+
}>;
|
|
427
|
+
label: z.ZodString;
|
|
428
|
+
level: z.ZodOptional<z.ZodEnum<{
|
|
429
|
+
connection: "connection";
|
|
430
|
+
installation: "installation";
|
|
431
|
+
}>>;
|
|
432
|
+
description: z.ZodOptional<z.ZodString>;
|
|
433
|
+
secret: z.ZodDefault<z.ZodBoolean>;
|
|
434
|
+
generated: z.ZodOptional<z.ZodBoolean>;
|
|
435
|
+
reconnect: z.ZodDefault<z.ZodBoolean>;
|
|
436
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
437
|
+
default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber]>>;
|
|
438
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
439
|
+
consent: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
+
}, z.core.$strict>>;
|
|
441
|
+
bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
442
|
+
key: z.ZodString;
|
|
443
|
+
label: z.ZodString;
|
|
444
|
+
description: z.ZodString;
|
|
445
|
+
class: z.ZodEnum<{
|
|
446
|
+
entity: "entity";
|
|
447
|
+
event: "event";
|
|
448
|
+
}>;
|
|
449
|
+
access: z.ZodEnum<{
|
|
450
|
+
read: "read";
|
|
451
|
+
write: "write";
|
|
452
|
+
}>;
|
|
453
|
+
required: z.ZodBoolean;
|
|
454
|
+
owned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
455
|
+
match: z.ZodOptional<z.ZodString>;
|
|
456
|
+
creates: z.ZodOptional<z.ZodLiteral<true>>;
|
|
457
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
458
|
+
key: z.ZodString;
|
|
459
|
+
label: z.ZodString;
|
|
460
|
+
description: z.ZodOptional<z.ZodString>;
|
|
461
|
+
types: z.ZodArray<z.ZodEnum<{
|
|
462
|
+
address: "address";
|
|
463
|
+
boolean: "boolean";
|
|
464
|
+
date: "date";
|
|
465
|
+
date_time: "date_time";
|
|
466
|
+
emails: "emails";
|
|
467
|
+
files: "files";
|
|
468
|
+
full_name: "full_name";
|
|
469
|
+
json: "json";
|
|
470
|
+
links: "links";
|
|
471
|
+
money: "money";
|
|
472
|
+
multi_select: "multi_select";
|
|
473
|
+
number: "number";
|
|
474
|
+
phones: "phones";
|
|
475
|
+
relation: "relation";
|
|
476
|
+
select: "select";
|
|
477
|
+
text: "text";
|
|
478
|
+
}>>;
|
|
479
|
+
required: z.ZodBoolean;
|
|
480
|
+
lookup: z.ZodOptional<z.ZodLiteral<true>>;
|
|
481
|
+
owned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
482
|
+
installationOwned: z.ZodOptional<z.ZodLiteral<true>>;
|
|
483
|
+
target: z.ZodOptional<z.ZodString>;
|
|
484
|
+
values: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
485
|
+
create: z.ZodOptional<z.ZodObject<{
|
|
486
|
+
universalId: z.ZodUUID;
|
|
487
|
+
name: z.ZodString;
|
|
488
|
+
label: z.ZodString;
|
|
489
|
+
type: z.ZodEnum<{
|
|
490
|
+
address: "address";
|
|
491
|
+
boolean: "boolean";
|
|
492
|
+
date: "date";
|
|
493
|
+
date_time: "date_time";
|
|
494
|
+
emails: "emails";
|
|
495
|
+
files: "files";
|
|
496
|
+
full_name: "full_name";
|
|
497
|
+
json: "json";
|
|
498
|
+
links: "links";
|
|
499
|
+
money: "money";
|
|
500
|
+
multi_select: "multi_select";
|
|
501
|
+
number: "number";
|
|
502
|
+
phones: "phones";
|
|
503
|
+
relation: "relation";
|
|
504
|
+
select: "select";
|
|
505
|
+
text: "text";
|
|
506
|
+
}>;
|
|
507
|
+
description: z.ZodOptional<z.ZodString>;
|
|
508
|
+
isNullable: z.ZodOptional<z.ZodBoolean>;
|
|
509
|
+
isUnique: z.ZodOptional<z.ZodBoolean>;
|
|
510
|
+
isFilterable: z.ZodOptional<z.ZodBoolean>;
|
|
511
|
+
isSearchable: z.ZodOptional<z.ZodBoolean>;
|
|
512
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
513
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
514
|
+
value: z.ZodString;
|
|
515
|
+
label: z.ZodString;
|
|
516
|
+
}, z.core.$strict>>>;
|
|
517
|
+
targetObject: z.ZodOptional<z.ZodUUID>;
|
|
518
|
+
targetObjects: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
519
|
+
relationCardinality: z.ZodOptional<z.ZodEnum<{
|
|
520
|
+
many_to_many: "many_to_many";
|
|
521
|
+
many_to_one: "many_to_one";
|
|
522
|
+
}>>;
|
|
523
|
+
onDelete: z.ZodOptional<z.ZodEnum<{
|
|
524
|
+
cascade: "cascade";
|
|
525
|
+
set_null: "set_null";
|
|
526
|
+
}>>;
|
|
527
|
+
rollUpEvents: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
+
maxValues: z.ZodOptional<z.ZodNumber>;
|
|
529
|
+
}, z.core.$strict>>;
|
|
530
|
+
}, z.core.$strict>>;
|
|
531
|
+
}, z.core.$strict>>;
|
|
532
|
+
create: z.ZodOptional<z.ZodObject<{
|
|
533
|
+
universalId: z.ZodUUID;
|
|
534
|
+
nameSingular: z.ZodString;
|
|
535
|
+
namePlural: z.ZodString;
|
|
536
|
+
labelSingular: z.ZodString;
|
|
537
|
+
labelPlural: z.ZodString;
|
|
538
|
+
class: z.ZodOptional<z.ZodEnum<{
|
|
539
|
+
entity: "entity";
|
|
540
|
+
event: "event";
|
|
541
|
+
}>>;
|
|
542
|
+
description: z.ZodOptional<z.ZodString>;
|
|
543
|
+
labelField: z.ZodOptional<z.ZodString>;
|
|
544
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
545
|
+
universalId: z.ZodUUID;
|
|
546
|
+
name: z.ZodString;
|
|
547
|
+
label: z.ZodString;
|
|
548
|
+
type: z.ZodEnum<{
|
|
549
|
+
address: "address";
|
|
550
|
+
boolean: "boolean";
|
|
551
|
+
date: "date";
|
|
552
|
+
date_time: "date_time";
|
|
553
|
+
emails: "emails";
|
|
554
|
+
files: "files";
|
|
555
|
+
full_name: "full_name";
|
|
556
|
+
json: "json";
|
|
557
|
+
links: "links";
|
|
558
|
+
money: "money";
|
|
559
|
+
multi_select: "multi_select";
|
|
560
|
+
number: "number";
|
|
561
|
+
phones: "phones";
|
|
562
|
+
relation: "relation";
|
|
563
|
+
select: "select";
|
|
564
|
+
text: "text";
|
|
565
|
+
}>;
|
|
566
|
+
description: z.ZodOptional<z.ZodString>;
|
|
567
|
+
isNullable: z.ZodOptional<z.ZodBoolean>;
|
|
568
|
+
isUnique: z.ZodOptional<z.ZodBoolean>;
|
|
569
|
+
isFilterable: z.ZodOptional<z.ZodBoolean>;
|
|
570
|
+
isSearchable: z.ZodOptional<z.ZodBoolean>;
|
|
571
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
572
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
573
|
+
value: z.ZodString;
|
|
574
|
+
label: z.ZodString;
|
|
575
|
+
}, z.core.$strict>>>;
|
|
576
|
+
targetObject: z.ZodOptional<z.ZodUUID>;
|
|
577
|
+
targetObjects: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
578
|
+
relationCardinality: z.ZodOptional<z.ZodEnum<{
|
|
579
|
+
many_to_many: "many_to_many";
|
|
580
|
+
many_to_one: "many_to_one";
|
|
581
|
+
}>>;
|
|
582
|
+
onDelete: z.ZodOptional<z.ZodEnum<{
|
|
583
|
+
cascade: "cascade";
|
|
584
|
+
set_null: "set_null";
|
|
585
|
+
}>>;
|
|
586
|
+
rollUpEvents: z.ZodOptional<z.ZodBoolean>;
|
|
587
|
+
maxValues: z.ZodOptional<z.ZodNumber>;
|
|
588
|
+
}, z.core.$strict>>;
|
|
589
|
+
}, z.core.$strict>>;
|
|
590
|
+
}, z.core.$strict>>;
|
|
591
|
+
}, z.core.$strict>>>;
|
|
592
|
+
views: z.ZodArray<z.ZodObject<{
|
|
593
|
+
universalId: z.ZodUUID;
|
|
594
|
+
name: z.ZodString;
|
|
595
|
+
kind: z.ZodLiteral<"table">;
|
|
596
|
+
binding: z.ZodString;
|
|
597
|
+
fields: z.ZodArray<z.ZodString>;
|
|
598
|
+
}, z.core.$strict>>;
|
|
599
|
+
functions: z.ZodArray<z.ZodObject<{
|
|
600
|
+
universalId: z.ZodUUID;
|
|
601
|
+
name: z.ZodString;
|
|
602
|
+
description: z.ZodString;
|
|
603
|
+
handlerDigest: z.ZodString;
|
|
604
|
+
trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
605
|
+
kind: z.ZodLiteral<"configure">;
|
|
606
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
607
|
+
kind: z.ZodLiteral<"install">;
|
|
608
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
609
|
+
kind: z.ZodLiteral<"uninstall">;
|
|
610
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
611
|
+
kind: z.ZodLiteral<"connect">;
|
|
612
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
613
|
+
kind: z.ZodLiteral<"disconnect">;
|
|
614
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
615
|
+
kind: z.ZodLiteral<"job">;
|
|
616
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
617
|
+
kind: z.ZodLiteral<"tool">;
|
|
618
|
+
title: z.ZodString;
|
|
619
|
+
effect: z.ZodEnum<{
|
|
620
|
+
read: "read";
|
|
621
|
+
send: "send";
|
|
622
|
+
write: "write";
|
|
623
|
+
}>;
|
|
624
|
+
connection: z.ZodEnum<{
|
|
625
|
+
member: "member";
|
|
626
|
+
workspace: "workspace";
|
|
627
|
+
}>;
|
|
628
|
+
outputSchema: z.ZodType<InputSchema, unknown, z.core.$ZodTypeInternals<InputSchema, unknown>>;
|
|
629
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
630
|
+
kind: z.ZodLiteral<"route">;
|
|
631
|
+
route: z.ZodString;
|
|
632
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
633
|
+
kind: z.ZodLiteral<"serverRoute">;
|
|
634
|
+
route: z.ZodString;
|
|
635
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
636
|
+
kind: z.ZodLiteral<"schedule">;
|
|
637
|
+
cron: z.ZodString;
|
|
638
|
+
timezone: z.ZodLiteral<"UTC">;
|
|
639
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
640
|
+
kind: z.ZodLiteral<"change">;
|
|
641
|
+
binding: z.ZodString;
|
|
642
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
643
|
+
related: z.ZodOptional<z.ZodBoolean>;
|
|
644
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
645
|
+
create: "create";
|
|
646
|
+
update: "update";
|
|
647
|
+
}>>>;
|
|
648
|
+
}, z.core.$strict>], "kind">;
|
|
649
|
+
inputSchema: z.ZodType<InputSchema, unknown, z.core.$ZodTypeInternals<InputSchema, unknown>>;
|
|
650
|
+
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
651
|
+
secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
652
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
653
|
+
read: "read";
|
|
654
|
+
write: "write";
|
|
655
|
+
}>>>;
|
|
656
|
+
mappedWrite: z.ZodOptional<z.ZodString>;
|
|
657
|
+
uses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
658
|
+
model: "model";
|
|
659
|
+
}>>>;
|
|
660
|
+
}, z.core.$strict>>;
|
|
661
|
+
oauth: z.ZodOptional<z.ZodObject<{
|
|
662
|
+
verifierSetting: z.ZodString;
|
|
663
|
+
codeSetting: z.ZodString;
|
|
664
|
+
tokenSetting: z.ZodString;
|
|
665
|
+
keySetting: z.ZodOptional<z.ZodString>;
|
|
666
|
+
revokeUrl: z.ZodURL;
|
|
667
|
+
}, z.core.$strict>>;
|
|
668
|
+
gettingStarted: z.ZodOptional<z.ZodObject<{
|
|
669
|
+
text: z.ZodString;
|
|
670
|
+
linkLabel: z.ZodString;
|
|
671
|
+
url: z.ZodURL;
|
|
672
|
+
}, z.core.$strict>>;
|
|
673
|
+
}, z.core.$strict>;
|
|
674
|
+
export type ExtensionManifest = z.infer<typeof manifestSchema>;
|
|
675
|
+
type FunctionDefinition = ExtensionManifest['functions'][number];
|
|
676
|
+
/** The secret settings a function can access. */
|
|
677
|
+
export declare function functionSecrets(manifest: Pick<ExtensionManifest, 'settings'>, fn: Pick<FunctionDefinition, 'secrets'> & {
|
|
678
|
+
trigger?: FunctionDefinition['trigger'];
|
|
679
|
+
}): string[];
|
|
680
|
+
/** A release's disconnect hook and the generated secrets it may read after a disconnect. */
|
|
681
|
+
export declare function disconnectHook(manifest: Pick<ExtensionManifest, 'settings' | 'functions'>): {
|
|
682
|
+
functionId: string | null;
|
|
683
|
+
secrets: string[];
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Whether a release runs code in the hosted runtime: every hosted release,
|
|
687
|
+
* and a standalone one with functions. Such a release follows the hosted
|
|
688
|
+
* rules for `runtimeEnabled`, executable admission and readiness (spec 8);
|
|
689
|
+
* `execution` decides only how the app's own service gets its credential and
|
|
690
|
+
* how the installation activates.
|
|
691
|
+
*/
|
|
692
|
+
export declare function runsHostedCode(manifest: Pick<ExtensionManifest, 'execution' | 'functions'>): boolean;
|
|
693
|
+
/** The scopes a function needs; its run token gets their intersection with the grant (spec 8). */
|
|
694
|
+
export declare function functionScopes(manifest: Pick<ExtensionManifest, 'scopes'>, fn: Pick<FunctionDefinition, 'scopes'>): ('read' | 'write')[];
|
|
695
|
+
/** The capabilities a function's run may receive, before the installation's grant (spec 3.1). */
|
|
696
|
+
export declare function functionUses(fn: Pick<FunctionDefinition, 'uses'>): ExtensionUse[];
|
|
697
|
+
/** A release's uses: the union of its functions'. Approved with its access. */
|
|
698
|
+
export declare function releaseUses(manifest: Pick<ExtensionManifest, 'functions'>): ExtensionUse[];
|
|
699
|
+
/** Tamloot can install with manual mappings when only its configure hook needs a model. */
|
|
700
|
+
export declare function hasOptionalSetupModel(manifest: ExtensionManifest): boolean;
|
|
701
|
+
/** Whether a release supports this server: inside its range, or in its exact list. */
|
|
702
|
+
export declare function supportsServer(manifest: Pick<ExtensionManifest, 'serverRange' | 'serverVersions'>, serverVersion: string): boolean;
|
|
703
|
+
export declare function defineExtension(value: unknown): ExtensionManifest;
|
|
704
|
+
export declare function defineFunction(value: unknown): {
|
|
705
|
+
universalId: string;
|
|
706
|
+
name: string;
|
|
707
|
+
description: string;
|
|
708
|
+
handlerDigest: string;
|
|
709
|
+
trigger: {
|
|
710
|
+
kind: "configure";
|
|
711
|
+
} | {
|
|
712
|
+
kind: "install";
|
|
713
|
+
} | {
|
|
714
|
+
kind: "uninstall";
|
|
715
|
+
} | {
|
|
716
|
+
kind: "connect";
|
|
717
|
+
} | {
|
|
718
|
+
kind: "disconnect";
|
|
719
|
+
} | {
|
|
720
|
+
kind: "job";
|
|
721
|
+
} | {
|
|
722
|
+
kind: "tool";
|
|
723
|
+
title: string;
|
|
724
|
+
effect: "read" | "send" | "write";
|
|
725
|
+
connection: "member" | "workspace";
|
|
726
|
+
outputSchema: InputSchema;
|
|
727
|
+
} | {
|
|
728
|
+
kind: "route";
|
|
729
|
+
route: string;
|
|
730
|
+
} | {
|
|
731
|
+
kind: "serverRoute";
|
|
732
|
+
route: string;
|
|
733
|
+
} | {
|
|
734
|
+
kind: "schedule";
|
|
735
|
+
cron: string;
|
|
736
|
+
timezone: "UTC";
|
|
737
|
+
} | {
|
|
738
|
+
kind: "change";
|
|
739
|
+
binding: string;
|
|
740
|
+
fields?: string[] | undefined;
|
|
741
|
+
related?: boolean | undefined;
|
|
742
|
+
operations?: ("create" | "update")[] | undefined;
|
|
743
|
+
};
|
|
744
|
+
inputSchema: InputSchema;
|
|
745
|
+
timeoutSeconds: number;
|
|
746
|
+
secrets?: string[] | undefined;
|
|
747
|
+
scopes?: ("read" | "write")[] | undefined;
|
|
748
|
+
mappedWrite?: string | undefined;
|
|
749
|
+
uses?: "model"[] | undefined;
|
|
750
|
+
};
|
|
751
|
+
export declare function defineTool(value: unknown): {
|
|
752
|
+
universalId: string;
|
|
753
|
+
description: string;
|
|
754
|
+
handlerDigest: string;
|
|
755
|
+
inputSchema: InputSchema;
|
|
756
|
+
timeoutSeconds: number;
|
|
757
|
+
secrets?: string[] | undefined;
|
|
758
|
+
scopes?: ("read" | "write")[] | undefined;
|
|
759
|
+
mappedWrite?: string | undefined;
|
|
760
|
+
uses?: "model"[] | undefined;
|
|
761
|
+
name: string;
|
|
762
|
+
trigger: {
|
|
763
|
+
kind: 'tool';
|
|
764
|
+
title: string;
|
|
765
|
+
effect: "read" | "send" | "write";
|
|
766
|
+
connection: "member" | "workspace";
|
|
767
|
+
outputSchema: InputSchema;
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
export declare const defineView: (value: unknown) => {
|
|
771
|
+
universalId: string;
|
|
772
|
+
name: string;
|
|
773
|
+
kind: "table";
|
|
774
|
+
binding: string;
|
|
775
|
+
fields: string[];
|
|
776
|
+
};
|
|
777
|
+
export type ExtensionInstallInput = {
|
|
778
|
+
/** Install directly with manually chosen destinations, without running configure. */
|
|
779
|
+
manualSetup?: boolean;
|
|
780
|
+
/** Access-only preview/approval for a target release. */
|
|
781
|
+
accessOnly?: boolean;
|
|
782
|
+
/** Explicit final approval of a configuring installation. */
|
|
783
|
+
turnOn?: boolean;
|
|
784
|
+
/** Set for an upgrade preview and commit. */
|
|
785
|
+
installationId?: string;
|
|
786
|
+
/** Explicitly review a new credential/account connection on the current release. */
|
|
787
|
+
reconnect?: boolean;
|
|
788
|
+
/** Retire the old source binding and callback addresses; retained evidence keeps its namespace. */
|
|
789
|
+
replaceSourceAccount?: boolean;
|
|
790
|
+
/** Request a separate approval plan for increased access; never grants access on preview. */
|
|
791
|
+
grantChange?: boolean;
|
|
792
|
+
secretRefs?: Record<string, string>;
|
|
793
|
+
registrationId: string;
|
|
794
|
+
version: string;
|
|
795
|
+
settings: Record<string, string | boolean | number>;
|
|
796
|
+
bindings?: ExtensionBindingChoices;
|
|
797
|
+
};
|
|
798
|
+
export type ExtensionPreview = {
|
|
799
|
+
planDigest: string;
|
|
800
|
+
schemaVersion: number;
|
|
801
|
+
generation: number;
|
|
802
|
+
releaseDigest: string;
|
|
803
|
+
operations: unknown[];
|
|
804
|
+
/**
|
|
805
|
+
* `update` applies the publisher's change to an unedited view;
|
|
806
|
+
* `keep_workspace` keeps a view the workspace edited and `deleted_workspace`
|
|
807
|
+
* leaves one it deleted absent (a warning says so for both).
|
|
808
|
+
*/
|
|
809
|
+
views: {
|
|
810
|
+
universalId: string;
|
|
811
|
+
name: string;
|
|
812
|
+
action: 'create' | 'retain' | 'update' | 'keep_workspace' | 'deleted_workspace';
|
|
813
|
+
}[];
|
|
814
|
+
/** `uses` lists the release's platform capabilities; `model` sends workspace data to Anthropic. */
|
|
815
|
+
grants: {
|
|
816
|
+
actor: 'integration' | 'agent';
|
|
817
|
+
scopes: ('read' | 'write')[];
|
|
818
|
+
uses: ExtensionUse[];
|
|
819
|
+
};
|
|
820
|
+
previousGrants?: {
|
|
821
|
+
actor: 'integration' | 'agent';
|
|
822
|
+
scopes: ('read' | 'write')[];
|
|
823
|
+
uses: ExtensionUse[];
|
|
824
|
+
};
|
|
825
|
+
bindings?: ExtensionBindingChoices;
|
|
826
|
+
/** Plain facts about the access being approved, such as when it uses a model. */
|
|
827
|
+
notices: string[];
|
|
828
|
+
/** Cautions: what approving changes or leaves undone that the admin may not expect. */
|
|
829
|
+
warnings: string[];
|
|
830
|
+
};
|
|
831
|
+
export type ExtensionCredential = {
|
|
832
|
+
id: string;
|
|
833
|
+
kind: 'key' | 'oauth';
|
|
834
|
+
prefix: string | null;
|
|
835
|
+
clientId: string | null;
|
|
836
|
+
/** The installation grant generation this credential was issued for. */
|
|
837
|
+
generation: number;
|
|
838
|
+
scopes: ('read' | 'write')[];
|
|
839
|
+
createdAt: string;
|
|
840
|
+
revokedAt: string | null;
|
|
841
|
+
active: boolean;
|
|
842
|
+
};
|
|
843
|
+
export type ExtensionInstallation = {
|
|
844
|
+
stateChangedBy?: import('@retainer/shared').Actor;
|
|
845
|
+
/** Latest configure run for the installed release, when there is one. */
|
|
846
|
+
suggestionsStatus?: 'queued' | 'running' | 'ready' | 'failed';
|
|
847
|
+
id: string;
|
|
848
|
+
registrationId: string;
|
|
849
|
+
version: string;
|
|
850
|
+
releaseDigest: string;
|
|
851
|
+
state: 'configuring' | 'installing' | 'active' | 'setup_failed' | 'disabled' | 'upgrading' | 'uninstalling' | 'uninstalled';
|
|
852
|
+
/** Fences runs: changes on every release, settings or state change. */
|
|
853
|
+
generation: number;
|
|
854
|
+
/** What standalone keys and app grants bind to: changes only on disable, uninstall, grant change or reconnect. */
|
|
855
|
+
grantGeneration: number;
|
|
856
|
+
settingsRevision: number;
|
|
857
|
+
lastError?: string | null;
|
|
858
|
+
connectionHealth?: 'ok' | 'needs_reconnect' | 'degraded';
|
|
859
|
+
/** Availability in this server's catalog, computed on read; independent of the provider connection. */
|
|
860
|
+
runtimeAvailability?: {
|
|
861
|
+
state: 'available';
|
|
862
|
+
} | {
|
|
863
|
+
state: 'unavailable';
|
|
864
|
+
code: 'incompatible_runtime' | 'release_unavailable';
|
|
865
|
+
};
|
|
866
|
+
secrets?: Record<string, boolean>;
|
|
867
|
+
settings: Record<string, string | boolean | number>;
|
|
868
|
+
grantedActor: 'integration' | 'agent';
|
|
869
|
+
grantedScopes: ('read' | 'write')[];
|
|
870
|
+
/** Platform capabilities an admin approved, such as `model` (model calls spec 3.1). */
|
|
871
|
+
grantedUses: ExtensionUse[];
|
|
872
|
+
createdBy: {
|
|
873
|
+
type: string;
|
|
874
|
+
id: string;
|
|
875
|
+
};
|
|
876
|
+
bindingChoices?: ExtensionBindingChoices;
|
|
877
|
+
/** How a member may connect, for a member release: OAuth, a pasted key, or both. */
|
|
878
|
+
connectionMethods?: ExtensionConnectionMethod[];
|
|
879
|
+
/**
|
|
880
|
+
* The caller's most recent connection whose provider access may remain and
|
|
881
|
+
* whose notice they have not dismissed. `at` is opaque: send it back unchanged.
|
|
882
|
+
*/
|
|
883
|
+
releaseNotice?: {
|
|
884
|
+
connectionId: string;
|
|
885
|
+
at: string;
|
|
886
|
+
} | null;
|
|
887
|
+
};
|
|
888
|
+
export type ExtensionConnectionMethod = 'oauth' | 'key';
|
|
889
|
+
/** A standalone app's sidebar link, for a member of a workspace where it is active (spec 8). */
|
|
890
|
+
export type ExtensionAppLink = {
|
|
891
|
+
installationId: string;
|
|
892
|
+
name: string;
|
|
893
|
+
label: string;
|
|
894
|
+
icon: SidebarIcon;
|
|
895
|
+
/** The app's page; it names the installation in `retainer_installation`. */
|
|
896
|
+
url: string;
|
|
897
|
+
};
|
|
898
|
+
export * from './model.js';
|
|
899
|
+
export * from './protocol.js';
|
|
900
|
+
export * from './webhook.js';
|
|
901
|
+
/** A person's credential boundary beneath the installation's approved workspace grant. */
|
|
902
|
+
export type ExtensionConnection = {
|
|
903
|
+
id: string;
|
|
904
|
+
installationId: string;
|
|
905
|
+
owner: Actor;
|
|
906
|
+
state: 'connecting' | 'active' | 'setup_failed' | 'needs_reconnect' | 'disconnected';
|
|
907
|
+
health: 'ok' | 'needs_reconnect' | 'degraded';
|
|
908
|
+
lastError: string | null;
|
|
909
|
+
generation: number;
|
|
910
|
+
settings: Record<string, string | boolean | number>;
|
|
911
|
+
settingsRevision: number;
|
|
912
|
+
/** Names only; credentials never appear in reads. */
|
|
913
|
+
secrets: string[];
|
|
914
|
+
createdAt: string;
|
|
915
|
+
connectedAt: string | null;
|
|
916
|
+
disconnectedAt: string | null;
|
|
917
|
+
lastSuccessfulScanAt: string | null;
|
|
918
|
+
failedItems: number;
|
|
919
|
+
/** Fixed when the connection is created. */
|
|
920
|
+
credential: ExtensionConnectionMethod;
|
|
921
|
+
/** Whether the connection's source account imported at least one item. */
|
|
922
|
+
hasImportedItems: boolean;
|
|
923
|
+
/** When a cleanup that held provider credentials last did not finish. */
|
|
924
|
+
releaseIncompleteAt: string | null;
|
|
925
|
+
};
|
|
926
|
+
export type ExtensionConnectionInput = {
|
|
927
|
+
settings: Record<string, string | boolean | number>;
|
|
928
|
+
secretRefs?: Record<string, string>;
|
|
929
|
+
/** Required when reconnecting; a stale form cannot replace a newer credential. */
|
|
930
|
+
expectedGeneration?: number;
|
|
931
|
+
};
|
|
932
|
+
export type ExtensionAuthorizeInput = {
|
|
933
|
+
settings: Record<string, string | boolean | number>;
|
|
934
|
+
/** Set both to reconnect an existing OAuth connection. */
|
|
935
|
+
connectionId?: string;
|
|
936
|
+
expectedGeneration?: number;
|
|
937
|
+
/** An email the provider may prefill; carries no authority. */
|
|
938
|
+
loginHint?: string;
|
|
939
|
+
};
|
|
940
|
+
export type ExtensionAuthorization = {
|
|
941
|
+
authorizationUrl: string;
|
|
942
|
+
state: string;
|
|
943
|
+
expiresAt: string;
|
|
944
|
+
};
|
|
945
|
+
/** Exactly one of `code` and `error`. */
|
|
946
|
+
export type ExtensionAuthorizationCompletion = {
|
|
947
|
+
state: string;
|
|
948
|
+
code?: string;
|
|
949
|
+
error?: string;
|
|
950
|
+
};
|
|
951
|
+
/** What a run that holds the token secret may read about the operator's OAuth client. */
|
|
952
|
+
export type ExtensionOAuthClient = {
|
|
953
|
+
clientId: string;
|
|
954
|
+
clientSecret: string;
|
|
955
|
+
tokenEndpoint: string;
|
|
956
|
+
redirectUri: string;
|
|
957
|
+
apiOrigin?: string;
|
|
958
|
+
};
|
|
959
|
+
export type ManagedSourceTask = {
|
|
960
|
+
externalId: string;
|
|
961
|
+
title: string;
|
|
962
|
+
status: 'open' | 'done';
|
|
963
|
+
contactEmails: string[];
|
|
964
|
+
};
|
|
965
|
+
export type SourceTaskBatchInput = {
|
|
966
|
+
expectedTaskRevision: number;
|
|
967
|
+
expectedRevisionId: string | null;
|
|
968
|
+
tasks: ManagedSourceTask[];
|
|
969
|
+
complete: boolean;
|
|
970
|
+
};
|
|
971
|
+
export type SourceTaskBatchResult = {
|
|
972
|
+
applied: number;
|
|
973
|
+
removed: number;
|
|
974
|
+
detached: number;
|
|
975
|
+
unchanged: number;
|
|
976
|
+
erased: number;
|
|
977
|
+
hasMore: boolean;
|
|
978
|
+
checkpoint: number;
|
|
979
|
+
bindingStatus: 'ok' | 'degraded';
|
|
980
|
+
warnings: string[];
|
|
981
|
+
};
|
|
982
|
+
export type SourceTaskSchema = {
|
|
983
|
+
status: 'ok' | 'degraded';
|
|
984
|
+
fields: Record<string, {
|
|
985
|
+
name: string;
|
|
986
|
+
type: string;
|
|
987
|
+
}>;
|
|
988
|
+
errors: {
|
|
989
|
+
field: string;
|
|
990
|
+
reason: string;
|
|
991
|
+
}[];
|
|
992
|
+
};
|
|
993
|
+
/** Suggestions never become approved settings or field bindings without human review. */
|
|
994
|
+
export type ExtensionSuggestions = {
|
|
995
|
+
/** Valid target-release approval; only non-secret settings and staged secret names. */
|
|
996
|
+
access?: {
|
|
997
|
+
settings: Record<string, string | number | boolean>;
|
|
998
|
+
secrets: string[];
|
|
999
|
+
};
|
|
1000
|
+
status: 'queued' | 'running' | 'ready' | 'failed';
|
|
1001
|
+
code?: string;
|
|
1002
|
+
bindings?: ExtensionBindingChoices;
|
|
1003
|
+
bindingReasons?: Record<string, string>;
|
|
1004
|
+
settings?: Record<string, string | number | boolean>;
|
|
1005
|
+
issues: Record<string, string>;
|
|
1006
|
+
};
|