@preapexis/piexis 0.1.2

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 (348) hide show
  1. package/.github/workflows/npm-publish.yml +63 -0
  2. package/AGENTS.md +58 -0
  3. package/PERMISSION_MODES_PLAN.md +279 -0
  4. package/README.md +207 -0
  5. package/WHAT_YOU_GET.md +153 -0
  6. package/eval/README.md +72 -0
  7. package/eval/permission-cases.json +28 -0
  8. package/eval/permissions.mjs +103 -0
  9. package/extensions/ask-question.ts +111 -0
  10. package/extensions/background-tasks.ts +433 -0
  11. package/extensions/background-worker.ts +50 -0
  12. package/extensions/glob.ts +32 -0
  13. package/extensions/mode.ts +397 -0
  14. package/extensions/ui.ts +134 -0
  15. package/lib/bash-approvals.ts +113 -0
  16. package/lib/bash-policy.ts +164 -0
  17. package/lib/mode-policy.ts +174 -0
  18. package/lib/path-policy.ts +182 -0
  19. package/lib/permission-classifier.ts +128 -0
  20. package/lib/permission-config.ts +91 -0
  21. package/lib/permission-denials.ts +32 -0
  22. package/lib/permission-intent.ts +128 -0
  23. package/lib/permission-taxonomy.ts +15 -0
  24. package/lib/task-broker.ts +65 -0
  25. package/lib/task-checkout.ts +39 -0
  26. package/lib/task-git.ts +44 -0
  27. package/lib/task-patch.ts +106 -0
  28. package/lib/task-permissions.ts +51 -0
  29. package/lib/task-report.ts +62 -0
  30. package/lib/task-worktree-policy.ts +56 -0
  31. package/package.json +51 -0
  32. package/prompts/commit.md +7 -0
  33. package/prompts/init.md +66 -0
  34. package/prompts/summary.md +14 -0
  35. package/skills/claude-api/LICENSE.txt +202 -0
  36. package/skills/claude-api/SKILL.md +572 -0
  37. package/skills/claude-api/csharp/claude-api/README.md +362 -0
  38. package/skills/claude-api/csharp/claude-api/batches.md +14 -0
  39. package/skills/claude-api/csharp/claude-api/files-api.md +25 -0
  40. package/skills/claude-api/csharp/claude-api/streaming.md +28 -0
  41. package/skills/claude-api/csharp/claude-api/tool-use.md +164 -0
  42. package/skills/claude-api/curl/examples.md +256 -0
  43. package/skills/claude-api/curl/managed-agents.md +371 -0
  44. package/skills/claude-api/go/claude-api/README.md +188 -0
  45. package/skills/claude-api/go/claude-api/files-api.md +23 -0
  46. package/skills/claude-api/go/claude-api/streaming.md +43 -0
  47. package/skills/claude-api/go/claude-api/tool-use.md +220 -0
  48. package/skills/claude-api/go/managed-agents/README.md +564 -0
  49. package/skills/claude-api/java/claude-api/README.md +238 -0
  50. package/skills/claude-api/java/claude-api/files-api.md +27 -0
  51. package/skills/claude-api/java/claude-api/streaming.md +24 -0
  52. package/skills/claude-api/java/claude-api/tool-use.md +228 -0
  53. package/skills/claude-api/java/managed-agents/README.md +443 -0
  54. package/skills/claude-api/php/claude-api/README.md +174 -0
  55. package/skills/claude-api/php/claude-api/batches.md +15 -0
  56. package/skills/claude-api/php/claude-api/files-api.md +13 -0
  57. package/skills/claude-api/php/claude-api/streaming.md +27 -0
  58. package/skills/claude-api/php/claude-api/tool-use.md +253 -0
  59. package/skills/claude-api/php/managed-agents/README.md +443 -0
  60. package/skills/claude-api/python/claude-api/README.md +565 -0
  61. package/skills/claude-api/python/claude-api/batches.md +198 -0
  62. package/skills/claude-api/python/claude-api/files-api.md +170 -0
  63. package/skills/claude-api/python/claude-api/sdk-upgrade.md +286 -0
  64. package/skills/claude-api/python/claude-api/streaming.md +179 -0
  65. package/skills/claude-api/python/claude-api/tool-use.md +627 -0
  66. package/skills/claude-api/python/managed-agents/README.md +335 -0
  67. package/skills/claude-api/ruby/claude-api/README.md +134 -0
  68. package/skills/claude-api/ruby/claude-api/streaming.md +16 -0
  69. package/skills/claude-api/ruby/claude-api/tool-use.md +41 -0
  70. package/skills/claude-api/ruby/managed-agents/README.md +394 -0
  71. package/skills/claude-api/shared/admin-api.md +179 -0
  72. package/skills/claude-api/shared/agent-design.md +101 -0
  73. package/skills/claude-api/shared/anthropic-cli.md +269 -0
  74. package/skills/claude-api/shared/claude-platform-on-aws.md +59 -0
  75. package/skills/claude-api/shared/cost-optimization.md +233 -0
  76. package/skills/claude-api/shared/error-codes.md +262 -0
  77. package/skills/claude-api/shared/live-sources.md +166 -0
  78. package/skills/claude-api/shared/managed-agents-api-reference.md +455 -0
  79. package/skills/claude-api/shared/managed-agents-client-patterns.md +220 -0
  80. package/skills/claude-api/shared/managed-agents-core.md +359 -0
  81. package/skills/claude-api/shared/managed-agents-environments.md +226 -0
  82. package/skills/claude-api/shared/managed-agents-events.md +290 -0
  83. package/skills/claude-api/shared/managed-agents-memory.md +201 -0
  84. package/skills/claude-api/shared/managed-agents-multiagent.md +260 -0
  85. package/skills/claude-api/shared/managed-agents-onboarding.md +82 -0
  86. package/skills/claude-api/shared/managed-agents-outcomes.md +108 -0
  87. package/skills/claude-api/shared/managed-agents-overview.md +77 -0
  88. package/skills/claude-api/shared/managed-agents-scheduled-deployments.md +156 -0
  89. package/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +282 -0
  90. package/skills/claude-api/shared/managed-agents-tools.md +504 -0
  91. package/skills/claude-api/shared/managed-agents-webhooks.md +143 -0
  92. package/skills/claude-api/shared/model-migration.md +1872 -0
  93. package/skills/claude-api/shared/models.md +142 -0
  94. package/skills/claude-api/shared/platform-availability.md +53 -0
  95. package/skills/claude-api/shared/prompt-audit.md +223 -0
  96. package/skills/claude-api/shared/prompt-caching.md +292 -0
  97. package/skills/claude-api/shared/token-counting.md +56 -0
  98. package/skills/claude-api/shared/tool-use-concepts.md +526 -0
  99. package/skills/claude-api/typescript/claude-api/README.md +405 -0
  100. package/skills/claude-api/typescript/claude-api/batches.md +106 -0
  101. package/skills/claude-api/typescript/claude-api/files-api.md +98 -0
  102. package/skills/claude-api/typescript/claude-api/streaming.md +178 -0
  103. package/skills/claude-api/typescript/claude-api/tool-use.md +586 -0
  104. package/skills/claude-api/typescript/managed-agents/README.md +359 -0
  105. package/skills/code-review/SKILL.md +34 -0
  106. package/skills/code-review/agents/openai.yaml +3 -0
  107. package/skills/codebase-design/DEEPENING.md +37 -0
  108. package/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  109. package/skills/codebase-design/SKILL.md +40 -0
  110. package/skills/diagnosing-bugs/SKILL.md +38 -0
  111. package/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  112. package/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  113. package/skills/docx/LICENSE.txt +30 -0
  114. package/skills/docx/SKILL.md +93 -0
  115. package/skills/docx/scripts/__init__.py +1 -0
  116. package/skills/docx/scripts/accept_changes.py +135 -0
  117. package/skills/docx/scripts/comment.py +368 -0
  118. package/skills/docx/scripts/merge_runs.py +310 -0
  119. package/skills/docx/scripts/office/helpers/__init__.py +111 -0
  120. package/skills/docx/scripts/office/helpers/pptx_chart.py +170 -0
  121. package/skills/docx/scripts/office/helpers/pptx_slide.py +60 -0
  122. package/skills/docx/scripts/office/helpers/pptx_theme.py +114 -0
  123. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  124. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  125. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  126. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  127. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  128. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  129. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  130. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  131. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  132. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  133. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  134. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  135. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  136. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  137. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  138. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  139. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  140. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  141. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  142. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  143. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  144. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  145. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  146. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  147. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  148. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  149. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  150. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  151. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  152. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  153. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  154. package/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
  155. package/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  156. package/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  157. package/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  158. package/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  159. package/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  160. package/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  161. package/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  162. package/skills/docx/scripts/office/soffice.py +192 -0
  163. package/skills/docx/scripts/office/validate.py +173 -0
  164. package/skills/docx/scripts/office/validators/__init__.py +15 -0
  165. package/skills/docx/scripts/office/validators/base.py +875 -0
  166. package/skills/docx/scripts/office/validators/docx.py +466 -0
  167. package/skills/docx/scripts/office/validators/pptx.py +441 -0
  168. package/skills/docx/scripts/office/validators/redlining.py +299 -0
  169. package/skills/docx/scripts/templates/comments.xml +3 -0
  170. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  171. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  172. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  173. package/skills/docx/scripts/templates/people.xml +3 -0
  174. package/skills/frontend-design/LICENSE.txt +177 -0
  175. package/skills/frontend-design/SKILL.md +27 -0
  176. package/skills/grilling/SKILL.md +41 -0
  177. package/skills/lean-build/SKILL.md +22 -0
  178. package/skills/lean-build/agents/openai.yaml +4 -0
  179. package/skills/mcp-builder/LICENSE.txt +202 -0
  180. package/skills/mcp-builder/SKILL.md +235 -0
  181. package/skills/mcp-builder/reference/evaluation.md +602 -0
  182. package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  183. package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  184. package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  185. package/skills/mcp-builder/scripts/connections.py +151 -0
  186. package/skills/mcp-builder/scripts/evaluation.py +373 -0
  187. package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  188. package/skills/mcp-builder/scripts/requirements.txt +2 -0
  189. package/skills/migration/SKILL.md +17 -0
  190. package/skills/migration/agents/openai.yaml +4 -0
  191. package/skills/pdf/LICENSE.txt +30 -0
  192. package/skills/pdf/SKILL.md +27 -0
  193. package/skills/pdf/forms.md +294 -0
  194. package/skills/pdf/reference.md +612 -0
  195. package/skills/pdf/scripts/check_bounding_boxes.py +65 -0
  196. package/skills/pdf/scripts/check_fillable_fields.py +11 -0
  197. package/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
  198. package/skills/pdf/scripts/create_validation_image.py +37 -0
  199. package/skills/pdf/scripts/extract_form_field_info.py +122 -0
  200. package/skills/pdf/scripts/extract_form_structure.py +115 -0
  201. package/skills/pdf/scripts/fill_fillable_fields.py +98 -0
  202. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  203. package/skills/pptx/LICENSE.txt +30 -0
  204. package/skills/pptx/SKILL.md +240 -0
  205. package/skills/pptx/scripts/__init__.py +0 -0
  206. package/skills/pptx/scripts/add_slide.py +367 -0
  207. package/skills/pptx/scripts/clean.py +309 -0
  208. package/skills/pptx/scripts/office/helpers/__init__.py +111 -0
  209. package/skills/pptx/scripts/office/helpers/pptx_chart.py +170 -0
  210. package/skills/pptx/scripts/office/helpers/pptx_slide.py +60 -0
  211. package/skills/pptx/scripts/office/helpers/pptx_theme.py +114 -0
  212. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  213. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  214. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  215. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  216. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  217. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  218. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  219. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  220. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  221. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  222. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  223. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  224. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  225. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  226. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  227. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  228. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  229. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  230. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  231. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  232. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  233. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  234. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  235. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  236. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  237. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  238. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  239. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  240. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  241. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  242. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  243. package/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
  244. package/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  245. package/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  246. package/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  247. package/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  248. package/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  249. package/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  250. package/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  251. package/skills/pptx/scripts/office/soffice.py +192 -0
  252. package/skills/pptx/scripts/office/validate.py +173 -0
  253. package/skills/pptx/scripts/office/validators/__init__.py +15 -0
  254. package/skills/pptx/scripts/office/validators/base.py +875 -0
  255. package/skills/pptx/scripts/office/validators/docx.py +466 -0
  256. package/skills/pptx/scripts/office/validators/pptx.py +441 -0
  257. package/skills/pptx/scripts/office/validators/redlining.py +299 -0
  258. package/skills/pptx/scripts/thumbnail.py +311 -0
  259. package/skills/safe-refactor/SKILL.md +16 -0
  260. package/skills/safe-refactor/agents/openai.yaml +4 -0
  261. package/skills/tdd/SKILL.md +18 -0
  262. package/skills/tdd/agents/openai.yaml +3 -0
  263. package/skills/tdd/mocking.md +59 -0
  264. package/skills/tdd/tests.md +77 -0
  265. package/skills/verify-and-stop/SKILL.md +16 -0
  266. package/skills/verify-and-stop/agents/openai.yaml +4 -0
  267. package/skills/webapp-testing/LICENSE.txt +202 -0
  268. package/skills/webapp-testing/SKILL.md +96 -0
  269. package/skills/webapp-testing/examples/console_logging.py +35 -0
  270. package/skills/webapp-testing/examples/element_discovery.py +40 -0
  271. package/skills/webapp-testing/examples/static_html_automation.py +33 -0
  272. package/skills/webapp-testing/scripts/with_server.py +106 -0
  273. package/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  274. package/skills/writing-for-agents/SKILL.md +28 -0
  275. package/skills/writing-for-agents/agents/openai.yaml +3 -0
  276. package/skills/xlsx/LICENSE.txt +30 -0
  277. package/skills/xlsx/SKILL.md +101 -0
  278. package/skills/xlsx/scripts/office/helpers/__init__.py +111 -0
  279. package/skills/xlsx/scripts/office/helpers/pptx_chart.py +170 -0
  280. package/skills/xlsx/scripts/office/helpers/pptx_slide.py +60 -0
  281. package/skills/xlsx/scripts/office/helpers/pptx_theme.py +114 -0
  282. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  283. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  284. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  285. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  286. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  287. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  288. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  289. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  290. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  291. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  292. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  293. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  294. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  295. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  296. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  297. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  298. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  299. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  300. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  301. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  302. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  303. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  304. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  305. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  306. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  307. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  308. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  309. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  310. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  311. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  312. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  313. package/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  314. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  315. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  316. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  317. package/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  318. package/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  319. package/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  320. package/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  321. package/skills/xlsx/scripts/office/soffice.py +192 -0
  322. package/skills/xlsx/scripts/office/validate.py +173 -0
  323. package/skills/xlsx/scripts/office/validators/__init__.py +15 -0
  324. package/skills/xlsx/scripts/office/validators/base.py +875 -0
  325. package/skills/xlsx/scripts/office/validators/docx.py +466 -0
  326. package/skills/xlsx/scripts/office/validators/pptx.py +441 -0
  327. package/skills/xlsx/scripts/office/validators/redlining.py +299 -0
  328. package/skills/xlsx/scripts/recalc.py +308 -0
  329. package/skills-lock.json +359 -0
  330. package/tests/auto-permissions.test.mjs +315 -0
  331. package/tests/background-tasks.test.mjs +27 -0
  332. package/tests/background-worker.test.mjs +60 -0
  333. package/tests/bash-permissions.test.mjs +276 -0
  334. package/tests/glob.test.mjs +31 -0
  335. package/tests/mode.test.mjs +62 -0
  336. package/tests/permission-evaluation.test.mjs +70 -0
  337. package/tests/permission-foundation.test.mjs +194 -0
  338. package/tests/permission-policy.test.mjs +158 -0
  339. package/tests/runtime/README.md +51 -0
  340. package/tests/runtime/harness.mjs +190 -0
  341. package/tests/runtime/permissions.test.mjs +192 -0
  342. package/tests/runtime/tui.test.mjs +60 -0
  343. package/tests/skills-routing.test.mjs +51 -0
  344. package/tests/task-integration.test.mjs +324 -0
  345. package/tests/task-permissions.test.mjs +178 -0
  346. package/tests/task-worktree-policy.test.mjs +53 -0
  347. package/themes/orange.json +82 -0
  348. package/tsconfig.json +13 -0
