@knowledge-stack/ksapi 1.135.1 → 1.136.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 (144) hide show
  1. package/.openapi-generator/FILES +28 -4
  2. package/README.md +29 -4
  3. package/dist/apis/FoldersApi.d.ts +9 -9
  4. package/dist/apis/FoldersApi.js +2 -2
  5. package/dist/apis/SkillsApi.d.ts +579 -0
  6. package/dist/apis/SkillsApi.js +786 -0
  7. package/dist/apis/WorkflowDefinitionsApi.d.ts +3 -0
  8. package/dist/apis/WorkflowDefinitionsApi.js +3 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/apis/FoldersApi.d.ts +9 -9
  12. package/dist/esm/apis/FoldersApi.js +3 -3
  13. package/dist/esm/apis/SkillsApi.d.ts +579 -0
  14. package/dist/esm/apis/SkillsApi.js +749 -0
  15. package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +3 -0
  16. package/dist/esm/apis/WorkflowDefinitionsApi.js +3 -0
  17. package/dist/esm/apis/index.d.ts +1 -0
  18. package/dist/esm/apis/index.js +1 -0
  19. package/dist/esm/models/ActivateSkillVersionRequest.d.ts +47 -0
  20. package/dist/esm/models/ActivateSkillVersionRequest.js +42 -0
  21. package/dist/esm/models/CreateSkillRequest.d.ts +60 -0
  22. package/dist/esm/models/CreateSkillRequest.js +59 -0
  23. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
  24. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +6 -0
  25. package/dist/esm/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.d.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.d.ts} +9 -6
  26. package/dist/esm/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.js → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.js} +11 -6
  27. package/dist/esm/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.d.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.d.ts} +16 -16
  28. package/dist/esm/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.js → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.js} +12 -12
  29. package/dist/esm/models/PaginatedResponseSkillResponse.d.ts +66 -0
  30. package/dist/esm/models/PaginatedResponseSkillResponse.js +70 -0
  31. package/dist/esm/models/PartType.d.ts +1 -0
  32. package/dist/esm/models/PartType.js +2 -1
  33. package/dist/esm/models/ReferenceType.d.ts +1 -0
  34. package/dist/esm/models/ReferenceType.js +1 -0
  35. package/dist/esm/models/SearchSkillsRequest.d.ts +59 -0
  36. package/dist/esm/models/SearchSkillsRequest.js +64 -0
  37. package/dist/esm/models/SearchSkillsResponse.d.ts +48 -0
  38. package/dist/esm/models/SearchSkillsResponse.js +43 -0
  39. package/dist/esm/models/SkillOrder.d.ts +26 -0
  40. package/dist/esm/models/SkillOrder.js +44 -0
  41. package/dist/esm/models/SkillResponse.d.ts +147 -0
  42. package/dist/esm/models/SkillResponse.js +101 -0
  43. package/dist/esm/models/SkillScriptFile.d.ts +53 -0
  44. package/dist/esm/models/SkillScriptFile.js +52 -0
  45. package/dist/esm/models/SkillSearchResult.d.ts +71 -0
  46. package/dist/esm/models/SkillSearchResult.js +60 -0
  47. package/dist/esm/models/SkillVersionResponse.d.ts +71 -0
  48. package/dist/esm/models/SkillVersionResponse.js +58 -0
  49. package/dist/esm/models/UpdateSkillRequest.d.ts +54 -0
  50. package/dist/esm/models/UpdateSkillRequest.js +50 -0
  51. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
  52. package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +6 -0
  53. package/dist/esm/models/WorkflowDefinitionResponse.d.ts +6 -0
  54. package/dist/esm/models/WorkflowDefinitionResponse.js +2 -0
  55. package/dist/esm/models/WorkflowRunSnapshot.d.ts +6 -0
  56. package/dist/esm/models/WorkflowRunSnapshot.js +2 -0
  57. package/dist/esm/models/index.d.ts +13 -2
  58. package/dist/esm/models/index.js +13 -2
  59. package/dist/models/ActivateSkillVersionRequest.d.ts +47 -0
  60. package/dist/models/ActivateSkillVersionRequest.js +50 -0
  61. package/dist/models/CreateSkillRequest.d.ts +60 -0
  62. package/dist/models/CreateSkillRequest.js +67 -0
  63. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
  64. package/dist/models/CreateWorkflowDefinitionRequest.js +6 -0
  65. package/dist/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.d.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.d.ts} +9 -6
  66. package/dist/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.js → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.js} +15 -10
  67. package/dist/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.d.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.d.ts} +16 -16
  68. package/dist/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.js → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.js} +18 -18
  69. package/dist/models/PaginatedResponseSkillResponse.d.ts +66 -0
  70. package/dist/models/PaginatedResponseSkillResponse.js +78 -0
  71. package/dist/models/PartType.d.ts +1 -0
  72. package/dist/models/PartType.js +2 -1
  73. package/dist/models/ReferenceType.d.ts +1 -0
  74. package/dist/models/ReferenceType.js +1 -0
  75. package/dist/models/SearchSkillsRequest.d.ts +59 -0
  76. package/dist/models/SearchSkillsRequest.js +72 -0
  77. package/dist/models/SearchSkillsResponse.d.ts +48 -0
  78. package/dist/models/SearchSkillsResponse.js +51 -0
  79. package/dist/models/SkillOrder.d.ts +26 -0
  80. package/dist/models/SkillOrder.js +52 -0
  81. package/dist/models/SkillResponse.d.ts +147 -0
  82. package/dist/models/SkillResponse.js +109 -0
  83. package/dist/models/SkillScriptFile.d.ts +53 -0
  84. package/dist/models/SkillScriptFile.js +60 -0
  85. package/dist/models/SkillSearchResult.d.ts +71 -0
  86. package/dist/models/SkillSearchResult.js +68 -0
  87. package/dist/models/SkillVersionResponse.d.ts +71 -0
  88. package/dist/models/SkillVersionResponse.js +66 -0
  89. package/dist/models/UpdateSkillRequest.d.ts +54 -0
  90. package/dist/models/UpdateSkillRequest.js +58 -0
  91. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
  92. package/dist/models/UpdateWorkflowDefinitionRequest.js +6 -0
  93. package/dist/models/WorkflowDefinitionResponse.d.ts +6 -0
  94. package/dist/models/WorkflowDefinitionResponse.js +2 -0
  95. package/dist/models/WorkflowRunSnapshot.d.ts +6 -0
  96. package/dist/models/WorkflowRunSnapshot.js +2 -0
  97. package/dist/models/index.d.ts +13 -2
  98. package/dist/models/index.js +13 -2
  99. package/docs/ActivateSkillVersionRequest.md +35 -0
  100. package/docs/ChunksApi.md +1 -1
  101. package/docs/CreateSkillRequest.md +39 -0
  102. package/docs/CreateWorkflowDefinitionRequest.md +2 -0
  103. package/docs/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.md → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md} +12 -4
  104. package/docs/FoldersApi.md +4 -4
  105. package/docs/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.md → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.md} +5 -5
  106. package/docs/PaginatedResponseSkillResponse.md +40 -0
  107. package/docs/SearchSkillsRequest.md +39 -0
  108. package/docs/SearchSkillsResponse.md +34 -0
  109. package/docs/SkillOrder.md +33 -0
  110. package/docs/SkillResponse.md +65 -0
  111. package/docs/SkillScriptFile.md +37 -0
  112. package/docs/SkillSearchResult.md +43 -0
  113. package/docs/SkillVersionResponse.md +43 -0
  114. package/docs/SkillsApi.md +1093 -0
  115. package/docs/UpdateSkillRequest.md +37 -0
  116. package/docs/UpdateWorkflowDefinitionRequest.md +2 -0
  117. package/docs/WorkflowDefinitionResponse.md +2 -0
  118. package/docs/WorkflowDefinitionsApi.md +4 -1
  119. package/docs/WorkflowRunSnapshot.md +2 -0
  120. package/package.json +1 -1
  121. package/src/apis/FoldersApi.ts +13 -13
  122. package/src/apis/SkillsApi.ts +1321 -0
  123. package/src/apis/WorkflowDefinitionsApi.ts +7 -0
  124. package/src/apis/index.ts +1 -0
  125. package/src/models/ActivateSkillVersionRequest.ts +82 -0
  126. package/src/models/CreateSkillRequest.ts +115 -0
  127. package/src/models/CreateWorkflowDefinitionRequest.ts +12 -0
  128. package/src/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.ts} +19 -8
  129. package/src/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.ts} +25 -25
  130. package/src/models/PaginatedResponseSkillResponse.ts +130 -0
  131. package/src/models/PartType.ts +2 -1
  132. package/src/models/ReferenceType.ts +1 -0
  133. package/src/models/SearchSkillsRequest.ts +114 -0
  134. package/src/models/SearchSkillsResponse.ts +90 -0
  135. package/src/models/SkillOrder.ts +54 -0
  136. package/src/models/SkillResponse.ts +244 -0
  137. package/src/models/SkillScriptFile.ts +95 -0
  138. package/src/models/SkillSearchResult.ts +119 -0
  139. package/src/models/SkillVersionResponse.ts +118 -0
  140. package/src/models/UpdateSkillRequest.ts +102 -0
  141. package/src/models/UpdateWorkflowDefinitionRequest.ts +12 -0
  142. package/src/models/WorkflowDefinitionResponse.ts +8 -0
  143. package/src/models/WorkflowRunSnapshot.ts +8 -0
  144. package/src/models/index.ts +13 -2
