@leaflow/sdk 0.19.0 → 0.21.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.
@@ -50,8 +50,18 @@ export type SubmitWeixinVerifyCodeBody = NonNullable<operations["submit-weixin-v
50
50
  export type SubmitDynamicCallResultBody = NonNullable<operations["submit-dynamic-call-result"]["requestBody"]>["content"]["application/json"];
51
51
  /** `GET /api/v1/memories` 成功时的响应体。 */
52
52
  export type ListMemoriesResult = operations["list-memories"]["responses"][200]["content"]["application/json"];
53
- /** `GET /api/v1/models` 成功时的响应体。 */
54
- export type ListModelsResult = operations["list-models"]["responses"][200]["content"]["application/json"];
53
+ /** `GET /api/v1/skills` 成功时的响应体。 */
54
+ export type ListSkillsResult = operations["list-skills"]["responses"][200]["content"]["application/json"];
55
+ /** `POST /api/v1/skills` 成功时的响应体。 */
56
+ export type PutSkillResult = operations["put-skill"]["responses"][200]["content"]["application/json"];
57
+ /** `POST /api/v1/skills` 的请求体。 */
58
+ export type PutSkillBody = NonNullable<operations["put-skill"]["requestBody"]>["content"]["application/json"];
59
+ /** `GET /api/v1/skills/{skill}` 成功时的响应体。 */
60
+ export type GetSkillResult = operations["get-skill"]["responses"][200]["content"]["application/json"];
61
+ /** `PATCH /api/v1/skills/{skill}` 成功时的响应体。 */
62
+ export type SetSkillEnabledResult = operations["set-skill-enabled"]["responses"][200]["content"]["application/json"];
63
+ /** `PATCH /api/v1/skills/{skill}` 的请求体。 */
64
+ export type SetSkillEnabledBody = NonNullable<operations["set-skill-enabled"]["requestBody"]>["content"]["application/json"];
55
65
  /** `GET /api/v1/threads` 成功时的响应体。 */
56
66
  export type ListThreadsResult = operations["list-threads"]["responses"][200]["content"]["application/json"];
57
67
  /** `GET /api/v1/threads` 的查询参数。 */
@@ -351,7 +351,7 @@ export interface paths {
351
351
  patch?: never;
352
352
  trace?: never;
353
353
  };
354
- "/api/v1/models": {
354
+ "/api/v1/skills": {
355
355
  parameters: {
356
356
  query?: never;
357
357
  header?: never;
@@ -359,18 +359,63 @@ export interface paths {
359
359
  cookie?: never;
360
360
  };
361
361
  /**
362
- * List available models
363
- * @description The models currently offered, with their context window, reasoning levels and supported input types. Use it to populate the model picker in conversation settings.
362
+ * List the skills this project can use
363
+ * @description Everything the assistant can reach in this project, including the ones that are turned off
364
+ * an entry that disappeared once it was switched off could not be switched back on.
365
+ *
366
+ * `origin` says whether a skill can be edited here. Skills belonging to the project are
367
+ * visible to everyone in it, whoever wrote them.
364
368
  */
365
- get: operations["list-models"];
369
+ get: operations["list-skills"];
366
370
  put?: never;
367
- post?: never;
371
+ /**
372
+ * Write a skill for this project
373
+ * @description Creates it, or replaces the project's skill of that name. The whole package goes in each
374
+ * time: files left out of a write are removed, so the stored skill is what was sent and not
375
+ * what accumulated.
376
+ *
377
+ * A project skill takes precedence over a built-in one of the same name for this project only.
378
+ * The built-in is untouched and reappears if the project's is deleted.
379
+ */
380
+ post: operations["put-skill"];
368
381
  delete?: never;
369
382
  options?: never;
370
383
  head?: never;
371
384
  patch?: never;
372
385
  trace?: never;
373
386
  };
387
+ "/api/v1/skills/{skill}": {
388
+ parameters: {
389
+ query?: never;
390
+ header?: never;
391
+ path?: never;
392
+ cookie?: never;
393
+ };
394
+ /**
395
+ * Read one skill, with its files
396
+ * @description Works for built-in skills too; they simply cannot be written.
397
+ */
398
+ get: operations["get-skill"];
399
+ put?: never;
400
+ post?: never;
401
+ /**
402
+ * Delete this project's skill
403
+ * @description A built-in skill of the same name, if there was one, becomes visible again.
404
+ */
405
+ delete: operations["delete-skill"];
406
+ options?: never;
407
+ head?: never;
408
+ /**
409
+ * Turn a skill on or off
410
+ * @description Separate from writing it, because this is the frequent one: a skill that is off costs
411
+ * nothing and stays where it is.
412
+ *
413
+ * Only skills belonging to the project can be switched. To keep a built-in one out of the
414
+ * way, write a project skill of the same name and turn that off.
415
+ */
416
+ patch: operations["set-skill-enabled"];
417
+ trace?: never;
418
+ };
374
419
  "/api/v1/threads": {
375
420
  parameters: {
376
421
  query?: never;
@@ -411,7 +456,7 @@ export interface paths {
411
456
  head?: never;
412
457
  /**
413
458
  * Update conversation settings
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.
459
+ * @description Changes the approval mode and archived state. A change takes effect from the next turn; a turn already running keeps the settings it started with.
415
460
  */
416
461
  patch: operations["update-thread"];
417
462
  trace?: never;
@@ -792,35 +837,62 @@ export interface components {
792
837
  VerifyCodeRequestBody: {
793
838
  code: string;
794
839
  };
795
- ModelResource: {
796
- /** Format: int64 */
797
- contextWindow: number;
798
- inputModalities: string[] | null;
799
- key: string;
800
- reasoningTiers: string[] | null;
840
+ SkillResource: {
841
+ /**
842
+ * @description True when the assistant wrote this skill during a conversation rather than a person
843
+ * writing it here.
844
+ *
845
+ * Which conversation is deliberately not returned: skills are shared across the project
846
+ * while conversations belong to one person, so naming one would tell everybody in the
847
+ * project that a particular colleague had it.
848
+ */
849
+ authoredByAssistant: boolean;
850
+ /** @description Why the assistant would open this skill. It sits in every request, so it is the one field worth writing carefully. */
851
+ description: string;
852
+ enabled: boolean;
853
+ /** @description Path to contents, `SKILL.md` among them. Only returned by `get-skill`; the list leaves it out. */
854
+ files?: {
855
+ [key: string]: string;
856
+ } | null;
857
+ name: string;
858
+ /**
859
+ * @description `builtin` — provided by the platform and read-only here.
860
+ * `project` — written for this project and editable by anyone in it.
861
+ * @enum {string}
862
+ */
863
+ origin: "builtin" | "project";
864
+ shortDescription: string | null;
865
+ /**
866
+ * Format: date-time
867
+ * @description Null for built-in skills, which have no edit history here.
868
+ */
869
+ updatedAt: string | null;
801
870
  };
802
- MemoryListResponseBody: {
803
- items: components["schemas"]["MemoryResource"][];
871
+ SkillListResponseBody: {
872
+ skills: components["schemas"]["SkillResource"][];
804
873
  };
805
- MemoryResource: {
806
- /** @description The fact itself */
807
- body: string;
808
- /** Format: date-time */
809
- createdAt: string;
810
- id: string;
811
- /** @description The name the assistant gave this fact; it overwrites or deletes its own entries by that name */
874
+ SkillRequestBody: {
875
+ /** @description Why the assistant would open this skill. It sits in every request; write it as the answer to "when do I need this", not "what does it contain". */
876
+ description: string;
877
+ /** @default true */
878
+ enabled?: boolean;
879
+ /**
880
+ * @description Path to contents. `SKILL.md` is required; anything else it references goes alongside it.
881
+ *
882
+ * Paths are relative to the skill and cannot leave it. At most 32 files, 256 KiB each and
883
+ * 1 MiB in total.
884
+ */
885
+ files: {
886
+ [key: string]: string;
887
+ };
888
+ /** @description Also how the assistant refers to it, so renaming is deleting and writing again. */
812
889
  name: string;
813
- /** @description Which conversation the assistant learned it in. That conversation may since have been deleted */
814
- sourceThreadId?: string;
815
- /** Format: date-time */
816
- updatedAt: string;
890
+ shortDescription?: string;
817
891
  };
818
- ModelListResponseBody: {
819
- models: components["schemas"]["ModelResource"][] | null;
892
+ SkillEnabledRequestBody: {
893
+ enabled: boolean;
820
894
  };
821
895
  ThreadSummaryResource: {
822
- /** @description The tier this conversation runs at, or null when it follows the model's own default. */
823
- reasoningEffort: string | null;
824
896
  /** @enum {string} */
825
897
  approvalMode: "guardian" | "manual" | "yolo";
826
898
  archived: boolean;
@@ -844,8 +916,6 @@ export interface components {
844
916
  approvalMode?: "guardian" | "manual" | "yolo";
845
917
  };
846
918
  ContextResource: {
847
- /** @description The tier this conversation runs at, or null when it follows the model's own default. */
848
- reasoningEffort: string | null;
849
919
  /** Format: int64 */
850
920
  compactAt: number | null;
851
921
  model: string;
@@ -954,14 +1024,6 @@ export interface components {
954
1024
  /** @enum {string} */
955
1025
  approvalMode?: "guardian" | "manual" | "yolo";
956
1026
  archived?: boolean;
957
- model?: string;
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;
965
1027
  };
966
1028
  DecideRequestBody: {
967
1029
  approved: boolean;
@@ -979,6 +1041,22 @@ export interface components {
979
1041
  */
980
1042
  parts: components["schemas"]["MessagePart"][];
981
1043
  };
1044
+ MemoryListResponseBody: {
1045
+ items: components["schemas"]["MemoryResource"][];
1046
+ };
1047
+ MemoryResource: {
1048
+ /** @description The fact itself */
1049
+ body: string;
1050
+ /** Format: date-time */
1051
+ createdAt: string;
1052
+ id: string;
1053
+ /** @description The name the assistant gave this fact; it overwrites or deletes its own entries by that name */
1054
+ name: string;
1055
+ /** @description Which conversation the assistant learned it in. That conversation may since have been deleted */
1056
+ sourceThreadId?: string;
1057
+ /** Format: date-time */
1058
+ updatedAt: string;
1059
+ };
982
1060
  /**
983
1061
  * @description One piece of a message. `type` says which of the fields below carries it:
984
1062
  *
@@ -1794,13 +1872,78 @@ export interface operations {
1794
1872
  };
1795
1873
  };
1796
1874
  };
1797
- "list-models": {
1875
+ "list-skills": {
1876
+ parameters: {
1877
+ query?: never;
1878
+ header?: never;
1879
+ path?: never;
1880
+ cookie?: never;
1881
+ };
1882
+ requestBody?: never;
1883
+ responses: {
1884
+ /** @description OK */
1885
+ 200: {
1886
+ headers: {
1887
+ [name: string]: unknown;
1888
+ };
1889
+ content: {
1890
+ "application/json": components["schemas"]["SkillListResponseBody"];
1891
+ };
1892
+ };
1893
+ /** @description Error */
1894
+ default: {
1895
+ headers: {
1896
+ [name: string]: unknown;
1897
+ };
1898
+ content: {
1899
+ "application/json": components["schemas"]["Error"];
1900
+ };
1901
+ };
1902
+ };
1903
+ };
1904
+ "put-skill": {
1798
1905
  parameters: {
1799
1906
  query?: never;
1800
1907
  header?: never;
1801
1908
  path?: never;
1802
1909
  cookie?: never;
1803
1910
  };
1911
+ requestBody: {
1912
+ content: {
1913
+ "application/json": components["schemas"]["SkillRequestBody"];
1914
+ };
1915
+ };
1916
+ responses: {
1917
+ /** @description OK */
1918
+ 200: {
1919
+ headers: {
1920
+ [name: string]: unknown;
1921
+ };
1922
+ content: {
1923
+ "application/json": components["schemas"]["SkillResource"];
1924
+ };
1925
+ };
1926
+ /** @description Error */
1927
+ default: {
1928
+ headers: {
1929
+ [name: string]: unknown;
1930
+ };
1931
+ content: {
1932
+ "application/json": components["schemas"]["Error"];
1933
+ };
1934
+ };
1935
+ };
1936
+ };
1937
+ "get-skill": {
1938
+ parameters: {
1939
+ query?: never;
1940
+ header?: never;
1941
+ path: {
1942
+ /** @description The skill's name, as `list-skills` returned it. */
1943
+ skill: string;
1944
+ };
1945
+ cookie?: never;
1946
+ };
1804
1947
  requestBody?: never;
1805
1948
  responses: {
1806
1949
  /** @description OK */
@@ -1809,7 +1952,71 @@ export interface operations {
1809
1952
  [name: string]: unknown;
1810
1953
  };
1811
1954
  content: {
1812
- "application/json": components["schemas"]["ModelListResponseBody"];
1955
+ "application/json": components["schemas"]["SkillResource"];
1956
+ };
1957
+ };
1958
+ /** @description Error */
1959
+ default: {
1960
+ headers: {
1961
+ [name: string]: unknown;
1962
+ };
1963
+ content: {
1964
+ "application/json": components["schemas"]["Error"];
1965
+ };
1966
+ };
1967
+ };
1968
+ };
1969
+ "delete-skill": {
1970
+ parameters: {
1971
+ query?: never;
1972
+ header?: never;
1973
+ path: {
1974
+ skill: string;
1975
+ };
1976
+ cookie?: never;
1977
+ };
1978
+ requestBody?: never;
1979
+ responses: {
1980
+ /** @description No Content */
1981
+ 204: {
1982
+ headers: {
1983
+ [name: string]: unknown;
1984
+ };
1985
+ content?: never;
1986
+ };
1987
+ /** @description Error */
1988
+ default: {
1989
+ headers: {
1990
+ [name: string]: unknown;
1991
+ };
1992
+ content: {
1993
+ "application/json": components["schemas"]["Error"];
1994
+ };
1995
+ };
1996
+ };
1997
+ };
1998
+ "set-skill-enabled": {
1999
+ parameters: {
2000
+ query?: never;
2001
+ header?: never;
2002
+ path: {
2003
+ skill: string;
2004
+ };
2005
+ cookie?: never;
2006
+ };
2007
+ requestBody: {
2008
+ content: {
2009
+ "application/json": components["schemas"]["SkillEnabledRequestBody"];
2010
+ };
2011
+ };
2012
+ responses: {
2013
+ /** @description OK */
2014
+ 200: {
2015
+ headers: {
2016
+ [name: string]: unknown;
2017
+ };
2018
+ content: {
2019
+ "application/json": components["schemas"]["SkillResource"];
1813
2020
  };
1814
2021
  };
1815
2022
  /** @description Error */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {