specli 0.0.5 → 0.0.7

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 (208) hide show
  1. package/cli.ts +13 -4
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +2331 -0
  5. package/dist/cli.js.map +53 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +2032 -0
  9. package/dist/index.js.map +48 -0
  10. package/dist/src/ai/tools.d.ts +139 -0
  11. package/dist/src/ai/tools.d.ts.map +1 -0
  12. package/dist/src/ai/tools.js +1656 -0
  13. package/dist/src/ai/tools.js.map +45 -0
  14. package/dist/src/cli/auth-requirements.d.ts +10 -0
  15. package/dist/src/cli/auth-requirements.d.ts.map +1 -0
  16. package/dist/src/cli/auth-requirements.js +66 -0
  17. package/dist/src/cli/auth-requirements.js.map +10 -0
  18. package/dist/src/cli/auth-schemes.d.ts +22 -0
  19. package/dist/src/cli/auth-schemes.d.ts.map +1 -0
  20. package/dist/src/cli/auth-schemes.js +116 -0
  21. package/dist/src/cli/auth-schemes.js.map +11 -0
  22. package/dist/src/cli/capabilities.d.ts +32 -0
  23. package/dist/src/cli/capabilities.d.ts.map +1 -0
  24. package/dist/src/cli/capabilities.js +45 -0
  25. package/dist/src/cli/capabilities.js.map +10 -0
  26. package/dist/src/cli/command-id.d.ts +8 -0
  27. package/dist/src/cli/command-id.d.ts.map +1 -0
  28. package/dist/src/cli/command-id.js +18 -0
  29. package/dist/src/cli/command-id.js.map +11 -0
  30. package/dist/src/cli/command-index.d.ts +6 -0
  31. package/dist/src/cli/command-index.d.ts.map +1 -0
  32. package/dist/src/cli/command-index.js +15 -0
  33. package/dist/src/cli/command-index.js.map +10 -0
  34. package/dist/src/cli/command-model.d.ts +40 -0
  35. package/dist/src/cli/command-model.d.ts.map +1 -0
  36. package/dist/src/cli/command-model.js +274 -0
  37. package/dist/src/cli/command-model.js.map +18 -0
  38. package/dist/src/cli/compile.d.ts +15 -0
  39. package/dist/src/cli/compile.d.ts.map +1 -0
  40. package/dist/src/cli/compile.js +146 -0
  41. package/dist/src/cli/compile.js.map +11 -0
  42. package/dist/src/cli/crypto.d.ts +2 -0
  43. package/dist/src/cli/crypto.d.ts.map +1 -0
  44. package/dist/src/cli/crypto.js +15 -0
  45. package/dist/src/cli/crypto.js.map +10 -0
  46. package/dist/src/cli/derive-name.d.ts +9 -0
  47. package/dist/src/cli/derive-name.d.ts.map +1 -0
  48. package/dist/src/cli/derive-name.js +70 -0
  49. package/dist/src/cli/derive-name.js.map +10 -0
  50. package/dist/src/cli/exec.d.ts +14 -0
  51. package/dist/src/cli/exec.d.ts.map +1 -0
  52. package/dist/src/cli/exec.js +2077 -0
  53. package/dist/src/cli/exec.js.map +49 -0
  54. package/dist/src/cli/main.d.ts +10 -0
  55. package/dist/src/cli/main.d.ts.map +1 -0
  56. package/dist/src/cli/main.js +2032 -0
  57. package/dist/src/cli/main.js.map +48 -0
  58. package/dist/src/cli/naming.d.ts +12 -0
  59. package/dist/src/cli/naming.d.ts.map +1 -0
  60. package/dist/src/cli/naming.js +216 -0
  61. package/dist/src/cli/naming.js.map +12 -0
  62. package/dist/src/cli/operations.d.ts +3 -0
  63. package/dist/src/cli/operations.d.ts.map +1 -0
  64. package/dist/src/cli/operations.js +103 -0
  65. package/dist/src/cli/operations.js.map +10 -0
  66. package/dist/src/cli/params.d.ts +19 -0
  67. package/dist/src/cli/params.d.ts.map +1 -0
  68. package/dist/src/cli/params.js +79 -0
  69. package/dist/src/cli/params.js.map +12 -0
  70. package/dist/src/cli/pluralize.d.ts +2 -0
  71. package/dist/src/cli/pluralize.d.ts.map +1 -0
  72. package/dist/src/cli/pluralize.js +43 -0
  73. package/dist/src/cli/pluralize.js.map +10 -0
  74. package/dist/src/cli/positional.d.ts +19 -0
  75. package/dist/src/cli/positional.d.ts.map +1 -0
  76. package/dist/src/cli/positional.js +39 -0
  77. package/dist/src/cli/positional.js.map +10 -0
  78. package/dist/src/cli/request-body.d.ts +20 -0
  79. package/dist/src/cli/request-body.d.ts.map +1 -0
  80. package/dist/src/cli/request-body.js +82 -0
  81. package/dist/src/cli/request-body.js.map +12 -0
  82. package/dist/src/cli/runtime/argv.d.ts +3 -0
  83. package/dist/src/cli/runtime/argv.d.ts.map +1 -0
  84. package/dist/src/cli/runtime/argv.js +22 -0
  85. package/dist/src/cli/runtime/argv.js.map +10 -0
  86. package/dist/src/cli/runtime/auth/resolve.d.ts +9 -0
  87. package/dist/src/cli/runtime/auth/resolve.d.ts.map +1 -0
  88. package/dist/src/cli/runtime/auth/resolve.js +38 -0
  89. package/dist/src/cli/runtime/auth/resolve.js.map +10 -0
  90. package/dist/src/cli/runtime/body-flags.d.ts +41 -0
  91. package/dist/src/cli/runtime/body-flags.d.ts.map +1 -0
  92. package/dist/src/cli/runtime/body-flags.js +86 -0
  93. package/dist/src/cli/runtime/body-flags.js.map +10 -0
  94. package/dist/src/cli/runtime/body.d.ts +15 -0
  95. package/dist/src/cli/runtime/body.d.ts.map +1 -0
  96. package/dist/src/cli/runtime/body.js +40 -0
  97. package/dist/src/cli/runtime/body.js.map +11 -0
  98. package/dist/src/cli/runtime/collect.d.ts +2 -0
  99. package/dist/src/cli/runtime/collect.d.ts.map +1 -0
  100. package/dist/src/cli/runtime/collect.js +9 -0
  101. package/dist/src/cli/runtime/collect.js.map +10 -0
  102. package/dist/src/cli/runtime/compat.d.ts +35 -0
  103. package/dist/src/cli/runtime/compat.d.ts.map +1 -0
  104. package/dist/src/cli/runtime/compat.js +62 -0
  105. package/dist/src/cli/runtime/compat.js.map +10 -0
  106. package/dist/src/cli/runtime/context.d.ts +16 -0
  107. package/dist/src/cli/runtime/context.d.ts.map +1 -0
  108. package/dist/src/cli/runtime/context.js +936 -0
  109. package/dist/src/cli/runtime/context.js.map +32 -0
  110. package/dist/src/cli/runtime/execute.d.ts +33 -0
  111. package/dist/src/cli/runtime/execute.d.ts.map +1 -0
  112. package/dist/src/cli/runtime/execute.js +670 -0
  113. package/dist/src/cli/runtime/execute.js.map +22 -0
  114. package/dist/src/cli/runtime/generated.d.ts +14 -0
  115. package/dist/src/cli/runtime/generated.d.ts.map +1 -0
  116. package/dist/src/cli/runtime/generated.js +869 -0
  117. package/dist/src/cli/runtime/generated.js.map +23 -0
  118. package/dist/src/cli/runtime/headers.d.ts +9 -0
  119. package/dist/src/cli/runtime/headers.d.ts.map +1 -0
  120. package/dist/src/cli/runtime/headers.js +36 -0
  121. package/dist/src/cli/runtime/headers.js.map +10 -0
  122. package/dist/src/cli/runtime/index.d.ts +4 -0
  123. package/dist/src/cli/runtime/index.d.ts.map +1 -0
  124. package/dist/src/cli/runtime/index.js +1808 -0
  125. package/dist/src/cli/runtime/index.js.map +46 -0
  126. package/dist/src/cli/runtime/profile/secrets.d.ts +25 -0
  127. package/dist/src/cli/runtime/profile/secrets.d.ts.map +1 -0
  128. package/dist/src/cli/runtime/profile/secrets.js +51 -0
  129. package/dist/src/cli/runtime/profile/secrets.js.map +11 -0
  130. package/dist/src/cli/runtime/profile/store.d.ts +15 -0
  131. package/dist/src/cli/runtime/profile/store.d.ts.map +1 -0
  132. package/dist/src/cli/runtime/profile/store.js +102 -0
  133. package/dist/src/cli/runtime/profile/store.js.map +11 -0
  134. package/dist/src/cli/runtime/request.d.ts +36 -0
  135. package/dist/src/cli/runtime/request.d.ts.map +1 -0
  136. package/dist/src/cli/runtime/request.js +571 -0
  137. package/dist/src/cli/runtime/request.js.map +21 -0
  138. package/dist/src/cli/runtime/server-url.d.ts +8 -0
  139. package/dist/src/cli/runtime/server-url.d.ts.map +1 -0
  140. package/dist/src/cli/runtime/server-url.js +55 -0
  141. package/dist/src/cli/runtime/server-url.js.map +11 -0
  142. package/dist/src/cli/runtime/template.d.ts +5 -0
  143. package/dist/src/cli/runtime/template.d.ts.map +1 -0
  144. package/dist/src/cli/runtime/template.js +29 -0
  145. package/dist/src/cli/runtime/template.js.map +10 -0
  146. package/dist/src/cli/runtime/validate/ajv.d.ts +3 -0
  147. package/dist/src/cli/runtime/validate/ajv.d.ts.map +1 -0
  148. package/dist/src/cli/runtime/validate/ajv.js +17 -0
  149. package/dist/src/cli/runtime/validate/ajv.js.map +10 -0
  150. package/dist/src/cli/runtime/validate/coerce.d.ts +4 -0
  151. package/dist/src/cli/runtime/validate/coerce.d.ts.map +1 -0
  152. package/dist/src/cli/runtime/validate/coerce.js +60 -0
  153. package/dist/src/cli/runtime/validate/coerce.js.map +10 -0
  154. package/dist/src/cli/runtime/validate/error.d.ts +3 -0
  155. package/dist/src/cli/runtime/validate/error.d.ts.map +1 -0
  156. package/dist/src/cli/runtime/validate/error.js +21 -0
  157. package/dist/src/cli/runtime/validate/error.js.map +10 -0
  158. package/dist/src/cli/runtime/validate/index.d.ts +5 -0
  159. package/dist/src/cli/runtime/validate/index.d.ts.map +1 -0
  160. package/dist/src/cli/runtime/validate/index.js +122 -0
  161. package/dist/src/cli/runtime/validate/index.js.map +13 -0
  162. package/dist/src/cli/runtime/validate/schema.d.ts +9 -0
  163. package/dist/src/cli/runtime/validate/schema.d.ts.map +1 -0
  164. package/dist/src/cli/runtime/validate/schema.js +36 -0
  165. package/dist/src/cli/runtime/validate/schema.js.map +10 -0
  166. package/dist/src/cli/schema-shape.d.ts +5 -0
  167. package/dist/src/cli/schema-shape.d.ts.map +1 -0
  168. package/dist/src/cli/schema-shape.js +41 -0
  169. package/dist/src/cli/schema-shape.js.map +10 -0
  170. package/dist/src/cli/schema.d.ts +30 -0
  171. package/dist/src/cli/schema.d.ts.map +1 -0
  172. package/dist/src/cli/schema.js +38 -0
  173. package/dist/src/cli/schema.js.map +10 -0
  174. package/dist/src/cli/server.d.ts +16 -0
  175. package/dist/src/cli/server.d.ts.map +1 -0
  176. package/dist/src/cli/server.js +64 -0
  177. package/dist/src/cli/server.js.map +11 -0
  178. package/dist/src/cli/spec-id.d.ts +3 -0
  179. package/dist/src/cli/spec-id.d.ts.map +1 -0
  180. package/dist/src/cli/spec-id.js +21 -0
  181. package/dist/src/cli/spec-id.js.map +11 -0
  182. package/dist/src/cli/spec-loader.d.ts +7 -0
  183. package/dist/src/cli/spec-loader.d.ts.map +1 -0
  184. package/dist/src/cli/spec-loader.js +110 -0
  185. package/dist/src/cli/spec-loader.js.map +15 -0
  186. package/dist/src/cli/stable-json.d.ts +4 -0
  187. package/dist/src/cli/stable-json.d.ts.map +1 -0
  188. package/dist/src/cli/stable-json.js +35 -0
  189. package/dist/src/cli/stable-json.js.map +10 -0
  190. package/dist/src/cli/strings.d.ts +3 -0
  191. package/dist/src/cli/strings.d.ts.map +1 -0
  192. package/dist/src/cli/strings.js +16 -0
  193. package/dist/src/cli/strings.js.map +10 -0
  194. package/dist/src/cli/types.d.ts +53 -0
  195. package/dist/src/cli/types.d.ts.map +1 -0
  196. package/dist/src/cli/types.js +9 -0
  197. package/dist/src/cli/types.js.map +10 -0
  198. package/package.json +31 -4
  199. package/src/ai/tools.ts +211 -0
  200. package/src/cli/main.ts +3 -2
  201. package/src/cli/runtime/body.ts +3 -3
  202. package/src/cli/runtime/compat.ts +89 -0
  203. package/src/cli/runtime/execute.ts +98 -39
  204. package/src/cli/runtime/generated.ts +111 -4
  205. package/src/cli/runtime/profile/secrets.ts +42 -1
  206. package/src/cli/runtime/profile/store.ts +15 -13
  207. package/src/cli/runtime/request.ts +12 -4
  208. package/src/cli/spec-loader.ts +2 -2
