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.
- package/bin/agent/adjustment_computer.md +44 -0
- package/bin/agent/chief_manager.md +82 -0
- package/bin/agent/commercial_specialist.md +39 -0
- package/bin/agent/cpiii_specialist.md +42 -0
- package/bin/agent/data_analyst.md +55 -0
- package/bin/agent/knowledge_curator.md +41 -0
- package/bin/agent/norm_librarian.md +38 -0
- package/bin/agent/qa_inspector.md +58 -0
- package/bin/agent/qa_reviewer.md +49 -0
- package/bin/agent/solution_architect.md +44 -0
- package/bin/agent/source_ingestor.md +38 -0
- package/bin/agent/technical_writer.md +50 -0
- package/bin/command/bid-prepare.md +21 -0
- package/bin/command/daily-report.md +20 -0
- package/bin/command/data-check.md +19 -0
- package/bin/command/emergency-response.md +62 -0
- package/bin/command/monthly-report.md +32 -0
- package/bin/command/payment-reminder.md +22 -0
- package/bin/command/safety-check.md +18 -0
- package/bin/command/trend-analysis.md +35 -0
- package/bin/railwise +0 -0
- package/bin/railwise.json +4 -0
- package/bin/rw +2 -0
- package/bin/skill/THIRD_PARTY_NOTICES.md +405 -0
- package/bin/skill/algorithmic-art/LICENSE.txt +202 -0
- package/bin/skill/algorithmic-art/SKILL.md +405 -0
- package/bin/skill/algorithmic-art/templates/generator_template.js +223 -0
- package/bin/skill/algorithmic-art/templates/viewer.html +599 -0
- package/bin/skill/bidding-knowledge/SKILL.md +67 -0
- package/bin/skill/brand-guidelines/LICENSE.txt +202 -0
- package/bin/skill/brand-guidelines/SKILL.md +73 -0
- package/bin/skill/bun-file-io/SKILL.md +42 -0
- package/bin/skill/canvas-design/SKILL.md +141 -0
- package/bin/skill/claude-api/LICENSE.txt +202 -0
- package/bin/skill/claude-api/SKILL.md +325 -0
- package/bin/skill/claude-api/csharp/claude-api.md +402 -0
- package/bin/skill/claude-api/curl/examples.md +216 -0
- package/bin/skill/claude-api/curl/managed-agents.md +336 -0
- package/bin/skill/claude-api/go/claude-api.md +421 -0
- package/bin/skill/claude-api/go/managed-agents/README.md +561 -0
- package/bin/skill/claude-api/java/claude-api.md +432 -0
- package/bin/skill/claude-api/java/managed-agents/README.md +442 -0
- package/bin/skill/claude-api/php/claude-api.md +375 -0
- package/bin/skill/claude-api/php/managed-agents/README.md +435 -0
- package/bin/skill/claude-api/python/claude-api/README.md +420 -0
- package/bin/skill/claude-api/python/claude-api/batches.md +185 -0
- package/bin/skill/claude-api/python/claude-api/files-api.md +165 -0
- package/bin/skill/claude-api/python/claude-api/streaming.md +162 -0
- package/bin/skill/claude-api/python/claude-api/tool-use.md +590 -0
- package/bin/skill/claude-api/python/managed-agents/README.md +332 -0
- package/bin/skill/claude-api/ruby/claude-api.md +113 -0
- package/bin/skill/claude-api/ruby/managed-agents/README.md +389 -0
- package/bin/skill/claude-api/shared/agent-design.md +101 -0
- package/bin/skill/claude-api/shared/error-codes.md +213 -0
- package/bin/skill/claude-api/shared/live-sources.md +135 -0
- package/bin/skill/claude-api/shared/managed-agents-api-reference.md +378 -0
- package/bin/skill/claude-api/shared/managed-agents-client-patterns.md +209 -0
- package/bin/skill/claude-api/shared/managed-agents-core.md +238 -0
- package/bin/skill/claude-api/shared/managed-agents-environments.md +215 -0
- package/bin/skill/claude-api/shared/managed-agents-events.md +195 -0
- package/bin/skill/claude-api/shared/managed-agents-memory.md +197 -0
- package/bin/skill/claude-api/shared/managed-agents-multiagent.md +99 -0
- package/bin/skill/claude-api/shared/managed-agents-onboarding.md +114 -0
- package/bin/skill/claude-api/shared/managed-agents-outcomes.md +106 -0
- package/bin/skill/claude-api/shared/managed-agents-overview.md +68 -0
- package/bin/skill/claude-api/shared/managed-agents-self-hosted-sandboxes.md +173 -0
- package/bin/skill/claude-api/shared/managed-agents-tools.md +321 -0
- package/bin/skill/claude-api/shared/managed-agents-webhooks.md +110 -0
- package/bin/skill/claude-api/shared/model-migration.md +879 -0
- package/bin/skill/claude-api/shared/models.md +124 -0
- package/bin/skill/claude-api/shared/prompt-caching.md +171 -0
- package/bin/skill/claude-api/shared/tool-use-concepts.md +327 -0
- package/bin/skill/claude-api/typescript/claude-api/README.md +333 -0
- package/bin/skill/claude-api/typescript/claude-api/batches.md +106 -0
- package/bin/skill/claude-api/typescript/claude-api/files-api.md +98 -0
- package/bin/skill/claude-api/typescript/claude-api/streaming.md +178 -0
- package/bin/skill/claude-api/typescript/claude-api/tool-use.md +527 -0
- package/bin/skill/claude-api/typescript/managed-agents/README.md +359 -0
- package/bin/skill/data-analysis/SKILL.md +79 -0
- package/bin/skill/doc-coauthoring/SKILL.md +375 -0
- package/bin/skill/docx/LICENSE.txt +30 -0
- package/bin/skill/docx/SKILL.md +590 -0
- package/bin/skill/docx/scripts/__init__.py +1 -0
- package/bin/skill/docx/scripts/accept_changes.py +135 -0
- package/bin/skill/docx/scripts/comment.py +318 -0
- package/bin/skill/docx/scripts/office/helpers/__init__.py +0 -0
- package/bin/skill/docx/scripts/office/helpers/merge_runs.py +199 -0
- package/bin/skill/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/bin/skill/docx/scripts/office/pack.py +159 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/bin/skill/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/bin/skill/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/bin/skill/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/bin/skill/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/bin/skill/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/bin/skill/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/bin/skill/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/bin/skill/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/bin/skill/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/bin/skill/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/bin/skill/docx/scripts/office/soffice.py +183 -0
- package/bin/skill/docx/scripts/office/unpack.py +132 -0
- package/bin/skill/docx/scripts/office/validate.py +111 -0
- package/bin/skill/docx/scripts/office/validators/__init__.py +15 -0
- package/bin/skill/docx/scripts/office/validators/base.py +847 -0
- package/bin/skill/docx/scripts/office/validators/docx.py +446 -0
- package/bin/skill/docx/scripts/office/validators/pptx.py +275 -0
- package/bin/skill/docx/scripts/office/validators/redlining.py +247 -0
- package/bin/skill/docx/scripts/templates/comments.xml +3 -0
- package/bin/skill/docx/scripts/templates/commentsExtended.xml +3 -0
- package/bin/skill/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/bin/skill/docx/scripts/templates/commentsIds.xml +3 -0
- package/bin/skill/docx/scripts/templates/people.xml +3 -0
- package/bin/skill/docx-generation/SKILL.md +160 -0
- package/bin/skill/excel-operations/SKILL.md +121 -0
- package/bin/skill/frontend-design/SKILL.md +151 -0
- package/bin/skill/humanizer/SKILL.md +90 -0
- package/bin/skill/internal-comms/LICENSE.txt +202 -0
- package/bin/skill/internal-comms/SKILL.md +32 -0
- package/bin/skill/internal-comms/examples/3p-updates.md +47 -0
- package/bin/skill/internal-comms/examples/company-newsletter.md +65 -0
- package/bin/skill/internal-comms/examples/faq-answers.md +30 -0
- package/bin/skill/internal-comms/examples/general-comms.md +16 -0
- package/bin/skill/mcp-builder/LICENSE.txt +202 -0
- package/bin/skill/mcp-builder/SKILL.md +236 -0
- package/bin/skill/mcp-builder/reference/evaluation.md +602 -0
- package/bin/skill/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/bin/skill/mcp-builder/reference/node_mcp_server.md +970 -0
- package/bin/skill/mcp-builder/reference/python_mcp_server.md +719 -0
- package/bin/skill/mcp-builder/scripts/connections.py +151 -0
- package/bin/skill/mcp-builder/scripts/evaluation.py +373 -0
- package/bin/skill/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/bin/skill/mcp-builder/scripts/requirements.txt +2 -0
- package/bin/skill/monitoring-design/SKILL.md +79 -0
- package/bin/skill/operational-monitoring/SKILL.md +135 -0
- package/bin/skill/operational-monitoring/assets/checklists/archive-self-check.md +54 -0
- package/bin/skill/operational-monitoring/assets/schemas/convergence-result-table.csv +5 -0
- package/bin/skill/operational-monitoring/assets/schemas/horizontal-result-table.csv +3 -0
- package/bin/skill/operational-monitoring/assets/schemas/settlement-result-table.csv +7 -0
- package/bin/skill/operational-monitoring/assets/scripts/init-archive-tree.sh +65 -0
- package/bin/skill/operational-monitoring/assets/templates/control-network-report.md +102 -0
- package/bin/skill/operational-monitoring/assets/templates/daily-log.md +47 -0
- package/bin/skill/operational-monitoring/assets/templates/i-angle-check.md +38 -0
- package/bin/skill/operational-monitoring/assets/templates/monitoring-scheme.md +234 -0
- package/bin/skill/operational-monitoring/assets/templates/period-report.md +95 -0
- package/bin/skill/operational-monitoring/assets/templates/point-acceptance-record.md +51 -0
- package/bin/skill/operational-monitoring/assets/templates/point-installation-record.md +38 -0
- package/bin/skill/operational-monitoring/assets/templates/summary-report.md +89 -0
- package/bin/skill/operational-monitoring/assets/templates/warning-bulletin.md +61 -0
- package/bin/skill/operational-monitoring/assets/templates/weekly-monthly-report.md +46 -0
- package/bin/skill/operational-monitoring/references/archive-and-delivery.md +146 -0
- package/bin/skill/operational-monitoring/references/baseline-network.md +131 -0
- package/bin/skill/operational-monitoring/references/convergence-monitoring.md +134 -0
- package/bin/skill/operational-monitoring/references/data-processing.md +178 -0
- package/bin/skill/operational-monitoring/references/horizontal-displacement.md +128 -0
- package/bin/skill/operational-monitoring/references/monitoring-points.md +132 -0
- package/bin/skill/operational-monitoring/references/monitoring-scheme.md +178 -0
- package/bin/skill/operational-monitoring/references/period-report.md +108 -0
- package/bin/skill/operational-monitoring/references/regulations-and-frequency.md +127 -0
- package/bin/skill/operational-monitoring/references/settlement-monitoring.md +116 -0
- package/bin/skill/operational-monitoring/references/summary-report.md +128 -0
- package/bin/skill/operational-monitoring/references/warning-and-disposal.md +118 -0
- package/bin/skill/pdf/LICENSE.txt +30 -0
- package/bin/skill/pdf/SKILL.md +314 -0
- package/bin/skill/pdf/forms.md +294 -0
- package/bin/skill/pdf/reference.md +612 -0
- package/bin/skill/pdf/scripts/check_bounding_boxes.py +65 -0
- package/bin/skill/pdf/scripts/check_fillable_fields.py +11 -0
- package/bin/skill/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/bin/skill/pdf/scripts/create_validation_image.py +37 -0
- package/bin/skill/pdf/scripts/extract_form_field_info.py +122 -0
- package/bin/skill/pdf/scripts/extract_form_structure.py +115 -0
- package/bin/skill/pdf/scripts/fill_fillable_fields.py +98 -0
- package/bin/skill/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/bin/skill/pptx/LICENSE.txt +30 -0
- package/bin/skill/pptx/SKILL.md +232 -0
- package/bin/skill/pptx/editing.md +205 -0
- package/bin/skill/pptx/pptxgenjs.md +420 -0
- package/bin/skill/pptx/scripts/__init__.py +0 -0
- package/bin/skill/pptx/scripts/add_slide.py +195 -0
- package/bin/skill/pptx/scripts/clean.py +286 -0
- package/bin/skill/pptx/scripts/office/helpers/__init__.py +0 -0
- package/bin/skill/pptx/scripts/office/helpers/merge_runs.py +199 -0
- package/bin/skill/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/bin/skill/pptx/scripts/office/pack.py +159 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/bin/skill/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/bin/skill/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/bin/skill/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/bin/skill/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/bin/skill/pptx/scripts/office/soffice.py +183 -0
- package/bin/skill/pptx/scripts/office/unpack.py +132 -0
- package/bin/skill/pptx/scripts/office/validate.py +111 -0
- package/bin/skill/pptx/scripts/office/validators/__init__.py +15 -0
- package/bin/skill/pptx/scripts/office/validators/base.py +847 -0
- package/bin/skill/pptx/scripts/office/validators/docx.py +446 -0
- package/bin/skill/pptx/scripts/office/validators/pptx.py +275 -0
- package/bin/skill/pptx/scripts/office/validators/redlining.py +247 -0
- package/bin/skill/pptx/scripts/thumbnail.py +289 -0
- package/bin/skill/rail-monitoring-plan/SKILL.md +147 -0
- package/bin/skill/rail-monitoring-plan/assets/plan-template.md +673 -0
- package/bin/skill/rail-monitoring-plan/references/elevated-line.md +319 -0
- package/bin/skill/rail-monitoring-plan/references/key-difficulties.md +216 -0
- package/bin/skill/rail-monitoring-plan/references/phase0-intake.md +169 -0
- package/bin/skill/rail-monitoring-plan/references/phase1-drafting.md +185 -0
- package/bin/skill/rail-monitoring-plan/references/phase2-internal-review.md +166 -0
- package/bin/skill/rail-monitoring-plan/references/review-checklist.md +140 -0
- package/bin/skill/rail-monitoring-plan/references/review-response-template.md +87 -0
- package/bin/skill/rail-monitoring-plan/references/scoping-and-pricing.md +214 -0
- package/bin/skill/rail-monitoring-plan/references/technical-standards.md +188 -0
- package/bin/skill/rail-monitoring-plan/references/toc-template-A.md +142 -0
- package/bin/skill/rail-monitoring-plan/references/toc-template-B.md +100 -0
- package/bin/skill/report-writing/SKILL.md +103 -0
- package/bin/skill/skill-creator/LICENSE.txt +202 -0
- package/bin/skill/skill-creator/SKILL.md +485 -0
- package/bin/skill/skill-creator/agents/analyzer.md +274 -0
- package/bin/skill/skill-creator/agents/comparator.md +202 -0
- package/bin/skill/skill-creator/agents/grader.md +223 -0
- package/bin/skill/skill-creator/assets/eval_review.html +146 -0
- package/bin/skill/skill-creator/eval-viewer/generate_review.py +471 -0
- package/bin/skill/skill-creator/eval-viewer/viewer.html +1325 -0
- package/bin/skill/skill-creator/references/schemas.md +430 -0
- package/bin/skill/skill-creator/scripts/__init__.py +0 -0
- package/bin/skill/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/bin/skill/skill-creator/scripts/generate_report.py +326 -0
- package/bin/skill/skill-creator/scripts/improve_description.py +247 -0
- package/bin/skill/skill-creator/scripts/package_skill.py +136 -0
- package/bin/skill/skill-creator/scripts/quick_validate.py +103 -0
- package/bin/skill/skill-creator/scripts/run_eval.py +310 -0
- package/bin/skill/skill-creator/scripts/run_loop.py +328 -0
- package/bin/skill/skill-creator/scripts/utils.py +47 -0
- package/bin/skill/slack-gif-creator/LICENSE.txt +202 -0
- package/bin/skill/slack-gif-creator/SKILL.md +254 -0
- package/bin/skill/slack-gif-creator/core/easing.py +234 -0
- package/bin/skill/slack-gif-creator/core/frame_composer.py +176 -0
- package/bin/skill/slack-gif-creator/core/gif_builder.py +269 -0
- package/bin/skill/slack-gif-creator/core/validators.py +136 -0
- package/bin/skill/slack-gif-creator/requirements.txt +4 -0
- package/bin/skill/standard-reference/SKILL.md +89 -0
- package/bin/skill/theme-factory/LICENSE.txt +202 -0
- package/bin/skill/theme-factory/SKILL.md +59 -0
- package/bin/skill/theme-factory/theme-showcase.pdf +0 -0
- package/bin/skill/theme-factory/themes/arctic-frost.md +19 -0
- package/bin/skill/theme-factory/themes/botanical-garden.md +19 -0
- package/bin/skill/theme-factory/themes/desert-rose.md +19 -0
- package/bin/skill/theme-factory/themes/forest-canopy.md +19 -0
- package/bin/skill/theme-factory/themes/golden-hour.md +19 -0
- package/bin/skill/theme-factory/themes/midnight-galaxy.md +19 -0
- package/bin/skill/theme-factory/themes/modern-minimalist.md +19 -0
- package/bin/skill/theme-factory/themes/ocean-depths.md +19 -0
- package/bin/skill/theme-factory/themes/sunset-boulevard.md +19 -0
- package/bin/skill/theme-factory/themes/tech-innovation.md +19 -0
- package/bin/skill/web-artifacts-builder/LICENSE.txt +202 -0
- package/bin/skill/web-artifacts-builder/SKILL.md +74 -0
- package/bin/skill/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/bin/skill/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/bin/skill/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/bin/skill/webapp-testing/LICENSE.txt +202 -0
- package/bin/skill/webapp-testing/SKILL.md +96 -0
- package/bin/skill/webapp-testing/examples/console_logging.py +35 -0
- package/bin/skill/webapp-testing/examples/element_discovery.py +40 -0
- package/bin/skill/webapp-testing/examples/static_html_automation.py +33 -0
- package/bin/skill/webapp-testing/scripts/with_server.py +106 -0
- package/bin/skill/xlsx/LICENSE.txt +30 -0
- package/bin/skill/xlsx/SKILL.md +292 -0
- package/bin/skill/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/bin/skill/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/bin/skill/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/bin/skill/xlsx/scripts/office/pack.py +159 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/bin/skill/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/bin/skill/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/bin/skill/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/bin/skill/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/bin/skill/xlsx/scripts/office/soffice.py +183 -0
- package/bin/skill/xlsx/scripts/office/unpack.py +132 -0
- package/bin/skill/xlsx/scripts/office/validate.py +111 -0
- package/bin/skill/xlsx/scripts/office/validators/__init__.py +15 -0
- package/bin/skill/xlsx/scripts/office/validators/base.py +847 -0
- package/bin/skill/xlsx/scripts/office/validators/docx.py +446 -0
- package/bin/skill/xlsx/scripts/office/validators/pptx.py +275 -0
- package/bin/skill/xlsx/scripts/office/validators/redlining.py +247 -0
- package/bin/skill/xlsx/scripts/recalc.py +184 -0
- package/package.json +14 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
# Claude API — Go
|
|
2
|
+
|
|
3
|
+
> **Note:** The Go SDK supports the Claude API and beta tool use with `BetaToolRunner`. Agent SDK is not yet available for Go.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
go get github.com/anthropics/anthropic-sdk-go
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Client Initialization
|
|
12
|
+
|
|
13
|
+
```go
|
|
14
|
+
import (
|
|
15
|
+
"github.com/anthropics/anthropic-sdk-go"
|
|
16
|
+
"github.com/anthropics/anthropic-sdk-go/option"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
// Default (uses ANTHROPIC_API_KEY env var)
|
|
20
|
+
client := anthropic.NewClient()
|
|
21
|
+
|
|
22
|
+
// Explicit API key
|
|
23
|
+
client := anthropic.NewClient(
|
|
24
|
+
option.WithAPIKey("your-api-key"),
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Basic Message Request
|
|
31
|
+
|
|
32
|
+
```go
|
|
33
|
+
response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
|
|
34
|
+
Model: anthropic.ModelClaudeOpus4_6,
|
|
35
|
+
MaxTokens: 16000,
|
|
36
|
+
Messages: []anthropic.MessageParam{
|
|
37
|
+
anthropic.NewUserMessage(anthropic.NewTextBlock("What is the capital of France?")),
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
if err != nil {
|
|
41
|
+
log.Fatal(err)
|
|
42
|
+
}
|
|
43
|
+
for _, block := range response.Content {
|
|
44
|
+
switch variant := block.AsAny().(type) {
|
|
45
|
+
case anthropic.TextBlock:
|
|
46
|
+
fmt.Println(variant.Text)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Streaming
|
|
54
|
+
|
|
55
|
+
```go
|
|
56
|
+
stream := client.Messages.NewStreaming(context.Background(), anthropic.MessageNewParams{
|
|
57
|
+
Model: anthropic.ModelClaudeOpus4_6,
|
|
58
|
+
MaxTokens: 64000,
|
|
59
|
+
Messages: []anthropic.MessageParam{
|
|
60
|
+
anthropic.NewUserMessage(anthropic.NewTextBlock("Write a haiku")),
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
for stream.Next() {
|
|
65
|
+
event := stream.Current()
|
|
66
|
+
switch eventVariant := event.AsAny().(type) {
|
|
67
|
+
case anthropic.ContentBlockDeltaEvent:
|
|
68
|
+
switch deltaVariant := eventVariant.Delta.AsAny().(type) {
|
|
69
|
+
case anthropic.TextDelta:
|
|
70
|
+
fmt.Print(deltaVariant.Text)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if err := stream.Err(); err != nil {
|
|
75
|
+
log.Fatal(err)
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Accumulating the final message** (there is no `GetFinalMessage()` on the stream):
|
|
80
|
+
|
|
81
|
+
```go
|
|
82
|
+
stream := client.Messages.NewStreaming(ctx, params)
|
|
83
|
+
message := anthropic.Message{}
|
|
84
|
+
for stream.Next() {
|
|
85
|
+
message.Accumulate(stream.Current())
|
|
86
|
+
}
|
|
87
|
+
if err := stream.Err(); err != nil { log.Fatal(err) }
|
|
88
|
+
// message.Content now has the complete response
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Tool Use
|
|
95
|
+
|
|
96
|
+
### Tool Runner (Beta — Recommended)
|
|
97
|
+
|
|
98
|
+
**Beta:** The Go SDK provides `BetaToolRunner` for automatic tool use loops via the `toolrunner` package.
|
|
99
|
+
|
|
100
|
+
```go
|
|
101
|
+
import (
|
|
102
|
+
"context"
|
|
103
|
+
"fmt"
|
|
104
|
+
"log"
|
|
105
|
+
|
|
106
|
+
"github.com/anthropics/anthropic-sdk-go"
|
|
107
|
+
"github.com/anthropics/anthropic-sdk-go/toolrunner"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
// Define tool input with jsonschema tags for automatic schema generation
|
|
111
|
+
type GetWeatherInput struct {
|
|
112
|
+
City string `json:"city" jsonschema:"required,description=The city name"`
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Create a tool with automatic schema generation from struct tags
|
|
116
|
+
weatherTool, err := toolrunner.NewBetaToolFromJSONSchema(
|
|
117
|
+
"get_weather",
|
|
118
|
+
"Get current weather for a city",
|
|
119
|
+
func(ctx context.Context, input GetWeatherInput) (anthropic.BetaToolResultBlockParamContentUnion, error) {
|
|
120
|
+
return anthropic.BetaToolResultBlockParamContentUnion{
|
|
121
|
+
OfText: &anthropic.BetaTextBlockParam{
|
|
122
|
+
Text: fmt.Sprintf("The weather in %s is sunny, 72°F", input.City),
|
|
123
|
+
},
|
|
124
|
+
}, nil
|
|
125
|
+
},
|
|
126
|
+
)
|
|
127
|
+
if err != nil {
|
|
128
|
+
log.Fatal(err)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Create a tool runner that handles the conversation loop automatically
|
|
132
|
+
runner := client.Beta.Messages.NewToolRunner(
|
|
133
|
+
[]anthropic.BetaTool{weatherTool},
|
|
134
|
+
anthropic.BetaToolRunnerParams{
|
|
135
|
+
BetaMessageNewParams: anthropic.BetaMessageNewParams{
|
|
136
|
+
Model: anthropic.ModelClaudeOpus4_6,
|
|
137
|
+
MaxTokens: 16000,
|
|
138
|
+
Messages: []anthropic.BetaMessageParam{
|
|
139
|
+
anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("What's the weather in Paris?")),
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
MaxIterations: 5,
|
|
143
|
+
},
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
// Run until Claude produces a final response
|
|
147
|
+
message, err := runner.RunToCompletion(context.Background())
|
|
148
|
+
if err != nil {
|
|
149
|
+
log.Fatal(err)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// RunToCompletion returns *BetaMessage; content is []BetaContentBlockUnion.
|
|
153
|
+
// Narrow via AsAny() switch — note the Beta-namespace types (BetaTextBlock,
|
|
154
|
+
// not TextBlock):
|
|
155
|
+
for _, block := range message.Content {
|
|
156
|
+
switch block := block.AsAny().(type) {
|
|
157
|
+
case anthropic.BetaTextBlock:
|
|
158
|
+
fmt.Println(block.Text)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Key features of the Go tool runner:**
|
|
164
|
+
|
|
165
|
+
- Automatic schema generation from Go structs via `jsonschema` tags
|
|
166
|
+
- `RunToCompletion()` for simple one-shot usage
|
|
167
|
+
- `All()` iterator for processing each message in the conversation
|
|
168
|
+
- `NextMessage()` for step-by-step iteration
|
|
169
|
+
- Streaming variant via `NewToolRunnerStreaming()` with `AllStreaming()`
|
|
170
|
+
|
|
171
|
+
### Manual Loop
|
|
172
|
+
|
|
173
|
+
For fine-grained control over the agentic loop, define tools with `ToolParam`, check `StopReason`, execute tools yourself, and feed `tool_result` blocks back. This is the pattern when you need to intercept, validate, or log tool calls.
|
|
174
|
+
|
|
175
|
+
Derived from `anthropic-sdk-go/examples/tools/main.go`.
|
|
176
|
+
|
|
177
|
+
```go
|
|
178
|
+
package main
|
|
179
|
+
|
|
180
|
+
import (
|
|
181
|
+
"context"
|
|
182
|
+
"encoding/json"
|
|
183
|
+
"fmt"
|
|
184
|
+
"log"
|
|
185
|
+
|
|
186
|
+
"github.com/anthropics/anthropic-sdk-go"
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
func main() {
|
|
190
|
+
client := anthropic.NewClient()
|
|
191
|
+
|
|
192
|
+
// 1. Define tools. ToolParam.InputSchema uses a map, no struct tags needed.
|
|
193
|
+
addTool := anthropic.ToolParam{
|
|
194
|
+
Name: "add",
|
|
195
|
+
Description: anthropic.String("Add two integers"),
|
|
196
|
+
InputSchema: anthropic.ToolInputSchemaParam{
|
|
197
|
+
Properties: map[string]any{
|
|
198
|
+
"a": map[string]any{"type": "integer"},
|
|
199
|
+
"b": map[string]any{"type": "integer"},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
}
|
|
203
|
+
// ToolParam must be wrapped in ToolUnionParam for the Tools slice
|
|
204
|
+
tools := []anthropic.ToolUnionParam{{OfTool: &addTool}}
|
|
205
|
+
|
|
206
|
+
messages := []anthropic.MessageParam{
|
|
207
|
+
anthropic.NewUserMessage(anthropic.NewTextBlock("What is 2 + 3?")),
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
for {
|
|
211
|
+
resp, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
|
|
212
|
+
Model: anthropic.ModelClaudeSonnet4_6,
|
|
213
|
+
MaxTokens: 16000,
|
|
214
|
+
Messages: messages,
|
|
215
|
+
Tools: tools,
|
|
216
|
+
})
|
|
217
|
+
if err != nil {
|
|
218
|
+
log.Fatal(err)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// 2. Append the assistant response to history BEFORE processing tool calls.
|
|
222
|
+
// resp.ToParam() converts Message → MessageParam in one call.
|
|
223
|
+
messages = append(messages, resp.ToParam())
|
|
224
|
+
|
|
225
|
+
// 3. Walk content blocks. ContentBlockUnion is a flattened struct;
|
|
226
|
+
// use block.AsAny().(type) to switch on the actual variant.
|
|
227
|
+
toolResults := []anthropic.ContentBlockParamUnion{}
|
|
228
|
+
for _, block := range resp.Content {
|
|
229
|
+
switch variant := block.AsAny().(type) {
|
|
230
|
+
case anthropic.TextBlock:
|
|
231
|
+
fmt.Println(variant.Text)
|
|
232
|
+
case anthropic.ToolUseBlock:
|
|
233
|
+
// 4. Parse the tool input. Use variant.JSON.Input.Raw() to get the
|
|
234
|
+
// raw JSON — block.Input is json.RawMessage, not the parsed value.
|
|
235
|
+
var in struct {
|
|
236
|
+
A int `json:"a"`
|
|
237
|
+
B int `json:"b"`
|
|
238
|
+
}
|
|
239
|
+
if err := json.Unmarshal([]byte(variant.JSON.Input.Raw()), &in); err != nil {
|
|
240
|
+
log.Fatal(err)
|
|
241
|
+
}
|
|
242
|
+
result := fmt.Sprintf("%d", in.A+in.B)
|
|
243
|
+
// 5. NewToolResultBlock(toolUseID, content, isError) builds the
|
|
244
|
+
// ContentBlockParamUnion for you. block.ID is the tool_use_id.
|
|
245
|
+
toolResults = append(toolResults,
|
|
246
|
+
anthropic.NewToolResultBlock(block.ID, result, false))
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// 6. Exit when Claude stops asking for tools
|
|
251
|
+
if resp.StopReason != anthropic.StopReasonToolUse {
|
|
252
|
+
break
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 7. Tool results go in a user message (variadic: all results in one turn)
|
|
256
|
+
messages = append(messages, anthropic.NewUserMessage(toolResults...))
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**Key API surface:**
|
|
262
|
+
|
|
263
|
+
| Symbol | Purpose |
|
|
264
|
+
|---|---|
|
|
265
|
+
| `resp.ToParam()` | Convert `Message` response → `MessageParam` for history |
|
|
266
|
+
| `block.AsAny().(type)` | Type-switch on `ContentBlockUnion` variants |
|
|
267
|
+
| `variant.JSON.Input.Raw()` | Raw JSON string of tool input (for `json.Unmarshal`) |
|
|
268
|
+
| `anthropic.NewToolResultBlock(id, content, isError)` | Build `tool_result` block |
|
|
269
|
+
| `anthropic.NewUserMessage(blocks...)` | Wrap tool results as a user turn |
|
|
270
|
+
| `anthropic.StopReasonToolUse` | `StopReason` constant to check loop termination |
|
|
271
|
+
| `anthropic.ToolUnionParam{OfTool: &t}` | Wrap `ToolParam` in the union for `Tools:` |
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Thinking
|
|
276
|
+
|
|
277
|
+
Enable Claude's internal reasoning by setting `Thinking` in `MessageNewParams`. The response will contain `ThinkingBlock` content before the final `TextBlock`.
|
|
278
|
+
|
|
279
|
+
**Adaptive thinking is the recommended mode for Claude 4.6+ models.** Claude decides dynamically when and how much to think. Combine with the `effort` parameter for cost-quality control.
|
|
280
|
+
|
|
281
|
+
Derived from `anthropic-sdk-go/message.go` (`ThinkingConfigParamUnion`, `NewThinkingConfigAdaptiveParam`).
|
|
282
|
+
|
|
283
|
+
```go
|
|
284
|
+
// There is no ThinkingConfigParamOfAdaptive helper — construct the union
|
|
285
|
+
// struct-literal directly and take the address of the variant.
|
|
286
|
+
adaptive := anthropic.NewThinkingConfigAdaptiveParam()
|
|
287
|
+
params := anthropic.MessageNewParams{
|
|
288
|
+
Model: anthropic.ModelClaudeSonnet4_6,
|
|
289
|
+
MaxTokens: 16000,
|
|
290
|
+
Thinking: anthropic.ThinkingConfigParamUnion{OfAdaptive: &adaptive},
|
|
291
|
+
Messages: []anthropic.MessageParam{
|
|
292
|
+
anthropic.NewUserMessage(anthropic.NewTextBlock("How many r's in strawberry?")),
|
|
293
|
+
},
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
resp, err := client.Messages.New(context.Background(), params)
|
|
297
|
+
if err != nil {
|
|
298
|
+
log.Fatal(err)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// ThinkingBlock(s) precede TextBlock in content
|
|
302
|
+
for _, block := range resp.Content {
|
|
303
|
+
switch b := block.AsAny().(type) {
|
|
304
|
+
case anthropic.ThinkingBlock:
|
|
305
|
+
fmt.Println("[thinking]", b.Thinking)
|
|
306
|
+
case anthropic.TextBlock:
|
|
307
|
+
fmt.Println(b.Text)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
> **Deprecated:** `ThinkingConfigParamOfEnabled(budgetTokens)` (fixed-budget extended thinking) still works on Claude 4.6 but is deprecated. Use adaptive thinking above.
|
|
313
|
+
|
|
314
|
+
To disable: `anthropic.ThinkingConfigParamUnion{OfDisabled: &anthropic.ThinkingConfigDisabledParam{}}`.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Prompt Caching
|
|
319
|
+
|
|
320
|
+
`System` is `[]TextBlockParam`; set `CacheControl` on the last block to cache tools + system together. For placement patterns and the silent-invalidator audit checklist, see `shared/prompt-caching.md`.
|
|
321
|
+
|
|
322
|
+
```go
|
|
323
|
+
System: []anthropic.TextBlockParam{{
|
|
324
|
+
Text: longSystemPrompt,
|
|
325
|
+
CacheControl: anthropic.NewCacheControlEphemeralParam(), // default 5m TTL
|
|
326
|
+
}},
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
For 1-hour TTL: `anthropic.CacheControlEphemeralParam{TTL: anthropic.CacheControlEphemeralTTLTTL1h}`. There's also a top-level `CacheControl` on `MessageNewParams` that auto-places on the last cacheable block.
|
|
330
|
+
|
|
331
|
+
Verify hits via `resp.Usage.CacheCreationInputTokens` / `resp.Usage.CacheReadInputTokens`.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Server-Side Tools
|
|
336
|
+
|
|
337
|
+
Version-suffixed struct names with `Param` suffix. `Name`/`Type` are `constant.*` types — zero value marshals correctly, so `{}` works. Wrap in `ToolUnionParam` with the matching `Of*` field.
|
|
338
|
+
|
|
339
|
+
```go
|
|
340
|
+
Tools: []anthropic.ToolUnionParam{
|
|
341
|
+
{OfWebSearchTool20260209: &anthropic.WebSearchTool20260209Param{}},
|
|
342
|
+
{OfBashTool20250124: &anthropic.ToolBash20250124Param{}},
|
|
343
|
+
{OfTextEditor20250728: &anthropic.ToolTextEditor20250728Param{}},
|
|
344
|
+
{OfCodeExecutionTool20260120: &anthropic.CodeExecutionTool20260120Param{}},
|
|
345
|
+
},
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Also available: `WebFetchTool20260209Param`, `MemoryTool20250818Param`, `ToolSearchToolBm25_20251119Param`, `ToolSearchToolRegex20251119Param`.
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## PDF / Document Input
|
|
353
|
+
|
|
354
|
+
`NewDocumentBlock` generic helper accepts any source type. `MediaType`/`Type` are auto-set.
|
|
355
|
+
|
|
356
|
+
```go
|
|
357
|
+
b64 := base64.StdEncoding.EncodeToString(pdfBytes)
|
|
358
|
+
|
|
359
|
+
msg := anthropic.NewUserMessage(
|
|
360
|
+
anthropic.NewDocumentBlock(anthropic.Base64PDFSourceParam{Data: b64}),
|
|
361
|
+
anthropic.NewTextBlock("Summarize this document"),
|
|
362
|
+
)
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Other sources: `URLPDFSourceParam{URL: "https://..."}`, `PlainTextSourceParam{Data: "..."}`.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Files API (Beta)
|
|
370
|
+
|
|
371
|
+
Under `client.Beta.Files`. Method is **`Upload`** (NOT `New`/`Create`), params struct is `BetaFileUploadParams`. The `File` field takes an `io.Reader`; use `anthropic.File()` to attach a filename + content-type for the multipart encoding.
|
|
372
|
+
|
|
373
|
+
```go
|
|
374
|
+
f, _ := os.Open("./upload_me.txt")
|
|
375
|
+
defer f.Close()
|
|
376
|
+
|
|
377
|
+
meta, err := client.Beta.Files.Upload(ctx, anthropic.BetaFileUploadParams{
|
|
378
|
+
File: anthropic.File(f, "upload_me.txt", "text/plain"),
|
|
379
|
+
Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
|
|
380
|
+
})
|
|
381
|
+
// meta.ID is the file_id to reference in subsequent message requests
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Other `Beta.Files` methods: `List`, `Delete`, `Download`, `GetMetadata`.
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Context Editing / Compaction (Beta)
|
|
389
|
+
|
|
390
|
+
Use `Beta.Messages.New` with `ContextManagement` on `BetaMessageNewParams`. There is no `NewBetaAssistantMessage` — use `.ToParam()` for the round-trip.
|
|
391
|
+
|
|
392
|
+
```go
|
|
393
|
+
params := anthropic.BetaMessageNewParams{
|
|
394
|
+
Model: anthropic.ModelClaudeOpus4_6, // also supported: ModelClaudeSonnet4_6
|
|
395
|
+
MaxTokens: 16000,
|
|
396
|
+
Betas: []anthropic.AnthropicBeta{"compact-2026-01-12"},
|
|
397
|
+
ContextManagement: anthropic.BetaContextManagementConfigParam{
|
|
398
|
+
Edits: []anthropic.BetaContextManagementConfigEditUnionParam{
|
|
399
|
+
{OfCompact20260112: &anthropic.BetaCompact20260112EditParam{}},
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
Messages: []anthropic.BetaMessageParam{ /* ... */ },
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
resp, err := client.Beta.Messages.New(ctx, params)
|
|
406
|
+
if err != nil {
|
|
407
|
+
log.Fatal(err)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Round-trip: append response to history via .ToParam()
|
|
411
|
+
params.Messages = append(params.Messages, resp.ToParam())
|
|
412
|
+
|
|
413
|
+
// Read compaction blocks from the response
|
|
414
|
+
for _, block := range resp.Content {
|
|
415
|
+
if c, ok := block.AsAny().(anthropic.BetaCompactionBlock); ok {
|
|
416
|
+
fmt.Println("compaction summary:", c.Content)
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Other edit types: `BetaClearToolUses20250919EditParam`, `BetaClearThinking20251015EditParam`.
|