@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
@@ -227,7 +227,9 @@ export * from './ProposeMemoryChunkRequest';
227
227
  export * from './ProposedMemoryChunkResponse';
228
228
  export * from './ReasoningPart';
229
229
  export * from './ReferenceType';
230
+ export * from './ReorderPathPartRequest';
230
231
  export * from './RequestPhoneChangeRequest';
232
+ export * from './ResolvedRef';
231
233
  export * from './ResolvedReferenceInput';
232
234
  export * from './ResolvedReferenceOutput';
233
235
  export * from './ResponseSendPwResetEmail';
@@ -255,9 +257,9 @@ export * from './SetApprovalStateRequest';
255
257
  export * from './SetWorkflowRunApprovalRequest';
256
258
  export * from './SheetVisibilityChange';
257
259
  export * from './SignInRequest';
260
+ export * from './SkillFile';
258
261
  export * from './SkillOrder';
259
262
  export * from './SkillResponse';
260
- export * from './SkillScriptFile';
261
263
  export * from './SkillSearchResult';
262
264
  export * from './SkillVersionResponse';
263
265
  export * from './SortDirection';
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { SkillScriptFile } from './SkillScriptFile';
12
+ import type { SkillFile } from './SkillFile';
13
13
  /**
14
14
  * Author a skill from a SKILL.md bundle.
15
15
  * @export
@@ -29,11 +29,11 @@ export interface CreateSkillRequest {
29
29
  */
30
30
  skillMd: string;
31
31
  /**
32
- * Optional scripts bundled under the skill's scripts/ folder.
33
- * @type {Array<SkillScriptFile>}
32
+ * Optional bundle files at paths relative to the skill root (scripts/, references/, assets/, …). SKILL.md is supplied separately and must not be repeated here.
33
+ * @type {Array<SkillFile>}
34
34
  * @memberof CreateSkillRequest
35
35
  */
36
- scripts?: Array<SkillScriptFile>;
36
+ files?: Array<SkillFile>;
37
37
  }
