@smithery/api 0.54.0 → 0.56.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 (51) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -5
  9. package/client.mjs.map +1 -1
  10. package/package.json +7 -1
  11. package/resources/index.d.mts +1 -1
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +1 -1
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js.map +1 -1
  16. package/resources/index.mjs.map +1 -1
  17. package/resources/servers/servers.d.mts +5 -0
  18. package/resources/servers/servers.d.mts.map +1 -1
  19. package/resources/servers/servers.d.ts +5 -0
  20. package/resources/servers/servers.d.ts.map +1 -1
  21. package/resources/servers/servers.js.map +1 -1
  22. package/resources/servers/servers.mjs.map +1 -1
  23. package/resources/skills/index.d.mts +1 -1
  24. package/resources/skills/index.d.mts.map +1 -1
  25. package/resources/skills/index.d.ts +1 -1
  26. package/resources/skills/index.d.ts.map +1 -1
  27. package/resources/skills/index.js.map +1 -1
  28. package/resources/skills/index.mjs.map +1 -1
  29. package/resources/skills/skills.d.mts +37 -11
  30. package/resources/skills/skills.d.mts.map +1 -1
  31. package/resources/skills/skills.d.ts +37 -11
  32. package/resources/skills/skills.d.ts.map +1 -1
  33. package/resources/skills/skills.js +13 -7
  34. package/resources/skills/skills.js.map +1 -1
  35. package/resources/skills/skills.mjs +13 -7
  36. package/resources/skills/skills.mjs.map +1 -1
  37. package/resources/tokens.d.mts +4 -14
  38. package/resources/tokens.d.mts.map +1 -1
  39. package/resources/tokens.d.ts +4 -14
  40. package/resources/tokens.d.ts.map +1 -1
  41. package/src/client.ts +10 -5
  42. package/src/resources/index.ts +2 -0
  43. package/src/resources/servers/servers.ts +6 -0
  44. package/src/resources/skills/index.ts +2 -0
  45. package/src/resources/skills/skills.ts +60 -12
  46. package/src/resources/tokens.ts +4 -16
  47. package/src/version.ts +1 -1
  48. package/version.d.mts +1 -1
  49. package/version.d.ts +1 -1
  50. package/version.js +1 -1
  51. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -91,6 +91,8 @@ import {
91
91
  SkillSetResponse,
92
92
  SkillSyncParams,
93
93
  SkillSyncResponse,
94
+ SkillUploadParams,
95
+ SkillUploadResponse,
94
96
  Skills,
95
97
  } from './resources/skills/skills';
96
98
  import { type Fetch } from './internal/builtin-types';
