@botiverse/raft-sdk 0.4.1 → 0.6.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 +3 -8
- package/dist/index.d.ts +2 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,9 +182,8 @@ if (!signal.ok) return new Response(signal.message, { status: 401 });
|
|
|
182
182
|
|
|
183
183
|
When a call needs the model to decide (today: newer messages arrived in the
|
|
184
184
|
conversation a send, claim or task write targets), it returns
|
|
185
|
-
`{ ok: true, state: "interrupted", interrupt, next, text }
|
|
186
|
-
|
|
187
|
-
gateway can handle it without knowing the command (`isInterrupted(outcome)`):
|
|
185
|
+
`{ ok: true, state: "interrupted", interrupt, next, text }` (narrow with
|
|
186
|
+
`isInterrupted(outcome)`):
|
|
188
187
|
|
|
189
188
|
```ts
|
|
190
189
|
interface RaftInterrupt {
|
|
@@ -203,8 +202,7 @@ interface RaftInterrupt {
|
|
|
203
202
|
}
|
|
204
203
|
```
|
|
205
204
|
|
|
206
|
-
- A held send run as a command (
|
|
207
|
-
which store the draft): `resume.argv` is
|
|
205
|
+
- A held send run as a `raft` CLI command (which stores the draft): `resume.argv` is
|
|
208
206
|
`["message", "send", "--send-draft", "--target", T, "--expected-draft-key", K]`
|
|
209
207
|
with `resume.idempotencyKey` = `K`, the original key; `cancel.argv` is the
|
|
210
208
|
same with `--discard-draft`, which clears the saved draft only if it still
|
|
@@ -223,9 +221,6 @@ interface RaftInterrupt {
|
|
|
223
221
|
- An absent `resume.argv` means: call the same SDK method again with the same
|
|
224
222
|
input and `resume.idempotencyKey`. Present argv are the exact command form a
|
|
225
223
|
gateway hands to the model.
|
|
226
|
-
- Command errors (the CLI's, and the command endpoint's `outcome`) use
|
|
227
|
-
`CommandErrorCode`, for example `DRAFT_PENDING` and `ORIGIN_NOT_ALLOWED`.
|
|
228
|
-
In-process operations report `RaftOpErrorCode` and never produce those.
|
|
229
224
|
|
|
230
225
|
Failures are outcomes too (`ok: false`) with a stable `error.code`, the
|
|
231
226
|
Server's `serverCode` when it sent one, `nextAction`, and `retryable`; raw
|
package/dist/index.d.ts
CHANGED
|
@@ -433,7 +433,7 @@ interface RaftInterruptResume {
|
|
|
433
433
|
/**
|
|
434
434
|
* The exact `raft` argv that carries out the interrupted call (for example
|
|
435
435
|
* `["message", "send", "--send-draft", …]`), when the call ran as a command
|
|
436
|
-
* (
|
|
436
|
+
* (the `raft` CLI) and its input is stored. Absent for an
|
|
437
437
|
* in-process SDK call: then resuming means calling the same SDK method again
|
|
438
438
|
* with the same input and `idempotencyKey`.
|
|
439
439
|
*/
|
|
@@ -9256,7 +9256,4 @@ interface Raft {
|
|
|
9256
9256
|
}
|
|
9257
9257
|
export declare function createRaft(options: CreateRaftOptions): Raft;
|
|
9258
9258
|
//#endregion
|
|
9259
|
-
|
|
9260
|
-
type CommandErrorCode = "MISSING_AGENT_ID" | "MISSING_SERVER_URL" | "MISSING_AGENT_PROXY_URL" | "MULTIPLE_AGENT_PROXY_TOKENS" | "MISSING_AGENT_PROXY_TOKEN" | "MISSING_TOKEN" | "CHECK_FAILED" | "ARCHIVE_FAILED" | "AMEND_FAILED" | "COMMENTS_FAILED" | "CREATE_FAILED" | "RECEIPT_FAILED" | "INBOX_CHECK_FAILED" | "INBOX_UNAVAILABLE" | "ORIGIN_NOT_ALLOWED" | "TOKEN_FILE_UNREADABLE" | "TOKEN_FILE_EMPTY" | "PROFILE_FILE_UNREADABLE" | "PROFILE_FILE_INVALID" | "PROFILE_MANAGED_CONTEXT_CONFLICT" | "MANAGED_WRAPPER_UNAVAILABLE" | "MANAGED_WRAPPER_REQUIRED" | "MANAGED_WRAPPER_FORWARD_FAILED" | "BRIDGE_EXPECTED_AGENT_REQUIRED" | "BRIDGE_IDENTITY_MISMATCH" | "SEND_HELD_AS_DRAFT" | "SEND_HELD" | "GUIDANCE_DELIVERED" | "SEND_DRAFT_NOT_FOUND" | "SEND_DRAFT_EXPIRED" | "SAVED_DRAFT_IDENTITY_CHANGED" | "DRAFT_PENDING" | "THREAD_CONTEXT_TARGET_CONFIRMATION_REQUIRED" | "INVALID_ARG" | "INVALID_SCOPE" | "INVALID_TARGET" | "INVALID_JSON_RESPONSE" | "IDENTITY_MISMATCH" | "PROMPT_UNAVAILABLE" | "WHOAMI_FAILED" | "INFO_FAILED" | "INTEGRATION_SESSION_HANDOFF_FAILED" | "HISTORY_FAILED" | "JOIN_FAILED" | "KNOWLEDGE_GET_FAILED" | "KNOWLEDGE_SEARCH_FAILED" | "KNOWLEDGE_CONTEXT_INVALID" | "LEAVE_FAILED" | "LIST_FAILED" | "MEMBERS_FAILED" | "MUTE_FAILED" | "MENTION_ACTION_FAILED" | "MENTION_DELIVERY_FAILED" | "AMBIGUOUS_ID" | "BRIDGE_ALREADY_RUNNING" | "BRIDGE_WAKE_HINTS_FAILED" | "BRIDGE_WAKE_STREAM_FAILED" | "BRIDGE_WAKE_STREAM_UNAVAILABLE" | "BRIDGE_ACTIVITY_DRAIN_FAILED" | "BRIDGE_ACTIVITY_FORWARD_FAILED" | "BRIDGE_REQUIRES_PROFILE" | "NOT_FOUND" | "PROFILE_SHOW_FAILED" | "READ_FAILED" | "SEARCH_FAILED" | "SCOPE_DENIED" | "QUERY_TOO_BROAD" | "SEARCH_TIMEOUT" | "SEARCH_UNAVAILABLE" | "SERVER_5XX" | "PROXY_5XX" | "UNFOLLOW_FAILED" | "UNARCHIVE_FAILED" | "UNMUTE_FAILED" | "UNCLAIM_FAILED" | "CLAIM_FAILED" | "CLAIM_CONFLICT" | "ASSIGN_FAILED" | "DELETE_FAILED" | "CONVERT_FAILED" | "UPDATE_FAILED" | "VIEW_FAILED" | "VERSION_UNAVAILABLE" | "WAIT_FAILED" | "LOCAL_WRITE_FAILED" | "LOCAL_WRITE_SOURCE_FAILED" | "LOCAL_WRITE_DESTINATION_FAILED" | "LOCAL_WRITE_PARTIAL_FAILED" | "LOCAL_WRITE_POST_COMMIT_FAILED" | "LOCAL_WRITE_SIZE_EXCEEDED" | "INTERNAL_BUG" | "knowledge_agent_missing" | "knowledge_internal_error" | "knowledge_intent_invalid" | "knowledge_language_unsupported" | "knowledge_not_found" | "knowledge_query_invalid" | "knowledge_reason_invalid" | "knowledge_scope_invalid" | "knowledge_source_invalid" | "knowledge_topic_invalid" | "knowledge_trace_id_invalid" | "knowledge_turn_id_invalid" | "unsupported_capability";
|
|
9261
|
-
//#endregion
|
|
9262
|
-
export type { AmendTaskOutcome, AmendTaskRequest, AssignTaskRequest, BootstrapRaftCredentialOptions, CheckInboxOutcome, CheckInboxRequest, ClaimTasksOutcome, ClaimTasksRequest, CommandErrorCode, CreateRaftClientFromStoreOptions, CreateRaftClientOptions, CreateRaftOptions, CreateRaftRoutesOptions, CreateTasksRequest, DrainInboxRequest, ExecuteMentionActionRequest, ListInboxRequest, ListTasksRequest, ManualContext, PrepareActionCardRequest, Raft, RaftAckMode, RaftActionPrepareRequest, RaftActionPrepared, RaftApiError, RaftApiResult, RaftAppConfig, RaftAppConfigPatch, RaftAttachmentBytes, RaftAttachmentUploaded, RaftAvatarUpload, RaftChannelJoinClient, RaftChannelJoinClientResult, RaftChannelJoinError, RaftChannelJoinFailure, RaftChannelJoinOperation, RaftChannelJoinRequest, RaftChannelJoinResult, RaftChannelJoinSuccess, RaftChannelJoinTransportError, RaftChannelMuteState, RaftChannelRef, RaftClaimResult, RaftClaimRow, RaftClaimRowState, RaftClient, RaftClientError, RaftClientFailure, RaftClientResult, RaftClientSuccess, RaftClientThrottleOptions, RaftClientTransportRequest, RaftContextAgent, RaftContextData, RaftContextError, RaftContextResult, RaftContextServer, RaftCredentialErrorCode, RaftCredentialIdentity, RaftCredentialStore, RaftEvent, RaftEventAttachment, RaftEventExternalMessage, RaftEventsReceiveData, RaftEventsReceiveError, RaftEventsReceiveRequest, RaftEventsReceiveResult, RaftFailure, RaftHistoryPage, RaftInboxBatch, RaftInboxCommitResult, RaftInboxConversation, RaftInboxDrainSummary, RaftInboxListing, RaftInboxNotice, RaftInterrupt, RaftInterruptCancel, RaftInterruptReason, RaftInterruptResume, RaftInterrupted, RaftLatestReadThread, RaftManageClient, RaftMessage, RaftMessageAttachment, RaftMessageTask, RaftNextStep, RaftNoticeFlag, RaftNoticeTarget, RaftOpError, RaftOpErrorCode, 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, RaftWebhookStatus, ReactRequest, ReadHistoryRequest, ReadLatestReadThreadOptions, SearchMessagesRequest, SeenAttestation, SeenFrontierSnapshot, SendMessageOutcome, SendMessageRequest, ServerInfoRequest, ServerInfoSection, StoredRaftCredential, TaskRef, UpdateTaskStatusOutcome, UpdateTaskStatusRequest, UploadAttachmentRequest, VerifyNoticeInput, VerifyNoticeRejection, VerifyNoticeResult };
|
|
9259
|
+
export type { AmendTaskOutcome, AmendTaskRequest, AssignTaskRequest, BootstrapRaftCredentialOptions, CheckInboxOutcome, CheckInboxRequest, ClaimTasksOutcome, ClaimTasksRequest, CreateRaftClientFromStoreOptions, CreateRaftClientOptions, CreateRaftOptions, CreateRaftRoutesOptions, CreateTasksRequest, DrainInboxRequest, ExecuteMentionActionRequest, ListInboxRequest, ListTasksRequest, ManualContext, PrepareActionCardRequest, Raft, RaftAckMode, RaftActionPrepareRequest, RaftActionPrepared, RaftApiError, RaftApiResult, RaftAppConfig, RaftAppConfigPatch, RaftAttachmentBytes, RaftAttachmentUploaded, RaftAvatarUpload, RaftChannelJoinClient, RaftChannelJoinClientResult, RaftChannelJoinError, RaftChannelJoinFailure, RaftChannelJoinOperation, RaftChannelJoinRequest, RaftChannelJoinResult, RaftChannelJoinSuccess, RaftChannelJoinTransportError, RaftChannelMuteState, RaftChannelRef, RaftClaimResult, RaftClaimRow, RaftClaimRowState, RaftClient, RaftClientError, RaftClientFailure, RaftClientResult, RaftClientSuccess, RaftClientThrottleOptions, RaftClientTransportRequest, RaftContextAgent, RaftContextData, RaftContextError, RaftContextResult, RaftContextServer, RaftCredentialErrorCode, RaftCredentialIdentity, RaftCredentialStore, RaftEvent, RaftEventAttachment, RaftEventExternalMessage, RaftEventsReceiveData, RaftEventsReceiveError, RaftEventsReceiveRequest, RaftEventsReceiveResult, RaftFailure, RaftHistoryPage, RaftInboxBatch, RaftInboxCommitResult, RaftInboxConversation, RaftInboxDrainSummary, RaftInboxListing, RaftInboxNotice, RaftInterrupt, RaftInterruptCancel, RaftInterruptReason, RaftInterruptResume, RaftInterrupted, RaftLatestReadThread, RaftManageClient, RaftMessage, RaftMessageAttachment, RaftMessageTask, RaftNextStep, RaftNoticeFlag, RaftNoticeTarget, RaftOpError, RaftOpErrorCode, 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, RaftWebhookStatus, ReactRequest, ReadHistoryRequest, ReadLatestReadThreadOptions, SearchMessagesRequest, SeenAttestation, SeenFrontierSnapshot, SendMessageOutcome, SendMessageRequest, ServerInfoRequest, ServerInfoSection, StoredRaftCredential, TaskRef, UpdateTaskStatusOutcome, UpdateTaskStatusRequest, UploadAttachmentRequest, VerifyNoticeInput, VerifyNoticeRejection, VerifyNoticeResult };
|