@hashgraphonline/standards-sdk 0.1.162 → 0.1.164

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 (239) hide show
  1. package/README.md +59 -0
  2. package/dist/cjs/common/node-operator-resolver.d.ts +1 -1
  3. package/dist/cjs/common/tx/tx-utils.d.ts +1 -1
  4. package/dist/cjs/hcs-10/base-client.d.ts +1 -1
  5. package/dist/cjs/hcs-10/browser.d.ts +1 -1
  6. package/dist/cjs/hcs-10/sdk.d.ts +1 -1
  7. package/dist/cjs/hcs-10/tx.d.ts +1 -1
  8. package/dist/cjs/hcs-10/types.d.ts +1 -1
  9. package/dist/cjs/hcs-11/client.d.ts +51 -51
  10. package/dist/cjs/hcs-11/types.d.ts +1 -1
  11. package/dist/cjs/hcs-12/base-client.d.ts +1 -1
  12. package/dist/cjs/hcs-12/browser.d.ts +1 -1
  13. package/dist/cjs/hcs-12/sdk.d.ts +1 -1
  14. package/dist/cjs/hcs-12/security/signature-verifier.d.ts +1 -1
  15. package/dist/cjs/hcs-12/tx.d.ts +1 -1
  16. package/dist/cjs/hcs-14/issuers/types.d.ts +1 -1
  17. package/dist/cjs/hcs-14/sdk.d.ts +1 -1
  18. package/dist/cjs/hcs-15/browser.d.ts +1 -1
  19. package/dist/cjs/hcs-15/sdk.d.ts +1 -1
  20. package/dist/cjs/hcs-15/tx.d.ts +1 -1
  21. package/dist/cjs/hcs-15/types.d.ts +1 -1
  22. package/dist/cjs/hcs-16/base-client.d.ts +1 -1
  23. package/dist/cjs/hcs-16/browser.d.ts +1 -1
  24. package/dist/cjs/hcs-16/sdk.d.ts +1 -1
  25. package/dist/cjs/hcs-16/tx.d.ts +1 -1
  26. package/dist/cjs/hcs-16/types.d.ts +1 -1
  27. package/dist/cjs/hcs-17/base-client.d.ts +1 -1
  28. package/dist/cjs/hcs-17/browser.d.ts +1 -1
  29. package/dist/cjs/hcs-17/sdk.d.ts +1 -1
  30. package/dist/cjs/hcs-17/tx.d.ts +1 -1
  31. package/dist/cjs/hcs-17/types.d.ts +1 -1
  32. package/dist/cjs/hcs-18/browser.d.ts +1 -1
  33. package/dist/cjs/hcs-18/sdk.d.ts +2 -2
  34. package/dist/cjs/hcs-18/tx.d.ts +1 -1
  35. package/dist/cjs/hcs-18/types.d.ts +1 -1
  36. package/dist/cjs/hcs-2/base-client.d.ts +1 -1
  37. package/dist/cjs/hcs-2/browser.d.ts +1 -1
  38. package/dist/cjs/hcs-2/client.d.ts +8 -2
  39. package/dist/cjs/hcs-2/client.d.ts.map +1 -1
  40. package/dist/cjs/hcs-2/tx.d.ts +1 -1
  41. package/dist/cjs/hcs-2/types.d.ts +3 -1
  42. package/dist/cjs/hcs-2/types.d.ts.map +1 -1
  43. package/dist/cjs/hcs-20/base-client.d.ts +1 -1
  44. package/dist/cjs/hcs-20/tx.d.ts +1 -1
  45. package/dist/cjs/hcs-20/types.d.ts +1 -1
  46. package/dist/cjs/hcs-21/sdk.d.ts +1 -1
  47. package/dist/cjs/hcs-21/tx.d.ts +1 -1
  48. package/dist/cjs/hcs-5/tx.d.ts +1 -1
  49. package/dist/cjs/hcs-5/types.d.ts +1 -1
  50. package/dist/cjs/hcs-6/base-client.d.ts +1 -1
  51. package/dist/cjs/hcs-6/browser.d.ts +1 -1
  52. package/dist/cjs/hcs-6/sdk.d.ts +1 -1
  53. package/dist/cjs/hcs-6/tx.d.ts +1 -1
  54. package/dist/cjs/hcs-6/types.d.ts +1 -1
  55. package/dist/cjs/hcs-7/evm-bridge.d.ts +1 -1
  56. package/dist/cjs/hcs-7/tx.d.ts +1 -1
  57. package/dist/cjs/hcs-7/types.d.ts +1 -1
  58. package/dist/cjs/inscribe/types.d.ts +1 -1
  59. package/dist/cjs/services/mirror-node.d.ts +1 -1
  60. package/dist/cjs/services/registry-broker/client/base-client.d.ts +22 -9
  61. package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
  62. package/dist/cjs/services/registry-broker/client/skills.d.ts +19 -9
  63. package/dist/cjs/services/registry-broker/client/skills.d.ts.map +1 -1
  64. package/dist/cjs/services/registry-broker/client/verification.d.ts +3 -1
  65. package/dist/cjs/services/registry-broker/client/verification.d.ts.map +1 -1
  66. package/dist/cjs/services/registry-broker/private-key-signer.d.ts +1 -1
  67. package/dist/cjs/services/registry-broker/schemas.d.ts +12879 -167
  68. package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
  69. package/dist/cjs/services/registry-broker/types.d.ts +80 -2
  70. package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
  71. package/dist/cjs/standards-sdk.cjs +1 -1
  72. package/dist/cjs/standards-sdk.cjs.map +1 -1
  73. package/dist/cjs/utils/key-type-detector.d.ts +1 -1
  74. package/dist/cjs/utils/parsers/crypto-parser.d.ts +1 -1
  75. package/dist/cjs/utils/parsers/file-parser.d.ts +1 -1
  76. package/dist/cjs/utils/parsers/hcs-parser.d.ts +1 -1
  77. package/dist/cjs/utils/parsers/hts-parser.d.ts +1 -1
  78. package/dist/cjs/utils/parsers/parser-utils.d.ts +1 -1
  79. package/dist/cjs/utils/parsers/schedule-parser.d.ts +1 -1
  80. package/dist/cjs/utils/parsers/scs-parser.d.ts +1 -1
  81. package/dist/cjs/utils/parsers/util-parser.d.ts +1 -1
  82. package/dist/cjs/utils/topic-fee-utils.d.ts +1 -1
  83. package/dist/cjs/utils/transaction-parser.d.ts +1 -1
  84. package/dist/es/common/node-operator-resolver.d.ts +1 -1
  85. package/dist/es/common/tx/tx-utils.d.ts +1 -1
  86. package/dist/es/hcs-10/base-client.d.ts +1 -1
  87. package/dist/es/hcs-10/browser.d.ts +1 -1
  88. package/dist/es/hcs-10/sdk.d.ts +1 -1
  89. package/dist/es/hcs-10/tx.d.ts +1 -1
  90. package/dist/es/hcs-10/types.d.ts +1 -1
  91. package/dist/es/hcs-11/client.d.ts +51 -51
  92. package/dist/es/hcs-11/types.d.ts +1 -1
  93. package/dist/es/hcs-12/base-client.d.ts +1 -1
  94. package/dist/es/hcs-12/browser.d.ts +1 -1
  95. package/dist/es/hcs-12/sdk.d.ts +1 -1
  96. package/dist/es/hcs-12/security/signature-verifier.d.ts +1 -1
  97. package/dist/es/hcs-12/tx.d.ts +1 -1
  98. package/dist/es/hcs-14/issuers/types.d.ts +1 -1
  99. package/dist/es/hcs-14/sdk.d.ts +1 -1
  100. package/dist/es/hcs-15/browser.d.ts +1 -1
  101. package/dist/es/hcs-15/sdk.d.ts +1 -1
  102. package/dist/es/hcs-15/tx.d.ts +1 -1
  103. package/dist/es/hcs-15/types.d.ts +1 -1
  104. package/dist/es/hcs-16/base-client.d.ts +1 -1
  105. package/dist/es/hcs-16/browser.d.ts +1 -1
  106. package/dist/es/hcs-16/sdk.d.ts +1 -1
  107. package/dist/es/hcs-16/tx.d.ts +1 -1
  108. package/dist/es/hcs-16/types.d.ts +1 -1
  109. package/dist/es/hcs-17/base-client.d.ts +1 -1
  110. package/dist/es/hcs-17/browser.d.ts +1 -1
  111. package/dist/es/hcs-17/sdk.d.ts +1 -1
  112. package/dist/es/hcs-17/tx.d.ts +1 -1
  113. package/dist/es/hcs-17/types.d.ts +1 -1
  114. package/dist/es/hcs-18/browser.d.ts +1 -1
  115. package/dist/es/hcs-18/sdk.d.ts +2 -2
  116. package/dist/es/hcs-18/tx.d.ts +1 -1
  117. package/dist/es/hcs-18/types.d.ts +1 -1
  118. package/dist/es/hcs-2/base-client.d.ts +1 -1
  119. package/dist/es/hcs-2/browser.d.ts +1 -1
  120. package/dist/es/hcs-2/client.d.ts +8 -2
  121. package/dist/es/hcs-2/client.d.ts.map +1 -1
  122. package/dist/es/hcs-2/tx.d.ts +1 -1
  123. package/dist/es/hcs-2/types.d.ts +3 -1
  124. package/dist/es/hcs-2/types.d.ts.map +1 -1
  125. package/dist/es/hcs-20/base-client.d.ts +1 -1
  126. package/dist/es/hcs-20/tx.d.ts +1 -1
  127. package/dist/es/hcs-20/types.d.ts +1 -1
  128. package/dist/es/hcs-21/sdk.d.ts +1 -1
  129. package/dist/es/hcs-21/tx.d.ts +1 -1
  130. package/dist/es/hcs-5/tx.d.ts +1 -1
  131. package/dist/es/hcs-5/types.d.ts +1 -1
  132. package/dist/es/hcs-6/base-client.d.ts +1 -1
  133. package/dist/es/hcs-6/browser.d.ts +1 -1
  134. package/dist/es/hcs-6/sdk.d.ts +1 -1
  135. package/dist/es/hcs-6/tx.d.ts +1 -1
  136. package/dist/es/hcs-6/types.d.ts +1 -1
  137. package/dist/es/hcs-7/evm-bridge.d.ts +1 -1
  138. package/dist/es/hcs-7/tx.d.ts +1 -1
  139. package/dist/es/hcs-7/types.d.ts +1 -1
  140. package/dist/es/inscribe/types.d.ts +1 -1
  141. package/dist/es/services/mirror-node.d.ts +1 -1
  142. package/dist/es/services/registry-broker/client/base-client.d.ts +22 -9
  143. package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
  144. package/dist/es/services/registry-broker/client/skills.d.ts +19 -9
  145. package/dist/es/services/registry-broker/client/skills.d.ts.map +1 -1
  146. package/dist/es/services/registry-broker/client/verification.d.ts +3 -1
  147. package/dist/es/services/registry-broker/client/verification.d.ts.map +1 -1
  148. package/dist/es/services/registry-broker/private-key-signer.d.ts +1 -1
  149. package/dist/es/services/registry-broker/schemas.d.ts +12879 -167
  150. package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
  151. package/dist/es/services/registry-broker/types.d.ts +80 -2
  152. package/dist/es/services/registry-broker/types.d.ts.map +1 -1
  153. package/dist/es/standards-sdk.es104.js +1 -1
  154. package/dist/es/standards-sdk.es106.js +1 -1
  155. package/dist/es/standards-sdk.es108.js +1 -1
  156. package/dist/es/standards-sdk.es11.js +1 -1
  157. package/dist/es/standards-sdk.es110.js +1 -1
  158. package/dist/es/standards-sdk.es116.js +1 -1
  159. package/dist/es/standards-sdk.es12.js +1 -1
  160. package/dist/es/standards-sdk.es132.js +1 -1
  161. package/dist/es/standards-sdk.es137.js +1 -1
  162. package/dist/es/standards-sdk.es138.js +1 -1
  163. package/dist/es/standards-sdk.es140.js +234 -0
  164. package/dist/es/standards-sdk.es140.js.map +1 -1
  165. package/dist/es/standards-sdk.es143.js +1 -1
  166. package/dist/es/standards-sdk.es144.js +45 -3
  167. package/dist/es/standards-sdk.es144.js.map +1 -1
  168. package/dist/es/standards-sdk.es153.js +12450 -106
  169. package/dist/es/standards-sdk.es153.js.map +1 -1
  170. package/dist/es/standards-sdk.es154.js +133 -37
  171. package/dist/es/standards-sdk.es154.js.map +1 -1
  172. package/dist/es/standards-sdk.es155.js +34 -12474
  173. package/dist/es/standards-sdk.es155.js.map +1 -1
  174. package/dist/es/standards-sdk.es156.js +54 -15
  175. package/dist/es/standards-sdk.es156.js.map +1 -1
  176. package/dist/es/standards-sdk.es157.js +76 -48
  177. package/dist/es/standards-sdk.es157.js.map +1 -1
  178. package/dist/es/standards-sdk.es158.js +66 -69
  179. package/dist/es/standards-sdk.es158.js.map +1 -1
  180. package/dist/es/standards-sdk.es159.js +180 -61
  181. package/dist/es/standards-sdk.es159.js.map +1 -1
  182. package/dist/es/standards-sdk.es160.js +521 -187
  183. package/dist/es/standards-sdk.es160.js.map +1 -1
  184. package/dist/es/standards-sdk.es162.js +15 -240
  185. package/dist/es/standards-sdk.es162.js.map +1 -1
  186. package/dist/es/standards-sdk.es169.js +1 -1
  187. package/dist/es/standards-sdk.es173.js +1 -1
  188. package/dist/es/standards-sdk.es179.js +37 -1
  189. package/dist/es/standards-sdk.es179.js.map +1 -1
  190. package/dist/es/standards-sdk.es18.js +3 -3
  191. package/dist/es/standards-sdk.es19.js +1 -1
  192. package/dist/es/standards-sdk.es22.js +1 -1
  193. package/dist/es/standards-sdk.es27.js +2 -2
  194. package/dist/es/standards-sdk.es30.js +1 -1
  195. package/dist/es/standards-sdk.es31.js +1 -1
  196. package/dist/es/standards-sdk.es35.js +1 -1
  197. package/dist/es/standards-sdk.es36.js +3 -3
  198. package/dist/es/standards-sdk.es37.js +1 -1
  199. package/dist/es/standards-sdk.es4.js +1 -1
  200. package/dist/es/standards-sdk.es41.js +7 -7
  201. package/dist/es/standards-sdk.es41.js.map +1 -1
  202. package/dist/es/standards-sdk.es53.js +1 -1
  203. package/dist/es/standards-sdk.es56.js +1 -1
  204. package/dist/es/standards-sdk.es59.js +1 -1
  205. package/dist/es/standards-sdk.es60.js +1 -1
  206. package/dist/es/standards-sdk.es62.js +1 -1
  207. package/dist/es/standards-sdk.es63.js +2 -2
  208. package/dist/es/standards-sdk.es64.js +1 -1
  209. package/dist/es/standards-sdk.es65.js +1 -1
  210. package/dist/es/standards-sdk.es66.js +1 -1
  211. package/dist/es/standards-sdk.es67.js +1 -1
  212. package/dist/es/standards-sdk.es69.js +1 -1
  213. package/dist/es/standards-sdk.es7.js +1 -1
  214. package/dist/es/standards-sdk.es71.js +1 -1
  215. package/dist/es/standards-sdk.es72.js +2 -2
  216. package/dist/es/standards-sdk.es74.js.map +1 -1
  217. package/dist/es/standards-sdk.es75.js +97 -6
  218. package/dist/es/standards-sdk.es75.js.map +1 -1
  219. package/dist/es/standards-sdk.es76.js +1 -1
  220. package/dist/es/standards-sdk.es78.js +1 -1
  221. package/dist/es/standards-sdk.es83.js +1 -1
  222. package/dist/es/standards-sdk.es85.js +1 -1
  223. package/dist/es/standards-sdk.es88.js +2 -2
  224. package/dist/es/standards-sdk.es90.js +1 -1
  225. package/dist/es/standards-sdk.es94.js +1 -1
  226. package/dist/es/standards-sdk.es98.js +2 -2
  227. package/dist/es/standards-sdk.es99.js +1 -1
  228. package/dist/es/utils/key-type-detector.d.ts +1 -1
  229. package/dist/es/utils/parsers/crypto-parser.d.ts +1 -1
  230. package/dist/es/utils/parsers/file-parser.d.ts +1 -1
  231. package/dist/es/utils/parsers/hcs-parser.d.ts +1 -1
  232. package/dist/es/utils/parsers/hts-parser.d.ts +1 -1
  233. package/dist/es/utils/parsers/parser-utils.d.ts +1 -1
  234. package/dist/es/utils/parsers/schedule-parser.d.ts +1 -1
  235. package/dist/es/utils/parsers/scs-parser.d.ts +1 -1
  236. package/dist/es/utils/parsers/util-parser.d.ts +1 -1
  237. package/dist/es/utils/topic-fee-utils.d.ts +1 -1
  238. package/dist/es/utils/transaction-parser.d.ts +1 -1
  239. package/package.json +7 -6