@@ -0,0 +1,564 @@
1
+ # Managed Agents - Go
2
+
3
+ > **Bindings not shown here:** This README covers the most common managed-agents flows for Go. If you need a class, method, namespace, field, or behavior that isn't shown, WebFetch the Go SDK repo **or the relevant docs page** from `shared/live-sources.md` rather than guess. Do not extrapolate from cURL shapes or another language's SDK.
4
+
5
+ > **Agents are persistent - create once, reference by ID.** Store the agent ID returned by `agents.New` and pass it to every subsequent `sessions.New`; do not call `agents.New` in the request path. **Recommended:** define agents and environments as version-controlled YAML applied with the `ant` CLI - see `shared/anthropic-cli.md` (its live-docs URL is in `shared/live-sources.md`). The CLI owns the control plane (create/update); your code owns the data plane (sessions with the stored ID). The examples below show in-code creation for when you must provision programmatically; in production the create call belongs in setup, not in the request path.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ go get github.com/anthropics/anthropic-sdk-go
11
+ ```
12
+
13
+ ## Client Initialization
14
+
15
+ ```go
16
+ import (
17
+ "context"
18
+
19
+ "github.com/anthropics/anthropic-sdk-go"
20
+ "github.com/anthropics/anthropic-sdk-go/option"
21
+ )
22
+
23
+ // Default (uses ANTHROPIC_API_KEY env var)
24
+ client := anthropic.NewClient()
25
+
26
+ // Explicit API key
27
+ client := anthropic.NewClient(
28
+ option.WithAPIKey("your-api-key"),
29
+ )
30
+
31
+ ctx := context.Background()
32
+ ```
33
+
34
+ ---
35
+
36
+ ## Create an Environment
37
+
38
+ ```go
39
+ environment, err := client.Beta.Environments.New(ctx, anthropic.BetaEnvironmentNewParams{
40
+ Name: "my-dev-env",
41
+ Config: anthropic.BetaEnvironmentNewParamsConfigUnion{
42
+ OfCloud: &anthropic.BetaCloudConfigParams{
43
+ Networking: anthropic.BetaCloudConfigParamsNetworkingUnion{
44
+ OfUnrestricted: &anthropic.BetaUnrestrictedNetworkParam{},
45
+ },
46
+ },
47
+ },
48
+ })
49
+ if err != nil {
50
+ panic(err)
51
+ }
52
+ fmt.Println(environment.ID) // env_...
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Create an Agent (required first step)
58
+
59
+ > Warning: **There is no inline agent config.** `Model`/`System`/`Tools` live on the agent object, not the session. Always start with `Beta.Agents.New()` - the session only takes `Agent: anthropic.BetaSessionNewParamsAgentUnion{OfString: anthropic.String(agent.ID)}` (or the typed `OfBetaManagedAgentsAgents` variant when you need a specific version).
60
+
61
+ ### Minimal
62
+
63
+ ```go
64
+ // 1. Create the agent (reusable, versioned)
65
+ agent, err := client.Beta.Agents.New(ctx, anthropic.BetaAgentNewParams{
66
+ Name: "Coding Assistant",
67
+ Model: anthropic.BetaManagedAgentsModelConfigParams{
68
+ ID: "claude-opus-5",
69
+ Type: anthropic.BetaManagedAgentsModelConfigParamsTypeModelConfig,
70
+ },
71
+ System: anthropic.String("You are a helpful coding assistant."),
72
+ Tools: []anthropic.BetaAgentNewParamsToolUnion{{
73
+ OfAgentToolset20260401: &anthropic.BetaManagedAgentsAgentToolset20260401Params{
74
+ Type: anthropic.BetaManagedAgentsAgentToolset20260401ParamsTypeAgentToolset20260401,
75
+ },
76
+ }},
77
+ })
78
+ if err != nil {
79
+ panic(err)
80
+ }
81
+
82
+ // 2. Start a session
83
+ session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{
84
+ Agent: anthropic.BetaSessionNewParamsAgentUnion{
85
+ OfBetaManagedAgentsAgents: &anthropic.BetaManagedAgentsAgentParams{
86
+ Type: anthropic.BetaManagedAgentsAgentParamsTypeAgent,
87
+ ID: agent.ID,
88
+ Version: anthropic.Int(agent.Version),
89
+ },
90
+ },
91
+ EnvironmentID: environment.ID,
92
+ Title: anthropic.String("Quickstart session"),
93
+ })
94
+ if err != nil {
95
+ panic(err)
96
+ }
97
+ fmt.Printf("Session ID: %s, status: %s\n", session.ID, session.Status)
98
+ fmt.Printf("Trace: https://platform.claude.com/workspaces/default/sessions/%s\n", session.ID) // swap 'default' for your workspace ID if the API key is not in the Default workspace
99
+ ```
100
+
101
+ ### Updating an Agent
102
+
103
+ Updates create new versions; the agent object is immutable per version.
104
+
105
+ ```go
106
+ updatedAgent, err := client.Beta.Agents.Update(ctx, agent.ID, anthropic.BetaAgentUpdateParams{
107
+ Version: agent.Version,
108
+ System: anthropic.String("You are a helpful coding agent. Always write tests."),
109
+ })
110
+ if err != nil {
111
+ panic(err)
112
+ }
113
+ fmt.Printf("New version: %d\n", updatedAgent.Version)
114
+
115
+ // List all versions
116
+ iter := client.Beta.Agents.Versions.ListAutoPaging(ctx, agent.ID, anthropic.BetaAgentVersionListParams{})
117
+ for iter.Next() {
118
+ version := iter.Current()
119
+ fmt.Printf("Version %d: %s\n", version.Version, version.UpdatedAt.Format(time.RFC3339))
120
+ }
121
+ if err := iter.Err(); err != nil {
122
+ panic(err)
123
+ }
124
+
125
+ // Archive the agent
126
+ _, err = client.Beta.Agents.Archive(ctx, agent.ID, anthropic.BetaAgentArchiveParams{})
127
+ if err != nil {
128
+ panic(err)
129
+ }
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Send a User Message
135
+
136
+ ```go
137
+ _, err = client.Beta.Sessions.Events.Send(ctx, session.ID, anthropic.BetaSessionEventSendParams{
138
+ Events: []anthropic.BetaManagedAgentsEventParamsUnion{{
139
+ OfUserMessage: &anthropic.BetaManagedAgentsUserMessageEventParams{
140
+ Type: anthropic.BetaManagedAgentsUserMessageEventParamsTypeUserMessage,
141
+ Content: []anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{{
142
+ OfText: &anthropic.BetaManagedAgentsTextBlockParam{
143
+ Type: anthropic.BetaManagedAgentsTextBlockTypeText,
144
+ Text: "Review the auth module",
145
+ },
146
+ }},
147
+ },
148
+ }},
149
+ })
150
+ if err != nil {
151
+ panic(err)
152
+ }
153
+ ```
154
+
155
+ > Tip: **Stream-first:** Open the stream *before* (or concurrently with) sending the message. The stream only delivers events that occur after it opens - stream-after-send means early events arrive buffered in one batch. See [Steering Patterns](../../shared/managed-agents-events.md#steering-patterns).
156
+
157
+ ---
158
+
159
+ ## Stream Events (SSE)
160
+
161
+ ```go
162
+ // Open the stream first, then send the user message
163
+ stream := client.Beta.Sessions.Events.StreamEvents(ctx, session.ID, anthropic.BetaSessionEventStreamParams{})
164
+ defer stream.Close()
165
+
166
+ if _, err := client.Beta.Sessions.Events.Send(ctx, session.ID, anthropic.BetaSessionEventSendParams{
167
+ Events: []anthropic.BetaManagedAgentsEventParamsUnion{{
168
+ OfUserMessage: &anthropic.BetaManagedAgentsUserMessageEventParams{
169
+ Type: anthropic.BetaManagedAgentsUserMessageEventParamsTypeUserMessage,
170
+ Content: []anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{{
171
+ OfText: &anthropic.BetaManagedAgentsTextBlockParam{
172
+ Type: anthropic.BetaManagedAgentsTextBlockTypeText,
173
+ Text: "Summarize the repo README",
174
+ },
175
+ }},
176
+ },
177
+ }},
178
+ }); err != nil {
179
+ panic(err)
180
+ }
181
+
182
+ events:
183
+ for stream.Next() {
184
+ switch event := stream.Current().AsAny().(type) {
185
+ case anthropic.BetaManagedAgentsAgentMessageEvent:
186
+ for _, block := range event.Content {
187
+ fmt.Print(block.Text)
188
+ }
189
+ case anthropic.BetaManagedAgentsAgentToolUseEvent:
190
+ fmt.Printf("\n[Using tool: %s]\n", event.Name)
191
+ case anthropic.BetaManagedAgentsSessionStatusIdleEvent:
192
+ break events
193
+ case anthropic.BetaManagedAgentsSessionErrorEvent:
194
+ fmt.Printf("\n[Error: %s]\n", event.Error.Message)
195
+ break events
196
+ }
197
+ }
198
+ if err := stream.Err(); err != nil {
199
+ panic(err)
200
+ }
201
+ ```
202
+
203
+ ### Reconnecting and Tailing
204
+
205
+ When reconnecting mid-session, list past events first to dedupe, then tail live events:
206
+
207
+ ```go
208
+ stream := client.Beta.Sessions.Events.StreamEvents(ctx, session.ID, anthropic.BetaSessionEventStreamParams{})
209
+ defer stream.Close()
210
+
211
+ // Stream is open and buffering. List history before tailing live.
212
+ seenEventIDs := map[string]struct{}{}
213
+ history := client.Beta.Sessions.Events.ListAutoPaging(ctx, session.ID, anthropic.BetaSessionEventListParams{})
214
+ for history.Next() {
215
+ seenEventIDs[history.Current().ID] = struct{}{}
216
+ }
217
+ if err := history.Err(); err != nil {
218
+ panic(err)
219
+ }
220
+
221
+ // Tail live events, skipping anything already seen
222
+ tail:
223
+ for stream.Next() {
224
+ event := stream.Current()
225
+ if _, seen := seenEventIDs[event.ID]; seen {
226
+ continue
227
+ }
228
+ seenEventIDs[event.ID] = struct{}{}
229
+ switch event := event.AsAny().(type) {
230
+ case anthropic.BetaManagedAgentsAgentMessageEvent:
231
+ for _, block := range event.Content {
232
+ fmt.Print(block.Text)
233
+ }
234
+ case anthropic.BetaManagedAgentsSessionStatusIdleEvent:
235
+ break tail
236
+ }
237
+ }
238
+ if err := stream.Err(); err != nil {
239
+ panic(err)
240
+ }
241
+ ```
242
+
243
+ ---
244
+
245
+ ## Provide Custom Tool Result
246
+
247
+ > Note: The Go managed-agents bindings for `user.custom_tool_result` are not yet documented in this skill or in the apps source examples. Refer to `shared/managed-agents-events.md` for the wire format and the `github.com/anthropics/anthropic-sdk-go` repository for the corresponding Go params types.
248
+
249
+ ---
250
+
251
+ ## Poll Events
252
+
253
+ ```go
254
+ // Auto-paginating iterator
255
+ iter := client.Beta.Sessions.Events.ListAutoPaging(ctx, session.ID, anthropic.BetaSessionEventListParams{})
256
+ for iter.Next() {
257
+ event := iter.Current()
258
+ fmt.Printf("%s: %s\n", event.Type, event.ID)
259
+ }
260
+ if err := iter.Err(); err != nil {
261
+ panic(err)
262
+ }
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Upload a File
268
+
269
+ ```go
270
+ csvFile, err := os.Open("data.csv")
271
+ if err != nil {
272
+ panic(err)
273
+ }
274
+ defer csvFile.Close()
275
+
276
+ file, err := client.Beta.Files.Upload(ctx, anthropic.BetaFileUploadParams{
277
+ File: csvFile,
278
+ })
279
+ if err != nil {
280
+ panic(err)
281
+ }
282
+ fmt.Printf("File ID: %s\n", file.ID)
283
+
284
+ // Mount in a session
285
+ session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{
286
+ Agent: anthropic.BetaSessionNewParamsAgentUnion{
287
+ OfString: anthropic.String(agent.ID),
288
+ },
289
+ EnvironmentID: environment.ID,
290
+ Resources: []anthropic.BetaSessionNewParamsResourceUnion{{
291
+ OfFile: &anthropic.BetaManagedAgentsFileResourceParams{
292
+ Type: anthropic.BetaManagedAgentsFileResourceParamsTypeFile,
293
+ FileID: file.ID,
294
+ MountPath: anthropic.String("/workspace/data.csv"),
295
+ },
296
+ }},
297
+ })
298
+ if err != nil {
299
+ panic(err)
300
+ }
301
+ ```
302
+
303
+ ### Add and Manage Resources on an Existing Session
304
+
305
+ ```go
306
+ // Attach an additional file to an open session
307
+ resource, err := client.Beta.Sessions.Resources.Add(ctx, session.ID, anthropic.BetaSessionResourceAddParams{
308
+ BetaManagedAgentsFileResourceParams: anthropic.BetaManagedAgentsFileResourceParams{
309
+ Type: anthropic.BetaManagedAgentsFileResourceParamsTypeFile,
310
+ FileID: file.ID,
311
+ },
312
+ })
313
+ if err != nil {
314
+ panic(err)
315
+ }
316
+ fmt.Println(resource.ID) // "sesrsc_01ABC..."
317
+
318
+ // List resources on the session
319
+ listed, err := client.Beta.Sessions.Resources.List(ctx, session.ID, anthropic.BetaSessionResourceListParams{})
320
+ if err != nil {
321
+ panic(err)
322
+ }
323
+ for _, entry := range listed.Data {
324
+ fmt.Println(entry.ID, entry.Type)
325
+ }
326
+
327
+ // Detach a resource
328
+ if _, err := client.Beta.Sessions.Resources.Delete(ctx, resource.ID, anthropic.BetaSessionResourceDeleteParams{
329
+ SessionID: session.ID,
330
+ }); err != nil {
331
+ panic(err)
332
+ }
333
+ ```
334
+
335
+ ---
336
+
337
+ ## List and Download Session Files
338
+
339
+ > Note: Listing and downloading files an agent wrote during a session is not yet documented for Go in this skill or in the apps source examples. See `shared/managed-agents-events.md` and the `github.com/anthropics/anthropic-sdk-go` repository for the `Beta.Files.List` and `Beta.Files.Download` Go params types.
340
+
341
+ ---
342
+
343
+ ## Session Management
344
+
345
+ ```go
346
+ // List environments
347
+ environments, err := client.Beta.Environments.List(ctx, anthropic.BetaEnvironmentListParams{})
348
+ if err != nil {
349
+ panic(err)
350
+ }
351
+
352
+ // Retrieve a specific environment
353
+ env, err := client.Beta.Environments.Get(ctx, environment.ID, anthropic.BetaEnvironmentGetParams{})
354
+ if err != nil {
355
+ panic(err)
356
+ }
357
+
358
+ // Archive an environment (read-only, existing sessions continue)
359
+ _, err = client.Beta.Environments.Archive(ctx, environment.ID, anthropic.BetaEnvironmentArchiveParams{})
360
+ if err != nil {
361
+ panic(err)
362
+ }
363
+
364
+ // Delete an environment (only if no sessions reference it)
365
+ _, err = client.Beta.Environments.Delete(ctx, environment.ID, anthropic.BetaEnvironmentDeleteParams{})
366
+ if err != nil {
367
+ panic(err)
368
+ }
369
+
370
+ // Delete a session
371
+ _, err = client.Beta.Sessions.Delete(ctx, session.ID, anthropic.BetaSessionDeleteParams{})
372
+ if err != nil {
373
+ panic(err)
374
+ }
375
+ ```
376
+
377
+ ---
378
+
379
+ ## MCP Server Integration
380
+
381
+ ```go
382
+ // Agent declares MCP server (no auth here - auth goes in a vault)
383
+ agent, err := client.Beta.Agents.New(ctx, anthropic.BetaAgentNewParams{
384
+ Name: "GitHub Assistant",
385
+ Model: anthropic.BetaManagedAgentsModelConfigParams{
386
+ ID: "claude-opus-5",
387
+ Type: anthropic.BetaManagedAgentsModelConfigParamsTypeModelConfig,
388
+ },
389
+ MCPServers: []anthropic.BetaManagedAgentsURLMCPServerParams{{
390
+ Type: anthropic.BetaManagedAgentsURLMCPServerParamsTypeURL,
391
+ Name: "github",
392
+ URL: "https://api.githubcopilot.com/mcp/",
393
+ }},
394
+ Tools: []anthropic.BetaAgentNewParamsToolUnion{
395
+ {
396
+ OfAgentToolset20260401: &anthropic.BetaManagedAgentsAgentToolset20260401Params{
397
+ Type: anthropic.BetaManagedAgentsAgentToolset20260401ParamsTypeAgentToolset20260401,
398
+ },
399
+ },
400
+ {
401
+ OfMCPToolset: &anthropic.BetaManagedAgentsMCPToolsetParams{
402
+ Type: anthropic.BetaManagedAgentsMCPToolsetParamsTypeMCPToolset,
403
+ MCPServerName: "github",
404
+ },
405
+ },
406
+ },
407
+ })
408
+ if err != nil {
409
+ panic(err)
410
+ }
411
+
412
+ // Session attaches vault(s) containing credentials for those MCP server URLs
413
+ session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{
414
+ Agent: anthropic.BetaSessionNewParamsAgentUnion{
415
+ OfBetaManagedAgentsAgents: &anthropic.BetaManagedAgentsAgentParams{
416
+ Type: anthropic.BetaManagedAgentsAgentParamsTypeAgent,
417
+ ID: agent.ID,
418
+ Version: anthropic.Int(agent.Version),
419
+ },
420
+ },
421
+ EnvironmentID: environment.ID,
422
+ VaultIDs: []string{vault.ID},
423
+ })
424
+ if err != nil {
425
+ panic(err)
426
+ }
427
+ ```
428
+
429
+ See `shared/managed-agents-tools.md` §Vaults for creating vaults and adding credentials.
430
+
431
+ ---
432
+
433
+ ## Vaults
434
+
435
+ ```go
436
+ // Create a vault
437
+ vault, err := client.Beta.Vaults.New(ctx, anthropic.BetaVaultNewParams{
438
+ DisplayName: "Alice",
439
+ Metadata: map[string]string{"external_user_id": "usr_abc123"},
440
+ })
441
+ if err != nil {
442
+ panic(err)
443
+ }
444
+
445
+ // Add an OAuth credential
446
+ credential, err := client.Beta.Vaults.Credentials.New(ctx, vault.ID, anthropic.BetaVaultCredentialNewParams{
447
+ DisplayName: anthropic.String("Alice's Slack"),
448
+ Auth: anthropic.BetaVaultCredentialNewParamsAuthUnion{
449
+ OfMCPOAuth: &anthropic.BetaManagedAgentsMCPOAuthCreateParams{
450
+ Type: anthropic.BetaManagedAgentsMCPOAuthCreateParamsTypeMCPOAuth,
451
+ MCPServerURL: "https://mcp.slack.com/mcp",
452
+ AccessToken: "xoxp-...",
453
+ ExpiresAt: anthropic.Time(time.Date(2026, time.April, 15, 0, 0, 0, 0, time.UTC)),
454
+ Refresh: anthropic.BetaManagedAgentsMCPOAuthRefreshParams{
455
+ TokenEndpoint: "https://slack.com/api/oauth.v2.access",
456
+ ClientID: "1234567890.0987654321",
457
+ Scope: anthropic.String("channels:read chat:write"),
458
+ RefreshToken: "xoxe-1-...",
459
+ TokenEndpointAuth: anthropic.BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion{
460
+ OfClientSecretPost: &anthropic.BetaManagedAgentsTokenEndpointAuthPostParam{
461
+ Type: anthropic.BetaManagedAgentsTokenEndpointAuthPostParamTypeClientSecretPost,
462
+ ClientSecret: "abc123...",
463
+ },
464
+ },
465
+ },
466
+ },
467
+ },
468
+ })
469
+ if err != nil {
470
+ panic(err)
471
+ }
472
+
473
+ // Rotate the credential (e.g., after a token refresh)
474
+ _, err = client.Beta.Vaults.Credentials.Update(ctx, credential.ID, anthropic.BetaVaultCredentialUpdateParams{
475
+ VaultID: vault.ID,
476
+ Auth: anthropic.BetaVaultCredentialUpdateParamsAuthUnion{
477
+ OfMCPOAuth: &anthropic.BetaManagedAgentsMCPOAuthUpdateParams{
478
+ Type: anthropic.BetaManagedAgentsMCPOAuthUpdateParamsTypeMCPOAuth,
479
+ AccessToken: anthropic.String("xoxp-new-..."),
480
+ ExpiresAt: anthropic.Time(time.Date(2026, time.May, 15, 0, 0, 0, 0, time.UTC)),
481
+ Refresh: anthropic.BetaManagedAgentsMCPOAuthRefreshUpdateParams{
482
+ RefreshToken: anthropic.String("xoxe-1-new-..."),
483
+ },
484
+ },
485
+ },
486
+ })
487
+ if err != nil {
488
+ panic(err)
489
+ }
490
+
491
+ // Archive a vault
492
+ _, err = client.Beta.Vaults.Archive(ctx, vault.ID, anthropic.BetaVaultArchiveParams{})
493
+ if err != nil {
494
+ panic(err)
495
+ }
496
+ ```
497
+
498
+ ---
499
+
500
+ ## GitHub Repository Integration
501
+
502
+ Mount a GitHub repository as a session resource (a vault holds the GitHub MCP credential):
503
+
504
+ ```go
505
+ session, err := client.Beta.Sessions.New(ctx, anthropic.BetaSessionNewParams{
506
+ Agent: anthropic.BetaSessionNewParamsAgentUnion{OfString: anthropic.String(agent.ID)},
507
+ EnvironmentID: environment.ID,
508
+ VaultIDs: []string{vault.ID},
509
+ Resources: []anthropic.BetaSessionNewParamsResourceUnion{
510
+ {
511
+ OfGitHubRepository: &anthropic.BetaManagedAgentsGitHubRepositoryResourceParams{
512
+ Type: anthropic.BetaManagedAgentsGitHubRepositoryResourceParamsTypeGitHubRepository,
513
+ URL: "https://github.com/org/repo",
514
+ MountPath: anthropic.String("/workspace/repo"),
515
+ AuthorizationToken: "ghp_your_github_token",
516
+ },
517
+ },
518
+ },
519
+ })
520
+ if err != nil {
521
+ panic(err)
522
+ }
523
+ ```
524
+
525
+ Multiple repositories on the same session:
526
+
527
+ ```go
528
+ resources := []anthropic.BetaSessionNewParamsResourceUnion{
529
+ {
530
+ OfGitHubRepository: &anthropic.BetaManagedAgentsGitHubRepositoryResourceParams{
531
+ Type: anthropic.BetaManagedAgentsGitHubRepositoryResourceParamsTypeGitHubRepository,
532
+ URL: "https://github.com/org/frontend",
533
+ MountPath: anthropic.String("/workspace/frontend"),
534
+ AuthorizationToken: "ghp_your_github_token",
535
+ },
536
+ },
537
+ {
538
+ OfGitHubRepository: &anthropic.BetaManagedAgentsGitHubRepositoryResourceParams{
539
+ Type: anthropic.BetaManagedAgentsGitHubRepositoryResourceParamsTypeGitHubRepository,
540
+ URL: "https://github.com/org/backend",
541
+ MountPath: anthropic.String("/workspace/backend"),
542
+ AuthorizationToken: "ghp_your_github_token",
543
+ },
544
+ },
545
+ }
546
+ ```
547
+
548
+ Rotating a repository's authorization token:
549
+
550
+ ```go
551
+ listed, err := client.Beta.Sessions.Resources.List(ctx, session.ID, anthropic.BetaSessionResourceListParams{})
552
+ if err != nil {
553
+ panic(err)
554
+ }
555
+ repoResourceID := listed.Data[0].ID
556
+
557
+ _, err = client.Beta.Sessions.Resources.Update(ctx, repoResourceID, anthropic.BetaSessionResourceUpdateParams{
558
+ SessionID: session.ID,
559
+ AuthorizationToken: "ghp_your_new_github_token",
560
+ })
561
+ if err != nil {
562
+ panic(err)
563
+ }
564
+ ```