@verentis/sdk 0.2.6 → 1.0.1
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/README.md +42 -9
- package/dist/index.cjs +527 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +591 -124
- package/dist/index.d.ts +591 -124
- package/dist/index.js +521 -145
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -26,6 +26,304 @@ interface HeaderActionRegistration {
|
|
|
26
26
|
type HeaderActionHandler = () => void | HeaderActionResult | Promise<void | HeaderActionResult>;
|
|
27
27
|
declare function isHeaderAction(value: unknown): value is HeaderAction;
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Page commands an app exports to the workspace command registry (⌘K palette) while they are active.
|
|
31
|
+
*
|
|
32
|
+
* Unlike header actions, page commands have no placement and no count limit: an app with 100 actionable
|
|
33
|
+
* buttons registers all 100. Only display metadata crosses the bridge — never form data or handler code.
|
|
34
|
+
* Registration changes are sent incrementally (`upsert` / `remove`) in batches of at most
|
|
35
|
+
* {@link APP_COMMAND_BATCH_SIZE} entries per message, so large pages do not resend full snapshots.
|
|
36
|
+
*/
|
|
37
|
+
interface AppCommand {
|
|
38
|
+
/** Stable identifier, unique within the app session. */
|
|
39
|
+
id: string;
|
|
40
|
+
label: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
/** Palette group heading; the host defaults to the current page. */
|
|
43
|
+
group?: string;
|
|
44
|
+
/** `lucide:<name>` icon. */
|
|
45
|
+
icon?: string;
|
|
46
|
+
/** Extra search terms. */
|
|
47
|
+
keywords?: string[];
|
|
48
|
+
variant?: 'default' | 'outline' | 'destructive';
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
busy?: boolean;
|
|
51
|
+
disabledReason?: string;
|
|
52
|
+
}
|
|
53
|
+
type AppCommandHandler = () => void | Promise<void>;
|
|
54
|
+
interface AppCommandRegistration {
|
|
55
|
+
update(command: AppCommand): void;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
}
|
|
58
|
+
/** Maximum entries (upserts + removals) in one `verentis:commands:update` message. Not a command-count cap. */
|
|
59
|
+
declare const APP_COMMAND_BATCH_SIZE = 200;
|
|
60
|
+
/** Host capability announced in `verentis:init` when it accepts page commands. */
|
|
61
|
+
declare const APP_COMMANDS_CAPABILITY = "commands";
|
|
62
|
+
declare const APP_COMMAND_ID_PATTERN: RegExp;
|
|
63
|
+
declare function isAppCommand(value: unknown): value is AppCommand;
|
|
64
|
+
|
|
65
|
+
/** A conversation participant. `agent` is reserved for future AI participants and rejected today. */
|
|
66
|
+
interface ChatParticipant {
|
|
67
|
+
kind: 'user' | 'bot';
|
|
68
|
+
id: string;
|
|
69
|
+
}
|
|
70
|
+
type ConversationKind = 'direct' | 'group' | 'channel';
|
|
71
|
+
type ConversationVisibility = 'private' | 'public';
|
|
72
|
+
type HistoryPolicy = 'full' | 'fromJoin';
|
|
73
|
+
type MemberRole = 'owner' | 'admin' | 'member';
|
|
74
|
+
type AttentionLevel = 'all' | 'mentions' | 'none';
|
|
75
|
+
/** A versioned message part. Unknown types are rejected on write; readers fall back to `fallbackText`. */
|
|
76
|
+
type MessagePartInput = {
|
|
77
|
+
partId?: string;
|
|
78
|
+
type: 'text';
|
|
79
|
+
version?: 1;
|
|
80
|
+
data: {
|
|
81
|
+
markdown: string;
|
|
82
|
+
};
|
|
83
|
+
fallbackText?: string;
|
|
84
|
+
} | {
|
|
85
|
+
partId?: string;
|
|
86
|
+
type: 'link';
|
|
87
|
+
version?: 1;
|
|
88
|
+
data: {
|
|
89
|
+
url: string;
|
|
90
|
+
title?: string;
|
|
91
|
+
};
|
|
92
|
+
fallbackText?: string;
|
|
93
|
+
} | {
|
|
94
|
+
partId?: string;
|
|
95
|
+
type: 'mention';
|
|
96
|
+
version?: 1;
|
|
97
|
+
data: {
|
|
98
|
+
participant: ChatParticipant;
|
|
99
|
+
label?: string;
|
|
100
|
+
};
|
|
101
|
+
fallbackText?: string;
|
|
102
|
+
} | {
|
|
103
|
+
partId?: string;
|
|
104
|
+
type: 'fileRef';
|
|
105
|
+
version?: 1;
|
|
106
|
+
data: {
|
|
107
|
+
nodeId: string;
|
|
108
|
+
versionId?: string;
|
|
109
|
+
name?: string;
|
|
110
|
+
mimeType?: string;
|
|
111
|
+
size?: number;
|
|
112
|
+
};
|
|
113
|
+
fallbackText?: string;
|
|
114
|
+
};
|
|
115
|
+
interface MessagePart {
|
|
116
|
+
partId: string;
|
|
117
|
+
type: string;
|
|
118
|
+
version: number;
|
|
119
|
+
data: Record<string, unknown>;
|
|
120
|
+
fallbackText: string;
|
|
121
|
+
}
|
|
122
|
+
interface Membership {
|
|
123
|
+
role: MemberRole;
|
|
124
|
+
active: boolean;
|
|
125
|
+
joinedSeq: number;
|
|
126
|
+
/** First sequence this member may see (the history boundary). */
|
|
127
|
+
historyFromSeq: number;
|
|
128
|
+
}
|
|
129
|
+
interface Conversation {
|
|
130
|
+
id: string;
|
|
131
|
+
kind: ConversationKind;
|
|
132
|
+
visibility: ConversationVisibility;
|
|
133
|
+
historyPolicy: HistoryPolicy;
|
|
134
|
+
title?: string;
|
|
135
|
+
topic?: string;
|
|
136
|
+
archived: boolean;
|
|
137
|
+
createdAt: string;
|
|
138
|
+
createdBy: ChatParticipant;
|
|
139
|
+
/** Sequence of the latest durable change. */
|
|
140
|
+
highWatermark: number;
|
|
141
|
+
membershipRevision: number;
|
|
142
|
+
memberCount: number;
|
|
143
|
+
lastActivityAt: string;
|
|
144
|
+
/** Null when previewing a public channel you have not joined. */
|
|
145
|
+
membership?: Membership;
|
|
146
|
+
directParticipants?: ChatParticipant[];
|
|
147
|
+
}
|
|
148
|
+
interface ConversationSummary {
|
|
149
|
+
id: string;
|
|
150
|
+
kind: ConversationKind;
|
|
151
|
+
visibility: ConversationVisibility;
|
|
152
|
+
title?: string;
|
|
153
|
+
directParticipants?: ChatParticipant[];
|
|
154
|
+
archived: boolean;
|
|
155
|
+
highWatermark: number;
|
|
156
|
+
readThroughSeq: number;
|
|
157
|
+
unreadCount: number;
|
|
158
|
+
unreadMentionCount: number;
|
|
159
|
+
muted: boolean;
|
|
160
|
+
attention: AttentionLevel;
|
|
161
|
+
lastMessageId?: string;
|
|
162
|
+
lastMessageAuthor?: ChatParticipant;
|
|
163
|
+
lastMessagePreview?: string;
|
|
164
|
+
lastActivityAt: string;
|
|
165
|
+
}
|
|
166
|
+
interface ReplyPreview {
|
|
167
|
+
messageId: string;
|
|
168
|
+
/** False when the original is outside your history boundary or gone. */
|
|
169
|
+
available: boolean;
|
|
170
|
+
deleted: boolean;
|
|
171
|
+
author?: ChatParticipant;
|
|
172
|
+
preview?: string;
|
|
173
|
+
}
|
|
174
|
+
interface ChatMessage {
|
|
175
|
+
id: string;
|
|
176
|
+
conversationId: string;
|
|
177
|
+
/** Creation sequence; never changes on edit. */
|
|
178
|
+
seq: number;
|
|
179
|
+
lastEventSeq: number;
|
|
180
|
+
revision: number;
|
|
181
|
+
author: ChatParticipant;
|
|
182
|
+
contentVersion: number;
|
|
183
|
+
/** Absent for deleted messages (tombstones). */
|
|
184
|
+
parts?: MessagePart[];
|
|
185
|
+
fallbackText?: string;
|
|
186
|
+
replyTo?: ReplyPreview;
|
|
187
|
+
createdAt: string;
|
|
188
|
+
editedAt?: string;
|
|
189
|
+
deleted: boolean;
|
|
190
|
+
deletedAt?: string;
|
|
191
|
+
}
|
|
192
|
+
interface MessagePage {
|
|
193
|
+
/** Oldest first. */
|
|
194
|
+
items: ChatMessage[];
|
|
195
|
+
/** Cursor for the next older page; absent at the history boundary. */
|
|
196
|
+
before?: string;
|
|
197
|
+
highWatermark: number;
|
|
198
|
+
historyFromSeq: number;
|
|
199
|
+
}
|
|
200
|
+
interface ConversationEvent {
|
|
201
|
+
seq: number;
|
|
202
|
+
kind: string;
|
|
203
|
+
at: string;
|
|
204
|
+
author?: ChatParticipant;
|
|
205
|
+
messageId?: string;
|
|
206
|
+
/** Current state of the message (content may have changed since the event). */
|
|
207
|
+
message?: ChatMessage;
|
|
208
|
+
participants?: ChatParticipant[];
|
|
209
|
+
role?: MemberRole;
|
|
210
|
+
}
|
|
211
|
+
interface EventPage {
|
|
212
|
+
items: ConversationEvent[];
|
|
213
|
+
/** Cursor to continue from. */
|
|
214
|
+
next: string;
|
|
215
|
+
highWatermark: number;
|
|
216
|
+
hasMore: boolean;
|
|
217
|
+
/** The cursor cannot be continued: discard local state and reload from `conversation` and history. */
|
|
218
|
+
resetRequired: boolean;
|
|
219
|
+
conversation?: Conversation;
|
|
220
|
+
}
|
|
221
|
+
interface ChatPage<T> {
|
|
222
|
+
items: T[];
|
|
223
|
+
cursor?: string;
|
|
224
|
+
}
|
|
225
|
+
interface Member {
|
|
226
|
+
participant: ChatParticipant;
|
|
227
|
+
role: MemberRole;
|
|
228
|
+
joinedSeq: number;
|
|
229
|
+
joinedAt: string;
|
|
230
|
+
}
|
|
231
|
+
interface ReadState {
|
|
232
|
+
conversationId: string;
|
|
233
|
+
readThroughSeq: number;
|
|
234
|
+
unreadCount: number;
|
|
235
|
+
unreadMentionCount: number;
|
|
236
|
+
}
|
|
237
|
+
interface ConversationPreferences {
|
|
238
|
+
conversationId: string;
|
|
239
|
+
muted: boolean;
|
|
240
|
+
attention: AttentionLevel;
|
|
241
|
+
}
|
|
242
|
+
interface PublicChannel {
|
|
243
|
+
id: string;
|
|
244
|
+
title?: string;
|
|
245
|
+
topic?: string;
|
|
246
|
+
memberCount: number;
|
|
247
|
+
lastActivityAt: string;
|
|
248
|
+
}
|
|
249
|
+
interface ChatPerson {
|
|
250
|
+
userId: string;
|
|
251
|
+
displayName: string;
|
|
252
|
+
/** Relative avatar URL on the workspace API. */
|
|
253
|
+
avatarUrl: string;
|
|
254
|
+
}
|
|
255
|
+
interface ChatBot {
|
|
256
|
+
id: string;
|
|
257
|
+
app: string;
|
|
258
|
+
key: string;
|
|
259
|
+
displayName: string;
|
|
260
|
+
description?: string;
|
|
261
|
+
directMessages: 'none' | 'workspace';
|
|
262
|
+
}
|
|
263
|
+
interface ChatCommandArgument {
|
|
264
|
+
name: string;
|
|
265
|
+
type: 'string' | 'number' | 'boolean';
|
|
266
|
+
required: boolean;
|
|
267
|
+
description?: string;
|
|
268
|
+
}
|
|
269
|
+
interface ChatCommand {
|
|
270
|
+
/** `{app}/{name}`. */
|
|
271
|
+
id: string;
|
|
272
|
+
app: string;
|
|
273
|
+
name: string;
|
|
274
|
+
description: string;
|
|
275
|
+
botId?: string;
|
|
276
|
+
arguments: ChatCommandArgument[];
|
|
277
|
+
}
|
|
278
|
+
/** The validated Execution request a command invocation returns; run it with the user's own token. */
|
|
279
|
+
interface ChatCommandInvocation {
|
|
280
|
+
command: string;
|
|
281
|
+
eventSeq: number;
|
|
282
|
+
invocationKey: string;
|
|
283
|
+
workspaceId: string;
|
|
284
|
+
filePath: string;
|
|
285
|
+
branch: string;
|
|
286
|
+
/** JSON object text of the validated arguments. */
|
|
287
|
+
parameters: string;
|
|
288
|
+
}
|
|
289
|
+
interface CreateConversationOptions {
|
|
290
|
+
kind: ConversationKind;
|
|
291
|
+
participants?: ChatParticipant[];
|
|
292
|
+
title?: string;
|
|
293
|
+
topic?: string;
|
|
294
|
+
visibility?: ConversationVisibility;
|
|
295
|
+
historyPolicy?: HistoryPolicy;
|
|
296
|
+
/** Makes creation idempotent for this caller. */
|
|
297
|
+
idempotencyKey?: string;
|
|
298
|
+
}
|
|
299
|
+
interface SendMessageOptions {
|
|
300
|
+
replyTo?: string;
|
|
301
|
+
/** Makes the send idempotent: a retry with the same key and body returns the original message. */
|
|
302
|
+
idempotencyKey?: string;
|
|
303
|
+
}
|
|
304
|
+
interface BotPostOptions {
|
|
305
|
+
/** The bot's key when the app declares several. */
|
|
306
|
+
bot?: string;
|
|
307
|
+
conversationId?: string;
|
|
308
|
+
userId?: string;
|
|
309
|
+
parts: MessagePartInput[];
|
|
310
|
+
idempotencyKey?: string;
|
|
311
|
+
}
|
|
312
|
+
/** Identifier-only live hint; fetch content through the chat API. */
|
|
313
|
+
interface ChatChangeHint {
|
|
314
|
+
conversationId: string;
|
|
315
|
+
highWatermark: number;
|
|
316
|
+
kinds: Array<'messages' | 'members' | 'conversation'>;
|
|
317
|
+
}
|
|
318
|
+
type ChatConnectionStatus = 'idle' | 'connecting' | 'connected' | 'reconnecting' | 'disconnected';
|
|
319
|
+
interface ChatSubscriptionHandlers {
|
|
320
|
+
onChange: (hint: ChatChangeHint) => void;
|
|
321
|
+
/** Called with the host connection state; reconcile durable state after `connected` following a disconnect. */
|
|
322
|
+
onConnection?: (status: ChatConnectionStatus) => void;
|
|
323
|
+
/** The host refused the subscription (for example `chat.read` is not approved). */
|
|
324
|
+
onError?: (reason: string) => void;
|
|
325
|
+
}
|
|
326
|
+
|
|
29
327
|
type BridgeEventType = HostToAppMessage['type'];
|
|
30
328
|
/** Handles a host message; the resolved value (structured-cloneable, ideally JSON) is the reply. */
|
|
31
329
|
type HostMessageHandler = (payload: unknown) => unknown | Promise<unknown>;
|
|
@@ -50,6 +348,14 @@ declare class Bridge {
|
|
|
50
348
|
private sessionId;
|
|
51
349
|
private actions;
|
|
52
350
|
private requests;
|
|
351
|
+
private commands;
|
|
352
|
+
private commandUpserts;
|
|
353
|
+
private commandRemovals;
|
|
354
|
+
private commandReset;
|
|
355
|
+
private commandFlushScheduled;
|
|
356
|
+
private commandRequests;
|
|
357
|
+
private _hostCapabilities;
|
|
358
|
+
private chatSubscribers;
|
|
53
359
|
private hostMessageHandlers;
|
|
54
360
|
private hostMessageRequests;
|
|
55
361
|
private wopiRequests;
|
|
@@ -64,6 +370,13 @@ declare class Bridge {
|
|
|
64
370
|
}>;
|
|
65
371
|
/** Get the host origin (available after init) */
|
|
66
372
|
get hostOrigin(): string | null;
|
|
373
|
+
/** Capabilities the host announced in `verentis:init`. */
|
|
374
|
+
get hostCapabilities(): readonly string[];
|
|
375
|
+
/**
|
|
376
|
+
* Whether the host exports page commands to its command registry. Older hosts ignore registrations;
|
|
377
|
+
* commands still run locally, they are just not discoverable in the workspace palette.
|
|
378
|
+
*/
|
|
379
|
+
get supportsCommands(): boolean;
|
|
67
380
|
/** Send a message to the host */
|
|
68
381
|
postToHost(message: AppToHostMessage): void;
|
|
69
382
|
/**
|
|
@@ -92,6 +405,16 @@ declare class Bridge {
|
|
|
92
405
|
private requestWopi;
|
|
93
406
|
requestNativeCollaboration(command: NativeCollaborationCommand): Promise<unknown>;
|
|
94
407
|
registerAction(descriptor: HeaderAction, handler: HeaderActionHandler): HeaderActionRegistration;
|
|
408
|
+
/**
|
|
409
|
+
* Export a page command to the workspace command registry while it is active. There is no count limit;
|
|
410
|
+
* dispose the registration when the control unmounts. May be called before the init handshake.
|
|
411
|
+
*/
|
|
412
|
+
registerCommand(descriptor: AppCommand, handler: AppCommandHandler): AppCommandRegistration;
|
|
413
|
+
private queueCommand;
|
|
414
|
+
private scheduleCommandFlush;
|
|
415
|
+
private commandSnapshot;
|
|
416
|
+
private flushCommands;
|
|
417
|
+
private invokeCommand;
|
|
95
418
|
private publishActions;
|
|
96
419
|
private invokeAction;
|
|
97
420
|
/**
|
|
@@ -101,6 +424,12 @@ declare class Bridge {
|
|
|
101
424
|
*/
|
|
102
425
|
onHostMessage(channel: string, handler: HostMessageHandler): () => void;
|
|
103
426
|
private receiveHostMessage;
|
|
427
|
+
/**
|
|
428
|
+
* Subscribes to the host's chat live hints (see `ChatModule.subscribeChanges`). The first subscriber asks the host
|
|
429
|
+
* to relay; the last one to leave stops it. Messages from another session are ignored.
|
|
430
|
+
*/
|
|
431
|
+
subscribeChat(handlers: ChatSubscriptionHandlers): () => void;
|
|
432
|
+
private receiveChat;
|
|
104
433
|
/** Subscribe to a specific message type from the host */
|
|
105
434
|
on(type: BridgeEventType, listener: BridgeListener): () => void;
|
|
106
435
|
/** Clean up event listeners */
|
|
@@ -226,6 +555,8 @@ interface VerentisInitMessage extends VerentisMessage {
|
|
|
226
555
|
context: AppContext;
|
|
227
556
|
token: TokenInfo;
|
|
228
557
|
sessionId?: string;
|
|
558
|
+
/** Optional host features, e.g. `commands` for page command registration. */
|
|
559
|
+
capabilities?: string[];
|
|
229
560
|
}
|
|
230
561
|
interface VerentisActionsSetMessage extends VerentisMessage {
|
|
231
562
|
type: 'verentis:actions:set';
|
|
@@ -246,6 +577,27 @@ interface VerentisActionResultMessage extends VerentisMessage {
|
|
|
246
577
|
result?: HeaderActionResult;
|
|
247
578
|
error?: string;
|
|
248
579
|
}
|
|
580
|
+
/** Incremental page-command registration. `reset` replaces everything the host holds for the session. */
|
|
581
|
+
interface VerentisCommandsUpdateMessage extends VerentisMessage {
|
|
582
|
+
type: 'verentis:commands:update';
|
|
583
|
+
sessionId: string;
|
|
584
|
+
reset?: boolean;
|
|
585
|
+
upsert: AppCommand[];
|
|
586
|
+
remove: string[];
|
|
587
|
+
}
|
|
588
|
+
interface VerentisCommandInvokeMessage extends VerentisMessage {
|
|
589
|
+
type: 'verentis:command:invoke';
|
|
590
|
+
sessionId: string;
|
|
591
|
+
requestId: string;
|
|
592
|
+
commandId: string;
|
|
593
|
+
}
|
|
594
|
+
interface VerentisCommandResultMessage extends VerentisMessage {
|
|
595
|
+
type: 'verentis:command:result';
|
|
596
|
+
sessionId: string;
|
|
597
|
+
requestId: string;
|
|
598
|
+
commandId: string;
|
|
599
|
+
error?: string;
|
|
600
|
+
}
|
|
249
601
|
/**
|
|
250
602
|
* A message from the workspace (typically an agent acting for the user) on a channel the app declares in
|
|
251
603
|
* its manifest `spec.messages`. Handled with `bridge.onHostMessage(channel, handler)`.
|
|
@@ -325,6 +677,36 @@ interface VerentisThemeMessage extends VerentisMessage {
|
|
|
325
677
|
colorScheme: 'light' | 'dark';
|
|
326
678
|
variables?: Record<string, string>;
|
|
327
679
|
}
|
|
680
|
+
/** Host → app chat live-hint relay messages (bound to the bridge session). */
|
|
681
|
+
interface VerentisChatSubscribedMessage extends VerentisMessage {
|
|
682
|
+
type: 'verentis:chat:subscribed';
|
|
683
|
+
sessionId: string;
|
|
684
|
+
status: string;
|
|
685
|
+
}
|
|
686
|
+
interface VerentisChatChangedMessage extends VerentisMessage {
|
|
687
|
+
type: 'verentis:chat:changed';
|
|
688
|
+
sessionId: string;
|
|
689
|
+
hint: {
|
|
690
|
+
conversationId: string;
|
|
691
|
+
highWatermark: number;
|
|
692
|
+
kinds: string[];
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
interface VerentisChatConnectionMessage extends VerentisMessage {
|
|
696
|
+
type: 'verentis:chat:connection';
|
|
697
|
+
sessionId: string;
|
|
698
|
+
status: string;
|
|
699
|
+
}
|
|
700
|
+
interface VerentisChatErrorMessage extends VerentisMessage {
|
|
701
|
+
type: 'verentis:chat:error';
|
|
702
|
+
sessionId: string;
|
|
703
|
+
reason: string;
|
|
704
|
+
}
|
|
705
|
+
/** App → host chat relay subscription messages. */
|
|
706
|
+
interface VerentisChatSubscriptionMessage extends VerentisMessage {
|
|
707
|
+
type: 'verentis:chat:subscribe' | 'verentis:chat:unsubscribe';
|
|
708
|
+
sessionId: string;
|
|
709
|
+
}
|
|
328
710
|
interface VerentisReadyMessage extends VerentisMessage {
|
|
329
711
|
type: 'verentis:ready';
|
|
330
712
|
capabilities?: string[];
|
|
@@ -352,8 +734,8 @@ interface VerentisDirtyMessage extends VerentisMessage {
|
|
|
352
734
|
type: 'verentis:dirty';
|
|
353
735
|
isDirty: boolean;
|
|
354
736
|
}
|
|
355
|
-
type HostToAppMessage = VerentisInitMessage | VerentisActionInvokeMessage | VerentisHostMessage | VerentisTokenRefreshedMessage | VerentisFileChangedMessage | VerentisThemeMessage | VerentisWopiResponse | NativeCollaborationResponse;
|
|
356
|
-
type AppToHostMessage = VerentisReadyMessage | VerentisActionsSetMessage | VerentisActionResultMessage | VerentisHostReplyMessage | VerentisTokenRefreshMessage | VerentisNavigateMessage | VerentisResizeMessage | VerentisTitleMessage | VerentisDirtyMessage | VerentisWopiRequest | NativeCollaborationRequest;
|
|
737
|
+
type HostToAppMessage = VerentisInitMessage | VerentisActionInvokeMessage | VerentisCommandInvokeMessage | VerentisHostMessage | VerentisTokenRefreshedMessage | VerentisFileChangedMessage | VerentisThemeMessage | VerentisWopiResponse | NativeCollaborationResponse | VerentisChatSubscribedMessage | VerentisChatChangedMessage | VerentisChatConnectionMessage | VerentisChatErrorMessage;
|
|
738
|
+
type AppToHostMessage = VerentisReadyMessage | VerentisActionsSetMessage | VerentisActionResultMessage | VerentisCommandsUpdateMessage | VerentisCommandResultMessage | VerentisHostReplyMessage | VerentisTokenRefreshMessage | VerentisNavigateMessage | VerentisResizeMessage | VerentisTitleMessage | VerentisDirtyMessage | VerentisWopiRequest | NativeCollaborationRequest | VerentisChatSubscriptionMessage;
|
|
357
739
|
type AppSurface = 'file' | 'workspace';
|
|
358
740
|
interface AppContextBase {
|
|
359
741
|
application?: AppApplicationContext;
|
|
@@ -366,6 +748,8 @@ interface AppContextBase {
|
|
|
366
748
|
authorizationGeneration?: string;
|
|
367
749
|
wopiEnabled?: boolean;
|
|
368
750
|
};
|
|
751
|
+
/** In-app location the host asks the app to open (for example `/conversations/<id>` from a notification). */
|
|
752
|
+
location?: string;
|
|
369
753
|
}
|
|
370
754
|
interface AppApplicationContext {
|
|
371
755
|
manifestPath: string;
|
|
@@ -739,8 +1123,10 @@ interface ApplicationManifest {
|
|
|
739
1123
|
spec: ApplicationSpec;
|
|
740
1124
|
}
|
|
741
1125
|
interface ManifestMetadata {
|
|
742
|
-
|
|
743
|
-
|
|
1126
|
+
/** Package identity (`metadata.id`). */
|
|
1127
|
+
id: string;
|
|
1128
|
+
/** Optional human-friendly label (`metadata.name`); displays fall back to {@link id}. */
|
|
1129
|
+
name?: string;
|
|
744
1130
|
description?: string;
|
|
745
1131
|
icon?: string;
|
|
746
1132
|
version?: string;
|
|
@@ -823,7 +1209,7 @@ interface ApplicationSpec {
|
|
|
823
1209
|
scopes?: string[];
|
|
824
1210
|
/** Declarative install map: where packaged files land in the workspace VFS. */
|
|
825
1211
|
install?: InstallDirective[];
|
|
826
|
-
/** Where the app-record (manifest node) is anchored. Default `/applications/{
|
|
1212
|
+
/** Where the app-record (manifest node) is anchored. Default `/applications/{id}`. */
|
|
827
1213
|
installRoot?: string;
|
|
828
1214
|
/** Default display behavior inherited by entry points. */
|
|
829
1215
|
display?: ApplicationDisplayOptions;
|
|
@@ -834,7 +1220,7 @@ interface ApplicationSpec {
|
|
|
834
1220
|
launch?: ApplicationLaunchConfig;
|
|
835
1221
|
/**
|
|
836
1222
|
* Workspace settings and secrets this app requires. Declared settings are auto-registered
|
|
837
|
-
* in the workspace settings store under `{metadata.
|
|
1223
|
+
* in the workspace settings store under `{metadata.id}.{key}` and surfaced in the
|
|
838
1224
|
* settings UI. Secret values never reach browser contexts.
|
|
839
1225
|
*/
|
|
840
1226
|
settings?: SettingDeclaration[];
|
|
@@ -843,11 +1229,11 @@ interface ApplicationSpec {
|
|
|
843
1229
|
type SettingDeclarationType = 'string' | 'number' | 'boolean' | 'select' | 'file';
|
|
844
1230
|
/**
|
|
845
1231
|
* A workspace setting or secret an application/engine manifest requires. The platform
|
|
846
|
-
* auto-creates a matching setting definition (namespaced `{
|
|
1232
|
+
* auto-creates a matching setting definition (namespaced `{metadata.id}.{key}`) so
|
|
847
1233
|
* workspace admins can provide the value; engines receive values at run time.
|
|
848
1234
|
*/
|
|
849
1235
|
interface SettingDeclaration {
|
|
850
|
-
/** Short key; stored namespaced as `{metadata.
|
|
1236
|
+
/** Short key; stored namespaced as `{metadata.id}.{key}` in the settings store. */
|
|
851
1237
|
key: string;
|
|
852
1238
|
/** Optional environment variable name injected into engine runs (e.g. `MY_API_KEY`). */
|
|
853
1239
|
env?: string;
|
|
@@ -931,6 +1317,62 @@ interface RunFileOptions {
|
|
|
931
1317
|
arguments?: string[];
|
|
932
1318
|
/** Structured parameters passed to the engine; serialized to JSON for the platform. */
|
|
933
1319
|
parameters?: Record<string, unknown>;
|
|
1320
|
+
/** Idempotency key: requests with the same key from the same caller resolve to one execution. */
|
|
1321
|
+
invocationKey?: string;
|
|
1322
|
+
}
|
|
1323
|
+
/** Value type of a declared script argument. */
|
|
1324
|
+
type ScriptArgumentType = 'string' | 'integer' | 'number' | 'boolean' | 'date';
|
|
1325
|
+
/** One declared script argument (an option such as `--customer-id`, or a positional). */
|
|
1326
|
+
interface ScriptArgumentDefinition {
|
|
1327
|
+
/** Canonical name, e.g. `customer-id`. Structured parameters with this key become the option. */
|
|
1328
|
+
name: string;
|
|
1329
|
+
kind: 'option' | 'positional';
|
|
1330
|
+
/** Option flags, e.g. `["--customer-id", "-c"]`. */
|
|
1331
|
+
flags?: string[];
|
|
1332
|
+
type: ScriptArgumentType;
|
|
1333
|
+
required: boolean;
|
|
1334
|
+
repeatable: boolean;
|
|
1335
|
+
default?: unknown;
|
|
1336
|
+
choices?: Array<string | number>;
|
|
1337
|
+
minimum?: number;
|
|
1338
|
+
maximum?: number;
|
|
1339
|
+
help?: string;
|
|
1340
|
+
label?: string;
|
|
1341
|
+
metavar?: string;
|
|
1342
|
+
/** Option may appear without a value. */
|
|
1343
|
+
valueOptional?: boolean;
|
|
1344
|
+
/** Flag that sets a boolean option to false, e.g. `--no-cache`. */
|
|
1345
|
+
negation?: string;
|
|
1346
|
+
/** Value a boolean flag stores when present. */
|
|
1347
|
+
presentValue?: boolean;
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
* A script's exported argument declaration (`<script>.arguments.json`, schema
|
|
1351
|
+
* `verentis.io/script-arguments/v1`). The platform validates runs against it and the workspace prompts
|
|
1352
|
+
* for missing required arguments.
|
|
1353
|
+
*/
|
|
1354
|
+
interface ScriptArgumentDescriptor {
|
|
1355
|
+
schema: 'verentis.io/script-arguments/v1';
|
|
1356
|
+
script?: string;
|
|
1357
|
+
/** SHA-256 of the script the descriptor was exported from. */
|
|
1358
|
+
sourceSha256?: string;
|
|
1359
|
+
description?: string;
|
|
1360
|
+
/** `options`: structured parameters named like an option are passed as that option. */
|
|
1361
|
+
parameters?: 'options';
|
|
1362
|
+
/** A parameter that selects a sibling script with its own descriptor. */
|
|
1363
|
+
variants?: {
|
|
1364
|
+
parameter: string;
|
|
1365
|
+
scripts: Record<string, string>;
|
|
1366
|
+
};
|
|
1367
|
+
arguments: ScriptArgumentDefinition[];
|
|
1368
|
+
exclusiveGroups?: Array<{
|
|
1369
|
+
required: boolean;
|
|
1370
|
+
arguments: string[];
|
|
1371
|
+
}>;
|
|
1372
|
+
}
|
|
1373
|
+
/** Options for reading a script's argument declaration. */
|
|
1374
|
+
interface ScriptArgumentsOptions {
|
|
1375
|
+
branch?: string;
|
|
934
1376
|
}
|
|
935
1377
|
/** Options for executing a specific engine (optionally against a file). */
|
|
936
1378
|
interface ExecuteEngineOptions {
|
|
@@ -1134,7 +1576,8 @@ declare class ApiError extends Error {
|
|
|
1134
1576
|
readonly detail: string;
|
|
1135
1577
|
readonly title?: string | undefined;
|
|
1136
1578
|
readonly code?: string | undefined;
|
|
1137
|
-
|
|
1579
|
+
readonly retryAfterMs?: number | undefined;
|
|
1580
|
+
constructor(status: number, detail: string, title?: string | undefined, code?: string | undefined, retryAfterMs?: number | undefined);
|
|
1138
1581
|
}
|
|
1139
1582
|
|
|
1140
1583
|
/**
|
|
@@ -1200,6 +1643,8 @@ declare class HttpTransport {
|
|
|
1200
1643
|
private buildUrl;
|
|
1201
1644
|
}
|
|
1202
1645
|
|
|
1646
|
+
/** Schema of exported script argument descriptors. */
|
|
1647
|
+
declare const SCRIPT_ARGUMENTS_SCHEMA = "verentis.io/script-arguments/v1";
|
|
1203
1648
|
/** Returns true once an execution has reached a final state. */
|
|
1204
1649
|
declare function isTerminalStatus(status: ExecutionStatus): boolean;
|
|
1205
1650
|
/**
|
|
@@ -1221,6 +1666,11 @@ declare class ExecutionsModule {
|
|
|
1221
1666
|
* (e.g. invoking an engine tool without a script).
|
|
1222
1667
|
*/
|
|
1223
1668
|
execute(engineId: string, options?: ExecuteEngineOptions): Promise<Execution>;
|
|
1669
|
+
/**
|
|
1670
|
+
* Read the arguments a script declares (its exported `<script>.arguments.json`), e.g. to build a form
|
|
1671
|
+
* before {@link run}. Returns `null` for scripts that declare none. Reading never runs the script.
|
|
1672
|
+
*/
|
|
1673
|
+
getArguments(filePath: string, options?: ScriptArgumentsOptions): Promise<ScriptArgumentDescriptor | null>;
|
|
1224
1674
|
/** Get an execution by id. */
|
|
1225
1675
|
get(id: string, options?: ExecutionScopedOptions): Promise<Execution>;
|
|
1226
1676
|
/** List workspace executions with optional engine, file, lifecycle, and time filters. */
|
|
@@ -1343,8 +1793,8 @@ declare class ResourcesModule {
|
|
|
1343
1793
|
* over the Verentis settings API (`/v1/settings`).
|
|
1344
1794
|
*
|
|
1345
1795
|
* The app token must carry the matching scopes, declared in the manifest's `spec.permissions`:
|
|
1346
|
-
* `
|
|
1347
|
-
* and `
|
|
1796
|
+
* `setting.read` (get, list), `setting.write` (set)
|
|
1797
|
+
* and `setting.delete` (reset).
|
|
1348
1798
|
*
|
|
1349
1799
|
* Secret values are server-only: for browser callers the platform always returns `value: null`
|
|
1350
1800
|
* for secrets while `hasValue` reports whether one is configured. Manifest-declared settings
|
|
@@ -1365,9 +1815,9 @@ declare class SettingsModule {
|
|
|
1365
1815
|
* This never returns value content and also finds values retained after a definition is removed.
|
|
1366
1816
|
*/
|
|
1367
1817
|
presence(keys: string[], options?: SettingsScopedOptions): Promise<SettingPresence[]>;
|
|
1368
|
-
/** Upsert a setting value by its full key. Requires the `
|
|
1818
|
+
/** Upsert a setting value by its full key. Requires the `setting.write` scope. */
|
|
1369
1819
|
set(key: string, value: unknown, options?: SettingsScopedOptions): Promise<void>;
|
|
1370
|
-
/** Delete a stored value (reverting to the definition default). Requires `
|
|
1820
|
+
/** Delete a stored value (reverting to the definition default). Requires `setting.delete`. */
|
|
1371
1821
|
reset(key: string, options?: SettingsScopedOptions): Promise<void>;
|
|
1372
1822
|
/**
|
|
1373
1823
|
* A view of this module where every key is auto-prefixed with `{namespace}.` — the platform's
|
|
@@ -1390,126 +1840,36 @@ interface NamespacedSettings {
|
|
|
1390
1840
|
reset(key: string, options?: SettingsScopedOptions): Promise<void>;
|
|
1391
1841
|
}
|
|
1392
1842
|
|
|
1393
|
-
interface
|
|
1843
|
+
interface NotificationSendOptions {
|
|
1394
1844
|
workspaceId?: string;
|
|
1395
|
-
branch?: 'main';
|
|
1396
|
-
}
|
|
1397
|
-
interface EmailHistoryOptions extends EmailScopedOptions {
|
|
1398
|
-
recordId?: string;
|
|
1399
1845
|
installationId?: string;
|
|
1400
|
-
|
|
1401
|
-
interface EmailPurpose {
|
|
1402
|
-
name: string;
|
|
1403
|
-
templateId: string;
|
|
1404
|
-
maximumRecipients: number;
|
|
1405
|
-
maximumAttachmentBytes: number;
|
|
1406
|
-
allowsOpenTracking: boolean;
|
|
1407
|
-
allowsClickTracking: boolean;
|
|
1408
|
-
senderRequirement: 'workspace-owned' | 'managed-or-workspace';
|
|
1409
|
-
}
|
|
1410
|
-
interface EmailSenderGrant {
|
|
1411
|
-
purpose: string;
|
|
1412
|
-
senderId: string;
|
|
1413
|
-
senderIdentityDigest?: string;
|
|
1414
|
-
}
|
|
1415
|
-
interface EmailConsentPreview {
|
|
1416
|
-
installationId: string;
|
|
1417
|
-
workspaceId: string;
|
|
1418
|
-
accountId: string;
|
|
1419
|
-
packageId: string;
|
|
1420
|
-
packageVersionId: string;
|
|
1421
|
-
publisherId: string;
|
|
1422
|
-
publisherName: string;
|
|
1423
|
-
version: string;
|
|
1424
|
-
treeDigest: string;
|
|
1425
|
-
signingKeyId: string;
|
|
1426
|
-
installPath: string;
|
|
1427
|
-
branch: string;
|
|
1428
|
-
candidateDigest: string;
|
|
1429
|
-
declaration: {
|
|
1430
|
-
purposes: EmailPurpose[];
|
|
1431
|
-
maximumMessagesPerHour: number;
|
|
1432
|
-
permissions: string[];
|
|
1433
|
-
scopes: string[];
|
|
1434
|
-
manifestDigest: string;
|
|
1435
|
-
};
|
|
1436
|
-
}
|
|
1437
|
-
interface EmailConsent {
|
|
1438
|
-
installationId: string;
|
|
1439
|
-
candidateDigest: string;
|
|
1440
|
-
enabled: boolean;
|
|
1441
|
-
allowOpenTracking: boolean;
|
|
1442
|
-
allowClickTracking: boolean;
|
|
1443
|
-
approvedBy: string;
|
|
1444
|
-
updatedAt: string;
|
|
1445
|
-
senderGrants: EmailSenderGrant[] | null;
|
|
1446
|
-
}
|
|
1447
|
-
interface EmailConsentOptions {
|
|
1448
|
-
senderGrants: EmailSenderGrant[];
|
|
1449
|
-
allowOpenTracking?: boolean;
|
|
1450
|
-
allowClickTracking?: boolean;
|
|
1451
|
-
}
|
|
1452
|
-
interface EmailSenderIdentity {
|
|
1453
|
-
id: string;
|
|
1454
|
-
mode: 'managed' | 'custom';
|
|
1455
|
-
displayName: string;
|
|
1456
|
-
address: string;
|
|
1457
|
-
}
|
|
1458
|
-
interface EmailArtifactOutcome {
|
|
1459
|
-
artifactId: string;
|
|
1460
|
-
sha256: string;
|
|
1461
|
-
byteLength: number;
|
|
1462
|
-
fileName: string;
|
|
1463
|
-
}
|
|
1464
|
-
interface EmailDispatchOptions extends EmailScopedOptions {
|
|
1465
|
-
installationId: string;
|
|
1466
|
-
recordId: string;
|
|
1467
|
-
purpose: string;
|
|
1468
|
-
templateId: string;
|
|
1469
|
-
senderId: string;
|
|
1470
|
-
recipients: string[];
|
|
1471
|
-
artifactIds: string[];
|
|
1846
|
+
typeKey: string;
|
|
1472
1847
|
idempotencyKey: string;
|
|
1473
|
-
|
|
1848
|
+
userIds?: string[];
|
|
1849
|
+
audienceScope?: string;
|
|
1850
|
+
emailAddresses?: string[];
|
|
1851
|
+
parameters: Record<string, unknown>;
|
|
1474
1852
|
}
|
|
1475
|
-
interface
|
|
1853
|
+
interface NotificationRequestOptions {
|
|
1854
|
+
workspaceId?: string;
|
|
1855
|
+
installationId?: string;
|
|
1856
|
+
}
|
|
1857
|
+
interface NotificationRequestStatus {
|
|
1476
1858
|
id: string;
|
|
1477
|
-
status:
|
|
1859
|
+
status: string;
|
|
1860
|
+
outcomeCode: string | null;
|
|
1478
1861
|
createdAt: string;
|
|
1479
|
-
|
|
1480
|
-
recordId: string;
|
|
1481
|
-
installationId: string;
|
|
1482
|
-
branch: 'main';
|
|
1483
|
-
purpose: string;
|
|
1484
|
-
templateId: string;
|
|
1485
|
-
events: EmailDeliveryEvidence[];
|
|
1486
|
-
}
|
|
1487
|
-
interface EmailDeliveryEvidence {
|
|
1488
|
-
type: 'processed' | 'deferred' | 'delivered' | 'failed' | 'complaint' | 'unsubscribe' | 'open' | 'click';
|
|
1489
|
-
occurredAt: string;
|
|
1862
|
+
updatedAt: string;
|
|
1490
1863
|
}
|
|
1491
1864
|
|
|
1492
|
-
/**
|
|
1493
|
-
declare class
|
|
1865
|
+
/** Send app notifications through the installed package's registered catalogue. */
|
|
1866
|
+
declare class NotificationsModule {
|
|
1494
1867
|
private readonly http;
|
|
1495
1868
|
private readonly workspaceId?;
|
|
1496
1869
|
constructor(http: HttpTransport, workspaceId?: string | undefined);
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
consent(preview: EmailConsentPreview, approval: true, options: EmailConsentOptions): Promise<EmailConsent>;
|
|
1501
|
-
revoke(consent: EmailConsent, options?: EmailScopedOptions): Promise<EmailConsent>;
|
|
1502
|
-
senders(options?: EmailScopedOptions): Promise<EmailSenderIdentity[]>;
|
|
1503
|
-
invoicePdf(recordId: string, installationId: string, options?: EmailScopedOptions): Promise<EmailArtifactOutcome>;
|
|
1504
|
-
/** Authenticated immutable bytes; no public URL. The caller owns any local object URL it creates. */
|
|
1505
|
-
artifactContent(artifactId: string, options?: EmailScopedOptions): Promise<Blob>;
|
|
1506
|
-
/** A stable key binds this exact request. After a lost response inspect status; never automatically resend. */
|
|
1507
|
-
dispatch(options: EmailDispatchOptions): Promise<EmailDispatchOutcome>;
|
|
1508
|
-
outcome(id: string, options?: EmailScopedOptions): Promise<EmailDispatchOutcome>;
|
|
1509
|
-
history(options?: EmailHistoryOptions): Promise<EmailDispatchOutcome[]>;
|
|
1510
|
-
status(id: string, options?: EmailScopedOptions): Promise<EmailDispatchOutcome>;
|
|
1511
|
-
private workspace;
|
|
1512
|
-
private mainBranch;
|
|
1870
|
+
send(options: NotificationSendOptions): Promise<NotificationRequestStatus>;
|
|
1871
|
+
request(id: string, options?: NotificationRequestOptions): Promise<NotificationRequestStatus>;
|
|
1872
|
+
private requireWorkspaceId;
|
|
1513
1873
|
}
|
|
1514
1874
|
|
|
1515
1875
|
type BusinessOperation = 'save-record' | 'archive-record' | 'delete-record' | 'restore-record' | 'close-period' | 'issue-invoice' | 'credit-invoice' | 'post-payment' | 'reverse-payment' | 'post-journal' | 'reverse-journal' | 'post-expense' | 'reverse-expense';
|
|
@@ -1643,6 +2003,111 @@ declare class BusinessModule {
|
|
|
1643
2003
|
private headers;
|
|
1644
2004
|
}
|
|
1645
2005
|
|
|
2006
|
+
/**
|
|
2007
|
+
* Workspace chat (`/v1/chat`). Framework independent; the workspace and caller come from the token. In an installed
|
|
2008
|
+
* app, {@link subscribeChanges} relays identifier-only live hints over the host's existing realtime connection
|
|
2009
|
+
* (requires the approved `chat.read` permission); hints are best effort, so reconcile with {@link events} after
|
|
2010
|
+
* reconnecting and on resume.
|
|
2011
|
+
*/
|
|
2012
|
+
declare class ChatModule {
|
|
2013
|
+
private readonly http;
|
|
2014
|
+
private readonly bridge;
|
|
2015
|
+
private readonly executions?;
|
|
2016
|
+
constructor(http: HttpTransport, bridge?: Bridge | null, executions?: ExecutionsModule | undefined);
|
|
2017
|
+
listConversations(options?: {
|
|
2018
|
+
cursor?: string;
|
|
2019
|
+
limit?: number;
|
|
2020
|
+
}): Promise<ChatPage<ConversationSummary>>;
|
|
2021
|
+
createConversation(options: CreateConversationOptions): Promise<Conversation>;
|
|
2022
|
+
/** Opens (or returns the existing) direct conversation with one participant. */
|
|
2023
|
+
openDirect(participant: ChatParticipant): Promise<Conversation>;
|
|
2024
|
+
getConversation(conversationId: string): Promise<Conversation>;
|
|
2025
|
+
updateConversation(conversationId: string, changes: {
|
|
2026
|
+
title?: string;
|
|
2027
|
+
topic?: string;
|
|
2028
|
+
archived?: boolean;
|
|
2029
|
+
}): Promise<Conversation>;
|
|
2030
|
+
join(conversationId: string): Promise<Conversation>;
|
|
2031
|
+
listPublicChannels(options?: {
|
|
2032
|
+
query?: string;
|
|
2033
|
+
cursor?: string;
|
|
2034
|
+
limit?: number;
|
|
2035
|
+
}): Promise<ChatPage<PublicChannel>>;
|
|
2036
|
+
listMembers(conversationId: string): Promise<ChatPage<Member>>;
|
|
2037
|
+
addMembers(conversationId: string, participants: ChatParticipant[], role?: 'member' | 'admin'): Promise<Conversation>;
|
|
2038
|
+
/** Removes a member; pass yourself to leave. */
|
|
2039
|
+
removeMember(conversationId: string, participant: ChatParticipant): Promise<void>;
|
|
2040
|
+
changeRole(conversationId: string, participant: ChatParticipant, role: MemberRole): Promise<ChatPage<Member>>;
|
|
2041
|
+
listMessages(conversationId: string, options?: {
|
|
2042
|
+
before?: string;
|
|
2043
|
+
limit?: number;
|
|
2044
|
+
}): Promise<MessagePage>;
|
|
2045
|
+
getMessage(conversationId: string, messageId: string): Promise<ChatMessage>;
|
|
2046
|
+
send(conversationId: string, parts: MessagePartInput[], options?: SendMessageOptions): Promise<ChatMessage>;
|
|
2047
|
+
/** Sends Markdown text (rendered without raw HTML by every reader). */
|
|
2048
|
+
sendText(conversationId: string, markdown: string, options?: SendMessageOptions): Promise<ChatMessage>;
|
|
2049
|
+
/** Edits your own message; pass the revision you saw to reject a concurrent edit. */
|
|
2050
|
+
edit(conversationId: string, messageId: string, parts: MessagePartInput[], options?: {
|
|
2051
|
+
revision?: number;
|
|
2052
|
+
}): Promise<ChatMessage>;
|
|
2053
|
+
delete(conversationId: string, messageId: string): Promise<ChatMessage>;
|
|
2054
|
+
/**
|
|
2055
|
+
* Durable changes after a position: `afterSeq` is a snapshot's `highWatermark` (or the last sequence you applied);
|
|
2056
|
+
* `after` is the `next` cursor of a previous page.
|
|
2057
|
+
*/
|
|
2058
|
+
events(conversationId: string, options?: {
|
|
2059
|
+
after?: string;
|
|
2060
|
+
afterSeq?: number;
|
|
2061
|
+
limit?: number;
|
|
2062
|
+
}): Promise<EventPage>;
|
|
2063
|
+
/** Marks messages read through a sequence; never moves back and never past what the server has. */
|
|
2064
|
+
markRead(conversationId: string, readThroughSeq: number): Promise<ReadState>;
|
|
2065
|
+
setPreferences(conversationId: string, preferences: {
|
|
2066
|
+
muted?: boolean;
|
|
2067
|
+
attention?: AttentionLevel;
|
|
2068
|
+
}): Promise<ConversationPreferences>;
|
|
2069
|
+
/** People in your workspace (name and avatar only). */
|
|
2070
|
+
searchPeople(options?: {
|
|
2071
|
+
query?: string;
|
|
2072
|
+
cursor?: string;
|
|
2073
|
+
limit?: number;
|
|
2074
|
+
}): Promise<ChatPage<ChatPerson>>;
|
|
2075
|
+
listBots(): Promise<ChatPage<ChatBot>>;
|
|
2076
|
+
/** Workspace managers (`chat.manage`) decide whether a bot may message people directly. */
|
|
2077
|
+
updateBotSettings(botId: string, settings: {
|
|
2078
|
+
directMessages: 'none' | 'workspace';
|
|
2079
|
+
}): Promise<ChatBot>;
|
|
2080
|
+
listCommands(): Promise<ChatPage<ChatCommand>>;
|
|
2081
|
+
/** Validates and records a command invocation, returning the Execution request to run as you. */
|
|
2082
|
+
invokeCommand(conversationId: string, command: string, args?: Record<string, unknown>, options?: {
|
|
2083
|
+
idempotencyKey?: string;
|
|
2084
|
+
}): Promise<ChatCommandInvocation>;
|
|
2085
|
+
/**
|
|
2086
|
+
* Invokes an installed app's command and runs its script with your own authorisation. Retrying with the same
|
|
2087
|
+
* idempotency key reuses the invocation key, so Execution never runs it twice.
|
|
2088
|
+
*/
|
|
2089
|
+
runCommand(conversationId: string, command: string, args?: Record<string, unknown>, options?: {
|
|
2090
|
+
idempotencyKey?: string;
|
|
2091
|
+
}): Promise<{
|
|
2092
|
+
invocation: ChatCommandInvocation;
|
|
2093
|
+
execution: Execution;
|
|
2094
|
+
}>;
|
|
2095
|
+
/**
|
|
2096
|
+
* Posts as the installed app's bot from a running script. The bot is derived from the script's execution; the
|
|
2097
|
+
* conversation must have added the bot (or, for `userId`, the workspace must allow it to message people).
|
|
2098
|
+
* Retries briefly while Execution's start event is still on its way.
|
|
2099
|
+
*/
|
|
2100
|
+
postAsBot(options: BotPostOptions): Promise<{
|
|
2101
|
+
conversationId: string;
|
|
2102
|
+
message: ChatMessage;
|
|
2103
|
+
}>;
|
|
2104
|
+
/**
|
|
2105
|
+
* Subscribes to live change hints through the host (installed apps only). Returns an unsubscribe function.
|
|
2106
|
+
* Hints carry ids only; duplicates and reordering are normal, and hints are lost while disconnected.
|
|
2107
|
+
*/
|
|
2108
|
+
subscribeChanges(handlers: ChatSubscriptionHandlers): () => void;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
1646
2111
|
/**
|
|
1647
2112
|
* The main Verentis SDK client.
|
|
1648
2113
|
* Provides access to file operations, workspace context, and (in iframe mode)
|
|
@@ -1655,8 +2120,9 @@ declare class VerentisClient {
|
|
|
1655
2120
|
installations: InstallationsModule;
|
|
1656
2121
|
resources: ResourcesModule;
|
|
1657
2122
|
settings: SettingsModule;
|
|
1658
|
-
|
|
2123
|
+
notifications: NotificationsModule;
|
|
1659
2124
|
business: BusinessModule;
|
|
2125
|
+
chat: ChatModule;
|
|
1660
2126
|
readonly context: ContextModule;
|
|
1661
2127
|
readonly bridge: Bridge | null;
|
|
1662
2128
|
readonly collaboration: NativeCollaborationClient;
|
|
@@ -1811,4 +2277,5 @@ declare class BridgeAuth implements AuthStrategy {
|
|
|
1811
2277
|
*/
|
|
1812
2278
|
declare function createVerentisClient(options?: VerentisClientOptions): VerentisClient;
|
|
1813
2279
|
|
|
1814
|
-
export {
|
|
2280
|
+
export { APP_COMMANDS_CAPABILITY, APP_COMMAND_BATCH_SIZE, APP_COMMAND_ID_PATTERN, ApiError, ApiKeyAuth, Bridge, BridgeAuth, BusinessModule, ChatModule, ContextModule, EnginesModule, ExecutionsModule, FilesModule, HOST_MESSAGE_CHANNEL_PATTERN, HttpTransport, InstallationsModule, NativeCollaborationClient, NativeCollaborationError, NotificationsModule, ResourcesModule, SCRIPT_ARGUMENTS_SCHEMA, SettingsModule, TokenAuth, VerentisClient, createVerentisClient, exactHttpsOrigin, findBestMatch, isAppCommand, isDurableSaveConfirmed, isHeaderAction, isNativeSaveResult, isNativeSnapshot, isTerminalStatus, isTrustedMessage, matchMimeType, validateCollaborationDocument, validateNativeCommand };
|
|
2281
|
+
export type { AppApplicationContext, AppCommand, AppCommandHandler, AppCommandRegistration, AppContext, AppSurface, AppToHostMessage, ApplicationDisplayOptions, ApplicationEntryPoint, ApplicationFileType, ApplicationLaunchConfig, ApplicationManifest, ApplicationSpec, ArchiveFormat, AttentionLevel, AuthOptions, AuthStrategy, BotPostOptions, BusinessCommand, BusinessCommitResult, BusinessContext, BusinessLedgerEntry, BusinessOperation, BusinessOutcomeRequest, BusinessParameters, BusinessReceivable, BusinessReceivableTotals, BusinessReport, BusinessReportLine, BusinessReportName, BusinessSnapshot, CatalogImage, ChatBot, ChatChangeHint, ChatCommand, ChatCommandArgument, ChatCommandInvocation, ChatConnectionStatus, ChatMessage, ChatPage, ChatParticipant, ChatPerson, ChatSubscriptionHandlers, CollaborationDocument, CollaborationDocumentContext, Conversation, ConversationEvent, ConversationKind, ConversationPreferences, ConversationSummary, ConversationVisibility, CreateConversationOptions, DeleteFileOptions, EngineFileType, EngineRuntime, EngineTool, EntryPointInfo, EventPage, ExecuteEngineOptions, Execution, ExecutionEngine, ExecutionEngineListOptions, ExecutionListOptions, ExecutionLogs, ExecutionMode, ExecutionResult, ExecutionScopedOptions, ExecutionStatus, ExecutionTrigger, ExtractUploadOptions, FileAppContext, FileEntry, FileInfo, GetFileOptions, HeaderAction, HeaderActionHandler, HeaderActionRegistration, HeaderActionResult, HistoryPolicy, HostMessageHandler, HostToAppMessage, Installation, InstallationDetail, InstallationGraphOutcomeStatus, InstallationGraphPackage, InstallationGraphPreview, InstallationGraphResult, InstallationLifecycleResult, InstallationListOptions, InstallationMode, InstallationScopedOptions, InstallationStatus, InstalledPackageDescriptor, InstalledPackagePayload, ManifestMetadata, Member, MemberRole, Membership, MessagePage, MessagePart, MessagePartInput, MimeTypeBinding, MoveFileOptions, NamespacedSettings, NativeChangeSet, NativeCollaborationCommand, NativeCollaborationRequest, NativeCollaborationResponse, NativeElement, NativeFile, NativeParticipant, NativePointer, NativeSaveReceipt, NativeSaveResult, NativeScene, NativeSnapshot, NavigateOptions, NodeFileContent, NodeFileMetadata, NodeFileOptions, NotificationRequestOptions, NotificationRequestStatus, NotificationSendOptions, OAuthConfig, PackageDependency, PagedResult, PreviewInstallationOptions, PublicChannel, ReadArchiveOptions, ReadState, ReplyPreview, RequestOptions, ResolveInstallationOptions, ResourceMimeTypeBinding, ResourceRegistration, ResourceScopedOptions, RunFileOptions, SandboxOptions, ScriptArgumentDefinition, ScriptArgumentDescriptor, ScriptArgumentType, ScriptArgumentsOptions, SendMessageOptions, SettingDeclaration, SettingDeclarationType, SettingGroup, SettingItem, SettingOption, SettingPresence, SettingsScopedOptions, TokenGrant, TokenInfo, UpdateInstallationOptions, VerentisActionInvokeMessage, VerentisActionResultMessage, VerentisActionsSetMessage, VerentisClientOptions, VerentisCommandInvokeMessage, VerentisCommandResultMessage, VerentisCommandsUpdateMessage, VerentisDirtyMessage, VerentisFileChangedMessage, VerentisHostMessage, VerentisHostReplyMessage, VerentisInitMessage, VerentisMessage, VerentisNavigateMessage, VerentisReadyMessage, VerentisResizeMessage, VerentisThemeMessage, VerentisTitleMessage, VerentisTokenRefreshMessage, VerentisTokenRefreshedMessage, VerentisWopiRequest, VerentisWopiResponse, WaitOptions, WopiContinuation, WopiLaunch, WopiSaveCheckpoint, WopiSaveStatus, WorkspaceAppContext, WorkspaceInfo, WriteFileOptions, WriteNodeFileOptions };
|