zilmate 1.9.9 → 1.10.1

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/.agents/skills/ad-creative/SKILL.md +362 -0
  2. package/.agents/skills/ad-creative/evals/evals.json +90 -0
  3. package/.agents/skills/ad-creative/references/generative-tools.md +637 -0
  4. package/.agents/skills/ad-creative/references/platform-specs.md +213 -0
  5. package/.agents/skills/ai-seo/SKILL.md +489 -0
  6. package/.agents/skills/ai-seo/evals/evals.json +90 -0
  7. package/.agents/skills/ai-seo/references/content-patterns.md +285 -0
  8. package/.agents/skills/ai-seo/references/content-types.md +71 -0
  9. package/.agents/skills/ai-seo/references/okf.md +104 -0
  10. package/.agents/skills/ai-seo/references/platform-ranking-factors.md +154 -0
  11. package/.agents/skills/clerk-backend-api/SKILL.md +426 -0
  12. package/.agents/skills/clerk-backend-api/evals/evals.json +87 -0
  13. package/.agents/skills/clerk-backend-api/scripts/api-specs-context.sh +30 -0
  14. package/.agents/skills/clerk-backend-api/scripts/execute-request.sh +88 -0
  15. package/.agents/skills/clerk-backend-api/scripts/extract-endpoint-detail.sh +165 -0
  16. package/.agents/skills/clerk-backend-api/scripts/extract-tag-endpoints.sh +208 -0
  17. package/.agents/skills/clerk-backend-api/scripts/extract-tags.js +14 -0
  18. package/.agents/skills/copy-editing/SKILL.md +457 -0
  19. package/.agents/skills/copy-editing/evals/evals.json +89 -0
  20. package/.agents/skills/copy-editing/references/checklist.md +66 -0
  21. package/.agents/skills/copy-editing/references/content-refresh.md +38 -0
  22. package/.agents/skills/copy-editing/references/plain-english-alternatives.md +394 -0
  23. package/.agents/skills/hyperframes/SKILL.md +163 -0
  24. package/.agents/skills/hyperframes-cli/SKILL.md +109 -0
  25. package/.agents/skills/hyperframes-cli/references/doctor-browser.md +45 -0
  26. package/.agents/skills/hyperframes-cli/references/init-and-scaffold.md +51 -0
  27. package/.agents/skills/hyperframes-cli/references/lambda.md +132 -0
  28. package/.agents/skills/hyperframes-cli/references/lint-validate-inspect.md +121 -0
  29. package/.agents/skills/hyperframes-cli/references/preview-render.md +109 -0
  30. package/.agents/skills/hyperframes-cli/references/upgrade-info-misc.md +75 -0
  31. package/.agents/skills/hyperframes-media/SKILL.md +97 -0
  32. package/.agents/skills/hyperframes-media/assets/sfx/CREDITS.md +35 -0
  33. package/.agents/skills/hyperframes-media/assets/sfx/manifest.json +97 -0
  34. package/.agents/skills/hyperframes-media/references/bgm.md +72 -0
  35. package/.agents/skills/hyperframes-media/references/captions/authoring.md +159 -0
  36. package/.agents/skills/hyperframes-media/references/captions/motion.md +87 -0
  37. package/.agents/skills/hyperframes-media/references/captions/transcript-handling.md +97 -0
  38. package/.agents/skills/hyperframes-media/references/remove-background.md +143 -0
  39. package/.agents/skills/hyperframes-media/references/requirements.md +29 -0
  40. package/.agents/skills/hyperframes-media/references/sfx.md +42 -0
  41. package/.agents/skills/hyperframes-media/references/transcribe.md +52 -0
  42. package/.agents/skills/hyperframes-media/references/tts-to-captions.md +24 -0
  43. package/.agents/skills/hyperframes-media/references/tts.md +135 -0
  44. package/.agents/skills/hyperframes-media/scripts/audio.mjs +282 -0
  45. package/.agents/skills/hyperframes-media/scripts/heygen-tts.mjs +121 -0
  46. package/.agents/skills/hyperframes-media/scripts/lib/bgm.mjs +235 -0
  47. package/.agents/skills/hyperframes-media/scripts/lib/heygen.mjs +131 -0
  48. package/.agents/skills/hyperframes-media/scripts/lib/sfx.mjs +128 -0
  49. package/.agents/skills/hyperframes-media/scripts/lib/tts.mjs +220 -0
  50. package/.agents/skills/hyperframes-media/scripts/lyria-recipe.py +128 -0
  51. package/.agents/skills/hyperframes-media/scripts/wait-bgm.mjs +167 -0
  52. package/.agents/skills/hyperframes-registry/SKILL.md +101 -0
  53. package/.agents/skills/hyperframes-registry/examples/add-block.md +51 -0
  54. package/.agents/skills/hyperframes-registry/examples/add-component.md +73 -0
  55. package/.agents/skills/hyperframes-registry/references/contributing.md +166 -0
  56. package/.agents/skills/hyperframes-registry/references/demo-html-pattern.md +54 -0
  57. package/.agents/skills/hyperframes-registry/references/discovery.md +215 -0
  58. package/.agents/skills/hyperframes-registry/references/install-locations.md +45 -0
  59. package/.agents/skills/hyperframes-registry/references/templates.md +417 -0
  60. package/.agents/skills/hyperframes-registry/references/wiring-blocks.md +61 -0
  61. package/.agents/skills/hyperframes-registry/references/wiring-components.md +39 -0
  62. package/.agents/skills/marketing-psychology/SKILL.md +455 -0
  63. package/.agents/skills/marketing-psychology/evals/evals.json +88 -0
  64. package/.agents/skills/mintlify/SKILL.md +328 -0
  65. package/.agents/skills/product-launch-video/SKILL.md +206 -0
  66. package/.agents/skills/product-launch-video/references/cut-catalog.md +220 -0
  67. package/.agents/skills/product-launch-video/references/motion-language.md +156 -0
  68. package/.agents/skills/product-launch-video/references/story-design.md +373 -0
  69. package/.agents/skills/product-launch-video/references/visual-design.md +126 -0
  70. package/.agents/skills/product-launch-video/scripts/assemble-index.mjs +570 -0
  71. package/.agents/skills/product-launch-video/scripts/audio.mjs +253 -0
  72. package/.agents/skills/product-launch-video/scripts/build-frame.mjs +536 -0
  73. package/.agents/skills/product-launch-video/scripts/captions.mjs +508 -0
  74. package/.agents/skills/product-launch-video/scripts/lib/assets.mjs +55 -0
  75. package/.agents/skills/product-launch-video/scripts/lib/dimensions.mjs +45 -0
  76. package/.agents/skills/product-launch-video/scripts/lib/storyboard.mjs +249 -0
  77. package/.agents/skills/product-launch-video/scripts/lib/tokens.mjs +204 -0
  78. package/.agents/skills/product-launch-video/scripts/lib/transition-registry.mjs +38 -0
  79. package/.agents/skills/product-launch-video/scripts/lib/transitions.json +71 -0
  80. package/.agents/skills/product-launch-video/scripts/stage-assets.mjs +39 -0
  81. package/.agents/skills/product-launch-video/scripts/transitions.mjs +320 -0
  82. package/.agents/skills/product-launch-video/sub-agents/frame-worker.md +74 -0
  83. package/.agents/skills/prompt-engineering-patterns/SKILL.md +144 -0
  84. package/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
  85. package/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
  86. package/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
  87. package/.agents/skills/prompt-engineering-patterns/references/details.md +338 -0
  88. package/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
  89. package/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
  90. package/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
  91. package/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
  92. package/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
  93. package/.agents/skills/remotion-to-hyperframes/SKILL.md +127 -0
  94. package/.agents/skills/remotion-to-hyperframes/assets/.gitkeep +0 -0
  95. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/run.sh +249 -0
  96. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/README.md +41 -0
  97. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/expected.json +26 -0
  98. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/index.html +61 -0
  99. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/package.json +14 -0
  100. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/remotion.config.ts +13 -0
  101. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/Root.tsx +13 -0
  102. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/TitleCard.tsx +34 -0
  103. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/index.ts +4 -0
  104. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/tsconfig.json +15 -0
  105. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/README.md +54 -0
  106. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/expected.json +29 -0
  107. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/index.html +118 -0
  108. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/package.json +14 -0
  109. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/remotion.config.ts +13 -0
  110. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/MultiScene.tsx +105 -0
  111. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/Root.tsx +13 -0
  112. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/index.ts +4 -0
  113. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/tsconfig.json +15 -0
  114. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/setup.sh +34 -0
  115. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/README.md +85 -0
  116. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/expected.json +41 -0
  117. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/index.html +269 -0
  118. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/package.json +15 -0
  119. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/remotion.config.ts +13 -0
  120. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Root.tsx +27 -0
  121. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Stargazed.tsx +37 -0
  122. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/AnimatedNumber.tsx +23 -0
  123. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/StatCard.tsx +59 -0
  124. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/UnderlinedText.tsx +47 -0
  125. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/index.ts +4 -0
  126. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/OutroScene.tsx +18 -0
  127. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/StatsScene.tsx +34 -0
  128. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/TitleScene.tsx +55 -0
  129. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/tsconfig.json +15 -0
  130. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/README.md +51 -0
  131. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/01-use-state.tsx +29 -0
  132. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/02-use-effect-deps.tsx +29 -0
  133. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/03-async-metadata.tsx +39 -0
  134. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/04-third-party-react.tsx +30 -0
  135. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/05-lambda-config.tsx +38 -0
  136. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/06-warnings-only.tsx +36 -0
  137. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/07-custom-hook.tsx +28 -0
  138. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/08-mixed.tsx +41 -0
  139. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/expected.json +85 -0
  140. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/validate.sh +110 -0
  141. package/.agents/skills/remotion-to-hyperframes/references/api-map.md +142 -0
  142. package/.agents/skills/remotion-to-hyperframes/references/escape-hatch.md +115 -0
  143. package/.agents/skills/remotion-to-hyperframes/references/eval.md +140 -0
  144. package/.agents/skills/remotion-to-hyperframes/references/fonts.md +112 -0
  145. package/.agents/skills/remotion-to-hyperframes/references/limitations.md +136 -0
  146. package/.agents/skills/remotion-to-hyperframes/references/lottie.md +121 -0
  147. package/.agents/skills/remotion-to-hyperframes/references/media.md +149 -0
  148. package/.agents/skills/remotion-to-hyperframes/references/parameters.md +167 -0
  149. package/.agents/skills/remotion-to-hyperframes/references/sequencing.md +195 -0
  150. package/.agents/skills/remotion-to-hyperframes/references/timing.md +165 -0
  151. package/.agents/skills/remotion-to-hyperframes/references/transitions.md +114 -0
  152. package/.agents/skills/remotion-to-hyperframes/scripts/.gitkeep +0 -0
  153. package/.agents/skills/remotion-to-hyperframes/scripts/frame_strip.sh +107 -0
  154. package/.agents/skills/remotion-to-hyperframes/scripts/lint_source.py +358 -0
  155. package/.agents/skills/remotion-to-hyperframes/scripts/render_diff.sh +103 -0
  156. package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/blocker.tsx +50 -0
  157. package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/clean.tsx +46 -0
  158. package/.agents/skills/remotion-to-hyperframes/scripts/tests/smoke.sh +90 -0
  159. package/.agents/skills/seo-audit/SKILL.md +497 -0
  160. package/.agents/skills/seo-audit/evals/evals.json +136 -0
  161. package/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
  162. package/.agents/skills/seo-audit/references/international-seo.md +230 -0
  163. package/README.md +4 -2
  164. package/SDK.md +64 -1
  165. package/dist/agents/coding.agent.d.ts +550 -0
  166. package/dist/agents/coding.agent.d.ts.map +1 -1
  167. package/dist/agents/coding.agent.js +8 -0
  168. package/dist/agents/coding.agent.js.map +1 -1
  169. package/dist/agents/developer-helper.agent.d.ts +704 -0
  170. package/dist/agents/developer-helper.agent.d.ts.map +1 -1
  171. package/dist/agents/developer-helper.agent.js +6 -0
  172. package/dist/agents/developer-helper.agent.js.map +1 -1
  173. package/dist/agents/manager.d.ts +829 -2
  174. package/dist/agents/manager.d.ts.map +1 -1
  175. package/dist/agents/manager.js +8 -0
  176. package/dist/agents/manager.js.map +1 -1
  177. package/dist/agents/security.agent.d.ts +157 -3
  178. package/dist/agents/security.agent.d.ts.map +1 -1
  179. package/dist/agents/security.agent.js +3 -0
  180. package/dist/agents/security.agent.js.map +1 -1
  181. package/dist/agents/swarm/main.js +1 -1
  182. package/dist/agents/swarm/main.js.map +1 -1
  183. package/dist/agents/swarm/registry.d.ts.map +1 -1
  184. package/dist/agents/swarm/registry.js +232 -26
  185. package/dist/agents/swarm/registry.js.map +1 -1
  186. package/dist/cli/doctor.d.ts +14 -0
  187. package/dist/cli/doctor.d.ts.map +1 -1
  188. package/dist/cli/doctor.js +91 -0
  189. package/dist/cli/doctor.js.map +1 -1
  190. package/dist/cli/menu.d.ts.map +1 -1
  191. package/dist/cli/menu.js +102 -0
  192. package/dist/cli/menu.js.map +1 -1
  193. package/dist/cli/setup.d.ts +10 -0
  194. package/dist/cli/setup.d.ts.map +1 -1
  195. package/dist/cli/setup.js +178 -0
  196. package/dist/cli/setup.js.map +1 -1
  197. package/dist/config/env.d.ts +10 -0
  198. package/dist/config/env.d.ts.map +1 -1
  199. package/dist/config/env.js +10 -0
  200. package/dist/config/env.js.map +1 -1
  201. package/dist/index.js +14 -2
  202. package/dist/index.js.map +1 -1
  203. package/dist/jobs/trigger-orchestrator.d.ts +5 -1
  204. package/dist/jobs/trigger-orchestrator.d.ts.map +1 -1
  205. package/dist/jobs/trigger-orchestrator.js +29 -9
  206. package/dist/jobs/trigger-orchestrator.js.map +1 -1
  207. package/dist/jobs/trigger-router.d.ts.map +1 -1
  208. package/dist/jobs/trigger-router.js +3 -2
  209. package/dist/jobs/trigger-router.js.map +1 -1
  210. package/dist/memory/corporate-wiki.d.ts +15 -0
  211. package/dist/memory/corporate-wiki.d.ts.map +1 -0
  212. package/dist/memory/corporate-wiki.js +152 -0
  213. package/dist/memory/corporate-wiki.js.map +1 -0
  214. package/dist/observability/doctor.d.ts.map +1 -1
  215. package/dist/observability/doctor.js +12 -4
  216. package/dist/observability/doctor.js.map +1 -1
  217. package/dist/runtime/swarm.d.ts +0 -1
  218. package/dist/runtime/swarm.d.ts.map +1 -1
  219. package/dist/runtime/swarm.js +26 -15
  220. package/dist/runtime/swarm.js.map +1 -1
  221. package/dist/safety/approvals.d.ts +2 -2
  222. package/dist/safety/approvals.d.ts.map +1 -1
  223. package/dist/safety/approvals.js +47 -1
  224. package/dist/safety/approvals.js.map +1 -1
  225. package/dist/safety/redaction.d.ts.map +1 -1
  226. package/dist/safety/redaction.js +10 -0
  227. package/dist/safety/redaction.js.map +1 -1
  228. package/dist/tools/cloud.tool.d.ts +394 -0
  229. package/dist/tools/cloud.tool.d.ts.map +1 -0
  230. package/dist/tools/cloud.tool.js +784 -0
  231. package/dist/tools/cloud.tool.js.map +1 -0
  232. package/dist/tools/computer-use.tool.d.ts +2 -2
  233. package/dist/tools/corporate-wiki.tool.d.ts +22 -0
  234. package/dist/tools/corporate-wiki.tool.d.ts.map +1 -0
  235. package/dist/tools/corporate-wiki.tool.js +39 -0
  236. package/dist/tools/corporate-wiki.tool.js.map +1 -0
  237. package/dist/tools/devops.tool.d.ts +162 -0
  238. package/dist/tools/devops.tool.d.ts.map +1 -0
  239. package/dist/tools/devops.tool.js +377 -0
  240. package/dist/tools/devops.tool.js.map +1 -0
  241. package/dist/tools/multimedia.tool.d.ts +126 -0
  242. package/dist/tools/multimedia.tool.d.ts.map +1 -0
  243. package/dist/tools/multimedia.tool.js +533 -0
  244. package/dist/tools/multimedia.tool.js.map +1 -0
  245. package/dist/tools/osint.tool.d.ts +6 -6
  246. package/dist/tools/sandbox-dev.tool.d.ts +15 -0
  247. package/dist/tools/sandbox-dev.tool.d.ts.map +1 -0
  248. package/dist/tools/sandbox-dev.tool.js +139 -0
  249. package/dist/tools/sandbox-dev.tool.js.map +1 -0
  250. package/dist/tools/setup-assistant.tool.d.ts +1 -1
  251. package/dist/tools/swarm-ops.tool.d.ts +14 -0
  252. package/dist/tools/swarm-ops.tool.d.ts.map +1 -1
  253. package/dist/tools/swarm-ops.tool.js +44 -0
  254. package/dist/tools/swarm-ops.tool.js.map +1 -1
  255. package/dist/tools/sysops.tool.d.ts +157 -0
  256. package/dist/tools/sysops.tool.d.ts.map +1 -0
  257. package/dist/tools/sysops.tool.js +643 -0
  258. package/dist/tools/sysops.tool.js.map +1 -0
  259. package/dist/voice/deepgram.d.ts.map +1 -1
  260. package/dist/voice/deepgram.js +30 -2
  261. package/dist/voice/deepgram.js.map +1 -1
  262. package/package.json +8 -1
  263. package/scripts/release-github.mjs +23 -16
