railwise-darwin-x64 1.2.29

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 (380) hide show
  1. package/bin/agent/adjustment_computer.md +44 -0
  2. package/bin/agent/chief_manager.md +82 -0
  3. package/bin/agent/commercial_specialist.md +39 -0
  4. package/bin/agent/cpiii_specialist.md +42 -0
  5. package/bin/agent/data_analyst.md +55 -0
  6. package/bin/agent/knowledge_curator.md +41 -0
  7. package/bin/agent/norm_librarian.md +38 -0
  8. package/bin/agent/qa_inspector.md +58 -0
  9. package/bin/agent/qa_reviewer.md +49 -0
  10. package/bin/agent/solution_architect.md +44 -0
  11. package/bin/agent/source_ingestor.md +38 -0
  12. package/bin/agent/technical_writer.md +50 -0
  13. package/bin/command/bid-prepare.md +21 -0
  14. package/bin/command/daily-report.md +20 -0
  15. package/bin/command/data-check.md +19 -0
  16. package/bin/command/emergency-response.md +62 -0
  17. package/bin/command/monthly-report.md +32 -0
  18. package/bin/command/payment-reminder.md +22 -0
  19. package/bin/command/safety-check.md +18 -0
  20. package/bin/command/trend-analysis.md +35 -0
  21. package/bin/railwise +0 -0
  22. package/bin/railwise.json +4 -0
  23. package/bin/rw +2 -0
  24. package/bin/skill/THIRD_PARTY_NOTICES.md +405 -0
  25. package/bin/skill/algorithmic-art/LICENSE.txt +202 -0
  26. package/bin/skill/algorithmic-art/SKILL.md +405 -0
  27. package/bin/skill/algorithmic-art/templates/generator_template.js +223 -0
  28. package/bin/skill/algorithmic-art/templates/viewer.html +599 -0
  29. package/bin/skill/bidding-knowledge/SKILL.md +67 -0
  30. package/bin/skill/brand-guidelines/LICENSE.txt +202 -0
  31. package/bin/skill/brand-guidelines/SKILL.md +73 -0
  32. package/bin/skill/bun-file-io/SKILL.md +42 -0
  33. package/bin/skill/canvas-design/SKILL.md +141 -0
  34. package/bin/skill/claude-api/LICENSE.txt +202 -0
  35. package/bin/skill/claude-api/SKILL.md +325 -0
  36. package/bin/skill/claude-api/csharp/claude-api.md +402 -0
  37. package/bin/skill/claude-api/curl/examples.md +216 -0
  38. package/bin/skill/claude-api/curl/managed-agents.md +336 -0
  39. package/bin/skill/claude-api/go/claude-api.md +421 -0
  40. package/bin/skill/claude-api/go/managed-agents/README.md +561 -0
  41. package/bin/skill/claude-api/java/claude-api.md +432 -0
  42. package/bin/skill/claude-api/java/managed-agents/README.md +442 -0
  43. package/bin/skill/claude-api/php/claude-api.md +375 -0
  44. package/bin/skill/claude-api/php/managed-agents/README.md +435 -0
  45. package/bin/skill/claude-api/python/claude-api/README.md +420 -0
  46. package/bin/skill/claude-api/python/claude-api/batches.md +185 -0
  47. package/bin/skill/claude-api/python/claude-api/files-api.md +165 -0
  48. package/bin/skill/claude-api/python/claude-api/streaming.md +162 -0
  49. package/bin/skill/claude-api/python/claude-api/tool-use.md +590 -0
  50. package/bin/skill/claude-api/python/managed-agents/README.md +332 -0
  51. package/bin/skill/claude-api/ruby/claude-api.md +113 -0
  52. package/bin/skill/claude-api/ruby/managed-agents/README.md +389 -0
  53. package/bin/skill/claude-api/shared/agent-design.md +101 -0
  54. package/bin/skill/claude-api/shared/error-codes.md +213 -0
  55. package/bin/skill/claude-api/shared/live-sources.md +135 -0
  56. package/bin/skill/claude-api/shared/managed-agents-api-reference.md +378 -0
  57. package/bin/skill/claude-api/shared/managed-agents-client-patterns.md +209 -0
  58. package/bin/skill/claude-api/shared/managed-agents-core.md +238 -0
  59. package/bin/skill/claude-api/shared/managed-agents-environments.md +215 -0
  60. package/bin/skill/claude-api/shared/managed-agents-events.md +195 -0
  61. package/bin/skill/claude-api/shared/managed-agents-memory.md +197 -0
  62. package/bin/skill/claude-api/shared/managed-agents-multiagent.md +99 -0
  63. package/bin/skill/claude-api/shared/managed-agents-onboarding.md +114 -0
  64. package/bin/skill/claude-api/shared/managed-agents-outcomes.md +106 -0
  65. package/bin/skill/claude-api/shared/managed-agents-overview.md +68 -0
  66. package/bin/skill/claude-api/shared/managed-agents-self-hosted-sandboxes.md +173 -0
  67. package/bin/skill/claude-api/shared/managed-agents-tools.md +321 -0
  68. package/bin/skill/claude-api/shared/managed-agents-webhooks.md +110 -0
  69. package/bin/skill/claude-api/shared/model-migration.md +879 -0
  70. package/bin/skill/claude-api/shared/models.md +124 -0
  71. package/bin/skill/claude-api/shared/prompt-caching.md +171 -0
  72. package/bin/skill/claude-api/shared/tool-use-concepts.md +327 -0
  73. package/bin/skill/claude-api/typescript/claude-api/README.md +333 -0
  74. package/bin/skill/claude-api/typescript/claude-api/batches.md +106 -0
  75. package/bin/skill/claude-api/typescript/claude-api/files-api.md +98 -0
  76. package/bin/skill/claude-api/typescript/claude-api/streaming.md +178 -0
  77. package/bin/skill/claude-api/typescript/claude-api/tool-use.md +527 -0
  78. package/bin/skill/claude-api/typescript/managed-agents/README.md +359 -0
  79. package/bin/skill/data-analysis/SKILL.md +79 -0
  80. package/bin/skill/doc-coauthoring/SKILL.md +375 -0
  81. package/bin/skill/docx/LICENSE.txt +30 -0
  82. package/bin/skill/docx/SKILL.md +590 -0
  83. package/bin/skill/docx/scripts/__init__.py +1 -0
  84. package/bin/skill/docx/scripts/accept_changes.py +135 -0
  85. package/bin/skill/docx/scripts/comment.py +318 -0
  86. package/bin/skill/docx/scripts/office/helpers/__init__.py +0 -0
  87. package/bin/skill/docx/scripts/office/helpers/merge_runs.py +199 -0
  88. package/bin/skill/docx/scripts/office/helpers/simplify_redlines.py +197 -0
  89. package/bin/skill/docx/scripts/office/pack.py +159 -0
  90. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  91. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  92. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  93. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  94. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  95. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  96. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  97. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  98. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  99. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  100. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  101. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  102. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  103. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  104. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  105. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  106. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  107. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  108. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  109. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  110. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  111. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  112. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  113. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  114. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  115. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  116. package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  117. package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  118. package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  119. package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  120. package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  121. package/bin/skill/docx/scripts/office/schemas/mce/mc.xsd +75 -0
  122. package/bin/skill/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  123. package/bin/skill/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  124. package/bin/skill/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  125. package/bin/skill/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  126. package/bin/skill/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  127. package/bin/skill/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  128. package/bin/skill/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  129. package/bin/skill/docx/scripts/office/soffice.py +183 -0
  130. package/bin/skill/docx/scripts/office/unpack.py +132 -0
  131. package/bin/skill/docx/scripts/office/validate.py +111 -0
  132. package/bin/skill/docx/scripts/office/validators/__init__.py +15 -0
  133. package/bin/skill/docx/scripts/office/validators/base.py +847 -0
  134. package/bin/skill/docx/scripts/office/validators/docx.py +446 -0
  135. package/bin/skill/docx/scripts/office/validators/pptx.py +275 -0
  136. package/bin/skill/docx/scripts/office/validators/redlining.py +247 -0
  137. package/bin/skill/docx/scripts/templates/comments.xml +3 -0
  138. package/bin/skill/docx/scripts/templates/commentsExtended.xml +3 -0
  139. package/bin/skill/docx/scripts/templates/commentsExtensible.xml +3 -0
  140. package/bin/skill/docx/scripts/templates/commentsIds.xml +3 -0
  141. package/bin/skill/docx/scripts/templates/people.xml +3 -0
  142. package/bin/skill/docx-generation/SKILL.md +160 -0
  143. package/bin/skill/excel-operations/SKILL.md +121 -0
  144. package/bin/skill/frontend-design/SKILL.md +151 -0
  145. package/bin/skill/humanizer/SKILL.md +90 -0
  146. package/bin/skill/internal-comms/LICENSE.txt +202 -0
  147. package/bin/skill/internal-comms/SKILL.md +32 -0
  148. package/bin/skill/internal-comms/examples/3p-updates.md +47 -0
  149. package/bin/skill/internal-comms/examples/company-newsletter.md +65 -0
  150. package/bin/skill/internal-comms/examples/faq-answers.md +30 -0
  151. package/bin/skill/internal-comms/examples/general-comms.md +16 -0
  152. package/bin/skill/mcp-builder/LICENSE.txt +202 -0
  153. package/bin/skill/mcp-builder/SKILL.md +236 -0
  154. package/bin/skill/mcp-builder/reference/evaluation.md +602 -0
  155. package/bin/skill/mcp-builder/reference/mcp_best_practices.md +249 -0
  156. package/bin/skill/mcp-builder/reference/node_mcp_server.md +970 -0
  157. package/bin/skill/mcp-builder/reference/python_mcp_server.md +719 -0
  158. package/bin/skill/mcp-builder/scripts/connections.py +151 -0
  159. package/bin/skill/mcp-builder/scripts/evaluation.py +373 -0
  160. package/bin/skill/mcp-builder/scripts/example_evaluation.xml +22 -0
  161. package/bin/skill/mcp-builder/scripts/requirements.txt +2 -0
  162. package/bin/skill/monitoring-design/SKILL.md +79 -0
  163. package/bin/skill/operational-monitoring/SKILL.md +135 -0
  164. package/bin/skill/operational-monitoring/assets/checklists/archive-self-check.md +54 -0
  165. package/bin/skill/operational-monitoring/assets/schemas/convergence-result-table.csv +5 -0
  166. package/bin/skill/operational-monitoring/assets/schemas/horizontal-result-table.csv +3 -0
  167. package/bin/skill/operational-monitoring/assets/schemas/settlement-result-table.csv +7 -0
  168. package/bin/skill/operational-monitoring/assets/scripts/init-archive-tree.sh +65 -0
  169. package/bin/skill/operational-monitoring/assets/templates/control-network-report.md +102 -0
  170. package/bin/skill/operational-monitoring/assets/templates/daily-log.md +47 -0
  171. package/bin/skill/operational-monitoring/assets/templates/i-angle-check.md +38 -0
  172. package/bin/skill/operational-monitoring/assets/templates/monitoring-scheme.md +234 -0
  173. package/bin/skill/operational-monitoring/assets/templates/period-report.md +95 -0
  174. package/bin/skill/operational-monitoring/assets/templates/point-acceptance-record.md +51 -0
  175. package/bin/skill/operational-monitoring/assets/templates/point-installation-record.md +38 -0
  176. package/bin/skill/operational-monitoring/assets/templates/summary-report.md +89 -0
  177. package/bin/skill/operational-monitoring/assets/templates/warning-bulletin.md +61 -0
  178. package/bin/skill/operational-monitoring/assets/templates/weekly-monthly-report.md +46 -0
  179. package/bin/skill/operational-monitoring/references/archive-and-delivery.md +146 -0
  180. package/bin/skill/operational-monitoring/references/baseline-network.md +131 -0
  181. package/bin/skill/operational-monitoring/references/convergence-monitoring.md +134 -0
  182. package/bin/skill/operational-monitoring/references/data-processing.md +178 -0
  183. package/bin/skill/operational-monitoring/references/horizontal-displacement.md +128 -0
  184. package/bin/skill/operational-monitoring/references/monitoring-points.md +132 -0
  185. package/bin/skill/operational-monitoring/references/monitoring-scheme.md +178 -0
  186. package/bin/skill/operational-monitoring/references/period-report.md +108 -0
  187. package/bin/skill/operational-monitoring/references/regulations-and-frequency.md +127 -0
  188. package/bin/skill/operational-monitoring/references/settlement-monitoring.md +116 -0
  189. package/bin/skill/operational-monitoring/references/summary-report.md +128 -0
  190. package/bin/skill/operational-monitoring/references/warning-and-disposal.md +118 -0
  191. package/bin/skill/pdf/LICENSE.txt +30 -0
  192. package/bin/skill/pdf/SKILL.md +314 -0
  193. package/bin/skill/pdf/forms.md +294 -0
  194. package/bin/skill/pdf/reference.md +612 -0
  195. package/bin/skill/pdf/scripts/check_bounding_boxes.py +65 -0
  196. package/bin/skill/pdf/scripts/check_fillable_fields.py +11 -0
  197. package/bin/skill/pdf/scripts/convert_pdf_to_images.py +33 -0
  198. package/bin/skill/pdf/scripts/create_validation_image.py +37 -0
  199. package/bin/skill/pdf/scripts/extract_form_field_info.py +122 -0
  200. package/bin/skill/pdf/scripts/extract_form_structure.py +115 -0
  201. package/bin/skill/pdf/scripts/fill_fillable_fields.py +98 -0
  202. package/bin/skill/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  203. package/bin/skill/pptx/LICENSE.txt +30 -0
  204. package/bin/skill/pptx/SKILL.md +232 -0
  205. package/bin/skill/pptx/editing.md +205 -0
  206. package/bin/skill/pptx/pptxgenjs.md +420 -0
  207. package/bin/skill/pptx/scripts/__init__.py +0 -0
  208. package/bin/skill/pptx/scripts/add_slide.py +195 -0
  209. package/bin/skill/pptx/scripts/clean.py +286 -0
  210. package/bin/skill/pptx/scripts/office/helpers/__init__.py +0 -0
  211. package/bin/skill/pptx/scripts/office/helpers/merge_runs.py +199 -0
  212. package/bin/skill/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
  213. package/bin/skill/pptx/scripts/office/pack.py +159 -0
  214. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  215. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  216. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  217. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  218. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  219. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  220. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  221. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  222. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  223. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  224. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  225. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  226. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  227. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  228. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  229. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  230. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  231. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  232. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  233. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  234. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  235. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  236. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  237. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  238. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  239. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  240. package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  241. package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  242. package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  243. package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  244. package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  245. package/bin/skill/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
  246. package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  247. package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  248. package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  249. package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  250. package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  251. package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  252. package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  253. package/bin/skill/pptx/scripts/office/soffice.py +183 -0
  254. package/bin/skill/pptx/scripts/office/unpack.py +132 -0
  255. package/bin/skill/pptx/scripts/office/validate.py +111 -0
  256. package/bin/skill/pptx/scripts/office/validators/__init__.py +15 -0
  257. package/bin/skill/pptx/scripts/office/validators/base.py +847 -0
  258. package/bin/skill/pptx/scripts/office/validators/docx.py +446 -0
  259. package/bin/skill/pptx/scripts/office/validators/pptx.py +275 -0
  260. package/bin/skill/pptx/scripts/office/validators/redlining.py +247 -0
  261. package/bin/skill/pptx/scripts/thumbnail.py +289 -0
  262. package/bin/skill/rail-monitoring-plan/SKILL.md +147 -0
  263. package/bin/skill/rail-monitoring-plan/assets/plan-template.md +673 -0
  264. package/bin/skill/rail-monitoring-plan/references/elevated-line.md +319 -0
  265. package/bin/skill/rail-monitoring-plan/references/key-difficulties.md +216 -0
  266. package/bin/skill/rail-monitoring-plan/references/phase0-intake.md +169 -0
  267. package/bin/skill/rail-monitoring-plan/references/phase1-drafting.md +185 -0
  268. package/bin/skill/rail-monitoring-plan/references/phase2-internal-review.md +166 -0
  269. package/bin/skill/rail-monitoring-plan/references/review-checklist.md +140 -0
  270. package/bin/skill/rail-monitoring-plan/references/review-response-template.md +87 -0
  271. package/bin/skill/rail-monitoring-plan/references/scoping-and-pricing.md +214 -0
  272. package/bin/skill/rail-monitoring-plan/references/technical-standards.md +188 -0
  273. package/bin/skill/rail-monitoring-plan/references/toc-template-A.md +142 -0
  274. package/bin/skill/rail-monitoring-plan/references/toc-template-B.md +100 -0
  275. package/bin/skill/report-writing/SKILL.md +103 -0
  276. package/bin/skill/skill-creator/LICENSE.txt +202 -0
  277. package/bin/skill/skill-creator/SKILL.md +485 -0
  278. package/bin/skill/skill-creator/agents/analyzer.md +274 -0
  279. package/bin/skill/skill-creator/agents/comparator.md +202 -0
  280. package/bin/skill/skill-creator/agents/grader.md +223 -0
  281. package/bin/skill/skill-creator/assets/eval_review.html +146 -0
  282. package/bin/skill/skill-creator/eval-viewer/generate_review.py +471 -0
  283. package/bin/skill/skill-creator/eval-viewer/viewer.html +1325 -0
  284. package/bin/skill/skill-creator/references/schemas.md +430 -0
  285. package/bin/skill/skill-creator/scripts/__init__.py +0 -0
  286. package/bin/skill/skill-creator/scripts/aggregate_benchmark.py +401 -0
  287. package/bin/skill/skill-creator/scripts/generate_report.py +326 -0
  288. package/bin/skill/skill-creator/scripts/improve_description.py +247 -0
  289. package/bin/skill/skill-creator/scripts/package_skill.py +136 -0
  290. package/bin/skill/skill-creator/scripts/quick_validate.py +103 -0
  291. package/bin/skill/skill-creator/scripts/run_eval.py +310 -0
  292. package/bin/skill/skill-creator/scripts/run_loop.py +328 -0
  293. package/bin/skill/skill-creator/scripts/utils.py +47 -0
  294. package/bin/skill/slack-gif-creator/LICENSE.txt +202 -0
  295. package/bin/skill/slack-gif-creator/SKILL.md +254 -0
  296. package/bin/skill/slack-gif-creator/core/easing.py +234 -0
  297. package/bin/skill/slack-gif-creator/core/frame_composer.py +176 -0
  298. package/bin/skill/slack-gif-creator/core/gif_builder.py +269 -0
  299. package/bin/skill/slack-gif-creator/core/validators.py +136 -0
  300. package/bin/skill/slack-gif-creator/requirements.txt +4 -0
  301. package/bin/skill/standard-reference/SKILL.md +89 -0
  302. package/bin/skill/theme-factory/LICENSE.txt +202 -0
  303. package/bin/skill/theme-factory/SKILL.md +59 -0
  304. package/bin/skill/theme-factory/theme-showcase.pdf +0 -0
  305. package/bin/skill/theme-factory/themes/arctic-frost.md +19 -0
  306. package/bin/skill/theme-factory/themes/botanical-garden.md +19 -0
  307. package/bin/skill/theme-factory/themes/desert-rose.md +19 -0
  308. package/bin/skill/theme-factory/themes/forest-canopy.md +19 -0
  309. package/bin/skill/theme-factory/themes/golden-hour.md +19 -0
  310. package/bin/skill/theme-factory/themes/midnight-galaxy.md +19 -0
  311. package/bin/skill/theme-factory/themes/modern-minimalist.md +19 -0
  312. package/bin/skill/theme-factory/themes/ocean-depths.md +19 -0
  313. package/bin/skill/theme-factory/themes/sunset-boulevard.md +19 -0
  314. package/bin/skill/theme-factory/themes/tech-innovation.md +19 -0
  315. package/bin/skill/web-artifacts-builder/LICENSE.txt +202 -0
  316. package/bin/skill/web-artifacts-builder/SKILL.md +74 -0
  317. package/bin/skill/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
  318. package/bin/skill/web-artifacts-builder/scripts/init-artifact.sh +322 -0
  319. package/bin/skill/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
  320. package/bin/skill/webapp-testing/LICENSE.txt +202 -0
  321. package/bin/skill/webapp-testing/SKILL.md +96 -0
  322. package/bin/skill/webapp-testing/examples/console_logging.py +35 -0
  323. package/bin/skill/webapp-testing/examples/element_discovery.py +40 -0
  324. package/bin/skill/webapp-testing/examples/static_html_automation.py +33 -0
  325. package/bin/skill/webapp-testing/scripts/with_server.py +106 -0
  326. package/bin/skill/xlsx/LICENSE.txt +30 -0
  327. package/bin/skill/xlsx/SKILL.md +292 -0
  328. package/bin/skill/xlsx/scripts/office/helpers/__init__.py +0 -0
  329. package/bin/skill/xlsx/scripts/office/helpers/merge_runs.py +199 -0
  330. package/bin/skill/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
  331. package/bin/skill/xlsx/scripts/office/pack.py +159 -0
  332. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  333. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  334. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  335. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  336. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  337. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  338. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  339. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  340. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  341. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  342. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  343. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  344. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  345. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  346. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  347. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  348. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  349. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  350. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  351. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  352. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  353. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  354. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  355. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  356. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  357. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  358. package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  359. package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  360. package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  361. package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  362. package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  363. package/bin/skill/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  364. package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  365. package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  366. package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  367. package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  368. package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  369. package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  370. package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  371. package/bin/skill/xlsx/scripts/office/soffice.py +183 -0
  372. package/bin/skill/xlsx/scripts/office/unpack.py +132 -0
  373. package/bin/skill/xlsx/scripts/office/validate.py +111 -0
  374. package/bin/skill/xlsx/scripts/office/validators/__init__.py +15 -0
  375. package/bin/skill/xlsx/scripts/office/validators/base.py +847 -0
  376. package/bin/skill/xlsx/scripts/office/validators/docx.py +446 -0
  377. package/bin/skill/xlsx/scripts/office/validators/pptx.py +275 -0
  378. package/bin/skill/xlsx/scripts/office/validators/redlining.py +247 -0
  379. package/bin/skill/xlsx/scripts/recalc.py +184 -0
  380. package/package.json +14 -0
