@agentxm/extension-model 0.28.4-bootstrap.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 (263) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +17 -0
  3. package/dist/src/unstable/agent-capabilities/catalog.d.ts +47000 -0
  4. package/dist/src/unstable/agent-capabilities/catalog.js +172 -0
  5. package/dist/src/unstable/agent-capabilities/data/agents/adal.d.ts +162 -0
  6. package/dist/src/unstable/agent-capabilities/data/agents/adal.js +134 -0
  7. package/dist/src/unstable/agent-capabilities/data/agents/aider-desk.d.ts +167 -0
  8. package/dist/src/unstable/agent-capabilities/data/agents/aider-desk.js +133 -0
  9. package/dist/src/unstable/agent-capabilities/data/agents/amp.d.ts +203 -0
  10. package/dist/src/unstable/agent-capabilities/data/agents/amp.js +187 -0
  11. package/dist/src/unstable/agent-capabilities/data/agents/antigravity-cli.d.ts +186 -0
  12. package/dist/src/unstable/agent-capabilities/data/agents/antigravity-cli.js +140 -0
  13. package/dist/src/unstable/agent-capabilities/data/agents/antigravity.d.ts +357 -0
  14. package/dist/src/unstable/agent-capabilities/data/agents/antigravity.js +294 -0
  15. package/dist/src/unstable/agent-capabilities/data/agents/augment.d.ts +383 -0
  16. package/dist/src/unstable/agent-capabilities/data/agents/augment.js +329 -0
  17. package/dist/src/unstable/agent-capabilities/data/agents/chatgpt.d.ts +159 -0
  18. package/dist/src/unstable/agent-capabilities/data/agents/chatgpt.js +117 -0
  19. package/dist/src/unstable/agent-capabilities/data/agents/claude-ai.d.ts +153 -0
  20. package/dist/src/unstable/agent-capabilities/data/agents/claude-ai.js +105 -0
  21. package/dist/src/unstable/agent-capabilities/data/agents/claude-code.d.ts +460 -0
  22. package/dist/src/unstable/agent-capabilities/data/agents/claude-code.js +406 -0
  23. package/dist/src/unstable/agent-capabilities/data/agents/cline.d.ts +225 -0
  24. package/dist/src/unstable/agent-capabilities/data/agents/cline.js +190 -0
  25. package/dist/src/unstable/agent-capabilities/data/agents/codearts-agent.d.ts +246 -0
  26. package/dist/src/unstable/agent-capabilities/data/agents/codearts-agent.js +206 -0
  27. package/dist/src/unstable/agent-capabilities/data/agents/codebuddy.d.ts +420 -0
  28. package/dist/src/unstable/agent-capabilities/data/agents/codebuddy.js +378 -0
  29. package/dist/src/unstable/agent-capabilities/data/agents/codemaker.d.ts +143 -0
  30. package/dist/src/unstable/agent-capabilities/data/agents/codemaker.js +112 -0
  31. package/dist/src/unstable/agent-capabilities/data/agents/codestudio.d.ts +165 -0
  32. package/dist/src/unstable/agent-capabilities/data/agents/codestudio.js +136 -0
  33. package/dist/src/unstable/agent-capabilities/data/agents/codex.d.ts +458 -0
  34. package/dist/src/unstable/agent-capabilities/data/agents/codex.js +399 -0
  35. package/dist/src/unstable/agent-capabilities/data/agents/command-code.d.ts +247 -0
  36. package/dist/src/unstable/agent-capabilities/data/agents/command-code.js +222 -0
  37. package/dist/src/unstable/agent-capabilities/data/agents/continue.d.ts +322 -0
  38. package/dist/src/unstable/agent-capabilities/data/agents/continue.js +273 -0
  39. package/dist/src/unstable/agent-capabilities/data/agents/cortex.d.ts +306 -0
  40. package/dist/src/unstable/agent-capabilities/data/agents/cortex.js +241 -0
  41. package/dist/src/unstable/agent-capabilities/data/agents/cowork.d.ts +185 -0
  42. package/dist/src/unstable/agent-capabilities/data/agents/cowork.js +133 -0
  43. package/dist/src/unstable/agent-capabilities/data/agents/crush.d.ts +249 -0
  44. package/dist/src/unstable/agent-capabilities/data/agents/crush.js +218 -0
  45. package/dist/src/unstable/agent-capabilities/data/agents/cursor.d.ts +300 -0
  46. package/dist/src/unstable/agent-capabilities/data/agents/cursor.js +282 -0
  47. package/dist/src/unstable/agent-capabilities/data/agents/deepagents.d.ts +159 -0
  48. package/dist/src/unstable/agent-capabilities/data/agents/deepagents.js +137 -0
  49. package/dist/src/unstable/agent-capabilities/data/agents/devin.d.ts +410 -0
  50. package/dist/src/unstable/agent-capabilities/data/agents/devin.js +358 -0
  51. package/dist/src/unstable/agent-capabilities/data/agents/dexto.d.ts +166 -0
  52. package/dist/src/unstable/agent-capabilities/data/agents/dexto.js +141 -0
  53. package/dist/src/unstable/agent-capabilities/data/agents/droid.d.ts +318 -0
  54. package/dist/src/unstable/agent-capabilities/data/agents/droid.js +257 -0
  55. package/dist/src/unstable/agent-capabilities/data/agents/firebender.d.ts +313 -0
  56. package/dist/src/unstable/agent-capabilities/data/agents/firebender.js +244 -0
  57. package/dist/src/unstable/agent-capabilities/data/agents/forgecode.d.ts +193 -0
  58. package/dist/src/unstable/agent-capabilities/data/agents/forgecode.js +160 -0
  59. package/dist/src/unstable/agent-capabilities/data/agents/gemini-app.d.ts +153 -0
  60. package/dist/src/unstable/agent-capabilities/data/agents/gemini-app.js +105 -0
  61. package/dist/src/unstable/agent-capabilities/data/agents/gemini-cli.d.ts +424 -0
  62. package/dist/src/unstable/agent-capabilities/data/agents/gemini-cli.js +411 -0
  63. package/dist/src/unstable/agent-capabilities/data/agents/github-copilot-cli.d.ts +300 -0
  64. package/dist/src/unstable/agent-capabilities/data/agents/github-copilot-cli.js +307 -0
  65. package/dist/src/unstable/agent-capabilities/data/agents/goose.d.ts +162 -0
  66. package/dist/src/unstable/agent-capabilities/data/agents/goose.js +131 -0
  67. package/dist/src/unstable/agent-capabilities/data/agents/grok-cli.d.ts +186 -0
  68. package/dist/src/unstable/agent-capabilities/data/agents/grok-cli.js +164 -0
  69. package/dist/src/unstable/agent-capabilities/data/agents/hermes.d.ts +303 -0
  70. package/dist/src/unstable/agent-capabilities/data/agents/hermes.js +223 -0
  71. package/dist/src/unstable/agent-capabilities/data/agents/ibm-bob.d.ts +231 -0
  72. package/dist/src/unstable/agent-capabilities/data/agents/ibm-bob.js +200 -0
  73. package/dist/src/unstable/agent-capabilities/data/agents/iflow-cli.d.ts +182 -0
  74. package/dist/src/unstable/agent-capabilities/data/agents/iflow-cli.js +126 -0
  75. package/dist/src/unstable/agent-capabilities/data/agents/index.d.ts +67 -0
  76. package/dist/src/unstable/agent-capabilities/data/agents/index.js +67 -0
  77. package/dist/src/unstable/agent-capabilities/data/agents/junie.d.ts +219 -0
  78. package/dist/src/unstable/agent-capabilities/data/agents/junie.js +200 -0
  79. package/dist/src/unstable/agent-capabilities/data/agents/kilo.d.ts +282 -0
  80. package/dist/src/unstable/agent-capabilities/data/agents/kilo.js +260 -0
  81. package/dist/src/unstable/agent-capabilities/data/agents/kimi-cli.d.ts +350 -0
  82. package/dist/src/unstable/agent-capabilities/data/agents/kimi-cli.js +274 -0
  83. package/dist/src/unstable/agent-capabilities/data/agents/kiro-cli.d.ts +227 -0
  84. package/dist/src/unstable/agent-capabilities/data/agents/kiro-cli.js +197 -0
  85. package/dist/src/unstable/agent-capabilities/data/agents/kode.d.ts +166 -0
  86. package/dist/src/unstable/agent-capabilities/data/agents/kode.js +141 -0
  87. package/dist/src/unstable/agent-capabilities/data/agents/lingma.d.ts +185 -0
  88. package/dist/src/unstable/agent-capabilities/data/agents/lingma.js +149 -0
  89. package/dist/src/unstable/agent-capabilities/data/agents/mcpjam.d.ts +144 -0
  90. package/dist/src/unstable/agent-capabilities/data/agents/mcpjam.js +116 -0
  91. package/dist/src/unstable/agent-capabilities/data/agents/minimax-code.d.ts +138 -0
  92. package/dist/src/unstable/agent-capabilities/data/agents/minimax-code.js +93 -0
  93. package/dist/src/unstable/agent-capabilities/data/agents/mistral-vibe.d.ts +244 -0
  94. package/dist/src/unstable/agent-capabilities/data/agents/mistral-vibe.js +200 -0
  95. package/dist/src/unstable/agent-capabilities/data/agents/mux.d.ts +155 -0
  96. package/dist/src/unstable/agent-capabilities/data/agents/mux.js +127 -0
  97. package/dist/src/unstable/agent-capabilities/data/agents/neovate.d.ts +211 -0
  98. package/dist/src/unstable/agent-capabilities/data/agents/neovate.js +178 -0
  99. package/dist/src/unstable/agent-capabilities/data/agents/ona.d.ts +167 -0
  100. package/dist/src/unstable/agent-capabilities/data/agents/ona.js +110 -0
  101. package/dist/src/unstable/agent-capabilities/data/agents/openclaw.d.ts +139 -0
  102. package/dist/src/unstable/agent-capabilities/data/agents/openclaw.js +114 -0
  103. package/dist/src/unstable/agent-capabilities/data/agents/opencode.d.ts +220 -0
  104. package/dist/src/unstable/agent-capabilities/data/agents/opencode.js +192 -0
  105. package/dist/src/unstable/agent-capabilities/data/agents/openhands.d.ts +245 -0
  106. package/dist/src/unstable/agent-capabilities/data/agents/openhands.js +184 -0
  107. package/dist/src/unstable/agent-capabilities/data/agents/pi.d.ts +185 -0
  108. package/dist/src/unstable/agent-capabilities/data/agents/pi.js +169 -0
  109. package/dist/src/unstable/agent-capabilities/data/agents/pochi.d.ts +199 -0
  110. package/dist/src/unstable/agent-capabilities/data/agents/pochi.js +163 -0
  111. package/dist/src/unstable/agent-capabilities/data/agents/qoder-cn.d.ts +199 -0
  112. package/dist/src/unstable/agent-capabilities/data/agents/qoder-cn.js +141 -0
  113. package/dist/src/unstable/agent-capabilities/data/agents/qoder.d.ts +414 -0
  114. package/dist/src/unstable/agent-capabilities/data/agents/qoder.js +378 -0
  115. package/dist/src/unstable/agent-capabilities/data/agents/qwen-code.d.ts +406 -0
  116. package/dist/src/unstable/agent-capabilities/data/agents/qwen-code.js +345 -0
  117. package/dist/src/unstable/agent-capabilities/data/agents/replit.d.ts +144 -0
  118. package/dist/src/unstable/agent-capabilities/data/agents/replit.js +116 -0
  119. package/dist/src/unstable/agent-capabilities/data/agents/roo.d.ts +192 -0
  120. package/dist/src/unstable/agent-capabilities/data/agents/roo.js +180 -0
  121. package/dist/src/unstable/agent-capabilities/data/agents/rovodev.d.ts +189 -0
  122. package/dist/src/unstable/agent-capabilities/data/agents/rovodev.js +156 -0
  123. package/dist/src/unstable/agent-capabilities/data/agents/tabnine-cli.d.ts +280 -0
  124. package/dist/src/unstable/agent-capabilities/data/agents/tabnine-cli.js +223 -0
  125. package/dist/src/unstable/agent-capabilities/data/agents/trae-cn.d.ts +188 -0
  126. package/dist/src/unstable/agent-capabilities/data/agents/trae-cn.js +156 -0
  127. package/dist/src/unstable/agent-capabilities/data/agents/trae.d.ts +188 -0
  128. package/dist/src/unstable/agent-capabilities/data/agents/trae.js +156 -0
  129. package/dist/src/unstable/agent-capabilities/data/agents/warp.d.ts +169 -0
  130. package/dist/src/unstable/agent-capabilities/data/agents/warp.js +133 -0
  131. package/dist/src/unstable/agent-capabilities/data/agents/windsurf.d.ts +414 -0
  132. package/dist/src/unstable/agent-capabilities/data/agents/windsurf.js +326 -0
  133. package/dist/src/unstable/agent-capabilities/data/agents/zed.d.ts +168 -0
  134. package/dist/src/unstable/agent-capabilities/data/agents/zed.js +109 -0
  135. package/dist/src/unstable/agent-capabilities/data/agents/zencoder.d.ts +168 -0
  136. package/dist/src/unstable/agent-capabilities/data/agents/zencoder.js +137 -0
  137. package/dist/src/unstable/agent-capabilities/data/agents/zenflow.d.ts +153 -0
  138. package/dist/src/unstable/agent-capabilities/data/agents/zenflow.js +96 -0
  139. package/dist/src/unstable/agent-capabilities/derive.d.ts +129 -0
  140. package/dist/src/unstable/agent-capabilities/derive.js +389 -0
  141. package/dist/src/unstable/agent-capabilities/index.d.ts +15 -0
  142. package/dist/src/unstable/agent-capabilities/index.js +15 -0
  143. package/dist/src/unstable/agent-capabilities/lookup.d.ts +10 -0
  144. package/dist/src/unstable/agent-capabilities/lookup.js +9 -0
  145. package/dist/src/unstable/agent-capabilities/schema.d.ts +3788 -0
  146. package/dist/src/unstable/agent-capabilities/schema.js +1218 -0
  147. package/dist/src/unstable/agent-capabilities/verification.d.ts +25 -0
  148. package/dist/src/unstable/agent-capabilities/verification.js +40 -0
  149. package/dist/src/unstable/agents/registry.d.ts +33 -0
  150. package/dist/src/unstable/agents/registry.js +50 -0
  151. package/dist/src/unstable/agents/types.d.ts +126 -0
  152. package/dist/src/unstable/agents/types.js +17 -0
  153. package/dist/src/unstable/date-time.d.ts +17 -0
  154. package/dist/src/unstable/date-time.js +30 -0
  155. package/dist/src/unstable/discovery-walk.d.ts +8 -0
  156. package/dist/src/unstable/discovery-walk.js +15 -0
  157. package/dist/src/unstable/extension-types/index.d.ts +8 -0
  158. package/dist/src/unstable/extension-types/index.js +8 -0
  159. package/dist/src/unstable/extension-types/schema.d.ts +154 -0
  160. package/dist/src/unstable/extension-types/schema.js +102 -0
  161. package/dist/src/unstable/extension-types/standards.d.ts +29 -0
  162. package/dist/src/unstable/extension-types/standards.js +29 -0
  163. package/dist/src/unstable/extensions/common.d.ts +539 -0
  164. package/dist/src/unstable/extensions/common.js +605 -0
  165. package/dist/src/unstable/extensions/deprecation.d.ts +42 -0
  166. package/dist/src/unstable/extensions/deprecation.js +46 -0
  167. package/dist/src/unstable/extensions/fqn-pattern.d.ts +17 -0
  168. package/dist/src/unstable/extensions/fqn-pattern.js +63 -0
  169. package/dist/src/unstable/extensions/fqn.d.ts +51 -0
  170. package/dist/src/unstable/extensions/fqn.js +51 -0
  171. package/dist/src/unstable/extensions/handle.d.ts +16 -0
  172. package/dist/src/unstable/extensions/handle.js +30 -0
  173. package/dist/src/unstable/extensions/index.d.ts +13 -0
  174. package/dist/src/unstable/extensions/index.js +13 -0
  175. package/dist/src/unstable/extensions/installable-types.d.ts +12 -0
  176. package/dist/src/unstable/extensions/installable-types.js +21 -0
  177. package/dist/src/unstable/extensions/license.d.ts +16 -0
  178. package/dist/src/unstable/extensions/license.js +29 -0
  179. package/dist/src/unstable/extensions/manifest-metadata.d.ts +18 -0
  180. package/dist/src/unstable/extensions/manifest-metadata.js +61 -0
  181. package/dist/src/unstable/extensions/refs/extension-ref.d.ts +20 -0
  182. package/dist/src/unstable/extensions/refs/extension-ref.js +12 -0
  183. package/dist/src/unstable/extensions/refs/hook.d.ts +29 -0
  184. package/dist/src/unstable/extensions/refs/hook.js +8 -0
  185. package/dist/src/unstable/extensions/refs/knowledge.d.ts +15 -0
  186. package/dist/src/unstable/extensions/refs/knowledge.js +2 -0
  187. package/dist/src/unstable/extensions/refs/mcp-server.d.ts +19 -0
  188. package/dist/src/unstable/extensions/refs/mcp-server.js +8 -0
  189. package/dist/src/unstable/extensions/refs/pack.d.ts +17 -0
  190. package/dist/src/unstable/extensions/refs/pack.js +10 -0
  191. package/dist/src/unstable/extensions/refs/ref-base.d.ts +125 -0
  192. package/dist/src/unstable/extensions/refs/ref-base.js +12 -0
  193. package/dist/src/unstable/extensions/refs/rule.d.ts +27 -0
  194. package/dist/src/unstable/extensions/refs/rule.js +8 -0
  195. package/dist/src/unstable/extensions/refs/skill.d.ts +28 -0
  196. package/dist/src/unstable/extensions/refs/skill.js +11 -0
  197. package/dist/src/unstable/extensions/refs/subagent.d.ts +19 -0
  198. package/dist/src/unstable/extensions/refs/subagent.js +8 -0
  199. package/dist/src/unstable/extensions/registry-source.d.ts +37 -0
  200. package/dist/src/unstable/extensions/registry-source.js +158 -0
  201. package/dist/src/unstable/extensions/release-age.d.ts +36 -0
  202. package/dist/src/unstable/extensions/release-age.js +11 -0
  203. package/dist/src/unstable/extensions/universal-skills-dir.d.ts +58 -0
  204. package/dist/src/unstable/extensions/universal-skills-dir.js +68 -0
  205. package/dist/src/unstable/hooks/manifest-schema.d.ts +175 -0
  206. package/dist/src/unstable/hooks/manifest-schema.js +112 -0
  207. package/dist/src/unstable/knowledge/concept-ref.d.ts +34 -0
  208. package/dist/src/unstable/knowledge/concept-ref.js +114 -0
  209. package/dist/src/unstable/knowledge/index.d.ts +8 -0
  210. package/dist/src/unstable/knowledge/index.js +8 -0
  211. package/dist/src/unstable/knowledge/manifest-schema.d.ts +60 -0
  212. package/dist/src/unstable/knowledge/manifest-schema.js +34 -0
  213. package/dist/src/unstable/mcps/manifest-schema.d.ts +899 -0
  214. package/dist/src/unstable/mcps/manifest-schema.js +230 -0
  215. package/dist/src/unstable/package-urls/companion-package.d.ts +14 -0
  216. package/dist/src/unstable/package-urls/companion-package.js +44 -0
  217. package/dist/src/unstable/package-urls/index.d.ts +4 -0
  218. package/dist/src/unstable/package-urls/index.js +4 -0
  219. package/dist/src/unstable/package-urls/internal.d.ts +6 -0
  220. package/dist/src/unstable/package-urls/internal.js +17 -0
  221. package/dist/src/unstable/package-urls/package-identity-purl.d.ts +5 -0
  222. package/dist/src/unstable/package-urls/package-identity-purl.js +26 -0
  223. package/dist/src/unstable/package-urls/vers-range.d.ts +34 -0
  224. package/dist/src/unstable/package-urls/vers-range.js +163 -0
  225. package/dist/src/unstable/packaging/index.d.ts +8 -0
  226. package/dist/src/unstable/packaging/index.js +8 -0
  227. package/dist/src/unstable/packaging/package-type.d.ts +23 -0
  228. package/dist/src/unstable/packaging/package-type.js +31 -0
  229. package/dist/src/unstable/packaging/package-url.d.ts +50 -0
  230. package/dist/src/unstable/packaging/package-url.js +93 -0
  231. package/dist/src/unstable/packs/manifest-schema.d.ts +66 -0
  232. package/dist/src/unstable/packs/manifest-schema.js +34 -0
  233. package/dist/src/unstable/path-types.d.ts +22 -0
  234. package/dist/src/unstable/path-types.js +48 -0
  235. package/dist/src/unstable/rules/manifest-schema.d.ts +70 -0
  236. package/dist/src/unstable/rules/manifest-schema.js +43 -0
  237. package/dist/src/unstable/schema-issues.d.ts +13 -0
  238. package/dist/src/unstable/schema-issues.js +34 -0
  239. package/dist/src/unstable/skills/manifest-schema.d.ts +69 -0
  240. package/dist/src/unstable/skills/manifest-schema.js +31 -0
  241. package/dist/src/unstable/sources/forge-grammar.d.ts +22 -0
  242. package/dist/src/unstable/sources/forge-grammar.js +50 -0
  243. package/dist/src/unstable/sources/parser.d.ts +85 -0
  244. package/dist/src/unstable/sources/parser.js +122 -0
  245. package/dist/src/unstable/sources/printer.d.ts +14 -0
  246. package/dist/src/unstable/sources/printer.js +45 -0
  247. package/dist/src/unstable/sources/source-hash.d.ts +24 -0
  248. package/dist/src/unstable/sources/source-hash.js +22 -0
  249. package/dist/src/unstable/sources/source-host-provider.d.ts +112 -0
  250. package/dist/src/unstable/sources/source-host-provider.js +11 -0
  251. package/dist/src/unstable/sources/types.d.ts +262 -0
  252. package/dist/src/unstable/sources/types.js +127 -0
  253. package/dist/src/unstable/sources/workspace.d.ts +13 -0
  254. package/dist/src/unstable/sources/workspace.js +13 -0
  255. package/dist/src/unstable/subagents/manifest-schema.d.ts +81 -0
  256. package/dist/src/unstable/subagents/manifest-schema.js +43 -0
  257. package/dist/src/unstable/version-constraints/version-constraints.d.ts +71 -0
  258. package/dist/src/unstable/version-constraints/version-constraints.js +144 -0
  259. package/dist/src/unstable/workspace-files.d.ts +13 -0
  260. package/dist/src/unstable/workspace-files.js +13 -0
  261. package/dist/src/unstable/workspace-scope.d.ts +11 -0
  262. package/dist/src/unstable/workspace-scope.js +10 -0
  263. package/package.json +271 -0
