@knowledge-stack/ksapi 1.143.0 → 1.145.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.
Files changed (63) hide show
  1. package/.openapi-generator/FILES +6 -2
  2. package/README.md +6 -3
  3. package/dist/apis/PathPartsApi.d.ts +42 -1
  4. package/dist/apis/PathPartsApi.js +53 -0
  5. package/dist/apis/SkillsApi.d.ts +11 -8
  6. package/dist/apis/SkillsApi.js +7 -4
  7. package/dist/esm/apis/PathPartsApi.d.ts +42 -1
  8. package/dist/esm/apis/PathPartsApi.js +54 -1
  9. package/dist/esm/apis/SkillsApi.d.ts +11 -8
  10. package/dist/esm/apis/SkillsApi.js +7 -4
  11. package/dist/esm/models/CreateSkillRequest.d.ts +4 -4
  12. package/dist/esm/models/CreateSkillRequest.js +5 -5
  13. package/dist/esm/models/EventResponse.d.ts +35 -1
  14. package/dist/esm/models/EventResponse.js +12 -0
  15. package/dist/esm/models/{SkillScriptFile.d.ts → ReorderPathPartRequest.d.ts} +17 -17
  16. package/dist/esm/models/ReorderPathPartRequest.js +44 -0
  17. package/dist/esm/models/ResolvedRef.d.ts +79 -0
  18. package/dist/esm/models/ResolvedRef.js +59 -0
  19. package/dist/esm/models/SkillFile.d.ts +71 -0
  20. package/dist/esm/models/{SkillScriptFile.js → SkillFile.js} +23 -14
  21. package/dist/esm/models/SkillResponse.d.ts +6 -6
  22. package/dist/esm/models/SkillResponse.js +5 -5
  23. package/dist/esm/models/UpdateSkillRequest.d.ts +4 -4
  24. package/dist/esm/models/UpdateSkillRequest.js +5 -5
  25. package/dist/esm/models/index.d.ts +3 -1
  26. package/dist/esm/models/index.js +3 -1
  27. package/dist/models/CreateSkillRequest.d.ts +4 -4
  28. package/dist/models/CreateSkillRequest.js +5 -5
  29. package/dist/models/EventResponse.d.ts +35 -1
  30. package/dist/models/EventResponse.js +12 -0
  31. package/dist/models/{SkillScriptFile.d.ts → ReorderPathPartRequest.d.ts} +17 -17
  32. package/dist/models/ReorderPathPartRequest.js +52 -0
  33. package/dist/models/ResolvedRef.d.ts +79 -0
  34. package/dist/models/ResolvedRef.js +67 -0
  35. package/dist/models/SkillFile.d.ts +71 -0
  36. package/dist/models/{SkillScriptFile.js → SkillFile.js} +29 -20
  37. package/dist/models/SkillResponse.d.ts +6 -6
  38. package/dist/models/SkillResponse.js +5 -5
  39. package/dist/models/UpdateSkillRequest.d.ts +4 -4
  40. package/dist/models/UpdateSkillRequest.js +5 -5
  41. package/dist/models/index.d.ts +3 -1
  42. package/dist/models/index.js +3 -1
  43. package/docs/CreateSkillRequest.md +2 -2
  44. package/docs/EventResponse.md +11 -1
  45. package/docs/FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md +4 -4
  46. package/docs/PathPartsApi.md +79 -0
  47. package/docs/{SkillScriptFile.md → ReorderPathPartRequest.md} +9 -9
  48. package/docs/ResolvedRef.md +41 -0
  49. package/docs/SkillFile.md +39 -0
  50. package/docs/SkillResponse.md +4 -4
  51. package/docs/SkillsApi.md +6 -3
  52. package/docs/UpdateSkillRequest.md +2 -2
  53. package/package.json +1 -1
  54. package/src/apis/PathPartsApi.ts +99 -0
  55. package/src/apis/SkillsApi.ts +15 -8
  56. package/src/models/CreateSkillRequest.ts +13 -13
  57. package/src/models/EventResponse.ts +49 -1
  58. package/src/models/{SkillScriptFile.ts → ReorderPathPartRequest.ts} +23 -28
  59. package/src/models/ResolvedRef.ts +125 -0
  60. package/src/models/SkillFile.ts +118 -0
  61. package/src/models/SkillResponse.ts +15 -15
  62. package/src/models/UpdateSkillRequest.ts +13 -13
  63. package/src/models/index.ts +3 -1
