@leaflow/sdk 0.17.0 → 0.19.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.
|
@@ -46,6 +46,8 @@ export type GetWeixinLoginResult = operations["get-weixin-login"]["responses"][2
|
|
|
46
46
|
export type SubmitWeixinVerifyCodeResult = operations["submit-weixin-verify-code"]["responses"][200]["content"]["application/json"];
|
|
47
47
|
/** `POST /api/v1/weixin-logins/{login}/verify-code` 的请求体。 */
|
|
48
48
|
export type SubmitWeixinVerifyCodeBody = NonNullable<operations["submit-weixin-verify-code"]["requestBody"]>["content"]["application/json"];
|
|
49
|
+
/** `POST /api/v1/dynamic-calls/{call}/result` 的请求体。 */
|
|
50
|
+
export type SubmitDynamicCallResultBody = NonNullable<operations["submit-dynamic-call-result"]["requestBody"]>["content"]["application/json"];
|
|
49
51
|
/** `GET /api/v1/memories` 成功时的响应体。 */
|
|
50
52
|
export type ListMemoriesResult = operations["list-memories"]["responses"][200]["content"]["application/json"];
|
|
51
53
|
/** `GET /api/v1/models` 成功时的响应体。 */
|
|
@@ -287,6 +287,30 @@ export interface paths {
|
|
|
287
287
|
patch?: never;
|
|
288
288
|
trace?: never;
|
|
289
289
|
};
|
|
290
|
+
"/api/v1/dynamic-calls/{call}/result": {
|
|
291
|
+
parameters: {
|
|
292
|
+
query?: never;
|
|
293
|
+
header?: never;
|
|
294
|
+
path?: never;
|
|
295
|
+
cookie?: never;
|
|
296
|
+
};
|
|
297
|
+
get?: never;
|
|
298
|
+
put?: never;
|
|
299
|
+
/**
|
|
300
|
+
* Report what an action produced
|
|
301
|
+
* @description The assistant asks the client to run an action by adding a tool call to the conversation
|
|
302
|
+
* with the namespace `dynamic`; the client acts when that entry turns in_progress and reports
|
|
303
|
+
* back here.
|
|
304
|
+
*
|
|
305
|
+
* The first result is the one that counts. A later one is refused rather than replacing it.
|
|
306
|
+
*/
|
|
307
|
+
post: operations["submit-dynamic-call-result"];
|
|
308
|
+
delete?: never;
|
|
309
|
+
options?: never;
|
|
310
|
+
head?: never;
|
|
311
|
+
patch?: never;
|
|
312
|
+
trace?: never;
|
|
313
|
+
};
|
|
290
314
|
"/api/v1/memories": {
|
|
291
315
|
parameters: {
|
|
292
316
|
query?: never;
|
|
@@ -387,7 +411,7 @@ export interface paths {
|
|
|
387
411
|
head?: never;
|
|
388
412
|
/**
|
|
389
413
|
* Update conversation settings
|
|
390
|
-
* @description Changes the model, reasoning level, approval mode and archived state. A change takes effect from the next turn; a turn already running keeps the settings it started with.
|
|
414
|
+
* @description Changes the model, reasoning level, approval mode and archived state. A change takes effect from the next turn; a turn already running keeps the settings it started with. Model and reasoning level change independently: sending one leaves the other alone.
|
|
391
415
|
*/
|
|
392
416
|
patch: operations["update-thread"];
|
|
393
417
|
trace?: never;
|
|
@@ -795,6 +819,8 @@ export interface components {
|
|
|
795
819
|
models: components["schemas"]["ModelResource"][] | null;
|
|
796
820
|
};
|
|
797
821
|
ThreadSummaryResource: {
|
|
822
|
+
/** @description The tier this conversation runs at, or null when it follows the model's own default. */
|
|
823
|
+
reasoningEffort: string | null;
|
|
798
824
|
/** @enum {string} */
|
|
799
825
|
approvalMode: "guardian" | "manual" | "yolo";
|
|
800
826
|
archived: boolean;
|
|
@@ -818,6 +844,8 @@ export interface components {
|
|
|
818
844
|
approvalMode?: "guardian" | "manual" | "yolo";
|
|
819
845
|
};
|
|
820
846
|
ContextResource: {
|
|
847
|
+
/** @description The tier this conversation runs at, or null when it follows the model's own default. */
|
|
848
|
+
reasoningEffort: string | null;
|
|
821
849
|
/** Format: int64 */
|
|
822
850
|
compactAt: number | null;
|
|
823
851
|
model: string;
|
|
@@ -846,6 +874,17 @@ export interface components {
|
|
|
846
874
|
approvalReason?: string | null;
|
|
847
875
|
arguments?: string;
|
|
848
876
|
attachments?: components["schemas"]["AttachmentResource"][] | null;
|
|
877
|
+
/**
|
|
878
|
+
* @description The context blocks the client attached to this message.
|
|
879
|
+
*
|
|
880
|
+
* **Not part of what the operator wrote** — `text` is. Render the message from `text` and
|
|
881
|
+
* leave these out of the bubble; they are here so a client that did not send them, or one
|
|
882
|
+
* that reloaded, can still read what the assistant was given.
|
|
883
|
+
*
|
|
884
|
+
* The actions declared alongside them are not returned: they are re-declared as they
|
|
885
|
+
* change and would make every fetch of the conversation carry them again.
|
|
886
|
+
*/
|
|
887
|
+
clientContext?: components["schemas"]["ClientContextPart"][] | null;
|
|
849
888
|
/** Format: date-time */
|
|
850
889
|
createdAt: string;
|
|
851
890
|
detail?: string | null;
|
|
@@ -916,7 +955,13 @@ export interface components {
|
|
|
916
955
|
approvalMode?: "guardian" | "manual" | "yolo";
|
|
917
956
|
archived?: boolean;
|
|
918
957
|
model?: string;
|
|
919
|
-
|
|
958
|
+
/**
|
|
959
|
+
* @description Which reasoning tier to run at, from the model's `reasoningTiers`. Null puts it back to
|
|
960
|
+
* the model's own default; leaving it out keeps whatever is set.
|
|
961
|
+
*
|
|
962
|
+
* Independent of `model` — sending one does not touch the other.
|
|
963
|
+
*/
|
|
964
|
+
reasoningEffort?: string | null;
|
|
920
965
|
};
|
|
921
966
|
DecideRequestBody: {
|
|
922
967
|
approved: boolean;
|
|
@@ -927,9 +972,97 @@ export interface components {
|
|
|
927
972
|
items: components["schemas"]["ItemResource"][] | null;
|
|
928
973
|
};
|
|
929
974
|
SendMessageRequestBody: {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
975
|
+
client?: components["schemas"]["ClientContextRequest"];
|
|
976
|
+
/**
|
|
977
|
+
* @description The message, in the order it was written. A message with nothing but text is a single
|
|
978
|
+
* text part; that is the ordinary case and nothing else is required.
|
|
979
|
+
*/
|
|
980
|
+
parts: components["schemas"]["MessagePart"][];
|
|
981
|
+
};
|
|
982
|
+
/**
|
|
983
|
+
* @description One piece of a message. `type` says which of the fields below carries it:
|
|
984
|
+
*
|
|
985
|
+
* - `text` — the words, in `text`
|
|
986
|
+
* - `file` — an attachment uploaded earlier, by id in `attachmentId`
|
|
987
|
+
* - `data-<something>` — context from the client, in `data`. The name after `data-` is yours;
|
|
988
|
+
* it is shown to the assistant so it can tell one kind of block from another.
|
|
989
|
+
*
|
|
990
|
+
* Order matters: an image belongs where it was written, not at the end.
|
|
991
|
+
*/
|
|
992
|
+
MessagePart: {
|
|
993
|
+
/** @description For `file` parts. The attachment must have been uploaded and not yet bound to another message. */
|
|
994
|
+
attachmentId?: string | null;
|
|
995
|
+
/** @description For `data-*` parts. Any object; its keys reach the assistant as they are. */
|
|
996
|
+
data?: {
|
|
997
|
+
[key: string]: unknown;
|
|
998
|
+
} | null;
|
|
999
|
+
/** @description For `text` parts. */
|
|
1000
|
+
text?: string | null;
|
|
1001
|
+
type: string;
|
|
1002
|
+
};
|
|
1003
|
+
/**
|
|
1004
|
+
* @description Which client this is and what it can do, so the assistant can ask it to do those things
|
|
1005
|
+
* while it answers. What the operator is looking at travels as `data-*` parts on the message.
|
|
1006
|
+
*
|
|
1007
|
+
* Send `actions` only when they differ from the last message on this conversation. Sending the
|
|
1008
|
+
* block without `actions` keeps whatever was declared before.
|
|
1009
|
+
*/
|
|
1010
|
+
ClientContextRequest: {
|
|
1011
|
+
/** @description The actions on offer right now. Omit when unchanged since the last message. */
|
|
1012
|
+
actions?: components["schemas"]["ClientActionRequest"][] | null;
|
|
1013
|
+
/** @description Identifies this client while it stays open. Any stable string; one per tab or process. */
|
|
1014
|
+
clientId: string;
|
|
1015
|
+
/** @description How the client calls itself, for example "Leaflow console (web)". */
|
|
1016
|
+
label?: string;
|
|
1017
|
+
};
|
|
1018
|
+
/** @description A `data-*` part as it was sent. */
|
|
1019
|
+
ClientContextPart: {
|
|
1020
|
+
data: {
|
|
1021
|
+
[key: string]: unknown;
|
|
1022
|
+
};
|
|
1023
|
+
type: string;
|
|
1024
|
+
};
|
|
1025
|
+
/** @description The shape of a tool in the OpenAI Chat Completions API, plus `readOnly` and `timeoutMs`. */
|
|
1026
|
+
ClientActionRequest: {
|
|
1027
|
+
function: components["schemas"]["ClientFunctionRequest"];
|
|
1028
|
+
/** @description True when the action changes nothing outside the client. Anything else goes through this conversation's approval before it runs. */
|
|
1029
|
+
readOnly: boolean;
|
|
1030
|
+
/**
|
|
1031
|
+
* Format: int64
|
|
1032
|
+
* @description How long the assistant should wait for this action. Omit for the default; longer values are capped.
|
|
1033
|
+
*/
|
|
1034
|
+
timeoutMs?: number;
|
|
1035
|
+
/**
|
|
1036
|
+
* @description Only functions are supported.
|
|
1037
|
+
* @default function
|
|
1038
|
+
* @enum {string}
|
|
1039
|
+
*/
|
|
1040
|
+
type?: "function";
|
|
1041
|
+
};
|
|
1042
|
+
/** @description The function object from the OpenAI tools format. */
|
|
1043
|
+
ClientFunctionRequest: {
|
|
1044
|
+
/** @description What the action does, written for the model. An action without one can only be guessed at from its name. */
|
|
1045
|
+
description: string;
|
|
1046
|
+
/** @description The MCP and Anthropic spelling of `parameters`. Give one or the other, not both. */
|
|
1047
|
+
inputSchema?: {
|
|
1048
|
+
[key: string]: unknown;
|
|
1049
|
+
} | null;
|
|
1050
|
+
name: string;
|
|
1051
|
+
/** @description JSON Schema for the arguments. Omit for an action that takes none. */
|
|
1052
|
+
parameters?: {
|
|
1053
|
+
[key: string]: unknown;
|
|
1054
|
+
} | null;
|
|
1055
|
+
};
|
|
1056
|
+
DynamicCallResultRequestBody: {
|
|
1057
|
+
/** @description The same value sent with the message. A result from a different client is refused. */
|
|
1058
|
+
clientId: string;
|
|
1059
|
+
/** @description Why it failed, when `ok` is false. It reaches the assistant, so write it for a reader who cannot see the screen. */
|
|
1060
|
+
error?: string;
|
|
1061
|
+
/** @description Pass back when there is more to read. The assistant will call again with it. */
|
|
1062
|
+
nextCursor?: string;
|
|
1063
|
+
ok: boolean;
|
|
1064
|
+
/** @description What the action produced. At most 64 KiB; use `nextCursor` for anything larger. */
|
|
1065
|
+
output?: string;
|
|
933
1066
|
};
|
|
934
1067
|
TodoResource: {
|
|
935
1068
|
/** @description The same step phrased as happening now — "Installing nginx". Show this one while the item is in progress. */
|
|
@@ -1569,6 +1702,40 @@ export interface operations {
|
|
|
1569
1702
|
};
|
|
1570
1703
|
};
|
|
1571
1704
|
};
|
|
1705
|
+
"submit-dynamic-call-result": {
|
|
1706
|
+
parameters: {
|
|
1707
|
+
query?: never;
|
|
1708
|
+
header?: never;
|
|
1709
|
+
path: {
|
|
1710
|
+
/** @description The id of the tool call entry in the conversation. */
|
|
1711
|
+
call: string;
|
|
1712
|
+
};
|
|
1713
|
+
cookie?: never;
|
|
1714
|
+
};
|
|
1715
|
+
requestBody: {
|
|
1716
|
+
content: {
|
|
1717
|
+
"application/json": components["schemas"]["DynamicCallResultRequestBody"];
|
|
1718
|
+
};
|
|
1719
|
+
};
|
|
1720
|
+
responses: {
|
|
1721
|
+
/** @description No Content */
|
|
1722
|
+
204: {
|
|
1723
|
+
headers: {
|
|
1724
|
+
[name: string]: unknown;
|
|
1725
|
+
};
|
|
1726
|
+
content?: never;
|
|
1727
|
+
};
|
|
1728
|
+
/** @description Error */
|
|
1729
|
+
default: {
|
|
1730
|
+
headers: {
|
|
1731
|
+
[name: string]: unknown;
|
|
1732
|
+
};
|
|
1733
|
+
content: {
|
|
1734
|
+
"application/json": components["schemas"]["Error"];
|
|
1735
|
+
};
|
|
1736
|
+
};
|
|
1737
|
+
};
|
|
1738
|
+
};
|
|
1572
1739
|
"list-memories": {
|
|
1573
1740
|
parameters: {
|
|
1574
1741
|
query?: never;
|
|
@@ -368,7 +368,9 @@ export interface paths {
|
|
|
368
368
|
*
|
|
369
369
|
* Instances are created one by one in order. If the sequence stops part way through, because of a quota limit for example, **the instances already created are kept** and `failure` states why it stopped. A failure on the first instance is treated as a failure of the whole request and no instance is created.
|
|
370
370
|
*
|
|
371
|
-
* Exactly one
|
|
371
|
+
* Exactly one source must be given: `image_id` for a platform image, `private_image_id` for a private image, or `boot_disk_id` to boot a disk you already have. Supplying more than one, or none, is rejected.
|
|
372
|
+
*
|
|
373
|
+
* `boot_disk_id` recovers an instance that can no longer be repaired from the inside. Snapshot its disk, restore that snapshot into a new disk, attach the new disk to another instance and repair it there, then create an instance from it. That disk is not deleted when the instance is released; it is detached and returned to you.
|
|
372
374
|
*
|
|
373
375
|
* Instances are created in the availability zone of the instance type. Disks to be attached later must reside in the same zone.
|
|
374
376
|
*
|
|
@@ -1494,6 +1496,11 @@ export interface components {
|
|
|
1494
1496
|
hostname: string;
|
|
1495
1497
|
/** Format: uuid */
|
|
1496
1498
|
id: string;
|
|
1499
|
+
/**
|
|
1500
|
+
* Format: uuid
|
|
1501
|
+
* @description Non-empty when the instance was created from a disk you already had, instead of from an image
|
|
1502
|
+
*/
|
|
1503
|
+
boot_disk_id: string | null;
|
|
1497
1504
|
/**
|
|
1498
1505
|
* Format: uuid
|
|
1499
1506
|
* @description Non-empty when the instance was created from a platform image
|
|
@@ -1564,13 +1571,20 @@ export interface components {
|
|
|
1564
1571
|
generate_password?: boolean;
|
|
1565
1572
|
/**
|
|
1566
1573
|
* Format: uuid
|
|
1567
|
-
* @description
|
|
1574
|
+
* @description Boot a disk you already have instead of installing an image. The disk must be available, unattached, and in the same availability zone as the instance type. Exactly one of this, `image_id` and `private_image_id`
|
|
1575
|
+
*/
|
|
1576
|
+
boot_disk_id?: string;
|
|
1577
|
+
/**
|
|
1578
|
+
* Format: uuid
|
|
1579
|
+
* @description A platform image. Exactly one of this, `private_image_id` and `boot_disk_id`
|
|
1568
1580
|
*/
|
|
1569
1581
|
image_id?: string;
|
|
1570
1582
|
/** Format: uuid */
|
|
1571
1583
|
instance_type_id: string;
|
|
1584
|
+
/** @description The account the disk lets you log in as. Required with `boot_disk_id`, and rejected without it since an image states its own */
|
|
1585
|
+
login_username?: string;
|
|
1572
1586
|
name: string;
|
|
1573
|
-
/** @description
|
|
1587
|
+
/** @description The password to set, on the login account and on root. Only the SSH public keys of the project are used when omitted */
|
|
1574
1588
|
password?: string;
|
|
1575
1589
|
/**
|
|
1576
1590
|
* Format: uuid
|
|
@@ -1579,12 +1593,12 @@ export interface components {
|
|
|
1579
1593
|
port_id?: string;
|
|
1580
1594
|
/**
|
|
1581
1595
|
* Format: uuid
|
|
1582
|
-
* @description A private image. Exactly one of this and `
|
|
1596
|
+
* @description A private image. Exactly one of this, `image_id` and `boot_disk_id`
|
|
1583
1597
|
*/
|
|
1584
1598
|
private_image_id?: string;
|
|
1585
1599
|
/**
|
|
1586
1600
|
* Format: int64
|
|
1587
|
-
* @description System disk capacity in GB. Chosen automatically from the requirement of the image and the platform minimum when omitted
|
|
1601
|
+
* @description System disk capacity in GB. Chosen automatically from the requirement of the image and the platform minimum when omitted. Ignored with `boot_disk_id`, since that disk already has its capacity
|
|
1588
1602
|
*/
|
|
1589
1603
|
root_disk_gb?: number;
|
|
1590
1604
|
/** @description Required when a primary network interface is created, at least one; the default security group is not applied automatically. Ignored together with `port_id`, as the security groups of that interface were fixed when it was created */
|
|
@@ -14,6 +14,8 @@ export interface paths {
|
|
|
14
14
|
* 查看本项目的四层隧道
|
|
15
15
|
* @description 还没生成过时返回 `TUNNEL_NOT_FOUND`——首屏据此决定画「生成订阅链接」那个按钮还是画结果。
|
|
16
16
|
*
|
|
17
|
+
* 项目未获开放时返回 403 `TUNNEL_NOT_ENTITLED`,那是另一件事:控制台据此把四层隧道的入口整个收起来,而不是画那个按钮。
|
|
18
|
+
*
|
|
17
19
|
* 订阅地址、用量、配额各有自己的接口,这里不重复返回。
|
|
18
20
|
*/
|
|
19
21
|
get: operations["get-l4-tunnel"];
|