@bastani/atomic 0.6.8-0 → 0.7.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/atomic +65 -0
- package/package.json +17 -82
- package/postinstall.mjs +47 -0
- package/.agents/skills/ado-commit/SKILL.md +0 -94
- package/.agents/skills/ado-create-pr/SKILL.md +0 -211
- package/.agents/skills/advanced-evaluation/SKILL.md +0 -404
- package/.agents/skills/advanced-evaluation/references/bias-mitigation.md +0 -288
- package/.agents/skills/advanced-evaluation/references/evaluation-pipeline.md +0 -43
- package/.agents/skills/advanced-evaluation/references/implementation-patterns.md +0 -315
- package/.agents/skills/advanced-evaluation/references/metrics-guide.md +0 -331
- package/.agents/skills/advanced-evaluation/scripts/evaluation_example.py +0 -392
- package/.agents/skills/ast-grep/SKILL.md +0 -325
- package/.agents/skills/ast-grep/references/rule_reference.md +0 -297
- package/.agents/skills/bdi-mental-states/SKILL.md +0 -313
- package/.agents/skills/bdi-mental-states/references/bdi-ontology-core.md +0 -207
- package/.agents/skills/bdi-mental-states/references/framework-integration.md +0 -582
- package/.agents/skills/bdi-mental-states/references/rdf-examples.md +0 -315
- package/.agents/skills/bdi-mental-states/references/sparql-competency.md +0 -420
- package/.agents/skills/bun/SKILL.md +0 -233
- package/.agents/skills/context-compression/SKILL.md +0 -274
- package/.agents/skills/context-compression/references/evaluation-framework.md +0 -213
- package/.agents/skills/context-compression/scripts/compression_evaluator.py +0 -862
- package/.agents/skills/context-compression/tests/test_compression_evaluator.py +0 -56
- package/.agents/skills/context-degradation/SKILL.md +0 -208
- package/.agents/skills/context-degradation/references/patterns.md +0 -314
- package/.agents/skills/context-degradation/scripts/degradation_detector.py +0 -614
- package/.agents/skills/context-fundamentals/SKILL.md +0 -203
- package/.agents/skills/context-fundamentals/references/context-components.md +0 -283
- package/.agents/skills/context-fundamentals/scripts/context_manager.py +0 -533
- package/.agents/skills/context-optimization/SKILL.md +0 -197
- package/.agents/skills/context-optimization/references/optimization_techniques.md +0 -272
- package/.agents/skills/context-optimization/scripts/compaction.py +0 -562
- package/.agents/skills/create-spec/SKILL.md +0 -249
- package/.agents/skills/docx/LICENSE.txt +0 -30
- package/.agents/skills/docx/SKILL.md +0 -592
- package/.agents/skills/docx/scripts/__init__.py +0 -1
- package/.agents/skills/docx/scripts/accept_changes.py +0 -135
- package/.agents/skills/docx/scripts/comment.py +0 -318
- package/.agents/skills/docx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/docx/scripts/office/helpers/merge_runs.py +0 -199
- package/.agents/skills/docx/scripts/office/helpers/simplify_redlines.py +0 -197
- package/.agents/skills/docx/scripts/office/pack.py +0 -159
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agents/skills/docx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agents/skills/docx/scripts/office/soffice.py +0 -183
- package/.agents/skills/docx/scripts/office/unpack.py +0 -132
- package/.agents/skills/docx/scripts/office/validate.py +0 -111
- package/.agents/skills/docx/scripts/office/validators/__init__.py +0 -15
- package/.agents/skills/docx/scripts/office/validators/base.py +0 -847
- package/.agents/skills/docx/scripts/office/validators/docx.py +0 -446
- package/.agents/skills/docx/scripts/office/validators/pptx.py +0 -275
- package/.agents/skills/docx/scripts/office/validators/redlining.py +0 -247
- package/.agents/skills/docx/scripts/templates/comments.xml +0 -3
- package/.agents/skills/docx/scripts/templates/commentsExtended.xml +0 -3
- package/.agents/skills/docx/scripts/templates/commentsExtensible.xml +0 -3
- package/.agents/skills/docx/scripts/templates/commentsIds.xml +0 -3
- package/.agents/skills/docx/scripts/templates/people.xml +0 -3
- package/.agents/skills/evaluation/SKILL.md +0 -253
- package/.agents/skills/evaluation/references/metrics.md +0 -339
- package/.agents/skills/evaluation/scripts/evaluator.py +0 -627
- package/.agents/skills/explain-code/SKILL.md +0 -232
- package/.agents/skills/filesystem-context/SKILL.md +0 -289
- package/.agents/skills/filesystem-context/references/implementation-patterns.md +0 -549
- package/.agents/skills/filesystem-context/scripts/filesystem_context.py +0 -425
- package/.agents/skills/find-skills/SKILL.md +0 -144
- package/.agents/skills/gh-commit/SKILL.md +0 -245
- package/.agents/skills/gh-create-pr/SKILL.md +0 -95
- package/.agents/skills/hosted-agents/SKILL.md +0 -262
- package/.agents/skills/hosted-agents/references/infrastructure-patterns.md +0 -700
- package/.agents/skills/hosted-agents/scripts/sandbox_manager.py +0 -590
- package/.agents/skills/impeccable/SKILL.md +0 -178
- package/.agents/skills/impeccable/agents/openai.yaml +0 -4
- package/.agents/skills/impeccable/reference/adapt.md +0 -190
- package/.agents/skills/impeccable/reference/animate.md +0 -175
- package/.agents/skills/impeccable/reference/audit.md +0 -134
- package/.agents/skills/impeccable/reference/bolder.md +0 -113
- package/.agents/skills/impeccable/reference/brand.md +0 -114
- package/.agents/skills/impeccable/reference/clarify.md +0 -174
- package/.agents/skills/impeccable/reference/cognitive-load.md +0 -106
- package/.agents/skills/impeccable/reference/color-and-contrast.md +0 -105
- package/.agents/skills/impeccable/reference/colorize.md +0 -154
- package/.agents/skills/impeccable/reference/craft.md +0 -193
- package/.agents/skills/impeccable/reference/critique.md +0 -213
- package/.agents/skills/impeccable/reference/delight.md +0 -302
- package/.agents/skills/impeccable/reference/distill.md +0 -111
- package/.agents/skills/impeccable/reference/document.md +0 -427
- package/.agents/skills/impeccable/reference/extract.md +0 -70
- package/.agents/skills/impeccable/reference/harden.md +0 -347
- package/.agents/skills/impeccable/reference/heuristics-scoring.md +0 -234
- package/.agents/skills/impeccable/reference/interaction-design.md +0 -195
- package/.agents/skills/impeccable/reference/layout.md +0 -141
- package/.agents/skills/impeccable/reference/live.md +0 -594
- package/.agents/skills/impeccable/reference/motion-design.md +0 -109
- package/.agents/skills/impeccable/reference/onboard.md +0 -234
- package/.agents/skills/impeccable/reference/optimize.md +0 -258
- package/.agents/skills/impeccable/reference/overdrive.md +0 -130
- package/.agents/skills/impeccable/reference/personas.md +0 -178
- package/.agents/skills/impeccable/reference/polish.md +0 -232
- package/.agents/skills/impeccable/reference/product.md +0 -62
- package/.agents/skills/impeccable/reference/quieter.md +0 -99
- package/.agents/skills/impeccable/reference/responsive-design.md +0 -114
- package/.agents/skills/impeccable/reference/shape.md +0 -151
- package/.agents/skills/impeccable/reference/spatial-design.md +0 -100
- package/.agents/skills/impeccable/reference/teach.md +0 -156
- package/.agents/skills/impeccable/reference/typeset.md +0 -124
- package/.agents/skills/impeccable/reference/typography.md +0 -159
- package/.agents/skills/impeccable/reference/ux-writing.md +0 -107
- package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +0 -284
- package/.agents/skills/impeccable/scripts/command-metadata.json +0 -94
- package/.agents/skills/impeccable/scripts/design-parser.mjs +0 -820
- package/.agents/skills/impeccable/scripts/detect-csp.mjs +0 -198
- package/.agents/skills/impeccable/scripts/is-generated.mjs +0 -69
- package/.agents/skills/impeccable/scripts/live-accept.mjs +0 -595
- package/.agents/skills/impeccable/scripts/live-browser.js +0 -4781
- package/.agents/skills/impeccable/scripts/live-inject.mjs +0 -445
- package/.agents/skills/impeccable/scripts/live-poll.mjs +0 -186
- package/.agents/skills/impeccable/scripts/live-server.mjs +0 -694
- package/.agents/skills/impeccable/scripts/live-wrap.mjs +0 -571
- package/.agents/skills/impeccable/scripts/live.mjs +0 -247
- package/.agents/skills/impeccable/scripts/load-context.mjs +0 -141
- package/.agents/skills/impeccable/scripts/modern-screenshot.umd.js +0 -14
- package/.agents/skills/impeccable/scripts/pin.mjs +0 -214
- package/.agents/skills/init/SKILL.md +0 -140
- package/.agents/skills/liteparse/SKILL.md +0 -223
- package/.agents/skills/memory-systems/SKILL.md +0 -221
- package/.agents/skills/memory-systems/references/implementation.md +0 -551
- package/.agents/skills/memory-systems/scripts/memory_store.py +0 -616
- package/.agents/skills/multi-agent-patterns/SKILL.md +0 -259
- package/.agents/skills/multi-agent-patterns/references/frameworks.md +0 -433
- package/.agents/skills/multi-agent-patterns/scripts/coordination.py +0 -613
- package/.agents/skills/opentui/SKILL.md +0 -202
- package/.agents/skills/opentui/references/animation/REFERENCE.md +0 -431
- package/.agents/skills/opentui/references/components/REFERENCE.md +0 -144
- package/.agents/skills/opentui/references/components/code-diff.md +0 -672
- package/.agents/skills/opentui/references/components/containers.md +0 -417
- package/.agents/skills/opentui/references/components/inputs.md +0 -531
- package/.agents/skills/opentui/references/components/text-display.md +0 -386
- package/.agents/skills/opentui/references/core/REFERENCE.md +0 -145
- package/.agents/skills/opentui/references/core/api.md +0 -543
- package/.agents/skills/opentui/references/core/configuration.md +0 -168
- package/.agents/skills/opentui/references/core/gotchas.md +0 -393
- package/.agents/skills/opentui/references/core/patterns.md +0 -449
- package/.agents/skills/opentui/references/keyboard/REFERENCE.md +0 -617
- package/.agents/skills/opentui/references/layout/REFERENCE.md +0 -337
- package/.agents/skills/opentui/references/layout/patterns.md +0 -444
- package/.agents/skills/opentui/references/react/REFERENCE.md +0 -174
- package/.agents/skills/opentui/references/react/api.md +0 -436
- package/.agents/skills/opentui/references/react/configuration.md +0 -302
- package/.agents/skills/opentui/references/react/gotchas.md +0 -443
- package/.agents/skills/opentui/references/react/patterns.md +0 -501
- package/.agents/skills/opentui/references/solid/REFERENCE.md +0 -201
- package/.agents/skills/opentui/references/solid/api.md +0 -564
- package/.agents/skills/opentui/references/solid/configuration.md +0 -316
- package/.agents/skills/opentui/references/solid/gotchas.md +0 -427
- package/.agents/skills/opentui/references/solid/patterns.md +0 -560
- package/.agents/skills/opentui/references/testing/REFERENCE.md +0 -614
- package/.agents/skills/pdf/LICENSE.txt +0 -30
- package/.agents/skills/pdf/SKILL.md +0 -316
- package/.agents/skills/pdf/forms.md +0 -294
- package/.agents/skills/pdf/reference.md +0 -612
- package/.agents/skills/pdf/scripts/check_bounding_boxes.py +0 -65
- package/.agents/skills/pdf/scripts/check_fillable_fields.py +0 -11
- package/.agents/skills/pdf/scripts/convert_pdf_to_images.py +0 -33
- package/.agents/skills/pdf/scripts/create_validation_image.py +0 -37
- package/.agents/skills/pdf/scripts/extract_form_field_info.py +0 -122
- package/.agents/skills/pdf/scripts/extract_form_structure.py +0 -115
- package/.agents/skills/pdf/scripts/fill_fillable_fields.py +0 -98
- package/.agents/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -107
- package/.agents/skills/playwright-cli/SKILL.md +0 -390
- package/.agents/skills/playwright-cli/references/element-attributes.md +0 -23
- package/.agents/skills/playwright-cli/references/playwright-tests.md +0 -39
- package/.agents/skills/playwright-cli/references/request-mocking.md +0 -87
- package/.agents/skills/playwright-cli/references/running-code.md +0 -241
- package/.agents/skills/playwright-cli/references/session-management.md +0 -225
- package/.agents/skills/playwright-cli/references/spec-driven-testing.md +0 -305
- package/.agents/skills/playwright-cli/references/storage-state.md +0 -275
- package/.agents/skills/playwright-cli/references/test-generation.md +0 -134
- package/.agents/skills/playwright-cli/references/tracing.md +0 -139
- package/.agents/skills/playwright-cli/references/video-recording.md +0 -143
- package/.agents/skills/pptx/LICENSE.txt +0 -30
- package/.agents/skills/pptx/SKILL.md +0 -234
- package/.agents/skills/pptx/editing.md +0 -205
- package/.agents/skills/pptx/pptxgenjs.md +0 -420
- package/.agents/skills/pptx/scripts/__init__.py +0 -0
- package/.agents/skills/pptx/scripts/add_slide.py +0 -195
- package/.agents/skills/pptx/scripts/clean.py +0 -286
- package/.agents/skills/pptx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/pptx/scripts/office/helpers/merge_runs.py +0 -199
- package/.agents/skills/pptx/scripts/office/helpers/simplify_redlines.py +0 -197
- package/.agents/skills/pptx/scripts/office/pack.py +0 -159
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agents/skills/pptx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agents/skills/pptx/scripts/office/soffice.py +0 -183
- package/.agents/skills/pptx/scripts/office/unpack.py +0 -132
- package/.agents/skills/pptx/scripts/office/validate.py +0 -111
- package/.agents/skills/pptx/scripts/office/validators/__init__.py +0 -15
- package/.agents/skills/pptx/scripts/office/validators/base.py +0 -847
- package/.agents/skills/pptx/scripts/office/validators/docx.py +0 -446
- package/.agents/skills/pptx/scripts/office/validators/pptx.py +0 -275
- package/.agents/skills/pptx/scripts/office/validators/redlining.py +0 -247
- package/.agents/skills/pptx/scripts/thumbnail.py +0 -289
- package/.agents/skills/project-development/SKILL.md +0 -293
- package/.agents/skills/project-development/references/case-studies.md +0 -388
- package/.agents/skills/project-development/references/pipeline-patterns.md +0 -610
- package/.agents/skills/project-development/scripts/pipeline_template.py +0 -796
- package/.agents/skills/prompt-engineer/SKILL.md +0 -265
- package/.agents/skills/prompt-engineer/references/advanced_patterns.md +0 -271
- package/.agents/skills/prompt-engineer/references/core_prompting.md +0 -137
- package/.agents/skills/prompt-engineer/references/quality_improvement.md +0 -193
- package/.agents/skills/research-codebase/SKILL.md +0 -229
- package/.agents/skills/ripgrep/SKILL.md +0 -384
- package/.agents/skills/skill-creator/LICENSE.txt +0 -202
- package/.agents/skills/skill-creator/SKILL.md +0 -487
- package/.agents/skills/skill-creator/agents/analyzer.md +0 -274
- package/.agents/skills/skill-creator/agents/comparator.md +0 -202
- package/.agents/skills/skill-creator/agents/grader.md +0 -223
- package/.agents/skills/skill-creator/assets/eval_review.html +0 -146
- package/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
- package/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
- package/.agents/skills/skill-creator/references/schemas.md +0 -430
- package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
- package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
- package/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
- package/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
- package/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
- package/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
- package/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
- package/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
- package/.agents/skills/skill-creator/scripts/utils.py +0 -47
- package/.agents/skills/sl-commit/SKILL.md +0 -53
- package/.agents/skills/sl-submit-diff/SKILL.md +0 -57
- package/.agents/skills/tdd/SKILL.md +0 -111
- package/.agents/skills/tdd/deep-modules.md +0 -33
- package/.agents/skills/tdd/interface-design.md +0 -31
- package/.agents/skills/tdd/mocking.md +0 -59
- package/.agents/skills/tdd/refactoring.md +0 -10
- package/.agents/skills/tdd/tests.md +0 -61
- package/.agents/skills/tool-design/SKILL.md +0 -273
- package/.agents/skills/tool-design/references/architectural_reduction.md +0 -210
- package/.agents/skills/tool-design/references/best_practices.md +0 -176
- package/.agents/skills/tool-design/scripts/description_generator.py +0 -528
- package/.agents/skills/typescript-advanced-types/SKILL.md +0 -720
- package/.agents/skills/typescript-expert/SKILL.md +0 -434
- package/.agents/skills/typescript-expert/references/tsconfig-strict.json +0 -92
- package/.agents/skills/typescript-expert/references/typescript-cheatsheet.md +0 -383
- package/.agents/skills/typescript-expert/references/utility-types.ts +0 -335
- package/.agents/skills/typescript-expert/scripts/ts_diagnostic.py +0 -203
- package/.agents/skills/typescript-react-reviewer/SKILL.md +0 -201
- package/.agents/skills/typescript-react-reviewer/references/antipatterns.md +0 -510
- package/.agents/skills/typescript-react-reviewer/references/checklist.md +0 -267
- package/.agents/skills/typescript-react-reviewer/references/react19-patterns.md +0 -305
- package/.agents/skills/workflow-creator/SKILL.md +0 -553
- package/.agents/skills/workflow-creator/references/agent-sessions.md +0 -891
- package/.agents/skills/workflow-creator/references/agent-setup-recipe.md +0 -266
- package/.agents/skills/workflow-creator/references/computation-and-validation.md +0 -201
- package/.agents/skills/workflow-creator/references/control-flow.md +0 -470
- package/.agents/skills/workflow-creator/references/failure-modes.md +0 -1014
- package/.agents/skills/workflow-creator/references/getting-started.md +0 -392
- package/.agents/skills/workflow-creator/references/registry-and-validation.md +0 -141
- package/.agents/skills/workflow-creator/references/running-workflows.md +0 -418
- package/.agents/skills/workflow-creator/references/session-config.md +0 -431
- package/.agents/skills/workflow-creator/references/state-and-data-flow.md +0 -356
- package/.agents/skills/workflow-creator/references/user-input.md +0 -234
- package/.agents/skills/workflow-creator/references/workflow-inputs.md +0 -392
- package/.agents/skills/xlsx/LICENSE.txt +0 -30
- package/.agents/skills/xlsx/SKILL.md +0 -294
- package/.agents/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/.agents/skills/xlsx/scripts/office/helpers/merge_runs.py +0 -199
- package/.agents/skills/xlsx/scripts/office/helpers/simplify_redlines.py +0 -197
- package/.agents/skills/xlsx/scripts/office/pack.py +0 -159
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agents/skills/xlsx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agents/skills/xlsx/scripts/office/soffice.py +0 -183
- package/.agents/skills/xlsx/scripts/office/unpack.py +0 -132
- package/.agents/skills/xlsx/scripts/office/validate.py +0 -111
- package/.agents/skills/xlsx/scripts/office/validators/__init__.py +0 -15
- package/.agents/skills/xlsx/scripts/office/validators/base.py +0 -847
- package/.agents/skills/xlsx/scripts/office/validators/docx.py +0 -446
- package/.agents/skills/xlsx/scripts/office/validators/pptx.py +0 -275
- package/.agents/skills/xlsx/scripts/office/validators/redlining.py +0 -247
- package/.agents/skills/xlsx/scripts/recalc.py +0 -184
- package/.claude/agents/code-simplifier.md +0 -52
- package/.claude/agents/codebase-analyzer.md +0 -166
- package/.claude/agents/codebase-locator.md +0 -122
- package/.claude/agents/codebase-online-researcher.md +0 -148
- package/.claude/agents/codebase-pattern-finder.md +0 -247
- package/.claude/agents/codebase-research-analyzer.md +0 -179
- package/.claude/agents/codebase-research-locator.md +0 -145
- package/.claude/agents/debugger.md +0 -91
- package/.claude/agents/orchestrator.md +0 -19
- package/.claude/agents/planner.md +0 -295
- package/.claude/agents/reviewer.md +0 -98
- package/.claude/agents/worker.md +0 -165
- package/.claude/settings.json +0 -27
- package/.github/agents/code-simplifier.md +0 -52
- package/.github/agents/codebase-analyzer.md +0 -166
- package/.github/agents/codebase-locator.md +0 -122
- package/.github/agents/codebase-online-researcher.md +0 -146
- package/.github/agents/codebase-pattern-finder.md +0 -247
- package/.github/agents/codebase-research-analyzer.md +0 -179
- package/.github/agents/codebase-research-locator.md +0 -145
- package/.github/agents/debugger.md +0 -98
- package/.github/agents/orchestrator.md +0 -27
- package/.github/agents/planner.md +0 -305
- package/.github/agents/reviewer.md +0 -95
- package/.github/agents/worker.md +0 -237
- package/.github/lsp.json +0 -93
- package/.mcp.json +0 -20
- package/.opencode/agents/code-simplifier.md +0 -62
- package/.opencode/agents/codebase-analyzer.md +0 -171
- package/.opencode/agents/codebase-locator.md +0 -127
- package/.opencode/agents/codebase-online-researcher.md +0 -152
- package/.opencode/agents/codebase-pattern-finder.md +0 -252
- package/.opencode/agents/codebase-research-analyzer.md +0 -183
- package/.opencode/agents/codebase-research-locator.md +0 -149
- package/.opencode/agents/debugger.md +0 -99
- package/.opencode/agents/orchestrator.md +0 -27
- package/.opencode/agents/planner.md +0 -309
- package/.opencode/agents/reviewer.md +0 -103
- package/.opencode/agents/worker.md +0 -165
- package/.opencode/opencode.json +0 -25
- package/README.md +0 -1624
- package/assets/settings.schema.json +0 -51
- package/dist/commands/cli/claude-inflight-hook.d.ts +0 -100
- package/dist/commands/cli/claude-inflight-hook.d.ts.map +0 -1
- package/dist/commands/cli/claude-stop-hook.d.ts +0 -80
- package/dist/commands/cli/claude-stop-hook.d.ts.map +0 -1
- package/dist/lib/atomic-temp.d.ts +0 -8
- package/dist/lib/atomic-temp.d.ts.map +0 -1
- package/dist/lib/path-root-guard.d.ts +0 -4
- package/dist/lib/path-root-guard.d.ts.map +0 -1
- package/dist/lib/spawn.d.ts +0 -102
- package/dist/lib/spawn.d.ts.map +0 -1
- package/dist/lib/terminal-env.d.ts +0 -9
- package/dist/lib/terminal-env.d.ts.map +0 -1
- package/dist/sdk/components/attached-statusline.d.ts +0 -26
- package/dist/sdk/components/attached-statusline.d.ts.map +0 -1
- package/dist/sdk/components/color-utils.d.ts +0 -4
- package/dist/sdk/components/color-utils.d.ts.map +0 -1
- package/dist/sdk/components/compact-switcher.d.ts +0 -10
- package/dist/sdk/components/compact-switcher.d.ts.map +0 -1
- package/dist/sdk/components/connectors.d.ts +0 -16
- package/dist/sdk/components/connectors.d.ts.map +0 -1
- package/dist/sdk/components/edge.d.ts +0 -4
- package/dist/sdk/components/edge.d.ts.map +0 -1
- package/dist/sdk/components/error-boundary.d.ts +0 -23
- package/dist/sdk/components/error-boundary.d.ts.map +0 -1
- package/dist/sdk/components/graph-theme.d.ts +0 -18
- package/dist/sdk/components/graph-theme.d.ts.map +0 -1
- package/dist/sdk/components/header.d.ts +0 -3
- package/dist/sdk/components/header.d.ts.map +0 -1
- package/dist/sdk/components/hooks.d.ts +0 -15
- package/dist/sdk/components/hooks.d.ts.map +0 -1
- package/dist/sdk/components/layout.d.ts +0 -27
- package/dist/sdk/components/layout.d.ts.map +0 -1
- package/dist/sdk/components/node-card.d.ts +0 -10
- package/dist/sdk/components/node-card.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts +0 -16
- package/dist/sdk/components/orchestrator-panel-contexts.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel-store.d.ts +0 -52
- package/dist/sdk/components/orchestrator-panel-store.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel-types.d.ts +0 -18
- package/dist/sdk/components/orchestrator-panel-types.d.ts.map +0 -1
- package/dist/sdk/components/orchestrator-panel.d.ts +0 -86
- package/dist/sdk/components/orchestrator-panel.d.ts.map +0 -1
- package/dist/sdk/components/renderer-background.d.ts +0 -9
- package/dist/sdk/components/renderer-background.d.ts.map +0 -1
- package/dist/sdk/components/session-graph-panel.d.ts +0 -7
- package/dist/sdk/components/session-graph-panel.d.ts.map +0 -1
- package/dist/sdk/components/status-helpers.d.ts +0 -6
- package/dist/sdk/components/status-helpers.d.ts.map +0 -1
- package/dist/sdk/components/statusline.d.ts +0 -5
- package/dist/sdk/components/statusline.d.ts.map +0 -1
- package/dist/sdk/components/tui-diagnostics.d.ts +0 -56
- package/dist/sdk/components/tui-diagnostics.d.ts.map +0 -1
- package/dist/sdk/components/workflow-picker-panel.d.ts +0 -126
- package/dist/sdk/components/workflow-picker-panel.d.ts.map +0 -1
- package/dist/sdk/define-workflow.d.ts +0 -107
- package/dist/sdk/define-workflow.d.ts.map +0 -1
- package/dist/sdk/errors.d.ts +0 -46
- package/dist/sdk/errors.d.ts.map +0 -1
- package/dist/sdk/index.d.ts +0 -26
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/primitives/inputs.d.ts +0 -36
- package/dist/sdk/primitives/inputs.d.ts.map +0 -1
- package/dist/sdk/primitives/metadata.d.ts +0 -40
- package/dist/sdk/primitives/metadata.d.ts.map +0 -1
- package/dist/sdk/primitives/run.d.ts +0 -57
- package/dist/sdk/primitives/run.d.ts.map +0 -1
- package/dist/sdk/primitives/sessions.d.ts +0 -128
- package/dist/sdk/primitives/sessions.d.ts.map +0 -1
- package/dist/sdk/providers/claude.d.ts +0 -392
- package/dist/sdk/providers/claude.d.ts.map +0 -1
- package/dist/sdk/providers/copilot.d.ts +0 -55
- package/dist/sdk/providers/copilot.d.ts.map +0 -1
- package/dist/sdk/providers/opencode.d.ts +0 -27
- package/dist/sdk/providers/opencode.d.ts.map +0 -1
- package/dist/sdk/registry.d.ts +0 -27
- package/dist/sdk/registry.d.ts.map +0 -1
- package/dist/sdk/runtime/attached-footer.d.ts +0 -31
- package/dist/sdk/runtime/attached-footer.d.ts.map +0 -1
- package/dist/sdk/runtime/cc-debounce.d.ts +0 -29
- package/dist/sdk/runtime/cc-debounce.d.ts.map +0 -1
- package/dist/sdk/runtime/executor-env.d.ts +0 -20
- package/dist/sdk/runtime/executor-env.d.ts.map +0 -1
- package/dist/sdk/runtime/executor.d.ts +0 -265
- package/dist/sdk/runtime/executor.d.ts.map +0 -1
- package/dist/sdk/runtime/graph-inference.d.ts +0 -35
- package/dist/sdk/runtime/graph-inference.d.ts.map +0 -1
- package/dist/sdk/runtime/orchestrator-entry.d.ts +0 -26
- package/dist/sdk/runtime/orchestrator-entry.d.ts.map +0 -1
- package/dist/sdk/runtime/panel.d.ts +0 -9
- package/dist/sdk/runtime/panel.d.ts.map +0 -1
- package/dist/sdk/runtime/port-discovery.d.ts +0 -71
- package/dist/sdk/runtime/port-discovery.d.ts.map +0 -1
- package/dist/sdk/runtime/status-writer.d.ts +0 -101
- package/dist/sdk/runtime/status-writer.d.ts.map +0 -1
- package/dist/sdk/runtime/theme.d.ts +0 -33
- package/dist/sdk/runtime/theme.d.ts.map +0 -1
- package/dist/sdk/runtime/tmux.d.ts +0 -307
- package/dist/sdk/runtime/tmux.d.ts.map +0 -1
- package/dist/sdk/runtime/version-compat.d.ts +0 -28
- package/dist/sdk/runtime/version-compat.d.ts.map +0 -1
- package/dist/sdk/types.d.ts +0 -435
- package/dist/sdk/types.d.ts.map +0 -1
- package/dist/sdk/worker-shared.d.ts +0 -42
- package/dist/sdk/worker-shared.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +0 -81
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +0 -37
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts +0 -43
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +0 -14
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +0 -136
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts +0 -58
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts +0 -43
- package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +0 -37
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts +0 -68
- package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts +0 -56
- package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts +0 -72
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts +0 -46
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts +0 -32
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts +0 -33
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts +0 -106
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts +0 -50
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts +0 -12
- package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts +0 -58
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +0 -37
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +0 -34
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts +0 -25
- package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +0 -69
- package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +0 -266
- package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +0 -24
- package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +0 -1
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +0 -33
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +0 -1
- package/dist/sdk/workflows/index.d.ts +0 -32
- package/dist/sdk/workflows/index.d.ts.map +0 -1
- package/dist/services/config/additional-instructions.d.ts +0 -67
- package/dist/services/config/additional-instructions.d.ts.map +0 -1
- package/dist/services/config/atomic-config.d.ts +0 -42
- package/dist/services/config/atomic-config.d.ts.map +0 -1
- package/dist/services/config/definitions.d.ts +0 -52
- package/dist/services/config/definitions.d.ts.map +0 -1
- package/dist/services/config/index.d.ts +0 -7
- package/dist/services/config/index.d.ts.map +0 -1
- package/dist/services/config/scm-sync.d.ts +0 -37
- package/dist/services/config/scm-sync.d.ts.map +0 -1
- package/dist/services/config/settings-schema.d.ts +0 -2
- package/dist/services/config/settings-schema.d.ts.map +0 -1
- package/dist/services/system/copy.d.ts +0 -84
- package/dist/services/system/copy.d.ts.map +0 -1
- package/dist/services/system/detect.d.ts +0 -75
- package/dist/services/system/detect.d.ts.map +0 -1
- package/dist/theme/colors.d.ts +0 -35
- package/dist/theme/colors.d.ts.map +0 -1
- package/src/cli.ts +0 -397
- package/src/commands/builtin-registry.ts +0 -37
- package/src/commands/cli/chat/index.test.ts +0 -252
- package/src/commands/cli/chat/index.ts +0 -430
- package/src/commands/cli/chat.ts +0 -8
- package/src/commands/cli/claude-ask-hook.test.ts +0 -128
- package/src/commands/cli/claude-ask-hook.ts +0 -84
- package/src/commands/cli/claude-inflight-hook.test.ts +0 -598
- package/src/commands/cli/claude-inflight-hook.ts +0 -359
- package/src/commands/cli/claude-session-start-hook.ts +0 -61
- package/src/commands/cli/claude-stop-hook.test.ts +0 -317
- package/src/commands/cli/claude-stop-hook.ts +0 -441
- package/src/commands/cli/completions.ts +0 -24
- package/src/commands/cli/config.ts +0 -80
- package/src/commands/cli/footer.tsx +0 -248
- package/src/commands/cli/init/index.ts +0 -41
- package/src/commands/cli/init/onboarding.ts +0 -61
- package/src/commands/cli/init.ts +0 -8
- package/src/commands/cli/management-commands.ts +0 -112
- package/src/commands/cli/session.test.ts +0 -830
- package/src/commands/cli/session.ts +0 -447
- package/src/commands/cli/workflow-command.test.ts +0 -618
- package/src/commands/cli/workflow-inputs.test.ts +0 -353
- package/src/commands/cli/workflow-inputs.ts +0 -266
- package/src/commands/cli/workflow-list.test.ts +0 -235
- package/src/commands/cli/workflow-list.ts +0 -0
- package/src/commands/cli/workflow-status.test.ts +0 -451
- package/src/commands/cli/workflow-status.ts +0 -330
- package/src/commands/cli/workflow.ts +0 -196
- package/src/completions/bash.ts +0 -102
- package/src/completions/fish.ts +0 -136
- package/src/completions/index.ts +0 -7
- package/src/completions/powershell.ts +0 -195
- package/src/completions/zsh.ts +0 -150
- package/src/lib/atomic-temp.test.ts +0 -86
- package/src/lib/atomic-temp.ts +0 -62
- package/src/lib/common-ignore.ts +0 -46
- package/src/lib/merge.ts +0 -103
- package/src/lib/path-root-guard.ts +0 -38
- package/src/lib/spawn.test.ts +0 -109
- package/src/lib/spawn.ts +0 -678
- package/src/lib/terminal-env.test.ts +0 -343
- package/src/lib/terminal-env.ts +0 -100
- package/src/scripts/bump-version.ts +0 -94
- package/src/scripts/bundle-configs.ts +0 -116
- package/src/scripts/clean-dist.test.ts +0 -53
- package/src/scripts/clean-dist.ts +0 -37
- package/src/scripts/constants-base.ts +0 -14
- package/src/scripts/constants.ts +0 -35
- package/src/sdk/components/attached-statusline.tsx +0 -86
- package/src/sdk/components/color-utils.ts +0 -20
- package/src/sdk/components/compact-switcher.tsx +0 -78
- package/src/sdk/components/connectors.test.ts +0 -707
- package/src/sdk/components/connectors.ts +0 -160
- package/src/sdk/components/edge.tsx +0 -13
- package/src/sdk/components/error-boundary.tsx +0 -38
- package/src/sdk/components/graph-theme.ts +0 -37
- package/src/sdk/components/header.tsx +0 -85
- package/src/sdk/components/hooks.ts +0 -21
- package/src/sdk/components/layout.test.ts +0 -1245
- package/src/sdk/components/layout.ts +0 -223
- package/src/sdk/components/node-card.tsx +0 -91
- package/src/sdk/components/orchestrator-panel-contexts.ts +0 -35
- package/src/sdk/components/orchestrator-panel-store.test.ts +0 -847
- package/src/sdk/components/orchestrator-panel-store.ts +0 -187
- package/src/sdk/components/orchestrator-panel-types.ts +0 -23
- package/src/sdk/components/orchestrator-panel.tsx +0 -262
- package/src/sdk/components/renderer-background.ts +0 -49
- package/src/sdk/components/session-graph-panel.tsx +0 -471
- package/src/sdk/components/status-helpers.ts +0 -33
- package/src/sdk/components/statusline.tsx +0 -68
- package/src/sdk/components/tui-diagnostics.ts +0 -273
- package/src/sdk/components/workflow-picker-panel.tsx +0 -1613
- package/src/sdk/define-workflow.test.ts +0 -354
- package/src/sdk/define-workflow.ts +0 -275
- package/src/sdk/errors.test.ts +0 -83
- package/src/sdk/errors.ts +0 -77
- package/src/sdk/index.test.ts +0 -92
- package/src/sdk/index.ts +0 -101
- package/src/sdk/primitives/inputs.ts +0 -48
- package/src/sdk/primitives/metadata.ts +0 -63
- package/src/sdk/primitives/run.ts +0 -81
- package/src/sdk/primitives/sessions.test.ts +0 -594
- package/src/sdk/primitives/sessions.ts +0 -328
- package/src/sdk/providers/claude.ts +0 -1450
- package/src/sdk/providers/copilot.test.ts +0 -365
- package/src/sdk/providers/copilot.ts +0 -185
- package/src/sdk/providers/headless-hil-policy.test.ts +0 -211
- package/src/sdk/providers/opencode.ts +0 -88
- package/src/sdk/registry.ts +0 -132
- package/src/sdk/runtime/attached-footer.ts +0 -155
- package/src/sdk/runtime/cc-debounce.ts +0 -104
- package/src/sdk/runtime/executor-env.ts +0 -45
- package/src/sdk/runtime/executor.test.ts +0 -1321
- package/src/sdk/runtime/executor.ts +0 -2136
- package/src/sdk/runtime/graph-inference.ts +0 -50
- package/src/sdk/runtime/orchestrator-entry.ts +0 -110
- package/src/sdk/runtime/panel.tsx +0 -9
- package/src/sdk/runtime/port-discovery.test.ts +0 -573
- package/src/sdk/runtime/port-discovery.ts +0 -496
- package/src/sdk/runtime/status-writer.test.ts +0 -245
- package/src/sdk/runtime/status-writer.ts +0 -201
- package/src/sdk/runtime/theme.ts +0 -71
- package/src/sdk/runtime/tmux.conf +0 -112
- package/src/sdk/runtime/tmux.ts +0 -785
- package/src/sdk/runtime/version-compat.ts +0 -68
- package/src/sdk/types.ts +0 -548
- package/src/sdk/worker-shared.test.ts +0 -163
- package/src/sdk/worker-shared.ts +0 -155
- package/src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts +0 -569
- package/src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts +0 -481
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/batching.ts +0 -65
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.ts +0 -24
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/ignore-by-default.d.ts +0 -8
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.ts +0 -958
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scout.ts +0 -505
- package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.ts +0 -115
- package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +0 -530
- package/src/sdk/workflows/builtin/open-claude-design/claude/index.ts +0 -500
- package/src/sdk/workflows/builtin/open-claude-design/copilot/index.ts +0 -508
- package/src/sdk/workflows/builtin/open-claude-design/helpers/constants.ts +0 -159
- package/src/sdk/workflows/builtin/open-claude-design/helpers/design-system.ts +0 -88
- package/src/sdk/workflows/builtin/open-claude-design/helpers/export.ts +0 -193
- package/src/sdk/workflows/builtin/open-claude-design/helpers/import.ts +0 -52
- package/src/sdk/workflows/builtin/open-claude-design/helpers/prompts.ts +0 -1110
- package/src/sdk/workflows/builtin/open-claude-design/helpers/scan.ts +0 -117
- package/src/sdk/workflows/builtin/open-claude-design/helpers/validation.ts +0 -38
- package/src/sdk/workflows/builtin/open-claude-design/opencode/index.ts +0 -610
- package/src/sdk/workflows/builtin/ralph/claude/index.ts +0 -272
- package/src/sdk/workflows/builtin/ralph/copilot/index.ts +0 -298
- package/src/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.ts +0 -105
- package/src/sdk/workflows/builtin/ralph/helpers/git.ts +0 -201
- package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +0 -1108
- package/src/sdk/workflows/builtin/ralph/helpers/review.ts +0 -33
- package/src/sdk/workflows/builtin/ralph/opencode/index.ts +0 -290
- package/src/sdk/workflows/index.ts +0 -116
- package/src/services/config/additional-instructions.ts +0 -273
- package/src/services/config/atomic-config.ts +0 -210
- package/src/services/config/atomic-global-config.ts +0 -348
- package/src/services/config/config-path.ts +0 -19
- package/src/services/config/definitions.ts +0 -125
- package/src/services/config/index.ts +0 -7
- package/src/services/config/scm-sync.ts +0 -185
- package/src/services/config/settings-schema.ts +0 -2
- package/src/services/config/settings.ts +0 -144
- package/src/services/system/agents.ts +0 -95
- package/src/services/system/auth.test.ts +0 -343
- package/src/services/system/auth.ts +0 -140
- package/src/services/system/auto-sync.ts +0 -128
- package/src/services/system/copy.ts +0 -392
- package/src/services/system/detect.ts +0 -161
- package/src/services/system/file-lock.ts +0 -289
- package/src/services/system/install-ui.ts +0 -296
- package/src/services/system/skills.ts +0 -58
- package/src/theme/colors.ts +0 -96
- package/src/theme/logo.ts +0 -123
- package/src/version.ts +0 -7
|
@@ -1,891 +0,0 @@
|
|
|
1
|
-
# Agent Sessions
|
|
2
|
-
|
|
3
|
-
Each `ctx.stage()` call inside a workflow's `.run()` callback creates an isolated agent session. The runtime auto-initializes the provider client and session before invoking your callback — the callback receives `s` (a `SessionContext`) with `s.client` (the pre-created SDK client) and `s.session` (the pre-created session) ready to use. Auto-cleanup (disconnect, stop) is handled by the runtime after the callback completes. This is the programmatic equivalent of defining agent stages — you have full access to every SDK feature through `s.client` and `s.session`.
|
|
4
|
-
|
|
5
|
-
`ctx.stage()` takes four arguments: `ctx.stage(stageOpts, clientOpts, sessionOpts, callback)`.
|
|
6
|
-
|
|
7
|
-
## Claude Agent SDK
|
|
8
|
-
|
|
9
|
-
Claude runs as a full interactive TUI in a tmux pane. The runtime auto-starts the Claude CLI (via `s.client`) and creates a session wrapper (`s.session`) before the callback runs. Pass CLI flags via `clientOpts` (2nd arg). Claude has **no per-session options** — the 3rd arg must be `{}`.
|
|
10
|
-
|
|
11
|
-
### Session lifecycle
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { defineWorkflow } from "@bastani/atomic/workflows";
|
|
15
|
-
|
|
16
|
-
// ...
|
|
17
|
-
.run(async (ctx) => {
|
|
18
|
-
await ctx.stage(
|
|
19
|
-
{ name: "implement", description: "Implement the feature" },
|
|
20
|
-
{}, // clientOpts: chatFlags and readyTimeoutMs go here
|
|
21
|
-
{}, // sessionOpts: must be {} for Claude — no per-session options exist
|
|
22
|
-
async (s) => {
|
|
23
|
-
// s.client — Claude CLI wrapper (already started by runtime)
|
|
24
|
-
// s.session — session wrapper (ready to accept queries via s.session.query())
|
|
25
|
-
|
|
26
|
-
// Send queries — Claude maintains conversation context across calls
|
|
27
|
-
// Returns SessionMessage[] (native SDK type from @anthropic-ai/claude-agent-sdk)
|
|
28
|
-
const result = await s.session.query((s.inputs.prompt ?? ""));
|
|
29
|
-
|
|
30
|
-
// Save transcript
|
|
31
|
-
s.save(s.sessionId);
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
})
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
The runtime handles:
|
|
38
|
-
1. Starting the Claude CLI in the tmux pane
|
|
39
|
-
2. Creating a session wrapper bound to the pane (exposes `s.session.query()`)
|
|
40
|
-
3. Auto-cleanup after the callback returns
|
|
41
|
-
|
|
42
|
-
Client options (2nd arg to `ctx.stage()`):
|
|
43
|
-
- `chatFlags` — CLI flags (default: `["--allow-dangerously-skip-permissions", "--dangerously-skip-permissions"]`)
|
|
44
|
-
- `readyTimeoutMs` — timeout waiting for TUI readiness (default: 30s)
|
|
45
|
-
|
|
46
|
-
Session options (3rd arg to `ctx.stage()`): **none**. The Claude session wrapper takes no configuration — interactive delivery is driven entirely by the CLI's Stop hook, and idle detection watches the Stop-hook marker automatically. Pass `{}`.
|
|
47
|
-
|
|
48
|
-
For **headless Claude** (`headless: true` in `stageOpts`), `s.session.query(prompt, options)` forwards its second argument as `Partial<SDKOptions>` to the Agent SDK — that's where you pass `agent`, `permissionMode`, `allowDangerouslySkipPermissions`, etc. (see the headless example further down).
|
|
49
|
-
|
|
50
|
-
No manual timeout is needed — idle detection watches for the pane prompt to return, and the session transcript is used to extract the response text.
|
|
51
|
-
|
|
52
|
-
### Basic usage with `s.session.query()`
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
import { defineWorkflow } from "@bastani/atomic/workflows";
|
|
56
|
-
|
|
57
|
-
export default defineWorkflow({
|
|
58
|
-
name: "implement",
|
|
59
|
-
source: import.meta.path,
|
|
60
|
-
inputs: [{ name: "prompt", type: "text", required: true, description: "task prompt" }],
|
|
61
|
-
})
|
|
62
|
-
.for("claude")
|
|
63
|
-
.run(async (ctx) => {
|
|
64
|
-
await ctx.stage(
|
|
65
|
-
{ name: "implement", description: "Implement the feature" },
|
|
66
|
-
{},
|
|
67
|
-
{},
|
|
68
|
-
async (s) => {
|
|
69
|
-
const messages = await s.session.query((s.inputs.prompt ?? ""));
|
|
70
|
-
// messages is SessionMessage[] — native SDK type
|
|
71
|
-
// Use extractAssistantText(messages, 0) to get the text response
|
|
72
|
-
s.save(s.sessionId);
|
|
73
|
-
},
|
|
74
|
-
);
|
|
75
|
-
})
|
|
76
|
-
.compile();
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
`s.session.query(prompt)` sends text to the Claude pane, verifies delivery, retries if needed, and waits for output stabilization. Returns `SessionMessage[]` (the native transcript messages from this turn, imported from `@anthropic-ai/claude-agent-sdk`). Use `extractAssistantText(messages, 0)` to extract the plain text response.
|
|
80
|
-
|
|
81
|
-
### Multi-turn conversations
|
|
82
|
-
|
|
83
|
-
Claude maintains conversation context across calls within the same pane. Call `s.session.query()` multiple times in one stage for multi-turn conversations:
|
|
84
|
-
|
|
85
|
-
```ts
|
|
86
|
-
.run(async (ctx) => {
|
|
87
|
-
await ctx.stage({ name: "implement" }, {}, {}, async (s) => {
|
|
88
|
-
// Turn 1: Plan
|
|
89
|
-
await s.session.query("Plan the implementation.");
|
|
90
|
-
// Turn 2: Execute (Claude remembers the plan)
|
|
91
|
-
await s.session.query("Now implement the plan.");
|
|
92
|
-
// Turn 3: Verify
|
|
93
|
-
await s.session.query("Run the tests.");
|
|
94
|
-
s.save(s.sessionId);
|
|
95
|
-
});
|
|
96
|
-
})
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Advanced: Claude Agent SDK `query()` option surface (reference only)
|
|
100
|
-
|
|
101
|
-
**Do not import `query` from `@anthropic-ai/claude-agent-sdk` inside a `ctx.stage()` callback.** In a non-headless stage it double-spawns Claude (idle TUI pane + in-process SDK call) — see `failure-modes.md` §F16. In a headless stage it bypasses the runtime's wiring. Always go through `s.session.query()`; the runtime forwards options to the SDK for headless stages and routes the interactive TUI for non-headless stages.
|
|
102
|
-
|
|
103
|
-
Two correct routes:
|
|
104
|
-
|
|
105
|
-
1. **Headless + SDK options** — `s.session.query(prompt, sdkOptions)` inside `{ headless: true }`.
|
|
106
|
-
2. **Interactive TUI + `--agent`** — `chatFlags: ["--agent", "<name>", ...]` in `clientOpts`.
|
|
107
|
-
|
|
108
|
-
For the full SDK option surface, see `session-config.md` §"`query()` options".
|
|
109
|
-
|
|
110
|
-
Example workflow usage in a headless stage:
|
|
111
|
-
|
|
112
|
-
```ts
|
|
113
|
-
await ctx.stage({ name: "implement", headless: true }, {}, {}, async (s) => {
|
|
114
|
-
const messages = await s.session.query(s.inputs.prompt ?? "", {
|
|
115
|
-
model: "claude-opus-4-6",
|
|
116
|
-
permissionMode: "acceptEdits",
|
|
117
|
-
allowedTools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"],
|
|
118
|
-
outputFormat: {
|
|
119
|
-
type: "json_schema",
|
|
120
|
-
schema: { type: "object", properties: { tasks: { type: "array", items: { type: "string" } } } },
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
s.save(s.sessionId);
|
|
124
|
-
return extractAssistantText(messages, 0);
|
|
125
|
-
});
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Key `query()` options:
|
|
129
|
-
- `model` — model ID (`"claude-opus-4-6"`, `"claude-sonnet-4-6"`) or alias (`"opus"`, `"sonnet"`, `"haiku"`)
|
|
130
|
-
- `effort` — reasoning effort (`"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` — `"max"` is Opus 4.6/4.7 only)
|
|
131
|
-
- `thinking` — thinking/reasoning config: `{ type: "adaptive" }` (default for supported models), `{ type: "enabled", budgetTokens: N }`, or `{ type: "disabled" }`
|
|
132
|
-
- `maxTurns` — maximum conversation turns
|
|
133
|
-
- `maxBudgetUsd` — spending cap in USD
|
|
134
|
-
- `permissionMode` — `"default"`, `"dontAsk"`, `"acceptEdits"`, `"bypassPermissions"`, `"plan"`
|
|
135
|
-
- `allowedTools` / `disallowedTools` — tool access control
|
|
136
|
-
- `tools` — base set of available built-in tools: `string[]` for specific tools, `[]` to disable all, or `{ type: "preset", preset: "claude_code" }` for defaults
|
|
137
|
-
- `systemPrompt` — custom system prompt (`string`) or preset with additions (`{ type: "preset", preset: "claude_code", append: "..." }`)
|
|
138
|
-
- `outputFormat` — structured output: `{ type: "json_schema", schema: { ... } }`
|
|
139
|
-
- `agents` — `Record<string, AgentDefinition>` — named subagents for orchestration
|
|
140
|
-
- `agent` — main thread agent name (must be defined in `agents` or settings)
|
|
141
|
-
- `resume` — session ID to resume a prior session
|
|
142
|
-
- `forkSession` — `boolean` — when `true` with `resume`, forks to a new session instead of continuing
|
|
143
|
-
- `mcpServers` — MCP server configurations
|
|
144
|
-
- `hooks` — `Partial<Record<HookEvent, HookCallbackMatcher[]>>` — event-driven callbacks (see `session-config.md`)
|
|
145
|
-
- `sandbox` — sandboxed command execution settings
|
|
146
|
-
- `betas` — enable beta features (e.g. `["context-1m-2025-08-07"]` for 1M context on Sonnet)
|
|
147
|
-
|
|
148
|
-
### Subagents
|
|
149
|
-
|
|
150
|
-
Claude supports parallel subagents via the `agents` option (a
|
|
151
|
-
`Record<string, AgentDefinition>` keyed by agent name). In a workflow,
|
|
152
|
-
pass the option through `s.session.query(prompt, sdkOptions)` in a
|
|
153
|
-
**headless** stage — see §F16 for why the raw SDK `query()` import is
|
|
154
|
-
an anti-pattern:
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
await ctx.stage(
|
|
158
|
-
{ name: "implement-and-review", headless: true },
|
|
159
|
-
{}, {},
|
|
160
|
-
async (s) => {
|
|
161
|
-
const messages = await s.session.query(
|
|
162
|
-
"Implement and review the feature",
|
|
163
|
-
{
|
|
164
|
-
agents: {
|
|
165
|
-
worker: {
|
|
166
|
-
description: "Implement a single task",
|
|
167
|
-
prompt: "You are a task implementer...",
|
|
168
|
-
tools: ["Read", "Write", "Edit", "Bash"],
|
|
169
|
-
},
|
|
170
|
-
reviewer: {
|
|
171
|
-
description: "Review code changes",
|
|
172
|
-
prompt: "You are a code reviewer...",
|
|
173
|
-
tools: ["Read", "Grep", "Glob"],
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
);
|
|
178
|
-
s.save(s.sessionId);
|
|
179
|
-
return extractAssistantText(messages, 0);
|
|
180
|
-
},
|
|
181
|
-
);
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Session continuity
|
|
185
|
-
|
|
186
|
-
Resume or fork prior sessions through `s.session.query()` in a headless
|
|
187
|
-
stage (same reasoning as Subagents above — never import `query` directly):
|
|
188
|
-
|
|
189
|
-
```ts
|
|
190
|
-
// Resume a session (continues the same conversation)
|
|
191
|
-
await ctx.stage({ name: "continue", headless: true }, {}, {}, async (s) => {
|
|
192
|
-
const messages = await s.session.query("Continue...", { resume: sessionId });
|
|
193
|
-
s.save(s.sessionId);
|
|
194
|
-
return extractAssistantText(messages, 0);
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
// Fork a session (creates a new branch from the session's history)
|
|
198
|
-
await ctx.stage({ name: "fork", headless: true }, {}, {}, async (s) => {
|
|
199
|
-
const messages = await s.session.query(
|
|
200
|
-
"Try a different approach",
|
|
201
|
-
{ resume: sessionId, forkSession: true },
|
|
202
|
-
);
|
|
203
|
-
s.save(s.sessionId);
|
|
204
|
-
return extractAssistantText(messages, 0);
|
|
205
|
-
});
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Subagent delegation
|
|
209
|
-
|
|
210
|
-
For stages that call a single subagent, use `--agent` (interactive) or the SDK `agent` option (headless) to route all prompts through that agent. The agent must be defined in `.claude/agents/` or `.agents/skills/`.
|
|
211
|
-
|
|
212
|
-
**Interactive stages** — pass `--agent` via `chatFlags` in client opts (2nd arg):
|
|
213
|
-
|
|
214
|
-
```ts
|
|
215
|
-
.run(async (ctx) => {
|
|
216
|
-
await ctx.stage(
|
|
217
|
-
{ name: "plan" },
|
|
218
|
-
{ chatFlags: ["--agent", "planner", "--allow-dangerously-skip-permissions", "--dangerously-skip-permissions"] },
|
|
219
|
-
{},
|
|
220
|
-
async (s) => {
|
|
221
|
-
await s.session.query(`Create a plan for: ${(s.inputs.prompt ?? "")}`);
|
|
222
|
-
s.save(s.sessionId);
|
|
223
|
-
},
|
|
224
|
-
);
|
|
225
|
-
})
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
**Headless stages** — pass `agent` via SDK options in the `query()` call:
|
|
229
|
-
|
|
230
|
-
```ts
|
|
231
|
-
.run(async (ctx) => {
|
|
232
|
-
const handle = await ctx.stage(
|
|
233
|
-
{ name: "locate", headless: true },
|
|
234
|
-
{}, {},
|
|
235
|
-
async (s) => {
|
|
236
|
-
const result = await s.session.query(
|
|
237
|
-
"Find all API endpoint files",
|
|
238
|
-
{ agent: "codebase-locator", permissionMode: "bypassPermissions", allowDangerouslySkipPermissions: true },
|
|
239
|
-
);
|
|
240
|
-
s.save(s.sessionId);
|
|
241
|
-
return extractAssistantText(result, 0);
|
|
242
|
-
},
|
|
243
|
-
);
|
|
244
|
-
})
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
> **Note:** The `@"agent-name (agent)"` prompt prefix is for multi-agent conversations in a single stage where you switch between agents mid-session. For single-agent stages, prefer `--agent` (interactive) or the `agent` SDK option (headless) as shown above.
|
|
248
|
-
|
|
249
|
-
### Headless mode (background stages)
|
|
250
|
-
|
|
251
|
-
Claude headless stages use the Agent SDK's `query()` API directly in-process instead of automating a tmux pane. Set `headless: true` in the stage options. SDK options like `agent`, `permissionMode`, and `allowDangerouslySkipPermissions` can be passed directly in the `query()` call:
|
|
252
|
-
|
|
253
|
-
```ts
|
|
254
|
-
import { defineWorkflow, extractAssistantText } from "@bastani/atomic/workflows";
|
|
255
|
-
|
|
256
|
-
// ...
|
|
257
|
-
await ctx.stage(
|
|
258
|
-
{ name: "background-analysis", headless: true },
|
|
259
|
-
{}, {},
|
|
260
|
-
async (s) => {
|
|
261
|
-
const result = await s.session.query(
|
|
262
|
-
"Analyze the codebase.",
|
|
263
|
-
{ agent: "codebase-analyzer", permissionMode: "bypassPermissions", allowDangerouslySkipPermissions: true },
|
|
264
|
-
);
|
|
265
|
-
s.save(s.sessionId);
|
|
266
|
-
return extractAssistantText(result, 0);
|
|
267
|
-
},
|
|
268
|
-
);
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
The callback interface is identical to interactive stages — `s.session.query()` returns `SessionMessage[]` in both cases. Internally, the runtime uses `HeadlessClaudeSessionWrapper` which calls `query()` from `@anthropic-ai/claude-agent-sdk` directly. No tmux pane is created, and the stage is invisible in the workflow graph.
|
|
272
|
-
|
|
273
|
-
**Design principle:** Never create custom message types. All provider return types are native SDK types — `SessionMessage[]` for Claude, `SessionEvent[]` for Copilot, `SessionPromptResponse` for OpenCode. Use `extractAssistantText()` to extract plain text from Claude's `SessionMessage[]`.
|
|
274
|
-
|
|
275
|
-
## Copilot SDK
|
|
276
|
-
|
|
277
|
-
Copilot uses a client-server architecture. The runtime auto-creates a `CopilotClient` (as `s.client`) and a `CopilotSession` (as `s.session`) before invoking your callback. Auto-cleanup (`session.disconnect()` and `client.stop()`) is handled by the runtime after the callback completes.
|
|
278
|
-
|
|
279
|
-
### Basic usage
|
|
280
|
-
|
|
281
|
-
```ts
|
|
282
|
-
import { defineWorkflow } from "@bastani/atomic/workflows";
|
|
283
|
-
|
|
284
|
-
export default defineWorkflow({
|
|
285
|
-
name: "implement",
|
|
286
|
-
source: import.meta.path,
|
|
287
|
-
inputs: [{ name: "prompt", type: "text", required: true, description: "task prompt" }],
|
|
288
|
-
})
|
|
289
|
-
.for("copilot")
|
|
290
|
-
.run(async (ctx) => {
|
|
291
|
-
await ctx.stage(
|
|
292
|
-
{ name: "implement" },
|
|
293
|
-
{}, // clientOpts: CopilotClientOptions (excluding cliUrl, which is auto-injected)
|
|
294
|
-
{}, // sessionOpts: CopilotSessionConfig (model, agent, tools, hooks, etc.)
|
|
295
|
-
async (s) => {
|
|
296
|
-
// s.client — CopilotClient (already started by runtime)
|
|
297
|
-
// s.session — CopilotSession (already created, foreground session set)
|
|
298
|
-
|
|
299
|
-
await s.session.send({ prompt: (s.inputs.prompt ?? "") });
|
|
300
|
-
|
|
301
|
-
s.save(await s.session.getMessages());
|
|
302
|
-
},
|
|
303
|
-
);
|
|
304
|
-
})
|
|
305
|
-
.compile();
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
### `send` vs `sendAndWait`: choosing the right method
|
|
309
|
-
|
|
310
|
-
**Always use `send`** for Copilot workflow stages. Inside a stage callback the
|
|
311
|
-
Atomic runtime wraps `s.session.send()` so the returned promise only resolves
|
|
312
|
-
when the session emits `session.idle` — the same semantics as Claude's
|
|
313
|
-
`query()` and OpenCode's `session.prompt()`. The wrapper has **no timeout**,
|
|
314
|
-
so long-running planners and reviewers are safe. This is different from the
|
|
315
|
-
raw Copilot SDK, where `send` is fire-and-forget; the wrapper is installed
|
|
316
|
-
per-stage by the runtime (`wrapCopilotSend` in `src/sdk/runtime/executor.ts`).
|
|
317
|
-
|
|
318
|
-
```ts
|
|
319
|
-
// Default pattern — blocks until the agent is idle, no timeout
|
|
320
|
-
await s.session.send({ prompt });
|
|
321
|
-
const messages = await s.session.getMessages(); // safe to read now
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
**Do not use `sendAndWait` in Atomic workflows.** It keeps the SDK's native
|
|
325
|
-
60-second default timeout, which is almost never enough for real agent work —
|
|
326
|
-
planners, reviewers, and orchestrators routinely exceed it, and the throw
|
|
327
|
-
propagates out of `run()` and halts the whole workflow (see
|
|
328
|
-
`failure-modes.md` §F10). `send` already blocks until idle with no timeout,
|
|
329
|
-
so `sendAndWait` buys you nothing but a failure mode. If you think you need
|
|
330
|
-
it, you almost certainly want `send`.
|
|
331
|
-
|
|
332
|
-
### Critical pitfall: session lifecycle controls what context is available
|
|
333
|
-
|
|
334
|
-
A workflow is not just a sequence of agent calls — it is an **information
|
|
335
|
-
flow problem**. The single most common failure mode in Copilot workflows is
|
|
336
|
-
assuming context carries across session boundaries when it doesn't.
|
|
337
|
-
Designing a workflow without thinking about information flow produces
|
|
338
|
-
subagents that hallucinate, repeat work, or drop requirements silently.
|
|
339
|
-
|
|
340
|
-
**Treat this section as load-bearing**, not decorative. If you skip it, your
|
|
341
|
-
workflow will ship broken in subtle, non-deterministic ways.
|
|
342
|
-
|
|
343
|
-
#### Session lifecycle states
|
|
344
|
-
|
|
345
|
-
For normal workflow authoring, use the **3-state rubric** from SKILL.md:
|
|
346
|
-
`Fresh` / `Continued` / `Closed`. Every new `ctx.stage()` call is fresh; if
|
|
347
|
-
you need full history, prefer another turn inside the same stage callback.
|
|
348
|
-
|
|
349
|
-
Copilot also exposes an advanced `Resumed` state at the provider level. Each
|
|
350
|
-
state determines what context the model sees on its next turn:
|
|
351
|
-
|
|
352
|
-
| State | How you get there | Context available | Action needed |
|
|
353
|
-
| ------------------------ | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
354
|
-
| **Fresh** | `client.createSession(...)` (what `ctx.stage()` does) | **None** — empty conversation | You MUST inject everything the agent needs in the first prompt |
|
|
355
|
-
| **Continued** | Same session, additional `send` calls | All prior turns in this session | Nothing — but watch total token usage |
|
|
356
|
-
| **Resumed** *(advanced)* | `client.resumeSession(sessionId)` | All persisted turns from the prior session of the SAME agent | Nothing — full history is reattached. Use only for same-role continuation |
|
|
357
|
-
| **Closed** | `session.disconnect()` or `client.stop()` (auto-handled by runtime after the stage callback returns) | **Gone** from the live client; persisted on disk if the host enables it | Either resume by ID (same agent) or start fresh and re-inject context |
|
|
358
|
-
|
|
359
|
-
The failure mode: you close a session, create a new one, and assume the new
|
|
360
|
-
one "remembers" the previous conversation. It doesn't. `client` is just the
|
|
361
|
-
transport — each session is a fully independent conversation. Resume/fork
|
|
362
|
-
APIs are provider-specific escape hatches, not the default stage-to-stage
|
|
363
|
-
handoff path.
|
|
364
|
-
|
|
365
|
-
```ts
|
|
366
|
-
// Buggy — the orchestrator stage is fresh and knows NOTHING about what
|
|
367
|
-
// the planner just produced, because each ctx.stage() starts a brand-new
|
|
368
|
-
// conversation for Copilot.
|
|
369
|
-
await ctx.stage({ name: "planner" }, {}, { agent: "planner" }, async (s) => {
|
|
370
|
-
await s.session.send({ prompt: buildPlannerPrompt((s.inputs.prompt ?? "")) });
|
|
371
|
-
s.save(await s.session.getMessages());
|
|
372
|
-
});
|
|
373
|
-
await ctx.stage({ name: "orchestrator" }, {}, { agent: "orchestrator" }, async (s) => {
|
|
374
|
-
await s.session.send({ prompt: buildOrchestratorPrompt() });
|
|
375
|
-
s.save(await s.session.getMessages());
|
|
376
|
-
});
|
|
377
|
-
// ↑ orchestrator only sees buildOrchestratorPrompt() — no planner output,
|
|
378
|
-
// no original user spec, no context.
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
#### Three reliable ways to avoid losing context
|
|
382
|
-
|
|
383
|
-
Pick the one that fits the data you need to hand off. These are not
|
|
384
|
-
mutually exclusive — ralph uses (1) + (2) together as belt-and-braces.
|
|
385
|
-
|
|
386
|
-
**1. Explicit prompt handoff** — capture the prior session's last assistant
|
|
387
|
-
message and inject it (or a summary) into the next session's first prompt.
|
|
388
|
-
Simplest and most common fix. Use `ctx.stage()` — the runtime auto-creates
|
|
389
|
-
and cleans up each session, so never call `client.createSession()` directly
|
|
390
|
-
(see Structural Rule 7 in SKILL.md):
|
|
391
|
-
|
|
392
|
-
```ts
|
|
393
|
-
// Correct — forward the planner's output into the orchestrator prompt
|
|
394
|
-
const plannerHandle = await ctx.stage(
|
|
395
|
-
{ name: "planner" },
|
|
396
|
-
{},
|
|
397
|
-
{ agent: "planner" },
|
|
398
|
-
async (s) => {
|
|
399
|
-
await s.session.send({ prompt: buildPlannerPrompt((s.inputs.prompt ?? "")) });
|
|
400
|
-
const messages = await s.session.getMessages();
|
|
401
|
-
s.save(messages);
|
|
402
|
-
return getAssistantText(messages); // see failure-modes.md §F1 for getAssistantText
|
|
403
|
-
},
|
|
404
|
-
);
|
|
405
|
-
|
|
406
|
-
await ctx.stage(
|
|
407
|
-
{ name: "orchestrator" },
|
|
408
|
-
{},
|
|
409
|
-
{ agent: "orchestrator" },
|
|
410
|
-
async (s) => {
|
|
411
|
-
await s.session.send({
|
|
412
|
-
prompt: buildOrchestratorPrompt(
|
|
413
|
-
(s.inputs.prompt ?? ""),
|
|
414
|
-
{ plannerNotes: plannerHandle.result },
|
|
415
|
-
),
|
|
416
|
-
});
|
|
417
|
-
s.save(await s.session.getMessages());
|
|
418
|
-
},
|
|
419
|
-
);
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
**2. External shared state** — write results to a medium both sessions can
|
|
423
|
-
read: the task list (`TaskCreate` / `TaskList`), files on disk, a git
|
|
424
|
-
working tree, or a database. The planner writes; the orchestrator reads.
|
|
425
|
-
Ralph uses `TaskCreate`/`TaskList` as its primary coordination medium.
|
|
426
|
-
|
|
427
|
-
**3. Keep the follow-up in the same stage callback** — if the next step needs
|
|
428
|
-
the full live conversation, don't cross a stage boundary. Send another turn to
|
|
429
|
-
the same session instead. This is the standard workflow-API way to preserve
|
|
430
|
-
history across related steps.
|
|
431
|
-
|
|
432
|
-
```ts
|
|
433
|
-
// Same stage, multi-turn — full history stays attached
|
|
434
|
-
await s.session.send({ prompt: "Plan the implementation." });
|
|
435
|
-
await s.session.send({ prompt: "Follow up on the plan above." });
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
If you deliberately drop down to provider-specific resume/fork APIs, keep them
|
|
439
|
-
within the same agent role. They are advanced escape hatches, not the normal
|
|
440
|
-
way stages communicate.
|
|
441
|
-
|
|
442
|
-
#### When context grows too large: compaction and clearing
|
|
443
|
-
|
|
444
|
-
Even within a single continued session, context can grow past the window.
|
|
445
|
-
Symptoms include lost-in-middle failures, repeated questions, and the model
|
|
446
|
-
"forgetting" earlier decisions. When that happens, you have two levers:
|
|
447
|
-
|
|
448
|
-
- **Compaction** — summarize the prior transcript into a shorter form and
|
|
449
|
-
feed it forward (either into a new session, or by starting a follow-up
|
|
450
|
-
session seeded with the summary). Most SDKs expose this as a built-in
|
|
451
|
-
command (Claude Code's `/compact` slash command, or programmatic helpers
|
|
452
|
-
in the OpenCode SDK). If the SDK you're using doesn't, roll your own with
|
|
453
|
-
a summarization call and start a fresh session with the summary in the
|
|
454
|
-
first prompt.
|
|
455
|
-
- **Clearing** — drop old turns entirely when they're no longer load-bearing
|
|
456
|
-
(e.g. one-shot tool outputs whose results were already captured to files).
|
|
457
|
-
Claude's `/clear`, per-SDK `clearHistory`-style APIs, or simply starting a
|
|
458
|
-
new session with only the essentials in prompt 1 all work.
|
|
459
|
-
|
|
460
|
-
Neither is free: compaction loses detail, clearing loses provenance. The
|
|
461
|
-
`context-compression` and `context-optimization` skills below cover the
|
|
462
|
-
trade-offs in depth.
|
|
463
|
-
|
|
464
|
-
#### Context engineering skills — consult these BEFORE writing code
|
|
465
|
-
|
|
466
|
-
Information flow is a design problem, not an implementation detail. Before
|
|
467
|
-
committing to a session layout, pull in the relevant skills:
|
|
468
|
-
|
|
469
|
-
| When you're deciding... | Consult |
|
|
470
|
-
| ------------------------------------------------------------------------ | ---------------------- |
|
|
471
|
-
| What context each session actually needs (anatomy + token budget) | `context-fundamentals` |
|
|
472
|
-
| How many sessions and how they hand off (orchestrator vs peers vs swarm) | `multi-agent-patterns` |
|
|
473
|
-
| How to compress large planner/reviewer output before re-injecting | `context-compression` |
|
|
474
|
-
| How to detect and prevent lost-in-middle, poisoning, and distraction | `context-degradation` |
|
|
475
|
-
| How to use files as coordination medium across sessions | `filesystem-context` |
|
|
476
|
-
| How to persist knowledge across whole workflow runs | `memory-systems` |
|
|
477
|
-
| Which turns to drop, which to cache, when to compact | `context-optimization` |
|
|
478
|
-
|
|
479
|
-
These aren't optional reading — they're the difference between a workflow
|
|
480
|
-
that works on day one and a workflow that silently degrades as inputs grow.
|
|
481
|
-
If you're about to write a multi-session workflow and you haven't consulted
|
|
482
|
-
at least `context-fundamentals` and `multi-agent-patterns`, **stop and read
|
|
483
|
-
them first.**
|
|
484
|
-
|
|
485
|
-
### Multi-turn conversations
|
|
486
|
-
|
|
487
|
-
Send multiple prompts to the same session:
|
|
488
|
-
|
|
489
|
-
```ts
|
|
490
|
-
.run(async (ctx) => {
|
|
491
|
-
await ctx.stage({ name: "implement" }, {}, {}, async (s) => {
|
|
492
|
-
// Turn 1
|
|
493
|
-
await s.session.send({ prompt: "Plan the implementation." });
|
|
494
|
-
// Turn 2
|
|
495
|
-
await s.session.send({ prompt: "Now implement the plan." });
|
|
496
|
-
// Turn 3
|
|
497
|
-
await s.session.send({ prompt: "Run the tests." });
|
|
498
|
-
|
|
499
|
-
s.save(await s.session.getMessages());
|
|
500
|
-
});
|
|
501
|
-
})
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
### Session configuration
|
|
505
|
-
|
|
506
|
-
Pass session config options as the 3rd arg to `ctx.stage()` (`sessionOpts`). These are forwarded to `client.createSession()`:
|
|
507
|
-
|
|
508
|
-
```ts
|
|
509
|
-
await ctx.stage(
|
|
510
|
-
{ name: "audit" },
|
|
511
|
-
{}, // clientOpts
|
|
512
|
-
{
|
|
513
|
-
model: "claude-sonnet-4.6",
|
|
514
|
-
reasoningEffort: "high",
|
|
515
|
-
systemMessage: "You are a security auditor...",
|
|
516
|
-
onUserInputRequest: (request) => { /* handle user input */ },
|
|
517
|
-
hooks: {
|
|
518
|
-
onPreToolUse: (event) => { /* before tool execution */ },
|
|
519
|
-
onPostToolUse: (event) => { /* after tool execution */ },
|
|
520
|
-
},
|
|
521
|
-
}, // sessionOpts
|
|
522
|
-
async (s) => {
|
|
523
|
-
await s.session.send({ prompt: (s.inputs.prompt ?? "") });
|
|
524
|
-
s.save(await s.session.getMessages());
|
|
525
|
-
},
|
|
526
|
-
);
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
### Custom tools
|
|
530
|
-
|
|
531
|
-
```ts
|
|
532
|
-
import { defineTool } from "@github/copilot-sdk";
|
|
533
|
-
|
|
534
|
-
const myTool = defineTool({
|
|
535
|
-
name: "check-coverage",
|
|
536
|
-
description: "Check test coverage",
|
|
537
|
-
parameters: { type: "object", properties: { path: { type: "string" } } },
|
|
538
|
-
execute: async (params) => {
|
|
539
|
-
// Run coverage check
|
|
540
|
-
return { content: "Coverage: 85%" };
|
|
541
|
-
},
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
// Pass tools via sessionOpts (3rd arg to ctx.stage())
|
|
545
|
-
await ctx.stage(
|
|
546
|
-
{ name: "implement" },
|
|
547
|
-
{},
|
|
548
|
-
{ tools: [myTool] },
|
|
549
|
-
async (s) => {
|
|
550
|
-
await s.session.send({ prompt: (s.inputs.prompt ?? "") });
|
|
551
|
-
s.save(await s.session.getMessages());
|
|
552
|
-
},
|
|
553
|
-
);
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
### Extracting response text
|
|
557
|
-
|
|
558
|
-
Do **not** just grab `.at(-1).data.content` — a Copilot turn's final
|
|
559
|
-
`assistant.message` often has empty `content` (tool-calls-only) and
|
|
560
|
-
subagent messages can pollute the stream via `parentToolCallId`. Concatenate
|
|
561
|
-
every top-level turn's non-empty content instead.
|
|
562
|
-
|
|
563
|
-
The canonical `getAssistantText` helper lives in `failure-modes.md` §F1 —
|
|
564
|
-
copy it into a sibling `helpers/parsers.ts` and import it. Usage:
|
|
565
|
-
|
|
566
|
-
```ts
|
|
567
|
-
import { getAssistantText } from "../helpers/parsers.ts";
|
|
568
|
-
|
|
569
|
-
const messages = await s.session.getMessages();
|
|
570
|
-
const text = getAssistantText(messages);
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
### Streaming events
|
|
574
|
-
|
|
575
|
-
```ts
|
|
576
|
-
// s.session is the CopilotSession — subscribe to events directly
|
|
577
|
-
s.session.on("assistant.message_delta", (event) => {
|
|
578
|
-
process.stdout.write(event.data.content);
|
|
579
|
-
});
|
|
580
|
-
|
|
581
|
-
s.session.on("assistant.reasoning_delta", (event) => {
|
|
582
|
-
// Access reasoning output
|
|
583
|
-
});
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
### Subagent delegation
|
|
587
|
-
|
|
588
|
-
Pass the `agent` parameter in `sessionOpts` (3rd arg to `ctx.stage()`) to bind the session to a named subagent:
|
|
589
|
-
|
|
590
|
-
```ts
|
|
591
|
-
.run(async (ctx) => {
|
|
592
|
-
await ctx.stage(
|
|
593
|
-
{ name: "plan" },
|
|
594
|
-
{},
|
|
595
|
-
{ agent: "planner" }, // sessionOpts — binds the session to the "planner" agent
|
|
596
|
-
async (s) => {
|
|
597
|
-
await s.session.send({ prompt: (s.inputs.prompt ?? "") });
|
|
598
|
-
s.save(await s.session.getMessages());
|
|
599
|
-
},
|
|
600
|
-
);
|
|
601
|
-
})
|
|
602
|
-
```
|
|
603
|
-
|
|
604
|
-
### Headless mode (background stages)
|
|
605
|
-
|
|
606
|
-
Copilot headless stages let the SDK spawn its own CLI subprocess internally — no tmux pane is needed. Set `headless: true`:
|
|
607
|
-
|
|
608
|
-
```ts
|
|
609
|
-
await ctx.stage(
|
|
610
|
-
{ name: "background-task", headless: true },
|
|
611
|
-
{}, {},
|
|
612
|
-
async (s) => {
|
|
613
|
-
// s.session.send() works identically
|
|
614
|
-
await s.session.send({ prompt: "Analyze the codebase." });
|
|
615
|
-
s.save(await s.session.getMessages());
|
|
616
|
-
},
|
|
617
|
-
);
|
|
618
|
-
```
|
|
619
|
-
|
|
620
|
-
The SDK creates a `CopilotClient` without a `cliUrl` — it spawns its own CLI process internally rather than connecting to a tmux-hosted server. The callback interface is identical.
|
|
621
|
-
|
|
622
|
-
## OpenCode SDK
|
|
623
|
-
|
|
624
|
-
OpenCode uses a client-server model. The runtime auto-creates an `OpencodeClient` (as `s.client`) and an OpenCode session (as `s.session`) before invoking your callback. Use `s.client.session.prompt({ sessionID: s.session.id, ... })` to send prompts.
|
|
625
|
-
|
|
626
|
-
### Basic usage
|
|
627
|
-
|
|
628
|
-
```ts
|
|
629
|
-
import { defineWorkflow } from "@bastani/atomic/workflows";
|
|
630
|
-
|
|
631
|
-
export default defineWorkflow({
|
|
632
|
-
name: "implement",
|
|
633
|
-
source: import.meta.path,
|
|
634
|
-
inputs: [{ name: "prompt", type: "text", required: true, description: "task prompt" }],
|
|
635
|
-
})
|
|
636
|
-
.for("opencode")
|
|
637
|
-
.run(async (ctx) => {
|
|
638
|
-
await ctx.stage(
|
|
639
|
-
{ name: "implement" },
|
|
640
|
-
{}, // clientOpts: directory, experimental_workspaceID
|
|
641
|
-
{ title: "implement" }, // sessionOpts: title, parentID, workspaceID
|
|
642
|
-
async (s) => {
|
|
643
|
-
// s.client — OpencodeClient (already connected)
|
|
644
|
-
// s.session — OpenCode Session (already created, TUI selected)
|
|
645
|
-
|
|
646
|
-
const result = await s.client.session.prompt({
|
|
647
|
-
sessionID: s.session.id,
|
|
648
|
-
parts: [{ type: "text", text: (s.inputs.prompt ?? "") }],
|
|
649
|
-
});
|
|
650
|
-
|
|
651
|
-
s.save(result.data!);
|
|
652
|
-
},
|
|
653
|
-
);
|
|
654
|
-
})
|
|
655
|
-
.compile();
|
|
656
|
-
```
|
|
657
|
-
|
|
658
|
-
### Critical pitfall: session lifecycle controls what context is available
|
|
659
|
-
|
|
660
|
-
OpenCode sessions have **exactly the same isolation semantics as Copilot
|
|
661
|
-
sessions**. Every call to `client.session.create(...)` returns a fresh,
|
|
662
|
-
empty conversation. Creating a new session for the next subagent wipes
|
|
663
|
-
everything the prior session knew — conversation history, tool-call
|
|
664
|
-
results, intermediate reasoning — unless you forward it explicitly.
|
|
665
|
-
|
|
666
|
-
The full explanation, the four lifecycle states (Fresh / Continued /
|
|
667
|
-
Resumed / Closed), the three valid ways to carry context across a session
|
|
668
|
-
boundary, compaction & clearing guidance, and the context engineering
|
|
669
|
-
skill-map live in the **Copilot** section above under
|
|
670
|
-
["Critical pitfall: session lifecycle controls what context is
|
|
671
|
-
available"](#critical-pitfall-session-lifecycle-controls-what-context-is-available).
|
|
672
|
-
Every principle there applies to OpenCode without modification — just
|
|
673
|
-
substitute the OpenCode API equivalents:
|
|
674
|
-
|
|
675
|
-
| Concept | Copilot API | OpenCode API |
|
|
676
|
-
| ---------------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
677
|
-
| Fresh session (auto-created) | `s.session` (runtime creates via `createSession`) | `s.session` (runtime creates via `session.create`) |
|
|
678
|
-
| Send a turn | `s.session.send({ prompt })` | `s.client.session.prompt({ sessionID: s.session.id, parts })` |
|
|
679
|
-
| Close / disconnect | Auto-handled by runtime | session lifecycle managed via server; no explicit disconnect in typical flow |
|
|
680
|
-
| Continue prior conversation | `s.client.resumeSession(sessionId)` (provider API; advanced) | Reuse the same `sessionID` with `s.client.session.prompt()` inside the same logical conversation. `ctx.stage()` itself still creates a fresh session every time |
|
|
681
|
-
| Extract final text | `getAssistantText(messages)` (see `failure-modes.md` §F1) | `extractResponseText(result.data!.parts)` |
|
|
682
|
-
|
|
683
|
-
**Multi-agent handoff example (applies the same pattern as Copilot):**
|
|
684
|
-
|
|
685
|
-
```ts
|
|
686
|
-
// Buggy — orchestrator stage is fresh; it has no idea what the planner
|
|
687
|
-
// produced because each ctx.stage() starts a brand-new session.
|
|
688
|
-
await ctx.stage({ name: "planner" }, {}, { title: "planner" }, async (s) => {
|
|
689
|
-
const result = await s.client.session.prompt({
|
|
690
|
-
sessionID: s.session.id,
|
|
691
|
-
parts: [{ type: "text", text: buildPlannerPrompt((s.inputs.prompt ?? "")) }],
|
|
692
|
-
agent: "planner",
|
|
693
|
-
});
|
|
694
|
-
s.save(result.data!);
|
|
695
|
-
});
|
|
696
|
-
await ctx.stage({ name: "orchestrator" }, {}, { title: "orchestrator" }, async (s) => {
|
|
697
|
-
await s.client.session.prompt({
|
|
698
|
-
sessionID: s.session.id,
|
|
699
|
-
parts: [{ type: "text", text: buildOrchestratorPrompt() }],
|
|
700
|
-
agent: "orchestrator",
|
|
701
|
-
});
|
|
702
|
-
s.save(/* ... */);
|
|
703
|
-
});
|
|
704
|
-
|
|
705
|
-
// Correct — capture planner output and forward it into orchestrator prompt
|
|
706
|
-
const plannerHandle = await ctx.stage(
|
|
707
|
-
{ name: "planner" },
|
|
708
|
-
{},
|
|
709
|
-
{ title: "planner" },
|
|
710
|
-
async (s) => {
|
|
711
|
-
const result = await s.client.session.prompt({
|
|
712
|
-
sessionID: s.session.id,
|
|
713
|
-
parts: [{ type: "text", text: buildPlannerPrompt((s.inputs.prompt ?? "")) }],
|
|
714
|
-
agent: "planner",
|
|
715
|
-
});
|
|
716
|
-
s.save(result.data!);
|
|
717
|
-
return extractResponseText(result.data!.parts); // see failure-modes.md §F3
|
|
718
|
-
},
|
|
719
|
-
);
|
|
720
|
-
|
|
721
|
-
await ctx.stage(
|
|
722
|
-
{ name: "orchestrator" },
|
|
723
|
-
{},
|
|
724
|
-
{ title: "orchestrator" },
|
|
725
|
-
async (s) => {
|
|
726
|
-
const result = await s.client.session.prompt({
|
|
727
|
-
sessionID: s.session.id,
|
|
728
|
-
parts: [{
|
|
729
|
-
type: "text",
|
|
730
|
-
text: buildOrchestratorPrompt(
|
|
731
|
-
(s.inputs.prompt ?? ""),
|
|
732
|
-
{ plannerNotes: plannerHandle.result },
|
|
733
|
-
),
|
|
734
|
-
}],
|
|
735
|
-
agent: "orchestrator",
|
|
736
|
-
});
|
|
737
|
-
s.save(result.data!);
|
|
738
|
-
},
|
|
739
|
-
);
|
|
740
|
-
```
|
|
741
|
-
|
|
742
|
-
When planner output is large enough to strain the orchestrator's context
|
|
743
|
-
window, compress before forwarding — consult `context-compression`. When a
|
|
744
|
-
single long-running OpenCode session starts showing lost-in-middle
|
|
745
|
-
symptoms, consult `context-optimization` for compaction/masking strategies
|
|
746
|
-
before reaching for "just start a new session", which loses all history.
|
|
747
|
-
|
|
748
|
-
**Read the Copilot section for the full write-up.** The pitfall applies
|
|
749
|
-
identically here; the only thing that changes is the method names.
|
|
750
|
-
|
|
751
|
-
### Multi-turn conversations
|
|
752
|
-
|
|
753
|
-
Send multiple prompts to the same session using `s.client.session.prompt()` with `s.session.id`:
|
|
754
|
-
|
|
755
|
-
```ts
|
|
756
|
-
.run(async (ctx) => {
|
|
757
|
-
await ctx.stage({ name: "multi-turn" }, {}, { title: "multi-turn" }, async (s) => {
|
|
758
|
-
// Turn 1
|
|
759
|
-
await s.client.session.prompt({
|
|
760
|
-
sessionID: s.session.id,
|
|
761
|
-
parts: [{ type: "text", text: "Plan the implementation." }],
|
|
762
|
-
});
|
|
763
|
-
// Turn 2
|
|
764
|
-
await s.client.session.prompt({
|
|
765
|
-
sessionID: s.session.id,
|
|
766
|
-
parts: [{ type: "text", text: "Now implement the plan." }],
|
|
767
|
-
});
|
|
768
|
-
// Turn 3
|
|
769
|
-
const result = await s.client.session.prompt({
|
|
770
|
-
sessionID: s.session.id,
|
|
771
|
-
parts: [{ type: "text", text: "Run the tests." }],
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
s.save(result.data!);
|
|
775
|
-
});
|
|
776
|
-
})
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
### Structured output
|
|
780
|
-
|
|
781
|
-
```ts
|
|
782
|
-
// Inside a ctx.stage callback:
|
|
783
|
-
const result = await s.client.session.prompt({
|
|
784
|
-
sessionID: s.session.id,
|
|
785
|
-
parts: [{ type: "text", text: "List all API endpoints as JSON" }],
|
|
786
|
-
format: {
|
|
787
|
-
type: "json_schema",
|
|
788
|
-
schema: {
|
|
789
|
-
type: "object",
|
|
790
|
-
properties: {
|
|
791
|
-
endpoints: {
|
|
792
|
-
type: "array",
|
|
793
|
-
items: { type: "object", properties: { path: { type: "string" }, method: { type: "string" } } },
|
|
794
|
-
},
|
|
795
|
-
},
|
|
796
|
-
},
|
|
797
|
-
retryCount: 3,
|
|
798
|
-
},
|
|
799
|
-
});
|
|
800
|
-
```
|
|
801
|
-
|
|
802
|
-
### Context injection (no-reply)
|
|
803
|
-
|
|
804
|
-
Inject context into a session without triggering a response:
|
|
805
|
-
|
|
806
|
-
```ts
|
|
807
|
-
// Inside a ctx.stage callback:
|
|
808
|
-
await s.client.session.prompt({
|
|
809
|
-
sessionID: s.session.id,
|
|
810
|
-
parts: [{ type: "text", text: "Here is the background context..." }],
|
|
811
|
-
noReply: true,
|
|
812
|
-
});
|
|
813
|
-
// Now send the actual prompt
|
|
814
|
-
const result = await s.client.session.prompt({
|
|
815
|
-
sessionID: s.session.id,
|
|
816
|
-
parts: [{ type: "text", text: "Based on the context, implement..." }],
|
|
817
|
-
});
|
|
818
|
-
```
|
|
819
|
-
|
|
820
|
-
### Extracting response text
|
|
821
|
-
|
|
822
|
-
Non-text parts (`tool`, `file`, `reasoning`, …) coexist with `text` parts in
|
|
823
|
-
`result.data!.parts`; naive `.map(p => p.text)` emits `undefined` for them.
|
|
824
|
-
The canonical `extractResponseText` helper lives in `failure-modes.md` §F3 —
|
|
825
|
-
copy it into a sibling `helpers/parsers.ts` and import it. Usage:
|
|
826
|
-
|
|
827
|
-
```ts
|
|
828
|
-
import { extractResponseText } from "../helpers/parsers.ts";
|
|
829
|
-
|
|
830
|
-
const result = await s.client.session.prompt({
|
|
831
|
-
sessionID: s.session.id,
|
|
832
|
-
parts: [{ type: "text", text: (s.inputs.prompt ?? "") }],
|
|
833
|
-
});
|
|
834
|
-
const text = extractResponseText(result.data!.parts);
|
|
835
|
-
```
|
|
836
|
-
|
|
837
|
-
### Event streaming
|
|
838
|
-
|
|
839
|
-
```ts
|
|
840
|
-
// Inside a ctx.stage callback:
|
|
841
|
-
const unsubscribe = await s.client.event.subscribe((event) => {
|
|
842
|
-
if (event.type === "session.updated") {
|
|
843
|
-
console.log("Session updated:", event.data);
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
```
|
|
847
|
-
|
|
848
|
-
### Subagent delegation
|
|
849
|
-
|
|
850
|
-
Pass the `agent` parameter to `s.client.session.prompt()` to route a prompt to a named subagent:
|
|
851
|
-
|
|
852
|
-
```ts
|
|
853
|
-
.run(async (ctx) => {
|
|
854
|
-
await ctx.stage(
|
|
855
|
-
{ name: "plan" },
|
|
856
|
-
{},
|
|
857
|
-
{ title: "plan" },
|
|
858
|
-
async (s) => {
|
|
859
|
-
// Route the prompt to the "planner" agent
|
|
860
|
-
const result = await s.client.session.prompt({
|
|
861
|
-
sessionID: s.session.id,
|
|
862
|
-
parts: [{ type: "text", text: (s.inputs.prompt ?? "") }],
|
|
863
|
-
agent: "planner",
|
|
864
|
-
});
|
|
865
|
-
|
|
866
|
-
s.save(result.data!);
|
|
867
|
-
},
|
|
868
|
-
);
|
|
869
|
-
})
|
|
870
|
-
```
|
|
871
|
-
|
|
872
|
-
### Headless mode (background stages)
|
|
873
|
-
|
|
874
|
-
OpenCode headless stages use `createOpencode()` from the SDK to start both server and client in-process. Set `headless: true`:
|
|
875
|
-
|
|
876
|
-
```ts
|
|
877
|
-
await ctx.stage(
|
|
878
|
-
{ name: "background-task", headless: true },
|
|
879
|
-
{}, { title: "background-task" },
|
|
880
|
-
async (s) => {
|
|
881
|
-
// s.client.session.prompt() works identically
|
|
882
|
-
const result = await s.client.session.prompt({
|
|
883
|
-
sessionID: s.session.id,
|
|
884
|
-
parts: [{ type: "text", text: "Analyze the codebase." }],
|
|
885
|
-
});
|
|
886
|
-
s.save(result.data!);
|
|
887
|
-
},
|
|
888
|
-
);
|
|
889
|
-
```
|
|
890
|
-
|
|
891
|
-
Internally, the runtime uses `createOpencode({ port: 0 })` to start both the OpenCode server and client in-process. A cleanup callback closes the server when the stage completes. The callback interface is identical.
|