@@ -0,0 +1,230 @@
1
+ /**
2
+ * MCP server manifest schema definition.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import * as Schema from "effect/Schema";
7
+ import { CommonManifestBaseFields, ExtensionNameSchema, NonPackManifestFields, } from "../extensions/common.js";
8
+ /**
9
+ * Filename for MCP server manifest files.
10
+ *
11
+ * @experimental This API is unstable and may change without notice.
12
+ */
13
+ export const MCP_SERVER_MANIFEST_FILENAME = "mcp.json";
14
+ /**
15
+ * URL for the MCP server manifest JSON Schema.
16
+ *
17
+ * @experimental This API is unstable and may change without notice.
18
+ */
19
+ export const MCP_SERVER_MANIFEST_SCHEMA_URL = "https://axm.sh/schemas/mcp.schema.json";
20
+ /** @experimental This API is unstable and may change without notice. */
21
+ export const MCP_SERVER_REGISTRY_SERVER_SCHEMA_URL = "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json";
22
+ const HttpUrlSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(/^https?:\/\/[^\s]+$/, {
23
+ message: "Expected an HTTP(S) URL.",
24
+ })));
25
+ const Sha256Schema = Schema.String.pipe(Schema.check(Schema.isPattern(/^[a-f0-9]{64}$/, {
26
+ message: "Expected a lowercase SHA-256 hex digest.",
27
+ })));
28
+ const McpRegistryInputFields = {
29
+ choices: Schema.optional(Schema.Array(Schema.String)),
30
+ default: Schema.optional(Schema.String),
31
+ description: Schema.optional(Schema.String),
32
+ format: Schema.optional(Schema.Literals(["string", "number", "boolean", "filepath"])),
33
+ isRequired: Schema.optional(Schema.Boolean),
34
+ isSecret: Schema.optional(Schema.Boolean),
35
+ placeholder: Schema.optional(Schema.String),
36
+ value: Schema.optional(Schema.String),
37
+ variables: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
38
+ };
39
+ /** @experimental This API is unstable and may change without notice. */
40
+ export const McpRegistryInputSchema = Schema.Struct({
41
+ ...McpRegistryInputFields,
42
+ }).annotate({
43
+ identifier: "McpRegistryInput",
44
+ title: "MCP Registry Input",
45
+ description: "Input metadata from the MCP registry server.json schema.",
46
+ });
47
+ /** @experimental This API is unstable and may change without notice. */
48
+ export const McpRegistryKeyValueInputSchema = Schema.Struct({
49
+ ...McpRegistryInputFields,
50
+ name: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "input name is required" })),
51
+ }).annotate({
52
+ identifier: "McpRegistryKeyValueInput",
53
+ title: "MCP Registry Key/Value Input",
54
+ description: "Named header or environment variable input.",
55
+ });
56
+ /** @experimental This API is unstable and may change without notice. */
57
+ export const McpRegistryNamedArgumentSchema = Schema.Struct({
58
+ ...McpRegistryInputFields,
59
+ type: Schema.Literal("named"),
60
+ name: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "argument name is required" })),
61
+ isRepeated: Schema.optional(Schema.Boolean),
62
+ }).annotate({
63
+ identifier: "McpRegistryNamedArgument",
64
+ title: "MCP Registry Named Argument",
65
+ description: "A named command-line argument.",
66
+ });
67
+ /** @experimental This API is unstable and may change without notice. */
68
+ export const McpRegistryPositionalArgumentSchema = Schema.Union([
69
+ Schema.Struct({
70
+ ...McpRegistryInputFields,
71
+ type: Schema.Literal("positional"),
72
+ isRepeated: Schema.optional(Schema.Boolean),
73
+ valueHint: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "positional argument valueHint is required" })),
74
+ }),
75
+ Schema.Struct({
76
+ ...McpRegistryInputFields,
77
+ type: Schema.Literal("positional"),
78
+ isRepeated: Schema.optional(Schema.Boolean),
79
+ value: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "positional argument value is required" })),
80
+ }),
81
+ ]).annotate({
82
+ identifier: "McpRegistryPositionalArgument",
83
+ title: "MCP Registry Positional Argument",
84
+ description: "A positional command-line argument.",
85
+ });
86
+ /** @experimental This API is unstable and may change without notice. */
87
+ export const McpRegistryArgumentSchema = Schema.Union([
88
+ McpRegistryPositionalArgumentSchema,
89
+ McpRegistryNamedArgumentSchema,
90
+ ]).annotate({
91
+ identifier: "McpRegistryArgument",
92
+ title: "MCP Registry Argument",
93
+ description: "Command-line argument metadata from the MCP registry schema.",
94
+ });
95
+ /** @experimental This API is unstable and may change without notice. */
96
+ export const McpRegistryIconSchema = Schema.Struct({
97
+ src: Schema.NonEmptyString.pipe(Schema.annotateKey({ messageMissingKey: "icon src is required" })),
98
+ mimeType: Schema.optional(Schema.Literals(["image/png", "image/jpeg", "image/jpg", "image/svg+xml", "image/webp"])),
99
+ sizes: Schema.optional(Schema.Array(Schema.String.pipe(Schema.check(Schema.isPattern(/^(\d+x\d+|any)$/, {
100
+ message: "Expected an icon size like 48x48 or any.",
101
+ }))))),
102
+ theme: Schema.optional(Schema.Literals(["light", "dark"])),
103
+ }).annotate({
104
+ identifier: "McpRegistryIcon",
105
+ title: "MCP Registry Icon",
106
+ description: "Optional icon metadata from the MCP registry schema.",
107
+ });
108
+ /** @experimental This API is unstable and may change without notice. */
109
+ export const McpRegistryStdioTransportSchema = Schema.Struct({
110
+ type: Schema.Literal("stdio"),
111
+ }).annotate({
112
+ identifier: "McpRegistryStdioTransport",
113
+ title: "MCP Registry Stdio Transport",
114
+ });
115
+ /** @experimental This API is unstable and may change without notice. */
116
+ export const McpRegistryStreamableHttpTransportSchema = Schema.Struct({
117
+ type: Schema.Literal("streamable-http"),
118
+ url: HttpUrlSchema.pipe(Schema.annotateKey({ messageMissingKey: "transport url is required" })),
119
+ headers: Schema.optional(Schema.Array(McpRegistryKeyValueInputSchema)),
120
+ }).annotate({
121
+ identifier: "McpRegistryStreamableHttpTransport",
122
+ title: "MCP Registry Streamable HTTP Transport",
123
+ });
124
+ /** @experimental This API is unstable and may change without notice. */
125
+ export const McpRegistrySseTransportSchema = Schema.Struct({
126
+ type: Schema.Literal("sse"),
127
+ url: HttpUrlSchema.pipe(Schema.annotateKey({ messageMissingKey: "transport url is required" })),
128
+ headers: Schema.optional(Schema.Array(McpRegistryKeyValueInputSchema)),
129
+ }).annotate({
130
+ identifier: "McpRegistrySseTransport",
131
+ title: "MCP Registry SSE Transport",
132
+ });
133
+ /** @experimental This API is unstable and may change without notice. */
134
+ export const McpRegistryLocalTransportSchema = Schema.Union([
135
+ McpRegistryStdioTransportSchema,
136
+ McpRegistryStreamableHttpTransportSchema,
137
+ McpRegistrySseTransportSchema,
138
+ ]).annotate({
139
+ identifier: "McpRegistryLocalTransport",
140
+ title: "MCP Registry Local Transport",
141
+ });
142
+ /** @experimental This API is unstable and may change without notice. */
143
+ export const McpRegistryRemoteTransportSchema = Schema.Union([
144
+ Schema.Struct({
145
+ type: Schema.Literal("streamable-http"),
146
+ url: HttpUrlSchema.pipe(Schema.annotateKey({ messageMissingKey: "transport url is required" })),
147
+ headers: Schema.optional(Schema.Array(McpRegistryKeyValueInputSchema)),
148
+ variables: Schema.optional(Schema.Record(Schema.String, McpRegistryInputSchema)),
149
+ }),
150
+ Schema.Struct({
151
+ type: Schema.Literal("sse"),
152
+ url: HttpUrlSchema.pipe(Schema.annotateKey({ messageMissingKey: "transport url is required" })),
153
+ headers: Schema.optional(Schema.Array(McpRegistryKeyValueInputSchema)),
154
+ variables: Schema.optional(Schema.Record(Schema.String, McpRegistryInputSchema)),
155
+ }),
156
+ ]).annotate({
157
+ identifier: "McpRegistryRemoteTransport",
158
+ title: "MCP Registry Remote Transport",
159
+ });
160
+ /** @experimental This API is unstable and may change without notice. */
161
+ export const McpRegistryPackageSchema = Schema.Struct({
162
+ registryType: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "package registryType is required" })),
163
+ identifier: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "package identifier is required" })),
164
+ transport: McpRegistryLocalTransportSchema.pipe(Schema.annotateKey({ messageMissingKey: "package transport is required" })),
165
+ version: Schema.optional(Schema.NonEmptyString.pipe(Schema.check(Schema.makeFilter((value) => value === "latest" ? "Package version must not be latest." : true)))),
166
+ registryBaseUrl: Schema.optional(Schema.String),
167
+ runtimeHint: Schema.optional(Schema.String),
168
+ runtimeArguments: Schema.optional(Schema.Array(McpRegistryArgumentSchema)),
169
+ packageArguments: Schema.optional(Schema.Array(McpRegistryArgumentSchema)),
170
+ environmentVariables: Schema.optional(Schema.Array(McpRegistryKeyValueInputSchema)),
171
+ fileSha256: Schema.optional(Sha256Schema),
172
+ }).annotate({
173
+ identifier: "McpRegistryPackage",
174
+ title: "MCP Registry Package",
175
+ description: "Installable MCP server package distribution.",
176
+ });
177
+ /** @experimental This API is unstable and may change without notice. */
178
+ export const McpRegistryRepositorySchema = Schema.Struct({
179
+ url: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "repository url is required" })),
180
+ source: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "repository source is required" })),
181
+ id: Schema.optional(Schema.String),
182
+ subfolder: Schema.optional(Schema.String),
183
+ }).annotate({
184
+ identifier: "McpRegistryRepository",
185
+ title: "MCP Registry Repository",
186
+ description: "Repository metadata for an MCP server.",
187
+ });
188
+ /** @experimental This API is unstable and may change without notice. */
189
+ export const McpRegistryServerDetailSchema = Schema.Struct({
190
+ $schema: Schema.optional(Schema.String),
191
+ name: Schema.NonEmptyString.pipe(Schema.annotateKey({ messageMissingKey: "MCP registry server name is required" }), Schema.check(Schema.isPattern(/^[a-zA-Z0-9.-]+\/[a-zA-Z0-9._-]+$/, {
192
+ message: "Expected reverse-DNS MCP server name with one slash.",
193
+ }))),
194
+ description: Schema.NonEmptyString.pipe(Schema.annotateKey({ messageMissingKey: "MCP registry server description is required" })),
195
+ version: Schema.String.pipe(Schema.annotateKey({ messageMissingKey: "MCP registry server version is required" })),
196
+ title: Schema.optional(Schema.NonEmptyString),
197
+ packages: Schema.optional(Schema.Array(McpRegistryPackageSchema)),
198
+ remotes: Schema.optional(Schema.Array(McpRegistryRemoteTransportSchema)),
199
+ repository: Schema.optional(McpRegistryRepositorySchema),
200
+ icons: Schema.optional(Schema.Array(McpRegistryIconSchema)),
201
+ websiteUrl: Schema.optional(Schema.String),
202
+ _meta: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
203
+ }).annotate({
204
+ identifier: "McpRegistryServerDetail",
205
+ title: "MCP Registry Server Detail",
206
+ description: "Verbatim MCP registry server.json ServerDetail embedded in AXM mcp.json manifests.",
207
+ });
208
+ /**
209
+ * Schema for MCP server manifest files (mcp.json).
210
+ *
211
+ * MCP servers provide Model Context Protocol endpoints that
212
+ * extend coding agent capabilities with external tools and resources.
213
+ *
214
+ * @experimental This API is unstable and may change without notice.
215
+ */
216
+ export const McpServerManifestSchema = Schema.Struct({
217
+ $schema: Schema.optional(Schema.String),
218
+ ...CommonManifestBaseFields,
219
+ ...NonPackManifestFields,
220
+ type: Schema.Literal("mcp-server"),
221
+ name: ExtensionNameSchema.pipe(Schema.annotateKey({ messageMissingKey: "MCP server name is required" }), Schema.annotate({
222
+ description: "Short name for this MCP server within its owner namespace. Combined with owner, forms the FQN @owner/mcps/<name>.",
223
+ })),
224
+ server: McpRegistryServerDetailSchema.pipe(Schema.annotateKey({ messageMissingKey: "MCP registry server detail is required" })),
225
+ }).annotate({
226
+ identifier: "McpServerManifest",
227
+ title: "MCP Server Manifest",
228
+ description: "Extension manifest file for MCP server. Registers a Model Context Protocol server that coding agents can connect to for additional tools and resources.",
229
+ });
230
+ //# sourceMappingURL=manifest-schema.js.map
@@ -0,0 +1,14 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const CompanionPackageSchema: Schema.Struct<{
3
+ readonly purl: Schema.brand<Schema.NonEmptyString, "PackageIdentityPurl">;
4
+ readonly versionRange: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.Struct<{
5
+ readonly raw: Schema.NonEmptyString;
6
+ readonly scheme: Schema.NonEmptyString;
7
+ readonly constraints: Schema.$Array<Schema.Struct<{
8
+ readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
9
+ readonly version: Schema.NonEmptyString;
10
+ }>>;
11
+ }>>, Schema.NonEmptyString, never, never>, "VersRange">>;
12
+ }>;
13
+ export type CompanionPackage = Schema.Schema.Type<typeof CompanionPackageSchema>;
14
+ //# sourceMappingURL=companion-package.d.ts.map
@@ -0,0 +1,44 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { parsePurlIdentity } from "./internal.js";
3
+ import { PackageIdentityPurlSchema } from "./package-identity-purl.js";
4
+ import { isConcreteEcosystemScheme, splitVersAtScheme, VersRangeSchema } from "./vers-range.js";
5
+ const CompanionPackageShapeSchema = Schema.Struct({
6
+ purl: PackageIdentityPurlSchema,
7
+ versionRange: Schema.optional(VersRangeSchema),
8
+ }).annotate({
9
+ identifier: "CompanionPackageShape",
10
+ title: "Companion Package",
11
+ description: "A companion package purl identity with an optional VERS compatibility range.",
12
+ });
13
+ const validateCompanionPackage = (value) => {
14
+ const parsed = parsePurlIdentity(value.purl);
15
+ if (typeof parsed === "string") {
16
+ return parsed;
17
+ }
18
+ if (!isConcreteEcosystemScheme(parsed.type)) {
19
+ return `Companion package purl ecosystem '${parsed.type}' is not supported.`;
20
+ }
21
+ if (value.versionRange === undefined) {
22
+ return undefined;
23
+ }
24
+ let versionRangeScheme;
25
+ if (typeof value.versionRange === "string") {
26
+ const split = splitVersAtScheme(value.versionRange);
27
+ if (typeof split === "string") {
28
+ return split;
29
+ }
30
+ versionRangeScheme = split.scheme;
31
+ }
32
+ else {
33
+ versionRangeScheme = value.versionRange.scheme;
34
+ }
35
+ return parsed.type === versionRangeScheme
36
+ ? undefined
37
+ : `Companion package purl ecosystem '${parsed.type}' must match VERS scheme '${versionRangeScheme}'.`;
38
+ };
39
+ export const CompanionPackageSchema = CompanionPackageShapeSchema.pipe(Schema.check(Schema.makeFilter(validateCompanionPackage)), Schema.annotate({
40
+ identifier: "CompanionPackage",
41
+ title: "Companion Package",
42
+ description: "A companion package declaration. The purl is an identity-only Package URL; versionRange is an optional VERS expression whose scheme must match the purl ecosystem.",
43
+ }));
44
+ //# sourceMappingURL=companion-package.js.map
@@ -0,0 +1,4 @@
1
+ export { CompanionPackageSchema, type CompanionPackage } from "./companion-package.js";
2
+ export { PACKAGE_IDENTITY_PURL_DESCRIPTION, PackageIdentityPurlSchema, type PackageIdentityPurl, } from "./package-identity-purl.js";
3
+ export { VersComparatorSchema, VersConstraintSchema, VersRangeSchema, parseVersRange, splitVersAtScheme, type VersComparator, type VersConstraint, type VersRange, } from "./vers-range.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export { CompanionPackageSchema } from "./companion-package.js";
2
+ export { PACKAGE_IDENTITY_PURL_DESCRIPTION, PackageIdentityPurlSchema, } from "./package-identity-purl.js";
3
+ export { VersComparatorSchema, VersConstraintSchema, VersRangeSchema, parseVersRange, splitVersAtScheme, } from "./vers-range.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ export interface ParsedPurlIdentity {
2
+ readonly type: string;
3
+ readonly version: string | undefined;
4
+ }
5
+ export declare const parsePurlIdentity: (value: string) => ParsedPurlIdentity | string;
6
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { PackageURL } from "packageurl-js";
2
+ export const parsePurlIdentity = (value) => {
3
+ try {
4
+ const [type, , , version] = PackageURL.parseString(value);
5
+ if (type === undefined) {
6
+ return `Expected valid purl, got: ${value}`;
7
+ }
8
+ return {
9
+ type: type.toLowerCase(),
10
+ version: version ?? undefined,
11
+ };
12
+ }
13
+ catch {
14
+ return `Expected valid purl, got: ${value}`;
15
+ }
16
+ };
17
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1,5 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const PACKAGE_IDENTITY_PURL_DESCRIPTION = "A Package URL (purl) identity for a companion package. Companion package purls are identities, not pins: omit the purl @version segment and put compatibility constraints in versionRange.";
3
+ export declare const PackageIdentityPurlSchema: Schema.brand<Schema.NonEmptyString, "PackageIdentityPurl">;
4
+ export type PackageIdentityPurl = Schema.Schema.Type<typeof PackageIdentityPurlSchema>;
5
+ //# sourceMappingURL=package-identity-purl.d.ts.map
@@ -0,0 +1,26 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { parsePurlIdentity } from "./internal.js";
3
+ export const PACKAGE_IDENTITY_PURL_DESCRIPTION = "A Package URL (purl) identity for a companion package. Companion package purls are identities, not pins: omit the purl @version segment and put compatibility constraints in versionRange.";
4
+ const PACKAGE_URL_PATTERN = /^[Pp][Kk][Gg]:[a-zA-Z][a-zA-Z0-9.+-]*\/.+$/;
5
+ const validatePackageIdentityPurl = (value) => {
6
+ const parsed = parsePurlIdentity(value);
7
+ if (typeof parsed === "string") {
8
+ return `Expected valid companion package purl, got: ${value}`;
9
+ }
10
+ return parsed.version === undefined
11
+ ? undefined
12
+ : `Companion package purls are identities, not pins. Move ${value}'s version into versionRange.`;
13
+ };
14
+ export const PackageIdentityPurlSchema = Schema.NonEmptyString.pipe(Schema.check(Schema.isPattern(PACKAGE_URL_PATTERN, {
15
+ title: "Package Identity Purl",
16
+ description: PACKAGE_IDENTITY_PURL_DESCRIPTION,
17
+ examples: ["pkg:npm/react", "pkg:pypi/requests", "pkg:cargo/serde"],
18
+ message: "Expected a Package URL like pkg:npm/react",
19
+ })), Schema.check(Schema.makeFilter(validatePackageIdentityPurl)), Schema.annotate({
20
+ identifier: "PackageIdentityPurl",
21
+ title: "Package Identity Purl",
22
+ description: PACKAGE_IDENTITY_PURL_DESCRIPTION,
23
+ examples: ["pkg:npm/react", "pkg:pypi/requests", "pkg:cargo/serde"],
24
+ message: "Companion package purls are identities, not pins. Use versionRange for versions.",
25
+ }), Schema.brand("PackageIdentityPurl"));
26
+ //# sourceMappingURL=package-identity-purl.js.map
@@ -0,0 +1,34 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const CONCRETE_ECOSYSTEM_SCHEMES: readonly ["apk", "bazel", "cargo", "cocoapods", "composer", "conan", "conda", "cpan", "cran", "deb", "docker", "gem", "golang", "hackage", "hex", "huggingface", "julia", "jsr", "luarocks", "maven", "mojo", "npm", "nuget", "opam", "pub", "pypi", "rpm", "swift", "zig"];
3
+ export declare const VersComparatorSchema: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
4
+ export type VersComparator = Schema.Schema.Type<typeof VersComparatorSchema>;
5
+ export declare const VersConstraintSchema: Schema.Struct<{
6
+ readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
7
+ readonly version: Schema.NonEmptyString;
8
+ }>;
9
+ export type VersConstraint = Schema.Schema.Type<typeof VersConstraintSchema>;
10
+ declare const VersRangeDecodedSchema: Schema.Struct<{
11
+ readonly raw: Schema.NonEmptyString;
12
+ readonly scheme: Schema.NonEmptyString;
13
+ readonly constraints: Schema.$Array<Schema.Struct<{
14
+ readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
15
+ readonly version: Schema.NonEmptyString;
16
+ }>>;
17
+ }>;
18
+ export declare const isConcreteEcosystemScheme: (scheme: string) => boolean;
19
+ export declare const splitVersAtScheme: (value: string) => {
20
+ readonly scheme: string;
21
+ readonly constraintsText: string;
22
+ } | string;
23
+ export declare const parseVersRange: (value: string) => Schema.Schema.Type<typeof VersRangeDecodedSchema> | string;
24
+ export declare const VersRangeSchema: Schema.brand<Schema.decodeTo<Schema.toType<Schema.Struct<{
25
+ readonly raw: Schema.NonEmptyString;
26
+ readonly scheme: Schema.NonEmptyString;
27
+ readonly constraints: Schema.$Array<Schema.Struct<{
28
+ readonly comparator: Schema.Literals<readonly ["=", "!=", "<", "<=", ">", ">="]>;
29
+ readonly version: Schema.NonEmptyString;
30
+ }>>;
31
+ }>>, Schema.NonEmptyString, never, never>, "VersRange">;
32
+ export type VersRange = Schema.Schema.Type<typeof VersRangeSchema>;
33
+ export {};
34
+ //# sourceMappingURL=vers-range.d.ts.map
@@ -0,0 +1,163 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Schema from "effect/Schema";
3
+ import * as SchemaIssue from "effect/SchemaIssue";
4
+ import * as SchemaTransformation from "effect/SchemaTransformation";
5
+ const VERS_PREFIX = "vers:";
6
+ const SENTINEL_SCHEMES = [
7
+ "all",
8
+ "none",
9
+ "semver",
10
+ "generic",
11
+ "intdot",
12
+ "lexicographic",
13
+ "datetime",
14
+ ];
15
+ export const CONCRETE_ECOSYSTEM_SCHEMES = [
16
+ "apk",
17
+ "bazel",
18
+ "cargo",
19
+ "cocoapods",
20
+ "composer",
21
+ "conan",
22
+ "conda",
23
+ "cpan",
24
+ "cran",
25
+ "deb",
26
+ "docker",
27
+ "gem",
28
+ "golang",
29
+ "hackage",
30
+ "hex",
31
+ "huggingface",
32
+ "julia",
33
+ "jsr",
34
+ "luarocks",
35
+ "maven",
36
+ "mojo",
37
+ "npm",
38
+ "nuget",
39
+ "opam",
40
+ "pub",
41
+ "pypi",
42
+ "rpm",
43
+ "swift",
44
+ "zig",
45
+ ];
46
+ export const VersComparatorSchema = Schema.Literals(["=", "!=", "<", "<=", ">", ">="]).annotate({
47
+ identifier: "VersComparator",
48
+ title: "VERS Comparator",
49
+ description: "A comparator inside an AgentXM-supported VERS constraint.",
50
+ });
51
+ export const VersConstraintSchema = Schema.Struct({
52
+ comparator: VersComparatorSchema,
53
+ version: Schema.NonEmptyString,
54
+ }).annotate({
55
+ identifier: "VersConstraint",
56
+ title: "VERS Constraint",
57
+ description: "A parsed comparator and version from an AgentXM-supported VERS range.",
58
+ });
59
+ const VersRangeDecodedSchema = Schema.Struct({
60
+ raw: Schema.NonEmptyString,
61
+ scheme: Schema.NonEmptyString,
62
+ constraints: Schema.Array(VersConstraintSchema),
63
+ }).annotate({
64
+ identifier: "VersRangeDecoded",
65
+ title: "VERS Range",
66
+ description: "A decoded VERS range with its raw value, ecosystem scheme, and constraints.",
67
+ });
68
+ const isSentinelScheme = (scheme) => SENTINEL_SCHEMES.some((candidate) => candidate === scheme);
69
+ export const isConcreteEcosystemScheme = (scheme) => CONCRETE_ECOSYSTEM_SCHEMES.some((candidate) => candidate === scheme);
70
+ const parseComparator = (constraint) => {
71
+ if (constraint.startsWith(">="))
72
+ return ">=";
73
+ if (constraint.startsWith("<="))
74
+ return "<=";
75
+ if (constraint.startsWith("!="))
76
+ return "!=";
77
+ if (constraint.startsWith(">"))
78
+ return ">";
79
+ if (constraint.startsWith("<"))
80
+ return "<";
81
+ if (constraint.startsWith("="))
82
+ return "=";
83
+ return undefined;
84
+ };
85
+ const parseConstraint = (constraint) => {
86
+ const comparator = parseComparator(constraint);
87
+ if (comparator === undefined) {
88
+ return `Expected VERS constraint to start with one of =, !=, <, <=, >, or >=, got: ${constraint}`;
89
+ }
90
+ const version = constraint.slice(comparator.length);
91
+ if (version.length === 0) {
92
+ return `Expected VERS constraint version after ${comparator}`;
93
+ }
94
+ return { comparator, version };
95
+ };
96
+ export const splitVersAtScheme = (value) => {
97
+ if (!value.startsWith(VERS_PREFIX)) {
98
+ return "Expected VERS range to start with the vers: prefix.";
99
+ }
100
+ const withoutPrefix = value.slice(VERS_PREFIX.length);
101
+ const slashIndex = withoutPrefix.indexOf("/");
102
+ if (slashIndex <= 0) {
103
+ return "Expected VERS range to include a non-empty scheme before '/'.";
104
+ }
105
+ const scheme = withoutPrefix.slice(0, slashIndex);
106
+ const constraintsText = withoutPrefix.slice(slashIndex + 1);
107
+ if (constraintsText.length === 0) {
108
+ return "Expected VERS range to include at least one constraint after '/'.";
109
+ }
110
+ return { scheme, constraintsText };
111
+ };
112
+ export const parseVersRange = (value) => {
113
+ if (value.includes("%")) {
114
+ return "VERS percent-encoded values are not supported yet.";
115
+ }
116
+ const split = splitVersAtScheme(value);
117
+ if (typeof split === "string") {
118
+ return split;
119
+ }
120
+ if (isSentinelScheme(split.scheme)) {
121
+ return `VERS scheme '${split.scheme}' is a generic scheme; generic schemes are not accepted for companion packages.`;
122
+ }
123
+ if (!isConcreteEcosystemScheme(split.scheme)) {
124
+ return `VERS scheme '${split.scheme}' is not a known concrete package ecosystem.`;
125
+ }
126
+ if (split.constraintsText === "*") {
127
+ return 'omit versionRange to express "any version"; wildcard-only VERS ranges are not accepted.';
128
+ }
129
+ const constraints = [];
130
+ for (const constraintText of split.constraintsText.split("|")) {
131
+ if (constraintText.length === 0) {
132
+ return "Expected VERS range constraints to be non-empty.";
133
+ }
134
+ const constraint = parseConstraint(constraintText);
135
+ if (typeof constraint === "string") {
136
+ return constraint;
137
+ }
138
+ constraints.push(constraint);
139
+ }
140
+ return {
141
+ raw: value,
142
+ scheme: split.scheme,
143
+ constraints,
144
+ };
145
+ };
146
+ const parseVersRangeEffect = (value) => {
147
+ const result = parseVersRange(value);
148
+ return typeof result === "string"
149
+ ? Effect.fail(new SchemaIssue.Forbidden({ message: result }, value))
150
+ : Effect.succeed(result);
151
+ };
152
+ export const VersRangeSchema = Schema.NonEmptyString.pipe(Schema.decodeTo(Schema.toType(VersRangeDecodedSchema), SchemaTransformation.transformOrFail({
153
+ decode: parseVersRangeEffect,
154
+ encode: (value) => Effect.succeed(value.raw),
155
+ })), Schema.annotate({
156
+ identifier: "VersRange",
157
+ title: "VERS Range",
158
+ description: "A VERS version range like vers:npm/>=1.0.0|<2.0.0. Use a concrete package ecosystem scheme matching the companion purl type. Omit versionRange for any-version compatibility.",
159
+ message: "Expected a VERS range like vers:npm/>=1.0.0|<2.0.0",
160
+ }), Schema.annotateEncoded({
161
+ examples: ["vers:npm/>=18.0.0|<19.0.0", "vers:pypi/>=2.31.0", "vers:cargo/>=1.0.0"],
162
+ }), Schema.brand("VersRange"));
163
+ //# sourceMappingURL=vers-range.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Area barrel for the package public surface.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ export { type PackageType, PackageTypeSchema } from "./package-type.js";
7
+ export { type PackageUrlParts, PackageUrlPartsSchema, PackageUrlSchema, formatPackageDisplay, } from "./package-url.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Area barrel for the package public surface.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ export { PackageTypeSchema } from "./package-type.js";
7
+ export { PackageUrlPartsSchema, PackageUrlSchema, formatPackageDisplay, } from "./package-url.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Package type schema for purl type components.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import * as Schema from "effect/Schema";
7
+ /**
8
+ * Branded string schema for purl package types (e.g. "npm", "pypi", "maven").
9
+ *
10
+ * Enforces the purl spec character set and lowercase canonical form. To
11
+ * accept inputs in any case, decode through {@link PackageUrlSchema} which
12
+ * normalises the type before constructing parts.
13
+ *
14
+ * @experimental This API is unstable and may change without notice.
15
+ */
16
+ export declare const PackageTypeSchema: Schema.brand<Schema.String, "PackageType">;
17
+ /**
18
+ * Inferred type for purl package types.
19
+ *
20
+ * @experimental This API is unstable and may change without notice.
21
+ */
22
+ export type PackageType = Schema.Schema.Type<typeof PackageTypeSchema>;
23
+ //# sourceMappingURL=package-type.d.ts.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Package type schema for purl type components.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import * as Schema from "effect/Schema";
7
+ /**
8
+ * Spec-conformant character set for a purl type: lowercase ASCII letters,
9
+ * digits, period, plus, and dash; must start with a letter. The purl spec
10
+ * declares `type` case-insensitive with a lowercase canonical form, so this
11
+ * schema accepts only the canonical form.
12
+ *
13
+ * @see https://github.com/package-url/purl-spec
14
+ */
15
+ const PACKAGE_TYPE_PATTERN = /^[a-z][a-z0-9.+-]*$/;
16
+ /**
17
+ * Branded string schema for purl package types (e.g. "npm", "pypi", "maven").
18
+ *
19
+ * Enforces the purl spec character set and lowercase canonical form. To
20
+ * accept inputs in any case, decode through {@link PackageUrlSchema} which
21
+ * normalises the type before constructing parts.
22
+ *
23
+ * @experimental This API is unstable and may change without notice.
24
+ */
25
+ export const PackageTypeSchema = Schema.String.pipe(Schema.check(Schema.isPattern(PACKAGE_TYPE_PATTERN, {
26
+ title: "Package Type",
27
+ description: "A purl package type identifier in canonical lowercase form (e.g. npm, pypi, maven). Allowed characters: ASCII letters, digits, '.', '+', '-'; must start with a letter.",
28
+ examples: ["npm", "pypi", "maven", "golang"],
29
+ message: "Expected a lowercase purl package type like npm or pypi",
30
+ })), Schema.brand("PackageType"), Schema.annotate({ identifier: "PackageType" }));
31
+ //# sourceMappingURL=package-type.js.map