@blade-hq/agent-client 2612.0.0-beta.82 → 2612.0.0-beta.83
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 +20 -0
- package/dist/blade-client.d.ts +4 -0
- package/dist/{chunk-FNFGLHK7.js → chunk-J5HK3PPV.js} +124 -2
- package/dist/chunk-J5HK3PPV.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -1
- package/dist/internal.js +5 -1
- package/dist/internal.js.map +1 -1
- package/dist/resources/capabilities.d.ts +14 -0
- package/dist/resources/feishu-bots.d.ts +273 -0
- package/package.json +1 -1
- package/public-api.md +308 -1
- package/dist/chunk-FNFGLHK7.js.map +0 -1
package/public-api.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
|
|
4
4
|
> 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
|
|
5
5
|
|
|
6
|
-
共
|
|
6
|
+
共 204 个公开声明。
|
|
7
7
|
|
|
8
8
|
## `AccountComputer` (interface)
|
|
9
9
|
|
|
@@ -256,10 +256,12 @@ userMessage: MountRenderer<{ message: ChatMessage; }> | undefined
|
|
|
256
256
|
auth: AuthResource
|
|
257
257
|
blob: (method: HttpMethod, path: string) => Promise<Blob>
|
|
258
258
|
buildAuthedUrl: (path: string) => string
|
|
259
|
+
capabilities: CapabilitiesResource
|
|
259
260
|
chatGroups: ChatGroupsResource
|
|
260
261
|
computers: ComputersResource
|
|
261
262
|
connectors: ConnectorsResource
|
|
262
263
|
connectToolProvider: (options: ToolProviderOptions) => ToolProvider
|
|
264
|
+
feishuBots: FeishuBotsResource
|
|
263
265
|
fetch: (method: HttpMethod, path: string, init?: BladeFetchInit, isRetry?: boolean) => Promise<Response>
|
|
264
266
|
forAnonymousSession: (sessionId: string) => BladeClient
|
|
265
267
|
formData: (method: HttpMethod, path: string, form: FormData, options?: { expectOk?: boolean; onUploadProgress?: (progress: UploadProgress) => void; }) => Promise<Response>
|
|
@@ -305,6 +307,20 @@ token: string | (() => string | null | undefined) | undefined
|
|
|
305
307
|
tokenStorage: TokenStorageMode | undefined
|
|
306
308
|
```
|
|
307
309
|
|
|
310
|
+
## `CapabilitiesResource` (class)
|
|
311
|
+
|
|
312
|
+
```ts
|
|
313
|
+
get: (options?: { signal?: AbortSignal; }) => Promise<CapabilitySnapshot>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## `CapabilitySnapshot` (interface)
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
capabilities: string[]
|
|
320
|
+
expires_at: string
|
|
321
|
+
status: "unknown" | "known"
|
|
322
|
+
```
|
|
323
|
+
|
|
308
324
|
## `ChatCompletion` (interface)
|
|
309
325
|
|
|
310
326
|
```ts
|
|
@@ -852,6 +868,297 @@ token_type: string
|
|
|
852
868
|
user: { id: string; username: string; display_name: string; avatar_url: string | null; }
|
|
853
869
|
```
|
|
854
870
|
|
|
871
|
+
## `FeishuBotArtifact` (interface)
|
|
872
|
+
|
|
873
|
+
```ts
|
|
874
|
+
artifact_id: string
|
|
875
|
+
content_type: string
|
|
876
|
+
download_path: string
|
|
877
|
+
expires_at: number | undefined
|
|
878
|
+
name: string
|
|
879
|
+
reference_scope: FeishuBotReferenceScope
|
|
880
|
+
sha256: string
|
|
881
|
+
size: number
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
## `FeishuBotAuthorizationAction` (type)
|
|
885
|
+
|
|
886
|
+
```ts
|
|
887
|
+
export type FeishuBotAuthorizationAction = "app" | "poll" | "cancel" | "check" | "finish" | "permissions" | "authorize"
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
## `FeishuBotAuthorizationOptions` (interface)
|
|
891
|
+
|
|
892
|
+
```ts
|
|
893
|
+
attempt_id: string | undefined
|
|
894
|
+
capabilities: string[] | undefined
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
## `FeishuBotConnection` (interface)
|
|
898
|
+
|
|
899
|
+
```ts
|
|
900
|
+
activation_pending: boolean | undefined
|
|
901
|
+
app_id: string | undefined
|
|
902
|
+
attempt_id: string | undefined
|
|
903
|
+
authorization_result: { status: "waiting" | "complete" | "partial" | "incomplete"; mode: "automatic" | "manual"; capabilities: string[]; missing_permissions: { scope: string; identity: "bot" | "user"; status: string; }[]; next_action: string; manual_url?: string; } | undefined
|
|
904
|
+
authorization_url: string | undefined
|
|
905
|
+
capabilities: ConnectorCapability[] | undefined
|
|
906
|
+
catalog_revision: string | undefined
|
|
907
|
+
catalog_unavailable: boolean | undefined
|
|
908
|
+
connected: boolean | undefined
|
|
909
|
+
connection_id: string
|
|
910
|
+
current_step: ConnectorAuthorizationStep | undefined
|
|
911
|
+
delivery_bound: boolean
|
|
912
|
+
domains: ConnectorDomain[] | undefined
|
|
913
|
+
enabled: boolean | undefined
|
|
914
|
+
error: ConnectorAuthorizationFailure | undefined
|
|
915
|
+
expires_at: number | undefined
|
|
916
|
+
label: string | undefined
|
|
917
|
+
operations: ConnectorCapability[] | undefined
|
|
918
|
+
permission_template: { id: string; name: string; source: string; } | undefined
|
|
919
|
+
permissions: ConnectorPermission[] | undefined
|
|
920
|
+
phase: "user" | "disconnected" | "authorization_required" | "connected" | "app" | "app_ready" | "permissions" | "expired" | "ready"
|
|
921
|
+
provider: "feishu"
|
|
922
|
+
purpose: "bot"
|
|
923
|
+
push_identity: { platform: "feishu" | "email"; connection_id: string; app_id?: string; } | undefined
|
|
924
|
+
reference_scope: { connection_id: string; app_id?: string; }
|
|
925
|
+
revision: number | undefined
|
|
926
|
+
selected_capabilities: string[] | undefined
|
|
927
|
+
steps: ConnectorAuthorizationStep[] | undefined
|
|
928
|
+
subscription_state: "paused" | "not_bound" | "enabled" | "missing" | undefined
|
|
929
|
+
trace_id: string | undefined
|
|
930
|
+
user_authorized: boolean
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
## `FeishuBotCreateMessageRequest` (interface)
|
|
934
|
+
|
|
935
|
+
```ts
|
|
936
|
+
data: { receive_id: string; msg_type: "text" | "post" | "image" | "file" | "audio" | "media" | "interactive" | "share_chat" | "share_user" | "sticker"; content: string; }
|
|
937
|
+
params: { receive_id_type: "open_id" | "chat_id"; }
|
|
938
|
+
reference_scope: FeishuBotReferenceScope
|
|
939
|
+
request_id: string
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
## `FeishuBotHistoryRequest` (interface)
|
|
943
|
+
|
|
944
|
+
```ts
|
|
945
|
+
chat_id: string
|
|
946
|
+
chat_type: "p2p" | "group"
|
|
947
|
+
page_token: string | undefined
|
|
948
|
+
reference_scope: FeishuBotReferenceScope
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
## `FeishuBotMember` (interface)
|
|
952
|
+
|
|
953
|
+
```ts
|
|
954
|
+
member_id: string
|
|
955
|
+
member_id_type: string | undefined
|
|
956
|
+
name: string | undefined
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
## `FeishuBotMessagePage` (interface)
|
|
960
|
+
|
|
961
|
+
```ts
|
|
962
|
+
has_more: boolean | undefined
|
|
963
|
+
items: FeishuBotRawMessage[]
|
|
964
|
+
page_token: string | undefined
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
## `FeishuBotMessageRequest` (interface)
|
|
968
|
+
|
|
969
|
+
```ts
|
|
970
|
+
chat_id: string
|
|
971
|
+
chat_type: "p2p" | "group"
|
|
972
|
+
message_id: string
|
|
973
|
+
reference_scope: FeishuBotReferenceScope
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
## `FeishuBotNames` (interface)
|
|
977
|
+
|
|
978
|
+
```ts
|
|
979
|
+
chats: Record<string, string>
|
|
980
|
+
senders: Record<string, string>
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
## `FeishuBotOperationResult` (interface)
|
|
984
|
+
|
|
985
|
+
```ts
|
|
986
|
+
data: T | undefined
|
|
987
|
+
error: ConnectorAuthorizationFailure | undefined
|
|
988
|
+
ok: boolean
|
|
989
|
+
outcome: "failed" | "unknown" | "partial" | "success"
|
|
990
|
+
reference_scope: FeishuBotReferenceScope
|
|
991
|
+
trace_id: string
|
|
992
|
+
warning: ConnectorAuthorizationFailure | undefined
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
## `FeishuBotPlatformResult` (interface)
|
|
996
|
+
|
|
997
|
+
```ts
|
|
998
|
+
code: number
|
|
999
|
+
data: T
|
|
1000
|
+
msg: string | undefined
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
## `FeishuBotRawMessage` (interface)
|
|
1004
|
+
|
|
1005
|
+
```ts
|
|
1006
|
+
body: { content: string; } | undefined
|
|
1007
|
+
chat_id: string | undefined
|
|
1008
|
+
create_time: string | undefined
|
|
1009
|
+
deleted: boolean | undefined
|
|
1010
|
+
mentions: { key: string; id: string; id_type: string; name: string; tenant_key?: string; }[] | undefined
|
|
1011
|
+
message_id: string
|
|
1012
|
+
msg_type: string | undefined
|
|
1013
|
+
parent_id: string | undefined
|
|
1014
|
+
root_id: string | undefined
|
|
1015
|
+
sender: { id: string; id_type: string; sender_type: string; tenant_key?: string; } | undefined
|
|
1016
|
+
thread_id: string | undefined
|
|
1017
|
+
update_time: string | undefined
|
|
1018
|
+
updated: boolean | undefined
|
|
1019
|
+
upper_message_id: string | undefined
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
## `FeishuBotReceipt` (interface)
|
|
1023
|
+
|
|
1024
|
+
```ts
|
|
1025
|
+
chat_id: string | undefined
|
|
1026
|
+
error: ConnectorAuthorizationFailure | undefined
|
|
1027
|
+
identity: "bot" | undefined
|
|
1028
|
+
message_id: string | undefined
|
|
1029
|
+
operation_id: string
|
|
1030
|
+
record_reason: string | undefined
|
|
1031
|
+
record_status: "failed" | "stored" | "unavailable" | undefined
|
|
1032
|
+
result: FeishuBotPlatformResult<T> | undefined
|
|
1033
|
+
status: "succeeded" | "unknown" | "rejected" | "retryable_rejected"
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
## `FeishuBotReceiptQuery` (type)
|
|
1037
|
+
|
|
1038
|
+
```ts
|
|
1039
|
+
export type FeishuBotReceiptQuery = FeishuBotScopedRequest & (
|
|
1040
|
+
{ operation_id: string; idempotency_key?: never; request_id?: never } |
|
|
1041
|
+
{ operation_id?: never; idempotency_key: string; request_id?: never } |
|
|
1042
|
+
{ operation_id?: never; idempotency_key?: never; request_id: string }
|
|
1043
|
+
)
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
## `FeishuBotReferenceScope` (interface)
|
|
1047
|
+
|
|
1048
|
+
```ts
|
|
1049
|
+
app_id: string
|
|
1050
|
+
connection_id: string
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
## `FeishuBotReplyRequest` (interface)
|
|
1054
|
+
|
|
1055
|
+
```ts
|
|
1056
|
+
idempotency_key: string
|
|
1057
|
+
message_id: string
|
|
1058
|
+
reference_scope: FeishuBotReferenceScope
|
|
1059
|
+
text: string
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
## `FeishuBotReplyTypedMessageRequest` (interface)
|
|
1063
|
+
|
|
1064
|
+
```ts
|
|
1065
|
+
data: Pick<{ receive_id: string; msg_type: "text" | "post" | "image" | "file" | "audio" | "media" | "interactive" | "share_chat" | "share_user" | "sticker"; content: string; }, "msg_type" | "content"> & { reply_in_thread?: boolean; }
|
|
1066
|
+
params: { message_id: string; }
|
|
1067
|
+
reference_scope: FeishuBotReferenceScope
|
|
1068
|
+
request_id: string
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1071
|
+
## `FeishuBotResourceRequest` (interface)
|
|
1072
|
+
|
|
1073
|
+
```ts
|
|
1074
|
+
chat_id: string | undefined
|
|
1075
|
+
chat_type: "p2p" | "group" | undefined
|
|
1076
|
+
file_key: string
|
|
1077
|
+
message_id: string
|
|
1078
|
+
reference_scope: FeishuBotReferenceScope
|
|
1079
|
+
type: "image" | "file"
|
|
1080
|
+
```
|
|
1081
|
+
|
|
1082
|
+
## `FeishuBotScopedRequest` (interface)
|
|
1083
|
+
|
|
1084
|
+
```ts
|
|
1085
|
+
reference_scope: FeishuBotReferenceScope
|
|
1086
|
+
```
|
|
1087
|
+
|
|
1088
|
+
## `FeishuBotSendRequest` (interface)
|
|
1089
|
+
|
|
1090
|
+
```ts
|
|
1091
|
+
chat_id: string
|
|
1092
|
+
idempotency_key: string
|
|
1093
|
+
reference_scope: FeishuBotReferenceScope
|
|
1094
|
+
text: string
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
## `FeishuBotsResource` (class)
|
|
1098
|
+
|
|
1099
|
+
```ts
|
|
1100
|
+
authorize: (id: string, action: FeishuBotAuthorizationAction, options?: FeishuBotAuthorizationOptions, init?: RequestInit) => Promise<FeishuBotConnection>
|
|
1101
|
+
bind: (id: string, pushUrl: string, init?: RequestInit) => Promise<FeishuBotConnection>
|
|
1102
|
+
create: (requestId: string, init?: RequestInit) => Promise<FeishuBotConnection>
|
|
1103
|
+
createMessage: (id: string, request: FeishuBotCreateMessageRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotReceipt>>
|
|
1104
|
+
disconnect: (id: string, init?: RequestInit) => Promise<{ disconnected: boolean; }>
|
|
1105
|
+
downloadArtifact: (id: string, artifactId: string, init?: RequestInit) => Promise<Response>
|
|
1106
|
+
downloadResource: (id: string, request: FeishuBotResourceRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotArtifact>>
|
|
1107
|
+
get: (id: string, init?: RequestInit) => Promise<FeishuBotConnection>
|
|
1108
|
+
getChatInfo: (id: string, request: FeishuBotScopedRequest & { chat_id: string; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<{ chat_id?: string; name?: string; description?: string; }>>>
|
|
1109
|
+
getDocument: (id: string, request: FeishuBotScopedRequest & { document_id: string; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<{ document: { document_id: string; title: string; revision_id?: number; }; }>>>
|
|
1110
|
+
getDocumentMetadata: (id: string, request: FeishuBotScopedRequest & { type: FeishuDocumentType; token: string; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<FeishuDocumentMetadata>>>
|
|
1111
|
+
getForwardedMessages: (id: string, request: FeishuBotMessageRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<FeishuBotMessagePage>>>
|
|
1112
|
+
getHistory: (id: string, request: FeishuBotHistoryRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<FeishuBotMessagePage>>>
|
|
1113
|
+
getMessage: (id: string, request: FeishuBotMessageRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<FeishuBotMessagePage>>>
|
|
1114
|
+
getReceipt: <T = FeishuBotRawMessage>(id: string, request: FeishuBotReceiptQuery, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotReceipt<T>>>
|
|
1115
|
+
getUserInfo: (id: string, request: FeishuBotScopedRequest & { user_id: string; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<{ user: FeishuBotUser; }>>>
|
|
1116
|
+
list: (init?: RequestInit) => Promise<{ items: FeishuBotConnection[]; }>
|
|
1117
|
+
listChatBots: (id: string, request: FeishuBotScopedRequest & { chat_id: string; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<{ items?: Array<{ app_id: string; name?: string; }>; }>>>
|
|
1118
|
+
listChatMembers: (id: string, request: FeishuBotScopedRequest & { chat_id: string; page_token?: string; page_size?: number; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotPlatformResult<{ items: FeishuBotMember[]; has_more?: boolean; page_token?: string; }>>>
|
|
1119
|
+
pause: (id: string, init?: RequestInit) => Promise<FeishuBotConnection>
|
|
1120
|
+
replyMessage: (id: string, request: FeishuBotReplyRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotReceipt>>
|
|
1121
|
+
replyTypedMessage: (id: string, request: FeishuBotReplyTypedMessageRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotReceipt>>
|
|
1122
|
+
resolveNames: (id: string, request: FeishuBotScopedRequest & { message_ids: string[]; chat_ids: string[]; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotNames>>
|
|
1123
|
+
resume: (id: string, init?: RequestInit) => Promise<FeishuBotConnection>
|
|
1124
|
+
sendMessage: (id: string, request: FeishuBotSendRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotReceipt>>
|
|
1125
|
+
uploadArtifact: (id: string, file: Blob, filename: string, requestId: string, init?: RequestInit) => Promise<FeishuBotArtifact>
|
|
1126
|
+
uploadFile: (id: string, request: FeishuBotUploadFileRequest, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotReceipt<{ file_key: string; }>>>
|
|
1127
|
+
uploadImage: (id: string, request: FeishuBotScopedRequest & { request_id: string; data: { artifact_id: string; image_type: "message"; }; }, init?: RequestInit) => Promise<FeishuBotOperationResult<FeishuBotReceipt<{ image_key: string; }>>>
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
## `FeishuBotUploadFileRequest` (interface)
|
|
1131
|
+
|
|
1132
|
+
```ts
|
|
1133
|
+
data: { artifact_id: string; file_type: "opus" | "mp4" | "pdf" | "doc" | "xls" | "ppt" | "stream"; duration?: number; }
|
|
1134
|
+
reference_scope: FeishuBotReferenceScope
|
|
1135
|
+
request_id: string
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
## `FeishuBotUser` (interface)
|
|
1139
|
+
|
|
1140
|
+
```ts
|
|
1141
|
+
en_name: string | undefined
|
|
1142
|
+
name: string | undefined
|
|
1143
|
+
open_id: string | undefined
|
|
1144
|
+
union_id: string | undefined
|
|
1145
|
+
user_id: string | undefined
|
|
1146
|
+
```
|
|
1147
|
+
|
|
1148
|
+
## `FeishuDocumentMetadata` (interface)
|
|
1149
|
+
|
|
1150
|
+
```ts
|
|
1151
|
+
failed_list: { token: string; code: number; }[] | undefined
|
|
1152
|
+
metas: { doc_token: string; doc_type: string; title: string; }[] | undefined
|
|
1153
|
+
node: { node_token: string; obj_token: string; obj_type: string; title: string; } | undefined
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
## `FeishuDocumentType` (type)
|
|
1157
|
+
|
|
1158
|
+
```ts
|
|
1159
|
+
export type FeishuDocumentType = "doc" | "docx" | "sheet" | "bitable" | "file" | "slides" | "mindnote" | "wiki"
|
|
1160
|
+
```
|
|
1161
|
+
|
|
855
1162
|
## `FileContentPart` (interface)
|
|
856
1163
|
|
|
857
1164
|
```ts
|