@@ -87,6 +87,7 @@ export interface ExportSkillRequest {
87
87
 
88
88
  export interface GetSkillRequest {
89
89
  skillId: string;
90
+ includeFileContents?: boolean;
90
91
  }
91
92
 
92
93
  export interface ImportSkillRequest {
@@ -300,15 +301,17 @@ export interface SkillsApiInterface {
300
301
  /**
301
302
  * Creates request options for getSkill without sending the request
302
303
  * @param {string} skillId
304
+ * @param {boolean} [includeFileContents] Include every bundle file\'s contents (base64 for binary). Off by default — the editor opts in; a large skill\'s contents can be many MB and one S3 read per file.
303
305
  * @throws {RequiredError}
304
306
  * @memberof SkillsApiInterface
305
307
  */
306
308
  getSkillRequestOpts(requestParameters: GetSkillRequest): Promise<runtime.RequestOpts>;
307
309
 
308
310
  /**
309
- * Skill detail: SKILL.md, script contents, has_unpublished_changes, perms.
311
+ * Skill detail: SKILL.md, file paths (+ contents on request), perms.
310
312
  * @summary Get Skill Handler
311
313
  * @param {string} skillId
314
+ * @param {boolean} [includeFileContents] Include every bundle file\&#39;s contents (base64 for binary). Off by default — the editor opts in; a large skill\&#39;s contents can be many MB and one S3 read per file.
312
315
  * @param {*} [options] Override http request option.
313
316
  * @throws {RequiredError}
314
317
  * @memberof SkillsApiInterface
@@ -316,7 +319,7 @@ export interface SkillsApiInterface {
316
319
  getSkillRaw(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
317
320
 
318
321
  /**
319
- * Skill detail: SKILL.md, script contents, has_unpublished_changes, perms.
322
+ * Skill detail: SKILL.md, file paths (+ contents on request), perms.
320
323
  * Get Skill Handler
321
324
  */
322
325
  getSkill(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
@@ -330,7 +333,7 @@ export interface SkillsApiInterface {
330
333
  importSkillRequestOpts(requestParameters: ImportSkillRequest): Promise<runtime.RequestOpts>;
331
334
 
332
335
  /**
333
- * Create a skill by importing a redistributable ZIP (works across tenants).
336
+ * Create a skill from an uploaded ZIP or tarball (works across tenants).
334
337
  * @summary Import Skill Handler
335
338
  * @param {Blob} file
336
339
  * @param {*} [options] Override http request option.
@@ -340,7 +343,7 @@ export interface SkillsApiInterface {
340
343
  importSkillRaw(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
341
344
 
342
345
  /**
343
- * Create a skill by importing a redistributable ZIP (works across tenants).
346
+ * Create a skill from an uploaded ZIP or tarball (works across tenants).
344
347
  * Import Skill Handler
345
348
  */
346
349
  importSkill(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
@@ -902,6 +905,10 @@ export class SkillsApi extends runtime.BaseAPI implements SkillsApiInterface {
902
905
 
903
906
  const queryParameters: any = {};
904
907
 
908
+ if (requestParameters['includeFileContents'] != null) {
909
+ queryParameters['include_file_contents'] = requestParameters['includeFileContents'];
910
+ }
911
+
905
912
  const headerParameters: runtime.HTTPHeaders = {};
906
913
 
907
914
  if (this.configuration && this.configuration.accessToken) {
@@ -925,7 +932,7 @@ export class SkillsApi extends runtime.BaseAPI implements SkillsApiInterface {
925
932
  }
926
933
 
927
934
  /**
928
- * Skill detail: SKILL.md, script contents, has_unpublished_changes, perms.
935
+ * Skill detail: SKILL.md, file paths (+ contents on request), perms.
929
936
  * Get Skill Handler
930
937
  */
931
938
  async getSkillRaw(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
@@ -936,7 +943,7 @@ export class SkillsApi extends runtime.BaseAPI implements SkillsApiInterface {
936
943
  }
937
944
 
938
945
  /**
939
- * Skill detail: SKILL.md, script contents, has_unpublished_changes, perms.
946
+ * Skill detail: SKILL.md, file paths (+ contents on request), perms.
940
947
  * Get Skill Handler
941
948
  */
942
949
  async getSkill(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
@@ -1000,7 +1007,7 @@ export class SkillsApi extends runtime.BaseAPI implements SkillsApiInterface {
1000
1007
  }
1001
1008
 
1002
1009
  /**
1003
- * Create a skill by importing a redistributable ZIP (works across tenants).
1010
+ * Create a skill from an uploaded ZIP or tarball (works across tenants).
1004
1011
  * Import Skill Handler
1005
1012
  */
1006
1013
  async importSkillRaw(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
@@ -1011,7 +1018,7 @@ export class SkillsApi extends runtime.BaseAPI implements SkillsApiInterface {
1011
1018
  }
1012
1019
 
1013
1020
  /**
1014
- * Create a skill by importing a redistributable ZIP (works across tenants).
1021
+ * Create a skill from an uploaded ZIP or tarball (works across tenants).
1015
1022
  * Import Skill Handler
1016
1023
  */
1017
1024
  async importSkill(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
@@ -13,13 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { SkillScriptFile } from './SkillScriptFile';
16
+ import type { SkillFile } from './SkillFile';
17
17
  import {
18
- SkillScriptFileFromJSON,
19
- SkillScriptFileFromJSONTyped,
20
- SkillScriptFileToJSON,
21
- SkillScriptFileToJSONTyped,
22
- } from './SkillScriptFile';
18
+ SkillFileFromJSON,
19
+ SkillFileFromJSONTyped,
20
+ SkillFileToJSON,
21
+ SkillFileToJSONTyped,
22
+ } from './SkillFile';
23
23
 
24
24
  /**
25
25
  * Author a skill from a SKILL.md bundle.
@@ -40,11 +40,11 @@ export interface CreateSkillRequest {
40
40
  */
41
41
  skillMd: string;
42
42
  /**
43
- * Optional scripts bundled under the skill's scripts/ folder.
44
- * @type {Array<SkillScriptFile>}
43
+ * Optional bundle files at paths relative to the skill root (scripts/, references/, assets/, …). SKILL.md is supplied separately and must not be repeated here.
44
+ * @type {Array<SkillFile>}
45
45
  * @memberof CreateSkillRequest
46
46
  */
47
- scripts?: Array<SkillScriptFile>;
47
+ files?: Array<SkillFile>;
48
48
  }
49
49
  export const CreateSkillRequestPropertyValidationAttributesMap: {
50
50
  [property: string]: {
@@ -64,8 +64,8 @@ export const CreateSkillRequestPropertyValidationAttributesMap: {
64
64
  name: {
65
65
  maxLength: 255,
66
66
  },
67
- scripts: {
68
- maxItems: 50,
67
+ files: {
68
+ maxItems: 2000,
69
69
  uniqueItems: false,
70
70
  },
71
71
  }
@@ -92,7 +92,7 @@ export function CreateSkillRequestFromJSONTyped(json: any, ignoreDiscriminator:
92
92
 
93
93
  'name': json['name'],
94
94
  'skillMd': json['skill_md'],
95
- 'scripts': json['scripts'] == null ? undefined : ((json['scripts'] as Array<any>).map(SkillScriptFileFromJSON)),
95
+ 'files': json['files'] == null ? undefined : ((json['files'] as Array<any>).map(SkillFileFromJSON)),
96
96
  };
97
97
  }
98
98
 
@@ -109,7 +109,7 @@ export function CreateSkillRequestToJSONTyped(value?: CreateSkillRequest | null,
109
109
 
110
110
  'name': value['name'],
111
111
  'skill_md': value['skillMd'],
112
- 'scripts': value['scripts'] == null ? undefined : ((value['scripts'] as Array<any>).map(SkillScriptFileToJSON)),
112
+ 'files': value['files'] == null ? undefined : ((value['files'] as Array<any>).map(SkillFileToJSON)),
113
113
  };
114
114
  }
115
115
 
@@ -20,13 +20,21 @@ import {
20
20
  UserInfoToJSON,
21
21
  UserInfoToJSONTyped,
22
22
  } from './UserInfo';
23
+ import type { ResolvedRef } from './ResolvedRef';
24
+ import {
25
+ ResolvedRefFromJSON,
26
+ ResolvedRefFromJSONTyped,
27
+ ResolvedRefToJSON,
28
+ ResolvedRefToJSONTyped,
29
+ } from './ResolvedRef';
23
30
 
24
31
  /**
25
32
  * One event row, anchored to a path_part subject.
26
33
  *
27
34
  * ``kind`` is namespaced ``domain.action`` (e.g. ``workflow.approval``,
28
35
  * ``document.created``). ``payload`` is the domain-specific structured
29
- * JSON associated with the event.
36
+ * JSON associated with the event, stored verbatim and never rewritten —
37
+ * the human-readable resolution lives alongside it in ``references``.
30
38
  * @export
31
39
  * @interface EventResponse
32
40
  */
@@ -73,6 +81,36 @@ export interface EventResponse {
73
81
  * @memberof EventResponse
74
82
  */
75
83
  actor?: UserInfo | null;
84
+ /**
85
+ *
86
+ * @type {string}
87
+ * @memberof EventResponse
88
+ */
89
+ subjectName?: string | null;
90
+ /**
91
+ *
92
+ * @type {string}
93
+ * @memberof EventResponse
94
+ */
95
+ subjectPath?: string | null;
96
+ /**
97
+ *
98
+ * @type {string}
99
+ * @memberof EventResponse
100
+ */
101
+ subjectObjectId?: string | null;
102
+ /**
103
+ *
104
+ * @type {string}
105
+ * @memberof EventResponse
106
+ */
107
+ subjectPartType?: string | null;
108
+ /**
109
+ *
110
+ * @type {{ [key: string]: ResolvedRef; }}
111
+ * @memberof EventResponse
112
+ */
113
+ references?: { [key: string]: ResolvedRef; };
76
114
  }
77
115
  export const EventResponsePropertyValidationAttributesMap: {
78
116
  [property: string]: {
@@ -122,6 +160,11 @@ export function EventResponseFromJSONTyped(json: any, ignoreDiscriminator: boole
122
160
  'actorUserId': json['actor_user_id'],
123
161
  'payload': json['payload'],
124
162
  'actor': json['actor'] == null ? undefined : UserInfoFromJSON(json['actor']),
163
+ 'subjectName': json['subject_name'] == null ? undefined : json['subject_name'],
164
+ 'subjectPath': json['subject_path'] == null ? undefined : json['subject_path'],
165
+ 'subjectObjectId': json['subject_object_id'] == null ? undefined : json['subject_object_id'],
166
+ 'subjectPartType': json['subject_part_type'] == null ? undefined : json['subject_part_type'],
167
+ 'references': json['references'] == null ? undefined : (mapValues(json['references'], ResolvedRefFromJSON)),
125
168
  };
126
169
  }
127
170
 
@@ -143,6 +186,11 @@ export function EventResponseToJSONTyped(value?: EventResponse | null, ignoreDis
143
186
  'actor_user_id': value['actorUserId'],
144
187
  'payload': value['payload'],
145
188
  'actor': UserInfoToJSON(value['actor']),
189
+ 'subject_name': value['subjectName'],
190
+ 'subject_path': value['subjectPath'],
191
+ 'subject_object_id': value['subjectObjectId'],
192
+ 'subject_part_type': value['subjectPartType'],
193
+ 'references': value['references'] == null ? undefined : (mapValues(value['references'], ResolvedRefToJSON)),
146
194
  };
147
195
  }
148
196
 
@@ -14,25 +14,25 @@
14
14
 
15
15
  import { mapValues } from '../runtime';
16
16
  /**
17
- * A single script bundled under a skill's ``scripts/`` folder.
17
+ * Reorder a path part within its sibling list.
18
18
  * @export
19
- * @interface SkillScriptFile
19
+ * @interface ReorderPathPartRequest
20
20
  */
21
- export interface SkillScriptFile {
21
+ export interface ReorderPathPartRequest {
22
22
  /**
23
- * Script file name, e.g. inspect.py
23
+ * Place this node immediately after the given sibling PathPart id (must share the same parent). Pass the current tail's id to move to the end. Requires move_to_head=false.
24
24
  * @type {string}
25
- * @memberof SkillScriptFile
25
+ * @memberof ReorderPathPartRequest
26
26
  */
27
- name: string;
27
+ prevSiblingPathId?: string | null;
28
28
  /**
29
- * Script file contents (UTF-8 text).
30
- * @type {string}
31
- * @memberof SkillScriptFile
29
+ * Move this node to the head of its sibling list.
30
+ * @type {boolean}
31
+ * @memberof ReorderPathPartRequest
32
32
  */
33
- content: string;
33
+ moveToHead?: boolean;
34
34
  }
35
- export const SkillScriptFilePropertyValidationAttributesMap: {
35
+ export const ReorderPathPartRequestPropertyValidationAttributesMap: {
36
36
  [property: string]: {
37
37
  maxLength?: number,
38
38
  minLength?: number,
@@ -47,49 +47,44 @@ export const SkillScriptFilePropertyValidationAttributesMap: {
47
47
  uniqueItems?: boolean
48
48
  }
49
49
  } = {
50
- name: {
51
- maxLength: 255,
52
- },
53
50
  }
54
51
 
55
52
 
56
53
  /**
57
- * Check if a given object implements the SkillScriptFile interface.
54
+ * Check if a given object implements the ReorderPathPartRequest interface.
58
55
  */
59
- export function instanceOfSkillScriptFile(value: object): value is SkillScriptFile {
60
- if (!('name' in value) || value['name'] === undefined) return false;
61
- if (!('content' in value) || value['content'] === undefined) return false;
56
+ export function instanceOfReorderPathPartRequest(value: object): value is ReorderPathPartRequest {
62
57
  return true;
63
58
  }
64
59
 
65
- export function SkillScriptFileFromJSON(json: any): SkillScriptFile {
66
- return SkillScriptFileFromJSONTyped(json, false);
60
+ export function ReorderPathPartRequestFromJSON(json: any): ReorderPathPartRequest {
61
+ return ReorderPathPartRequestFromJSONTyped(json, false);
67
62
  }
68
63
 
69
- export function SkillScriptFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): SkillScriptFile {
64
+ export function ReorderPathPartRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReorderPathPartRequest {
70
65
  if (json == null) {
71
66
  return json;
72
67
  }
73
68
  return {
74
69
 
75
- 'name': json['name'],
76
- 'content': json['content'],
70
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
71
+ 'moveToHead': json['move_to_head'] == null ? undefined : json['move_to_head'],
77
72
  };
78
73
  }
79
74
 
80
- export function SkillScriptFileToJSON(json: any): SkillScriptFile {
81
- return SkillScriptFileToJSONTyped(json, false);
75
+ export function ReorderPathPartRequestToJSON(json: any): ReorderPathPartRequest {
76
+ return ReorderPathPartRequestToJSONTyped(json, false);
82
77
  }
83
78
 
84
- export function SkillScriptFileToJSONTyped(value?: SkillScriptFile | null, ignoreDiscriminator: boolean = false): any {
79
+ export function ReorderPathPartRequestToJSONTyped(value?: ReorderPathPartRequest | null, ignoreDiscriminator: boolean = false): any {
85
80
  if (value == null) {
86
81
  return value;
87
82
  }
88
83
 
89
84
  return {
90
85
 
91
- 'name': value['name'],
92
- 'content': value['content'],
86
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
87
+ 'move_to_head': value['moveToHead'],
93
88
  };
94
89
  }
95
90
 
@@ -0,0 +1,125 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * One id resolved to a human-readable, linkable entity.
18
+ *
19
+ * Every UUID that appears in an event (its subject, its actor, and any id
20
+ * inside the payload) resolves to one of these so the frontend can render a
21
+ * name and a link instead of a bare UUID. ``object_id`` is what the frontend
22
+ * routes on: a PDO id for a path_part (never the internal path_part_id), or
23
+ * the user id for a user.
24
+ * @export
25
+ * @interface ResolvedRef
26
+ */
27
+ export interface ResolvedRef {
28
+ /**
29
+ *
30
+ * @type {ResolvedRefEntityTypeEnum}
31
+ * @memberof ResolvedRef
32
+ */
33
+ entityType: ResolvedRefEntityTypeEnum;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ResolvedRef
38
+ */
39
+ objectId: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ResolvedRef
44
+ */
45
+ displayName?: string | null;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof ResolvedRef
50
+ */
51
+ partType?: string | null;
52
+ }
53
+
54
+
55
+ /**
56
+ * @export
57
+ */
58
+ export const ResolvedRefEntityTypeEnum = {
59
+ PathPart: 'path_part',
60
+ User: 'user'
61
+ } as const;
62
+ export type ResolvedRefEntityTypeEnum = typeof ResolvedRefEntityTypeEnum[keyof typeof ResolvedRefEntityTypeEnum];
63
+
64
+ export const ResolvedRefPropertyValidationAttributesMap: {
65
+ [property: string]: {
66
+ maxLength?: number,
67
+ minLength?: number,
68
+ pattern?: string,
69
+ maximum?: number,
70
+ exclusiveMaximum?: boolean,
71
+ minimum?: number,
72
+ exclusiveMinimum?: boolean,
73
+ multipleOf?: number,
74
+ maxItems?: number,
75
+ minItems?: number,
76
+ uniqueItems?: boolean
77
+ }
78
+ } = {
79
+ }
80
+
81
+
82
+ /**
83
+ * Check if a given object implements the ResolvedRef interface.
84
+ */
85
+ export function instanceOfResolvedRef(value: object): value is ResolvedRef {
86
+ if (!('entityType' in value) || value['entityType'] === undefined) return false;
87
+ if (!('objectId' in value) || value['objectId'] === undefined) return false;
88
+ return true;
89
+ }
90
+
91
+ export function ResolvedRefFromJSON(json: any): ResolvedRef {
92
+ return ResolvedRefFromJSONTyped(json, false);
93
+ }
94
+
95
+ export function ResolvedRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResolvedRef {
96
+ if (json == null) {
97
+ return json;
98
+ }
99
+ return {
100
+
101
+ 'entityType': json['entity_type'],
102
+ 'objectId': json['object_id'],
103
+ 'displayName': json['display_name'] == null ? undefined : json['display_name'],
104
+ 'partType': json['part_type'] == null ? undefined : json['part_type'],
105
+ };
106
+ }
107
+
108
+ export function ResolvedRefToJSON(json: any): ResolvedRef {
109
+ return ResolvedRefToJSONTyped(json, false);
110
+ }
111
+
112
+ export function ResolvedRefToJSONTyped(value?: ResolvedRef | null, ignoreDiscriminator: boolean = false): any {
113
+ if (value == null) {
114
+ return value;
115
+ }
116
+
117
+ return {
118
+
119
+ 'entity_type': value['entityType'],
120
+ 'object_id': value['objectId'],
121
+ 'display_name': value['displayName'],
122
+ 'part_type': value['partType'],
123
+ };
124
+ }
125
+
@@ -0,0 +1,118 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * One file in a skill bundle, at a path relative to the skill root.
18
+ *
19
+ * Skills carry arbitrary trees (``scripts/office/validate.py``,
20
+ * ``references/guide.md``, ``assets/logo.png``), so binary files are carried
21
+ * base64-encoded rather than excluded.
22
+ * @export
23
+ * @interface SkillFile
24
+ */
25
+ export interface SkillFile {
26
+ /**
27
+ * Path relative to the skill root, e.g. scripts/office/run.py
28
+ * @type {string}
29
+ * @memberof SkillFile
30
+ */
31
+ path: string;
32
+ /**
33
+ * UTF-8 text, or base64-encoded bytes when encoding=base64.
34
+ * @type {string}
35
+ * @memberof SkillFile
36
+ */
37
+ content: string;
38
+ /**
39
+ * How `content` is encoded.
40
+ * @type {SkillFileEncodingEnum}
41
+ * @memberof SkillFile
42
+ */
43
+ encoding?: SkillFileEncodingEnum;
44
+ }
45
+
46
+
47
+ /**
48
+ * @export
49
+ */
50
+ export const SkillFileEncodingEnum = {
51
+ Utf8: 'utf-8',
52
+ Base64: 'base64'
53
+ } as const;
54
+ export type SkillFileEncodingEnum = typeof SkillFileEncodingEnum[keyof typeof SkillFileEncodingEnum];
55
+
56
+ export const SkillFilePropertyValidationAttributesMap: {
57
+ [property: string]: {
58
+ maxLength?: number,
59
+ minLength?: number,
60
+ pattern?: string,
61
+ maximum?: number,
62
+ exclusiveMaximum?: boolean,
63
+ minimum?: number,
64
+ exclusiveMinimum?: boolean,
65
+ multipleOf?: number,
66
+ maxItems?: number,
67
+ minItems?: number,
68
+ uniqueItems?: boolean
69
+ }
70
+ } = {
71
+ path: {
72
+ maxLength: 1024,
73
+ },
74
+ }
75
+
76
+
77
+ /**
78
+ * Check if a given object implements the SkillFile interface.
79
+ */
80
+ export function instanceOfSkillFile(value: object): value is SkillFile {
81
+ if (!('path' in value) || value['path'] === undefined) return false;
82
+ if (!('content' in value) || value['content'] === undefined) return false;
83
+ return true;
84
+ }
85
+
86
+ export function SkillFileFromJSON(json: any): SkillFile {
87
+ return SkillFileFromJSONTyped(json, false);
88
+ }
89
+
90
+ export function SkillFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): SkillFile {
91
+ if (json == null) {
92
+ return json;
93
+ }
94
+ return {
95
+
96
+ 'path': json['path'],
97
+ 'content': json['content'],
98
+ 'encoding': json['encoding'] == null ? undefined : json['encoding'],
99
+ };
100
+ }
101
+
102
+ export function SkillFileToJSON(json: any): SkillFile {
103
+ return SkillFileToJSONTyped(json, false);
104
+ }
105
+
106
+ export function SkillFileToJSONTyped(value?: SkillFile | null, ignoreDiscriminator: boolean = false): any {
107
+ if (value == null) {
108
+ return value;
109
+ }
110
+
111
+ return {
112
+
113
+ 'path': value['path'],
114
+ 'content': value['content'],
115
+ 'encoding': value['encoding'],
116
+ };
117
+ }
118
+
@@ -20,13 +20,13 @@ import {
20
20
  ItemPermissionsToJSON,
21
21
  ItemPermissionsToJSONTyped,
22
22
  } from './ItemPermissions';
23
- import type { SkillScriptFile } from './SkillScriptFile';
23
+ import type { SkillFile } from './SkillFile';
24
24
  import {
25
- SkillScriptFileFromJSON,
26
- SkillScriptFileFromJSONTyped,
27
- SkillScriptFileToJSON,
28
- SkillScriptFileToJSONTyped,
29
- } from './SkillScriptFile';
25
+ SkillFileFromJSON,
26
+ SkillFileFromJSONTyped,
27
+ SkillFileToJSON,
28
+ SkillFileToJSONTyped,
29
+ } from './SkillFile';
30
30
  import type { PathPartApprovalState } from './PathPartApprovalState';
31
31
  import {
32
32
  PathPartApprovalStateFromJSON,
@@ -103,17 +103,17 @@ export interface SkillResponse {
103
103
  */
104
104
  skillMd?: string | null;
105
105
  /**
106
- * Bundled script file names; populated on the detail read and on mutation responses, empty on list.
106
+ * Bundle file paths relative to the skill root (SKILL.md excluded); populated on the detail read and on mutation responses, empty on list.
107
107
  * @type {Array<string>}
108
108
  * @memberof SkillResponse
109
109
  */
110
- scriptNames?: Array<string>;
110
+ filePaths?: Array<string>;
111
111
  /**
112
- * Bundled scripts with their contents; populated only on the detail read (GET /skills/{id}), null on list. Lets the editor read the current script set so a PATCH can safely resubmit the whole set.
113
- * @type {Array<SkillScriptFile>}
112
+ * Bundle files with their contents; populated only on the detail read (GET /skills/{id}), null on list. Lets the editor read the current file set so a PATCH can safely resubmit the whole set.
113
+ * @type {Array<SkillFile>}
114
114
  * @memberof SkillResponse
115
115
  */
116
- scripts?: Array<SkillScriptFile> | null;
116
+ files?: Array<SkillFile> | null;
117
117
  /**
118
118
  * Whether the working copy differs from the active published version. Always present (incl. list responses) so the UI can flag a skill with an unpublished draft.
119
119
  * @type {boolean}
@@ -215,8 +215,8 @@ export function SkillResponseFromJSONTyped(json: any, ignoreDiscriminator: boole
215
215
  'name': json['name'],
216
216
  'description': json['description'],
217
217
  'skillMd': json['skill_md'] == null ? undefined : json['skill_md'],
218
- 'scriptNames': json['script_names'] == null ? undefined : json['script_names'],
219
- 'scripts': json['scripts'] == null ? undefined : ((json['scripts'] as Array<any>).map(SkillScriptFileFromJSON)),
218
+ 'filePaths': json['file_paths'] == null ? undefined : json['file_paths'],
219
+ 'files': json['files'] == null ? undefined : ((json['files'] as Array<any>).map(SkillFileFromJSON)),
220
220
  'hasUnpublishedChanges': json['has_unpublished_changes'] == null ? undefined : json['has_unpublished_changes'],
221
221
  'approvalState': PathPartApprovalStateFromJSON(json['approval_state']),
222
222
  'owner': json['owner'] == null ? undefined : UserInfoFromJSON(json['owner']),
@@ -246,8 +246,8 @@ export function SkillResponseToJSONTyped(value?: SkillResponse | null, ignoreDis
246
246
  'name': value['name'],
247
247
  'description': value['description'],
248
248
  'skill_md': value['skillMd'],
249
- 'script_names': value['scriptNames'],
250
- 'scripts': value['scripts'] == null ? undefined : ((value['scripts'] as Array<any>).map(SkillScriptFileToJSON)),
249
+ 'file_paths': value['filePaths'],
250
+ 'files': value['files'] == null ? undefined : ((value['files'] as Array<any>).map(SkillFileToJSON)),
251
251
  'has_unpublished_changes': value['hasUnpublishedChanges'],
252
252
  'approval_state': PathPartApprovalStateToJSON(value['approvalState']),
253
253
  'owner': UserInfoToJSON(value['owner']),