@hashgraphonline/standards-sdk 0.1.175 → 0.1.177

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/README.md +23 -0
  2. package/dist/browser/services/registry-broker/client/base-client.d.ts +14 -7
  3. package/dist/browser/services/registry-broker/client/base-client.d.ts.map +1 -1
  4. package/dist/browser/services/registry-broker/client/skills.d.ts +11 -5
  5. package/dist/browser/services/registry-broker/client/skills.d.ts.map +1 -1
  6. package/dist/browser/services/registry-broker/schemas.d.ts +5562 -19962
  7. package/dist/browser/services/registry-broker/schemas.d.ts.map +1 -1
  8. package/dist/browser/services/registry-broker/types.d.ts +55 -12
  9. package/dist/browser/services/registry-broker/types.d.ts.map +1 -1
  10. package/dist/browser/standards-sdk.browser.js +240 -87
  11. package/dist/browser/standards-sdk.browser.js.map +1 -1
  12. package/dist/browser-root/services/registry-broker/client/base-client.d.ts +14 -7
  13. package/dist/browser-root/services/registry-broker/client/base-client.d.ts.map +1 -1
  14. package/dist/browser-root/services/registry-broker/client/skills.d.ts +11 -5
  15. package/dist/browser-root/services/registry-broker/client/skills.d.ts.map +1 -1
  16. package/dist/browser-root/services/registry-broker/schemas.d.ts +5562 -19962
  17. package/dist/browser-root/services/registry-broker/schemas.d.ts.map +1 -1
  18. package/dist/browser-root/services/registry-broker/types.d.ts +55 -12
  19. package/dist/browser-root/services/registry-broker/types.d.ts.map +1 -1
  20. package/dist/browser-root/standards-sdk.root-browser.js +483 -116
  21. package/dist/browser-root/standards-sdk.root-browser.js.map +1 -1
  22. package/dist/cjs/services/registry-broker/client/base-client.d.ts +14 -7
  23. package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
  24. package/dist/cjs/services/registry-broker/client/skills.d.ts +11 -5
  25. package/dist/cjs/services/registry-broker/client/skills.d.ts.map +1 -1
  26. package/dist/cjs/services/registry-broker/schemas.d.ts +4390 -18790
  27. package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
  28. package/dist/cjs/services/registry-broker/types.d.ts +55 -12
  29. package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
  30. package/dist/cjs/standards-sdk.cjs +2 -2
  31. package/dist/cjs/standards-sdk.cjs.map +1 -1
  32. package/dist/es/services/registry-broker/client/base-client.d.ts +14 -7
  33. package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
  34. package/dist/es/services/registry-broker/client/skills.d.ts +11 -5
  35. package/dist/es/services/registry-broker/client/skills.d.ts.map +1 -1
  36. package/dist/es/services/registry-broker/schemas.d.ts +4390 -18790
  37. package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
  38. package/dist/es/services/registry-broker/types.d.ts +55 -12
  39. package/dist/es/services/registry-broker/types.d.ts.map +1 -1
  40. package/dist/es/standards-sdk.es121.js +1 -1
  41. package/dist/es/standards-sdk.es142.js +2 -2
  42. package/dist/es/standards-sdk.es145.js +48 -10
  43. package/dist/es/standards-sdk.es145.js.map +1 -1
  44. package/dist/es/standards-sdk.es148.js +1 -1
  45. package/dist/es/standards-sdk.es161.js +256 -91
  46. package/dist/es/standards-sdk.es161.js.map +1 -1
  47. package/dist/es/standards-sdk.es169.js +735 -81
  48. package/dist/es/standards-sdk.es169.js.map +1 -1
  49. package/dist/es/standards-sdk.es170.js +51 -68
  50. package/dist/es/standards-sdk.es170.js.map +1 -1
  51. package/dist/es/standards-sdk.es171.js +95 -47
  52. package/dist/es/standards-sdk.es171.js.map +1 -1
  53. package/dist/es/standards-sdk.es174.js +68 -568
  54. package/dist/es/standards-sdk.es174.js.map +1 -1
  55. package/dist/es/standards-sdk.es178.js +1 -1
  56. package/dist/es/standards-sdk.es181.js +1 -1
  57. package/dist/es/standards-sdk.es56.js +1 -1
  58. package/dist/es/standards-sdk.es59.js +1 -1
  59. package/dist/es/standards-sdk.es60.js +1 -1
  60. package/dist/es/standards-sdk.es65.js +1 -1
  61. package/dist/es/standards-sdk.es66.js +1 -1
  62. package/dist/es/standards-sdk.es69.js +1 -1
  63. package/package.json +2 -1