@@ -0,0 +1,32 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/strings.ts", "../../../../src/cli/auth-schemes.ts", "../../../../src/cli/capabilities.ts", "../../../../src/cli/command-index.ts", "../../../../src/cli/auth-requirements.ts", "../../../../src/cli/command-id.ts", "../../../../src/cli/schema-shape.ts", "../../../../src/cli/params.ts", "../../../../src/cli/positional.ts", "../../../../src/cli/types.ts", "../../../../src/cli/request-body.ts", "../../../../src/cli/command-model.ts", "../../../../src/cli/pluralize.ts", "../../../../src/cli/naming.ts", "../../../../src/cli/operations.ts", "../../../../src/cli/schema.ts", "../../../../src/cli/server.ts", "../../../../src/cli/spec-loader.ts", "../../../../src/cli/crypto.ts", "../../../../src/cli/runtime/compat.ts", "../../../../src/cli/spec-id.ts", "../../../../src/cli/stable-json.ts", "../../../../src/cli/runtime/context.ts"],
4
+ "sourcesContent": [
5
+ "export function kebabCase(input: string): string {\n\tconst trimmed = input.trim();\n\tif (!trimmed) return \"\";\n\n\t// Convert spaces/underscores/dots to dashes, split camelCase.\n\treturn trimmed\n\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n\t\t.replace(/[\\s_.:/]+/g, \"-\")\n\t\t.replace(/[^a-zA-Z0-9-]/g, \"-\")\n\t\t.replace(/-+/g, \"-\")\n\t\t.replace(/^-|-$/g, \"\")\n\t\t.toLowerCase();\n}\n\nexport function titleCase(input: string): string {\n\treturn input\n\t\t.split(/\\s+/g)\n\t\t.filter(Boolean)\n\t\t.map((w) => w[0]?.toUpperCase() + w.slice(1))\n\t\t.join(\" \");\n}\n",
6
+ "import { kebabCase } from \"./strings.ts\";\nimport type { OpenApiDoc } from \"./types.ts\";\n\nexport type AuthSchemeKind =\n\t| \"http-bearer\"\n\t| \"http-basic\"\n\t| \"api-key\"\n\t| \"oauth2\"\n\t| \"openIdConnect\"\n\t| \"unknown\";\n\nexport type AuthScheme = {\n\tkey: string;\n\tkind: AuthSchemeKind;\n\tname?: string;\n\tin?: \"header\" | \"query\" | \"cookie\";\n\tscheme?: string;\n\tbearerFormat?: string;\n\tdescription?: string;\n\n\t// oauth2/openid only (subset of spec, enough to derive flags + docs)\n\toauthFlows?: OAuthFlows;\n\topenIdConnectUrl?: string;\n};\n\nexport type OAuthFlow = {\n\tauthorizationUrl?: string;\n\ttokenUrl?: string;\n\trefreshUrl?: string;\n\tscopes: string[];\n};\n\nexport type OAuthFlows = Partial<\n\tRecord<\n\t\t\"implicit\" | \"password\" | \"clientCredentials\" | \"authorizationCode\",\n\t\tOAuthFlow\n\t>\n>;\n\ntype RawOAuthFlow = {\n\tauthorizationUrl?: unknown;\n\ttokenUrl?: unknown;\n\trefreshUrl?: unknown;\n\tscopes?: unknown;\n};\n\ntype RawOAuthFlows = {\n\timplicit?: RawOAuthFlow;\n\tpassword?: RawOAuthFlow;\n\tclientCredentials?: RawOAuthFlow;\n\tauthorizationCode?: RawOAuthFlow;\n};\n\ntype RawSecurityScheme = {\n\ttype?: string;\n\tdescription?: string;\n\tname?: string;\n\tin?: string;\n\tscheme?: string;\n\tbearerFormat?: string;\n\tflows?: RawOAuthFlows;\n\topenIdConnectUrl?: string;\n};\n\nfunction parseOAuthFlow(flow: RawOAuthFlow | undefined): OAuthFlow | undefined {\n\tif (!flow) return undefined;\n\tconst scopesObj = flow.scopes;\n\tconst scopes =\n\t\tscopesObj && typeof scopesObj === \"object\" && !Array.isArray(scopesObj)\n\t\t\t? Object.keys(scopesObj as Record<string, unknown>)\n\t\t\t: [];\n\n\treturn {\n\t\tauthorizationUrl:\n\t\t\ttypeof flow.authorizationUrl === \"string\"\n\t\t\t\t? flow.authorizationUrl\n\t\t\t\t: undefined,\n\t\ttokenUrl: typeof flow.tokenUrl === \"string\" ? flow.tokenUrl : undefined,\n\t\trefreshUrl:\n\t\t\ttypeof flow.refreshUrl === \"string\" ? flow.refreshUrl : undefined,\n\t\tscopes: scopes.sort(),\n\t};\n}\n\nfunction parseOAuthFlows(\n\tflows: RawOAuthFlows | undefined,\n): OAuthFlows | undefined {\n\tif (!flows) return undefined;\n\tconst out: OAuthFlows = {};\n\n\tconst implicit = parseOAuthFlow(flows.implicit);\n\tif (implicit) out.implicit = implicit;\n\n\tconst password = parseOAuthFlow(flows.password);\n\tif (password) out.password = password;\n\n\tconst clientCredentials = parseOAuthFlow(flows.clientCredentials);\n\tif (clientCredentials) out.clientCredentials = clientCredentials;\n\n\tconst authorizationCode = parseOAuthFlow(flows.authorizationCode);\n\tif (authorizationCode) out.authorizationCode = authorizationCode;\n\n\treturn Object.keys(out).length ? out : undefined;\n}\n\nexport function listAuthSchemes(doc: OpenApiDoc): AuthScheme[] {\n\tconst schemes = doc.components?.securitySchemes;\n\tif (!schemes || typeof schemes !== \"object\") return [];\n\n\tconst out: AuthScheme[] = [];\n\n\tfor (const [key, raw] of Object.entries(schemes)) {\n\t\tif (!raw || typeof raw !== \"object\") continue;\n\t\tconst s = raw as RawSecurityScheme;\n\n\t\tconst type = s.type;\n\t\tif (type === \"http\") {\n\t\t\tconst scheme = (s.scheme ?? \"\").toLowerCase();\n\t\t\tif (scheme === \"bearer\") {\n\t\t\t\tout.push({\n\t\t\t\t\tkey,\n\t\t\t\t\tkind: \"http-bearer\",\n\t\t\t\t\tscheme: scheme,\n\t\t\t\t\tbearerFormat: s.bearerFormat,\n\t\t\t\t\tdescription: s.description,\n\t\t\t\t});\n\t\t\t} else if (scheme === \"basic\") {\n\t\t\t\tout.push({\n\t\t\t\t\tkey,\n\t\t\t\t\tkind: \"http-basic\",\n\t\t\t\t\tscheme: scheme,\n\t\t\t\t\tdescription: s.description,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tout.push({\n\t\t\t\t\tkey,\n\t\t\t\t\tkind: \"unknown\",\n\t\t\t\t\tscheme: s.scheme,\n\t\t\t\t\tdescription: s.description,\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (type === \"apiKey\") {\n\t\t\tconst where = s.in;\n\t\t\tconst loc =\n\t\t\t\twhere === \"header\" || where === \"query\" || where === \"cookie\"\n\t\t\t\t\t? where\n\t\t\t\t\t: undefined;\n\t\t\tout.push({\n\t\t\t\tkey,\n\t\t\t\tkind: \"api-key\",\n\t\t\t\tname: s.name,\n\t\t\t\tin: loc,\n\t\t\t\tdescription: s.description,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (type === \"oauth2\") {\n\t\t\tout.push({\n\t\t\t\tkey,\n\t\t\t\tkind: \"oauth2\",\n\t\t\t\tdescription: s.description,\n\t\t\t\toauthFlows: parseOAuthFlows(s.flows),\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (type === \"openIdConnect\") {\n\t\t\tout.push({\n\t\t\t\tkey,\n\t\t\t\tkind: \"openIdConnect\",\n\t\t\t\tdescription: s.description,\n\t\t\t\topenIdConnectUrl: s.openIdConnectUrl,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tout.push({ key, kind: \"unknown\", description: s.description });\n\t}\n\n\t// Stable order.\n\tout.sort((a, b) => kebabCase(a.key).localeCompare(kebabCase(b.key)));\n\treturn out;\n}\n",
7
+ "import type { AuthScheme, AuthSchemeKind } from \"./auth-schemes.ts\";\nimport type { CommandModel } from \"./command-model.ts\";\nimport type { ServerInfo } from \"./server.ts\";\nimport type {\n\tNormalizedOperation,\n\tOpenApiDoc,\n\tSecurityRequirement,\n} from \"./types.ts\";\n\nexport type Capabilities = {\n\tservers: {\n\t\tcount: number;\n\t\thasVariables: boolean;\n\t};\n\tauth: {\n\t\tcount: number;\n\t\tkinds: AuthSchemeKind[];\n\t\thasSecurityRequirements: boolean;\n\t};\n\toperations: {\n\t\tcount: number;\n\t\thasRequestBodies: boolean;\n\t};\n\tcommands: {\n\t\tcountResources: number;\n\t\tcountActions: number;\n\t\thasRequestBodies: boolean;\n\t};\n};\n\nfunction uniqueSorted<T>(items: T[], compare: (a: T, b: T) => number): T[] {\n\tconst out = [...items];\n\tout.sort(compare);\n\treturn out.filter((v, i) => i === 0 || compare(out[i - 1] as T, v) !== 0);\n}\n\nfunction hasSecurity(requirements: SecurityRequirement[] | undefined): boolean {\n\tif (!requirements?.length) return false;\n\n\t// Treat any non-empty array as \"auth exists\", even if it contains `{}` to mean optional.\n\treturn true;\n}\n\nexport function deriveCapabilities(input: {\n\tdoc: OpenApiDoc;\n\tservers: ServerInfo[];\n\tauthSchemes: AuthScheme[];\n\toperations: NormalizedOperation[];\n\tcommands?: CommandModel;\n}): Capabilities {\n\tconst serverHasVars = input.servers.some((s) => s.variableNames.length > 0);\n\n\tconst authKinds = uniqueSorted(\n\t\tinput.authSchemes.map((s) => s.kind),\n\t\t(a, b) => a.localeCompare(b),\n\t);\n\n\tconst hasSecurityRequirements =\n\t\thasSecurity(input.doc.security) ||\n\t\tinput.operations.some((op) => hasSecurity(op.security));\n\n\tconst opHasBodies = input.operations.some((op) => Boolean(op.requestBody));\n\n\tconst cmdResources = input.commands?.resources ?? [];\n\tconst cmdActions = cmdResources.flatMap((r) => r.actions);\n\tconst cmdHasBodies = cmdActions.some((a) => Boolean(a.requestBody));\n\n\treturn {\n\t\tservers: {\n\t\t\tcount: input.servers.length,\n\t\t\thasVariables: serverHasVars,\n\t\t},\n\t\tauth: {\n\t\t\tcount: input.authSchemes.length,\n\t\t\tkinds: authKinds,\n\t\t\thasSecurityRequirements,\n\t\t},\n\t\toperations: {\n\t\t\tcount: input.operations.length,\n\t\t\thasRequestBodies: opHasBodies,\n\t\t},\n\t\tcommands: {\n\t\t\tcountResources: cmdResources.length,\n\t\t\tcountActions: cmdActions.length,\n\t\t\thasRequestBodies: cmdHasBodies,\n\t\t},\n\t};\n}\n",
8
+ "import type { CommandAction, CommandModel } from \"./command-model.ts\";\n\nexport type CommandsIndex = {\n\tbyId: Record<string, CommandAction>;\n};\n\nexport function buildCommandsIndex(\n\tcommands: CommandModel | undefined,\n): CommandsIndex {\n\tconst byId: Record<string, CommandAction> = {};\n\n\tfor (const resource of commands?.resources ?? []) {\n\t\tfor (const action of resource.actions) {\n\t\t\tbyId[action.id] = action;\n\t\t}\n\t}\n\n\treturn { byId };\n}\n",
9
+ "import type { AuthScheme } from \"./auth-schemes.ts\";\nimport type { SecurityRequirement } from \"./types.ts\";\n\nexport type AuthRequirement = {\n\tkey: string;\n\tscopes: string[];\n};\n\nexport type AuthSummary = {\n\t// Alternatives: any one of these sets is sufficient.\n\talternatives: AuthRequirement[][];\n};\n\nfunction isSecurityRequirement(value: unknown): value is SecurityRequirement {\n\tif (!value || typeof value !== \"object\") return false;\n\tif (Array.isArray(value)) return false;\n\n\tfor (const [k, v] of Object.entries(value)) {\n\t\tif (typeof k !== \"string\") return false;\n\t\tif (!Array.isArray(v)) return false;\n\t\tif (!v.every((s) => typeof s === \"string\")) return false;\n\t}\n\n\treturn true;\n}\n\nfunction normalizeSecurity(value: unknown): {\n\trequirements: SecurityRequirement[];\n\tsource: \"none\" | \"empty\" | \"non-empty\";\n} {\n\tif (value == null) return { requirements: [], source: \"none\" };\n\tif (!Array.isArray(value)) return { requirements: [], source: \"none\" };\n\n\tconst reqs = value.filter(isSecurityRequirement);\n\tif (reqs.length === 0) return { requirements: [], source: \"empty\" };\n\treturn { requirements: reqs, source: \"non-empty\" };\n}\n\nexport function summarizeAuth(\n\toperationSecurity: unknown,\n\tglobalSecurity: unknown,\n\tknownSchemes: AuthScheme[],\n): AuthSummary {\n\t// Per spec:\n\t// - operation security overrides root\n\t// - empty array [] means \"no auth\"\n\tconst op = normalizeSecurity(operationSecurity);\n\tif (op.source === \"non-empty\") {\n\t\treturn { alternatives: toAlternatives(op.requirements, knownSchemes) };\n\t}\n\tif (op.source === \"empty\") {\n\t\treturn { alternatives: [] };\n\t}\n\n\tconst global = normalizeSecurity(globalSecurity);\n\tif (global.source === \"non-empty\") {\n\t\treturn { alternatives: toAlternatives(global.requirements, knownSchemes) };\n\t}\n\n\treturn { alternatives: [] };\n}\n\nfunction toAlternatives(\n\trequirements: SecurityRequirement[],\n\tknownSchemes: AuthScheme[],\n): AuthRequirement[][] {\n\tconst known = new Set(knownSchemes.map((s) => s.key));\n\n\treturn requirements.map((req) => {\n\t\tconst out: AuthRequirement[] = [];\n\t\tfor (const [key, scopes] of Object.entries(req)) {\n\t\t\tout.push({\n\t\t\t\tkey,\n\t\t\t\tscopes: Array.isArray(scopes) ? scopes : [],\n\t\t\t});\n\t\t}\n\n\t\t// Stable order.\n\t\tout.sort((a, b) => a.key.localeCompare(b.key));\n\n\t\t// Prefer known schemes first.\n\t\tout.sort((a, b) => {\n\t\t\tconst ak = known.has(a.key) ? 0 : 1;\n\t\t\tconst bk = known.has(b.key) ? 0 : 1;\n\t\t\tif (ak !== bk) return ak - bk;\n\t\t\treturn a.key.localeCompare(b.key);\n\t\t});\n\n\t\treturn out;\n\t});\n}\n",
10
+ "import { kebabCase } from \"./strings.ts\";\n\nexport type CommandIdParts = {\n\tspecId: string;\n\tresource: string;\n\taction: string;\n\toperationKey: string;\n};\n\nexport function buildCommandId(parts: CommandIdParts): string {\n\t// operationKey is the ultimate disambiguator, but we keep the id readable.\n\t// Example:\n\t// contacts-api:contacts:get:GET-/contacts/{id}\n\tconst op = kebabCase(parts.operationKey.replace(/\\s+/g, \"-\"));\n\treturn `${parts.specId}:${kebabCase(parts.resource)}:${kebabCase(parts.action)}:${op}`;\n}\n",
11
+ "export type ParamType =\n\t| \"string\"\n\t| \"number\"\n\t| \"integer\"\n\t| \"boolean\"\n\t| \"array\"\n\t| \"object\"\n\t| \"unknown\";\n\nexport function getSchemaType(schema: unknown): ParamType {\n\tif (!schema || typeof schema !== \"object\") return \"unknown\";\n\tconst t = (schema as { type?: unknown }).type;\n\tif (t === \"string\") return \"string\";\n\tif (t === \"number\") return \"number\";\n\tif (t === \"integer\") return \"integer\";\n\tif (t === \"boolean\") return \"boolean\";\n\tif (t === \"array\") return \"array\";\n\tif (t === \"object\") return \"object\";\n\treturn \"unknown\";\n}\n\nexport function getSchemaFormat(schema: unknown): string | undefined {\n\tif (!schema || typeof schema !== \"object\") return undefined;\n\tconst f = (schema as { format?: unknown }).format;\n\treturn typeof f === \"string\" ? f : undefined;\n}\n\nexport function getSchemaEnumStrings(schema: unknown): string[] | undefined {\n\tif (!schema || typeof schema !== \"object\") return undefined;\n\tconst e = (schema as { enum?: unknown }).enum;\n\tif (!Array.isArray(e)) return undefined;\n\n\t// We only surface string enums for now (enough for flag docs + completion).\n\tconst values = e.filter((v) => typeof v === \"string\") as string[];\n\treturn values.length ? values : undefined;\n}\n",
12
+ "import {\n\tgetSchemaEnumStrings,\n\tgetSchemaFormat,\n\tgetSchemaType,\n} from \"./schema-shape.ts\";\nimport { kebabCase } from \"./strings.ts\";\nimport type { NormalizedOperation, NormalizedParameter } from \"./types.ts\";\n\nexport type ParamType = import(\"./schema-shape.ts\").ParamType;\n\nexport type ParamSpec = {\n\tkind: \"positional\" | \"flag\";\n\tin: NormalizedParameter[\"in\"];\n\tname: string;\n\tflag: string;\n\trequired: boolean;\n\tdescription?: string;\n\ttype: ParamType;\n\tformat?: string;\n\tenum?: string[];\n\n\t// Arrays\n\titemType?: ParamType;\n\titemFormat?: string;\n\titemEnum?: string[];\n\n\t// Original schema for Ajv validation and future advanced flag expansion.\n\tschema?: import(\"./types.ts\").JsonSchema;\n};\n\nexport function deriveParamSpecs(op: NormalizedOperation): ParamSpec[] {\n\tconst out: ParamSpec[] = [];\n\n\tfor (const p of op.parameters) {\n\t\tconst flag = `--${kebabCase(p.name)}`;\n\t\tconst type = getSchemaType(p.schema);\n\t\tconst schemaObj =\n\t\t\tp.schema && typeof p.schema === \"object\"\n\t\t\t\t? (p.schema as import(\"./types.ts\").JsonSchema)\n\t\t\t\t: undefined;\n\n\t\tconst itemsSchema =\n\t\t\tschemaObj && type === \"array\" && typeof schemaObj.items === \"object\"\n\t\t\t\t? (schemaObj.items as unknown)\n\t\t\t\t: undefined;\n\n\t\tout.push({\n\t\t\tkind: p.in === \"path\" ? \"positional\" : \"flag\",\n\t\t\tin: p.in,\n\t\t\tname: p.name,\n\t\t\tflag,\n\t\t\trequired: p.required,\n\t\t\tdescription: p.description,\n\t\t\ttype,\n\t\t\tformat: getSchemaFormat(p.schema),\n\t\t\tenum: getSchemaEnumStrings(p.schema),\n\t\t\titemType: type === \"array\" ? getSchemaType(itemsSchema) : undefined,\n\t\t\titemFormat: type === \"array\" ? getSchemaFormat(itemsSchema) : undefined,\n\t\t\titemEnum:\n\t\t\t\ttype === \"array\" ? getSchemaEnumStrings(itemsSchema) : undefined,\n\t\t\tschema: schemaObj,\n\t\t});\n\t}\n\n\tout.sort((a, b) => {\n\t\tif (a.in !== b.in) return a.in.localeCompare(b.in);\n\t\treturn a.name.localeCompare(b.name);\n\t});\n\n\treturn out;\n}\n",
13
+ "import type { ParamSpec } from \"./params.ts\";\n\nexport type ActionShapeForCli = {\n\tpathArgs: string[];\n\tparams: ParamSpec[];\n};\n\nexport type PositionalArg = {\n\tname: string;\n\trequired: boolean;\n\tdescription?: string;\n\ttype: import(\"./schema-shape.ts\").ParamType;\n\tformat?: string;\n\tenum?: string[];\n};\n\nexport type FlagsIndex = {\n\tflags: Array<\n\t\tPick<\n\t\t\timport(\"./params.ts\").ParamSpec,\n\t\t\t| \"in\"\n\t\t\t| \"name\"\n\t\t\t| \"flag\"\n\t\t\t| \"required\"\n\t\t\t| \"description\"\n\t\t\t| \"type\"\n\t\t\t| \"format\"\n\t\t\t| \"enum\"\n\t\t\t| \"itemType\"\n\t\t\t| \"itemFormat\"\n\t\t\t| \"itemEnum\"\n\t\t>\n\t>;\n};\n\nexport function derivePositionals(action: ActionShapeForCli): PositionalArg[] {\n\tconst byName = new Map<string, PositionalArg>();\n\n\t// Use pathArgs order; match metadata from params when available.\n\tfor (const name of action.pathArgs) {\n\t\tconst p = action.params.find(\n\t\t\t(x: ParamSpec) => x.in === \"path\" && x.name === name,\n\t\t);\n\t\tbyName.set(name, {\n\t\t\tname,\n\t\t\trequired: true,\n\t\t\tdescription: p?.description,\n\t\t\ttype: p?.type ?? \"unknown\",\n\t\t\tformat: p?.format,\n\t\t\tenum: p?.enum,\n\t\t});\n\t}\n\n\treturn [...byName.values()];\n}\n\nexport function deriveFlags(action: ActionShapeForCli): FlagsIndex {\n\treturn {\n\t\tflags: action.params\n\t\t\t.filter((p: ParamSpec) => p.kind === \"flag\")\n\t\t\t.map((p: ParamSpec) => ({\n\t\t\t\tin: p.in,\n\t\t\t\tname: p.name,\n\t\t\t\tflag: p.flag,\n\t\t\t\trequired: p.required,\n\t\t\t\tdescription: p.description,\n\t\t\t\ttype: p.type,\n\t\t\t\tformat: p.format,\n\t\t\t\tenum: p.enum,\n\t\t\t\titemType: p.itemType,\n\t\t\t\titemFormat: p.itemFormat,\n\t\t\t\titemEnum: p.itemEnum,\n\t\t\t})),\n\t};\n}\n",
14
+ "export type SpecSource = \"embedded\" | \"file\" | \"url\";\n\nexport type SecurityRequirement = Record<string, string[]>;\n\nexport type OpenApiDoc = {\n\topenapi: string;\n\tinfo?: {\n\t\ttitle?: string;\n\t\tversion?: string;\n\t};\n\tservers?: Array<{ url: string; description?: string; variables?: unknown }>;\n\tsecurity?: SecurityRequirement[];\n\tcomponents?: {\n\t\tsecuritySchemes?: Record<string, unknown>;\n\t};\n\tpaths?: Record<string, unknown>;\n};\n\nexport type NormalizedParameter = {\n\tin: \"path\" | \"query\" | \"header\" | \"cookie\";\n\tname: string;\n\trequired: boolean;\n\tdescription?: string;\n\tschema?: unknown;\n};\n\n// Minimal JSON Schema-like shape for validation and flag expansion.\nexport type JsonSchema = Record<string, unknown>;\n\nexport function isJsonSchema(value: unknown): value is JsonSchema {\n\treturn Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nexport type NormalizedRequestBody = {\n\trequired: boolean;\n\tcontentTypes: string[];\n\tschemasByContentType: Record<string, unknown | undefined>;\n};\n\nexport type NormalizedOperation = {\n\tkey: string;\n\tmethod: string;\n\tpath: string;\n\toperationId?: string;\n\ttags: string[];\n\tsummary?: string;\n\tdescription?: string;\n\tdeprecated?: boolean;\n\tsecurity?: SecurityRequirement[];\n\tparameters: NormalizedParameter[];\n\trequestBody?: NormalizedRequestBody;\n};\n\nexport type LoadedSpec = {\n\tsource: SpecSource;\n\tid: string;\n\tfingerprint: string;\n\tdoc: OpenApiDoc;\n};\n",
15
+ "import {\n\tgetSchemaEnumStrings,\n\tgetSchemaFormat,\n\tgetSchemaType,\n} from \"./schema-shape.ts\";\nimport type {\n\tJsonSchema,\n\tNormalizedOperation,\n\tNormalizedRequestBody,\n} from \"./types.ts\";\nimport { isJsonSchema } from \"./types.ts\";\n\nexport type RequestBodyContent = {\n\tcontentType: string;\n\trequired: boolean;\n\tschemaType: import(\"./schema-shape.ts\").ParamType;\n\tschemaFormat?: string;\n\tschemaEnum?: string[];\n};\n\nexport type RequestBodyInfo = {\n\trequired: boolean;\n\tcontent: RequestBodyContent[];\n\t// Convenience flags for later arg generation.\n\thasJson: boolean;\n\thasFormUrlEncoded: boolean;\n\thasMultipart: boolean;\n\n\t// Phase 1 planning: supported generic body inputs.\n\tbodyFlags: string[];\n\tpreferredContentType?: string;\n\n\t// Original JSON Schema (for expanded flags + validation)\n\tpreferredSchema?: JsonSchema;\n};\n\nfunction getRequestBody(\n\top: NormalizedOperation,\n): NormalizedRequestBody | undefined {\n\treturn op.requestBody;\n}\n\nexport function deriveRequestBodyInfo(\n\top: NormalizedOperation,\n): RequestBodyInfo | undefined {\n\tconst rb = getRequestBody(op);\n\tif (!rb) return undefined;\n\n\tconst content: RequestBodyContent[] = [];\n\tfor (const contentType of rb.contentTypes) {\n\t\tconst schema = rb.schemasByContentType[contentType];\n\t\tcontent.push({\n\t\t\tcontentType,\n\t\t\trequired: rb.required,\n\t\t\tschemaType: getSchemaType(schema),\n\t\t\tschemaFormat: getSchemaFormat(schema),\n\t\t\tschemaEnum: getSchemaEnumStrings(schema),\n\t\t});\n\t}\n\n\tcontent.sort((a, b) => a.contentType.localeCompare(b.contentType));\n\n\tconst hasJson = content.some((c) => c.contentType.includes(\"json\"));\n\tconst hasFormUrlEncoded = content.some(\n\t\t(c) => c.contentType === \"application/x-www-form-urlencoded\",\n\t);\n\tconst hasMultipart = content.some((c) =>\n\t\tc.contentType.startsWith(\"multipart/\"),\n\t);\n\n\tconst bodyFlags = [\"--data\", \"--file\"]; // always available when requestBody exists\n\n\tconst preferredContentType =\n\t\tcontent.find((c) => c.contentType === \"application/json\")?.contentType ??\n\t\tcontent.find((c) => c.contentType.includes(\"json\"))?.contentType ??\n\t\tcontent[0]?.contentType;\n\n\tconst preferredSchema = preferredContentType\n\t\t? rb.schemasByContentType[preferredContentType]\n\t\t: undefined;\n\n\treturn {\n\t\trequired: rb.required,\n\t\tcontent,\n\t\thasJson,\n\t\thasFormUrlEncoded,\n\t\thasMultipart,\n\t\tbodyFlags,\n\t\tpreferredContentType,\n\t\tpreferredSchema: isJsonSchema(preferredSchema)\n\t\t\t? preferredSchema\n\t\t\t: undefined,\n\t};\n}\n",
16
+ "import type { AuthSummary } from \"./auth-requirements.ts\";\nimport { summarizeAuth } from \"./auth-requirements.ts\";\nimport type { AuthScheme } from \"./auth-schemes.ts\";\nimport { buildCommandId } from \"./command-id.ts\";\nimport type { PlannedOperation } from \"./naming.ts\";\nimport type { ParamSpec } from \"./params.ts\";\nimport { deriveParamSpecs } from \"./params.ts\";\nimport { deriveFlags, derivePositionals } from \"./positional.ts\";\nimport type { RequestBodyInfo } from \"./request-body.ts\";\nimport { deriveRequestBodyInfo } from \"./request-body.ts\";\nimport type { SecurityRequirement } from \"./types.ts\";\n\nexport type CommandAction = {\n\tid: string;\n\tkey: string;\n\taction: string;\n\t// Derived path arguments. These become positionals later.\n\tpathArgs: string[];\n\tmethod: string;\n\tpath: string;\n\toperationId?: string;\n\ttags: string[];\n\tsummary?: string;\n\tdescription?: string;\n\tdeprecated?: boolean;\n\tstyle: PlannedOperation[\"style\"];\n\n\t// Derived CLI shape (Phase 1 output; Phase 2 will wire these into commander)\n\tpositionals: Array<import(\"./positional.ts\").PositionalArg>;\n\tflags: Array<\n\t\tPick<\n\t\t\timport(\"./params.ts\").ParamSpec,\n\t\t\t| \"in\"\n\t\t\t| \"name\"\n\t\t\t| \"flag\"\n\t\t\t| \"required\"\n\t\t\t| \"description\"\n\t\t\t| \"type\"\n\t\t\t| \"format\"\n\t\t\t| \"enum\"\n\t\t\t| \"itemType\"\n\t\t\t| \"itemFormat\"\n\t\t\t| \"itemEnum\"\n\t\t>\n\t>;\n\n\t// Full raw params list (useful for debugging and future features)\n\tparams: ParamSpec[];\n\n\tauth: AuthSummary;\n\trequestBody?: RequestBodyInfo;\n\trequestBodySchema?: import(\"./types.ts\").JsonSchema;\n};\n\nexport type CommandResource = {\n\tresource: string;\n\tactions: CommandAction[];\n};\n\nexport type CommandModel = {\n\tresources: CommandResource[];\n};\n\nexport type BuildCommandModelOptions = {\n\tspecId: string;\n\tglobalSecurity?: SecurityRequirement[];\n\tauthSchemes?: AuthScheme[];\n};\n\nexport function buildCommandModel(\n\tplanned: PlannedOperation[],\n\toptions: BuildCommandModelOptions,\n): CommandModel {\n\tconst byResource = new Map<string, CommandAction[]>();\n\n\tfor (const op of planned) {\n\t\tconst list = byResource.get(op.resource) ?? [];\n\t\tconst params = deriveParamSpecs(op);\n\t\tconst positionals = derivePositionals({ pathArgs: op.pathArgs, params });\n\t\tconst flags = deriveFlags({ pathArgs: op.pathArgs, params });\n\n\t\tlist.push({\n\t\t\tid: buildCommandId({\n\t\t\t\tspecId: options.specId,\n\t\t\t\tresource: op.resource,\n\t\t\t\taction: op.action,\n\t\t\t\toperationKey: op.key,\n\t\t\t}),\n\t\t\tkey: op.key,\n\t\t\taction: op.action,\n\t\t\tpathArgs: op.pathArgs,\n\t\t\tmethod: op.method,\n\t\t\tpath: op.path,\n\t\t\toperationId: op.operationId,\n\t\t\ttags: op.tags,\n\t\t\tsummary: op.summary,\n\t\t\tdescription: op.description,\n\t\t\tdeprecated: op.deprecated,\n\t\t\tstyle: op.style,\n\t\t\tparams,\n\t\t\tpositionals,\n\t\t\tflags: flags.flags,\n\t\t\tauth: summarizeAuth(\n\t\t\t\top.security,\n\t\t\t\toptions.globalSecurity,\n\t\t\t\toptions.authSchemes ?? [],\n\t\t\t),\n\t\t\trequestBody: deriveRequestBodyInfo(op),\n\t\t\trequestBodySchema: deriveRequestBodyInfo(op)?.preferredSchema,\n\t\t});\n\t\tbyResource.set(op.resource, list);\n\t}\n\n\tconst resources: CommandResource[] = [];\n\n\tfor (const [resource, actions] of byResource.entries()) {\n\t\tactions.sort((a, b) => {\n\t\t\tif (a.action !== b.action) return a.action.localeCompare(b.action);\n\t\t\tif (a.path !== b.path) return a.path.localeCompare(b.path);\n\t\t\treturn a.method.localeCompare(b.method);\n\t\t});\n\t\tresources.push({ resource, actions });\n\t}\n\n\tresources.sort((a, b) => a.resource.localeCompare(b.resource));\n\n\treturn { resources };\n}\n",
17
+ "const IRREGULAR: Record<string, string> = {\n\tperson: \"people\",\n\tman: \"men\",\n\twoman: \"women\",\n\tchild: \"children\",\n\ttooth: \"teeth\",\n\tfoot: \"feet\",\n\tmouse: \"mice\",\n\tgoose: \"geese\",\n};\n\nconst UNCOUNTABLE = new Set([\n\t\"metadata\",\n\t\"information\",\n\t\"equipment\",\n\t\"money\",\n\t\"series\",\n\t\"species\",\n]);\n\nexport function pluralize(word: string): string {\n\tconst w = word.trim();\n\tif (!w) return w;\n\n\tconst lower = w.toLowerCase();\n\tif (UNCOUNTABLE.has(lower)) return lower;\n\tif (IRREGULAR[lower]) return IRREGULAR[lower];\n\n\t// already plural-ish\n\tif (lower.endsWith(\"s\")) return lower;\n\n\tif (/[bcdfghjklmnpqrstvwxyz]y$/.test(lower)) {\n\t\treturn lower.replace(/y$/, \"ies\");\n\t}\n\n\tif (/(ch|sh|x|z)$/.test(lower)) {\n\t\treturn `${lower}es`;\n\t}\n\n\treturn `${lower}s`;\n}\n",
18
+ "import { pluralize } from \"./pluralize.ts\";\nimport { kebabCase } from \"./strings.ts\";\nimport type { NormalizedOperation } from \"./types.ts\";\n\nexport type PlannedOperation = NormalizedOperation & {\n\tresource: string;\n\taction: string;\n\tpathArgs: string[];\n\tstyle: \"rest\" | \"rpc\";\n\tcanonicalAction: string;\n\taliasOf?: string;\n};\n\nconst GENERIC_TAGS = new Set([\"default\", \"defaults\", \"api\"]);\n\nfunction getPathSegments(path: string): string[] {\n\treturn path\n\t\t.split(\"/\")\n\t\t.map((s) => s.trim())\n\t\t.filter(Boolean);\n}\n\nfunction getPathArgs(path: string): string[] {\n\tconst args: string[] = [];\n\tconst re = /\\{([^}]+)\\}/g;\n\n\twhile (true) {\n\t\tconst match = re.exec(path);\n\t\tif (!match) break;\n\t\t// biome-ignore lint/style/noNonNullAssertion: unknown\n\t\targs.push(match[1]!);\n\t}\n\n\treturn args;\n}\n\nfunction pickResourceFromTags(tags: string[]): string | undefined {\n\tif (!tags.length) return undefined;\n\tconst first = tags[0]?.trim();\n\tif (!first) return undefined;\n\tif (GENERIC_TAGS.has(first.toLowerCase())) return undefined;\n\treturn first;\n}\n\nfunction splitOperationId(operationId: string): {\n\tprefix?: string;\n\tsuffix?: string;\n} {\n\tconst trimmed = operationId.trim();\n\tif (!trimmed) return {};\n\n\t// Prefer dot-notation when present: Contacts.List\n\tif (trimmed.includes(\".\")) {\n\t\tconst [prefix, ...rest] = trimmed.split(\".\");\n\t\treturn { prefix, suffix: rest.join(\".\") };\n\t}\n\n\t// Try separators: Contacts_List, Contacts__List\n\tif (trimmed.includes(\"__\")) {\n\t\tconst [prefix, ...rest] = trimmed.split(\"__\");\n\t\treturn { prefix, suffix: rest.join(\"__\") };\n\t}\n\n\tif (trimmed.includes(\"_\")) {\n\t\tconst [prefix, ...rest] = trimmed.split(\"_\");\n\t\treturn { prefix, suffix: rest.join(\"_\") };\n\t}\n\n\treturn { suffix: trimmed };\n}\n\nfunction inferStyle(op: NormalizedOperation): \"rest\" | \"rpc\" {\n\t// Path-based RPC convention (common in gRPC-ish HTTP gateways)\n\t// - POST /Contacts.List\n\t// - POST /Contacts/Service.List\n\tif (op.path.includes(\".\")) return \"rpc\";\n\n\t// operationId dot-notation alone is not enough to call it RPC; many REST APIs\n\t// have dotted ids. We treat dotted operationId as a weak signal.\n\tif (op.operationId?.includes(\".\") && op.method === \"POST\") return \"rpc\";\n\n\treturn \"rest\";\n}\n\nfunction inferResource(op: NormalizedOperation): string {\n\tconst tag = pickResourceFromTags(op.tags);\n\tif (tag) return pluralize(kebabCase(tag));\n\n\tif (op.operationId) {\n\t\tconst { prefix } = splitOperationId(op.operationId);\n\t\tif (prefix) {\n\t\t\tconst fromId = kebabCase(prefix);\n\t\t\tif (fromId === \"ping\") return \"ping\";\n\t\t\treturn pluralize(fromId);\n\t\t}\n\t}\n\n\tconst segments = getPathSegments(op.path);\n\tlet first = segments[0] ?? \"api\";\n\n\t// If first segment is rpc-ish, like Contacts.List, split it.\n\t// biome-ignore lint/style/noNonNullAssertion: split always returns at least one element\n\tfirst = first.includes(\".\") ? first.split(\".\")[0]! : first;\n\n\t// Singletons like /ping generally shouldn't become `pings`.\n\tif (first.toLowerCase() === \"ping\") return \"ping\";\n\n\t// Strip path params if they appear in first segment (rare)\n\tconst cleaned = first.replace(/^\\{.+\\}$/, \"\");\n\treturn pluralize(kebabCase(cleaned || \"api\"));\n}\n\nfunction canonicalizeAction(action: string): string {\n\tconst a = kebabCase(action);\n\n\t// Common RPC verbs -> REST canonical verbs\n\tif (a === \"retrieve\" || a === \"read\") return \"get\";\n\tif (a === \"list\" || a === \"search\") return \"list\";\n\tif (a === \"create\") return \"create\";\n\tif (a === \"update\" || a === \"patch\") return \"update\";\n\tif (a === \"delete\" || a === \"remove\") return \"delete\";\n\n\treturn a;\n}\n\nfunction inferRestAction(op: NormalizedOperation): string {\n\t// If operationId is present and looks intentional, prefer it.\n\t// This helps with singleton endpoints like GET /ping (Ping.Get) vs collections.\n\tif (op.operationId) {\n\t\tconst { suffix } = splitOperationId(op.operationId);\n\t\tif (suffix) {\n\t\t\tconst fromId = canonicalizeAction(suffix);\n\t\t\tif (\n\t\t\t\tfromId === \"get\" ||\n\t\t\t\tfromId === \"list\" ||\n\t\t\t\tfromId === \"create\" ||\n\t\t\t\tfromId === \"update\" ||\n\t\t\t\tfromId === \"delete\"\n\t\t\t) {\n\t\t\t\treturn fromId;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst method = op.method.toUpperCase();\n\tconst args = getPathArgs(op.path);\n\tconst hasId = args.length > 0;\n\n\tif (method === \"GET\" && !hasId) return \"list\";\n\tif (method === \"POST\" && !hasId) return \"create\";\n\n\tif (method === \"GET\" && hasId) return \"get\";\n\tif ((method === \"PUT\" || method === \"PATCH\") && hasId) return \"update\";\n\tif (method === \"DELETE\" && hasId) return \"delete\";\n\n\treturn kebabCase(method);\n}\n\nfunction inferRpcAction(op: NormalizedOperation): string {\n\t// Prefer operationId suffix: Contacts.List -> list\n\tif (op.operationId) {\n\t\tconst { suffix } = splitOperationId(op.operationId);\n\t\tif (suffix) return canonicalizeAction(suffix);\n\t}\n\n\t// Else take last segment and split by '.'\n\tconst segments = getPathSegments(op.path);\n\tconst last = segments[segments.length - 1] ?? \"\";\n\tif (last.includes(\".\")) {\n\t\tconst part = last.split(\".\").pop() ?? last;\n\t\treturn canonicalizeAction(part);\n\t}\n\n\treturn kebabCase(op.method);\n}\n\nexport function planOperation(op: NormalizedOperation): PlannedOperation {\n\tconst style = inferStyle(op);\n\tconst resource = inferResource(op);\n\tconst action = style === \"rpc\" ? inferRpcAction(op) : inferRestAction(op);\n\n\treturn {\n\t\t...op,\n\t\tkey: op.key,\n\t\tstyle,\n\t\tresource,\n\t\taction,\n\t\tcanonicalAction: action,\n\t\tpathArgs: getPathArgs(op.path).map((a) => kebabCase(a)),\n\t};\n}\n\nexport function planOperations(ops: NormalizedOperation[]): PlannedOperation[] {\n\tconst planned = ops.map(planOperation);\n\n\t// Stable collision handling: if resource+action repeats, add a suffix.\n\tconst counts = new Map<string, number>();\n\tfor (const op of planned) {\n\t\tconst key = `${op.resource}:${op.action}`;\n\t\tcounts.set(key, (counts.get(key) ?? 0) + 1);\n\t}\n\n\tconst seen = new Map<string, number>();\n\treturn planned.map((op) => {\n\t\tconst key = `${op.resource}:${op.action}`;\n\t\tconst total = counts.get(key) ?? 0;\n\t\tif (total <= 1) return op;\n\n\t\tconst idx = (seen.get(key) ?? 0) + 1;\n\t\tseen.set(key, idx);\n\n\t\tconst suffix = op.operationId\n\t\t\t? kebabCase(op.operationId)\n\t\t\t: kebabCase(`${op.method}-${op.path}`);\n\n\t\tconst disambiguatedAction = `${op.action}-${suffix}-${idx}`;\n\n\t\treturn {\n\t\t\t...op,\n\t\t\taction: disambiguatedAction,\n\t\t\taliasOf: `${op.resource} ${op.canonicalAction}`,\n\t\t};\n\t});\n}\n",
19
+ "import type {\n\tNormalizedOperation,\n\tNormalizedParameter,\n\tNormalizedRequestBody,\n\tOpenApiDoc,\n} from \"./types.ts\";\n\nfunction operationKey(method: string, path: string): string {\n\treturn `${method.toUpperCase()} ${path}`;\n}\n\nconst HTTP_METHODS = [\n\t\"get\",\n\t\"post\",\n\t\"put\",\n\t\"patch\",\n\t\"delete\",\n\t\"options\",\n\t\"head\",\n\t\"trace\",\n] as const;\n\ntype RawParameter = {\n\tin?: string;\n\tname?: string;\n\trequired?: boolean;\n\tdescription?: string;\n\tschema?: unknown;\n};\n\ntype RawRequestBody = {\n\trequired?: boolean;\n\tcontent?: Record<string, { schema?: unknown } | undefined>;\n};\n\ntype RawOperation = {\n\toperationId?: string;\n\ttags?: string[];\n\tsummary?: string;\n\tdescription?: string;\n\tdeprecated?: boolean;\n\tsecurity?: OpenApiDoc[\"security\"];\n\tparameters?: RawParameter[];\n\trequestBody?: RawRequestBody;\n};\n\ntype RawPathItem = {\n\tparameters?: RawParameter[];\n} & Partial<Record<(typeof HTTP_METHODS)[number], RawOperation>>;\n\nfunction normalizeParam(p: RawParameter): NormalizedParameter | undefined {\n\tif (!p || typeof p !== \"object\") return undefined;\n\tconst loc = p.in;\n\tconst name = p.name;\n\tif (\n\t\tloc !== \"path\" &&\n\t\tloc !== \"query\" &&\n\t\tloc !== \"header\" &&\n\t\tloc !== \"cookie\"\n\t) {\n\t\treturn undefined;\n\t}\n\tif (!name) return undefined;\n\n\treturn {\n\t\tin: loc,\n\t\tname,\n\t\trequired: Boolean(p.required || loc === \"path\"),\n\t\tdescription: p.description,\n\t\tschema: p.schema,\n\t};\n}\n\nfunction mergeParameters(\n\tpathParams: RawParameter[] | undefined,\n\topParams: RawParameter[] | undefined,\n): NormalizedParameter[] {\n\tconst merged = new Map<string, NormalizedParameter>();\n\n\tfor (const p of pathParams ?? []) {\n\t\tconst normalized = normalizeParam(p);\n\t\tif (!normalized) continue;\n\t\tmerged.set(`${normalized.in}:${normalized.name}`, normalized);\n\t}\n\n\tfor (const p of opParams ?? []) {\n\t\tconst normalized = normalizeParam(p);\n\t\tif (!normalized) continue;\n\t\tmerged.set(`${normalized.in}:${normalized.name}`, normalized);\n\t}\n\n\treturn [...merged.values()];\n}\n\nfunction normalizeRequestBody(\n\trb: RawRequestBody | undefined,\n): NormalizedRequestBody | undefined {\n\tif (!rb) return undefined;\n\n\tconst content = rb.content ?? {};\n\tconst contentTypes = Object.keys(content);\n\tconst schemasByContentType: Record<string, unknown | undefined> = {};\n\n\tfor (const contentType of contentTypes) {\n\t\tschemasByContentType[contentType] = content[contentType]?.schema;\n\t}\n\n\treturn {\n\t\trequired: Boolean(rb.required),\n\t\tcontentTypes,\n\t\tschemasByContentType,\n\t};\n}\n\nexport function indexOperations(doc: OpenApiDoc): NormalizedOperation[] {\n\tconst out: NormalizedOperation[] = [];\n\tconst paths = doc.paths ?? {};\n\n\tfor (const [path, rawPathItem] of Object.entries(paths)) {\n\t\tif (!rawPathItem || typeof rawPathItem !== \"object\") continue;\n\n\t\tconst pathItem = rawPathItem as RawPathItem;\n\n\t\tfor (const method of HTTP_METHODS) {\n\t\t\tconst op = pathItem[method];\n\t\t\tif (!op) continue;\n\n\t\t\tconst parameters = mergeParameters(pathItem.parameters, op.parameters);\n\t\t\tconst normalizedMethod = method.toUpperCase();\n\t\t\tout.push({\n\t\t\t\tkey: operationKey(normalizedMethod, path),\n\t\t\t\tmethod: normalizedMethod,\n\t\t\t\tpath,\n\t\t\t\toperationId: op.operationId,\n\t\t\t\ttags: op.tags ?? [],\n\t\t\t\tsummary: op.summary,\n\t\t\t\tdescription: op.description,\n\t\t\t\tdeprecated: op.deprecated,\n\t\t\t\tsecurity: (op.security ?? doc.security) as OpenApiDoc[\"security\"],\n\t\t\t\tparameters,\n\t\t\t\trequestBody: normalizeRequestBody(op.requestBody),\n\t\t\t});\n\t\t}\n\t}\n\n\tout.sort((a, b) => {\n\t\tif (a.path !== b.path) return a.path.localeCompare(b.path);\n\t\treturn a.method.localeCompare(b.method);\n\t});\n\n\treturn out;\n}\n",
20
+ "import type { AuthScheme } from \"./auth-schemes.ts\";\nimport type { Capabilities } from \"./capabilities.ts\";\nimport type { CommandModel } from \"./command-model.ts\";\nimport type { PlannedOperation } from \"./naming.ts\";\nimport type { ServerInfo } from \"./server.ts\";\nimport type { LoadedSpec, NormalizedOperation } from \"./types.ts\";\n\nexport type SchemaOutput = {\n\tschemaVersion: 1;\n\topenapi: {\n\t\tversion: string;\n\t\ttitle?: string;\n\t\tinfoVersion?: string;\n\t};\n\tspec: {\n\t\tid: string;\n\t\tfingerprint: string;\n\t\tsource: LoadedSpec[\"source\"];\n\t};\n\tcapabilities: Capabilities;\n\tservers: ServerInfo[];\n\tauthSchemes: AuthScheme[];\n\toperations: NormalizedOperation[];\n\tplanned?: PlannedOperation[];\n\tcommands?: CommandModel;\n\tcommandsIndex?: import(\"./command-index.ts\").CommandsIndex;\n};\n\nexport type MinimalSchemaOutput = Pick<\n\tSchemaOutput,\n\t\"schemaVersion\" | \"openapi\" | \"spec\" | \"capabilities\" | \"commands\"\n>;\n\nexport function buildSchemaOutput(\n\tloaded: LoadedSpec,\n\toperations: NormalizedOperation[],\n\tplanned: PlannedOperation[] | undefined,\n\tservers: ServerInfo[],\n\tauthSchemes: AuthScheme[],\n\tcommands: CommandModel | undefined,\n\tcommandsIndex: import(\"./command-index.ts\").CommandsIndex | undefined,\n\tcapabilities: Capabilities,\n): SchemaOutput {\n\treturn {\n\t\tschemaVersion: 1,\n\t\topenapi: {\n\t\t\tversion: loaded.doc.openapi,\n\t\t\ttitle: loaded.doc.info?.title,\n\t\t\tinfoVersion: loaded.doc.info?.version,\n\t\t},\n\t\tspec: {\n\t\t\tid: loaded.id,\n\t\t\tfingerprint: loaded.fingerprint,\n\t\t\tsource: loaded.source,\n\t\t},\n\t\tcapabilities,\n\t\tservers,\n\t\tauthSchemes,\n\t\toperations,\n\t\tplanned,\n\t\tcommands,\n\t\tcommandsIndex,\n\t};\n}\n\nexport function toMinimalSchemaOutput(\n\toutput: SchemaOutput,\n): MinimalSchemaOutput {\n\treturn {\n\t\tschemaVersion: output.schemaVersion,\n\t\topenapi: output.openapi,\n\t\tspec: output.spec,\n\t\tcapabilities: output.capabilities,\n\t\tcommands: output.commands,\n\t};\n}\n",
21
+ "import { getSchemaEnumStrings } from \"./schema-shape.ts\";\nimport type { OpenApiDoc } from \"./types.ts\";\n\nexport type ServerVariable = {\n\tname: string;\n\tdefault?: string;\n\tenum?: string[];\n\tdescription?: string;\n};\n\nexport type ServerInfo = {\n\turl: string;\n\tdescription?: string;\n\tvariables: ServerVariable[];\n\tvariableNames: string[];\n};\n\ntype RawServerVariable = {\n\tdefault?: unknown;\n\tenum?: unknown;\n\tdescription?: unknown;\n};\n\ntype RawServer = {\n\turl?: unknown;\n\tdescription?: unknown;\n\tvariables?: unknown;\n};\n\nfunction extractVariableNames(url: string): string[] {\n\tconst names: string[] = [];\n\tconst re = /\\{([^}]+)\\}/g;\n\n\twhile (true) {\n\t\tconst match = re.exec(url);\n\t\tif (!match) break;\n\t\tnames.push(match[1] ?? \"\");\n\t}\n\n\treturn names.map((n) => n.trim()).filter(Boolean);\n}\n\nexport function listServers(doc: OpenApiDoc): ServerInfo[] {\n\tconst servers = doc.servers ?? [];\n\tconst out: ServerInfo[] = [];\n\n\tfor (const raw of servers) {\n\t\tconst s = raw as RawServer;\n\t\tif (!s || typeof s !== \"object\") continue;\n\t\tif (typeof s.url !== \"string\") continue;\n\n\t\tconst variableNames = extractVariableNames(s.url);\n\t\tconst variables: ServerVariable[] = [];\n\n\t\tconst rawVars =\n\t\t\ts.variables &&\n\t\t\ttypeof s.variables === \"object\" &&\n\t\t\t!Array.isArray(s.variables)\n\t\t\t\t? (s.variables as Record<string, RawServerVariable>)\n\t\t\t\t: {};\n\n\t\tfor (const name of variableNames) {\n\t\t\tconst v = rawVars[name];\n\t\t\tconst def = v?.default;\n\t\t\tconst desc = v?.description;\n\t\t\tvariables.push({\n\t\t\t\tname,\n\t\t\t\tdefault: typeof def === \"string\" ? def : undefined,\n\t\t\t\tenum: getSchemaEnumStrings(v),\n\t\t\t\tdescription: typeof desc === \"string\" ? desc : undefined,\n\t\t\t});\n\t\t}\n\n\t\tout.push({\n\t\t\turl: s.url,\n\t\t\tdescription:\n\t\t\t\ttypeof s.description === \"string\" ? s.description : undefined,\n\t\t\tvariables,\n\t\t\tvariableNames,\n\t\t});\n\t}\n\n\treturn out;\n}\n\nexport function getDefaultServerUrl(doc: OpenApiDoc): string | undefined {\n\treturn listServers(doc)[0]?.url;\n}\n",
22
+ "import SwaggerParser from \"@apidevtools/swagger-parser\";\n\nimport { sha256Hex } from \"./crypto.ts\";\nimport { parseYamlContent } from \"./runtime/compat.ts\";\nimport { getSpecId } from \"./spec-id.ts\";\nimport { stableStringify } from \"./stable-json.ts\";\nimport type { LoadedSpec, OpenApiDoc, SpecSource } from \"./types.ts\";\n\nexport type LoadSpecOptions = {\n\tspec?: string;\n\tembeddedSpecText?: string;\n};\n\nfunction isProbablyUrl(input: string): boolean {\n\treturn /^https?:\\/\\//i.test(input);\n}\n\nfunction parseSpecText(text: string): unknown {\n\tconst trimmed = text.trimStart();\n\tif (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) {\n\t\treturn JSON.parse(text);\n\t}\n\n\treturn parseYamlContent(text);\n}\n\nexport async function loadSpec(options: LoadSpecOptions): Promise<LoadedSpec> {\n\tconst { spec, embeddedSpecText } = options;\n\n\tlet source: SpecSource;\n\tlet inputForParser: unknown;\n\n\tif (typeof embeddedSpecText === \"string\") {\n\t\tsource = \"embedded\";\n\t\tinputForParser = parseSpecText(embeddedSpecText);\n\t} else if (spec) {\n\t\tsource = isProbablyUrl(spec) ? \"url\" : \"file\";\n\t\tinputForParser = spec;\n\t} else {\n\t\tthrow new Error(\n\t\t\t\"Missing spec. Provide --spec <url|path> or build with an embedded spec.\",\n\t\t);\n\t}\n\n\tconst doc = (await SwaggerParser.dereference(\n\t\t// biome-ignore lint/suspicious/noExplicitAny: unknown\n\t\tinputForParser as any,\n\t)) as OpenApiDoc;\n\n\tif (!doc || typeof doc !== \"object\" || typeof doc.openapi !== \"string\") {\n\t\tthrow new Error(\"Loaded spec is not a valid OpenAPI document\");\n\t}\n\n\tconst fingerprint = await sha256Hex(stableStringify(doc));\n\tconst id = getSpecId({ doc, fingerprint });\n\n\treturn { source, id, fingerprint, doc };\n}\n",
23
+ "export async function sha256Hex(text: string): Promise<string> {\n\tconst data = new TextEncoder().encode(text);\n\tconst hash = await crypto.subtle.digest(\"SHA-256\", data);\n\tconst bytes = new Uint8Array(hash);\n\n\tlet out = \"\";\n\tfor (const b of bytes) out += b.toString(16).padStart(2, \"0\");\n\treturn out;\n}\n",
24
+ "/**\n * Cross-runtime compatibility utilities for Bun and Node.js\n *\n * This module provides abstractions over Bun-specific APIs to allow\n * the exec command to run in Node.js while compile remains Bun-only.\n */\n\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { parse as parseYaml } from \"yaml\";\n\n/**\n * Detect if we're running in Bun\n */\nexport const isBun = typeof globalThis.Bun !== \"undefined\";\n\n/**\n * Read a file's text content - works in both Bun and Node.js\n */\nexport async function readFileText(path: string): Promise<string> {\n\tif (isBun) {\n\t\treturn Bun.file(path).text();\n\t}\n\treturn readFileSync(path, \"utf-8\");\n}\n\n/**\n * Check if a file exists - works in both Bun and Node.js\n */\nexport async function fileExists(path: string): Promise<boolean> {\n\tif (isBun) {\n\t\treturn Bun.file(path).exists();\n\t}\n\treturn existsSync(path);\n}\n\n/**\n * Write text to a file - works in both Bun and Node.js\n */\nexport async function writeFileText(\n\tpath: string,\n\tcontent: string,\n): Promise<void> {\n\tif (isBun) {\n\t\tawait Bun.write(path, content);\n\t\treturn;\n\t}\n\twriteFileSync(path, content, \"utf-8\");\n}\n\n/**\n * Create directory recursively - works in both Bun and Node.js\n */\nexport async function mkdirp(path: string): Promise<void> {\n\tif (isBun) {\n\t\tawait Bun.$`mkdir -p ${path}`;\n\t\treturn;\n\t}\n\tmkdirSync(path, { recursive: true });\n}\n\n/**\n * Parse YAML content - works in both Bun and Node.js\n */\nexport function parseYamlContent(text: string): unknown {\n\tif (isBun) {\n\t\tconst { YAML } = globalThis.Bun;\n\t\treturn YAML.parse(text);\n\t}\n\treturn parseYaml(text);\n}\n\n/**\n * Read from stdin - works in both Bun and Node.js\n */\nexport async function readStdinText(): Promise<string> {\n\tif (isBun) {\n\t\treturn Bun.stdin.text();\n\t}\n\t// Node.js stdin reading\n\treturn new Promise((resolve, reject) => {\n\t\tlet data = \"\";\n\t\tprocess.stdin.setEncoding(\"utf8\");\n\t\tprocess.stdin.on(\"data\", (chunk) => {\n\t\t\tdata += chunk;\n\t\t});\n\t\tprocess.stdin.on(\"end\", () => resolve(data));\n\t\tprocess.stdin.on(\"error\", reject);\n\t});\n}\n",
25
+ "import { kebabCase } from \"./strings.ts\";\nimport type { LoadedSpec } from \"./types.ts\";\n\nexport function getSpecId(\n\tloaded: Pick<LoadedSpec, \"doc\" | \"fingerprint\">,\n): string {\n\tconst title = loaded.doc.info?.title;\n\tconst fromTitle = title ? kebabCase(title) : \"\";\n\tif (fromTitle) return fromTitle;\n\n\treturn loaded.fingerprint.slice(0, 12);\n}\n",
26
+ "export function stableStringify(\n\tvalue: unknown,\n\toptions?: { space?: number },\n): string {\n\tconst visiting = new WeakSet<object>();\n\treturn JSON.stringify(sort(value, visiting), null, options?.space);\n}\n\nfunction sort(value: unknown, visiting: WeakSet<object>): unknown {\n\tif (value === null) return null;\n\n\tif (Array.isArray(value)) {\n\t\tif (visiting.has(value)) return { __specli_circular: true };\n\t\tvisiting.add(value);\n\t\tconst out = value.map((v) => sort(v, visiting));\n\t\tvisiting.delete(value);\n\t\treturn out;\n\t}\n\n\tif (typeof value === \"object\") {\n\t\tif (visiting.has(value)) return { __specli_circular: true };\n\t\tvisiting.add(value);\n\n\t\tconst obj = value as Record<string, unknown>;\n\t\tconst out: Record<string, unknown> = {};\n\t\tfor (const key of Object.keys(obj).sort()) {\n\t\t\tout[key] = sort(obj[key], visiting);\n\t\t}\n\n\t\tvisiting.delete(value);\n\t\treturn out;\n\t}\n\n\treturn value;\n}\n",
27
+ "import { listAuthSchemes } from \"../auth-schemes.ts\";\nimport { deriveCapabilities } from \"../capabilities.ts\";\nimport { buildCommandsIndex } from \"../command-index.ts\";\nimport { buildCommandModel } from \"../command-model.ts\";\nimport { planOperations } from \"../naming.ts\";\nimport { indexOperations } from \"../operations.ts\";\nimport { buildSchemaOutput } from \"../schema.ts\";\nimport { listServers } from \"../server.ts\";\nimport { loadSpec } from \"../spec-loader.ts\";\n\nexport type BuildRuntimeContextOptions = {\n\tspec?: string;\n\tembeddedSpecText?: string;\n};\n\nexport async function buildRuntimeContext(options: BuildRuntimeContextOptions) {\n\tconst loaded = await loadSpec({\n\t\tspec: options.spec,\n\t\tembeddedSpecText: options.embeddedSpecText,\n\t});\n\n\tconst operations = indexOperations(loaded.doc);\n\tconst servers = listServers(loaded.doc);\n\tconst authSchemes = listAuthSchemes(loaded.doc);\n\tconst planned = planOperations(operations);\n\tconst commands = buildCommandModel(planned, {\n\t\tspecId: loaded.id,\n\t\tglobalSecurity: loaded.doc.security,\n\t\tauthSchemes,\n\t});\n\tconst commandsIndex = buildCommandsIndex(commands);\n\tconst capabilities = deriveCapabilities({\n\t\tdoc: loaded.doc,\n\t\tservers,\n\t\tauthSchemes,\n\t\toperations,\n\t\tcommands,\n\t});\n\n\tconst schema = buildSchemaOutput(\n\t\tloaded,\n\t\toperations,\n\t\tplanned,\n\t\tservers,\n\t\tauthSchemes,\n\t\tcommands,\n\t\tcommandsIndex,\n\t\tcapabilities,\n\t);\n\n\treturn {\n\t\tloaded,\n\t\toperations,\n\t\tservers,\n\t\tauthSchemes,\n\t\tplanned,\n\t\tcommands,\n\t\tcommandsIndex,\n\t\tcapabilities,\n\t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AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA;",
30
+ "debugId": "29AF5DFA74CC64D164756E2164756E21",
31
+ "names": []
32
+ }
@@ -0,0 +1,33 @@
1
+ import type { CommandAction } from "../command-model.js";
2
+ import type { BodyFlagDef } from "./body-flags.js";
3
+ import { type EmbeddedDefaults } from "./request.js";
4
+ export type ExecuteInput = {
5
+ action: CommandAction;
6
+ positionalValues: string[];
7
+ flagValues: Record<string, unknown>;
8
+ globals: import("./request.js").RuntimeGlobals;
9
+ servers: import("../server.js").ServerInfo[];
10
+ authSchemes: import("../auth-schemes.js").AuthScheme[];
11
+ specId: string;
12
+ embeddedDefaults?: EmbeddedDefaults;
13
+ bodyFlagDefs?: BodyFlagDef[];
14
+ /** Resource name for error messages (e.g. "plans") */
15
+ resourceName?: string;
16
+ };
17
+ export type ExecuteResult = {
18
+ ok: boolean;
19
+ status: number;
20
+ body: unknown;
21
+ curl: string;
22
+ };
23
+ /**
24
+ * Execute an action and return the result as data.
25
+ * This is the core execution function used by both CLI and programmatic API.
26
+ */
27
+ export declare function execute(input: Omit<ExecuteInput, "resourceName">): Promise<ExecuteResult>;
28
+ /**
29
+ * Execute an action and write output to stdout/stderr.
30
+ * This is the CLI-facing wrapper around execute().
31
+ */
32
+ export declare function executeAction(input: ExecuteInput): Promise<void>;
33
+ //# sourceMappingURL=execute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/cli/runtime/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,EAAE,OAAO,cAAc,EAAE,cAAc,CAAC;IAC/C,OAAO,EAAE,OAAO,cAAc,EAAE,UAAU,EAAE,CAAC;IAC7C,WAAW,EAAE,OAAO,oBAAoB,EAAE,UAAU,EAAE,CAAC;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAgBF;;;GAGG;AACH,wBAAsB,OAAO,CAC5B,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,GACvC,OAAO,CAAC,aAAa,CAAC,CAiCxB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6DtE"}