@@ -0,0 +1,786 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28
+ }) : function(o, v) {
29
+ o["default"] = v;
30
+ });
31
+ var __importStar = (this && this.__importStar) || (function () {
32
+ var ownKeys = function(o) {
33
+ ownKeys = Object.getOwnPropertyNames || function (o) {
34
+ var ar = [];
35
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
+ return ar;
37
+ };
38
+ return ownKeys(o);
39
+ };
40
+ return function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ })();
48
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
49
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
50
+ return new (P || (P = Promise))(function (resolve, reject) {
51
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
52
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
53
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
54
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
55
+ });
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.SkillsApi = void 0;
59
+ const runtime = __importStar(require("../runtime"));
60
+ const index_1 = require("../models/index");
61
+ /**
62
+ *
63
+ */
64
+ class SkillsApi extends runtime.BaseAPI {
65
+ /**
66
+ * Creates request options for activateSkillVersion without sending the request
67
+ */
68
+ activateSkillVersionRequestOpts(requestParameters) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ if (requestParameters['skillId'] == null) {
71
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling activateSkillVersion().');
72
+ }
73
+ if (requestParameters['versionId'] == null) {
74
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling activateSkillVersion().');
75
+ }
76
+ if (requestParameters['activateSkillVersionRequest'] == null) {
77
+ throw new runtime.RequiredError('activateSkillVersionRequest', 'Required parameter "activateSkillVersionRequest" was null or undefined when calling activateSkillVersion().');
78
+ }
79
+ const queryParameters = {};
80
+ const headerParameters = {};
81
+ headerParameters['Content-Type'] = 'application/json';
82
+ if (this.configuration && this.configuration.accessToken) {
83
+ const token = this.configuration.accessToken;
84
+ const tokenString = yield token("bearerAuth", []);
85
+ if (tokenString) {
86
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
87
+ }
88
+ }
89
+ let urlPath = `/v1/skills/{skill_id}/versions/{version_id}/activate`;
90
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
91
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
92
+ return {
93
+ path: urlPath,
94
+ method: 'POST',
95
+ headers: headerParameters,
96
+ query: queryParameters,
97
+ body: (0, index_1.ActivateSkillVersionRequestToJSON)(requestParameters['activateSkillVersionRequest']),
98
+ };
99
+ });
100
+ }
101
+ /**
102
+ * Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
103
+ * Activate Skill Version Handler
104
+ */
105
+ activateSkillVersionRaw(requestParameters, initOverrides) {
106
+ return __awaiter(this, void 0, void 0, function* () {
107
+ const requestOptions = yield this.activateSkillVersionRequestOpts(requestParameters);
108
+ const response = yield this.request(requestOptions, initOverrides);
109
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
110
+ });
111
+ }
112
+ /**
113
+ * Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
114
+ * Activate Skill Version Handler
115
+ */
116
+ activateSkillVersion(requestParameters, initOverrides) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ const response = yield this.activateSkillVersionRaw(requestParameters, initOverrides);
119
+ return yield response.value();
120
+ });
121
+ }
122
+ /**
123
+ * Creates request options for checkinSkill without sending the request
124
+ */
125
+ checkinSkillRequestOpts(requestParameters) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ if (requestParameters['skillId'] == null) {
128
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling checkinSkill().');
129
+ }
130
+ const queryParameters = {};
131
+ const headerParameters = {};
132
+ if (this.configuration && this.configuration.accessToken) {
133
+ const token = this.configuration.accessToken;
134
+ const tokenString = yield token("bearerAuth", []);
135
+ if (tokenString) {
136
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
137
+ }
138
+ }
139
+ let urlPath = `/v1/skills/{skill_id}/checkin`;
140
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
141
+ return {
142
+ path: urlPath,
143
+ method: 'POST',
144
+ headers: headerParameters,
145
+ query: queryParameters,
146
+ };
147
+ });
148
+ }
149
+ /**
150
+ * Release the skill\'s checkout so another author can edit it.
151
+ * Checkin Skill Handler
152
+ */
153
+ checkinSkillRaw(requestParameters, initOverrides) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ const requestOptions = yield this.checkinSkillRequestOpts(requestParameters);
156
+ const response = yield this.request(requestOptions, initOverrides);
157
+ return new runtime.VoidApiResponse(response);
158
+ });
159
+ }
160
+ /**
161
+ * Release the skill\'s checkout so another author can edit it.
162
+ * Checkin Skill Handler
163
+ */
164
+ checkinSkill(requestParameters, initOverrides) {
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ yield this.checkinSkillRaw(requestParameters, initOverrides);
167
+ });
168
+ }
169
+ /**
170
+ * Creates request options for checkoutSkill without sending the request
171
+ */
172
+ checkoutSkillRequestOpts(requestParameters) {
173
+ return __awaiter(this, void 0, void 0, function* () {
174
+ if (requestParameters['skillId'] == null) {
175
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling checkoutSkill().');
176
+ }
177
+ const queryParameters = {};
178
+ const headerParameters = {};
179
+ if (this.configuration && this.configuration.accessToken) {
180
+ const token = this.configuration.accessToken;
181
+ const tokenString = yield token("bearerAuth", []);
182
+ if (tokenString) {
183
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
184
+ }
185
+ }
186
+ let urlPath = `/v1/skills/{skill_id}/checkout`;
187
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
188
+ return {
189
+ path: urlPath,
190
+ method: 'POST',
191
+ headers: headerParameters,
192
+ query: queryParameters,
193
+ };
194
+ });
195
+ }
196
+ /**
197
+ * Check out the whole skill for editing (409 if another user holds it). Locks the skill via its ``SKILL.md`` document; hold it to edit any file (``SKILL.md`` or scripts) and release it with ``checkin``.
198
+ * Checkout Skill Handler
199
+ */
200
+ checkoutSkillRaw(requestParameters, initOverrides) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ const requestOptions = yield this.checkoutSkillRequestOpts(requestParameters);
203
+ const response = yield this.request(requestOptions, initOverrides);
204
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
205
+ });
206
+ }
207
+ /**
208
+ * Check out the whole skill for editing (409 if another user holds it). Locks the skill via its ``SKILL.md`` document; hold it to edit any file (``SKILL.md`` or scripts) and release it with ``checkin``.
209
+ * Checkout Skill Handler
210
+ */
211
+ checkoutSkill(requestParameters, initOverrides) {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ const response = yield this.checkoutSkillRaw(requestParameters, initOverrides);
214
+ return yield response.value();
215
+ });
216
+ }
217
+ /**
218
+ * Creates request options for createSkill without sending the request
219
+ */
220
+ createSkillRequestOpts(requestParameters) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ if (requestParameters['createSkillRequest'] == null) {
223
+ throw new runtime.RequiredError('createSkillRequest', 'Required parameter "createSkillRequest" was null or undefined when calling createSkill().');
224
+ }
225
+ const queryParameters = {};
226
+ const headerParameters = {};
227
+ headerParameters['Content-Type'] = 'application/json';
228
+ if (this.configuration && this.configuration.accessToken) {
229
+ const token = this.configuration.accessToken;
230
+ const tokenString = yield token("bearerAuth", []);
231
+ if (tokenString) {
232
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
233
+ }
234
+ }
235
+ let urlPath = `/v1/skills`;
236
+ return {
237
+ path: urlPath,
238
+ method: 'POST',
239
+ headers: headerParameters,
240
+ query: queryParameters,
241
+ body: (0, index_1.CreateSkillRequestToJSON)(requestParameters['createSkillRequest']),
242
+ };
243
+ });
244
+ }
245
+ /**
246
+ * Author a skill (JSON) under /agents/skills; requires can_write there.
247
+ * Create Skill Handler
248
+ */
249
+ createSkillRaw(requestParameters, initOverrides) {
250
+ return __awaiter(this, void 0, void 0, function* () {
251
+ const requestOptions = yield this.createSkillRequestOpts(requestParameters);
252
+ const response = yield this.request(requestOptions, initOverrides);
253
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
254
+ });
255
+ }
256
+ /**
257
+ * Author a skill (JSON) under /agents/skills; requires can_write there.
258
+ * Create Skill Handler
259
+ */
260
+ createSkill(requestParameters, initOverrides) {
261
+ return __awaiter(this, void 0, void 0, function* () {
262
+ const response = yield this.createSkillRaw(requestParameters, initOverrides);
263
+ return yield response.value();
264
+ });
265
+ }
266
+ /**
267
+ * Creates request options for deleteSkill without sending the request
268
+ */
269
+ deleteSkillRequestOpts(requestParameters) {
270
+ return __awaiter(this, void 0, void 0, function* () {
271
+ if (requestParameters['skillId'] == null) {
272
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling deleteSkill().');
273
+ }
274
+ const queryParameters = {};
275
+ const headerParameters = {};
276
+ if (this.configuration && this.configuration.accessToken) {
277
+ const token = this.configuration.accessToken;
278
+ const tokenString = yield token("bearerAuth", []);
279
+ if (tokenString) {
280
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
281
+ }
282
+ }
283
+ let urlPath = `/v1/skills/{skill_id}`;
284
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
285
+ return {
286
+ path: urlPath,
287
+ method: 'DELETE',
288
+ headers: headerParameters,
289
+ query: queryParameters,
290
+ };
291
+ });
292
+ }
293
+ /**
294
+ * Soft-delete a skill; requires can_delete; 409 if another holds checkout.
295
+ * Delete Skill Handler
296
+ */
297
+ deleteSkillRaw(requestParameters, initOverrides) {
298
+ return __awaiter(this, void 0, void 0, function* () {
299
+ const requestOptions = yield this.deleteSkillRequestOpts(requestParameters);
300
+ const response = yield this.request(requestOptions, initOverrides);
301
+ return new runtime.VoidApiResponse(response);
302
+ });
303
+ }
304
+ /**
305
+ * Soft-delete a skill; requires can_delete; 409 if another holds checkout.
306
+ * Delete Skill Handler
307
+ */
308
+ deleteSkill(requestParameters, initOverrides) {
309
+ return __awaiter(this, void 0, void 0, function* () {
310
+ yield this.deleteSkillRaw(requestParameters, initOverrides);
311
+ });
312
+ }
313
+ /**
314
+ * Creates request options for discardSkillDraft without sending the request
315
+ */
316
+ discardSkillDraftRequestOpts(requestParameters) {
317
+ return __awaiter(this, void 0, void 0, function* () {
318
+ if (requestParameters['skillId'] == null) {
319
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling discardSkillDraft().');
320
+ }
321
+ const queryParameters = {};
322
+ const headerParameters = {};
323
+ if (this.configuration && this.configuration.accessToken) {
324
+ const token = this.configuration.accessToken;
325
+ const tokenString = yield token("bearerAuth", []);
326
+ if (tokenString) {
327
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
328
+ }
329
+ }
330
+ let urlPath = `/v1/skills/{skill_id}/discard-draft`;
331
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
332
+ return {
333
+ path: urlPath,
334
+ method: 'POST',
335
+ headers: headerParameters,
336
+ query: queryParameters,
337
+ };
338
+ });
339
+ }
340
+ /**
341
+ * Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
342
+ * Discard Skill Draft Handler
343
+ */
344
+ discardSkillDraftRaw(requestParameters, initOverrides) {
345
+ return __awaiter(this, void 0, void 0, function* () {
346
+ const requestOptions = yield this.discardSkillDraftRequestOpts(requestParameters);
347
+ const response = yield this.request(requestOptions, initOverrides);
348
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
349
+ });
350
+ }
351
+ /**
352
+ * Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
353
+ * Discard Skill Draft Handler
354
+ */
355
+ discardSkillDraft(requestParameters, initOverrides) {
356
+ return __awaiter(this, void 0, void 0, function* () {
357
+ const response = yield this.discardSkillDraftRaw(requestParameters, initOverrides);
358
+ return yield response.value();
359
+ });
360
+ }
361
+ /**
362
+ * Creates request options for exportSkill without sending the request
363
+ */
364
+ exportSkillRequestOpts(requestParameters) {
365
+ return __awaiter(this, void 0, void 0, function* () {
366
+ if (requestParameters['skillId'] == null) {
367
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling exportSkill().');
368
+ }
369
+ const queryParameters = {};
370
+ const headerParameters = {};
371
+ if (this.configuration && this.configuration.accessToken) {
372
+ const token = this.configuration.accessToken;
373
+ const tokenString = yield token("bearerAuth", []);
374
+ if (tokenString) {
375
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
376
+ }
377
+ }
378
+ let urlPath = `/v1/skills/{skill_id}/export`;
379
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
380
+ return {
381
+ path: urlPath,
382
+ method: 'GET',
383
+ headers: headerParameters,
384
+ query: queryParameters,
385
+ };
386
+ });
387
+ }
388
+ /**
389
+ * Download the active published version as a self-contained ZIP for sharing.
390
+ * Export Skill Handler
391
+ */
392
+ exportSkillRaw(requestParameters, initOverrides) {
393
+ return __awaiter(this, void 0, void 0, function* () {
394
+ const requestOptions = yield this.exportSkillRequestOpts(requestParameters);
395
+ const response = yield this.request(requestOptions, initOverrides);
396
+ if (this.isJsonMime(response.headers.get('content-type'))) {
397
+ return new runtime.JSONApiResponse(response);
398
+ }
399
+ else {
400
+ return new runtime.TextApiResponse(response);
401
+ }
402
+ });
403
+ }
404
+ /**
405
+ * Download the active published version as a self-contained ZIP for sharing.
406
+ * Export Skill Handler
407
+ */
408
+ exportSkill(requestParameters, initOverrides) {
409
+ return __awaiter(this, void 0, void 0, function* () {
410
+ const response = yield this.exportSkillRaw(requestParameters, initOverrides);
411
+ return yield response.value();
412
+ });
413
+ }
414
+ /**
415
+ * Creates request options for getSkill without sending the request
416
+ */
417
+ getSkillRequestOpts(requestParameters) {
418
+ return __awaiter(this, void 0, void 0, function* () {
419
+ if (requestParameters['skillId'] == null) {
420
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling getSkill().');
421
+ }
422
+ const queryParameters = {};
423
+ const headerParameters = {};
424
+ if (this.configuration && this.configuration.accessToken) {
425
+ const token = this.configuration.accessToken;
426
+ const tokenString = yield token("bearerAuth", []);
427
+ if (tokenString) {
428
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
429
+ }
430
+ }
431
+ let urlPath = `/v1/skills/{skill_id}`;
432
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
433
+ return {
434
+ path: urlPath,
435
+ method: 'GET',
436
+ headers: headerParameters,
437
+ query: queryParameters,
438
+ };
439
+ });
440
+ }
441
+ /**
442
+ * Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
443
+ * Get Skill Handler
444
+ */
445
+ getSkillRaw(requestParameters, initOverrides) {
446
+ return __awaiter(this, void 0, void 0, function* () {
447
+ const requestOptions = yield this.getSkillRequestOpts(requestParameters);
448
+ const response = yield this.request(requestOptions, initOverrides);
449
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
450
+ });
451
+ }
452
+ /**
453
+ * Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
454
+ * Get Skill Handler
455
+ */
456
+ getSkill(requestParameters, initOverrides) {
457
+ return __awaiter(this, void 0, void 0, function* () {
458
+ const response = yield this.getSkillRaw(requestParameters, initOverrides);
459
+ return yield response.value();
460
+ });
461
+ }
462
+ /**
463
+ * Creates request options for importSkill without sending the request
464
+ */
465
+ importSkillRequestOpts(requestParameters) {
466
+ return __awaiter(this, void 0, void 0, function* () {
467
+ if (requestParameters['file'] == null) {
468
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling importSkill().');
469
+ }
470
+ const queryParameters = {};
471
+ const headerParameters = {};
472
+ if (this.configuration && this.configuration.accessToken) {
473
+ const token = this.configuration.accessToken;
474
+ const tokenString = yield token("bearerAuth", []);
475
+ if (tokenString) {
476
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
477
+ }
478
+ }
479
+ const consumes = [
480
+ { contentType: 'multipart/form-data' },
481
+ ];
482
+ // @ts-ignore: canConsumeForm may be unused
483
+ const canConsumeForm = runtime.canConsumeForm(consumes);
484
+ let formParams;
485
+ let useForm = false;
486
+ // use FormData to transmit files using content-type "multipart/form-data"
487
+ useForm = canConsumeForm;
488
+ if (useForm) {
489
+ formParams = new FormData();
490
+ }
491
+ else {
492
+ formParams = new URLSearchParams();
493
+ }
494
+ if (requestParameters['file'] != null) {
495
+ formParams.append('file', requestParameters['file']);
496
+ }
497
+ let urlPath = `/v1/skills/import`;
498
+ return {
499
+ path: urlPath,
500
+ method: 'POST',
501
+ headers: headerParameters,
502
+ query: queryParameters,
503
+ body: formParams,
504
+ };
505
+ });
506
+ }
507
+ /**
508
+ * Create a skill by importing a redistributable ZIP (works across tenants).
509
+ * Import Skill Handler
510
+ */
511
+ importSkillRaw(requestParameters, initOverrides) {
512
+ return __awaiter(this, void 0, void 0, function* () {
513
+ const requestOptions = yield this.importSkillRequestOpts(requestParameters);
514
+ const response = yield this.request(requestOptions, initOverrides);
515
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
516
+ });
517
+ }
518
+ /**
519
+ * Create a skill by importing a redistributable ZIP (works across tenants).
520
+ * Import Skill Handler
521
+ */
522
+ importSkill(requestParameters, initOverrides) {
523
+ return __awaiter(this, void 0, void 0, function* () {
524
+ const response = yield this.importSkillRaw(requestParameters, initOverrides);
525
+ return yield response.value();
526
+ });
527
+ }
528
+ /**
529
+ * Creates request options for listSkillVersions without sending the request
530
+ */
531
+ listSkillVersionsRequestOpts(requestParameters) {
532
+ return __awaiter(this, void 0, void 0, function* () {
533
+ if (requestParameters['skillId'] == null) {
534
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling listSkillVersions().');
535
+ }
536
+ const queryParameters = {};
537
+ const headerParameters = {};
538
+ if (this.configuration && this.configuration.accessToken) {
539
+ const token = this.configuration.accessToken;
540
+ const tokenString = yield token("bearerAuth", []);
541
+ if (tokenString) {
542
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
543
+ }
544
+ }
545
+ let urlPath = `/v1/skills/{skill_id}/versions`;
546
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
547
+ return {
548
+ path: urlPath,
549
+ method: 'GET',
550
+ headers: headerParameters,
551
+ query: queryParameters,
552
+ };
553
+ });
554
+ }
555
+ /**
556
+ * List a skill\'s published versions, newest first.
557
+ * List Skill Versions Handler
558
+ */
559
+ listSkillVersionsRaw(requestParameters, initOverrides) {
560
+ return __awaiter(this, void 0, void 0, function* () {
561
+ const requestOptions = yield this.listSkillVersionsRequestOpts(requestParameters);
562
+ const response = yield this.request(requestOptions, initOverrides);
563
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.SkillVersionResponseFromJSON));
564
+ });
565
+ }
566
+ /**
567
+ * List a skill\'s published versions, newest first.
568
+ * List Skill Versions Handler
569
+ */
570
+ listSkillVersions(requestParameters, initOverrides) {
571
+ return __awaiter(this, void 0, void 0, function* () {
572
+ const response = yield this.listSkillVersionsRaw(requestParameters, initOverrides);
573
+ return yield response.value();
574
+ });
575
+ }
576
+ /**
577
+ * Creates request options for listSkills without sending the request
578
+ */
579
+ listSkillsRequestOpts(requestParameters) {
580
+ return __awaiter(this, void 0, void 0, function* () {
581
+ const queryParameters = {};
582
+ if (requestParameters['sortBy'] != null) {
583
+ queryParameters['sort_by'] = requestParameters['sortBy'];
584
+ }
585
+ if (requestParameters['search'] != null) {
586
+ queryParameters['search'] = requestParameters['search'];
587
+ }
588
+ if (requestParameters['limit'] != null) {
589
+ queryParameters['limit'] = requestParameters['limit'];
590
+ }
591
+ if (requestParameters['offset'] != null) {
592
+ queryParameters['offset'] = requestParameters['offset'];
593
+ }
594
+ if (requestParameters['sortDir'] != null) {
595
+ queryParameters['sort_dir'] = requestParameters['sortDir'];
596
+ }
597
+ const headerParameters = {};
598
+ if (this.configuration && this.configuration.accessToken) {
599
+ const token = this.configuration.accessToken;
600
+ const tokenString = yield token("bearerAuth", []);
601
+ if (tokenString) {
602
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
603
+ }
604
+ }
605
+ let urlPath = `/v1/skills`;
606
+ return {
607
+ path: urlPath,
608
+ method: 'GET',
609
+ headers: headerParameters,
610
+ query: queryParameters,
611
+ };
612
+ });
613
+ }
614
+ /**
615
+ * List readable skills: paginated, sortable both ways, name-searchable.
616
+ * List Skills Handler
617
+ */
618
+ listSkillsRaw(requestParameters, initOverrides) {
619
+ return __awaiter(this, void 0, void 0, function* () {
620
+ const requestOptions = yield this.listSkillsRequestOpts(requestParameters);
621
+ const response = yield this.request(requestOptions, initOverrides);
622
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedResponseSkillResponseFromJSON)(jsonValue));
623
+ });
624
+ }
625
+ /**
626
+ * List readable skills: paginated, sortable both ways, name-searchable.
627
+ * List Skills Handler
628
+ */
629
+ listSkills() {
630
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
631
+ const response = yield this.listSkillsRaw(requestParameters, initOverrides);
632
+ return yield response.value();
633
+ });
634
+ }
635
+ /**
636
+ * Creates request options for publishSkillVersion without sending the request
637
+ */
638
+ publishSkillVersionRequestOpts(requestParameters) {
639
+ return __awaiter(this, void 0, void 0, function* () {
640
+ if (requestParameters['skillId'] == null) {
641
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling publishSkillVersion().');
642
+ }
643
+ const queryParameters = {};
644
+ const headerParameters = {};
645
+ if (this.configuration && this.configuration.accessToken) {
646
+ const token = this.configuration.accessToken;
647
+ const tokenString = yield token("bearerAuth", []);
648
+ if (tokenString) {
649
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
650
+ }
651
+ }
652
+ let urlPath = `/v1/skills/{skill_id}/versions`;
653
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
654
+ return {
655
+ path: urlPath,
656
+ method: 'POST',
657
+ headers: headerParameters,
658
+ query: queryParameters,
659
+ };
660
+ });
661
+ }
662
+ /**
663
+ * Snapshot the working copy into a new immutable version and activate it. Requires a held checkout on the skill (publishing mutates it), so a second author cannot push a version over the checkout holder\'s in-progress draft.
664
+ * Publish Skill Version Handler
665
+ */
666
+ publishSkillVersionRaw(requestParameters, initOverrides) {
667
+ return __awaiter(this, void 0, void 0, function* () {
668
+ const requestOptions = yield this.publishSkillVersionRequestOpts(requestParameters);
669
+ const response = yield this.request(requestOptions, initOverrides);
670
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
671
+ });
672
+ }
673
+ /**
674
+ * Snapshot the working copy into a new immutable version and activate it. Requires a held checkout on the skill (publishing mutates it), so a second author cannot push a version over the checkout holder\'s in-progress draft.
675
+ * Publish Skill Version Handler
676
+ */
677
+ publishSkillVersion(requestParameters, initOverrides) {
678
+ return __awaiter(this, void 0, void 0, function* () {
679
+ const response = yield this.publishSkillVersionRaw(requestParameters, initOverrides);
680
+ return yield response.value();
681
+ });
682
+ }
683
+ /**
684
+ * Creates request options for searchSkills without sending the request
685
+ */
686
+ searchSkillsRequestOpts(requestParameters) {
687
+ return __awaiter(this, void 0, void 0, function* () {
688
+ if (requestParameters['searchSkillsRequest'] == null) {
689
+ throw new runtime.RequiredError('searchSkillsRequest', 'Required parameter "searchSkillsRequest" was null or undefined when calling searchSkills().');
690
+ }
691
+ const queryParameters = {};
692
+ const headerParameters = {};
693
+ headerParameters['Content-Type'] = 'application/json';
694
+ if (this.configuration && this.configuration.accessToken) {
695
+ const token = this.configuration.accessToken;
696
+ const tokenString = yield token("bearerAuth", []);
697
+ if (tokenString) {
698
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
699
+ }
700
+ }
701
+ let urlPath = `/v1/skills/search`;
702
+ return {
703
+ path: urlPath,
704
+ method: 'POST',
705
+ headers: headerParameters,
706
+ query: queryParameters,
707
+ body: (0, index_1.SearchSkillsRequestToJSON)(requestParameters['searchSkillsRequest']),
708
+ };
709
+ });
710
+ }
711
+ /**
712
+ * Find skills by the meaning of their routing card (agent discovery). Dense semantic search over each skill\'s ``name + description`` card, scoped to the tenant. Fail-closed: hits are re-loaded tenant-scoped from Postgres (the authority — a mis-scoped Qdrant hit can\'t leak another tenant\'s skill) and any the caller cannot read are dropped.
713
+ * Search Skills Handler
714
+ */
715
+ searchSkillsRaw(requestParameters, initOverrides) {
716
+ return __awaiter(this, void 0, void 0, function* () {
717
+ const requestOptions = yield this.searchSkillsRequestOpts(requestParameters);
718
+ const response = yield this.request(requestOptions, initOverrides);
719
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SearchSkillsResponseFromJSON)(jsonValue));
720
+ });
721
+ }
722
+ /**
723
+ * Find skills by the meaning of their routing card (agent discovery). Dense semantic search over each skill\'s ``name + description`` card, scoped to the tenant. Fail-closed: hits are re-loaded tenant-scoped from Postgres (the authority — a mis-scoped Qdrant hit can\'t leak another tenant\'s skill) and any the caller cannot read are dropped.
724
+ * Search Skills Handler
725
+ */
726
+ searchSkills(requestParameters, initOverrides) {
727
+ return __awaiter(this, void 0, void 0, function* () {
728
+ const response = yield this.searchSkillsRaw(requestParameters, initOverrides);
729
+ return yield response.value();
730
+ });
731
+ }
732
+ /**
733
+ * Creates request options for updateSkill without sending the request
734
+ */
735
+ updateSkillRequestOpts(requestParameters) {
736
+ return __awaiter(this, void 0, void 0, function* () {
737
+ if (requestParameters['skillId'] == null) {
738
+ throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling updateSkill().');
739
+ }
740
+ if (requestParameters['updateSkillRequest'] == null) {
741
+ throw new runtime.RequiredError('updateSkillRequest', 'Required parameter "updateSkillRequest" was null or undefined when calling updateSkill().');
742
+ }
743
+ const queryParameters = {};
744
+ const headerParameters = {};
745
+ headerParameters['Content-Type'] = 'application/json';
746
+ if (this.configuration && this.configuration.accessToken) {
747
+ const token = this.configuration.accessToken;
748
+ const tokenString = yield token("bearerAuth", []);
749
+ if (tokenString) {
750
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
751
+ }
752
+ }
753
+ let urlPath = `/v1/skills/{skill_id}`;
754
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
755
+ return {
756
+ path: urlPath,
757
+ method: 'PATCH',
758
+ headers: headerParameters,
759
+ query: queryParameters,
760
+ body: (0, index_1.UpdateSkillRequestToJSON)(requestParameters['updateSkillRequest']),
761
+ };
762
+ });
763
+ }
764
+ /**
765
+ * Edit the working copy in place; requires can_write + a held checkout.
766
+ * Update Skill Handler
767
+ */
768
+ updateSkillRaw(requestParameters, initOverrides) {
769
+ return __awaiter(this, void 0, void 0, function* () {
770
+ const requestOptions = yield this.updateSkillRequestOpts(requestParameters);
771
+ const response = yield this.request(requestOptions, initOverrides);
772
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SkillResponseFromJSON)(jsonValue));
773
+ });
774
+ }
775
+ /**
776
+ * Edit the working copy in place; requires can_write + a held checkout.
777
+ * Update Skill Handler
778
+ */
779
+ updateSkill(requestParameters, initOverrides) {
780
+ return __awaiter(this, void 0, void 0, function* () {
781
+ const response = yield this.updateSkillRaw(requestParameters, initOverrides);
782
+ return yield response.value();
783
+ });
784
+ }
785
+ }
786
+ exports.SkillsApi = SkillsApi;