@botiverse/raft-sdk 0.8.0 → 0.10.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 +71 -6
- package/dist/cjs/index.cjs +862 -433
- package/dist/esm/index.js +862 -434
- package/dist/index.d.ts +150 -7
- package/operations.json +51 -3
- 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 {
|
|
@@ -878,6 +901,19 @@ interface CreateTasksRequest {
|
|
|
878
901
|
}>;
|
|
879
902
|
/** `@handle`; yourself to start in_progress, or (owner/admin) someone else to reserve a todo. */
|
|
880
903
|
assignee?: string;
|
|
904
|
+
/**
|
|
905
|
+
* One key per logical create. Generated with `crypto.randomUUID()` when
|
|
906
|
+
* omitted and returned as `data.idempotencyKey` (and, on a retryable
|
|
907
|
+
* failure, as `next.args.idempotencyKey`). Repeating the same request with
|
|
908
|
+
* the same key returns the first result (same task numbers) and creates
|
|
909
|
+
* nothing; the same key with a different request fails with
|
|
910
|
+
* `IDEMPOTENCY_KEY_REUSED`. A key is valid for 24 hours: retry within that
|
|
911
|
+
* window; after it the Server forgets the key and the same request creates
|
|
912
|
+
* again. The SDK never retries on its own: Servers
|
|
913
|
+
* without keyed task create ignore the key, and a repeat there creates the
|
|
914
|
+
* tasks again.
|
|
915
|
+
*/
|
|
916
|
+
idempotencyKey?: string;
|
|
881
917
|
}
|
|
882
918
|
export declare const createTasksRequestSchema: z.ZodObject<{
|
|
883
919
|
target: z.ZodString;
|
|
@@ -886,9 +922,12 @@ export declare const createTasksRequestSchema: z.ZodObject<{
|
|
|
886
922
|
createsResource: z.ZodOptional<z.ZodBoolean>;
|
|
887
923
|
}, z.core.$strip>>;
|
|
888
924
|
assignee: z.ZodOptional<z.ZodString>;
|
|
925
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
889
926
|
}, z.core.$strip>;
|
|
890
927
|
type RaftTasksCreated = AgentApiTaskCreateResponse & {
|
|
891
928
|
target: string;
|
|
929
|
+
/** The key this create was sent with (the caller's, or the generated one). */
|
|
930
|
+
idempotencyKey: string;
|
|
892
931
|
};
|
|
893
932
|
interface TaskRef {
|
|
894
933
|
target: string;
|
|
@@ -1087,6 +1126,8 @@ interface ServerInfoRequest {
|
|
|
1087
1126
|
limit?: number;
|
|
1088
1127
|
/** Channels only: restrict to joined channels. */
|
|
1089
1128
|
joined?: boolean;
|
|
1129
|
+
/** Sections only: keep rows whose visible text contains this (case-insensitive), like the CLI's `--query`. */
|
|
1130
|
+
query?: string;
|
|
1090
1131
|
}
|
|
1091
1132
|
export declare const serverInfoRequestSchema: z.ZodObject<{
|
|
1092
1133
|
view: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1099,6 +1140,7 @@ export declare const serverInfoRequestSchema: z.ZodObject<{
|
|
|
1099
1140
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
1100
1141
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1101
1142
|
joined: z.ZodOptional<z.ZodBoolean>;
|
|
1143
|
+
query: z.ZodOptional<z.ZodString>;
|
|
1102
1144
|
}, z.core.$strip>;
|
|
1103
1145
|
export declare const showProfileRequestSchema: z.ZodObject<{
|
|
1104
1146
|
target: z.ZodOptional<z.ZodString>;
|
|
@@ -1152,6 +1194,9 @@ export declare const attachmentCommentsRequestSchema: z.ZodObject<{
|
|
|
1152
1194
|
attachmentId: z.ZodString;
|
|
1153
1195
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1154
1196
|
}, z.core.$strip>;
|
|
1197
|
+
export declare const downloadAttachmentUrlRequestSchema: z.ZodObject<{
|
|
1198
|
+
attachmentId: z.ZodString;
|
|
1199
|
+
}, z.core.$strip>;
|
|
1155
1200
|
/** Explicit type wins; otherwise sniff the bytes, then the filename extension, then octet-stream. */
|
|
1156
1201
|
export declare function inferAttachmentMimeType(filename: string, bytes: Uint8Array, explicit?: string | null): string;
|
|
1157
1202
|
interface UploadAttachmentRequest {
|
|
@@ -1170,6 +1215,8 @@ interface RaftAttachmentBytes {
|
|
|
1170
1215
|
attachmentId: string;
|
|
1171
1216
|
bytes: Uint8Array;
|
|
1172
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">;
|
|
1173
1220
|
//#endregion
|
|
1174
1221
|
//#region ../shared/src/agentOps/search.d.ts
|
|
1175
1222
|
interface SearchMessagesRequest {
|
|
@@ -1330,6 +1377,15 @@ export declare function parseRaftState(value: unknown): RaftState | null;
|
|
|
1330
1377
|
export declare function hashRaftSendContent(target: string, content: string, attachmentIds?: readonly string[]): Promise<string>;
|
|
1331
1378
|
//#endregion
|
|
1332
1379
|
//#region ../shared/src/agentOps/actions.d.ts
|
|
1380
|
+
/**
|
|
1381
|
+
* `idempotencyKey`: one key per logical prepare. Generated with
|
|
1382
|
+
* `crypto.randomUUID()` when omitted and returned as `data.idempotencyKey`
|
|
1383
|
+
* (and, on a retryable failure, as `next.args.idempotencyKey`). Repeating the
|
|
1384
|
+
* same request with the same key returns the first card (same `messageId`)
|
|
1385
|
+
* and posts nothing; the same key with a different request fails with
|
|
1386
|
+
* `IDEMPOTENCY_KEY_REUSED`. A key is valid for 24 hours; after that the
|
|
1387
|
+
* Server forgets it. Servers without keyed prepare ignore the key.
|
|
1388
|
+
*/
|
|
1333
1389
|
type PrepareActionCardRequest = AgentApiActionPrepareBody;
|
|
1334
1390
|
/**
|
|
1335
1391
|
* The Agent API's own body schema (a discriminated union over the card
|
|
@@ -1412,11 +1468,14 @@ export declare const prepareActionCardRequestSchema: import("zod").ZodObject<{
|
|
|
1412
1468
|
targetAgent: import("zod").ZodString;
|
|
1413
1469
|
draftHint: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1414
1470
|
}, import("zod/v4/core").$strip>], "type">;
|
|
1471
|
+
idempotencyKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1415
1472
|
}, import("zod/v4/core").$loose>;
|
|
1416
1473
|
interface RaftPreparedCard {
|
|
1417
1474
|
target: string;
|
|
1418
1475
|
/** The card message; a human commits it by clicking its action verb. */
|
|
1419
1476
|
messageId: string;
|
|
1477
|
+
/** The key this prepare was sent with (the caller's `idempotencyKey`, or the generated one). */
|
|
1478
|
+
idempotencyKey: string;
|
|
1420
1479
|
}
|
|
1421
1480
|
//#endregion
|
|
1422
1481
|
//#region ../shared/src/agentApiRawClient.d.ts
|
|
@@ -1967,6 +2026,18 @@ declare const agentApiChannelLifecycleBodySchema: z.ZodObject<{
|
|
|
1967
2026
|
declare const agentApiAttachmentDownloadParamsSchema: z.ZodObject<{
|
|
1968
2027
|
attachmentId: z.ZodString;
|
|
1969
2028
|
}, z.core.$loose>;
|
|
2029
|
+
/**
|
|
2030
|
+
* Short-lived download URL for an attachment visible to the bound agent
|
|
2031
|
+
* credential (`GET /attachments/:attachmentId/url`). For runtimes that cannot
|
|
2032
|
+
* take binary tool results: the agent fetches the bytes itself from `url`
|
|
2033
|
+
* before `expiresAt`. The URL is a bearer capability; never log it.
|
|
2034
|
+
*/
|
|
2035
|
+
declare const agentApiAttachmentDownloadUrlResponseSchema: z.ZodObject<{
|
|
2036
|
+
url: z.ZodString;
|
|
2037
|
+
expiresAt: z.ZodString;
|
|
2038
|
+
filename: z.ZodString;
|
|
2039
|
+
mimeType: z.ZodString;
|
|
2040
|
+
}, z.core.$loose>;
|
|
1970
2041
|
declare const agentApiAttachmentCommentsParamsSchema: z.ZodObject<{
|
|
1971
2042
|
attachmentId: z.ZodString;
|
|
1972
2043
|
}, z.core.$loose>;
|
|
@@ -2112,6 +2183,7 @@ declare const agentApiTaskCreateBodySchema: z.ZodObject<{
|
|
|
2112
2183
|
creates_resource: z.ZodOptional<z.ZodBoolean>;
|
|
2113
2184
|
}, z.core.$loose>>;
|
|
2114
2185
|
assignee: z.ZodOptional<z.ZodString>;
|
|
2186
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
2115
2187
|
}, z.core.$loose>;
|
|
2116
2188
|
declare const agentApiTaskUnclaimBodySchema: z.ZodObject<{
|
|
2117
2189
|
channel: z.ZodString;
|
|
@@ -2393,6 +2465,7 @@ declare const agentApiActionPrepareBodySchema: z.ZodObject<{
|
|
|
2393
2465
|
targetAgent: z.ZodString;
|
|
2394
2466
|
draftHint: z.ZodOptional<z.ZodString>;
|
|
2395
2467
|
}, z.core.$strip>], "type">;
|
|
2468
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
2396
2469
|
}, z.core.$loose>;
|
|
2397
2470
|
declare const agentApiServerUpdateBodySchema: z.ZodObject<{
|
|
2398
2471
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -6151,6 +6224,7 @@ declare const agentApiContract: {
|
|
|
6151
6224
|
creates_resource: z.ZodOptional<z.ZodBoolean>;
|
|
6152
6225
|
}, z.core.$loose>>;
|
|
6153
6226
|
assignee: z.ZodOptional<z.ZodString>;
|
|
6227
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
6154
6228
|
}, z.core.$loose>;
|
|
6155
6229
|
};
|
|
6156
6230
|
readonly response: {
|
|
@@ -7993,6 +8067,7 @@ declare const agentApiContract: {
|
|
|
7993
8067
|
targetAgent: z.ZodString;
|
|
7994
8068
|
draftHint: z.ZodOptional<z.ZodString>;
|
|
7995
8069
|
}, z.core.$strip>], "type">;
|
|
8070
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
7996
8071
|
}, z.core.$loose>;
|
|
7997
8072
|
};
|
|
7998
8073
|
readonly response: {
|
|
@@ -8233,6 +8308,32 @@ declare const agentApiContract: {
|
|
|
8233
8308
|
} & {
|
|
8234
8309
|
fullPath: string;
|
|
8235
8310
|
};
|
|
8311
|
+
readonly attachmentDownloadUrl: {
|
|
8312
|
+
readonly key: "attachmentDownloadUrl";
|
|
8313
|
+
readonly method: "GET";
|
|
8314
|
+
readonly path: "/attachments/:attachmentId/url";
|
|
8315
|
+
readonly client: {
|
|
8316
|
+
readonly resource: "attachments";
|
|
8317
|
+
readonly method: "downloadUrl";
|
|
8318
|
+
};
|
|
8319
|
+
readonly capability: "read";
|
|
8320
|
+
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.";
|
|
8321
|
+
readonly request: {
|
|
8322
|
+
readonly params: z.ZodObject<{
|
|
8323
|
+
attachmentId: z.ZodString;
|
|
8324
|
+
}, z.core.$loose>;
|
|
8325
|
+
};
|
|
8326
|
+
readonly response: {
|
|
8327
|
+
readonly body: z.ZodObject<{
|
|
8328
|
+
url: z.ZodString;
|
|
8329
|
+
expiresAt: z.ZodString;
|
|
8330
|
+
filename: z.ZodString;
|
|
8331
|
+
mimeType: z.ZodString;
|
|
8332
|
+
}, z.core.$loose>;
|
|
8333
|
+
};
|
|
8334
|
+
} & {
|
|
8335
|
+
fullPath: string;
|
|
8336
|
+
};
|
|
8236
8337
|
readonly attachmentCommentsList: {
|
|
8237
8338
|
readonly key: "attachmentCommentsList";
|
|
8238
8339
|
readonly method: "GET";
|
|
@@ -8485,6 +8586,7 @@ type AgentApiAttachmentUploadSessionCreateResponse = z.infer<typeof createAttach
|
|
|
8485
8586
|
type AgentApiAttachmentUploadSessionCompleteResponse = z.infer<typeof completeAttachmentUploadSessionResponseSchema>;
|
|
8486
8587
|
type AgentApiAttachmentUploadSessionResponse = z.infer<typeof attachmentUploadSessionSchema>;
|
|
8487
8588
|
type AgentApiAttachmentDownloadResponse = Uint8Array;
|
|
8589
|
+
type AgentApiAttachmentDownloadUrlResponse = z.infer<typeof agentApiAttachmentDownloadUrlResponseSchema>;
|
|
8488
8590
|
interface AgentApiEventsInboxHint {
|
|
8489
8591
|
unread_conversations: number;
|
|
8490
8592
|
command: "raft inbox check";
|
|
@@ -8677,6 +8779,7 @@ type AgentApiRequestParamsByRoute = {
|
|
|
8677
8779
|
messageReactionAdd: AgentApiMessageReactionParams;
|
|
8678
8780
|
messageReactionRemove: AgentApiMessageReactionParams;
|
|
8679
8781
|
attachmentDownload: AgentApiAttachmentDownloadParams;
|
|
8782
|
+
attachmentDownloadUrl: AgentApiAttachmentDownloadParams;
|
|
8680
8783
|
attachmentCommentsList: AgentApiAttachmentCommentsParams;
|
|
8681
8784
|
channelJoin: AgentApiChannelMembershipParams;
|
|
8682
8785
|
channelLeave: AgentApiChannelMembershipParams;
|
|
@@ -8757,6 +8860,7 @@ type AgentApiRequestQueryByRoute = {
|
|
|
8757
8860
|
messageReactionAdd: never;
|
|
8758
8861
|
messageReactionRemove: never;
|
|
8759
8862
|
attachmentDownload: never;
|
|
8863
|
+
attachmentDownloadUrl: never;
|
|
8760
8864
|
attachmentCommentsList: AgentApiAttachmentCommentsQuery;
|
|
8761
8865
|
channelJoin: never;
|
|
8762
8866
|
channelLeave: never;
|
|
@@ -8837,6 +8941,7 @@ type AgentApiRequestBodyByRoute = {
|
|
|
8837
8941
|
messageReactionAdd: AgentApiMessageReactionBody;
|
|
8838
8942
|
messageReactionRemove: AgentApiMessageReactionBody;
|
|
8839
8943
|
attachmentDownload: never;
|
|
8944
|
+
attachmentDownloadUrl: never;
|
|
8840
8945
|
attachmentCommentsList: never;
|
|
8841
8946
|
channelJoin: never;
|
|
8842
8947
|
channelLeave: never;
|
|
@@ -8917,6 +9022,7 @@ type AgentApiResponseByRoute = {
|
|
|
8917
9022
|
messageReactionAdd: AgentApiMessageEnvelope;
|
|
8918
9023
|
messageReactionRemove: AgentApiMessageEnvelope;
|
|
8919
9024
|
attachmentDownload: AgentApiAttachmentDownloadResponse;
|
|
9025
|
+
attachmentDownloadUrl: AgentApiAttachmentDownloadUrlResponse;
|
|
8920
9026
|
attachmentCommentsList: AgentApiAttachmentCommentsResponse;
|
|
8921
9027
|
channelJoin: AgentApiOkResponse;
|
|
8922
9028
|
channelLeave: AgentApiOkResponse;
|
|
@@ -9764,6 +9870,21 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
9764
9870
|
mayBeLarge: false;
|
|
9765
9871
|
boundBy: never[];
|
|
9766
9872
|
};
|
|
9873
|
+
}, {
|
|
9874
|
+
readonly name: "attachments.downloadUrl";
|
|
9875
|
+
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.";
|
|
9876
|
+
readonly schema: z.ZodObject<{
|
|
9877
|
+
attachmentId: z.ZodString;
|
|
9878
|
+
}, z.core.$strip>;
|
|
9879
|
+
readonly routes: readonly ["attachmentDownloadUrl"];
|
|
9880
|
+
readonly consumes: {
|
|
9881
|
+
model: never[];
|
|
9882
|
+
code: never[];
|
|
9883
|
+
};
|
|
9884
|
+
readonly output: {
|
|
9885
|
+
mayBeLarge: false;
|
|
9886
|
+
boundBy: never[];
|
|
9887
|
+
};
|
|
9767
9888
|
}, {
|
|
9768
9889
|
readonly name: "attachments.comments";
|
|
9769
9890
|
readonly description: "List the comments on an attachment.";
|
|
@@ -9908,12 +10029,15 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
9908
10029
|
targetAgent: z.ZodString;
|
|
9909
10030
|
draftHint: z.ZodOptional<z.ZodString>;
|
|
9910
10031
|
}, z.core.$strip>], "type">;
|
|
10032
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
9911
10033
|
}, z.core.$loose>;
|
|
9912
10034
|
readonly fieldDescriptions: {
|
|
9913
10035
|
readonly target: "Conversation to post the card in: `#channel`, `dm:@peer`, or a thread.";
|
|
9914
10036
|
readonly action: "The operation the card proposes: `type` picks it, and the other fields apply per type as described.";
|
|
10037
|
+
readonly idempotencyKey: "One key per logical prepare; generated when omitted and returned. Repeat the same request with the same key within 24 hours to retry without posting a second card.";
|
|
9915
10038
|
};
|
|
9916
10039
|
readonly routes: readonly ["actionPrepare"];
|
|
10040
|
+
readonly idempotencyArg: "idempotencyKey";
|
|
9917
10041
|
readonly consumes: {
|
|
9918
10042
|
model: never[];
|
|
9919
10043
|
code: never[];
|
|
@@ -10009,8 +10133,10 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
10009
10133
|
createsResource: z.ZodOptional<z.ZodBoolean>;
|
|
10010
10134
|
}, z.core.$strip>>;
|
|
10011
10135
|
assignee: z.ZodOptional<z.ZodString>;
|
|
10136
|
+
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
10012
10137
|
}, z.core.$strip>;
|
|
10013
10138
|
readonly routes: readonly ["taskCreate"];
|
|
10139
|
+
readonly idempotencyArg: "idempotencyKey";
|
|
10014
10140
|
readonly consumes: {
|
|
10015
10141
|
model: never[];
|
|
10016
10142
|
code: never[];
|
|
@@ -10310,6 +10436,7 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
10310
10436
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
10311
10437
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
10312
10438
|
joined: z.ZodOptional<z.ZodBoolean>;
|
|
10439
|
+
query: z.ZodOptional<z.ZodString>;
|
|
10313
10440
|
}, z.core.$strip>;
|
|
10314
10441
|
readonly routes: readonly ["serverInfo"];
|
|
10315
10442
|
readonly consumes: {
|
|
@@ -10377,8 +10504,6 @@ declare const OPERATION_DEFS: readonly [{
|
|
|
10377
10504
|
}];
|
|
10378
10505
|
/** The dotted name of every operation in the manifest (the `invoke` key). */
|
|
10379
10506
|
type RaftOperationName = (typeof OPERATION_DEFS)[number]["name"];
|
|
10380
|
-
/** `tasks.updateStatus` → `tasks_update_status`. */
|
|
10381
|
-
export declare function raftToolNameFor(name: string): string;
|
|
10382
10507
|
/** Every agent operation on `createRaft`, in a stable order. */
|
|
10383
10508
|
export declare const RAFT_OPERATIONS: readonly RaftOperationSpec[];
|
|
10384
10509
|
/** Content hash of `RAFT_OPERATIONS` (16 hex digits); changes whenever any field of any operation changes. */
|
|
@@ -10423,6 +10548,15 @@ interface CreateRaftOptions {
|
|
|
10423
10548
|
state?: RaftStateStore;
|
|
10424
10549
|
/** Called when loading or saving the state fails or is rejected as stale. */
|
|
10425
10550
|
onStateSaveError?: RaftStateSaveErrorHandler;
|
|
10551
|
+
/**
|
|
10552
|
+
* How "do this next" hints render in every outcome's `text` and
|
|
10553
|
+
* `next.command`. `cli` (default): the `raft …` command, exactly as the CLI
|
|
10554
|
+
* prints it. `tool`: the operation as a tool call, `messages_read({ target:
|
|
10555
|
+
* "#ops" })`, for runtimes that hand operations to the model as tools
|
|
10556
|
+
* (required arguments the model supplies show as `content: …`). Either way
|
|
10557
|
+
* `next.operation` carries the structured call.
|
|
10558
|
+
*/
|
|
10559
|
+
hints?: RaftHintStyle;
|
|
10426
10560
|
}
|
|
10427
10561
|
interface RaftInboxCommitResult {
|
|
10428
10562
|
/** The committed cursor, or null when there was nothing to commit. */
|
|
@@ -10531,6 +10665,15 @@ interface Raft {
|
|
|
10531
10665
|
download(request: {
|
|
10532
10666
|
attachmentId: string;
|
|
10533
10667
|
}): Promise<RaftOutcome<RaftAttachmentBytes, "downloaded">>;
|
|
10668
|
+
/**
|
|
10669
|
+
* A short-lived (5 minute) URL for the bytes, for runtimes whose tools
|
|
10670
|
+
* cannot return binary data; fetch it yourself before `expiresAt` and do
|
|
10671
|
+
* not log it. A Server that cannot presign fails with `CONFLICT`
|
|
10672
|
+
* (`download_url_unavailable`) and `next` pointing at `download`.
|
|
10673
|
+
*/
|
|
10674
|
+
downloadUrl(request: {
|
|
10675
|
+
attachmentId: string;
|
|
10676
|
+
}): Promise<RaftOutcome<RaftAttachmentDownloadUrl, "url">>;
|
|
10534
10677
|
comments(request: {
|
|
10535
10678
|
attachmentId: string;
|
|
10536
10679
|
limit?: number;
|
|
@@ -10686,4 +10829,4 @@ export declare const commitInboxRequestSchema: z.ZodObject<{
|
|
|
10686
10829
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10687
10830
|
}, z.core.$strip>;
|
|
10688
10831
|
//#endregion
|
|
10689
|
-
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 };
|
|
10832
|
+
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, 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, 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": "4e70c891e417cd51",
|
|
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",
|
|
@@ -961,6 +995,10 @@
|
|
|
961
995
|
"type"
|
|
962
996
|
],
|
|
963
997
|
"description": "The operation the card proposes: `type` picks it, and the other fields apply per type as described."
|
|
998
|
+
},
|
|
999
|
+
"idempotencyKey": {
|
|
1000
|
+
"type": "string",
|
|
1001
|
+
"description": "One key per logical prepare; generated when omitted and returned. Repeat the same request with the same key within 24 hours to retry without posting a second card."
|
|
964
1002
|
}
|
|
965
1003
|
},
|
|
966
1004
|
"required": [
|
|
@@ -970,7 +1008,8 @@
|
|
|
970
1008
|
},
|
|
971
1009
|
"sideEffect": "write",
|
|
972
1010
|
"idempotency": {
|
|
973
|
-
"kind": "
|
|
1011
|
+
"kind": "key",
|
|
1012
|
+
"arg": "idempotencyKey"
|
|
974
1013
|
},
|
|
975
1014
|
"capability": [
|
|
976
1015
|
"tasks"
|
|
@@ -1218,6 +1257,10 @@
|
|
|
1218
1257
|
"assignee": {
|
|
1219
1258
|
"type": "string",
|
|
1220
1259
|
"description": "`@handle`: yourself to start in_progress, or (owner/admin) someone else to reserve a todo."
|
|
1260
|
+
},
|
|
1261
|
+
"idempotencyKey": {
|
|
1262
|
+
"type": "string",
|
|
1263
|
+
"description": "One key per logical create; generated when omitted and returned. Repeat the same request with the same key within 24 hours to retry without creating the tasks twice."
|
|
1221
1264
|
}
|
|
1222
1265
|
},
|
|
1223
1266
|
"required": [
|
|
@@ -1227,7 +1270,8 @@
|
|
|
1227
1270
|
},
|
|
1228
1271
|
"sideEffect": "write",
|
|
1229
1272
|
"idempotency": {
|
|
1230
|
-
"kind": "
|
|
1273
|
+
"kind": "key",
|
|
1274
|
+
"arg": "idempotencyKey"
|
|
1231
1275
|
},
|
|
1232
1276
|
"capability": [
|
|
1233
1277
|
"tasks"
|
|
@@ -1940,6 +1984,10 @@
|
|
|
1940
1984
|
"joined": {
|
|
1941
1985
|
"type": "boolean",
|
|
1942
1986
|
"description": "channels view only: only channels you have joined."
|
|
1987
|
+
},
|
|
1988
|
+
"query": {
|
|
1989
|
+
"type": "string",
|
|
1990
|
+
"description": "channels / agents / humans view only: keep rows whose name, description, or other visible text contains this (case-insensitive)."
|
|
1943
1991
|
}
|
|
1944
1992
|
}
|
|
1945
1993
|
},
|