38
38
  export declare const CreateSkillRequestPropertyValidationAttributesMap: {
39
39
  [property: string]: {
@@ -19,13 +19,13 @@ exports.CreateSkillRequestFromJSON = CreateSkillRequestFromJSON;
19
19
  exports.CreateSkillRequestFromJSONTyped = CreateSkillRequestFromJSONTyped;
20
20
  exports.CreateSkillRequestToJSON = CreateSkillRequestToJSON;
21
21
  exports.CreateSkillRequestToJSONTyped = CreateSkillRequestToJSONTyped;
22
- const SkillScriptFile_1 = require("./SkillScriptFile");
22
+ const SkillFile_1 = require("./SkillFile");
23
23
  exports.CreateSkillRequestPropertyValidationAttributesMap = {
24
24
  name: {
25
25
  maxLength: 255,
26
26
  },
27
- scripts: {
28
- maxItems: 50,
27
+ files: {
28
+ maxItems: 2000,
29
29
  uniqueItems: false,
30
30
  },
31
31
  };
@@ -49,7 +49,7 @@ function CreateSkillRequestFromJSONTyped(json, ignoreDiscriminator) {
49
49
  return {
50
50
  'name': json['name'],
51
51
  'skillMd': json['skill_md'],
52
- 'scripts': json['scripts'] == null ? undefined : (json['scripts'].map(SkillScriptFile_1.SkillScriptFileFromJSON)),
52
+ 'files': json['files'] == null ? undefined : (json['files'].map(SkillFile_1.SkillFileFromJSON)),
53
53
  };
54
54
  }
55
55
  function CreateSkillRequestToJSON(json) {
@@ -62,6 +62,6 @@ function CreateSkillRequestToJSONTyped(value, ignoreDiscriminator = false) {
62
62
  return {
63
63
  'name': value['name'],
64
64
  'skill_md': value['skillMd'],
65
- 'scripts': value['scripts'] == null ? undefined : (value['scripts'].map(SkillScriptFile_1.SkillScriptFileToJSON)),
65
+ 'files': value['files'] == null ? undefined : (value['files'].map(SkillFile_1.SkillFileToJSON)),
66
66
  };
67
67
  }
@@ -10,12 +10,14 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { UserInfo } from './UserInfo';
13
+ import type { ResolvedRef } from './ResolvedRef';
13
14
  /**
14
15
  * One event row, anchored to a path_part subject.
15
16
  *
16
17
  * ``kind`` is namespaced ``domain.action`` (e.g. ``workflow.approval``,
17
18
  * ``document.created``). ``payload`` is the domain-specific structured
18
- * JSON associated with the event.
19
+ * JSON associated with the event, stored verbatim and never rewritten —
20
+ * the human-readable resolution lives alongside it in ``references``.
19
21
  * @export
20
22
  * @interface EventResponse
21
23
  */
@@ -64,6 +66,38 @@ export interface EventResponse {
64
66
  * @memberof EventResponse
65
67
  */
66
68
  actor?: UserInfo | null;
69
+ /**
70
+ *
71
+ * @type {string}
72
+ * @memberof EventResponse
73
+ */
74
+ subjectName?: string | null;
75
+ /**
76
+ *
77
+ * @type {string}
78
+ * @memberof EventResponse
79
+ */
80
+ subjectPath?: string | null;
81
+ /**
82
+ *
83
+ * @type {string}
84
+ * @memberof EventResponse
85
+ */
86
+ subjectObjectId?: string | null;
87
+ /**
88
+ *
89
+ * @type {string}
90
+ * @memberof EventResponse
91
+ */
92
+ subjectPartType?: string | null;
93
+ /**
94
+ *
95
+ * @type {{ [key: string]: ResolvedRef; }}
96
+ * @memberof EventResponse
97
+ */
98
+ references?: {
99
+ [key: string]: ResolvedRef;
100
+ };
67
101
  }
68
102
  export declare const EventResponsePropertyValidationAttributesMap: {
69
103
  [property: string]: {
@@ -19,7 +19,9 @@ exports.EventResponseFromJSON = EventResponseFromJSON;
19
19
  exports.EventResponseFromJSONTyped = EventResponseFromJSONTyped;
20
20
  exports.EventResponseToJSON = EventResponseToJSON;
21
21
  exports.EventResponseToJSONTyped = EventResponseToJSONTyped;
22
+ const runtime_1 = require("../runtime");
22
23
  const UserInfo_1 = require("./UserInfo");
24
+ const ResolvedRef_1 = require("./ResolvedRef");
23
25
  exports.EventResponsePropertyValidationAttributesMap = {};
24
26
  /**
25
27
  * Check if a given object implements the EventResponse interface.
@@ -54,6 +56,11 @@ function EventResponseFromJSONTyped(json, ignoreDiscriminator) {
54
56
  'actorUserId': json['actor_user_id'],
55
57
  'payload': json['payload'],
56
58
  'actor': json['actor'] == null ? undefined : (0, UserInfo_1.UserInfoFromJSON)(json['actor']),
59
+ 'subjectName': json['subject_name'] == null ? undefined : json['subject_name'],
60
+ 'subjectPath': json['subject_path'] == null ? undefined : json['subject_path'],
61
+ 'subjectObjectId': json['subject_object_id'] == null ? undefined : json['subject_object_id'],
62
+ 'subjectPartType': json['subject_part_type'] == null ? undefined : json['subject_part_type'],
63
+ 'references': json['references'] == null ? undefined : ((0, runtime_1.mapValues)(json['references'], ResolvedRef_1.ResolvedRefFromJSON)),
57
64
  };
58
65
  }
59
66
  function EventResponseToJSON(json) {
@@ -71,5 +78,10 @@ function EventResponseToJSONTyped(value, ignoreDiscriminator = false) {
71
78
  'actor_user_id': value['actorUserId'],
72
79
  'payload': value['payload'],
73
80
  'actor': (0, UserInfo_1.UserInfoToJSON)(value['actor']),
81
+ 'subject_name': value['subjectName'],
82
+ 'subject_path': value['subjectPath'],
83
+ 'subject_object_id': value['subjectObjectId'],
84
+ 'subject_part_type': value['subjectPartType'],
85
+ 'references': value['references'] == null ? undefined : ((0, runtime_1.mapValues)(value['references'], ResolvedRef_1.ResolvedRefToJSON)),
74
86
  };
75
87
  }
@@ -10,25 +10,25 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * A single script bundled under a skill's ``scripts/`` folder.
13
+ * Reorder a path part within its sibling list.
14
14
  * @export
15
- * @interface SkillScriptFile
15
+ * @interface ReorderPathPartRequest
16
16
  */
17
- export interface SkillScriptFile {
17
+ export interface ReorderPathPartRequest {
18
18
  /**
19
- * Script file name, e.g. inspect.py
19
+ * 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.
20
20
  * @type {string}
21
- * @memberof SkillScriptFile
21
+ * @memberof ReorderPathPartRequest
22
22
  */
23
- name: string;
23
+ prevSiblingPathId?: string | null;
24
24
  /**
25
- * Script file contents (UTF-8 text).
26
- * @type {string}
27
- * @memberof SkillScriptFile
25
+ * Move this node to the head of its sibling list.
26
+ * @type {boolean}
27
+ * @memberof ReorderPathPartRequest
28
28
  */
29
- content: string;
29
+ moveToHead?: boolean;
30
30
  }
31
- export declare const SkillScriptFilePropertyValidationAttributesMap: {
31
+ export declare const ReorderPathPartRequestPropertyValidationAttributesMap: {
32
32
  [property: string]: {
33
33
  maxLength?: number;
34
34
  minLength?: number;
@@ -44,10 +44,10 @@ export declare const SkillScriptFilePropertyValidationAttributesMap: {
44
44
  };
45
45
  };
46
46
  /**
47
- * Check if a given object implements the SkillScriptFile interface.
47
+ * Check if a given object implements the ReorderPathPartRequest interface.
48
48
  */
49
- export declare function instanceOfSkillScriptFile(value: object): value is SkillScriptFile;
50
- export declare function SkillScriptFileFromJSON(json: any): SkillScriptFile;
51
- export declare function SkillScriptFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): SkillScriptFile;
52
- export declare function SkillScriptFileToJSON(json: any): SkillScriptFile;
53
- export declare function SkillScriptFileToJSONTyped(value?: SkillScriptFile | null, ignoreDiscriminator?: boolean): any;
49
+ export declare function instanceOfReorderPathPartRequest(value: object): value is ReorderPathPartRequest;
50
+ export declare function ReorderPathPartRequestFromJSON(json: any): ReorderPathPartRequest;
51
+ export declare function ReorderPathPartRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReorderPathPartRequest;
52
+ export declare function ReorderPathPartRequestToJSON(json: any): ReorderPathPartRequest;
53
+ export declare function ReorderPathPartRequestToJSONTyped(value?: ReorderPathPartRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ReorderPathPartRequestPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfReorderPathPartRequest = instanceOfReorderPathPartRequest;
18
+ exports.ReorderPathPartRequestFromJSON = ReorderPathPartRequestFromJSON;
19
+ exports.ReorderPathPartRequestFromJSONTyped = ReorderPathPartRequestFromJSONTyped;
20
+ exports.ReorderPathPartRequestToJSON = ReorderPathPartRequestToJSON;
21
+ exports.ReorderPathPartRequestToJSONTyped = ReorderPathPartRequestToJSONTyped;
22
+ exports.ReorderPathPartRequestPropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the ReorderPathPartRequest interface.
25
+ */
26
+ function instanceOfReorderPathPartRequest(value) {
27
+ return true;
28
+ }
29
+ function ReorderPathPartRequestFromJSON(json) {
30
+ return ReorderPathPartRequestFromJSONTyped(json, false);
31
+ }
32
+ function ReorderPathPartRequestFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
38
+ 'moveToHead': json['move_to_head'] == null ? undefined : json['move_to_head'],
39
+ };
40
+ }
41
+ function ReorderPathPartRequestToJSON(json) {
42
+ return ReorderPathPartRequestToJSONTyped(json, false);
43
+ }
44
+ function ReorderPathPartRequestToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
50
+ 'move_to_head': value['moveToHead'],
51
+ };
52
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * One id resolved to a human-readable, linkable entity.
14
+ *
15
+ * Every UUID that appears in an event (its subject, its actor, and any id
16
+ * inside the payload) resolves to one of these so the frontend can render a
17
+ * name and a link instead of a bare UUID. ``object_id`` is what the frontend
18
+ * routes on: a PDO id for a path_part (never the internal path_part_id), or
19
+ * the user id for a user.
20
+ * @export
21
+ * @interface ResolvedRef
22
+ */
23
+ export interface ResolvedRef {
24
+ /**
25
+ *
26
+ * @type {ResolvedRefEntityTypeEnum}
27
+ * @memberof ResolvedRef
28
+ */
29
+ entityType: ResolvedRefEntityTypeEnum;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ResolvedRef
34
+ */
35
+ objectId: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ResolvedRef
40
+ */
41
+ displayName?: string | null;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof ResolvedRef
46
+ */
47
+ partType?: string | null;
48
+ }
49
+ /**
50
+ * @export
51
+ */
52
+ export declare const ResolvedRefEntityTypeEnum: {
53
+ readonly PathPart: 'path_part';
54
+ readonly User: 'user';
55
+ };
56
+ export type ResolvedRefEntityTypeEnum = typeof ResolvedRefEntityTypeEnum[keyof typeof ResolvedRefEntityTypeEnum];
57
+ export declare const ResolvedRefPropertyValidationAttributesMap: {
58
+ [property: string]: {
59
+ maxLength?: number;
60
+ minLength?: number;
61
+ pattern?: string;
62
+ maximum?: number;
63
+ exclusiveMaximum?: boolean;
64
+ minimum?: number;
65
+ exclusiveMinimum?: boolean;
66
+ multipleOf?: number;
67
+ maxItems?: number;
68
+ minItems?: number;
69
+ uniqueItems?: boolean;
70
+ };
71
+ };
72
+ /**
73
+ * Check if a given object implements the ResolvedRef interface.
74
+ */
75
+ export declare function instanceOfResolvedRef(value: object): value is ResolvedRef;
76
+ export declare function ResolvedRefFromJSON(json: any): ResolvedRef;
77
+ export declare function ResolvedRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ResolvedRef;
78
+ export declare function ResolvedRefToJSON(json: any): ResolvedRef;
79
+ export declare function ResolvedRefToJSONTyped(value?: ResolvedRef | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ResolvedRefPropertyValidationAttributesMap = exports.ResolvedRefEntityTypeEnum = void 0;
17
+ exports.instanceOfResolvedRef = instanceOfResolvedRef;
18
+ exports.ResolvedRefFromJSON = ResolvedRefFromJSON;
19
+ exports.ResolvedRefFromJSONTyped = ResolvedRefFromJSONTyped;
20
+ exports.ResolvedRefToJSON = ResolvedRefToJSON;
21
+ exports.ResolvedRefToJSONTyped = ResolvedRefToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.ResolvedRefEntityTypeEnum = {
26
+ PathPart: 'path_part',
27
+ User: 'user'
28
+ };
29
+ exports.ResolvedRefPropertyValidationAttributesMap = {};
30
+ /**
31
+ * Check if a given object implements the ResolvedRef interface.
32
+ */
33
+ function instanceOfResolvedRef(value) {
34
+ if (!('entityType' in value) || value['entityType'] === undefined)
35
+ return false;
36
+ if (!('objectId' in value) || value['objectId'] === undefined)
37
+ return false;
38
+ return true;
39
+ }
40
+ function ResolvedRefFromJSON(json) {
41
+ return ResolvedRefFromJSONTyped(json, false);
42
+ }
43
+ function ResolvedRefFromJSONTyped(json, ignoreDiscriminator) {
44
+ if (json == null) {
45
+ return json;
46
+ }
47
+ return {
48
+ 'entityType': json['entity_type'],
49
+ 'objectId': json['object_id'],
50
+ 'displayName': json['display_name'] == null ? undefined : json['display_name'],
51
+ 'partType': json['part_type'] == null ? undefined : json['part_type'],
52
+ };
53
+ }
54
+ function ResolvedRefToJSON(json) {
55
+ return ResolvedRefToJSONTyped(json, false);
56
+ }
57
+ function ResolvedRefToJSONTyped(value, ignoreDiscriminator = false) {
58
+ if (value == null) {
59
+ return value;
60
+ }
61
+ return {
62
+ 'entity_type': value['entityType'],
63
+ 'object_id': value['objectId'],
64
+ 'display_name': value['displayName'],
65
+ 'part_type': value['partType'],
66
+ };
67
+ }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * One file in a skill bundle, at a path relative to the skill root.
14
+ *
15
+ * Skills carry arbitrary trees (``scripts/office/validate.py``,
16
+ * ``references/guide.md``, ``assets/logo.png``), so binary files are carried
17
+ * base64-encoded rather than excluded.
18
+ * @export
19
+ * @interface SkillFile
20
+ */
21
+ export interface SkillFile {
22
+ /**
23
+ * Path relative to the skill root, e.g. scripts/office/run.py
24
+ * @type {string}
25
+ * @memberof SkillFile
26
+ */
27
+ path: string;
28
+ /**
29
+ * UTF-8 text, or base64-encoded bytes when encoding=base64.
30
+ * @type {string}
31
+ * @memberof SkillFile
32
+ */
33
+ content: string;
34
+ /**
35
+ * How `content` is encoded.
36
+ * @type {SkillFileEncodingEnum}
37
+ * @memberof SkillFile
38
+ */
39
+ encoding?: SkillFileEncodingEnum;
40
+ }
41
+ /**
42
+ * @export
43
+ */
44
+ export declare const SkillFileEncodingEnum: {
45
+ readonly Utf8: 'utf-8';
46
+ readonly Base64: 'base64';
47
+ };
48
+ export type SkillFileEncodingEnum = typeof SkillFileEncodingEnum[keyof typeof SkillFileEncodingEnum];
49
+ export declare const SkillFilePropertyValidationAttributesMap: {
50
+ [property: string]: {
51
+ maxLength?: number;
52
+ minLength?: number;
53
+ pattern?: string;
54
+ maximum?: number;
55
+ exclusiveMaximum?: boolean;
56
+ minimum?: number;
57
+ exclusiveMinimum?: boolean;
58
+ multipleOf?: number;
59
+ maxItems?: number;
60
+ minItems?: number;
61
+ uniqueItems?: boolean;
62
+ };
63
+ };
64
+ /**
65
+ * Check if a given object implements the SkillFile interface.
66
+ */
67
+ export declare function instanceOfSkillFile(value: object): value is SkillFile;
68
+ export declare function SkillFileFromJSON(json: any): SkillFile;
69
+ export declare function SkillFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): SkillFile;
70
+ export declare function SkillFileToJSON(json: any): SkillFile;
71
+ export declare function SkillFileToJSONTyped(value?: SkillFile | null, ignoreDiscriminator?: boolean): any;
@@ -13,48 +13,57 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.SkillScriptFilePropertyValidationAttributesMap = void 0;
17
- exports.instanceOfSkillScriptFile = instanceOfSkillScriptFile;
18
- exports.SkillScriptFileFromJSON = SkillScriptFileFromJSON;
19
- exports.SkillScriptFileFromJSONTyped = SkillScriptFileFromJSONTyped;
20
- exports.SkillScriptFileToJSON = SkillScriptFileToJSON;
21
- exports.SkillScriptFileToJSONTyped = SkillScriptFileToJSONTyped;
22
- exports.SkillScriptFilePropertyValidationAttributesMap = {
23
- name: {
24
- maxLength: 255,
16
+ exports.SkillFilePropertyValidationAttributesMap = exports.SkillFileEncodingEnum = void 0;
17
+ exports.instanceOfSkillFile = instanceOfSkillFile;
18
+ exports.SkillFileFromJSON = SkillFileFromJSON;
19
+ exports.SkillFileFromJSONTyped = SkillFileFromJSONTyped;
20
+ exports.SkillFileToJSON = SkillFileToJSON;
21
+ exports.SkillFileToJSONTyped = SkillFileToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.SkillFileEncodingEnum = {
26
+ Utf8: 'utf-8',
27
+ Base64: 'base64'
28
+ };
29
+ exports.SkillFilePropertyValidationAttributesMap = {
30
+ path: {
31
+ maxLength: 1024,
25
32
  },
26
33
  };
27
34
  /**
28
- * Check if a given object implements the SkillScriptFile interface.
35
+ * Check if a given object implements the SkillFile interface.
29
36
  */
30
- function instanceOfSkillScriptFile(value) {
31
- if (!('name' in value) || value['name'] === undefined)
37
+ function instanceOfSkillFile(value) {
38
+ if (!('path' in value) || value['path'] === undefined)
32
39
  return false;
33
40
  if (!('content' in value) || value['content'] === undefined)
34
41
  return false;
35
42
  return true;
36
43
  }
37
- function SkillScriptFileFromJSON(json) {
38
- return SkillScriptFileFromJSONTyped(json, false);
44
+ function SkillFileFromJSON(json) {
45
+ return SkillFileFromJSONTyped(json, false);
39
46
  }
40
- function SkillScriptFileFromJSONTyped(json, ignoreDiscriminator) {
47
+ function SkillFileFromJSONTyped(json, ignoreDiscriminator) {
41
48
  if (json == null) {
42
49
  return json;
43
50
  }
44
51
  return {
45
- 'name': json['name'],
52
+ 'path': json['path'],
46
53
  'content': json['content'],
54
+ 'encoding': json['encoding'] == null ? undefined : json['encoding'],
47
55
  };
48
56
  }
49
- function SkillScriptFileToJSON(json) {
50
- return SkillScriptFileToJSONTyped(json, false);
57
+ function SkillFileToJSON(json) {
58
+ return SkillFileToJSONTyped(json, false);
51
59
  }
52
- function SkillScriptFileToJSONTyped(value, ignoreDiscriminator = false) {
60
+ function SkillFileToJSONTyped(value, ignoreDiscriminator = false) {
53
61
  if (value == null) {
54
62
  return value;
55
63
  }
56
64
  return {
57
- 'name': value['name'],
65
+ 'path': value['path'],
58
66
  'content': value['content'],
67
+ 'encoding': value['encoding'],
59
68
  };
60
69
  }
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { ItemPermissions } from './ItemPermissions';
13
- import type { SkillScriptFile } from './SkillScriptFile';
13
+ import type { SkillFile } from './SkillFile';
14
14
  import type { PathPartApprovalState } from './PathPartApprovalState';
15
15
  import type { UserInfo } from './UserInfo';
16
16
  /**
@@ -74,17 +74,17 @@ export interface SkillResponse {
74
74
  */
75
75
  skillMd?: string | null;
76
76
  /**
77
- * Bundled script file names; populated on the detail read and on mutation responses, empty on list.
77
+ * Bundle file paths relative to the skill root (SKILL.md excluded); populated on the detail read and on mutation responses, empty on list.
78
78
  * @type {Array<string>}
79
79
  * @memberof SkillResponse
80
80
  */
81
- scriptNames?: Array<string>;
81
+ filePaths?: Array<string>;
82
82
  /**
83
- * 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.
84
- * @type {Array<SkillScriptFile>}
83
+ * 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.
84
+ * @type {Array<SkillFile>}
85
85
  * @memberof SkillResponse
86
86
  */
87
- scripts?: Array<SkillScriptFile> | null;
87
+ files?: Array<SkillFile> | null;
88
88
  /**
89
89
  * 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.
90
90
  * @type {boolean}
@@ -20,7 +20,7 @@ exports.SkillResponseFromJSONTyped = SkillResponseFromJSONTyped;
20
20
  exports.SkillResponseToJSON = SkillResponseToJSON;
21
21
  exports.SkillResponseToJSONTyped = SkillResponseToJSONTyped;
22
22
  const ItemPermissions_1 = require("./ItemPermissions");
23
- const SkillScriptFile_1 = require("./SkillScriptFile");
23
+ const SkillFile_1 = require("./SkillFile");
24
24
  const PathPartApprovalState_1 = require("./PathPartApprovalState");
25
25
  const UserInfo_1 = require("./UserInfo");
26
26
  /**
@@ -73,8 +73,8 @@ function SkillResponseFromJSONTyped(json, ignoreDiscriminator) {
73
73
  'name': json['name'],
74
74
  'description': json['description'],
75
75
  'skillMd': json['skill_md'] == null ? undefined : json['skill_md'],
76
- 'scriptNames': json['script_names'] == null ? undefined : json['script_names'],
77
- 'scripts': json['scripts'] == null ? undefined : (json['scripts'].map(SkillScriptFile_1.SkillScriptFileFromJSON)),
76
+ 'filePaths': json['file_paths'] == null ? undefined : json['file_paths'],
77
+ 'files': json['files'] == null ? undefined : (json['files'].map(SkillFile_1.SkillFileFromJSON)),
78
78
  'hasUnpublishedChanges': json['has_unpublished_changes'] == null ? undefined : json['has_unpublished_changes'],
79
79
  'approvalState': (0, PathPartApprovalState_1.PathPartApprovalStateFromJSON)(json['approval_state']),
80
80
  'owner': json['owner'] == null ? undefined : (0, UserInfo_1.UserInfoFromJSON)(json['owner']),
@@ -100,8 +100,8 @@ function SkillResponseToJSONTyped(value, ignoreDiscriminator = false) {
100
100
  'name': value['name'],
101
101
  'description': value['description'],
102
102
  'skill_md': value['skillMd'],
103
- 'script_names': value['scriptNames'],
104
- 'scripts': value['scripts'] == null ? undefined : (value['scripts'].map(SkillScriptFile_1.SkillScriptFileToJSON)),
103
+ 'file_paths': value['filePaths'],
104
+ 'files': value['files'] == null ? undefined : (value['files'].map(SkillFile_1.SkillFileToJSON)),
105
105
  'has_unpublished_changes': value['hasUnpublishedChanges'],
106
106
  'approval_state': (0, PathPartApprovalState_1.PathPartApprovalStateToJSON)(value['approvalState']),
107
107
  'owner': (0, UserInfo_1.UserInfoToJSON)(value['owner']),