@@ -1,107 +1,761 @@
1
- import { isBrowser } from "./standards-sdk.es136.js";
2
- let nodeRequire;
3
- const isNodeRuntime = () => typeof process !== "undefined" && Boolean(process.versions?.node);
4
- function getNodeRequireSync() {
5
- try {
6
- const moduleNamespace = process.getBuiltinModule?.("module");
7
- if (typeof moduleNamespace?.createRequire === "function") {
8
- const requireFromModule = moduleNamespace.createRequire(import.meta.url);
9
- if (typeof requireFromModule.resolve === "function") {
10
- return requireFromModule;
11
- }
1
+ import { skillRegistryConfigResponseSchema, skillRegistryListResponseSchema, skillCatalogResponseSchema, skillRegistryVersionsResponseSchema, skillRegistryMineResponseSchema, skillRegistryMyListResponseSchema, skillRegistryQuoteResponseSchema, skillQuotePreviewResponseSchema, skillRegistryPublishResponseSchema, skillRegistryJobStatusResponseSchema, skillRegistryOwnershipResponseSchema, skillRecommendedVersionResponseSchema, skillDeprecationsResponseSchema, skillDeprecationRecordSchema, skillBadgeResponseSchema, skillStatusResponseSchema, skillSecurityBreakdownResponseSchema, skillConversionSignalsResponseSchema, skillPreviewRecordSchema, skillPreviewLookupResponseSchema, skillInstallResponseSchema, skillInstallCopyTelemetryResponseSchema, skillRegistryTagsResponseSchema, skillRegistryCategoriesResponseSchema, skillResolverManifestResponseSchema, skillRegistryVoteStatusResponseSchema, skillVerificationRequestCreateResponseSchema, skillVerificationStatusResponseSchema, skillVerificationDomainProofChallengeResponseSchema, skillVerificationDomainProofVerifyResponseSchema } from "./standards-sdk.es161.js";
2
+ async function skillsConfig(client) {
3
+ const raw = await client.requestJson("/skills/config", {
4
+ method: "GET"
5
+ });
6
+ return client.parseWithSchema(
7
+ raw,
8
+ skillRegistryConfigResponseSchema,
9
+ "skill registry config response"
10
+ );
11
+ }
12
+ async function listSkills(client, params = {}) {
13
+ const query = new URLSearchParams();
14
+ if (params.name) {
15
+ query.set("name", params.name);
16
+ }
17
+ if (params.version) {
18
+ query.set("version", params.version);
19
+ }
20
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
21
+ query.set("limit", String(Math.trunc(params.limit)));
22
+ }
23
+ if (params.cursor) {
24
+ query.set("cursor", params.cursor);
25
+ }
26
+ if (typeof params.includeFiles === "boolean") {
27
+ query.set("includeFiles", params.includeFiles ? "true" : "false");
28
+ }
29
+ if (params.accountId) {
30
+ query.set("accountId", params.accountId);
31
+ }
32
+ if (params.q) {
33
+ query.set("q", params.q);
34
+ }
35
+ if (params.tag) {
36
+ query.set("tag", params.tag);
37
+ }
38
+ if (params.category) {
39
+ query.set("category", params.category);
40
+ }
41
+ if (typeof params.featured === "boolean") {
42
+ query.set("featured", params.featured ? "true" : "false");
43
+ }
44
+ if (typeof params.verified === "boolean") {
45
+ query.set("verified", params.verified ? "true" : "false");
46
+ }
47
+ if (params.view) {
48
+ query.set("view", params.view);
49
+ }
50
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
51
+ const raw = await client.requestJson(`/skills${suffix}`, {
52
+ method: "GET"
53
+ });
54
+ return client.parseWithSchema(
55
+ raw,
56
+ skillRegistryListResponseSchema,
57
+ "skill registry list response"
58
+ );
59
+ }
60
+ async function getSkillSecurityBreakdown(client, params) {
61
+ const normalizedJobId = params.jobId.trim();
62
+ if (!normalizedJobId) {
63
+ throw new Error("jobId is required");
64
+ }
65
+ const raw = await client.requestJson(
66
+ `/skills/${encodeURIComponent(normalizedJobId)}/security-breakdown`,
67
+ { method: "GET" }
68
+ );
69
+ return client.parseWithSchema(
70
+ raw,
71
+ skillSecurityBreakdownResponseSchema,
72
+ "skill security breakdown response"
73
+ );
74
+ }
75
+ async function getSkillsCatalog(client, params = {}) {
76
+ const query = new URLSearchParams();
77
+ if (params.q) {
78
+ query.set("q", params.q);
79
+ }
80
+ if (params.category) {
81
+ query.set("category", params.category);
82
+ }
83
+ params.tags?.forEach((tag) => {
84
+ if (tag.trim()) {
85
+ query.append("tag", tag.trim());
12
86
  }
13
- const globalObject = typeof global !== "undefined" ? global : globalThis;
14
- const runtimeRequire = globalObject.process?.mainModule?.require ?? globalObject.require ?? Function('return typeof require === "function" ? require : undefined;')();
15
- if (typeof runtimeRequire === "function" && typeof runtimeRequire.resolve === "function") {
16
- return runtimeRequire;
87
+ });
88
+ if (typeof params.featured === "boolean") {
89
+ query.set("featured", params.featured ? "true" : "false");
90
+ }
91
+ if (typeof params.verified === "boolean") {
92
+ query.set("verified", params.verified ? "true" : "false");
93
+ }
94
+ if (params.channel) {
95
+ query.set("channel", params.channel);
96
+ }
97
+ if (params.sortBy) {
98
+ query.set("sortBy", params.sortBy);
99
+ }
100
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
101
+ query.set("limit", String(Math.trunc(params.limit)));
102
+ }
103
+ if (params.cursor) {
104
+ query.set("cursor", params.cursor);
105
+ }
106
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
107
+ const raw = await client.requestJson(`/skills/catalog${suffix}`, {
108
+ method: "GET"
109
+ });
110
+ return client.parseWithSchema(
111
+ raw,
112
+ skillCatalogResponseSchema,
113
+ "skill catalog response"
114
+ );
115
+ }
116
+ async function listSkillVersions(client, params) {
117
+ const normalizedName = params.name.trim();
118
+ if (!normalizedName) {
119
+ throw new Error("name is required");
120
+ }
121
+ const query = new URLSearchParams();
122
+ query.set("name", normalizedName);
123
+ const raw = await client.requestJson(
124
+ `/skills/versions?${query.toString()}`,
125
+ { method: "GET" }
126
+ );
127
+ return client.parseWithSchema(
128
+ raw,
129
+ skillRegistryVersionsResponseSchema,
130
+ "skill registry versions response"
131
+ );
132
+ }
133
+ async function listMySkills(client, params = {}) {
134
+ const query = new URLSearchParams();
135
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
136
+ query.set("limit", String(Math.trunc(params.limit)));
137
+ }
138
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
139
+ const raw = await client.requestJson(`/skills/mine${suffix}`, {
140
+ method: "GET"
141
+ });
142
+ return client.parseWithSchema(
143
+ raw,
144
+ skillRegistryMineResponseSchema,
145
+ "skill registry mine response"
146
+ );
147
+ }
148
+ async function getMySkillsList(client, params = {}) {
149
+ const query = new URLSearchParams();
150
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
151
+ query.set("limit", String(Math.trunc(params.limit)));
152
+ }
153
+ if (params.cursor) {
154
+ query.set("cursor", params.cursor);
155
+ }
156
+ if (params.accountId) {
157
+ query.set("accountId", params.accountId);
158
+ }
159
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
160
+ const raw = await client.requestJson(`/skills/my-list${suffix}`, {
161
+ method: "GET"
162
+ });
163
+ return client.parseWithSchema(
164
+ raw,
165
+ skillRegistryMyListResponseSchema,
166
+ "skill registry my list response"
167
+ );
168
+ }
169
+ async function quoteSkillPublish(client, payload) {
170
+ const raw = await client.requestJson("/skills/quote", {
171
+ method: "POST",
172
+ body: payload,
173
+ headers: { "content-type": "application/json" }
174
+ });
175
+ return client.parseWithSchema(
176
+ raw,
177
+ skillRegistryQuoteResponseSchema,
178
+ "skill registry quote response"
179
+ );
180
+ }
181
+ async function quoteSkillPublishPreview(client, payload) {
182
+ const raw = await client.requestJson("/skills/quote-preview", {
183
+ method: "POST",
184
+ body: payload,
185
+ headers: { "content-type": "application/json" }
186
+ });
187
+ return client.parseWithSchema(
188
+ raw,
189
+ skillQuotePreviewResponseSchema,
190
+ "skill quote preview response"
191
+ );
192
+ }
193
+ async function publishSkill(client, payload) {
194
+ const raw = await client.requestJson("/skills/publish", {
195
+ method: "POST",
196
+ body: payload,
197
+ headers: { "content-type": "application/json" }
198
+ });
199
+ return client.parseWithSchema(
200
+ raw,
201
+ skillRegistryPublishResponseSchema,
202
+ "skill registry publish response"
203
+ );
204
+ }
205
+ async function getSkillPublishJob(client, jobId, params = {}) {
206
+ const normalized = jobId.trim();
207
+ if (!normalized) {
208
+ throw new Error("jobId is required");
209
+ }
210
+ const query = new URLSearchParams();
211
+ if (params.accountId) {
212
+ query.set("accountId", params.accountId);
213
+ }
214
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
215
+ const raw = await client.requestJson(
216
+ `/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
217
+ { method: "GET" }
218
+ );
219
+ return client.parseWithSchema(
220
+ raw,
221
+ skillRegistryJobStatusResponseSchema,
222
+ "skill registry job status response"
223
+ );
224
+ }
225
+ async function getSkillOwnership(client, params) {
226
+ const normalizedName = params.name.trim();
227
+ if (!normalizedName) {
228
+ throw new Error("name is required");
229
+ }
230
+ const query = new URLSearchParams();
231
+ query.set("name", normalizedName);
232
+ if (params.accountId) {
233
+ query.set("accountId", params.accountId);
234
+ }
235
+ const raw = await client.requestJson(
236
+ `/skills/ownership?${query.toString()}`,
237
+ {
238
+ method: "GET"
17
239
  }
18
- } catch {
19
- return null;
240
+ );
241
+ return client.parseWithSchema(
242
+ raw,
243
+ skillRegistryOwnershipResponseSchema,
244
+ "skill registry ownership response"
245
+ );
246
+ }
247
+ async function getRecommendedSkillVersion(client, params) {
248
+ const normalizedName = params.name.trim();
249
+ if (!normalizedName) {
250
+ throw new Error("name is required");
251
+ }
252
+ const query = new URLSearchParams();
253
+ query.set("name", normalizedName);
254
+ const raw = await client.requestJson(
255
+ `/skills/recommended?${query.toString()}`,
256
+ { method: "GET" }
257
+ );
258
+ return client.parseWithSchema(
259
+ raw,
260
+ skillRecommendedVersionResponseSchema,
261
+ "skill recommended version response"
262
+ );
263
+ }
264
+ async function setRecommendedSkillVersion(client, payload) {
265
+ const normalizedName = payload.name.trim();
266
+ const normalizedVersion = payload.version.trim();
267
+ if (!normalizedName) {
268
+ throw new Error("name is required");
269
+ }
270
+ if (!normalizedVersion) {
271
+ throw new Error("version is required");
20
272
  }
21
- return null;
273
+ const raw = await client.requestJson("/skills/recommended", {
274
+ method: "POST",
275
+ body: {
276
+ name: normalizedName,
277
+ version: normalizedVersion
278
+ },
279
+ headers: { "content-type": "application/json" }
280
+ });
281
+ return client.parseWithSchema(
282
+ raw,
283
+ skillRecommendedVersionResponseSchema,
284
+ "skill recommended version response"
285
+ );
22
286
  }
23
- function isModuleNotFound(specifier, error) {
24
- if (!error || typeof error !== "object") {
25
- return false;
287
+ async function getSkillDeprecations(client, params) {
288
+ const normalizedName = params.name.trim();
289
+ if (!normalizedName) {
290
+ throw new Error("name is required");
26
291
  }
27
- const code = Reflect.get(error, "code");
28
- const message = Reflect.get(error, "message");
29
- const messageText = typeof message === "string" ? message : "";
30
- if (typeof code === "string" && code.includes("MODULE_NOT_FOUND")) {
31
- return messageText.includes(specifier);
292
+ const query = new URLSearchParams();
293
+ query.set("name", normalizedName);
294
+ const raw = await client.requestJson(
295
+ `/skills/deprecations?${query.toString()}`,
296
+ { method: "GET" }
297
+ );
298
+ return client.parseWithSchema(
299
+ raw,
300
+ skillDeprecationsResponseSchema,
301
+ "skill deprecations response"
302
+ );
303
+ }
304
+ async function setSkillDeprecation(client, payload) {
305
+ const normalizedName = payload.name.trim();
306
+ if (!normalizedName) {
307
+ throw new Error("name is required");
308
+ }
309
+ const version = payload.version?.trim();
310
+ const reason = payload.reason.trim();
311
+ if (!reason) {
312
+ throw new Error("reason is required");
313
+ }
314
+ const replacementRef = payload.replacementRef?.trim();
315
+ const raw = await client.requestJson("/skills/deprecate", {
316
+ method: "POST",
317
+ body: {
318
+ name: normalizedName,
319
+ version,
320
+ reason,
321
+ replacementRef
322
+ },
323
+ headers: { "content-type": "application/json" }
324
+ });
325
+ return client.parseWithSchema(
326
+ raw,
327
+ skillDeprecationRecordSchema,
328
+ "skill deprecation response"
329
+ );
330
+ }
331
+ async function getSkillBadge(client, params) {
332
+ const normalizedName = params.name.trim();
333
+ if (!normalizedName) {
334
+ throw new Error("name is required");
335
+ }
336
+ const query = new URLSearchParams();
337
+ query.set("name", normalizedName);
338
+ if (params.metric) {
339
+ query.set("metric", params.metric);
340
+ }
341
+ if (params.label?.trim()) {
342
+ query.set("label", params.label.trim());
343
+ }
344
+ if (params.style) {
345
+ query.set("style", params.style);
346
+ }
347
+ const raw = await client.requestJson(
348
+ `/skills/badge?${query.toString()}`,
349
+ { method: "GET" }
350
+ );
351
+ return client.parseWithSchema(
352
+ raw,
353
+ skillBadgeResponseSchema,
354
+ "skill badge response"
355
+ );
356
+ }
357
+ async function getSkillStatus(client, params) {
358
+ const normalizedName = params.name.trim();
359
+ if (!normalizedName) {
360
+ throw new Error("name is required");
361
+ }
362
+ const query = new URLSearchParams();
363
+ query.set("name", normalizedName);
364
+ if (params.version?.trim()) {
365
+ query.set("version", params.version.trim());
366
+ }
367
+ const raw = await client.requestJson(
368
+ `/skills/status?${query.toString()}`,
369
+ { method: "GET" }
370
+ );
371
+ return client.parseWithSchema(
372
+ raw,
373
+ skillStatusResponseSchema,
374
+ "skill status response"
375
+ );
376
+ }
377
+ async function getSkillStatusByRepo(client, params) {
378
+ const repo = params.repo.trim();
379
+ const skillDir = params.skillDir.trim();
380
+ if (!repo) {
381
+ throw new Error("repo is required");
32
382
  }
33
- if (messageText) {
34
- const lowered = messageText.toLowerCase();
35
- if (lowered.includes("cannot find module") || lowered.includes("module not found") || lowered.includes("cannot find package")) {
36
- return lowered.includes(specifier.toLowerCase());
383
+ if (!skillDir) {
384
+ throw new Error("skillDir is required");
385
+ }
386
+ const query = new URLSearchParams();
387
+ query.set("repo", repo);
388
+ query.set("skillDir", skillDir);
389
+ if (params.ref?.trim()) {
390
+ query.set("ref", params.ref.trim());
391
+ }
392
+ const raw = await client.requestJson(
393
+ `/skills/status/by-repo?${query.toString()}`,
394
+ { method: "GET" }
395
+ );
396
+ return client.parseWithSchema(
397
+ raw,
398
+ skillStatusResponseSchema,
399
+ "skill status response"
400
+ );
401
+ }
402
+ async function getSkillConversionSignalsByRepo(client, params) {
403
+ const repo = params.repo.trim();
404
+ const skillDir = params.skillDir.trim();
405
+ if (!repo) {
406
+ throw new Error("repo is required");
407
+ }
408
+ if (!skillDir) {
409
+ throw new Error("skillDir is required");
410
+ }
411
+ const query = new URLSearchParams();
412
+ query.set("repo", repo);
413
+ query.set("skillDir", skillDir);
414
+ if (params.ref?.trim()) {
415
+ query.set("ref", params.ref.trim());
416
+ }
417
+ const raw = await client.requestJson(
418
+ `/skills/conversion-signals/by-repo?${query.toString()}`,
419
+ { method: "GET" }
420
+ );
421
+ return client.parseWithSchema(
422
+ raw,
423
+ skillConversionSignalsResponseSchema,
424
+ "skill conversion signals response"
425
+ );
426
+ }
427
+ async function uploadSkillPreviewFromGithubOidc(client, payload) {
428
+ const token = payload.token.trim();
429
+ if (!token) {
430
+ throw new Error("token is required");
431
+ }
432
+ const raw = await client.requestJson(
433
+ "/skills/preview/github-oidc",
434
+ {
435
+ method: "POST",
436
+ body: payload.report,
437
+ headers: {
438
+ "content-type": "application/json",
439
+ authorization: `Bearer ${token}`
440
+ }
37
441
  }
442
+ );
443
+ return client.parseWithSchema(
444
+ raw,
445
+ skillPreviewRecordSchema,
446
+ "skill preview record response"
447
+ );
448
+ }
449
+ async function getSkillPreview(client, params) {
450
+ const normalizedName = params.name.trim();
451
+ if (!normalizedName) {
452
+ throw new Error("name is required");
453
+ }
454
+ const query = new URLSearchParams();
455
+ query.set("name", normalizedName);
456
+ if (params.version?.trim()) {
457
+ query.set("version", params.version.trim());
38
458
  }
39
- return false;
459
+ const raw = await client.requestJson(
460
+ `/skills/preview?${query.toString()}`,
461
+ { method: "GET" }
462
+ );
463
+ return client.parseWithSchema(
464
+ raw,
465
+ skillPreviewLookupResponseSchema,
466
+ "skill preview response"
467
+ );
40
468
  }
41
- async function resolveNodeRequire() {
42
- if (nodeRequire !== void 0) {
43
- return nodeRequire;
469
+ async function getSkillPreviewByRepo(client, params) {
470
+ const repo = params.repo.trim();
471
+ const skillDir = params.skillDir.trim();
472
+ if (!repo) {
473
+ throw new Error("repo is required");
44
474
  }
45
- if (isBrowser && !isNodeRuntime()) {
46
- nodeRequire = null;
47
- return nodeRequire;
475
+ if (!skillDir) {
476
+ throw new Error("skillDir is required");
48
477
  }
49
- try {
50
- nodeRequire = getNodeRequireSync();
51
- } catch {
52
- nodeRequire = null;
478
+ const query = new URLSearchParams();
479
+ query.set("repo", repo);
480
+ query.set("skillDir", skillDir);
481
+ if (params.ref?.trim()) {
482
+ query.set("ref", params.ref.trim());
53
483
  }
54
- return nodeRequire;
484
+ const raw = await client.requestJson(
485
+ `/skills/preview/by-repo?${query.toString()}`,
486
+ { method: "GET" }
487
+ );
488
+ return client.parseWithSchema(
489
+ raw,
490
+ skillPreviewLookupResponseSchema,
491
+ "skill preview by repo response"
492
+ );
55
493
  }
56
- async function dynamicImport(specifier) {
57
- try {
58
- return await import(
59
- /* webpackIgnore: true */
60
- specifier
61
- );
62
- } catch (error) {
63
- if (isModuleNotFound(specifier, error)) {
64
- return null;
494
+ async function getSkillPreviewById(client, previewId) {
495
+ const normalizedPreviewId = previewId.trim();
496
+ if (!normalizedPreviewId) {
497
+ throw new Error("previewId is required");
498
+ }
499
+ const raw = await client.requestJson(
500
+ `/skills/preview/${encodeURIComponent(normalizedPreviewId)}`,
501
+ { method: "GET" }
502
+ );
503
+ return client.parseWithSchema(
504
+ raw,
505
+ skillPreviewLookupResponseSchema,
506
+ "skill preview by id response"
507
+ );
508
+ }
509
+ async function getSkillInstall(client, skillRef) {
510
+ const normalizedSkillRef = skillRef.trim();
511
+ if (!normalizedSkillRef) {
512
+ throw new Error("skillRef is required");
513
+ }
514
+ const raw = await client.requestJson(
515
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/install`,
516
+ { method: "GET" }
517
+ );
518
+ return client.parseWithSchema(
519
+ raw,
520
+ skillInstallResponseSchema,
521
+ "skill install response"
522
+ );
523
+ }
524
+ async function recordSkillInstallCopy(client, skillRef, payload = {}) {
525
+ const normalizedSkillRef = skillRef.trim();
526
+ if (!normalizedSkillRef) {
527
+ throw new Error("skillRef is required");
528
+ }
529
+ const raw = await client.requestJson(
530
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/telemetry/install-copy`,
531
+ {
532
+ method: "POST",
533
+ body: payload,
534
+ headers: { "content-type": "application/json" }
65
535
  }
66
- throw error;
67
- }
68
- }
69
- async function optionalImport(specifier, options = {}) {
70
- if (isBrowser && !isNodeRuntime()) {
71
- return dynamicImport(specifier);
72
- }
73
- if (!options.preferImport) {
74
- const requireFn = await resolveNodeRequire();
75
- if (requireFn) {
76
- try {
77
- return requireFn(specifier);
78
- } catch (error) {
79
- if (!isModuleNotFound(specifier, error)) {
80
- throw error;
81
- }
536
+ );
537
+ return client.parseWithSchema(
538
+ raw,
539
+ skillInstallCopyTelemetryResponseSchema,
540
+ "skill install copy telemetry response"
541
+ );
542
+ }
543
+ async function listSkillTags(client) {
544
+ const raw = await client.requestJson("/skills/tags", {
545
+ method: "GET"
546
+ });
547
+ return client.parseWithSchema(
548
+ raw,
549
+ skillRegistryTagsResponseSchema,
550
+ "skill tags response"
551
+ );
552
+ }
553
+ async function listSkillCategories(client) {
554
+ const raw = await client.requestJson("/skills/categories", {
555
+ method: "GET"
556
+ });
557
+ return client.parseWithSchema(
558
+ raw,
559
+ skillRegistryCategoriesResponseSchema,
560
+ "skill categories response"
561
+ );
562
+ }
563
+ async function resolveSkillMarkdown(client, skillRef) {
564
+ const normalizedSkillRef = skillRef.trim();
565
+ if (!normalizedSkillRef) {
566
+ throw new Error("skillRef is required");
567
+ }
568
+ const response = await client.request(
569
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
570
+ {
571
+ method: "GET",
572
+ headers: {
573
+ accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
82
574
  }
83
575
  }
576
+ );
577
+ return response.text();
578
+ }
579
+ async function resolveSkillManifest(client, skillRef) {
580
+ const normalizedSkillRef = skillRef.trim();
581
+ if (!normalizedSkillRef) {
582
+ throw new Error("skillRef is required");
84
583
  }
85
- return dynamicImport(specifier);
584
+ const raw = await client.requestJson(
585
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
586
+ {
587
+ method: "GET"
588
+ }
589
+ );
590
+ return client.parseWithSchema(
591
+ raw,
592
+ skillResolverManifestResponseSchema,
593
+ "skill resolver manifest response"
594
+ );
86
595
  }
87
- function optionalImportSync(specifier) {
88
- if (isBrowser && !isNodeRuntime()) {
89
- return null;
596
+ async function getSkillVoteStatus(client, params) {
597
+ const normalizedName = params.name.trim();
598
+ if (!normalizedName) {
599
+ throw new Error("name is required");
90
600
  }
91
- try {
92
- const requireFn = getNodeRequireSync();
93
- if (requireFn) {
94
- return requireFn(specifier);
601
+ const query = new URLSearchParams();
602
+ query.set("name", normalizedName);
603
+ const raw = await client.requestJson(
604
+ `/skills/vote?${query.toString()}`,
605
+ { method: "GET" }
606
+ );
607
+ return client.parseWithSchema(
608
+ raw,
609
+ skillRegistryVoteStatusResponseSchema,
610
+ "skill registry vote status response"
611
+ );
612
+ }
613
+ async function setSkillVote(client, payload) {
614
+ const normalizedName = payload.name.trim();
615
+ if (!normalizedName) {
616
+ throw new Error("name is required");
617
+ }
618
+ const raw = await client.requestJson("/skills/vote", {
619
+ method: "POST",
620
+ body: { name: normalizedName, upvoted: payload.upvoted },
621
+ headers: { "content-type": "application/json" }
622
+ });
623
+ return client.parseWithSchema(
624
+ raw,
625
+ skillRegistryVoteStatusResponseSchema,
626
+ "skill registry vote status response"
627
+ );
628
+ }
629
+ async function requestSkillVerification(client, payload) {
630
+ const normalizedName = payload.name.trim();
631
+ if (!normalizedName) {
632
+ throw new Error("name is required");
633
+ }
634
+ const raw = await client.requestJson(
635
+ "/skills/verification/request",
636
+ {
637
+ method: "POST",
638
+ body: {
639
+ name: normalizedName,
640
+ version: payload.version,
641
+ tier: payload.tier
642
+ },
643
+ headers: { "content-type": "application/json" }
95
644
  }
96
- } catch (error) {
97
- if (!isModuleNotFound(specifier, error)) {
98
- throw error;
645
+ );
646
+ return client.parseWithSchema(
647
+ raw,
648
+ skillVerificationRequestCreateResponseSchema,
649
+ "skill verification request create response"
650
+ );
651
+ }
652
+ async function getSkillVerificationStatus(client, params) {
653
+ const normalizedName = params.name.trim();
654
+ if (!normalizedName) {
655
+ throw new Error("name is required");
656
+ }
657
+ const query = new URLSearchParams();
658
+ query.set("name", normalizedName);
659
+ if (params.version) {
660
+ query.set("version", params.version);
661
+ }
662
+ const raw = await client.requestJson(
663
+ `/skills/verification/status?${query.toString()}`,
664
+ { method: "GET" }
665
+ );
666
+ return client.parseWithSchema(
667
+ raw,
668
+ skillVerificationStatusResponseSchema,
669
+ "skill verification status response"
670
+ );
671
+ }
672
+ async function createSkillDomainProofChallenge(client, payload) {
673
+ const normalizedName = payload.name.trim();
674
+ if (!normalizedName) {
675
+ throw new Error("name is required");
676
+ }
677
+ const raw = await client.requestJson(
678
+ "/skills/verification/domain/challenge",
679
+ {
680
+ method: "POST",
681
+ body: {
682
+ name: normalizedName,
683
+ version: payload.version,
684
+ domain: payload.domain
685
+ },
686
+ headers: { "content-type": "application/json" }
99
687
  }
688
+ );
689
+ return client.parseWithSchema(
690
+ raw,
691
+ skillVerificationDomainProofChallengeResponseSchema,
692
+ "skill domain proof challenge response"
693
+ );
694
+ }
695
+ async function verifySkillDomainProof(client, payload) {
696
+ const normalizedName = payload.name.trim();
697
+ const challengeToken = payload.challengeToken.trim();
698
+ if (!normalizedName) {
699
+ throw new Error("name is required");
100
700
  }
101
- return null;
701
+ if (!challengeToken) {
702
+ throw new Error("challengeToken is required");
703
+ }
704
+ const raw = await client.requestJson(
705
+ "/skills/verification/domain/verify",
706
+ {
707
+ method: "POST",
708
+ body: {
709
+ name: normalizedName,
710
+ version: payload.version,
711
+ domain: payload.domain,
712
+ challengeToken
713
+ },
714
+ headers: { "content-type": "application/json" }
715
+ }
716
+ );
717
+ return client.parseWithSchema(
718
+ raw,
719
+ skillVerificationDomainProofVerifyResponseSchema,
720
+ "skill domain proof verify response"
721
+ );
102
722
  }
103
723
  export {
104
- optionalImport,
105
- optionalImportSync
724
+ createSkillDomainProofChallenge,
725
+ getMySkillsList,
726
+ getRecommendedSkillVersion,
727
+ getSkillBadge,
728
+ getSkillConversionSignalsByRepo,
729
+ getSkillDeprecations,
730
+ getSkillInstall,
731
+ getSkillOwnership,
732
+ getSkillPreview,
733
+ getSkillPreviewById,
734
+ getSkillPreviewByRepo,
735
+ getSkillPublishJob,
736
+ getSkillSecurityBreakdown,
737
+ getSkillStatus,
738
+ getSkillStatusByRepo,
739
+ getSkillVerificationStatus,
740
+ getSkillVoteStatus,
741
+ getSkillsCatalog,
742
+ listMySkills,
743
+ listSkillCategories,
744
+ listSkillTags,
745
+ listSkillVersions,
746
+ listSkills,
747
+ publishSkill,
748
+ quoteSkillPublish,
749
+ quoteSkillPublishPreview,
750
+ recordSkillInstallCopy,
751
+ requestSkillVerification,
752
+ resolveSkillManifest,
753
+ resolveSkillMarkdown,
754
+ setRecommendedSkillVersion,
755
+ setSkillDeprecation,
756
+ setSkillVote,
757
+ skillsConfig,
758
+ uploadSkillPreviewFromGithubOidc,
759
+ verifySkillDomainProof
106
760
  };
107
761
  //# sourceMappingURL=standards-sdk.es169.js.map