@bastani/atomic 0.6.8 → 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,1245 +0,0 @@
|
|
|
1
|
-
import { test, expect, describe } from "bun:test";
|
|
2
|
-
import {
|
|
3
|
-
computeLayout,
|
|
4
|
-
NODE_W,
|
|
5
|
-
NODE_H,
|
|
6
|
-
H_GAP,
|
|
7
|
-
V_GAP,
|
|
8
|
-
PAD,
|
|
9
|
-
} from "./layout.ts";
|
|
10
|
-
import type { SessionData, SessionStatus } from "./orchestrator-panel-types.ts";
|
|
11
|
-
|
|
12
|
-
// ─── Helpers ──────────────────────────────────────
|
|
13
|
-
|
|
14
|
-
function session(
|
|
15
|
-
name: string,
|
|
16
|
-
parents: string[] = [],
|
|
17
|
-
status: SessionStatus = "pending",
|
|
18
|
-
extra?: { error?: string; startedAt?: number; endedAt?: number },
|
|
19
|
-
): SessionData {
|
|
20
|
-
return {
|
|
21
|
-
name,
|
|
22
|
-
status,
|
|
23
|
-
parents,
|
|
24
|
-
error: extra?.error,
|
|
25
|
-
startedAt: extra?.startedAt ?? null,
|
|
26
|
-
endedAt: extra?.endedAt ?? null,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* y coordinate for a node at depth d, assuming all rows have height NODE_H.
|
|
32
|
-
* yAt(d) = sum_{i=0}^{d-1} (NODE_H + V_GAP)
|
|
33
|
-
*/
|
|
34
|
-
function yAt(depth: number): number {
|
|
35
|
-
let y = 0;
|
|
36
|
-
for (let i = 0; i < depth; i++) y += NODE_H + V_GAP;
|
|
37
|
-
return y;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ─── Tests ────────────────────────────────────────
|
|
41
|
-
|
|
42
|
-
describe("computeLayout", () => {
|
|
43
|
-
// ─── 1. Empty input ───────────────────────────
|
|
44
|
-
|
|
45
|
-
describe("empty input", () => {
|
|
46
|
-
test("returns empty roots array", () => {
|
|
47
|
-
const result = computeLayout([]);
|
|
48
|
-
expect(result.roots).toHaveLength(0);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("returns empty map", () => {
|
|
52
|
-
const result = computeLayout([]);
|
|
53
|
-
expect(Object.keys(result.map)).toHaveLength(0);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
test("returns zero-like dimensions (PAD on each side with no nodes)", () => {
|
|
57
|
-
const result = computeLayout([]);
|
|
58
|
-
// maxX=0, maxY=0 → width=0+PAD, height=0+PAD
|
|
59
|
-
expect(result.width).toBe(PAD);
|
|
60
|
-
expect(result.height).toBe(PAD);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test("returns empty rowH", () => {
|
|
64
|
-
const result = computeLayout([]);
|
|
65
|
-
expect(Object.keys(result.rowH)).toHaveLength(0);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// ─── 2. Single node ───────────────────────────
|
|
70
|
-
|
|
71
|
-
describe("single node", () => {
|
|
72
|
-
test("produces one root", () => {
|
|
73
|
-
const result = computeLayout([session("A")]);
|
|
74
|
-
expect(result.roots).toHaveLength(1);
|
|
75
|
-
expect(result.roots[0]!.name).toBe("A");
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test("node is in map", () => {
|
|
79
|
-
const result = computeLayout([session("A")]);
|
|
80
|
-
expect(result.map["A"]).toBeDefined();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test("node depth is 0", () => {
|
|
84
|
-
const result = computeLayout([session("A")]);
|
|
85
|
-
expect(result.map["A"]!.depth).toBe(0);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
test("node is at (PAD, PAD)", () => {
|
|
89
|
-
const result = computeLayout([session("A")]);
|
|
90
|
-
// cursor=0, leaf → x=0; yAt(0)=0; then +PAD
|
|
91
|
-
expect(result.map["A"]!.x).toBe(PAD);
|
|
92
|
-
expect(result.map["A"]!.y).toBe(PAD);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test("width = NODE_W + 2*PAD", () => {
|
|
96
|
-
const result = computeLayout([session("A")]);
|
|
97
|
-
// maxX = PAD + NODE_W, width = maxX + PAD = NODE_W + 2*PAD
|
|
98
|
-
expect(result.width).toBe(NODE_W + 2 * PAD);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test("height = NODE_H + 2*PAD", () => {
|
|
102
|
-
const result = computeLayout([session("A")]);
|
|
103
|
-
expect(result.height).toBe(NODE_H + 2 * PAD);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
test("rowH has exactly depth 0 = NODE_H", () => {
|
|
107
|
-
const result = computeLayout([session("A")]);
|
|
108
|
-
expect(result.rowH[0]).toBe(NODE_H);
|
|
109
|
-
expect(Object.keys(result.rowH)).toHaveLength(1);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// ─── 3. Linear chain A → B → C ───────────────
|
|
114
|
-
|
|
115
|
-
describe("linear chain (A → B → C)", () => {
|
|
116
|
-
function makeLinear() {
|
|
117
|
-
return computeLayout([
|
|
118
|
-
session("A"),
|
|
119
|
-
session("B", ["A"]),
|
|
120
|
-
session("C", ["B"]),
|
|
121
|
-
]);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
test("one root (A)", () => {
|
|
125
|
-
expect(makeLinear().roots).toHaveLength(1);
|
|
126
|
-
expect(makeLinear().roots[0]!.name).toBe("A");
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
test("depths are 0, 1, 2", () => {
|
|
130
|
-
const r = makeLinear();
|
|
131
|
-
expect(r.map["A"]!.depth).toBe(0);
|
|
132
|
-
expect(r.map["B"]!.depth).toBe(1);
|
|
133
|
-
expect(r.map["C"]!.depth).toBe(2);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
test("all nodes share the same x (single chain, no branching)", () => {
|
|
137
|
-
const r = makeLinear();
|
|
138
|
-
expect(r.map["A"]!.x).toBe(r.map["B"]!.x);
|
|
139
|
-
expect(r.map["B"]!.x).toBe(r.map["C"]!.x);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
test("all nodes are at x = PAD", () => {
|
|
143
|
-
const r = makeLinear();
|
|
144
|
-
// C (leaf) placed at cursor=0 → x=0+PAD=PAD; B centered over C → x=PAD; A centered over B → x=PAD
|
|
145
|
-
expect(r.map["A"]!.x).toBe(PAD);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
test("y values increase by NODE_H + V_GAP each level", () => {
|
|
149
|
-
const r = makeLinear();
|
|
150
|
-
const step = NODE_H + V_GAP;
|
|
151
|
-
expect(r.map["A"]!.y).toBe(yAt(0) + PAD);
|
|
152
|
-
expect(r.map["B"]!.y).toBe(yAt(1) + PAD);
|
|
153
|
-
expect(r.map["C"]!.y).toBe(yAt(2) + PAD);
|
|
154
|
-
expect(r.map["B"]!.y - r.map["A"]!.y).toBe(step);
|
|
155
|
-
expect(r.map["C"]!.y - r.map["B"]!.y).toBe(step);
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
test("rowH has entry for each depth = NODE_H", () => {
|
|
159
|
-
const r = makeLinear();
|
|
160
|
-
expect(r.rowH[0]).toBe(NODE_H);
|
|
161
|
-
expect(r.rowH[1]).toBe(NODE_H);
|
|
162
|
-
expect(r.rowH[2]).toBe(NODE_H);
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
test("children's y > parent's y", () => {
|
|
166
|
-
const r = makeLinear();
|
|
167
|
-
expect(r.map["B"]!.y).toBeGreaterThan(r.map["A"]!.y);
|
|
168
|
-
expect(r.map["C"]!.y).toBeGreaterThan(r.map["B"]!.y);
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
// ─── 4. Fan-out: A → [B, C] ──────────────────
|
|
173
|
-
|
|
174
|
-
describe("fan-out: A → [B, C]", () => {
|
|
175
|
-
function makeFanOut() {
|
|
176
|
-
return computeLayout([
|
|
177
|
-
session("A"),
|
|
178
|
-
session("B", ["A"]),
|
|
179
|
-
session("C", ["A"]),
|
|
180
|
-
]);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
test("one root (A), two children at depth 1", () => {
|
|
184
|
-
const r = makeFanOut();
|
|
185
|
-
expect(r.roots).toHaveLength(1);
|
|
186
|
-
expect(r.map["B"]!.depth).toBe(1);
|
|
187
|
-
expect(r.map["C"]!.depth).toBe(1);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
test("B and C share the same y", () => {
|
|
191
|
-
const r = makeFanOut();
|
|
192
|
-
expect(r.map["B"]!.y).toBe(r.map["C"]!.y);
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
test("B and C y = yAt(1) + PAD", () => {
|
|
196
|
-
const r = makeFanOut();
|
|
197
|
-
expect(r.map["B"]!.y).toBe(yAt(1) + PAD);
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
test("B is at x = PAD (leftmost leaf)", () => {
|
|
201
|
-
const r = makeFanOut();
|
|
202
|
-
// B placed first, cursor starts at 0 → x=0+PAD=PAD
|
|
203
|
-
expect(r.map["B"]!.x).toBe(PAD);
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
test("C is at x = PAD + NODE_W + H_GAP (second leaf)", () => {
|
|
207
|
-
const r = makeFanOut();
|
|
208
|
-
expect(r.map["C"]!.x).toBe(PAD + NODE_W + H_GAP);
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
test("A is horizontally centered above B and C", () => {
|
|
212
|
-
const r = makeFanOut();
|
|
213
|
-
const expectedX = Math.round((r.map["B"]!.x + r.map["C"]!.x) / 2);
|
|
214
|
-
expect(r.map["A"]!.x).toBe(expectedX);
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
test("A center aligns with midpoint between B center and C center", () => {
|
|
218
|
-
const r = makeFanOut();
|
|
219
|
-
const aMid = r.map["A"]!.x + Math.floor(NODE_W / 2);
|
|
220
|
-
const bMid = r.map["B"]!.x + Math.floor(NODE_W / 2);
|
|
221
|
-
const cMid = r.map["C"]!.x + Math.floor(NODE_W / 2);
|
|
222
|
-
expect(aMid).toBe(Math.round((bMid + cMid) / 2));
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
test("A y < B y (parent above children)", () => {
|
|
226
|
-
const r = makeFanOut();
|
|
227
|
-
expect(r.map["A"]!.y).toBeLessThan(r.map["B"]!.y);
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
test("all x values include PAD offset (x >= PAD)", () => {
|
|
231
|
-
const r = makeFanOut();
|
|
232
|
-
for (const node of Object.values(r.map)) {
|
|
233
|
-
expect(node.x).toBeGreaterThanOrEqual(PAD);
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
// ─── 5. Fan-out three children: A → [B, C, D] ─
|
|
239
|
-
|
|
240
|
-
describe("fan-out three children: A → [B, C, D]", () => {
|
|
241
|
-
function makeFanOut3() {
|
|
242
|
-
return computeLayout([
|
|
243
|
-
session("A"),
|
|
244
|
-
session("B", ["A"]),
|
|
245
|
-
session("C", ["A"]),
|
|
246
|
-
session("D", ["A"]),
|
|
247
|
-
]);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
test("B, C, D at depth 1 with same y", () => {
|
|
251
|
-
const r = makeFanOut3();
|
|
252
|
-
expect(r.map["B"]!.depth).toBe(1);
|
|
253
|
-
expect(r.map["C"]!.depth).toBe(1);
|
|
254
|
-
expect(r.map["D"]!.depth).toBe(1);
|
|
255
|
-
expect(r.map["B"]!.y).toBe(r.map["C"]!.y);
|
|
256
|
-
expect(r.map["C"]!.y).toBe(r.map["D"]!.y);
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
test("children are separated by NODE_W + H_GAP horizontally", () => {
|
|
260
|
-
const r = makeFanOut3();
|
|
261
|
-
expect(r.map["C"]!.x - r.map["B"]!.x).toBe(NODE_W + H_GAP);
|
|
262
|
-
expect(r.map["D"]!.x - r.map["C"]!.x).toBe(NODE_W + H_GAP);
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
test("B at x = PAD, C at PAD + NODE_W + H_GAP, D at PAD + 2*(NODE_W + H_GAP)", () => {
|
|
266
|
-
const r = makeFanOut3();
|
|
267
|
-
expect(r.map["B"]!.x).toBe(PAD);
|
|
268
|
-
expect(r.map["C"]!.x).toBe(PAD + NODE_W + H_GAP);
|
|
269
|
-
expect(r.map["D"]!.x).toBe(PAD + 2 * (NODE_W + H_GAP));
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
test("A centered above B and D (outermost children)", () => {
|
|
273
|
-
const r = makeFanOut3();
|
|
274
|
-
// place(A) uses first child (B) and last child (D) to center
|
|
275
|
-
const expectedX = Math.round((r.map["B"]!.x + r.map["D"]!.x) / 2);
|
|
276
|
-
expect(r.map["A"]!.x).toBe(expectedX);
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
test("A x = PAD + NODE_W + H_GAP (centered over 3 equally spaced children)", () => {
|
|
280
|
-
const r = makeFanOut3();
|
|
281
|
-
// B=0, C=42, D=84 before PAD → A center = round((0+84)/2)=42 → A.x=42+PAD=45
|
|
282
|
-
expect(r.map["A"]!.x).toBe(PAD + NODE_W + H_GAP);
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
// ─── 6. Fan-in / merge node: A → C, B → C ────
|
|
287
|
-
|
|
288
|
-
describe("fan-in / merge node: A → C, B → C", () => {
|
|
289
|
-
function makeFanIn() {
|
|
290
|
-
return computeLayout([
|
|
291
|
-
session("A"),
|
|
292
|
-
session("B"),
|
|
293
|
-
session("C", ["A", "B"]),
|
|
294
|
-
]);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
test("A and B are roots, C is a merge node (not in roots)", () => {
|
|
298
|
-
const r = makeFanIn();
|
|
299
|
-
expect(r.roots).toHaveLength(2);
|
|
300
|
-
expect(r.roots.map((n) => n.name)).toContain("A");
|
|
301
|
-
expect(r.roots.map((n) => n.name)).toContain("B");
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
test("C depth is max(parent depths) + 1 = 1", () => {
|
|
305
|
-
const r = makeFanIn();
|
|
306
|
-
expect(r.map["C"]!.depth).toBe(1);
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
test("A and B have depth 0", () => {
|
|
310
|
-
const r = makeFanIn();
|
|
311
|
-
expect(r.map["A"]!.depth).toBe(0);
|
|
312
|
-
expect(r.map["B"]!.depth).toBe(0);
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
test("A and B share the same y = PAD", () => {
|
|
316
|
-
const r = makeFanIn();
|
|
317
|
-
expect(r.map["A"]!.y).toBe(PAD);
|
|
318
|
-
expect(r.map["B"]!.y).toBe(PAD);
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
test("B x > A x (roots placed with gap between them)", () => {
|
|
322
|
-
const r = makeFanIn();
|
|
323
|
-
// A placed at cursor=0 → x=PAD; place(A) advances cursor by NODE_W+H_GAP=42;
|
|
324
|
-
// gap before B: cursor += H_GAP → cursor=48; B leaf: x=48+PAD=51
|
|
325
|
-
expect(r.map["A"]!.x).toBe(PAD);
|
|
326
|
-
expect(r.map["B"]!.x).toBe(PAD + NODE_W + 2 * H_GAP);
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
test("C is centered horizontally under A and B", () => {
|
|
330
|
-
const r = makeFanIn();
|
|
331
|
-
const aCenterX = r.map["A"]!.x + Math.floor(NODE_W / 2);
|
|
332
|
-
const bCenterX = r.map["B"]!.x + Math.floor(NODE_W / 2);
|
|
333
|
-
const expectedMid = Math.round((aCenterX + bCenterX) / 2);
|
|
334
|
-
const cCenterX = r.map["C"]!.x + Math.floor(NODE_W / 2);
|
|
335
|
-
expect(cCenterX).toBe(expectedMid);
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
test("C y = yAt(1) + PAD", () => {
|
|
339
|
-
const r = makeFanIn();
|
|
340
|
-
expect(r.map["C"]!.y).toBe(yAt(1) + PAD);
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
test("C y > A y (merge node below parents)", () => {
|
|
344
|
-
const r = makeFanIn();
|
|
345
|
-
expect(r.map["C"]!.y).toBeGreaterThan(r.map["A"]!.y);
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
test("C children array is empty (leaf merge node)", () => {
|
|
349
|
-
const r = makeFanIn();
|
|
350
|
-
expect(r.map["C"]!.children).toHaveLength(0);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
test("C parents array preserved", () => {
|
|
354
|
-
const r = makeFanIn();
|
|
355
|
-
expect(r.map["C"]!.parents).toEqual(["A", "B"]);
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
// ─── 7. Diamond: A → [B, C], [B, C] → D ──────
|
|
360
|
-
|
|
361
|
-
describe("diamond: A → [B, C], [B, C] → D", () => {
|
|
362
|
-
function makeDiamond() {
|
|
363
|
-
return computeLayout([
|
|
364
|
-
session("A"),
|
|
365
|
-
session("B", ["A"]),
|
|
366
|
-
session("C", ["A"]),
|
|
367
|
-
session("D", ["B", "C"]),
|
|
368
|
-
]);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
test("one root (A)", () => {
|
|
372
|
-
const r = makeDiamond();
|
|
373
|
-
expect(r.roots).toHaveLength(1);
|
|
374
|
-
expect(r.roots[0]!.name).toBe("A");
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
test("depths: A=0, B=1, C=1, D=2", () => {
|
|
378
|
-
const r = makeDiamond();
|
|
379
|
-
expect(r.map["A"]!.depth).toBe(0);
|
|
380
|
-
expect(r.map["B"]!.depth).toBe(1);
|
|
381
|
-
expect(r.map["C"]!.depth).toBe(1);
|
|
382
|
-
expect(r.map["D"]!.depth).toBe(2);
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
test("D depth = max(B.depth, C.depth) + 1 = 2", () => {
|
|
386
|
-
const r = makeDiamond();
|
|
387
|
-
expect(r.map["D"]!.depth).toBe(2);
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
test("B and C at same y", () => {
|
|
391
|
-
const r = makeDiamond();
|
|
392
|
-
expect(r.map["B"]!.y).toBe(r.map["C"]!.y);
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
test("y ordering: A < B < D", () => {
|
|
396
|
-
const r = makeDiamond();
|
|
397
|
-
expect(r.map["A"]!.y).toBeLessThan(r.map["B"]!.y);
|
|
398
|
-
expect(r.map["B"]!.y).toBeLessThan(r.map["D"]!.y);
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
test("D is centered under B and C (merge node positioning)", () => {
|
|
402
|
-
const r = makeDiamond();
|
|
403
|
-
const bCenterX = r.map["B"]!.x + Math.floor(NODE_W / 2);
|
|
404
|
-
const cCenterX = r.map["C"]!.x + Math.floor(NODE_W / 2);
|
|
405
|
-
const expectedMid = Math.round((bCenterX + cCenterX) / 2);
|
|
406
|
-
const dCenterX = r.map["D"]!.x + Math.floor(NODE_W / 2);
|
|
407
|
-
expect(dCenterX).toBe(expectedMid);
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
test("A is centered above B and C", () => {
|
|
411
|
-
const r = makeDiamond();
|
|
412
|
-
const expectedAx = Math.round((r.map["B"]!.x + r.map["C"]!.x) / 2);
|
|
413
|
-
expect(r.map["A"]!.x).toBe(expectedAx);
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
test("exact positions: A=(24,3), B=(3,10), C=(45,10), D=(24,17)", () => {
|
|
417
|
-
// B at cursor=0 → x=0+PAD=3; C at cursor=42 → x=42+PAD=45
|
|
418
|
-
// A: round((0+42)/2)+PAD=21+3=24
|
|
419
|
-
// D: centers=[0+18, 42+18]=[18,60], avg=round(39)=39, x=39-18=21, +PAD=24
|
|
420
|
-
const r = makeDiamond();
|
|
421
|
-
expect(r.map["A"]!.x).toBe(24);
|
|
422
|
-
expect(r.map["A"]!.y).toBe(3);
|
|
423
|
-
expect(r.map["B"]!.x).toBe(3);
|
|
424
|
-
expect(r.map["B"]!.y).toBe(10);
|
|
425
|
-
expect(r.map["C"]!.x).toBe(45);
|
|
426
|
-
expect(r.map["C"]!.y).toBe(10);
|
|
427
|
-
expect(r.map["D"]!.x).toBe(24);
|
|
428
|
-
expect(r.map["D"]!.y).toBe(17);
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
test("D children is empty", () => {
|
|
432
|
-
const r = makeDiamond();
|
|
433
|
-
expect(r.map["D"]!.children).toHaveLength(0);
|
|
434
|
-
});
|
|
435
|
-
|
|
436
|
-
test("rowH has entries for depths 0, 1, 2", () => {
|
|
437
|
-
const r = makeDiamond();
|
|
438
|
-
expect(r.rowH[0]).toBe(NODE_H);
|
|
439
|
-
expect(r.rowH[1]).toBe(NODE_H);
|
|
440
|
-
expect(r.rowH[2]).toBe(NODE_H);
|
|
441
|
-
});
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
// ─── 8. Multiple independent roots ────────────
|
|
445
|
-
|
|
446
|
-
describe("multiple independent roots: A, B", () => {
|
|
447
|
-
function makeMultiRoot() {
|
|
448
|
-
return computeLayout([session("A"), session("B")]);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
test("both are roots", () => {
|
|
452
|
-
const r = makeMultiRoot();
|
|
453
|
-
expect(r.roots).toHaveLength(2);
|
|
454
|
-
});
|
|
455
|
-
|
|
456
|
-
test("root order matches insertion order", () => {
|
|
457
|
-
const r = makeMultiRoot();
|
|
458
|
-
expect(r.roots[0]!.name).toBe("A");
|
|
459
|
-
expect(r.roots[1]!.name).toBe("B");
|
|
460
|
-
});
|
|
461
|
-
|
|
462
|
-
test("both at depth 0", () => {
|
|
463
|
-
const r = makeMultiRoot();
|
|
464
|
-
expect(r.map["A"]!.depth).toBe(0);
|
|
465
|
-
expect(r.map["B"]!.depth).toBe(0);
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
test("both at same y = PAD", () => {
|
|
469
|
-
const r = makeMultiRoot();
|
|
470
|
-
expect(r.map["A"]!.y).toBe(PAD);
|
|
471
|
-
expect(r.map["B"]!.y).toBe(PAD);
|
|
472
|
-
});
|
|
473
|
-
|
|
474
|
-
test("A at x = PAD (first root placed at cursor=0)", () => {
|
|
475
|
-
const r = makeMultiRoot();
|
|
476
|
-
expect(r.map["A"]!.x).toBe(PAD);
|
|
477
|
-
});
|
|
478
|
-
|
|
479
|
-
test("B at x = PAD + NODE_W + 2*H_GAP (gap inserted between roots)", () => {
|
|
480
|
-
const r = makeMultiRoot();
|
|
481
|
-
// After A: cursor=NODE_W+H_GAP=42; gap before B: cursor+=H_GAP → 48; B leaf: x=48+PAD=51
|
|
482
|
-
expect(r.map["B"]!.x).toBe(PAD + NODE_W + 2 * H_GAP);
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
test("B x > A x", () => {
|
|
486
|
-
const r = makeMultiRoot();
|
|
487
|
-
expect(r.map["B"]!.x).toBeGreaterThan(r.map["A"]!.x);
|
|
488
|
-
});
|
|
489
|
-
|
|
490
|
-
test("horizontal separation between leaf roots = NODE_W + 2*H_GAP", () => {
|
|
491
|
-
const r = makeMultiRoot();
|
|
492
|
-
// place(A): A leaf at cursor=0, cursor → NODE_W+H_GAP=42
|
|
493
|
-
// gap before B: cursor += H_GAP → 48
|
|
494
|
-
// place(B): B leaf at cursor=48
|
|
495
|
-
// Separation (before PAD): 48 - 0 = NODE_W + 2*H_GAP
|
|
496
|
-
expect(r.map["B"]!.x - r.map["A"]!.x).toBe(NODE_W + 2 * H_GAP);
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
test("three independent roots are each separated by NODE_W + 2*H_GAP", () => {
|
|
500
|
-
const r = computeLayout([session("X"), session("Y"), session("Z")]);
|
|
501
|
-
expect(r.roots).toHaveLength(3);
|
|
502
|
-
// X at 0, cursor→42; gap→48; Y at 48, cursor→90; gap→96; Z at 96
|
|
503
|
-
// After PAD: X=PAD, Y=48+PAD, Z=96+PAD
|
|
504
|
-
expect(r.map["X"]!.x).toBe(PAD);
|
|
505
|
-
expect(r.map["Y"]!.x - r.map["X"]!.x).toBe(NODE_W + 2 * H_GAP);
|
|
506
|
-
expect(r.map["Z"]!.x - r.map["Y"]!.x).toBe(NODE_W + 2 * H_GAP);
|
|
507
|
-
});
|
|
508
|
-
});
|
|
509
|
-
|
|
510
|
-
// ─── 9. Deep chain: A → B → C → D → E ────────
|
|
511
|
-
|
|
512
|
-
describe("deep chain: A → B → C → D → E", () => {
|
|
513
|
-
function makeDeepChain() {
|
|
514
|
-
return computeLayout([
|
|
515
|
-
session("A"),
|
|
516
|
-
session("B", ["A"]),
|
|
517
|
-
session("C", ["B"]),
|
|
518
|
-
session("D", ["C"]),
|
|
519
|
-
session("E", ["D"]),
|
|
520
|
-
]);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
test("depths 0 through 4", () => {
|
|
524
|
-
const r = makeDeepChain();
|
|
525
|
-
expect(r.map["A"]!.depth).toBe(0);
|
|
526
|
-
expect(r.map["B"]!.depth).toBe(1);
|
|
527
|
-
expect(r.map["C"]!.depth).toBe(2);
|
|
528
|
-
expect(r.map["D"]!.depth).toBe(3);
|
|
529
|
-
expect(r.map["E"]!.depth).toBe(4);
|
|
530
|
-
});
|
|
531
|
-
|
|
532
|
-
test("all nodes share x = PAD (single chain)", () => {
|
|
533
|
-
const r = makeDeepChain();
|
|
534
|
-
for (const name of ["A", "B", "C", "D", "E"]) {
|
|
535
|
-
expect(r.map[name]!.x).toBe(PAD);
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
test("y increases by NODE_H + V_GAP each level", () => {
|
|
540
|
-
const r = makeDeepChain();
|
|
541
|
-
const step = NODE_H + V_GAP;
|
|
542
|
-
expect(r.map["A"]!.y).toBe(PAD + yAt(0));
|
|
543
|
-
expect(r.map["B"]!.y).toBe(PAD + yAt(1));
|
|
544
|
-
expect(r.map["C"]!.y).toBe(PAD + yAt(2));
|
|
545
|
-
expect(r.map["D"]!.y).toBe(PAD + yAt(3));
|
|
546
|
-
expect(r.map["E"]!.y).toBe(PAD + yAt(4));
|
|
547
|
-
// Consecutive differences
|
|
548
|
-
expect(r.map["B"]!.y - r.map["A"]!.y).toBe(step);
|
|
549
|
-
expect(r.map["C"]!.y - r.map["B"]!.y).toBe(step);
|
|
550
|
-
expect(r.map["D"]!.y - r.map["C"]!.y).toBe(step);
|
|
551
|
-
expect(r.map["E"]!.y - r.map["D"]!.y).toBe(step);
|
|
552
|
-
});
|
|
553
|
-
|
|
554
|
-
test("exact y values: 3, 10, 17, 24, 31", () => {
|
|
555
|
-
const r = makeDeepChain();
|
|
556
|
-
expect(r.map["A"]!.y).toBe(3);
|
|
557
|
-
expect(r.map["B"]!.y).toBe(10);
|
|
558
|
-
expect(r.map["C"]!.y).toBe(17);
|
|
559
|
-
expect(r.map["D"]!.y).toBe(24);
|
|
560
|
-
expect(r.map["E"]!.y).toBe(31);
|
|
561
|
-
});
|
|
562
|
-
|
|
563
|
-
test("rowH has 5 entries all equal to NODE_H", () => {
|
|
564
|
-
const r = makeDeepChain();
|
|
565
|
-
for (let d = 0; d < 5; d++) {
|
|
566
|
-
expect(r.rowH[d]).toBe(NODE_H);
|
|
567
|
-
}
|
|
568
|
-
expect(Object.keys(r.rowH)).toHaveLength(5);
|
|
569
|
-
});
|
|
570
|
-
|
|
571
|
-
test("height = E.y + NODE_H + PAD", () => {
|
|
572
|
-
const r = makeDeepChain();
|
|
573
|
-
const e = r.map["E"]!;
|
|
574
|
-
expect(r.height).toBe(e.y + NODE_H + PAD);
|
|
575
|
-
});
|
|
576
|
-
|
|
577
|
-
test("width = A.x + NODE_W + PAD (single column)", () => {
|
|
578
|
-
const r = makeDeepChain();
|
|
579
|
-
expect(r.width).toBe(PAD + NODE_W + PAD);
|
|
580
|
-
});
|
|
581
|
-
});
|
|
582
|
-
|
|
583
|
-
// ─── 10. Merge node with children ─────────────
|
|
584
|
-
|
|
585
|
-
describe("merge node with children: A → C, B → C → D", () => {
|
|
586
|
-
// A and B are roots; C is merge node (parents=[A,B]) with child D
|
|
587
|
-
function makeMergeWithChild() {
|
|
588
|
-
return computeLayout([
|
|
589
|
-
session("A"),
|
|
590
|
-
session("B"),
|
|
591
|
-
session("C", ["A", "B"]),
|
|
592
|
-
session("D", ["C"]),
|
|
593
|
-
]);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
test("A and B are roots, C is merge node not in roots", () => {
|
|
597
|
-
const r = makeMergeWithChild();
|
|
598
|
-
expect(r.roots).toHaveLength(2);
|
|
599
|
-
const rootNames = r.roots.map((n) => n.name);
|
|
600
|
-
expect(rootNames).toContain("A");
|
|
601
|
-
expect(rootNames).toContain("B");
|
|
602
|
-
expect(rootNames).not.toContain("C");
|
|
603
|
-
});
|
|
604
|
-
|
|
605
|
-
test("depths: A=0, B=0, C=1, D=2", () => {
|
|
606
|
-
const r = makeMergeWithChild();
|
|
607
|
-
expect(r.map["A"]!.depth).toBe(0);
|
|
608
|
-
expect(r.map["B"]!.depth).toBe(0);
|
|
609
|
-
expect(r.map["C"]!.depth).toBe(1);
|
|
610
|
-
expect(r.map["D"]!.depth).toBe(2);
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
test("C center is horizontally aligned with midpoint of A and B centers", () => {
|
|
614
|
-
const r = makeMergeWithChild();
|
|
615
|
-
const aCenterX = r.map["A"]!.x + Math.floor(NODE_W / 2);
|
|
616
|
-
const bCenterX = r.map["B"]!.x + Math.floor(NODE_W / 2);
|
|
617
|
-
const expectedMid = Math.round((aCenterX + bCenterX) / 2);
|
|
618
|
-
const cCenterX = r.map["C"]!.x + Math.floor(NODE_W / 2);
|
|
619
|
-
expect(cCenterX).toBe(expectedMid);
|
|
620
|
-
});
|
|
621
|
-
|
|
622
|
-
test("D is directly below C (same x as C after shift)", () => {
|
|
623
|
-
const r = makeMergeWithChild();
|
|
624
|
-
// D is a single child of C → centered over D means D.x = C.x after shift
|
|
625
|
-
expect(r.map["D"]!.x).toBe(r.map["C"]!.x);
|
|
626
|
-
});
|
|
627
|
-
|
|
628
|
-
test("D y = yAt(2) + PAD", () => {
|
|
629
|
-
const r = makeMergeWithChild();
|
|
630
|
-
expect(r.map["D"]!.y).toBe(yAt(2) + PAD);
|
|
631
|
-
});
|
|
632
|
-
|
|
633
|
-
test("exact positions: A=(3,3), B=(51,3), C=(27,10), D=(27,17)", () => {
|
|
634
|
-
// A placed at cursor=0 → x=PAD=3; after A: cursor=42; gap: cursor=48; B at 48 → x=51
|
|
635
|
-
// C merge, has child D:
|
|
636
|
-
// place(C) → place(D) at cursor=90 → D.x=90; C centered: x=90; currentCenter=108
|
|
637
|
-
// parentCenters=[18,66], avg=42; dx=42-108=-66
|
|
638
|
-
// C.x=90-66=24 → +PAD=27; D.x=90-66=24 → +PAD=27
|
|
639
|
-
const r = makeMergeWithChild();
|
|
640
|
-
expect(r.map["A"]!.x).toBe(3);
|
|
641
|
-
expect(r.map["A"]!.y).toBe(3);
|
|
642
|
-
expect(r.map["B"]!.x).toBe(51);
|
|
643
|
-
expect(r.map["B"]!.y).toBe(3);
|
|
644
|
-
expect(r.map["C"]!.x).toBe(27);
|
|
645
|
-
expect(r.map["C"]!.y).toBe(10);
|
|
646
|
-
expect(r.map["D"]!.x).toBe(27);
|
|
647
|
-
expect(r.map["D"]!.y).toBe(17);
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
test("all x values are >= PAD", () => {
|
|
651
|
-
const r = makeMergeWithChild();
|
|
652
|
-
for (const node of Object.values(r.map)) {
|
|
653
|
-
expect(node.x).toBeGreaterThanOrEqual(PAD);
|
|
654
|
-
}
|
|
655
|
-
});
|
|
656
|
-
|
|
657
|
-
test("width >= rightmost node x + NODE_W + PAD", () => {
|
|
658
|
-
const r = makeMergeWithChild();
|
|
659
|
-
const rightmost = Math.max(...Object.values(r.map).map((n) => n.x + NODE_W));
|
|
660
|
-
expect(r.width).toBe(rightmost + PAD);
|
|
661
|
-
});
|
|
662
|
-
|
|
663
|
-
test("height >= bottommost node y + NODE_H + PAD", () => {
|
|
664
|
-
const r = makeMergeWithChild();
|
|
665
|
-
const bottommost = Math.max(...Object.values(r.map).map((n) => n.y + NODE_H));
|
|
666
|
-
expect(r.height).toBe(bottommost + PAD);
|
|
667
|
-
});
|
|
668
|
-
});
|
|
669
|
-
|
|
670
|
-
// ─── 11. Collision detection: merge-node shift causes overlap ─
|
|
671
|
-
|
|
672
|
-
describe("collision detection: A→B, C, [A,C]→M→M1", () => {
|
|
673
|
-
// A has child B; C is a standalone root; M is a merge node (parents=[A,C])
|
|
674
|
-
// with child M1. Without collision detection, shifting M to center under
|
|
675
|
-
// A and C would cause M to overlap with B at depth 1.
|
|
676
|
-
function makeOverlap() {
|
|
677
|
-
return computeLayout([
|
|
678
|
-
session("A"),
|
|
679
|
-
session("B", ["A"]),
|
|
680
|
-
session("C"),
|
|
681
|
-
session("M", ["A", "C"]),
|
|
682
|
-
session("M1", ["M"]),
|
|
683
|
-
]);
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
test("no nodes at the same depth overlap horizontally", () => {
|
|
687
|
-
const r = makeOverlap();
|
|
688
|
-
const byDepth: Record<number, Array<{ name: string; x: number }>> = {};
|
|
689
|
-
for (const n of Object.values(r.map)) {
|
|
690
|
-
(byDepth[n.depth] ??= []).push({ name: n.name, x: n.x });
|
|
691
|
-
}
|
|
692
|
-
for (const nodes of Object.values(byDepth)) {
|
|
693
|
-
nodes.sort((a, b) => a.x - b.x);
|
|
694
|
-
for (let i = 1; i < nodes.length; i++) {
|
|
695
|
-
const prev = nodes[i - 1]!;
|
|
696
|
-
const curr = nodes[i]!;
|
|
697
|
-
expect(curr.x).toBeGreaterThanOrEqual(
|
|
698
|
-
prev.x + NODE_W + H_GAP,
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
|
-
|
|
704
|
-
test("M and B are both at depth 1 but do not overlap", () => {
|
|
705
|
-
const r = makeOverlap();
|
|
706
|
-
expect(r.map["B"]!.depth).toBe(1);
|
|
707
|
-
expect(r.map["M"]!.depth).toBe(1);
|
|
708
|
-
const gap = Math.abs(r.map["M"]!.x - r.map["B"]!.x);
|
|
709
|
-
expect(gap).toBeGreaterThanOrEqual(NODE_W + H_GAP);
|
|
710
|
-
});
|
|
711
|
-
|
|
712
|
-
test("M1 is a child of M (depth 2)", () => {
|
|
713
|
-
const r = makeOverlap();
|
|
714
|
-
expect(r.map["M1"]!.depth).toBe(2);
|
|
715
|
-
});
|
|
716
|
-
|
|
717
|
-
test("all x values are >= PAD after collision resolution", () => {
|
|
718
|
-
const r = makeOverlap();
|
|
719
|
-
for (const node of Object.values(r.map)) {
|
|
720
|
-
expect(node.x).toBeGreaterThanOrEqual(PAD);
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
});
|
|
724
|
-
|
|
725
|
-
// ─── 12. Status and error propagation ─────────
|
|
726
|
-
|
|
727
|
-
describe("status and error propagation", () => {
|
|
728
|
-
test("preserves 'pending' status", () => {
|
|
729
|
-
const r = computeLayout([session("A", [], "pending")]);
|
|
730
|
-
expect(r.map["A"]!.status).toBe("pending");
|
|
731
|
-
});
|
|
732
|
-
|
|
733
|
-
test("preserves 'running' status", () => {
|
|
734
|
-
const r = computeLayout([session("A", [], "running")]);
|
|
735
|
-
expect(r.map["A"]!.status).toBe("running");
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
test("preserves 'complete' status", () => {
|
|
739
|
-
const r = computeLayout([session("A", [], "complete")]);
|
|
740
|
-
expect(r.map["A"]!.status).toBe("complete");
|
|
741
|
-
});
|
|
742
|
-
|
|
743
|
-
test("preserves 'error' status", () => {
|
|
744
|
-
const r = computeLayout([session("A", [], "error")]);
|
|
745
|
-
expect(r.map["A"]!.status).toBe("error");
|
|
746
|
-
});
|
|
747
|
-
|
|
748
|
-
test("preserves error message", () => {
|
|
749
|
-
const r = computeLayout([
|
|
750
|
-
session("A", [], "error", { error: "something went wrong" }),
|
|
751
|
-
]);
|
|
752
|
-
expect(r.map["A"]!.error).toBe("something went wrong");
|
|
753
|
-
});
|
|
754
|
-
|
|
755
|
-
test("error is undefined when not provided", () => {
|
|
756
|
-
const r = computeLayout([session("A")]);
|
|
757
|
-
expect(r.map["A"]!.error).toBeUndefined();
|
|
758
|
-
});
|
|
759
|
-
|
|
760
|
-
test("preserves startedAt timestamp", () => {
|
|
761
|
-
const r = computeLayout([
|
|
762
|
-
session("A", [], "running", { startedAt: 1700000000000 }),
|
|
763
|
-
]);
|
|
764
|
-
expect(r.map["A"]!.startedAt).toBe(1700000000000);
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
test("preserves endedAt timestamp", () => {
|
|
768
|
-
const r = computeLayout([
|
|
769
|
-
session("A", [], "complete", { startedAt: 100, endedAt: 200 }),
|
|
770
|
-
]);
|
|
771
|
-
expect(r.map["A"]!.endedAt).toBe(200);
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
test("startedAt and endedAt are null when not provided", () => {
|
|
775
|
-
const r = computeLayout([session("A")]);
|
|
776
|
-
expect(r.map["A"]!.startedAt).toBeNull();
|
|
777
|
-
expect(r.map["A"]!.endedAt).toBeNull();
|
|
778
|
-
});
|
|
779
|
-
|
|
780
|
-
test("preserves all fields on a node with mixed statuses in the graph", () => {
|
|
781
|
-
const sessions: SessionData[] = [
|
|
782
|
-
{ name: "start", status: "complete", parents: [], startedAt: 1000, endedAt: 2000 },
|
|
783
|
-
{ name: "mid", status: "running", parents: ["start"], startedAt: 2001, endedAt: null },
|
|
784
|
-
{ name: "end", status: "error", parents: ["mid"], error: "timed out", startedAt: 3000, endedAt: 3500 },
|
|
785
|
-
];
|
|
786
|
-
const r = computeLayout(sessions);
|
|
787
|
-
|
|
788
|
-
expect(r.map["start"]!.status).toBe("complete");
|
|
789
|
-
expect(r.map["start"]!.startedAt).toBe(1000);
|
|
790
|
-
expect(r.map["start"]!.endedAt).toBe(2000);
|
|
791
|
-
expect(r.map["start"]!.error).toBeUndefined();
|
|
792
|
-
|
|
793
|
-
expect(r.map["mid"]!.status).toBe("running");
|
|
794
|
-
expect(r.map["mid"]!.startedAt).toBe(2001);
|
|
795
|
-
expect(r.map["mid"]!.endedAt).toBeNull();
|
|
796
|
-
|
|
797
|
-
expect(r.map["end"]!.status).toBe("error");
|
|
798
|
-
expect(r.map["end"]!.error).toBe("timed out");
|
|
799
|
-
expect(r.map["end"]!.startedAt).toBe(3000);
|
|
800
|
-
expect(r.map["end"]!.endedAt).toBe(3500);
|
|
801
|
-
});
|
|
802
|
-
|
|
803
|
-
test("preserves parents array on layout nodes", () => {
|
|
804
|
-
const r = computeLayout([
|
|
805
|
-
session("A"),
|
|
806
|
-
session("B"),
|
|
807
|
-
session("C", ["A", "B"]),
|
|
808
|
-
]);
|
|
809
|
-
expect(r.map["C"]!.parents).toEqual(["A", "B"]);
|
|
810
|
-
});
|
|
811
|
-
|
|
812
|
-
test("preserves name on layout nodes", () => {
|
|
813
|
-
const r = computeLayout([session("my-session-name")]);
|
|
814
|
-
expect(r.map["my-session-name"]!.name).toBe("my-session-name");
|
|
815
|
-
});
|
|
816
|
-
});
|
|
817
|
-
|
|
818
|
-
// ─── Invariants applying to all layouts ───────
|
|
819
|
-
|
|
820
|
-
describe("layout invariants", () => {
|
|
821
|
-
const TOPOLOGIES = [
|
|
822
|
-
{
|
|
823
|
-
name: "single node",
|
|
824
|
-
sessions: () => [session("A")],
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
name: "linear chain",
|
|
828
|
-
sessions: () => [session("A"), session("B", ["A"]), session("C", ["B"])],
|
|
829
|
-
},
|
|
830
|
-
{
|
|
831
|
-
name: "fan-out",
|
|
832
|
-
sessions: () => [session("A"), session("B", ["A"]), session("C", ["A"])],
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
name: "fan-in merge",
|
|
836
|
-
sessions: () => [session("A"), session("B"), session("C", ["A", "B"])],
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
name: "diamond",
|
|
840
|
-
sessions: () => [
|
|
841
|
-
session("A"),
|
|
842
|
-
session("B", ["A"]),
|
|
843
|
-
session("C", ["A"]),
|
|
844
|
-
session("D", ["B", "C"]),
|
|
845
|
-
],
|
|
846
|
-
},
|
|
847
|
-
{
|
|
848
|
-
name: "multiple roots",
|
|
849
|
-
sessions: () => [session("X"), session("Y"), session("Z")],
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
name: "merge-node overlap (A→B, C, [A,C]→M→M1)",
|
|
853
|
-
sessions: () => [
|
|
854
|
-
session("A"),
|
|
855
|
-
session("B", ["A"]),
|
|
856
|
-
session("C"),
|
|
857
|
-
session("M", ["A", "C"]),
|
|
858
|
-
session("M1", ["M"]),
|
|
859
|
-
],
|
|
860
|
-
},
|
|
861
|
-
];
|
|
862
|
-
|
|
863
|
-
for (const topo of TOPOLOGIES) {
|
|
864
|
-
test(`[${topo.name}] all x values are >= PAD`, () => {
|
|
865
|
-
const r = computeLayout(topo.sessions());
|
|
866
|
-
for (const node of Object.values(r.map)) {
|
|
867
|
-
expect(node.x).toBeGreaterThanOrEqual(PAD);
|
|
868
|
-
}
|
|
869
|
-
});
|
|
870
|
-
|
|
871
|
-
test(`[${topo.name}] all y values are >= PAD`, () => {
|
|
872
|
-
const r = computeLayout(topo.sessions());
|
|
873
|
-
for (const node of Object.values(r.map)) {
|
|
874
|
-
expect(node.y).toBeGreaterThanOrEqual(PAD);
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
|
|
878
|
-
test(`[${topo.name}] width = max(node.x + NODE_W) + PAD`, () => {
|
|
879
|
-
const r = computeLayout(topo.sessions());
|
|
880
|
-
const rightmost = Math.max(...Object.values(r.map).map((n) => n.x + NODE_W));
|
|
881
|
-
expect(r.width).toBe(rightmost + PAD);
|
|
882
|
-
});
|
|
883
|
-
|
|
884
|
-
test(`[${topo.name}] height = max(node.y + NODE_H) + PAD`, () => {
|
|
885
|
-
const r = computeLayout(topo.sessions());
|
|
886
|
-
const bottommost = Math.max(...Object.values(r.map).map((n) => n.y + NODE_H));
|
|
887
|
-
expect(r.height).toBe(bottommost + PAD);
|
|
888
|
-
});
|
|
889
|
-
|
|
890
|
-
test(`[${topo.name}] nodes at same depth share the same y`, () => {
|
|
891
|
-
const r = computeLayout(topo.sessions());
|
|
892
|
-
const byDepth: Record<number, number[]> = {};
|
|
893
|
-
for (const node of Object.values(r.map)) {
|
|
894
|
-
(byDepth[node.depth] ??= []).push(node.y);
|
|
895
|
-
}
|
|
896
|
-
for (const ys of Object.values(byDepth)) {
|
|
897
|
-
const first = ys[0]!;
|
|
898
|
-
for (const y of ys) expect(y).toBe(first);
|
|
899
|
-
}
|
|
900
|
-
});
|
|
901
|
-
|
|
902
|
-
test(`[${topo.name}] rowH[d] = NODE_H for all used depths`, () => {
|
|
903
|
-
const r = computeLayout(topo.sessions());
|
|
904
|
-
for (const d of Object.keys(r.rowH)) {
|
|
905
|
-
expect(r.rowH[Number(d)]).toBe(NODE_H);
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
test(`[${topo.name}] no horizontal overlap between nodes at same depth`, () => {
|
|
910
|
-
const r = computeLayout(topo.sessions());
|
|
911
|
-
const byDepth: Record<number, number[]> = {};
|
|
912
|
-
for (const node of Object.values(r.map)) {
|
|
913
|
-
(byDepth[node.depth] ??= []).push(node.x);
|
|
914
|
-
}
|
|
915
|
-
for (const xs of Object.values(byDepth)) {
|
|
916
|
-
xs.sort((a, b) => a - b);
|
|
917
|
-
for (let i = 1; i < xs.length; i++) {
|
|
918
|
-
expect(xs[i]! - xs[i - 1]!).toBeGreaterThanOrEqual(NODE_W + H_GAP);
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
});
|
|
924
|
-
|
|
925
|
-
// ─── Edge cases: parent normalization ─────────
|
|
926
|
-
|
|
927
|
-
describe("missing parent fallback", () => {
|
|
928
|
-
test("session with missing parent falls back to orchestrator child", () => {
|
|
929
|
-
const r = computeLayout([
|
|
930
|
-
session("orchestrator"),
|
|
931
|
-
session("orphan", ["nonexistent"]),
|
|
932
|
-
]);
|
|
933
|
-
// orphan should be a child of orchestrator, not a root
|
|
934
|
-
expect(r.roots).toHaveLength(1);
|
|
935
|
-
expect(r.roots[0]!.name).toBe("orchestrator");
|
|
936
|
-
expect(r.map["orchestrator"]!.children).toHaveLength(1);
|
|
937
|
-
expect(r.map["orchestrator"]!.children[0]!.name).toBe("orphan");
|
|
938
|
-
expect(r.map["orphan"]!.depth).toBe(1);
|
|
939
|
-
});
|
|
940
|
-
|
|
941
|
-
test("session with missing parent and no orchestrator becomes root", () => {
|
|
942
|
-
const r = computeLayout([
|
|
943
|
-
session("A"),
|
|
944
|
-
session("orphan", ["nonexistent"]),
|
|
945
|
-
]);
|
|
946
|
-
// Without orchestrator, orphan becomes a root alongside A
|
|
947
|
-
expect(r.roots).toHaveLength(2);
|
|
948
|
-
expect(r.roots.map((n) => n.name)).toContain("orphan");
|
|
949
|
-
});
|
|
950
|
-
|
|
951
|
-
test("preserves raw parents array on LayoutNode even when normalized", () => {
|
|
952
|
-
const r = computeLayout([
|
|
953
|
-
session("orchestrator"),
|
|
954
|
-
session("orphan", ["nonexistent"]),
|
|
955
|
-
]);
|
|
956
|
-
// raw parents metadata should be unchanged
|
|
957
|
-
expect(r.map["orphan"]!.parents).toEqual(["nonexistent"]);
|
|
958
|
-
});
|
|
959
|
-
|
|
960
|
-
test("multiple orphans all fall back to orchestrator", () => {
|
|
961
|
-
const r = computeLayout([
|
|
962
|
-
session("orchestrator"),
|
|
963
|
-
session("a", ["ghost-1"]),
|
|
964
|
-
session("b", ["ghost-2"]),
|
|
965
|
-
]);
|
|
966
|
-
expect(r.roots).toHaveLength(1);
|
|
967
|
-
expect(r.map["orchestrator"]!.children).toHaveLength(2);
|
|
968
|
-
expect(r.map["a"]!.depth).toBe(1);
|
|
969
|
-
expect(r.map["b"]!.depth).toBe(1);
|
|
970
|
-
});
|
|
971
|
-
|
|
972
|
-
test("valid parent takes priority over orchestrator fallback", () => {
|
|
973
|
-
const r = computeLayout([
|
|
974
|
-
session("orchestrator"),
|
|
975
|
-
session("step-1", ["orchestrator"]),
|
|
976
|
-
session("child", ["step-1"]),
|
|
977
|
-
]);
|
|
978
|
-
// child should be under step-1, not orchestrator
|
|
979
|
-
expect(r.map["step-1"]!.children).toHaveLength(1);
|
|
980
|
-
expect(r.map["step-1"]!.children[0]!.name).toBe("child");
|
|
981
|
-
expect(r.map["child"]!.depth).toBe(2);
|
|
982
|
-
});
|
|
983
|
-
|
|
984
|
-
test("orchestrator itself does not get reparented to itself", () => {
|
|
985
|
-
const r = computeLayout([session("orchestrator")]);
|
|
986
|
-
expect(r.roots).toHaveLength(1);
|
|
987
|
-
expect(r.roots[0]!.name).toBe("orchestrator");
|
|
988
|
-
expect(r.map["orchestrator"]!.children).toHaveLength(0);
|
|
989
|
-
});
|
|
990
|
-
});
|
|
991
|
-
|
|
992
|
-
describe("merge node with missing parents", () => {
|
|
993
|
-
test("merge with one missing parent reclassified as single-parent child", () => {
|
|
994
|
-
const r = computeLayout([
|
|
995
|
-
session("orchestrator"),
|
|
996
|
-
session("A", ["orchestrator"]),
|
|
997
|
-
session("M", ["A", "nonexistent"]),
|
|
998
|
-
]);
|
|
999
|
-
// M should become a single-parent child of A (not a merge node)
|
|
1000
|
-
expect(r.map["A"]!.children).toHaveLength(1);
|
|
1001
|
-
expect(r.map["A"]!.children[0]!.name).toBe("M");
|
|
1002
|
-
expect(r.map["M"]!.depth).toBe(2);
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
|
-
test("merge with all missing parents falls back to orchestrator child", () => {
|
|
1006
|
-
const r = computeLayout([
|
|
1007
|
-
session("orchestrator"),
|
|
1008
|
-
session("M", ["ghost-1", "ghost-2"]),
|
|
1009
|
-
]);
|
|
1010
|
-
// All parents missing → falls back to orchestrator
|
|
1011
|
-
expect(r.map["orchestrator"]!.children).toHaveLength(1);
|
|
1012
|
-
expect(r.map["orchestrator"]!.children[0]!.name).toBe("M");
|
|
1013
|
-
expect(r.map["M"]!.depth).toBe(1);
|
|
1014
|
-
});
|
|
1015
|
-
|
|
1016
|
-
test("merge with duplicate parents after filtering is deduplicated", () => {
|
|
1017
|
-
const r = computeLayout([
|
|
1018
|
-
session("orchestrator"),
|
|
1019
|
-
session("A", ["orchestrator"]),
|
|
1020
|
-
session("M", ["A", "A"]),
|
|
1021
|
-
]);
|
|
1022
|
-
// Duplicate "A" deduplicated → single parent → tree child of A
|
|
1023
|
-
expect(r.map["A"]!.children).toHaveLength(1);
|
|
1024
|
-
expect(r.map["A"]!.children[0]!.name).toBe("M");
|
|
1025
|
-
});
|
|
1026
|
-
});
|
|
1027
|
-
|
|
1028
|
-
describe("chained merge node ordering", () => {
|
|
1029
|
-
test("merge nodes in reverse order get correct depths", () => {
|
|
1030
|
-
// M2 depends on M1, but M2 appears first in the sessions array
|
|
1031
|
-
const r = computeLayout([
|
|
1032
|
-
session("A"),
|
|
1033
|
-
session("B"),
|
|
1034
|
-
session("C"),
|
|
1035
|
-
session("M2", ["M1", "C"]), // M2 before M1 in array
|
|
1036
|
-
session("M1", ["A", "B"]),
|
|
1037
|
-
]);
|
|
1038
|
-
expect(r.map["M1"]!.depth).toBe(1);
|
|
1039
|
-
expect(r.map["M2"]!.depth).toBe(2); // must be deeper than M1
|
|
1040
|
-
});
|
|
1041
|
-
|
|
1042
|
-
test("indirect merge dependency: A,B → M1 → X; C,X → M2", () => {
|
|
1043
|
-
const r = computeLayout([
|
|
1044
|
-
session("A"),
|
|
1045
|
-
session("B"),
|
|
1046
|
-
session("C"),
|
|
1047
|
-
session("M1", ["A", "B"]),
|
|
1048
|
-
session("X", ["M1"]),
|
|
1049
|
-
session("M2", ["C", "X"]),
|
|
1050
|
-
]);
|
|
1051
|
-
expect(r.map["M1"]!.depth).toBe(1);
|
|
1052
|
-
expect(r.map["X"]!.depth).toBe(2);
|
|
1053
|
-
expect(r.map["M2"]!.depth).toBe(3);
|
|
1054
|
-
});
|
|
1055
|
-
|
|
1056
|
-
test("indirect merge dependency in forward session order", () => {
|
|
1057
|
-
const r = computeLayout([
|
|
1058
|
-
session("A"),
|
|
1059
|
-
session("B"),
|
|
1060
|
-
session("C"),
|
|
1061
|
-
session("M1", ["A", "B"]),
|
|
1062
|
-
session("X", ["M1"]),
|
|
1063
|
-
session("M2", ["C", "X"]),
|
|
1064
|
-
]);
|
|
1065
|
-
expect(r.map["M1"]!.depth).toBe(1);
|
|
1066
|
-
expect(r.map["X"]!.depth).toBe(2);
|
|
1067
|
-
expect(r.map["M2"]!.depth).toBe(3);
|
|
1068
|
-
});
|
|
1069
|
-
});
|
|
1070
|
-
|
|
1071
|
-
describe("deeply nested tree", () => {
|
|
1072
|
-
test("four levels of nesting with orchestrator", () => {
|
|
1073
|
-
const r = computeLayout([
|
|
1074
|
-
session("orchestrator"),
|
|
1075
|
-
session("step-1", ["orchestrator"]),
|
|
1076
|
-
session("step-2", ["step-1"]),
|
|
1077
|
-
session("step-3", ["step-2"]),
|
|
1078
|
-
session("step-4", ["step-3"]),
|
|
1079
|
-
]);
|
|
1080
|
-
expect(r.map["orchestrator"]!.depth).toBe(0);
|
|
1081
|
-
expect(r.map["step-1"]!.depth).toBe(1);
|
|
1082
|
-
expect(r.map["step-2"]!.depth).toBe(2);
|
|
1083
|
-
expect(r.map["step-3"]!.depth).toBe(3);
|
|
1084
|
-
expect(r.map["step-4"]!.depth).toBe(4);
|
|
1085
|
-
// All share x (single chain)
|
|
1086
|
-
const x0 = r.map["orchestrator"]!.x;
|
|
1087
|
-
for (const name of ["step-1", "step-2", "step-3", "step-4"]) {
|
|
1088
|
-
expect(r.map[name]!.x).toBe(x0);
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
});
|
|
1092
|
-
|
|
1093
|
-
describe("merge node as single parent", () => {
|
|
1094
|
-
test("child of merge node is placed correctly", () => {
|
|
1095
|
-
const r = computeLayout([
|
|
1096
|
-
session("A"),
|
|
1097
|
-
session("B"),
|
|
1098
|
-
session("M", ["A", "B"]),
|
|
1099
|
-
session("child", ["M"]),
|
|
1100
|
-
]);
|
|
1101
|
-
expect(r.map["M"]!.depth).toBe(1);
|
|
1102
|
-
expect(r.map["child"]!.depth).toBe(2);
|
|
1103
|
-
// child should be directly below M
|
|
1104
|
-
expect(r.map["child"]!.x).toBe(r.map["M"]!.x);
|
|
1105
|
-
});
|
|
1106
|
-
});
|
|
1107
|
-
|
|
1108
|
-
describe("wide fan-out from non-root node", () => {
|
|
1109
|
-
test("multiple children of a mid-tree node", () => {
|
|
1110
|
-
const r = computeLayout([
|
|
1111
|
-
session("orchestrator"),
|
|
1112
|
-
session("parent", ["orchestrator"]),
|
|
1113
|
-
session("c1", ["parent"]),
|
|
1114
|
-
session("c2", ["parent"]),
|
|
1115
|
-
session("c3", ["parent"]),
|
|
1116
|
-
]);
|
|
1117
|
-
expect(r.map["parent"]!.depth).toBe(1);
|
|
1118
|
-
expect(r.map["c1"]!.depth).toBe(2);
|
|
1119
|
-
expect(r.map["c2"]!.depth).toBe(2);
|
|
1120
|
-
expect(r.map["c3"]!.depth).toBe(2);
|
|
1121
|
-
// parent centered over children
|
|
1122
|
-
const parentX = r.map["parent"]!.x;
|
|
1123
|
-
const c1X = r.map["c1"]!.x;
|
|
1124
|
-
const c3X = r.map["c3"]!.x;
|
|
1125
|
-
expect(parentX).toBe(Math.round((c1X + c3X) / 2));
|
|
1126
|
-
});
|
|
1127
|
-
});
|
|
1128
|
-
|
|
1129
|
-
// ─── Extended invariants for new topologies ───
|
|
1130
|
-
|
|
1131
|
-
describe("layout invariants (extended edge cases)", () => {
|
|
1132
|
-
const EDGE_TOPOLOGIES = [
|
|
1133
|
-
{
|
|
1134
|
-
name: "missing parent → orchestrator fallback",
|
|
1135
|
-
sessions: () => [
|
|
1136
|
-
session("orchestrator"),
|
|
1137
|
-
session("orphan", ["nonexistent"]),
|
|
1138
|
-
],
|
|
1139
|
-
},
|
|
1140
|
-
{
|
|
1141
|
-
name: "merge with missing parent reclassified",
|
|
1142
|
-
sessions: () => [
|
|
1143
|
-
session("orchestrator"),
|
|
1144
|
-
session("A", ["orchestrator"]),
|
|
1145
|
-
session("M", ["A", "nonexistent"]),
|
|
1146
|
-
],
|
|
1147
|
-
},
|
|
1148
|
-
{
|
|
1149
|
-
name: "chained merges in reverse order",
|
|
1150
|
-
sessions: () => [
|
|
1151
|
-
session("A"),
|
|
1152
|
-
session("B"),
|
|
1153
|
-
session("C"),
|
|
1154
|
-
session("M2", ["M1", "C"]),
|
|
1155
|
-
session("M1", ["A", "B"]),
|
|
1156
|
-
],
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
name: "indirect merge dependency",
|
|
1160
|
-
sessions: () => [
|
|
1161
|
-
session("A"),
|
|
1162
|
-
session("B"),
|
|
1163
|
-
session("C"),
|
|
1164
|
-
session("M1", ["A", "B"]),
|
|
1165
|
-
session("X", ["M1"]),
|
|
1166
|
-
session("M2", ["C", "X"]),
|
|
1167
|
-
],
|
|
1168
|
-
},
|
|
1169
|
-
{
|
|
1170
|
-
name: "deeply nested (5 levels)",
|
|
1171
|
-
sessions: () => [
|
|
1172
|
-
session("orchestrator"),
|
|
1173
|
-
session("s1", ["orchestrator"]),
|
|
1174
|
-
session("s2", ["s1"]),
|
|
1175
|
-
session("s3", ["s2"]),
|
|
1176
|
-
session("s4", ["s3"]),
|
|
1177
|
-
],
|
|
1178
|
-
},
|
|
1179
|
-
{
|
|
1180
|
-
name: "wide fan-out from non-root",
|
|
1181
|
-
sessions: () => [
|
|
1182
|
-
session("orchestrator"),
|
|
1183
|
-
session("parent", ["orchestrator"]),
|
|
1184
|
-
session("c1", ["parent"]),
|
|
1185
|
-
session("c2", ["parent"]),
|
|
1186
|
-
session("c3", ["parent"]),
|
|
1187
|
-
],
|
|
1188
|
-
},
|
|
1189
|
-
];
|
|
1190
|
-
|
|
1191
|
-
for (const topo of EDGE_TOPOLOGIES) {
|
|
1192
|
-
test(`[${topo.name}] all x values are >= PAD`, () => {
|
|
1193
|
-
const r = computeLayout(topo.sessions());
|
|
1194
|
-
for (const node of Object.values(r.map)) {
|
|
1195
|
-
expect(node.x).toBeGreaterThanOrEqual(PAD);
|
|
1196
|
-
}
|
|
1197
|
-
});
|
|
1198
|
-
|
|
1199
|
-
test(`[${topo.name}] all y values are >= PAD`, () => {
|
|
1200
|
-
const r = computeLayout(topo.sessions());
|
|
1201
|
-
for (const node of Object.values(r.map)) {
|
|
1202
|
-
expect(node.y).toBeGreaterThanOrEqual(PAD);
|
|
1203
|
-
}
|
|
1204
|
-
});
|
|
1205
|
-
|
|
1206
|
-
test(`[${topo.name}] width = max(node.x + NODE_W) + PAD`, () => {
|
|
1207
|
-
const r = computeLayout(topo.sessions());
|
|
1208
|
-
const rightmost = Math.max(...Object.values(r.map).map((n) => n.x + NODE_W));
|
|
1209
|
-
expect(r.width).toBe(rightmost + PAD);
|
|
1210
|
-
});
|
|
1211
|
-
|
|
1212
|
-
test(`[${topo.name}] height = max(node.y + NODE_H) + PAD`, () => {
|
|
1213
|
-
const r = computeLayout(topo.sessions());
|
|
1214
|
-
const bottommost = Math.max(...Object.values(r.map).map((n) => n.y + NODE_H));
|
|
1215
|
-
expect(r.height).toBe(bottommost + PAD);
|
|
1216
|
-
});
|
|
1217
|
-
|
|
1218
|
-
test(`[${topo.name}] nodes at same depth share the same y`, () => {
|
|
1219
|
-
const r = computeLayout(topo.sessions());
|
|
1220
|
-
const byDepth: Record<number, number[]> = {};
|
|
1221
|
-
for (const node of Object.values(r.map)) {
|
|
1222
|
-
(byDepth[node.depth] ??= []).push(node.y);
|
|
1223
|
-
}
|
|
1224
|
-
for (const ys of Object.values(byDepth)) {
|
|
1225
|
-
const first = ys[0]!;
|
|
1226
|
-
for (const y of ys) expect(y).toBe(first);
|
|
1227
|
-
}
|
|
1228
|
-
});
|
|
1229
|
-
|
|
1230
|
-
test(`[${topo.name}] no horizontal overlap between nodes at same depth`, () => {
|
|
1231
|
-
const r = computeLayout(topo.sessions());
|
|
1232
|
-
const byDepth: Record<number, number[]> = {};
|
|
1233
|
-
for (const node of Object.values(r.map)) {
|
|
1234
|
-
(byDepth[node.depth] ??= []).push(node.x);
|
|
1235
|
-
}
|
|
1236
|
-
for (const xs of Object.values(byDepth)) {
|
|
1237
|
-
xs.sort((a, b) => a - b);
|
|
1238
|
-
for (let i = 1; i < xs.length; i++) {
|
|
1239
|
-
expect(xs[i]! - xs[i - 1]!).toBeGreaterThanOrEqual(NODE_W + H_GAP);
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
});
|
|
1245
|
-
});
|