@@ -1,203 +1,537 @@
1
- import { parseSemicolonFields } from "./standards-sdk.es159.js";
2
- const ANS_HCS27_REGISTRY = "ans";
3
- function isObjectRecord(value) {
4
- return typeof value === "object" && value !== null;
5
- }
6
- function asString(value) {
7
- if (typeof value !== "string") {
8
- return null;
9
- }
10
- const trimmed = value.trim();
11
- if (!trimmed) {
12
- return null;
13
- }
14
- return trimmed;
15
- }
16
- function isSemver(value) {
17
- return /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.test(
18
- value
19
- );
20
- }
21
- function normalizeAnsVersion(value) {
22
- const trimmed = value.trim();
23
- if (!trimmed) {
24
- return null;
25
- }
26
- const withoutPrefix = trimmed.startsWith("v") || trimmed.startsWith("V") ? trimmed.slice(1) : trimmed;
27
- if (!isSemver(withoutPrefix)) {
28
- return null;
29
- }
30
- return withoutPrefix;
31
- }
32
- function parseAnsDnsTxtRecord(rawRecord) {
33
- const fields = parseSemicolonFields(rawRecord);
34
- const version = fields["v"];
35
- const urlValue = fields["url"];
36
- if (!version || !urlValue || version.toLowerCase() !== "ans1") {
37
- return null;
38
- }
39
- let parsedUrl;
40
- try {
41
- parsedUrl = new URL(urlValue);
42
- } catch {
43
- return null;
44
- }
45
- if (parsedUrl.protocol.toLowerCase() !== "https:") {
46
- return null;
47
- }
48
- const rawAnsVersion = fields["version"];
49
- let normalizedAnsVersion;
50
- if (rawAnsVersion !== void 0) {
51
- const parsedVersion = normalizeAnsVersion(rawAnsVersion);
52
- if (!parsedVersion) {
53
- return null;
1
+ import { skillRegistryConfigResponseSchema, skillRegistryListResponseSchema, skillCatalogResponseSchema, skillRegistryVersionsResponseSchema, skillRegistryMineResponseSchema, skillRegistryMyListResponseSchema, skillRegistryQuoteResponseSchema, skillRegistryPublishResponseSchema, skillRegistryJobStatusResponseSchema, skillRegistryOwnershipResponseSchema, skillRecommendedVersionResponseSchema, skillDeprecationsResponseSchema, skillDeprecationRecordSchema, skillBadgeResponseSchema, skillRegistryTagsResponseSchema, skillRegistryCategoriesResponseSchema, skillResolverManifestResponseSchema, skillRegistryVoteStatusResponseSchema, skillVerificationRequestCreateResponseSchema, skillVerificationStatusResponseSchema, skillVerificationDomainProofChallengeResponseSchema, skillVerificationDomainProofVerifyResponseSchema } from "./standards-sdk.es140.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 getSkillsCatalog(client, params = {}) {
61
+ const query = new URLSearchParams();
62
+ if (params.q) {
63
+ query.set("q", params.q);
64
+ }
65
+ if (params.category) {
66
+ query.set("category", params.category);
67
+ }
68
+ params.tags?.forEach((tag) => {
69
+ if (tag.trim()) {
70
+ query.append("tag", tag.trim());
54
71
  }
55
- normalizedAnsVersion = parsedVersion;
72
+ });
73
+ if (typeof params.featured === "boolean") {
74
+ query.set("featured", params.featured ? "true" : "false");
75
+ }
76
+ if (typeof params.verified === "boolean") {
77
+ query.set("verified", params.verified ? "true" : "false");
78
+ }
79
+ if (params.channel) {
80
+ query.set("channel", params.channel);
81
+ }
82
+ if (params.sortBy) {
83
+ query.set("sortBy", params.sortBy);
56
84
  }
57
- return {
58
- version: normalizedAnsVersion,
59
- url: parsedUrl.toString()
60
- };
85
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
86
+ query.set("limit", String(Math.trunc(params.limit)));
87
+ }
88
+ if (params.cursor) {
89
+ query.set("cursor", params.cursor);
90
+ }
91
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
92
+ const raw = await client.requestJson(`/skills/catalog${suffix}`, {
93
+ method: "GET"
94
+ });
95
+ return client.parseWithSchema(
96
+ raw,
97
+ skillCatalogResponseSchema,
98
+ "skill catalog response"
99
+ );
61
100
  }
62
- function isValidAnsProfileVersion(value) {
63
- return !!value && normalizeAnsVersion(value) !== null;
101
+ async function listSkillVersions(client, params) {
102
+ const normalizedName = params.name.trim();
103
+ if (!normalizedName) {
104
+ throw new Error("name is required");
105
+ }
106
+ const query = new URLSearchParams();
107
+ query.set("name", normalizedName);
108
+ const raw = await client.requestJson(
109
+ `/skills/versions?${query.toString()}`,
110
+ { method: "GET" }
111
+ );
112
+ return client.parseWithSchema(
113
+ raw,
114
+ skillRegistryVersionsResponseSchema,
115
+ "skill registry versions response"
116
+ );
64
117
  }
65
- function hasProtocolPathSegment(pathname, protocol) {
66
- const normalizedProtocol = protocol.trim().toLowerCase();
67
- if (!normalizedProtocol) {
68
- return false;
118
+ async function listMySkills(client, params = {}) {
119
+ const query = new URLSearchParams();
120
+ if (typeof params.limit === "number" && Number.isFinite(params.limit)) {
121
+ query.set("limit", String(Math.trunc(params.limit)));
69
122
  }
70
- const pathSegments = pathname.split("/").map((segment) => segment.trim()).filter((segment) => segment.length > 0);
71
- for (const segment of pathSegments) {
72
- if (segment.toLowerCase() === normalizedProtocol) {
73
- return true;
123
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
124
+ const raw = await client.requestJson(`/skills/mine${suffix}`, {
125
+ method: "GET"
126
+ });
127
+ return client.parseWithSchema(
128
+ raw,
129
+ skillRegistryMineResponseSchema,
130
+ "skill registry mine response"
131
+ );
132
+ }
133
+ async function getMySkillsList(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
+ if (params.cursor) {
139
+ query.set("cursor", params.cursor);
140
+ }
141
+ if (params.accountId) {
142
+ query.set("accountId", params.accountId);
143
+ }
144
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
145
+ const raw = await client.requestJson(`/skills/my-list${suffix}`, {
146
+ method: "GET"
147
+ });
148
+ return client.parseWithSchema(
149
+ raw,
150
+ skillRegistryMyListResponseSchema,
151
+ "skill registry my list response"
152
+ );
153
+ }
154
+ async function quoteSkillPublish(client, payload) {
155
+ const raw = await client.requestJson("/skills/quote", {
156
+ method: "POST",
157
+ body: payload,
158
+ headers: { "content-type": "application/json" }
159
+ });
160
+ return client.parseWithSchema(
161
+ raw,
162
+ skillRegistryQuoteResponseSchema,
163
+ "skill registry quote response"
164
+ );
165
+ }
166
+ async function publishSkill(client, payload) {
167
+ const raw = await client.requestJson("/skills/publish", {
168
+ method: "POST",
169
+ body: payload,
170
+ headers: { "content-type": "application/json" }
171
+ });
172
+ return client.parseWithSchema(
173
+ raw,
174
+ skillRegistryPublishResponseSchema,
175
+ "skill registry publish response"
176
+ );
177
+ }
178
+ async function getSkillPublishJob(client, jobId, params = {}) {
179
+ const normalized = jobId.trim();
180
+ if (!normalized) {
181
+ throw new Error("jobId is required");
182
+ }
183
+ const query = new URLSearchParams();
184
+ if (params.accountId) {
185
+ query.set("accountId", params.accountId);
186
+ }
187
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
188
+ const raw = await client.requestJson(
189
+ `/skills/jobs/${encodeURIComponent(normalized)}${suffix}`,
190
+ { method: "GET" }
191
+ );
192
+ return client.parseWithSchema(
193
+ raw,
194
+ skillRegistryJobStatusResponseSchema,
195
+ "skill registry job status response"
196
+ );
197
+ }
198
+ async function getSkillOwnership(client, params) {
199
+ const normalizedName = params.name.trim();
200
+ if (!normalizedName) {
201
+ throw new Error("name is required");
202
+ }
203
+ const query = new URLSearchParams();
204
+ query.set("name", normalizedName);
205
+ if (params.accountId) {
206
+ query.set("accountId", params.accountId);
207
+ }
208
+ const raw = await client.requestJson(
209
+ `/skills/ownership?${query.toString()}`,
210
+ {
211
+ method: "GET"
74
212
  }
213
+ );
214
+ return client.parseWithSchema(
215
+ raw,
216
+ skillRegistryOwnershipResponseSchema,
217
+ "skill registry ownership response"
218
+ );
219
+ }
220
+ async function getRecommendedSkillVersion(client, params) {
221
+ const normalizedName = params.name.trim();
222
+ if (!normalizedName) {
223
+ throw new Error("name is required");
75
224
  }
76
- return false;
225
+ const query = new URLSearchParams();
226
+ query.set("name", normalizedName);
227
+ const raw = await client.requestJson(
228
+ `/skills/recommended?${query.toString()}`,
229
+ { method: "GET" }
230
+ );
231
+ return client.parseWithSchema(
232
+ raw,
233
+ skillRecommendedVersionResponseSchema,
234
+ "skill recommended version response"
235
+ );
77
236
  }
78
- function extractEndpointCandidates(endpoints, supportedSchemes) {
79
- const candidates = [];
80
- for (const [key, value] of Object.entries(endpoints)) {
81
- if (!isObjectRecord(value)) {
82
- continue;
237
+ async function setRecommendedSkillVersion(client, payload) {
238
+ const normalizedName = payload.name.trim();
239
+ const normalizedVersion = payload.version.trim();
240
+ if (!normalizedName) {
241
+ throw new Error("name is required");
242
+ }
243
+ if (!normalizedVersion) {
244
+ throw new Error("version is required");
245
+ }
246
+ const raw = await client.requestJson("/skills/recommended", {
247
+ method: "POST",
248
+ body: {
249
+ name: normalizedName,
250
+ version: normalizedVersion
251
+ },
252
+ headers: { "content-type": "application/json" }
253
+ });
254
+ return client.parseWithSchema(
255
+ raw,
256
+ skillRecommendedVersionResponseSchema,
257
+ "skill recommended version response"
258
+ );
259
+ }
260
+ async function getSkillDeprecations(client, params) {
261
+ const normalizedName = params.name.trim();
262
+ if (!normalizedName) {
263
+ throw new Error("name is required");
264
+ }
265
+ const query = new URLSearchParams();
266
+ query.set("name", normalizedName);
267
+ const raw = await client.requestJson(
268
+ `/skills/deprecations?${query.toString()}`,
269
+ { method: "GET" }
270
+ );
271
+ return client.parseWithSchema(
272
+ raw,
273
+ skillDeprecationsResponseSchema,
274
+ "skill deprecations response"
275
+ );
276
+ }
277
+ async function setSkillDeprecation(client, payload) {
278
+ const normalizedName = payload.name.trim();
279
+ if (!normalizedName) {
280
+ throw new Error("name is required");
281
+ }
282
+ const version = payload.version?.trim();
283
+ const reason = payload.reason.trim();
284
+ if (!reason) {
285
+ throw new Error("reason is required");
286
+ }
287
+ const replacementRef = payload.replacementRef?.trim();
288
+ const raw = await client.requestJson("/skills/deprecate", {
289
+ method: "POST",
290
+ body: {
291
+ name: normalizedName,
292
+ version,
293
+ reason,
294
+ replacementRef
295
+ },
296
+ headers: { "content-type": "application/json" }
297
+ });
298
+ return client.parseWithSchema(
299
+ raw,
300
+ skillDeprecationRecordSchema,
301
+ "skill deprecation response"
302
+ );
303
+ }
304
+ async function getSkillBadge(client, params) {
305
+ const normalizedName = params.name.trim();
306
+ if (!normalizedName) {
307
+ throw new Error("name is required");
308
+ }
309
+ const query = new URLSearchParams();
310
+ query.set("name", normalizedName);
311
+ if (params.metric) {
312
+ query.set("metric", params.metric);
313
+ }
314
+ if (params.label?.trim()) {
315
+ query.set("label", params.label.trim());
316
+ }
317
+ if (params.style) {
318
+ query.set("style", params.style);
319
+ }
320
+ const raw = await client.requestJson(
321
+ `/skills/badge?${query.toString()}`,
322
+ { method: "GET" }
323
+ );
324
+ return client.parseWithSchema(
325
+ raw,
326
+ skillBadgeResponseSchema,
327
+ "skill badge response"
328
+ );
329
+ }
330
+ async function listSkillTags(client) {
331
+ const raw = await client.requestJson("/skills/tags", {
332
+ method: "GET"
333
+ });
334
+ return client.parseWithSchema(
335
+ raw,
336
+ skillRegistryTagsResponseSchema,
337
+ "skill tags response"
338
+ );
339
+ }
340
+ async function listSkillCategories(client) {
341
+ const raw = await client.requestJson("/skills/categories", {
342
+ method: "GET"
343
+ });
344
+ return client.parseWithSchema(
345
+ raw,
346
+ skillRegistryCategoriesResponseSchema,
347
+ "skill categories response"
348
+ );
349
+ }
350
+ async function resolveSkillMarkdown(client, skillRef) {
351
+ const normalizedSkillRef = skillRef.trim();
352
+ if (!normalizedSkillRef) {
353
+ throw new Error("skillRef is required");
354
+ }
355
+ const response = await client.request(
356
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/SKILL.md`,
357
+ {
358
+ method: "GET",
359
+ headers: {
360
+ accept: "text/markdown, text/plain;q=0.9, */*;q=0.8"
361
+ }
362
+ }
363
+ );
364
+ return response.text();
365
+ }
366
+ async function resolveSkillManifest(client, skillRef) {
367
+ const normalizedSkillRef = skillRef.trim();
368
+ if (!normalizedSkillRef) {
369
+ throw new Error("skillRef is required");
370
+ }
371
+ const raw = await client.requestJson(
372
+ `/skills/${encodeURIComponent(normalizedSkillRef)}/manifest`,
373
+ {
374
+ method: "GET"
83
375
  }
84
- const endpoint = asString(value["url"]);
85
- if (!endpoint) {
86
- continue;
376
+ );
377
+ return client.parseWithSchema(
378
+ raw,
379
+ skillResolverManifestResponseSchema,
380
+ "skill resolver manifest response"
381
+ );
382
+ }
383
+ async function getSkillVoteStatus(client, params) {
384
+ const normalizedName = params.name.trim();
385
+ if (!normalizedName) {
386
+ throw new Error("name is required");
387
+ }
388
+ const query = new URLSearchParams();
389
+ query.set("name", normalizedName);
390
+ const raw = await client.requestJson(
391
+ `/skills/vote?${query.toString()}`,
392
+ { method: "GET" }
393
+ );
394
+ return client.parseWithSchema(
395
+ raw,
396
+ skillRegistryVoteStatusResponseSchema,
397
+ "skill registry vote status response"
398
+ );
399
+ }
400
+ async function setSkillVote(client, payload) {
401
+ const normalizedName = payload.name.trim();
402
+ if (!normalizedName) {
403
+ throw new Error("name is required");
404
+ }
405
+ const raw = await client.requestJson("/skills/vote", {
406
+ method: "POST",
407
+ body: { name: normalizedName, upvoted: payload.upvoted },
408
+ headers: { "content-type": "application/json" }
409
+ });
410
+ return client.parseWithSchema(
411
+ raw,
412
+ skillRegistryVoteStatusResponseSchema,
413
+ "skill registry vote status response"
414
+ );
415
+ }
416
+ async function requestSkillVerification(client, payload) {
417
+ const normalizedName = payload.name.trim();
418
+ if (!normalizedName) {
419
+ throw new Error("name is required");
420
+ }
421
+ const raw = await client.requestJson(
422
+ "/skills/verification/request",
423
+ {
424
+ method: "POST",
425
+ body: {
426
+ name: normalizedName,
427
+ version: payload.version,
428
+ tier: payload.tier
429
+ },
430
+ headers: { "content-type": "application/json" }
87
431
  }
88
- let parsedUrl;
89
- try {
90
- parsedUrl = new URL(endpoint);
91
- } catch {
92
- continue;
432
+ );
433
+ return client.parseWithSchema(
434
+ raw,
435
+ skillVerificationRequestCreateResponseSchema,
436
+ "skill verification request create response"
437
+ );
438
+ }
439
+ async function getSkillVerificationStatus(client, params) {
440
+ const normalizedName = params.name.trim();
441
+ if (!normalizedName) {
442
+ throw new Error("name is required");
443
+ }
444
+ const query = new URLSearchParams();
445
+ query.set("name", normalizedName);
446
+ if (params.version) {
447
+ query.set("version", params.version);
448
+ }
449
+ const raw = await client.requestJson(
450
+ `/skills/verification/status?${query.toString()}`,
451
+ { method: "GET" }
452
+ );
453
+ return client.parseWithSchema(
454
+ raw,
455
+ skillVerificationStatusResponseSchema,
456
+ "skill verification status response"
457
+ );
458
+ }
459
+ async function createSkillDomainProofChallenge(client, payload) {
460
+ const normalizedName = payload.name.trim();
461
+ if (!normalizedName) {
462
+ throw new Error("name is required");
463
+ }
464
+ const raw = await client.requestJson(
465
+ "/skills/verification/domain/challenge",
466
+ {
467
+ method: "POST",
468
+ body: {
469
+ name: normalizedName,
470
+ version: payload.version,
471
+ domain: payload.domain
472
+ },
473
+ headers: { "content-type": "application/json" }
93
474
  }
94
- const scheme = parsedUrl.protocol.replace(/:$/, "").toLowerCase();
95
- if (!supportedSchemes.has(scheme)) {
96
- continue;
475
+ );
476
+ return client.parseWithSchema(
477
+ raw,
478
+ skillVerificationDomainProofChallengeResponseSchema,
479
+ "skill domain proof challenge response"
480
+ );
481
+ }
482
+ async function verifySkillDomainProof(client, payload) {
483
+ const normalizedName = payload.name.trim();
484
+ const challengeToken = payload.challengeToken.trim();
485
+ if (!normalizedName) {
486
+ throw new Error("name is required");
487
+ }
488
+ if (!challengeToken) {
489
+ throw new Error("challengeToken is required");
490
+ }
491
+ const raw = await client.requestJson(
492
+ "/skills/verification/domain/verify",
493
+ {
494
+ method: "POST",
495
+ body: {
496
+ name: normalizedName,
497
+ version: payload.version,
498
+ domain: payload.domain,
499
+ challengeToken
500
+ },
501
+ headers: { "content-type": "application/json" }
97
502
  }
98
- candidates.push({
99
- key,
100
- endpointUrl: parsedUrl.toString(),
101
- parsedUrl
102
- });
103
- }
104
- return candidates;
105
- }
106
- function validateAnsHcs27Hints(input) {
107
- if (!isObjectRecord(input)) {
108
- return void 0;
109
- }
110
- const checkpointTopicId = asString(input["checkpoint_topic_id"]);
111
- const registry = asString(input["registry"]);
112
- const logId = asString(input["log_id"]);
113
- if (!checkpointTopicId || !registry || !logId || registry !== ANS_HCS27_REGISTRY) {
114
- return void 0;
115
- }
116
- const checkpointUri = asString(input["checkpoint_uri"]) ?? void 0;
117
- const viewerUri = asString(input["viewer_uri"]) ?? void 0;
118
- return {
119
- checkpointTopicId,
120
- registry,
121
- logId,
122
- checkpointUri,
123
- viewerUri
124
- };
125
- }
126
- function validateHcs28Hints(input) {
127
- if (!isObjectRecord(input)) {
128
- return void 0;
129
- }
130
- const directoryTopicId = asString(input["directory_topic_id"]);
131
- const tId = asString(input["t_id"]);
132
- const agentId = asString(input["agent_id"]);
133
- if (!directoryTopicId || !tId || !agentId) {
134
- return void 0;
135
- }
136
- const proofProfile = asString(input["proof_profile"]) ?? void 0;
137
- return {
138
- directoryTopicId,
139
- tId,
140
- agentId,
141
- proofProfile
142
- };
143
- }
144
- function parseTransparencyHints(input) {
145
- if (!isObjectRecord(input)) {
146
- return void 0;
147
- }
148
- const hcs27 = validateAnsHcs27Hints(input["hcs27"]);
149
- const hcs28 = validateHcs28Hints(input["hcs28"]);
150
- if (!hcs27 && !hcs28) {
151
- return void 0;
152
- }
153
- return {
154
- hcs27,
155
- hcs28
156
- };
157
- }
158
- function parseAnsAgentCard(input) {
159
- if (!isObjectRecord(input)) {
160
- return null;
161
- }
162
- const ansName = asString(input["ansName"]);
163
- const endpoints = input["endpoints"];
164
- if (!ansName || !isObjectRecord(endpoints)) {
165
- return null;
166
- }
167
- return {
168
- ansName,
169
- endpoints,
170
- transparencyHints: parseTransparencyHints(input["transparency"])
171
- };
172
- }
173
- function selectPreferredEndpoint(candidates, protocol) {
174
- if (candidates.length === 0) {
175
- return null;
176
- }
177
- const sortedCandidates = [...candidates].sort(
178
- (a, b) => a.key.localeCompare(b.key)
179
- );
180
- const protocolMatches = sortedCandidates.filter(
181
- (candidate) => hasProtocolPathSegment(candidate.parsedUrl.pathname, protocol)
182
- );
183
- if (protocolMatches.length > 0) {
184
- return protocolMatches[0];
185
- }
186
- return sortedCandidates[0];
187
- }
188
- function toErrorMessage(error) {
189
- if (error instanceof Error && error.message) {
190
- return error.message;
191
- }
192
- return null;
503
+ );
504
+ return client.parseWithSchema(
505
+ raw,
506
+ skillVerificationDomainProofVerifyResponseSchema,
507
+ "skill domain proof verify response"
508
+ );
193
509
  }
194
510
  export {
195
- extractEndpointCandidates,
196
- isValidAnsProfileVersion,
197
- normalizeAnsVersion,
198
- parseAnsAgentCard,
199
- parseAnsDnsTxtRecord,
200
- selectPreferredEndpoint,
201
- toErrorMessage
511
+ createSkillDomainProofChallenge,
512
+ getMySkillsList,
513
+ getRecommendedSkillVersion,
514
+ getSkillBadge,
515
+ getSkillDeprecations,
516
+ getSkillOwnership,
517
+ getSkillPublishJob,
518
+ getSkillVerificationStatus,
519
+ getSkillVoteStatus,
520
+ getSkillsCatalog,
521
+ listMySkills,
522
+ listSkillCategories,
523
+ listSkillTags,
524
+ listSkillVersions,
525
+ listSkills,
526
+ publishSkill,
527
+ quoteSkillPublish,
528
+ requestSkillVerification,
529
+ resolveSkillManifest,
530
+ resolveSkillMarkdown,
531
+ setRecommendedSkillVersion,
532
+ setSkillDeprecation,
533
+ setSkillVote,
534
+ skillsConfig,
535
+ verifySkillDomainProof
202
536
  };
203
537
  //# sourceMappingURL=standards-sdk.es160.js.map