@@ -0,0 +1,333 @@
1
+ # Claude API — TypeScript
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ npm install @anthropic-ai/sdk
7
+ ```
8
+
9
+ ## Client Initialization
10
+
11
+ ```typescript
12
+ import Anthropic from "@anthropic-ai/sdk";
13
+
14
+ // Default (uses ANTHROPIC_API_KEY env var)
15
+ const client = new Anthropic();
16
+
17
+ // Explicit API key
18
+ const client = new Anthropic({ apiKey: "your-api-key" });
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Basic Message Request
24
+
25
+ ```typescript
26
+ const response = await client.messages.create({
27
+ model: "claude-opus-4-8",
28
+ max_tokens: 16000,
29
+ messages: [{ role: "user", content: "What is the capital of France?" }],
30
+ });
31
+ // response.content is ContentBlock[] — a discriminated union. Narrow by .type
32
+ // before accessing .text (TypeScript will error on content[0].text without this).
33
+ for (const block of response.content) {
34
+ if (block.type === "text") {
35
+ console.log(block.text);
36
+ }
37
+ }
38
+ ```
39
+
40
+ ---
41
+
42
+ ## System Prompts
43
+
44
+ ```typescript
45
+ const response = await client.messages.create({
46
+ model: "claude-opus-4-8",
47
+ max_tokens: 16000,
48
+ system:
49
+ "You are a helpful coding assistant. Always provide examples in Python.",
50
+ messages: [{ role: "user", content: "How do I read a JSON file?" }],
51
+ });
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Vision (Images)
57
+
58
+ ### URL
59
+
60
+ ```typescript
61
+ const response = await client.messages.create({
62
+ model: "claude-opus-4-8",
63
+ max_tokens: 16000,
64
+ messages: [
65
+ {
66
+ role: "user",
67
+ content: [
68
+ {
69
+ type: "image",
70
+ source: { type: "url", url: "https://example.com/image.png" },
71
+ },
72
+ { type: "text", text: "Describe this image" },
73
+ ],
74
+ },
75
+ ],
76
+ });
77
+ ```
78
+
79
+ ### Base64
80
+
81
+ ```typescript
82
+ import fs from "fs";
83
+
84
+ const imageData = fs.readFileSync("image.png").toString("base64");
85
+
86
+ const response = await client.messages.create({
87
+ model: "claude-opus-4-8",
88
+ max_tokens: 16000,
89
+ messages: [
90
+ {
91
+ role: "user",
92
+ content: [
93
+ {
94
+ type: "image",
95
+ source: { type: "base64", media_type: "image/png", data: imageData },
96
+ },
97
+ { type: "text", text: "What's in this image?" },
98
+ ],
99
+ },
100
+ ],
101
+ });
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Prompt Caching
107
+
108
+ **Caching is a prefix match** — any byte change anywhere in the prefix invalidates everything after it. For placement patterns, architectural guidance (frozen system prompt, deterministic tool order, where to put volatile content), and the silent-invalidator audit checklist, read `shared/prompt-caching.md`.
109
+
110
+ ### Automatic Caching (Recommended)
111
+
112
+ Use top-level `cache_control` to automatically cache the last cacheable block in the request:
113
+
114
+ ```typescript
115
+ const response = await client.messages.create({
116
+ model: "claude-opus-4-8",
117
+ max_tokens: 16000,
118
+ cache_control: { type: "ephemeral" }, // auto-caches the last cacheable block
119
+ system: "You are an expert on this large document...",
120
+ messages: [{ role: "user", content: "Summarize the key points" }],
121
+ });
122
+ ```
123
+
124
+ ### Manual Cache Control
125
+
126
+ For fine-grained control, add `cache_control` to specific content blocks:
127
+
128
+ ```typescript
129
+ const response = await client.messages.create({
130
+ model: "claude-opus-4-8",
131
+ max_tokens: 16000,
132
+ system: [
133
+ {
134
+ type: "text",
135
+ text: "You are an expert on this large document...",
136
+ cache_control: { type: "ephemeral" }, // default TTL is 5 minutes
137
+ },
138
+ ],
139
+ messages: [{ role: "user", content: "Summarize the key points" }],
140
+ });
141
+
142
+ // With explicit TTL (time-to-live)
143
+ const response2 = await client.messages.create({
144
+ model: "claude-opus-4-8",
145
+ max_tokens: 16000,
146
+ system: [
147
+ {
148
+ type: "text",
149
+ text: "You are an expert on this large document...",
150
+ cache_control: { type: "ephemeral", ttl: "1h" }, // 1 hour TTL
151
+ },
152
+ ],
153
+ messages: [{ role: "user", content: "Summarize the key points" }],
154
+ });
155
+ ```
156
+
157
+ ### Verifying Cache Hits
158
+
159
+ ```typescript
160
+ console.log(response.usage.cache_creation_input_tokens); // tokens written to cache (~1.25x cost)
161
+ console.log(response.usage.cache_read_input_tokens); // tokens served from cache (~0.1x cost)
162
+ console.log(response.usage.input_tokens); // uncached tokens (full cost)
163
+ ```
164
+
165
+ If `cache_read_input_tokens` is zero across repeated identical-prefix requests, a silent invalidator is at work — `Date.now()` or a UUID in the system prompt, non-deterministic key ordering, or a varying tool set. See `shared/prompt-caching.md` for the full audit table.
166
+
167
+ ---
168
+
169
+ ## Extended Thinking
170
+
171
+ > **Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6:** Use adaptive thinking. `budget_tokens` is removed on Opus 4.8 and 4.7 (400 if sent); deprecated on Opus 4.6 and Sonnet 4.6.
172
+ > **Older models:** Use `thinking: {type: "enabled", budget_tokens: N}` (must be < `max_tokens`, min 1024).
173
+
174
+ ```typescript
175
+ // Opus 4.8 / 4.7 / 4.6: adaptive thinking (recommended)
176
+ const response = await client.messages.create({
177
+ model: "claude-opus-4-8",
178
+ max_tokens: 16000,
179
+ thinking: { type: "adaptive" },
180
+ output_config: { effort: "high" }, // low | medium | high | max
181
+ messages: [
182
+ { role: "user", content: "Solve this math problem step by step..." },
183
+ ],
184
+ });
185
+
186
+ for (const block of response.content) {
187
+ if (block.type === "thinking") {
188
+ console.log("Thinking:", block.thinking);
189
+ } else if (block.type === "text") {
190
+ console.log("Response:", block.text);
191
+ }
192
+ }
193
+ ```
194
+
195
+ ---
196
+
197
+ ## Error Handling
198
+
199
+ Use the SDK's typed exception classes — never check error messages with string matching:
200
+
201
+ ```typescript
202
+ import Anthropic from "@anthropic-ai/sdk";
203
+
204
+ try {
205
+ const response = await client.messages.create({...});
206
+ } catch (error) {
207
+ if (error instanceof Anthropic.BadRequestError) {
208
+ console.error("Bad request:", error.message);
209
+ } else if (error instanceof Anthropic.AuthenticationError) {
210
+ console.error("Invalid API key");
211
+ } else if (error instanceof Anthropic.RateLimitError) {
212
+ console.error("Rate limited - retry later");
213
+ } else if (error instanceof Anthropic.APIError) {
214
+ console.error(`API error ${error.status}:`, error.message);
215
+ }
216
+ }
217
+ ```
218
+
219
+ All classes extend `Anthropic.APIError` with a typed `status` field. Check from most specific to least specific. See [shared/error-codes.md](../../shared/error-codes.md) for the full error code reference.
220
+
221
+ ---
222
+
223
+ ## Multi-Turn Conversations
224
+
225
+ The API is stateless — send the full conversation history each time. Use `Anthropic.MessageParam[]` to type the messages array:
226
+
227
+ ```typescript
228
+ const messages: Anthropic.MessageParam[] = [
229
+ { role: "user", content: "My name is Alice." },
230
+ { role: "assistant", content: "Hello Alice! Nice to meet you." },
231
+ { role: "user", content: "What's my name?" },
232
+ ];
233
+
234
+ const response = await client.messages.create({
235
+ model: "claude-opus-4-8",
236
+ max_tokens: 16000,
237
+ messages: messages,
238
+ });
239
+ ```
240
+
241
+ **Rules:**
242
+
243
+ - Consecutive same-role messages are allowed — the API combines them into a single turn
244
+ - First message must be `user`
245
+ - Use SDK types (`Anthropic.MessageParam`, `Anthropic.Message`, `Anthropic.Tool`, etc.) for all API data structures — don't redefine equivalent interfaces
246
+
247
+ ---
248
+
249
+ ### Compaction (long conversations)
250
+
251
+ > **Beta, Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6.** When conversations approach the 200K context window, compaction automatically summarizes earlier context server-side. The API returns a `compaction` block; you must pass it back on subsequent requests — append `response.content`, not just the text.
252
+
253
+ ```typescript
254
+ import Anthropic from "@anthropic-ai/sdk";
255
+
256
+ const client = new Anthropic();
257
+ const messages: Anthropic.Beta.BetaMessageParam[] = [];
258
+
259
+ async function chat(userMessage: string): Promise<string> {
260
+ messages.push({ role: "user", content: userMessage });
261
+
262
+ const response = await client.beta.messages.create({
263
+ betas: ["compact-2026-01-12"],
264
+ model: "claude-opus-4-8",
265
+ max_tokens: 16000,
266
+ messages,
267
+ context_management: {
268
+ edits: [{ type: "compact_20260112" }],
269
+ },
270
+ });
271
+
272
+ // Append full content — compaction blocks must be preserved
273
+ messages.push({ role: "assistant", content: response.content });
274
+
275
+ const textBlock = response.content.find(
276
+ (b): b is Anthropic.Beta.BetaTextBlock => b.type === "text",
277
+ );
278
+ return textBlock?.text ?? "";
279
+ }
280
+
281
+ // Compaction triggers automatically when context grows large
282
+ console.log(await chat("Help me build a Python web scraper"));
283
+ console.log(await chat("Add support for JavaScript-rendered pages"));
284
+ console.log(await chat("Now add rate limiting and error handling"));
285
+ ```
286
+
287
+ ---
288
+
289
+ ## Stop Reasons
290
+
291
+ The `stop_reason` field in the response indicates why the model stopped generating:
292
+
293
+ | Value | Meaning |
294
+ | --------------- | --------------------------------------------------------------- |
295
+ | `end_turn` | Claude finished its response naturally |
296
+ | `max_tokens` | Hit the `max_tokens` limit — increase it or use streaming |
297
+ | `stop_sequence` | Hit a custom stop sequence |
298
+ | `tool_use` | Claude wants to call a tool — execute it and continue |
299
+ | `pause_turn` | Model paused and can be resumed (agentic flows) |
300
+ | `refusal` | Claude refused for safety reasons — output may not match schema |
301
+
302
+ ---
303
+
304
+ ## Cost Optimization Strategies
305
+
306
+ ### 1. Use Prompt Caching for Repeated Context
307
+
308
+ ```typescript
309
+ // Automatic caching (simplest — caches the last cacheable block)
310
+ const response = await client.messages.create({
311
+ model: "claude-opus-4-8",
312
+ max_tokens: 16000,
313
+ cache_control: { type: "ephemeral" },
314
+ system: largeDocumentText, // e.g., 50KB of context
315
+ messages: [{ role: "user", content: "Summarize the key points" }],
316
+ });
317
+
318
+ // First request: full cost
319
+ // Subsequent requests: ~90% cheaper for cached portion
320
+ ```
321
+
322
+ ### 2. Use Token Counting Before Requests
323
+
324
+ ```typescript
325
+ const countResponse = await client.messages.countTokens({
326
+ model: "claude-opus-4-8",
327
+ messages: messages,
328
+ system: system,
329
+ });
330
+
331
+ const estimatedInputCost = countResponse.input_tokens * 0.000005; // $5/1M tokens
332
+ console.log(`Estimated input cost: $${estimatedInputCost.toFixed(4)}`);
333
+ ```
@@ -0,0 +1,106 @@
1
+ # Message Batches API — TypeScript
2
+
3
+ The Batches API (`POST /v1/messages/batches`) processes Messages API requests asynchronously at 50% of standard prices.
4
+
5
+ ## Key Facts
6
+
7
+ - Up to 100,000 requests or 256 MB per batch
8
+ - Most batches complete within 1 hour; maximum 24 hours
9
+ - Results available for 29 days after creation
10
+ - 50% cost reduction on all token usage
11
+ - All Messages API features supported (vision, tools, caching, etc.)
12
+
13
+ ---
14
+
15
+ ## Create a Batch
16
+
17
+ ```typescript
18
+ import Anthropic from "@anthropic-ai/sdk";
19
+
20
+ const client = new Anthropic();
21
+
22
+ const messageBatch = await client.messages.batches.create({
23
+ requests: [
24
+ {
25
+ custom_id: "request-1",
26
+ params: {
27
+ model: "claude-opus-4-8",
28
+ max_tokens: 16000,
29
+ messages: [
30
+ { role: "user", content: "Summarize climate change impacts" },
31
+ ],
32
+ },
33
+ },
34
+ {
35
+ custom_id: "request-2",
36
+ params: {
37
+ model: "claude-opus-4-8",
38
+ max_tokens: 16000,
39
+ messages: [
40
+ { role: "user", content: "Explain quantum computing basics" },
41
+ ],
42
+ },
43
+ },
44
+ ],
45
+ });
46
+
47
+ console.log(`Batch ID: ${messageBatch.id}`);
48
+ console.log(`Status: ${messageBatch.processing_status}`);
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Poll for Completion
54
+
55
+ ```typescript
56
+ let batch;
57
+ while (true) {
58
+ batch = await client.messages.batches.retrieve(messageBatch.id);
59
+ if (batch.processing_status === "ended") break;
60
+ console.log(
61
+ `Status: ${batch.processing_status}, processing: ${batch.request_counts.processing}`,
62
+ );
63
+ await new Promise((resolve) => setTimeout(resolve, 60_000));
64
+ }
65
+
66
+ console.log("Batch complete!");
67
+ console.log(`Succeeded: ${batch.request_counts.succeeded}`);
68
+ console.log(`Errored: ${batch.request_counts.errored}`);
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Retrieve Results
74
+
75
+ ```typescript
76
+ for await (const result of await client.messages.batches.results(
77
+ messageBatch.id,
78
+ )) {
79
+ switch (result.result.type) {
80
+ case "succeeded":
81
+ console.log(
82
+ `[${result.custom_id}] ${result.result.message.content[0].text.slice(0, 100)}`,
83
+ );
84
+ break;
85
+ case "errored":
86
+ if (result.result.error.type === "invalid_request") {
87
+ console.log(`[${result.custom_id}] Validation error - fix and retry`);
88
+ } else {
89
+ console.log(`[${result.custom_id}] Server error - safe to retry`);
90
+ }
91
+ break;
92
+ case "expired":
93
+ console.log(`[${result.custom_id}] Expired - resubmit`);
94
+ break;
95
+ }
96
+ }
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Cancel a Batch
102
+
103
+ ```typescript
104
+ const cancelled = await client.messages.batches.cancel(messageBatch.id);
105
+ console.log(`Status: ${cancelled.processing_status}`); // "canceling"
106
+ ```
@@ -0,0 +1,98 @@
1
+ # Files API — TypeScript
2
+
3
+ The Files API uploads files for use in Messages API requests. Reference files via `file_id` in content blocks, avoiding re-uploads across multiple API calls.
4
+
5
+ **Beta:** Pass `betas: ["files-api-2025-04-14"]` in your API calls (the SDK sets the required header automatically).
6
+
7
+ ## Key Facts
8
+
9
+ - Maximum file size: 500 MB
10
+ - Total storage: 100 GB per organization
11
+ - Files persist until deleted
12
+ - File operations (upload, list, delete) are free; content used in messages is billed as input tokens
13
+ - Not available on Amazon Bedrock or Google Vertex AI
14
+
15
+ ---
16
+
17
+ ## Upload a File
18
+
19
+ ```typescript
20
+ import Anthropic, { toFile } from "@anthropic-ai/sdk";
21
+ import fs from "fs";
22
+
23
+ const client = new Anthropic();
24
+
25
+ const uploaded = await client.beta.files.upload({
26
+ file: await toFile(fs.createReadStream("report.pdf"), undefined, {
27
+ type: "application/pdf",
28
+ }),
29
+ betas: ["files-api-2025-04-14"],
30
+ });
31
+
32
+ console.log(`File ID: ${uploaded.id}`);
33
+ console.log(`Size: ${uploaded.size_bytes} bytes`);
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Use a File in Messages
39
+
40
+ ### PDF / Text Document
41
+
42
+ ```typescript
43
+ const response = await client.beta.messages.create({
44
+ model: "claude-opus-4-8",
45
+ max_tokens: 16000,
46
+ messages: [
47
+ {
48
+ role: "user",
49
+ content: [
50
+ { type: "text", text: "Summarize the key findings in this report." },
51
+ {
52
+ type: "document",
53
+ source: { type: "file", file_id: uploaded.id },
54
+ title: "Q4 Report",
55
+ citations: { enabled: true },
56
+ },
57
+ ],
58
+ },
59
+ ],
60
+ betas: ["files-api-2025-04-14"],
61
+ });
62
+
63
+ console.log(response.content[0].text);
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Manage Files
69
+
70
+ ### List Files
71
+
72
+ ```typescript
73
+ const files = await client.beta.files.list({
74
+ betas: ["files-api-2025-04-14"],
75
+ });
76
+ for (const f of files.data) {
77
+ console.log(`${f.id}: ${f.filename} (${f.size_bytes} bytes)`);
78
+ }
79
+ ```
80
+
81
+ ### Delete a File
82
+
83
+ ```typescript
84
+ await client.beta.files.delete("file_011CNha8iCJcU1wXNR6q4V8w", {
85
+ betas: ["files-api-2025-04-14"],
86
+ });
87
+ ```
88
+
89
+ ### Download a File
90
+
91
+ ```typescript
92
+ const response = await client.beta.files.download(
93
+ "file_011CNha8iCJcU1wXNR6q4V8w",
94
+ { betas: ["files-api-2025-04-14"] },
95
+ );
96
+ const content = Buffer.from(await response.arrayBuffer());
97
+ await fs.promises.writeFile("output.txt", content);
98
+ ```
@@ -0,0 +1,178 @@
1
+ # Streaming — TypeScript
2
+
3
+ ## Quick Start
4
+
5
+ ```typescript
6
+ const stream = client.messages.stream({
7
+ model: "claude-opus-4-8",
8
+ max_tokens: 64000,
9
+ messages: [{ role: "user", content: "Write a story" }],
10
+ });
11
+
12
+ for await (const event of stream) {
13
+ if (
14
+ event.type === "content_block_delta" &&
15
+ event.delta.type === "text_delta"
16
+ ) {
17
+ process.stdout.write(event.delta.text);
18
+ }
19
+ }
20
+ ```
21
+
22
+ ---
23
+
24
+ ## Handling Different Content Types
25
+
26
+ > **Opus 4.8 / Opus 4.7 / Opus 4.6:** Use `thinking: {type: "adaptive"}`. On older models, use `thinking: {type: "enabled", budget_tokens: N}` instead.
27
+
28
+ ```typescript
29
+ const stream = client.messages.stream({
30
+ model: "claude-opus-4-8",
31
+ max_tokens: 64000,
32
+ thinking: { type: "adaptive" },
33
+ messages: [{ role: "user", content: "Analyze this problem" }],
34
+ });
35
+
36
+ for await (const event of stream) {
37
+ switch (event.type) {
38
+ case "content_block_start":
39
+ switch (event.content_block.type) {
40
+ case "thinking":
41
+ console.log("\n[Thinking...]");
42
+ break;
43
+ case "text":
44
+ console.log("\n[Response:]");
45
+ break;
46
+ }
47
+ break;
48
+ case "content_block_delta":
49
+ switch (event.delta.type) {
50
+ case "thinking_delta":
51
+ process.stdout.write(event.delta.thinking);
52
+ break;
53
+ case "text_delta":
54
+ process.stdout.write(event.delta.text);
55
+ break;
56
+ }
57
+ break;
58
+ }
59
+ }
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Streaming with Tool Use (Tool Runner)
65
+
66
+ Use the tool runner with `stream: true`. The outer loop iterates over tool runner iterations (messages), the inner loop processes stream events:
67
+
68
+ ```typescript
69
+ import Anthropic from "@anthropic-ai/sdk";
70
+ import { betaZodTool } from "@anthropic-ai/sdk/helpers/beta/zod";
71
+ import { z } from "zod";
72
+
73
+ const client = new Anthropic();
74
+
75
+ const getWeather = betaZodTool({
76
+ name: "get_weather",
77
+ description: "Get current weather for a location",
78
+ inputSchema: z.object({
79
+ location: z.string().describe("City and state, e.g., San Francisco, CA"),
80
+ }),
81
+ run: async ({ location }) => `72°F and sunny in ${location}`,
82
+ });
83
+
84
+ const runner = client.beta.messages.toolRunner({
85
+ model: "claude-opus-4-8",
86
+ max_tokens: 64000,
87
+ tools: [getWeather],
88
+ messages: [
89
+ { role: "user", content: "What's the weather in Paris and London?" },
90
+ ],
91
+ stream: true,
92
+ });
93
+
94
+ // Outer loop: each tool runner iteration
95
+ for await (const messageStream of runner) {
96
+ // Inner loop: stream events for this iteration
97
+ for await (const event of messageStream) {
98
+ switch (event.type) {
99
+ case "content_block_delta":
100
+ switch (event.delta.type) {
101
+ case "text_delta":
102
+ process.stdout.write(event.delta.text);
103
+ break;
104
+ case "input_json_delta":
105
+ // Tool input being streamed
106
+ break;
107
+ }
108
+ break;
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Getting the Final Message
117
+
118
+ ```typescript
119
+ const stream = client.messages.stream({
120
+ model: "claude-opus-4-8",
121
+ max_tokens: 64000,
122
+ messages: [{ role: "user", content: "Hello" }],
123
+ });
124
+
125
+ for await (const event of stream) {
126
+ // Process events...
127
+ }
128
+
129
+ const finalMessage = await stream.finalMessage();
130
+ console.log(`Tokens used: ${finalMessage.usage.output_tokens}`);
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Stream Event Types
136
+
137
+ | Event Type | Description | When it fires |
138
+ | --------------------- | --------------------------- | --------------------------------- |
139
+ | `message_start` | Contains message metadata | Once at the beginning |
140
+ | `content_block_start` | New content block beginning | When a text/tool_use block starts |
141
+ | `content_block_delta` | Incremental content update | For each token/chunk |
142
+ | `content_block_stop` | Content block complete | When a block finishes |
143
+ | `message_delta` | Message-level updates | Contains `stop_reason`, usage |
144
+ | `message_stop` | Message complete | Once at the end |
145
+
146
+ ## Best Practices
147
+
148
+ 1. **Always flush output** — Use `process.stdout.write()` for immediate display
149
+ 2. **Handle partial responses** — If the stream is interrupted, you may have incomplete content
150
+ 3. **Track token usage** — The `message_delta` event contains usage information
151
+ 4. **Use `finalMessage()`** — Get the complete `Anthropic.Message` object even when streaming. Don't wrap `.on()` events in `new Promise()` — `finalMessage()` handles all completion/error/abort states internally
152
+ 5. **Buffer for web UIs** — Consider buffering a few tokens before rendering to avoid excessive DOM updates
153
+ 6. **Use `stream.on("text", ...)` for deltas** — The `text` event provides just the delta string, simpler than manually filtering `content_block_delta` events
154
+ 7. **For agentic loops with streaming** — See the [Streaming Manual Loop](./tool-use.md#streaming-manual-loop) section in tool-use.md for combining `stream()` + `finalMessage()` with a tool-use loop
155
+
156
+ ## Raw SSE Format
157
+
158
+ If using raw HTTP (not SDKs), the stream returns Server-Sent Events:
159
+
160
+ ```
161
+ event: message_start
162
+ data: {"type":"message_start","message":{"id":"msg_...","type":"message",...}}
163
+
164
+ event: content_block_start
165
+ data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
166
+
167
+ event: content_block_delta
168
+ data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}
169
+
170
+ event: content_block_stop
171
+ data: {"type":"content_block_stop","index":0}
172
+
173
+ event: message_delta
174
+ data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":12}}
175
+
176
+ event: message_stop
177
+ data: {"type":"message_stop"}
178
+ ```