@leaflow/sdk 0.19.0 → 0.20.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.
@@ -52,6 +52,18 @@ export type SubmitDynamicCallResultBody = NonNullable<operations["submit-dynamic
52
52
  export type ListMemoriesResult = operations["list-memories"]["responses"][200]["content"]["application/json"];
53
53
  /** `GET /api/v1/models` 成功时的响应体。 */
54
54
  export type ListModelsResult = operations["list-models"]["responses"][200]["content"]["application/json"];
55
+ /** `GET /api/v1/skills` 成功时的响应体。 */
56
+ export type ListSkillsResult = operations["list-skills"]["responses"][200]["content"]["application/json"];
57
+ /** `POST /api/v1/skills` 成功时的响应体。 */
58
+ export type PutSkillResult = operations["put-skill"]["responses"][200]["content"]["application/json"];
59
+ /** `POST /api/v1/skills` 的请求体。 */
60
+ export type PutSkillBody = NonNullable<operations["put-skill"]["requestBody"]>["content"]["application/json"];
61
+ /** `GET /api/v1/skills/{skill}` 成功时的响应体。 */
62
+ export type GetSkillResult = operations["get-skill"]["responses"][200]["content"]["application/json"];
63
+ /** `PATCH /api/v1/skills/{skill}` 成功时的响应体。 */
64
+ export type SetSkillEnabledResult = operations["set-skill-enabled"]["responses"][200]["content"]["application/json"];
65
+ /** `PATCH /api/v1/skills/{skill}` 的请求体。 */
66
+ export type SetSkillEnabledBody = NonNullable<operations["set-skill-enabled"]["requestBody"]>["content"]["application/json"];
55
67
  /** `GET /api/v1/threads` 成功时的响应体。 */
56
68
  export type ListThreadsResult = operations["list-threads"]["responses"][200]["content"]["application/json"];
57
69
  /** `GET /api/v1/threads` 的查询参数。 */
@@ -371,6 +371,71 @@ export interface paths {
371
371
  patch?: never;
372
372
  trace?: never;
373
373
  };
374
+ "/api/v1/skills": {
375
+ parameters: {
376
+ query?: never;
377
+ header?: never;
378
+ path?: never;
379
+ cookie?: never;
380
+ };
381
+ /**
382
+ * List the skills this project can use
383
+ * @description Everything the assistant can reach in this project, including the ones that are turned off —
384
+ * an entry that disappeared once it was switched off could not be switched back on.
385
+ *
386
+ * `origin` says whether a skill can be edited here. Skills belonging to the project are
387
+ * visible to everyone in it, whoever wrote them.
388
+ */
389
+ get: operations["list-skills"];
390
+ put?: never;
391
+ /**
392
+ * Write a skill for this project
393
+ * @description Creates it, or replaces the project's skill of that name. The whole package goes in each
394
+ * time: files left out of a write are removed, so the stored skill is what was sent and not
395
+ * what accumulated.
396
+ *
397
+ * A project skill takes precedence over a built-in one of the same name for this project only.
398
+ * The built-in is untouched and reappears if the project's is deleted.
399
+ */
400
+ post: operations["put-skill"];
401
+ delete?: never;
402
+ options?: never;
403
+ head?: never;
404
+ patch?: never;
405
+ trace?: never;
406
+ };
407
+ "/api/v1/skills/{skill}": {
408
+ parameters: {
409
+ query?: never;
410
+ header?: never;
411
+ path?: never;
412
+ cookie?: never;
413
+ };
414
+ /**
415
+ * Read one skill, with its files
416
+ * @description Works for built-in skills too; they simply cannot be written.
417
+ */
418
+ get: operations["get-skill"];
419
+ put?: never;
420
+ post?: never;
421
+ /**
422
+ * Delete this project's skill
423
+ * @description A built-in skill of the same name, if there was one, becomes visible again.
424
+ */
425
+ delete: operations["delete-skill"];
426
+ options?: never;
427
+ head?: never;
428
+ /**
429
+ * Turn a skill on or off
430
+ * @description Separate from writing it, because this is the frequent one: a skill that is off costs
431
+ * nothing and stays where it is.
432
+ *
433
+ * Only skills belonging to the project can be switched. To keep a built-in one out of the
434
+ * way, write a project skill of the same name and turn that off.
435
+ */
436
+ patch: operations["set-skill-enabled"];
437
+ trace?: never;
438
+ };
374
439
  "/api/v1/threads": {
375
440
  parameters: {
376
441
  query?: never;
@@ -818,6 +883,61 @@ export interface components {
818
883
  ModelListResponseBody: {
819
884
  models: components["schemas"]["ModelResource"][] | null;
820
885
  };
886
+ SkillResource: {
887
+ /**
888
+ * @description True when the assistant wrote this skill during a conversation rather than a person
889
+ * writing it here.
890
+ *
891
+ * Which conversation is deliberately not returned: skills are shared across the project
892
+ * while conversations belong to one person, so naming one would tell everybody in the
893
+ * project that a particular colleague had it.
894
+ */
895
+ authoredByAssistant: boolean;
896
+ /** @description Why the assistant would open this skill. It sits in every request, so it is the one field worth writing carefully. */
897
+ description: string;
898
+ enabled: boolean;
899
+ /** @description Path to contents, `SKILL.md` among them. Only returned by `get-skill`; the list leaves it out. */
900
+ files?: {
901
+ [key: string]: string;
902
+ } | null;
903
+ name: string;
904
+ /**
905
+ * @description `builtin` — provided by the platform and read-only here.
906
+ * `project` — written for this project and editable by anyone in it.
907
+ * @enum {string}
908
+ */
909
+ origin: "builtin" | "project";
910
+ shortDescription: string | null;
911
+ /**
912
+ * Format: date-time
913
+ * @description Null for built-in skills, which have no edit history here.
914
+ */
915
+ updatedAt: string | null;
916
+ };
917
+ SkillListResponseBody: {
918
+ skills: components["schemas"]["SkillResource"][];
919
+ };
920
+ SkillRequestBody: {
921
+ /** @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". */
922
+ description: string;
923
+ /** @default true */
924
+ enabled?: boolean;
925
+ /**
926
+ * @description Path to contents. `SKILL.md` is required; anything else it references goes alongside it.
927
+ *
928
+ * Paths are relative to the skill and cannot leave it. At most 32 files, 256 KiB each and
929
+ * 1 MiB in total.
930
+ */
931
+ files: {
932
+ [key: string]: string;
933
+ };
934
+ /** @description Also how the assistant refers to it, so renaming is deleting and writing again. */
935
+ name: string;
936
+ shortDescription?: string;
937
+ };
938
+ SkillEnabledRequestBody: {
939
+ enabled: boolean;
940
+ };
821
941
  ThreadSummaryResource: {
822
942
  /** @description The tier this conversation runs at, or null when it follows the model's own default. */
823
943
  reasoningEffort: string | null;
@@ -1823,6 +1943,164 @@ export interface operations {
1823
1943
  };
1824
1944
  };
1825
1945
  };
1946
+ "list-skills": {
1947
+ parameters: {
1948
+ query?: never;
1949
+ header?: never;
1950
+ path?: never;
1951
+ cookie?: never;
1952
+ };
1953
+ requestBody?: never;
1954
+ responses: {
1955
+ /** @description OK */
1956
+ 200: {
1957
+ headers: {
1958
+ [name: string]: unknown;
1959
+ };
1960
+ content: {
1961
+ "application/json": components["schemas"]["SkillListResponseBody"];
1962
+ };
1963
+ };
1964
+ /** @description Error */
1965
+ default: {
1966
+ headers: {
1967
+ [name: string]: unknown;
1968
+ };
1969
+ content: {
1970
+ "application/json": components["schemas"]["Error"];
1971
+ };
1972
+ };
1973
+ };
1974
+ };
1975
+ "put-skill": {
1976
+ parameters: {
1977
+ query?: never;
1978
+ header?: never;
1979
+ path?: never;
1980
+ cookie?: never;
1981
+ };
1982
+ requestBody: {
1983
+ content: {
1984
+ "application/json": components["schemas"]["SkillRequestBody"];
1985
+ };
1986
+ };
1987
+ responses: {
1988
+ /** @description OK */
1989
+ 200: {
1990
+ headers: {
1991
+ [name: string]: unknown;
1992
+ };
1993
+ content: {
1994
+ "application/json": components["schemas"]["SkillResource"];
1995
+ };
1996
+ };
1997
+ /** @description Error */
1998
+ default: {
1999
+ headers: {
2000
+ [name: string]: unknown;
2001
+ };
2002
+ content: {
2003
+ "application/json": components["schemas"]["Error"];
2004
+ };
2005
+ };
2006
+ };
2007
+ };
2008
+ "get-skill": {
2009
+ parameters: {
2010
+ query?: never;
2011
+ header?: never;
2012
+ path: {
2013
+ /** @description The skill's name, as `list-skills` returned it. */
2014
+ skill: string;
2015
+ };
2016
+ cookie?: never;
2017
+ };
2018
+ requestBody?: never;
2019
+ responses: {
2020
+ /** @description OK */
2021
+ 200: {
2022
+ headers: {
2023
+ [name: string]: unknown;
2024
+ };
2025
+ content: {
2026
+ "application/json": components["schemas"]["SkillResource"];
2027
+ };
2028
+ };
2029
+ /** @description Error */
2030
+ default: {
2031
+ headers: {
2032
+ [name: string]: unknown;
2033
+ };
2034
+ content: {
2035
+ "application/json": components["schemas"]["Error"];
2036
+ };
2037
+ };
2038
+ };
2039
+ };
2040
+ "delete-skill": {
2041
+ parameters: {
2042
+ query?: never;
2043
+ header?: never;
2044
+ path: {
2045
+ skill: string;
2046
+ };
2047
+ cookie?: never;
2048
+ };
2049
+ requestBody?: never;
2050
+ responses: {
2051
+ /** @description No Content */
2052
+ 204: {
2053
+ headers: {
2054
+ [name: string]: unknown;
2055
+ };
2056
+ content?: never;
2057
+ };
2058
+ /** @description Error */
2059
+ default: {
2060
+ headers: {
2061
+ [name: string]: unknown;
2062
+ };
2063
+ content: {
2064
+ "application/json": components["schemas"]["Error"];
2065
+ };
2066
+ };
2067
+ };
2068
+ };
2069
+ "set-skill-enabled": {
2070
+ parameters: {
2071
+ query?: never;
2072
+ header?: never;
2073
+ path: {
2074
+ skill: string;
2075
+ };
2076
+ cookie?: never;
2077
+ };
2078
+ requestBody: {
2079
+ content: {
2080
+ "application/json": components["schemas"]["SkillEnabledRequestBody"];
2081
+ };
2082
+ };
2083
+ responses: {
2084
+ /** @description OK */
2085
+ 200: {
2086
+ headers: {
2087
+ [name: string]: unknown;
2088
+ };
2089
+ content: {
2090
+ "application/json": components["schemas"]["SkillResource"];
2091
+ };
2092
+ };
2093
+ /** @description Error */
2094
+ default: {
2095
+ headers: {
2096
+ [name: string]: unknown;
2097
+ };
2098
+ content: {
2099
+ "application/json": components["schemas"]["Error"];
2100
+ };
2101
+ };
2102
+ };
2103
+ };
1826
2104
  "list-threads": {
1827
2105
  parameters: {
1828
2106
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {