@botiverse/raft-sdk 0.9.0 → 0.11.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/README.md +41 -5
- package/dist/cjs/index.cjs +860 -427
- package/dist/esm/index.js +859 -428
- package/dist/index.d.ts +185 -15
- package/operations.json +153 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -332,11 +332,28 @@ interface AgentApiToolAnnotations {
|
|
|
332
332
|
*/
|
|
333
333
|
type AgentApiRetryPolicy = "retry" | "retry_when_keyed" | "single_attempt";
|
|
334
334
|
//#endregion
|
|
335
|
+
//#region ../shared/src/agentOps/hint.d.ts
|
|
336
|
+
/** How hints are rendered: `cli` (default) as `raft …` commands, `tool` as operation tool calls. */
|
|
337
|
+
type RaftHintStyle = "cli" | "tool";
|
|
338
|
+
/** The operation a next step maps to: manifest name and arguments in manifest shape. */
|
|
339
|
+
interface RaftNextOperation {
|
|
340
|
+
/** Manifest name (`RAFT_OPERATIONS`), for example `messages.read`. */
|
|
341
|
+
name: string;
|
|
342
|
+
args: Record<string, unknown>;
|
|
343
|
+
/** Some required arguments are left for the caller (for example a message's `content`). */
|
|
344
|
+
partial?: true;
|
|
345
|
+
}
|
|
346
|
+
/** `tasks.updateStatus` → `tasks_update_status`: the manifest's tool name for an operation name. */
|
|
347
|
+
export declare function raftToolNameFor(name: string): string;
|
|
348
|
+
//#endregion
|
|
335
349
|
//#region ../shared/src/agentOps/outcome.d.ts
|
|
336
350
|
interface RaftNextStep {
|
|
337
351
|
/** Stable step kind, for example `read_target`, `run_inbox_check`, `retry_after_review`. */
|
|
338
352
|
kind: string;
|
|
339
|
-
/**
|
|
353
|
+
/**
|
|
354
|
+
* The exact CLI command an agent would run for this step, when one exists;
|
|
355
|
+
* with `createRaft({ hints: "tool" })`, the tool call instead.
|
|
356
|
+
*/
|
|
340
357
|
command?: string;
|
|
341
358
|
/**
|
|
342
359
|
* Structured arguments for the step: plain, serialisable data (never a
|
|
@@ -345,6 +362,12 @@ interface RaftNextStep {
|
|
|
345
362
|
* (An interrupted call's resume is `interrupt.resume`, not `args`.)
|
|
346
363
|
*/
|
|
347
364
|
args?: Record<string, unknown>;
|
|
365
|
+
/**
|
|
366
|
+
* The manifest operation that takes this step, with its arguments in
|
|
367
|
+
* manifest shape (valid for that operation's schema). `partial: true` when
|
|
368
|
+
* some required arguments are the caller's to supply (a send's `content`).
|
|
369
|
+
*/
|
|
370
|
+
operation?: RaftNextOperation;
|
|
348
371
|
/** One sentence explaining why this is the next step. */
|
|
349
372
|
why: string;
|
|
350
373
|
}
|
|
@@ -424,9 +447,9 @@ interface RaftMessage {
|
|
|
424
447
|
*/
|
|
425
448
|
export declare function hasAgentMessageIdentity(envelope: AgentApiMessageEnvelope): boolean;
|
|
426
449
|
/** Project one envelope; `null` when it has no conversation identity (skip it rather than render `#undefined`). */
|
|
427
|
-
export declare function projectRaftMessage(envelope: AgentApiMessageEnvelope): RaftMessage | null;
|
|
450
|
+
export declare function projectRaftMessage(envelope: AgentApiMessageEnvelope, style?: RaftHintStyle): RaftMessage | null;
|
|
428
451
|
/** Project a list, skipping envelopes without a conversation identity. */
|
|
429
|
-
export declare function projectRaftMessages(envelopes: readonly AgentApiMessageEnvelope[]): RaftMessage[];
|
|
452
|
+
export declare function projectRaftMessages(envelopes: readonly AgentApiMessageEnvelope[], style?: RaftHintStyle): RaftMessage[];
|
|
430
453
|
//#endregion
|
|
431
454
|
//#region ../shared/src/agentOps/interrupt.d.ts
|
|
432
455
|
/** Why the call stopped. */
|
|
@@ -666,7 +689,7 @@ interface RaftInboxConversation {
|
|
|
666
689
|
activitySeq: number;
|
|
667
690
|
latestSenderName: string | null;
|
|
668
691
|
latestAt: string | null;
|
|
669
|
-
/** The exact command that opens this conversation from the agent's read position. */
|
|
692
|
+
/** The exact command that opens this conversation from the agent's read position (the tool call with `hints: "tool"`). */
|
|
670
693
|
openCommand: string;
|
|
671
694
|
}
|
|
672
695
|
interface RaftInboxListing {
|
|
@@ -1103,6 +1126,8 @@ interface ServerInfoRequest {
|
|
|
1103
1126
|
limit?: number;
|
|
1104
1127
|
/** Channels only: restrict to joined channels. */
|
|
1105
1128
|
joined?: boolean;
|
|
1129
|
+
/** Sections only: keep rows whose visible text contains this (case-insensitive), like the CLI's `--query`. */
|
|
1130
|
+
query?: string;
|
|
1106
1131
|
}
|
|
1107
1132
|
export declare const serverInfoRequestSchema: z.ZodObject<{
|
|
1108
1133
|
view: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1115,6 +1140,7 @@ export declare const serverInfoRequestSchema: z.ZodObject<{
|
|
|
1115
1140
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
1116
1141
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1117
1142
|
joined: z.ZodOptional<z.ZodBoolean>;
|
|
1143
|
+
query: z.ZodOptional<z.ZodString>;
|
|
1118
1144
|
}, z.core.$strip>;
|
|
1119
1145
|
export declare const showProfileRequestSchema: z.ZodObject<{
|
|
1120
1146
|
target: z.ZodOptional<z.ZodString>;
|
|
@@ -1168,6 +1194,9 @@ export declare const attachmentCommentsRequestSchema: z.ZodObject<{
|
|
|
1168
1194
|
attachmentId: z.ZodString;
|
|
1169
1195
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1170
1196
|
}, z.core.$strip>;
|
|
1197
|
+
export declare const downloadAttachmentUrlRequestSchema: z.ZodObject<{
|
|
1198
|
+
attachmentId: z.ZodString;
|
|
1199
|
+
}, z.core.$strip>;
|
|
1171
1200
|
/** Explicit type wins; otherwise sniff the bytes, then the filename extension, then octet-stream. */
|
|
1172
1201
|
export declare function inferAttachmentMimeType(filename: string, bytes: Uint8Array, explicit?: string | null): string;
|
|
1173
1202
|
interface UploadAttachmentRequest {
|
|
@@ -1186,6 +1215,8 @@ interface RaftAttachmentBytes {
|
|
|
1186
1215
|
attachmentId: string;
|
|
1187
1216
|
bytes: Uint8Array;
|
|
1188
1217
|
}
|
|
1218
|
+
/** A short-lived download URL: what a runtime fetches the bytes from itself (`attachments.downloadUrl`). */
|
|
1219
|
+
type RaftAttachmentDownloadUrl = Pick<AgentApiAttachmentDownloadUrlResponse, "url" | "expiresAt" | "filename" | "mimeType">;
|
|
1189
1220
|
//#endregion
|
|
1190
1221
|
//#region ../shared/src/agentOps/search.d.ts
|
|
1191
1222
|
interface SearchMessagesRequest {
|
|
@@ -1264,6 +1295,10 @@ interface AgentMentionActionResult {
|
|
|
1264
1295
|
export declare const pendingMentionActionsRequestSchema: z.ZodObject<{
|
|
1265
1296
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1266
1297
|
}, z.core.$strip>;
|
|
1298
|
+
export declare const mentionResolutionIdsRequestSchema: z.ZodObject<{
|
|
1299
|
+
resolutionIds: z.ZodArray<z.ZodString>;
|
|
1300
|
+
}, z.core.$strip>;
|
|
1301
|
+
/** @deprecated The request of the deprecated `mentions.execute`; use `mentionResolutionIdsRequestSchema` (`mentions.notify` / `mentions.add`). */
|
|
1267
1302
|
export declare const executeMentionActionRequestSchema: z.ZodObject<{
|
|
1268
1303
|
action: z.ZodEnum<{
|
|
1269
1304
|
notify: "notify";
|
|
@@ -1280,6 +1315,14 @@ interface RaftPendingMentions {
|
|
|
1280
1315
|
hasMore: boolean | null;
|
|
1281
1316
|
limit: number | undefined;
|
|
1282
1317
|
}
|
|
1318
|
+
interface MentionResolutionIdsRequest {
|
|
1319
|
+
resolutionIds: string[];
|
|
1320
|
+
}
|
|
1321
|
+
type RaftMentionActionOutcome = RaftOutcome<{
|
|
1322
|
+
action: AgentMentionActionKind;
|
|
1323
|
+
results: AgentMentionActionResult[];
|
|
1324
|
+
}, "executed">;
|
|
1325
|
+
/** @deprecated The request of the deprecated `mentions.execute`; use `MentionResolutionIdsRequest`. */
|
|
1283
1326
|
interface ExecuteMentionActionRequest {
|
|
1284
1327
|
action: AgentMentionActionKind;
|
|
1285
1328
|
resolutionIds: string[];
|
|
@@ -1995,6 +2038,18 @@ declare const agentApiChannelLifecycleBodySchema: z.ZodObject<{
|
|
|
1995
2038
|
declare const agentApiAttachmentDownloadParamsSchema: z.ZodObject<{
|
|
1996
2039
|
attachmentId: z.ZodString;
|
|
1997
2040
|
}, z.core.$loose>;
|
|
2041
|
+
/**
|
|
2042
|
+
* Short-lived download URL for an attachment visible to the bound agent
|
|
2043
|
+
* credential (`GET /attachments/:attachmentId/url`). For runtimes that cannot
|
|
2044
|
+
* take binary tool results: the agent fetches the bytes itself from `url`
|
|
2045
|
+
* before `expiresAt`. The URL is a bearer capability; never log it.
|
|
2046
|
+
*/
|
|
2047
|
+
declare const agentApiAttachmentDownloadUrlResponseSchema: z.ZodObject<{
|
|
2048
|
+
url: z.ZodString;
|
|
2049
|
+
expiresAt: z.ZodString;
|
|
2050
|
+
filename: z.ZodString;
|
|
2051
|
+
mimeType: z.ZodString;
|
|
2052
|
+
}, z.core.$loose>;
|
|
1998
2053
|
declare const agentApiAttachmentCommentsParamsSchema: z.ZodObject<{
|
|
1999
2054
|
attachmentId: z.ZodString;
|
|
2000
2055
|
}, z.core.$loose>;
|
|
@@ -8265,6 +8320,32 @@ declare const agentApiContract: {
|
|
|
8265
8320
|
} & {
|
|
8266
8321
|
fullPath: string;
|
|
8267
8322
|
};
|
|
8323
|
+
readonly attachmentDownloadUrl: {
|
|
8324
|
+
readonly key: "attachmentDownloadUrl";
|
|
8325
|
+
readonly method: "GET";
|
|
8326
|
+
readonly path: "/attachments/:attachmentId/url";
|
|
8327
|
+
readonly client: {
|
|
8328
|
+
readonly resource: "attachments";
|
|
8329
|
+
readonly method: "downloadUrl";
|
|
8330
|
+
};
|
|
8331
|
+
readonly capability: "read";
|
|
8332
|
+
readonly description: "Mint a short-lived (5 minute) download URL for an attachment visible to the bound agent credential, with its filename and MIME type. 409 download_url_unavailable when this Server's storage cannot presign; use the binary download instead.";
|
|
8333
|
+
readonly request: {
|
|
8334
|
+
readonly params: z.ZodObject<{
|
|
8335
|
+
attachmentId: z.ZodString;
|
|
8336
|
+
}, z.core.$loose>;
|
|
8337
|
+
};
|
|
8338
|
+
readonly response: {
|
|
8339
|
+
readonly body: z.ZodObject<{
|
|
8340
|
+
url: z.ZodString;
|
|
8341
|
+
expiresAt: z.ZodString;
|
|
8342
|
+
filename: z.ZodString;
|
|
8343
|
+
mimeType: z.ZodString;
|
|
8344
|
+
}, z.core.$loose>;
|
|
8345
|
+
};
|
|
8346
|
+
} & {
|
|
8347
|
+
fullPath: string;
|
|
8348
|
+
};
|
|
8268
8349
|
readonly attachmentCommentsList: {
|
|
8269
8350
|
readonly key: "attachmentCommentsList";
|
|
8270
8351
|
readonly method: "GET";
|
|
@@ -8517,6 +8598,7 @@ type AgentApiAttachmentUploadSessionCreateResponse = z.infer<typeof createAttach
|
|
|
8517
8598
|
type AgentApiAttachmentUploadSessionCompleteResponse = z.infer<typeof completeAttachmentUploadSessionResponseSchema>;
|
|
8518
8599
|
type AgentApiAttachmentUploadSessionResponse = z.infer<typeof attachmentUploadSessionSchema>;
|
|
8519
8600
|
type AgentApiAttachmentDownloadResponse = Uint8Array;
|
|
8601
|
+
type AgentApiAttachmentDownloadUrlResponse = z.infer<typeof agentApiAttachmentDownloadUrlResponseSchema>;
|
|
8520
8602
|
interface AgentApiEventsInboxHint {
|
|
8521
8603
|
unread_conversations: number;
|
|
8522
8604
|
command: "raft inbox check";
|
|
@@ -8709,6 +8791,7 @@ type AgentApiRequestParamsByRoute = {
|
|
|
8709
8791
|
messageReactionAdd: AgentApiMessageReactionParams;
|
|
8710
8792
|
messageReactionRemove: AgentApiMessageReactionParams;
|
|
8711
8793
|
attachmentDownload: AgentApiAttachmentDownloadParams;
|
|
8794
|
+
attachmentDownloadUrl: AgentApiAttachmentDownloadParams;
|
|
8712
8795
|
attachmentCommentsList: AgentApiAttachmentCommentsParams;
|
|
8713
8796
|
channelJoin: AgentApiChannelMembershipParams;
|
|
8714
8797
|
channelLeave: AgentApiChannelMembershipParams;
|
|
@@ -8789,6 +8872,7 @@ type AgentApiRequestQueryByRoute = {
|
|
|
8789
8872
|
messageReactionAdd: never;
|
|
8790
8873
|
messageReactionRemove: never;
|
|
8791
8874
|
attachmentDownload: never;
|
|
8875
|
+
attachmentDownloadUrl: never;
|
|
8792
8876
|
attachmentCommentsList: AgentApiAttachmentCommentsQuery;
|
|
8793
8877
|
channelJoin: never;
|
|
8794
8878
|
channelLeave: never;
|
|
@@ -8869,6 +8953,7 @@ type AgentApiRequestBodyByRoute = {
|
|
|
8869
8953
|
messageReactionAdd: AgentApiMessageReactionBody;
|
|
8870
8954
|
messageReactionRemove: AgentApiMessageReactionBody;
|
|
8871
8955
|
attachmentDownload: never;
|
|
8956
|
+
attachmentDownloadUrl: never;
|
|
8872
8957
|
attachmentCommentsList: never;
|
|
8873
8958
|
channelJoin: never;
|
|
8874
8959
|
channelLeave: never;
|
|
@@ -8949,6 +9034,7 @@ type AgentApiResponseByRoute = {
|
|
|
8949
9034
|
messageReactionAdd: AgentApiMessageEnvelope;
|
|
8950
9035
|
messageReactionRemove: AgentApiMessageEnvelope;
|
|
8951
9036
|
attachmentDownload: AgentApiAttachmentDownloadResponse;
|
|
9037
|
+
attachmentDownloadUrl: AgentApiAttachmentDownloadUrlResponse;
|
|
8952
9038
|
attachmentCommentsList: AgentApiAttachmentCommentsResponse;
|
|
8953
9039
|
channelJoin: AgentApiOkResponse;
|
|
8954
9040
|
channelLeave: AgentApiOkResponse;
|
|
@@ -9796,6 +9882,21 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
9796
9882
|
mayBeLarge: false;
|
|
9797
9883
|
boundBy: never[];
|
|
9798
9884
|
};
|
|
9885
|
+
}, {
|
|
9886
|
+
readonly name: "attachments.downloadUrl";
|
|
9887
|
+
readonly description: "Get a short-lived (5 minute) URL for an attachment's bytes, with its filename and MIME type, for runtimes that fetch files themselves. The URL grants access to the file: do not post it in messages.";
|
|
9888
|
+
readonly schema: z.ZodObject<{
|
|
9889
|
+
attachmentId: z.ZodString;
|
|
9890
|
+
}, z.core.$strip>;
|
|
9891
|
+
readonly routes: readonly ["attachmentDownloadUrl"];
|
|
9892
|
+
readonly consumes: {
|
|
9893
|
+
model: never[];
|
|
9894
|
+
code: never[];
|
|
9895
|
+
};
|
|
9896
|
+
readonly output: {
|
|
9897
|
+
mayBeLarge: false;
|
|
9898
|
+
boundBy: never[];
|
|
9899
|
+
};
|
|
9799
9900
|
}, {
|
|
9800
9901
|
readonly name: "attachments.comments";
|
|
9801
9902
|
readonly description: "List the comments on an attachment.";
|
|
@@ -9827,9 +9928,54 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
9827
9928
|
readonly mayBeLarge: true;
|
|
9828
9929
|
readonly boundBy: ["limit"];
|
|
9829
9930
|
};
|
|
9931
|
+
}, {
|
|
9932
|
+
readonly name: "mentions.notify";
|
|
9933
|
+
readonly description: "Deliver unreached @mentions by notifying each mentioned target about the message, without adding them to the conversation. Takes resolutionId values from mentions.pending.";
|
|
9934
|
+
readonly schema: z.ZodObject<{
|
|
9935
|
+
resolutionIds: z.ZodArray<z.ZodString>;
|
|
9936
|
+
}, z.core.$strip>;
|
|
9937
|
+
readonly routes: readonly ["mentionActionsExecute"];
|
|
9938
|
+
readonly consumes: {
|
|
9939
|
+
model: never[];
|
|
9940
|
+
code: never[];
|
|
9941
|
+
};
|
|
9942
|
+
readonly output: {
|
|
9943
|
+
mayBeLarge: false;
|
|
9944
|
+
boundBy: never[];
|
|
9945
|
+
};
|
|
9946
|
+
}, {
|
|
9947
|
+
readonly name: "mentions.add";
|
|
9948
|
+
readonly description: "Deliver unreached @mentions by adding each mentioned target to the conversation, so they see the message and what follows. Takes resolutionId values from mentions.pending.";
|
|
9949
|
+
readonly schema: z.ZodObject<{
|
|
9950
|
+
resolutionIds: z.ZodArray<z.ZodString>;
|
|
9951
|
+
}, z.core.$strip>;
|
|
9952
|
+
readonly routes: readonly ["mentionActionsExecute"];
|
|
9953
|
+
readonly consumes: {
|
|
9954
|
+
model: never[];
|
|
9955
|
+
code: never[];
|
|
9956
|
+
};
|
|
9957
|
+
readonly output: {
|
|
9958
|
+
mayBeLarge: false;
|
|
9959
|
+
boundBy: never[];
|
|
9960
|
+
};
|
|
9961
|
+
}, {
|
|
9962
|
+
readonly name: "mentions.delivery";
|
|
9963
|
+
readonly description: "Whether each @mention in a message you sent reached its target.";
|
|
9964
|
+
readonly schema: z.ZodObject<{
|
|
9965
|
+
messageId: z.ZodString;
|
|
9966
|
+
}, z.core.$strip>;
|
|
9967
|
+
readonly routes: readonly ["senderMentionDeliveries"];
|
|
9968
|
+
readonly consumes: {
|
|
9969
|
+
model: never[];
|
|
9970
|
+
code: never[];
|
|
9971
|
+
};
|
|
9972
|
+
readonly output: {
|
|
9973
|
+
mayBeLarge: false;
|
|
9974
|
+
boundBy: never[];
|
|
9975
|
+
};
|
|
9830
9976
|
}, {
|
|
9831
9977
|
readonly name: "mentions.execute";
|
|
9832
|
-
readonly description: "Deliver unreached @mentions: notify the mentioned target, or add them to the conversation.";
|
|
9978
|
+
readonly description: "Deprecated: use mentions.notify / mentions.add. Removed in the next minor release. Deliver unreached @mentions: notify the mentioned target, or add them to the conversation.";
|
|
9833
9979
|
readonly schema: z.ZodObject<{
|
|
9834
9980
|
action: z.ZodEnum<{
|
|
9835
9981
|
notify: "notify";
|
|
@@ -9846,9 +9992,10 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
9846
9992
|
mayBeLarge: false;
|
|
9847
9993
|
boundBy: never[];
|
|
9848
9994
|
};
|
|
9995
|
+
readonly deprecated: true;
|
|
9849
9996
|
}, {
|
|
9850
9997
|
readonly name: "mentions.deliveries";
|
|
9851
|
-
readonly description: "Whether each @mention in a message you sent reached its target.";
|
|
9998
|
+
readonly description: "Deprecated: use mentions.delivery. Removed in the next minor release. Whether each @mention in a message you sent reached its target.";
|
|
9852
9999
|
readonly schema: z.ZodObject<{
|
|
9853
10000
|
messageId: z.ZodString;
|
|
9854
10001
|
}, z.core.$strip>;
|
|
@@ -9861,6 +10008,7 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
9861
10008
|
mayBeLarge: false;
|
|
9862
10009
|
boundBy: never[];
|
|
9863
10010
|
};
|
|
10011
|
+
readonly deprecated: true;
|
|
9864
10012
|
}, {
|
|
9865
10013
|
readonly name: "actions.prepare";
|
|
9866
10014
|
readonly description: "Post an action card (create a channel, add members, create an agent, or an integration step) for a human to confirm; the human who clicks it carries it out as themselves. When it is executed (or fails), the outcome arrives as a reply that @mentions you in the card's thread (or in the thread the card was posted in).";
|
|
@@ -10347,6 +10495,7 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
10347
10495
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
10348
10496
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
10349
10497
|
joined: z.ZodOptional<z.ZodBoolean>;
|
|
10498
|
+
query: z.ZodOptional<z.ZodString>;
|
|
10350
10499
|
}, z.core.$strip>;
|
|
10351
10500
|
readonly routes: readonly ["serverInfo"];
|
|
10352
10501
|
readonly consumes: {
|
|
@@ -10414,8 +10563,6 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
10414
10563
|
}];
|
|
10415
10564
|
/** The dotted name of every operation in the manifest (the `invoke` key). */
|
|
10416
10565
|
type RaftOperationName = (typeof OPERATION_DEFS)[number]["name"];
|
|
10417
|
-
/** `tasks.updateStatus` → `tasks_update_status`. */
|
|
10418
|
-
export declare function raftToolNameFor(name: string): string;
|
|
10419
10566
|
/** Every agent operation on `createRaft`, in a stable order. */
|
|
10420
10567
|
export declare const RAFT_OPERATIONS: readonly RaftOperationSpec[];
|
|
10421
10568
|
/** Content hash of `RAFT_OPERATIONS` (16 hex digits); changes whenever any field of any operation changes. */
|
|
@@ -10460,6 +10607,15 @@ interface CreateRaftOptions {
|
|
|
10460
10607
|
state?: RaftStateStore;
|
|
10461
10608
|
/** Called when loading or saving the state fails or is rejected as stale. */
|
|
10462
10609
|
onStateSaveError?: RaftStateSaveErrorHandler;
|
|
10610
|
+
/**
|
|
10611
|
+
* How "do this next" hints render in every outcome's `text` and
|
|
10612
|
+
* `next.command`. `cli` (default): the `raft …` command, exactly as the CLI
|
|
10613
|
+
* prints it. `tool`: the operation as a tool call, `messages_read({ target:
|
|
10614
|
+
* "#ops" })`, for runtimes that hand operations to the model as tools
|
|
10615
|
+
* (required arguments the model supplies show as `content: …`). Either way
|
|
10616
|
+
* `next.operation` carries the structured call.
|
|
10617
|
+
*/
|
|
10618
|
+
hints?: RaftHintStyle;
|
|
10463
10619
|
}
|
|
10464
10620
|
interface RaftInboxCommitResult {
|
|
10465
10621
|
/** The committed cursor, or null when there was nothing to commit. */
|
|
@@ -10568,6 +10724,15 @@ interface Raft {
|
|
|
10568
10724
|
download(request: {
|
|
10569
10725
|
attachmentId: string;
|
|
10570
10726
|
}): Promise<RaftOutcome<RaftAttachmentBytes, "downloaded">>;
|
|
10727
|
+
/**
|
|
10728
|
+
* A short-lived (5 minute) URL for the bytes, for runtimes whose tools
|
|
10729
|
+
* cannot return binary data; fetch it yourself before `expiresAt` and do
|
|
10730
|
+
* not log it. A Server that cannot presign fails with `CONFLICT`
|
|
10731
|
+
* (`download_url_unavailable`) and `next` pointing at `download`.
|
|
10732
|
+
*/
|
|
10733
|
+
downloadUrl(request: {
|
|
10734
|
+
attachmentId: string;
|
|
10735
|
+
}): Promise<RaftOutcome<RaftAttachmentDownloadUrl, "url">>;
|
|
10571
10736
|
comments(request: {
|
|
10572
10737
|
attachmentId: string;
|
|
10573
10738
|
limit?: number;
|
|
@@ -10580,12 +10745,17 @@ interface Raft {
|
|
|
10580
10745
|
pending(request?: {
|
|
10581
10746
|
limit?: number;
|
|
10582
10747
|
}): Promise<RaftOutcome<RaftPendingMentions, "pending" | "empty">>;
|
|
10583
|
-
/**
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10748
|
+
/** Notify the targets of unreached mentions about the message (`raft mention notify`). */
|
|
10749
|
+
notify(request: MentionResolutionIdsRequest): Promise<RaftMentionActionOutcome>;
|
|
10750
|
+
/** Add the targets of unreached mentions to the conversation (`raft mention add`). */
|
|
10751
|
+
add(request: MentionResolutionIdsRequest): Promise<RaftMentionActionOutcome>;
|
|
10752
|
+
/** Per-target delivery outcome for a message you sent (`raft mention delivery`). */
|
|
10753
|
+
delivery(request: {
|
|
10754
|
+
messageId: string;
|
|
10755
|
+
}): Promise<RaftOutcome<AgentApiSenderMentionDeliveriesResponse, "deliveries" | "empty">>;
|
|
10756
|
+
/** @deprecated Use `mentions.notify` / `mentions.add`; removed in 0.12.0. */
|
|
10757
|
+
execute(request: ExecuteMentionActionRequest): Promise<RaftMentionActionOutcome>;
|
|
10758
|
+
/** @deprecated Use `mentions.delivery`; removed in 0.12.0. */
|
|
10589
10759
|
deliveries(request: {
|
|
10590
10760
|
messageId: string;
|
|
10591
10761
|
}): Promise<RaftOutcome<AgentApiSenderMentionDeliveriesResponse, "deliveries" | "empty">>;
|
|
@@ -10723,4 +10893,4 @@ export declare const commitInboxRequestSchema: z.ZodObject<{
|
|
|
10723
10893
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10724
10894
|
}, z.core.$strip>;
|
|
10725
10895
|
//#endregion
|
|
10726
|
-
export type { AmendTaskOutcome, AmendTaskRequest, AssignTaskRequest, BootstrapRaftCredentialOptions, CheckInboxOutcome, CheckInboxRequest, ClaimTasksOutcome, ClaimTasksRequest, ConvertMessageToTaskRequest, CreateRaftClientFromStoreOptions, CreateRaftClientOptions, CreateRaftOptions, CreateRaftRoutesOptions, CreateTasksRequest, DrainInboxRequest, ExecuteMentionActionRequest, ListInboxRequest, ListTasksRequest, ManualContext, PrepareActionCardRequest, Raft, RaftAckMode, RaftActionPrepareRequest, RaftActionPrepared, RaftApiError, RaftApiResult, RaftAppConfig, RaftAppConfigPatch, RaftAttachmentBytes, RaftAttachmentUploaded, RaftAvatarUpload, RaftChannelInfo, RaftChannelJoinClient, RaftChannelJoinClientResult, RaftChannelJoinError, RaftChannelJoinFailure, RaftChannelJoinOperation, RaftChannelJoinRequest, RaftChannelJoinResult, RaftChannelJoinSuccess, RaftChannelJoinTransportError, RaftChannelMuteState, RaftChannelRef, RaftClaimResult, RaftClaimRow, RaftClaimRowState, RaftClient, RaftClientError, RaftClientFailure, RaftClientResult, RaftClientSuccess, RaftClientThrottleOptions, RaftClientTransportRequest, RaftConsumption, RaftContextAgent, RaftContextData, RaftContextError, RaftContextResult, RaftContextServer, RaftCredentialErrorCode, RaftCredentialIdentity, RaftCredentialStore, RaftEvent, RaftEventAttachment, RaftEventExternalMessage, RaftEventsReceiveData, RaftEventsReceiveError, RaftEventsReceiveRequest, RaftEventsReceiveResult, RaftFailure, RaftHistoryPage, RaftInboxBatch, RaftInboxCommitResult, RaftInboxConversation, RaftInboxDrainSummary, RaftInboxDrained, RaftInboxListing, RaftInboxNotice, RaftInterrupt, RaftInterruptCancel, RaftInterruptReason, RaftInterruptResume, RaftInterrupted, RaftInvokeCaller, RaftInvokeResult, RaftJsonSchema, RaftJsonSchemaType, RaftLatestReadThread, RaftManageClient, RaftMessage, RaftMessageAttachment, RaftMessageTask, RaftNextStep, RaftNoticeFlag, RaftNoticeTarget, RaftOpError, RaftOpErrorCode, RaftOperationIdempotency, RaftOperationName, RaftOperationSpec, RaftOperationsDocument, RaftOutcome, RaftPendingMentions, RaftPreparedCard, RaftProfile, RaftProfileUpdate, RaftRouteAnnotations, RaftRouteInfo, RaftRouteKey, RaftRouteMeta, RaftRouteResult, RaftRouteRetryPolicy, RaftRoutes, RaftSdkConfigurationErrorCode, RaftSearchPage, RaftSenderType, RaftSent, RaftServerInfo, RaftServerProfile, RaftServerUpdate, RaftState, RaftStateContinuation, RaftStateSaveErrorHandler, RaftStateStore, RaftTaskBoard, RaftTaskStatus, RaftTasksCreated, RaftUserInfo, RaftUserRef, RaftWebhookStatus, ReactRequest, ReadHistoryRequest, ReadLatestReadThreadOptions, ReplyToRequest, SearchMessagesRequest, SeenAttestation, SeenFrontierSnapshot, SendMessageOutcome, SendMessageRequest, ServerInfoRequest, ServerInfoSection, StoredRaftCredential, TaskRef, UpdateTaskStatusOutcome, UpdateTaskStatusRequest, UploadAttachmentRequest, UserInfoRequest, VerifyNoticeInput, VerifyNoticeRejection, VerifyNoticeResult };
|
|
10896
|
+
export type { AmendTaskOutcome, AmendTaskRequest, AssignTaskRequest, BootstrapRaftCredentialOptions, CheckInboxOutcome, CheckInboxRequest, ClaimTasksOutcome, ClaimTasksRequest, ConvertMessageToTaskRequest, CreateRaftClientFromStoreOptions, CreateRaftClientOptions, CreateRaftOptions, CreateRaftRoutesOptions, CreateTasksRequest, DrainInboxRequest, ExecuteMentionActionRequest, ListInboxRequest, ListTasksRequest, ManualContext, MentionResolutionIdsRequest, PrepareActionCardRequest, Raft, RaftAckMode, RaftActionPrepareRequest, RaftActionPrepared, RaftApiError, RaftApiResult, RaftAppConfig, RaftAppConfigPatch, RaftAttachmentBytes, RaftAttachmentDownloadUrl, RaftAttachmentUploaded, RaftAvatarUpload, RaftChannelInfo, RaftChannelJoinClient, RaftChannelJoinClientResult, RaftChannelJoinError, RaftChannelJoinFailure, RaftChannelJoinOperation, RaftChannelJoinRequest, RaftChannelJoinResult, RaftChannelJoinSuccess, RaftChannelJoinTransportError, RaftChannelMuteState, RaftChannelRef, RaftClaimResult, RaftClaimRow, RaftClaimRowState, RaftClient, RaftClientError, RaftClientFailure, RaftClientResult, RaftClientSuccess, RaftClientThrottleOptions, RaftClientTransportRequest, RaftConsumption, RaftContextAgent, RaftContextData, RaftContextError, RaftContextResult, RaftContextServer, RaftCredentialErrorCode, RaftCredentialIdentity, RaftCredentialStore, RaftEvent, RaftEventAttachment, RaftEventExternalMessage, RaftEventsReceiveData, RaftEventsReceiveError, RaftEventsReceiveRequest, RaftEventsReceiveResult, RaftFailure, RaftHintStyle, RaftHistoryPage, RaftInboxBatch, RaftInboxCommitResult, RaftInboxConversation, RaftInboxDrainSummary, RaftInboxDrained, RaftInboxListing, RaftInboxNotice, RaftInterrupt, RaftInterruptCancel, RaftInterruptReason, RaftInterruptResume, RaftInterrupted, RaftInvokeCaller, RaftInvokeResult, RaftJsonSchema, RaftJsonSchemaType, RaftLatestReadThread, RaftManageClient, RaftMentionActionOutcome, RaftMessage, RaftMessageAttachment, RaftMessageTask, RaftNextOperation, RaftNextStep, RaftNoticeFlag, RaftNoticeTarget, RaftOpError, RaftOpErrorCode, RaftOperationIdempotency, RaftOperationName, RaftOperationSpec, RaftOperationsDocument, RaftOutcome, RaftPendingMentions, RaftPreparedCard, RaftProfile, RaftProfileUpdate, RaftRouteAnnotations, RaftRouteInfo, RaftRouteKey, RaftRouteMeta, RaftRouteResult, RaftRouteRetryPolicy, RaftRoutes, RaftSdkConfigurationErrorCode, RaftSearchPage, RaftSenderType, RaftSent, RaftServerInfo, RaftServerProfile, RaftServerUpdate, RaftState, RaftStateContinuation, RaftStateSaveErrorHandler, RaftStateStore, RaftTaskBoard, RaftTaskStatus, RaftTasksCreated, RaftUserInfo, RaftUserRef, RaftWebhookStatus, ReactRequest, ReadHistoryRequest, ReadLatestReadThreadOptions, ReplyToRequest, SearchMessagesRequest, SeenAttestation, SeenFrontierSnapshot, SendMessageOutcome, SendMessageRequest, ServerInfoRequest, ServerInfoSection, StoredRaftCredential, TaskRef, UpdateTaskStatusOutcome, UpdateTaskStatusRequest, UploadAttachmentRequest, UserInfoRequest, VerifyNoticeInput, VerifyNoticeRejection, VerifyNoticeResult };
|
package/operations.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "raft-sdk-operations.v1",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16c7523f47f8b204",
|
|
4
4
|
"operations": [
|
|
5
5
|
{
|
|
6
6
|
"name": "identity.whoami",
|
|
@@ -620,6 +620,40 @@
|
|
|
620
620
|
"boundBy": []
|
|
621
621
|
}
|
|
622
622
|
},
|
|
623
|
+
{
|
|
624
|
+
"name": "attachments.downloadUrl",
|
|
625
|
+
"toolName": "attachments_download_url",
|
|
626
|
+
"description": "Get a short-lived (5 minute) URL for an attachment's bytes, with its filename and MIME type, for runtimes that fetch files themselves. The URL grants access to the file: do not post it in messages.",
|
|
627
|
+
"inputSchema": {
|
|
628
|
+
"type": "object",
|
|
629
|
+
"properties": {
|
|
630
|
+
"attachmentId": {
|
|
631
|
+
"type": "string",
|
|
632
|
+
"description": "The attachment id, as message lines show it (`id:…`)."
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
"required": [
|
|
636
|
+
"attachmentId"
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
"sideEffect": "read",
|
|
640
|
+
"idempotency": {
|
|
641
|
+
"kind": "natural"
|
|
642
|
+
},
|
|
643
|
+
"capability": [
|
|
644
|
+
"read"
|
|
645
|
+
],
|
|
646
|
+
"modelOnly": false,
|
|
647
|
+
"mayInterrupt": false,
|
|
648
|
+
"consumes": {
|
|
649
|
+
"model": [],
|
|
650
|
+
"code": []
|
|
651
|
+
},
|
|
652
|
+
"output": {
|
|
653
|
+
"mayBeLarge": false,
|
|
654
|
+
"boundBy": []
|
|
655
|
+
}
|
|
656
|
+
},
|
|
623
657
|
{
|
|
624
658
|
"name": "attachments.comments",
|
|
625
659
|
"toolName": "attachments_comments",
|
|
@@ -695,10 +729,118 @@
|
|
|
695
729
|
]
|
|
696
730
|
}
|
|
697
731
|
},
|
|
732
|
+
{
|
|
733
|
+
"name": "mentions.notify",
|
|
734
|
+
"toolName": "mentions_notify",
|
|
735
|
+
"description": "Deliver unreached @mentions by notifying each mentioned target about the message, without adding them to the conversation. Takes resolutionId values from mentions.pending.",
|
|
736
|
+
"inputSchema": {
|
|
737
|
+
"type": "object",
|
|
738
|
+
"properties": {
|
|
739
|
+
"resolutionIds": {
|
|
740
|
+
"type": "array",
|
|
741
|
+
"description": "resolutionId values from mentions.pending.",
|
|
742
|
+
"items": {
|
|
743
|
+
"type": "string"
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
"required": [
|
|
748
|
+
"resolutionIds"
|
|
749
|
+
]
|
|
750
|
+
},
|
|
751
|
+
"sideEffect": "write",
|
|
752
|
+
"idempotency": {
|
|
753
|
+
"kind": "none"
|
|
754
|
+
},
|
|
755
|
+
"capability": [
|
|
756
|
+
"mentions"
|
|
757
|
+
],
|
|
758
|
+
"modelOnly": false,
|
|
759
|
+
"mayInterrupt": false,
|
|
760
|
+
"consumes": {
|
|
761
|
+
"model": [],
|
|
762
|
+
"code": []
|
|
763
|
+
},
|
|
764
|
+
"output": {
|
|
765
|
+
"mayBeLarge": false,
|
|
766
|
+
"boundBy": []
|
|
767
|
+
}
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "mentions.add",
|
|
771
|
+
"toolName": "mentions_add",
|
|
772
|
+
"description": "Deliver unreached @mentions by adding each mentioned target to the conversation, so they see the message and what follows. Takes resolutionId values from mentions.pending.",
|
|
773
|
+
"inputSchema": {
|
|
774
|
+
"type": "object",
|
|
775
|
+
"properties": {
|
|
776
|
+
"resolutionIds": {
|
|
777
|
+
"type": "array",
|
|
778
|
+
"description": "resolutionId values from mentions.pending.",
|
|
779
|
+
"items": {
|
|
780
|
+
"type": "string"
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
"required": [
|
|
785
|
+
"resolutionIds"
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
"sideEffect": "write",
|
|
789
|
+
"idempotency": {
|
|
790
|
+
"kind": "none"
|
|
791
|
+
},
|
|
792
|
+
"capability": [
|
|
793
|
+
"mentions"
|
|
794
|
+
],
|
|
795
|
+
"modelOnly": false,
|
|
796
|
+
"mayInterrupt": false,
|
|
797
|
+
"consumes": {
|
|
798
|
+
"model": [],
|
|
799
|
+
"code": []
|
|
800
|
+
},
|
|
801
|
+
"output": {
|
|
802
|
+
"mayBeLarge": false,
|
|
803
|
+
"boundBy": []
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"name": "mentions.delivery",
|
|
808
|
+
"toolName": "mentions_delivery",
|
|
809
|
+
"description": "Whether each @mention in a message you sent reached its target.",
|
|
810
|
+
"inputSchema": {
|
|
811
|
+
"type": "object",
|
|
812
|
+
"properties": {
|
|
813
|
+
"messageId": {
|
|
814
|
+
"type": "string",
|
|
815
|
+
"description": "Id of a message you sent."
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
"required": [
|
|
819
|
+
"messageId"
|
|
820
|
+
]
|
|
821
|
+
},
|
|
822
|
+
"sideEffect": "read",
|
|
823
|
+
"idempotency": {
|
|
824
|
+
"kind": "natural"
|
|
825
|
+
},
|
|
826
|
+
"capability": [
|
|
827
|
+
"mentions"
|
|
828
|
+
],
|
|
829
|
+
"modelOnly": false,
|
|
830
|
+
"mayInterrupt": false,
|
|
831
|
+
"consumes": {
|
|
832
|
+
"model": [],
|
|
833
|
+
"code": []
|
|
834
|
+
},
|
|
835
|
+
"output": {
|
|
836
|
+
"mayBeLarge": false,
|
|
837
|
+
"boundBy": []
|
|
838
|
+
}
|
|
839
|
+
},
|
|
698
840
|
{
|
|
699
841
|
"name": "mentions.execute",
|
|
700
842
|
"toolName": "mentions_execute",
|
|
701
|
-
"description": "Deliver unreached @mentions: notify the mentioned target, or add them to the conversation.",
|
|
843
|
+
"description": "Deprecated: use mentions.notify / mentions.add. Removed in the next minor release. Deliver unreached @mentions: notify the mentioned target, or add them to the conversation.",
|
|
702
844
|
"inputSchema": {
|
|
703
845
|
"type": "object",
|
|
704
846
|
"properties": {
|
|
@@ -739,12 +881,13 @@
|
|
|
739
881
|
"output": {
|
|
740
882
|
"mayBeLarge": false,
|
|
741
883
|
"boundBy": []
|
|
742
|
-
}
|
|
884
|
+
},
|
|
885
|
+
"deprecated": true
|
|
743
886
|
},
|
|
744
887
|
{
|
|
745
888
|
"name": "mentions.deliveries",
|
|
746
889
|
"toolName": "mentions_deliveries",
|
|
747
|
-
"description": "Whether each @mention in a message you sent reached its target.",
|
|
890
|
+
"description": "Deprecated: use mentions.delivery. Removed in the next minor release. Whether each @mention in a message you sent reached its target.",
|
|
748
891
|
"inputSchema": {
|
|
749
892
|
"type": "object",
|
|
750
893
|
"properties": {
|
|
@@ -773,7 +916,8 @@
|
|
|
773
916
|
"output": {
|
|
774
917
|
"mayBeLarge": false,
|
|
775
918
|
"boundBy": []
|
|
776
|
-
}
|
|
919
|
+
},
|
|
920
|
+
"deprecated": true
|
|
777
921
|
},
|
|
778
922
|
{
|
|
779
923
|
"name": "actions.prepare",
|
|
@@ -1950,6 +2094,10 @@
|
|
|
1950
2094
|
"joined": {
|
|
1951
2095
|
"type": "boolean",
|
|
1952
2096
|
"description": "channels view only: only channels you have joined."
|
|
2097
|
+
},
|
|
2098
|
+
"query": {
|
|
2099
|
+
"type": "string",
|
|
2100
|
+
"description": "channels / agents / humans view only: keep rows whose name, description, or other visible text contains this (case-insensitive)."
|
|
1953
2101
|
}
|
|
1954
2102
|
}
|
|
1955
2103
|
},
|