@@ -0,0 +1,165 @@
1
+ #!/usr/bin/env bash
2
+ # extract-endpoint-detail.sh
3
+ #
4
+ # Extracts full details for a specific endpoint from an OpenAPI YAML spec (stdin),
5
+ # including parameters, request body, responses, and all referenced component schemas.
6
+ #
7
+ # Usage:
8
+ # curl -s <spec-url> | bash extract-endpoint-detail.sh "/users/{user_id}/billing/subscription" "get"
9
+
10
+ set -euo pipefail
11
+
12
+ ENDPOINT="${1:?Usage: extract-endpoint-detail.sh <path> <method>}"
13
+ METHOD="${2:?Usage: extract-endpoint-detail.sh <path> <method>}"
14
+ TMPDIR_WORK=$(mktemp -d)
15
+ trap 'rm -rf "$TMPDIR_WORK"' EXIT
16
+
17
+ SPEC="$TMPDIR_WORK/spec.yml"
18
+ cat > "$SPEC"
19
+
20
+ node - "$ENDPOINT" "$METHOD" "$SPEC" <<'SCRIPT'
21
+ const fs = require("fs");
22
+ const endpoint = process.argv[2];
23
+ const method = process.argv[3].toLowerCase();
24
+ const specFile = process.argv[4];
25
+ const lines = fs.readFileSync(specFile, "utf8").split("\n");
26
+
27
+ const httpMethods = ["get", "post", "put", "patch", "delete", "options", "head"];
28
+
29
+ // Locate paths: and components: sections
30
+ let pathsStart = -1, pathsEnd = -1, componentsStart = -1;
31
+ for (let i = 0; i < lines.length; i++) {
32
+ if (/^paths:\s*$/.test(lines[i])) pathsStart = i;
33
+ else if (pathsStart >= 0 && pathsEnd < 0 && /^\S/.test(lines[i]) && i > pathsStart) pathsEnd = i;
34
+ if (/^components:\s*$/.test(lines[i])) componentsStart = i;
35
+ }
36
+ if (pathsEnd < 0) pathsEnd = lines.length;
37
+
38
+ // Find the target path + method block
39
+ let targetStart = -1, targetEnd = -1;
40
+ let currentPath = null;
41
+
42
+ for (let i = pathsStart + 1; i < pathsEnd; i++) {
43
+ const line = lines[i];
44
+
45
+ // Path line: exactly 2 spaces + /
46
+ if (/^ {2}\/\S/.test(line)) {
47
+ currentPath = line.trim().replace(/:$/, "");
48
+ continue;
49
+ }
50
+
51
+ // Method line: exactly 4 spaces + method name
52
+ const methodMatch = line.match(/^ {4}(\w+):\s*$/);
53
+ if (methodMatch && httpMethods.includes(methodMatch[1])) {
54
+ if (currentPath === endpoint && methodMatch[1] === method) {
55
+ targetStart = i;
56
+ // Find end of this method block
57
+ for (let j = i + 1; j < pathsEnd; j++) {
58
+ const nextLine = lines[j];
59
+ // New method or new path
60
+ if (/^ {2}\/\S/.test(nextLine) || (/^ {4}\w+:\s*$/.test(nextLine) && httpMethods.some(m => nextLine.trim().startsWith(m + ":")))) {
61
+ targetEnd = j;
62
+ break;
63
+ }
64
+ }
65
+ if (targetEnd < 0) targetEnd = pathsEnd;
66
+ break;
67
+ }
68
+ }
69
+ }
70
+
71
+ if (targetStart < 0) {
72
+ console.error(`Endpoint not found: ${method.toUpperCase()} ${endpoint}`);
73
+ process.exit(1);
74
+ }
75
+
76
+ const blockLines = lines.slice(targetStart, targetEnd);
77
+
78
+ // Collect all $refs from the block
79
+ const allRefs = new Set();
80
+ for (const bl of blockLines) {
81
+ const refMatch = bl.match(/\$ref:\s*['"]?(#\/[^'"}\s]+)['"]?/);
82
+ if (refMatch) allRefs.add(refMatch[1]);
83
+ }
84
+
85
+ // Resolve a $ref path to the raw YAML lines for that component
86
+ function resolveRef(ref) {
87
+ const parts = ref.replace("#/", "").split("/");
88
+ // Find the component in the file by walking indentation
89
+ let searchStart = 0;
90
+ for (let p = 0; p < parts.length; p++) {
91
+ const indent = p * 2;
92
+ const target = " ".repeat(indent) + parts[p] + ":";
93
+ let found = false;
94
+ for (let i = searchStart; i < lines.length; i++) {
95
+ if (lines[i].startsWith(target) && (lines[i] === target || lines[i][target.length] === " ")) {
96
+ searchStart = i + 1;
97
+ found = true;
98
+ break;
99
+ }
100
+ }
101
+ if (!found) return null;
102
+ }
103
+
104
+ // Collect lines for this component (until same or lower indent)
105
+ const componentStart = searchStart - 1;
106
+ const baseIndent = parts.length * 2;
107
+ const result = [];
108
+ for (let i = searchStart; i < lines.length; i++) {
109
+ const line = lines[i];
110
+ if (line.trim() === "") { result.push(line); continue; }
111
+ const lineIndent = line.length - line.trimStart().length;
112
+ if (lineIndent < baseIndent) break;
113
+ result.push(line);
114
+ }
115
+ return result;
116
+ }
117
+
118
+ // Recursively resolve refs from component bodies
119
+ function collectDeepRefs(refSet, visited) {
120
+ const toProcess = [...refSet].filter(r => !visited.has(r));
121
+ for (const ref of toProcess) {
122
+ visited.add(ref);
123
+ const body = resolveRef(ref);
124
+ if (!body) continue;
125
+ for (const bl of body) {
126
+ const refMatch = bl.match(/\$ref:\s*['"]?(#\/[^'"}\s]+)['"]?/);
127
+ if (refMatch && !visited.has(refMatch[1])) {
128
+ refSet.add(refMatch[1]);
129
+ }
130
+ }
131
+ }
132
+ // Recurse if new refs were found
133
+ const newRefs = [...refSet].filter(r => !visited.has(r));
134
+ if (newRefs.length > 0) collectDeepRefs(refSet, visited);
135
+ }
136
+
137
+ collectDeepRefs(allRefs, new Set());
138
+
139
+ // Output
140
+ console.log(`## \`${method.toUpperCase()}\` \`${endpoint}\`\n`);
141
+ console.log("### Endpoint Definition\n");
142
+ console.log("```yaml");
143
+ for (const bl of blockLines) {
144
+ console.log(bl);
145
+ }
146
+ console.log("```\n");
147
+
148
+ if (allRefs.size > 0) {
149
+ console.log(`### Referenced Components (${allRefs.size})\n`);
150
+ const sorted = [...allRefs].sort();
151
+ for (const ref of sorted) {
152
+ const name = ref.split("/").pop();
153
+ const category = ref.replace("#/", "").split("/").slice(0, -1).join("/");
154
+ console.log(`#### \`${name}\` (${category})\n`);
155
+ const body = resolveRef(ref);
156
+ if (body) {
157
+ console.log("```yaml");
158
+ for (const bl of body) console.log(bl);
159
+ console.log("```\n");
160
+ } else {
161
+ console.log("_(could not resolve)_\n");
162
+ }
163
+ }
164
+ }
165
+ SCRIPT
@@ -0,0 +1,208 @@
1
+ #!/usr/bin/env bash
2
+ # extract-tag-endpoints.sh
3
+ #
4
+ # Extracts all endpoints for a given tag from an OpenAPI YAML spec (stdin),
5
+ # along with any $ref'd schemas/components.
6
+ #
7
+ # Usage:
8
+ # curl -s <spec-url> | bash extract-tag-endpoints.sh "Billing"
9
+
10
+ set -euo pipefail
11
+
12
+ TAG="${1:?Usage: extract-tag-endpoints.sh <tag-name>}"
13
+ TMPDIR_WORK=$(mktemp -d)
14
+ trap 'rm -rf "$TMPDIR_WORK"' EXIT
15
+
16
+ SPEC="$TMPDIR_WORK/spec.yml"
17
+ cat > "$SPEC"
18
+
19
+ # 1. Find all path+method blocks that have a matching tag
20
+ # Strategy: find line numbers of path entries (lines starting with " /"),
21
+ # then for each method block under that path, check if it contains the tag.
22
+
23
+ node - "$TAG" "$SPEC" <<'SCRIPT'
24
+ const fs = require("fs");
25
+ const tag = process.argv[2];
26
+ const specFile = process.argv[3];
27
+ const lines = fs.readFileSync(specFile, "utf8").split("\n");
28
+
29
+ const tagLower = tag.toLowerCase();
30
+
31
+ // Phase 1: Find all path definitions and their method blocks
32
+ // Paths start at indent 2 with " /"
33
+ // Methods start at indent 4 with " get:", " post:", etc.
34
+ const methods = ["get", "post", "put", "patch", "delete", "options", "head"];
35
+ const endpoints = [];
36
+ const refs = new Set();
37
+
38
+ let currentPath = null;
39
+ let currentMethod = null;
40
+ let blockStart = -1;
41
+ let blockLines = [];
42
+ let inPaths = false;
43
+ let inComponents = false;
44
+
45
+ // First pass: locate the "paths:" and "components:" top-level keys
46
+ let pathsStart = -1;
47
+ let pathsEnd = -1;
48
+ let componentsStart = -1;
49
+
50
+ for (let i = 0; i < lines.length; i++) {
51
+ const line = lines[i];
52
+ if (/^paths:\s*$/.test(line)) {
53
+ pathsStart = i;
54
+ } else if (pathsStart >= 0 && pathsEnd < 0 && /^\S/.test(line) && i > pathsStart) {
55
+ pathsEnd = i;
56
+ }
57
+ if (/^components:\s*$/.test(line)) {
58
+ componentsStart = i;
59
+ }
60
+ }
61
+ if (pathsEnd < 0) pathsEnd = lines.length;
62
+
63
+ // Second pass: extract endpoints matching the tag
64
+ function flushBlock() {
65
+ if (!currentPath || !currentMethod || blockLines.length === 0) return;
66
+
67
+ // Check if this block has the target tag
68
+ let inTags = false;
69
+ let hasTag = false;
70
+ const blockRefs = [];
71
+
72
+ for (const bl of blockLines) {
73
+ const trimmed = bl.trim();
74
+
75
+ // Detect tags section
76
+ if (/^tags:\s*$/.test(trimmed)) {
77
+ inTags = true;
78
+ continue;
79
+ }
80
+ if (inTags) {
81
+ if (/^- /.test(trimmed)) {
82
+ const tagVal = trimmed.replace(/^- /, "").trim().replace(/^['"]|['"]$/g, "");
83
+ if (tagVal.toLowerCase() === tagLower) hasTag = true;
84
+ } else {
85
+ inTags = false;
86
+ }
87
+ }
88
+
89
+ // Collect $ref values
90
+ const refMatch = bl.match(/\$ref:\s*['"]?(#\/[^'"}\s]+)['"]?/);
91
+ if (refMatch) blockRefs.push(refMatch[1]);
92
+ }
93
+
94
+ if (hasTag) {
95
+ // Extract summary, operationId, description
96
+ let summary = "";
97
+ let operationId = "";
98
+ let description = "";
99
+ let params = [];
100
+ let inDesc = false;
101
+ let inParams = false;
102
+
103
+ for (const bl of blockLines) {
104
+ const trimmed = bl.trim();
105
+ const indent = bl.length - bl.trimStart().length;
106
+
107
+ // Only capture operation-level keys (indent 6 = direct children of the method block)
108
+ if (indent === 6) {
109
+ const sumMatch = trimmed.match(/^summary:\s*(.+)/);
110
+ if (sumMatch) summary = sumMatch[1].replace(/^['"]|['"]$/g, "");
111
+
112
+ const opMatch = trimmed.match(/^operationId:\s*(.+)/);
113
+ if (opMatch) operationId = opMatch[1].replace(/^['"]|['"]$/g, "");
114
+
115
+ const descMatch = trimmed.match(/^description:\s*(.+)/);
116
+ if (descMatch && !inDesc) {
117
+ const val = descMatch[1].trim();
118
+ if (val === "|-" || val === "|" || val === ">-" || val === ">") {
119
+ inDesc = true;
120
+ } else {
121
+ description = val.replace(/^['"]|['"]$/g, "");
122
+ }
123
+ continue;
124
+ }
125
+ }
126
+
127
+ if (inDesc) {
128
+ // Continuation lines of description — grab first non-empty line
129
+ if (!description && trimmed.length > 0) {
130
+ description = trimmed;
131
+ }
132
+ // Stop when we hit the next operation-level key
133
+ if (indent === 6 && trimmed.length > 0 && !/^description:/.test(trimmed)) {
134
+ inDesc = false;
135
+ }
136
+ }
137
+ }
138
+
139
+ endpoints.push({
140
+ method: currentMethod.toUpperCase(),
141
+ path: currentPath,
142
+ operationId,
143
+ summary,
144
+ description,
145
+ refs: blockRefs,
146
+ });
147
+
148
+ for (const r of blockRefs) refs.add(r);
149
+ }
150
+ }
151
+
152
+ for (let i = pathsStart + 1; i < pathsEnd; i++) {
153
+ const line = lines[i];
154
+
155
+ // Path line: exactly 2 spaces + /
156
+ if (/^ {2}\/\S/.test(line)) {
157
+ flushBlock();
158
+ currentPath = line.trim().replace(/:$/, "");
159
+ currentMethod = null;
160
+ blockLines = [];
161
+ continue;
162
+ }
163
+
164
+ // Method line: exactly 4 spaces + method name
165
+ const methodMatch = line.match(/^ {4}(\w+):\s*$/);
166
+ if (methodMatch && methods.includes(methodMatch[1])) {
167
+ flushBlock();
168
+ currentMethod = methodMatch[1];
169
+ blockLines = [];
170
+ continue;
171
+ }
172
+
173
+ if (currentMethod) {
174
+ blockLines.push(line);
175
+ }
176
+ }
177
+ flushBlock();
178
+
179
+ // Output endpoints
180
+ if (endpoints.length === 0) {
181
+ console.error(`No endpoints found for tag: "${tag}"`);
182
+ process.exit(1);
183
+ }
184
+
185
+ console.log(`## Endpoints for "${tag}" (${endpoints.length} total)\n`);
186
+ for (const ep of endpoints) {
187
+ console.log(`### \`${ep.method}\` \`${ep.path}\``);
188
+ if (ep.operationId) console.log(`- **operationId**: \`${ep.operationId}\``);
189
+ if (ep.summary) console.log(`- **summary**: ${ep.summary}`);
190
+ if (ep.description && ep.description !== ep.summary)
191
+ console.log(`- **description**: ${ep.description}`);
192
+ if (ep.refs.length > 0) {
193
+ console.log(`- **refs**: ${ep.refs.map(r => "\`" + r.split("/").pop() + "\`").join(", ")}`);
194
+ }
195
+ console.log();
196
+ }
197
+
198
+ // Output unique refs list
199
+ if (refs.size > 0) {
200
+ console.log(`## Referenced Components (${refs.size} unique)\n`);
201
+ const sorted = [...refs].sort();
202
+ for (const r of sorted) {
203
+ const name = r.split("/").pop();
204
+ const category = r.split("/").slice(0, -1).join("/").replace("#/", "");
205
+ console.log(`- \`${name}\` (${category})`);
206
+ }
207
+ }
208
+ SCRIPT
@@ -0,0 +1,14 @@
1
+ let input = "";
2
+ process.stdin.on("data", d => input += d);
3
+ process.stdin.on("end", () => {
4
+ const lines = input.replace(/\r/g, "").split("\n");
5
+ let inTags = false;
6
+ for (const line of lines) {
7
+ if (line === "tags:") { inTags = true; continue; }
8
+ if (inTags && line.length > 0 && line[0] !== " ") break;
9
+ if (inTags) {
10
+ const m = line.match(/^\s{2}- name:\s*(.+)/);
11
+ if (m) console.log(m[1]);
12
+ }
13
+ }
14
+ });