@@ -319,8 +321,9 @@ export class Smithery {
319
321
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
320
322
 
321
323
  const defaultQuery = this.defaultQuery();
322
- if (!isEmptyObj(defaultQuery)) {
323
- query = { ...defaultQuery, ...query };
324
+ const pathQuery = Object.fromEntries(url.searchParams);
325
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
326
+ query = { ...pathQuery, ...defaultQuery, ...query };
324
327
  }
325
328
 
326
329
  if (typeof query === 'object' && query && !Array.isArray(query)) {
@@ -653,9 +656,9 @@ export class Smithery {
653
656
  }
654
657
  }
655
658
 
656
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
657
- // just do what it says, but otherwise calculate a default
658
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
659
+ // If the API asks us to wait a certain amount of time, just do what it
660
+ // says, but otherwise calculate a default
661
+ if (timeoutMillis === undefined) {
659
662
  const maxRetries = options.maxRetries ?? this.maxRetries;
660
663
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
661
664
  }
@@ -888,6 +891,7 @@ export declare namespace Smithery {
888
891
  type SkillGetResponse as SkillGetResponse,
889
892
  type SkillSetResponse as SkillSetResponse,
890
893
  type SkillSyncResponse as SkillSyncResponse,
894
+ type SkillUploadResponse as SkillUploadResponse,
891
895
  type SkillListResponsesSkillsPage as SkillListResponsesSkillsPage,
892
896
  type SkillCreateParams as SkillCreateParams,
893
897
  type SkillListParams as SkillListParams,
@@ -896,6 +900,7 @@ export declare namespace Smithery {
896
900
  type SkillGetParams as SkillGetParams,
897
901
  type SkillSetParams as SkillSetParams,
898
902
  type SkillSyncParams as SkillSyncParams,
903
+ type SkillUploadParams as SkillUploadParams,
899
904
  };
900
905
 
901
906
  export {
@@ -45,6 +45,7 @@ export {
45
45
  type SkillGetResponse,
46
46
  type SkillSetResponse,
47
47
  type SkillSyncResponse,
48
+ type SkillUploadResponse,
48
49
  type SkillCreateParams,
49
50
  type SkillListParams,
50
51
  type SkillDeleteParams,
@@ -52,6 +53,7 @@ export {
52
53
  type SkillGetParams,
53
54
  type SkillSetParams,
54
55
  type SkillSyncParams,
56
+ type SkillUploadParams,
55
57
  type SkillListResponsesSkillsPage,
56
58
  } from './skills/skills';
57
59
  export {
@@ -507,6 +507,12 @@ export interface ServerListParams extends SmitheryPageParams {
507
507
  */
508
508
  repoOwner?: string;
509
509
 
510
+ /**
511
+ * Random seed for deterministic pagination. When provided, results use a stable
512
+ * sort order that is consistent across pages for the same seed value.
513
+ */
514
+ seed?: number;
515
+
510
516
  /**
511
517
  * Maximum number of candidate results to consider from the search index before
512
518
  * pagination.
@@ -24,6 +24,7 @@ export {
24
24
  type SkillGetResponse,
25
25
  type SkillSetResponse,
26
26
  type SkillSyncResponse,
27
+ type SkillUploadResponse,
27
28
  type SkillCreateParams,
28
29
  type SkillListParams,
29
30
  type SkillDeleteParams,
@@ -31,6 +32,7 @@ export {
31
32
  type SkillGetParams,
32
33
  type SkillSetParams,
33
34
  type SkillSyncParams,
35
+ type SkillUploadParams,
34
36
  type SkillListResponsesSkillsPage,
35
37
  } from './skills';
36
38
  export {
@@ -31,8 +31,10 @@ import {
31
31
  } from './votes';
32
32
  import { APIPromise } from '../../core/api-promise';
33
33
  import { PagePromise, SkillsPage, type SkillsPageParams } from '../../core/pagination';
34
+ import { type Uploadable } from '../../core/uploads';
34
35
  import { buildHeaders } from '../../internal/headers';
35
36
  import { RequestOptions } from '../../internal/request-options';
37
+ import { multipartFormRequestOptions } from '../../internal/uploads';
36
38
  import { path } from '../../internal/utils/path';
37
39
 
38
40
  /**
@@ -72,8 +74,7 @@ export class Skills extends APIResource {
72
74
  }
73
75
 
74
76
  /**
75
- * Download a ZIP bundle containing all skill files, fetched via well-known
76
- * endpoints.
77
+ * Download a ZIP bundle containing all skill files.
77
78
  */
78
79
  download(slug: string, params: SkillDownloadParams, options?: RequestOptions): APIPromise<Response> {
79
80
  const { namespace } = params;
@@ -93,13 +94,12 @@ export class Skills extends APIResource {
93
94
  }
94
95
 
95
96
  /**
96
- * Idempotent endpoint to create or sync a skill. If the skill does not exist,
97
- * creates it. If it exists, updates displayName, description, and externalStars
98
- * from GitHub.
97
+ * Idempotent endpoint to create or update a GitHub-backed skill. Send
98
+ * application/json with `gitUrl`.
99
99
  */
100
100
  set(slug: string, params: SkillSetParams, options?: RequestOptions): APIPromise<SkillSetResponse> {
101
- const { namespace, ...body } = params;
102
- return this._client.put(path`/skills/${namespace}/${slug}`, { body, ...options });
101
+ const { namespace, body } = params;
102
+ return this._client.put(path`/skills/${namespace}/${slug}`, { body: body, ...options });
103
103
  }
104
104
 
105
105
  /**
@@ -112,6 +112,17 @@ export class Skills extends APIResource {
112
112
  const { namespace } = params;
113
113
  return this._client.post(path`/skills/${namespace}/${slug}/sync`, options);
114
114
  }
115
+
116
+ /**
117
+ * Upload or replace a skill bundle via multipart/form-data with an `archive` file.
118
+ */
119
+ upload(slug: string, params: SkillUploadParams, options?: RequestOptions): APIPromise<SkillUploadResponse> {
120
+ const { namespace, ...body } = params;
121
+ return this._client.put(
122
+ path`/skills/${namespace}/${slug}/upload`,
123
+ multipartFormRequestOptions({ body, ...options }, this._client),
124
+ );
125
+ }
115
126
  }
116
127
 
117
128
  export type SkillListResponsesSkillsPage = SkillsPage<SkillListResponse>;
@@ -199,7 +210,7 @@ export interface SkillListResponse {
199
210
  /**
200
211
  * URL to the skill's source repository.
201
212
  */
202
- gitUrl?: string;
213
+ gitUrl?: string | null;
203
214
 
204
215
  /**
205
216
  * Number of reviews for this skill.
@@ -250,7 +261,7 @@ export interface SkillGetResponse {
250
261
 
251
262
  externalStars: number;
252
263
 
253
- gitUrl: string;
264
+ gitUrl: string | null;
254
265
 
255
266
  listed: boolean;
256
267
 
@@ -294,7 +305,7 @@ export interface SkillSetResponse {
294
305
 
295
306
  externalStars: number;
296
307
 
297
- gitUrl: string;
308
+ gitUrl: string | null;
298
309
 
299
310
  listed: boolean;
300
311
 
@@ -323,6 +334,28 @@ export interface SkillSyncResponse {
323
334
  updatedAt: string;
324
335
  }
325
336
 
337
+ export interface SkillUploadResponse {
338
+ id: string;
339
+
340
+ createdAt: string;
341
+
342
+ description: string;
343
+
344
+ displayName: string;
345
+
346
+ externalStars: number;
347
+
348
+ gitUrl: string | null;
349
+
350
+ listed: boolean;
351
+
352
+ namespace: string;
353
+
354
+ slug: string;
355
+
356
+ updatedAt: string;
357
+ }
358
+
326
359
  export interface SkillCreateParams {
327
360
  /**
328
361
  * GitHub URL pointing to a repository with SKILL.md
@@ -404,15 +437,28 @@ export interface SkillSetParams {
404
437
  namespace: string;
405
438
 
406
439
  /**
407
- * Body param: GitHub URL pointing to a repository with SKILL.md
440
+ * Body param
408
441
  */
409
- gitUrl: string;
442
+ body: unknown;
410
443
  }
411
444
 
412
445
  export interface SkillSyncParams {
413
446
  namespace: string;
414
447
  }
415
448
 
449
+ export interface SkillUploadParams {
450
+ /**
451
+ * Path param
452
+ */
453
+ namespace: string;
454
+
455
+ /**
456
+ * Body param: ZIP file upload containing a skill folder with SKILL.md and any
457
+ * scripts, references, or assets.
458
+ */
459
+ archive: Uploadable;
460
+ }
461
+
416
462
  Skills.Votes = Votes;
417
463
  Skills.Reviews = Reviews;
418
464
 
@@ -424,6 +470,7 @@ export declare namespace Skills {
424
470
  type SkillGetResponse as SkillGetResponse,
425
471
  type SkillSetResponse as SkillSetResponse,
426
472
  type SkillSyncResponse as SkillSyncResponse,
473
+ type SkillUploadResponse as SkillUploadResponse,
427
474
  type SkillListResponsesSkillsPage as SkillListResponsesSkillsPage,
428
475
  type SkillCreateParams as SkillCreateParams,
429
476
  type SkillListParams as SkillListParams,
@@ -432,6 +479,7 @@ export declare namespace Skills {
432
479
  type SkillGetParams as SkillGetParams,
433
480
  type SkillSetParams as SkillSetParams,
434
481
  type SkillSyncParams as SkillSyncParams,
482
+ type SkillUploadParams as SkillUploadParams,
435
483
  };
436
484
 
437
485
  export {
@@ -68,16 +68,10 @@ export interface Constraint {
68
68
 
69
69
  export interface CreateTokenRequest {
70
70
  /**
71
- * Constraint objects to restrict the token. Cannot be combined with profileSlug.
72
- * Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
73
- * Maximum is 24 hours.
71
+ * Constraint objects to restrict the token. Each constraint may include a `ttl`
72
+ * field (max 24 hours). Default TTL is 1 hour. Maximum is 24 hours.
74
73
  */
75
74
  policy?: Array<Constraint>;
76
-
77
- /**
78
- * Profile slug for legacy token minting. Cannot be combined with policy.
79
- */
80
- profileSlug?: string;
81
75
  }
82
76
 
83
77
  export interface CreateTokenResponse {
@@ -94,16 +88,10 @@ export interface CreateTokenResponse {
94
88
 
95
89
  export interface TokenCreateParams {
96
90
  /**
97
- * Constraint objects to restrict the token. Cannot be combined with profileSlug.
98
- * Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour.
99
- * Maximum is 24 hours.
91
+ * Constraint objects to restrict the token. Each constraint may include a `ttl`
92
+ * field (max 24 hours). Default TTL is 1 hour. Maximum is 24 hours.
100
93
  */
101
94
  policy?: Array<Constraint>;
102
-
103
- /**
104
- * Profile slug for legacy token minting. Cannot be combined with policy.
105
- */
106
- profileSlug?: string;
107
95
  }
108
96
 
109
97
  export declare namespace Tokens {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.54.0'; // x-release-please-version
1
+ export const VERSION = '0.56.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.54.0";
1
+ export declare const VERSION = "0.56.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.54.0";
1
+ export declare const VERSION = "0.56.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.54.0'; // x-release-please-version
4
+ exports.VERSION = '0.56.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.54.0'; // x-release-please-version
1
+ export const VERSION = '0.56.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map