xtrm-tools 2.3.0 → 2.4.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/README.md +132 -111
- package/cli/dist/index.cjs +142 -53
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/config/pi/extensions/beads.ts +24 -0
- package/hooks/beads-gate-core.mjs +6 -4
- package/hooks/beads-memory-gate.mjs +12 -5
- package/hooks/hooks.json +126 -0
- package/package.json +3 -1
- package/skills/test-planning/SKILL.md +208 -0
- package/skills/test-planning/evals/evals.json +23 -0
- package/skills/using-xtrm/SKILL.md +5 -27
- package/project-skills/tdd-guard/.claude/hooks/tdd-guard-pretool-bridge.cjs +0 -103
- package/project-skills/tdd-guard/.claude/settings.json +0 -38
- package/project-skills/tdd-guard/.claude/skills/using-tdd-guard/SKILL.md +0 -79
- package/project-skills/tdd-guard/CLAUDE.md +0 -98
- package/project-skills/tdd-guard/CONTRIBUTING.md +0 -38
- package/project-skills/tdd-guard/DEVELOPMENT.md +0 -127
- package/project-skills/tdd-guard/LICENSE +0 -21
- package/project-skills/tdd-guard/README.md +0 -398
- package/project-skills/tdd-guard/docs/adr/001-claude-session-subdirectory.md +0 -52
- package/project-skills/tdd-guard/docs/adr/002-secure-claude-binary-path.md +0 -56
- package/project-skills/tdd-guard/docs/adr/003-remove-configurable-data-directory.md +0 -56
- package/project-skills/tdd-guard/docs/adr/004-monorepo-architecture.md +0 -64
- package/project-skills/tdd-guard/docs/adr/005-claude-project-dir-support.md +0 -55
- package/project-skills/tdd-guard/docs/adr/006-phpunit-separate-repository.md +0 -93
- package/project-skills/tdd-guard/docs/adr/007-golangci-lint-path-support.md +0 -83
- package/project-skills/tdd-guard/docs/adr/008-storybook-reporter-design.md +0 -182
- package/project-skills/tdd-guard/docs/assets/tdd-guard-demo-screenshot.gif +0 -0
- package/project-skills/tdd-guard/docs/config-migration.md +0 -143
- package/project-skills/tdd-guard/docs/configuration.md +0 -137
- package/project-skills/tdd-guard/docs/custom-instructions.md +0 -43
- package/project-skills/tdd-guard/docs/enforcement.md +0 -46
- package/project-skills/tdd-guard/docs/ignore-patterns.md +0 -81
- package/project-skills/tdd-guard/docs/linting.md +0 -109
- package/project-skills/tdd-guard/docs/quick-commands.md +0 -52
- package/project-skills/tdd-guard/docs/session-management.md +0 -75
- package/project-skills/tdd-guard/docs/storybook-vitest-addon.md +0 -120
- package/project-skills/tdd-guard/docs/validation-model.md +0 -63
- package/project-skills/tdd-guard/eslint.config.mjs +0 -140
- package/project-skills/tdd-guard/package-lock.json +0 -16937
- package/project-skills/tdd-guard/package.json +0 -102
- package/project-skills/tdd-guard/reporters/go/README.md +0 -67
- package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main.go +0 -127
- package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main_test.go +0 -280
- package/project-skills/tdd-guard/reporters/go/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/go/go.sum +0 -0
- package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter.go +0 -126
- package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter_test.go +0 -264
- package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader.go +0 -26
- package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader_test.go +0 -37
- package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader.go +0 -94
- package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader_test.go +0 -198
- package/project-skills/tdd-guard/reporters/go/internal/parser/parser.go +0 -245
- package/project-skills/tdd-guard/reporters/go/internal/parser/parser_test.go +0 -547
- package/project-skills/tdd-guard/reporters/go/internal/storage/storage.go +0 -35
- package/project-skills/tdd-guard/reporters/go/internal/storage/storage_test.go +0 -113
- package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer.go +0 -103
- package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer_test.go +0 -303
- package/project-skills/tdd-guard/reporters/jest/README.md +0 -102
- package/project-skills/tdd-guard/reporters/jest/package.json +0 -38
- package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test-data.ts +0 -199
- package/project-skills/tdd-guard/reporters/jest/src/JestReporter.test.ts +0 -302
- package/project-skills/tdd-guard/reporters/jest/src/JestReporter.ts +0 -201
- package/project-skills/tdd-guard/reporters/jest/src/index.ts +0 -4
- package/project-skills/tdd-guard/reporters/jest/src/types.ts +0 -42
- package/project-skills/tdd-guard/reporters/jest/tsconfig.json +0 -11
- package/project-skills/tdd-guard/reporters/phpunit/.php-cs-fixer.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/README.md +0 -97
- package/project-skills/tdd-guard/reporters/phpunit/SYNC_README.md +0 -29
- package/project-skills/tdd-guard/reporters/phpunit/composer.json +0 -55
- package/project-skills/tdd-guard/reporters/phpunit/phpunit.xml.dist +0 -19
- package/project-skills/tdd-guard/reporters/phpunit/psalm.xml +0 -44
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/ErroredTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/FailedTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/IncompleteTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/PassedTestSubscriber.php +0 -27
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/SkippedTestSubscriber.php +0 -28
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/TestRunnerFinishedSubscriber.php +0 -24
- package/project-skills/tdd-guard/reporters/phpunit/src/PathValidator.php +0 -88
- package/project-skills/tdd-guard/reporters/phpunit/src/Storage.php +0 -26
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardExtension.php +0 -33
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardListener.php +0 -158
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardSubscriber.php +0 -35
- package/project-skills/tdd-guard/reporters/phpunit/src/TestResultCollector.php +0 -105
- package/project-skills/tdd-guard/reporters/phpunit/tests/PathValidatorTest.php +0 -74
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionFailedTest.php +0 -241
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionTest.php +0 -84
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardStorageLocationTest.php +0 -71
- package/project-skills/tdd-guard/reporters/pytest/README.md +0 -77
- package/project-skills/tdd-guard/reporters/pytest/pyproject.toml +0 -43
- package/project-skills/tdd-guard/reporters/pytest/pytest.ini.example +0 -7
- package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/__init__.py +0 -1
- package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/pytest_reporter.py +0 -134
- package/project-skills/tdd-guard/reporters/pytest/tests/__init__.py +0 -1
- package/project-skills/tdd-guard/reporters/pytest/tests/conftest.py +0 -3
- package/project-skills/tdd-guard/reporters/pytest/tests/helpers.py +0 -293
- package/project-skills/tdd-guard/reporters/pytest/tests/test_config_option.py +0 -38
- package/project-skills/tdd-guard/reporters/pytest/tests/test_path_validation.py +0 -59
- package/project-skills/tdd-guard/reporters/pytest/tests/test_plugin_config.py +0 -32
- package/project-skills/tdd-guard/reporters/pytest/tests/test_project_root.py +0 -296
- package/project-skills/tdd-guard/reporters/pytest/tests/test_pytest_reporter.py +0 -137
- package/project-skills/tdd-guard/reporters/rspec/Gemfile +0 -3
- package/project-skills/tdd-guard/reporters/rust/Cargo.lock +0 -458
- package/project-skills/tdd-guard/reporters/rust/Cargo.toml +0 -33
- package/project-skills/tdd-guard/reporters/rust/Makefile.example +0 -95
- package/project-skills/tdd-guard/reporters/rust/README.md +0 -88
- package/project-skills/tdd-guard/reporters/rust/src/error_parser.rs +0 -309
- package/project-skills/tdd-guard/reporters/rust/src/main.rs +0 -464
- package/project-skills/tdd-guard/reporters/rust/src/parser.rs +0 -225
- package/project-skills/tdd-guard/reporters/rust/src/transformer.rs +0 -409
- package/project-skills/tdd-guard/reporters/storybook/README.md +0 -108
- package/project-skills/tdd-guard/reporters/storybook/package-lock.json +0 -9482
- package/project-skills/tdd-guard/reporters/storybook/package.json +0 -43
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test-data.ts +0 -22
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test.ts +0 -190
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.ts +0 -88
- package/project-skills/tdd-guard/reporters/storybook/src/index.ts +0 -12
- package/project-skills/tdd-guard/reporters/storybook/src/types.ts +0 -37
- package/project-skills/tdd-guard/reporters/storybook/tsconfig.json +0 -11
- package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/single_failing_test.go +0 -13
- package/project-skills/tdd-guard/reporters/test/artifacts/go/import/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/go/import/single_import_error_test.go +0 -17
- package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/go.mod +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/single_passing_test.go +0 -13
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-failing.test.js +0 -5
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-import-error.test.js +0 -8
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-passing.test.js +0 -5
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleFailingTest.php +0 -11
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleImportErrorTest.php +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SinglePassingTest.php +0 -11
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_failing.py +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_import_error.py +0 -6
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_passing.py +0 -3
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.lock +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.toml +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/src/lib.rs +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.lock +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.toml +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/src/lib.rs +0 -13
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.lock +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.toml +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/src/lib.rs +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/Calculator.js +0 -4
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-failing.stories.js +0 -15
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-import-error.stories.js +0 -14
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-passing.stories.js +0 -15
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-failing.test.js +0 -7
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-import-error.test.js +0 -9
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-passing.test.js +0 -7
- package/project-skills/tdd-guard/reporters/test/factories/go.ts +0 -59
- package/project-skills/tdd-guard/reporters/test/factories/helpers.ts +0 -48
- package/project-skills/tdd-guard/reporters/test/factories/index.ts +0 -7
- package/project-skills/tdd-guard/reporters/test/factories/jest.ts +0 -51
- package/project-skills/tdd-guard/reporters/test/factories/phpunit.ts +0 -63
- package/project-skills/tdd-guard/reporters/test/factories/pytest.ts +0 -41
- package/project-skills/tdd-guard/reporters/test/factories/rust.ts +0 -158
- package/project-skills/tdd-guard/reporters/test/factories/storybook.ts +0 -198
- package/project-skills/tdd-guard/reporters/test/factories/vitest.ts +0 -51
- package/project-skills/tdd-guard/reporters/test/reporters.integration.test.ts +0 -735
- package/project-skills/tdd-guard/reporters/test/types.ts +0 -28
- package/project-skills/tdd-guard/reporters/vitest/README.md +0 -64
- package/project-skills/tdd-guard/reporters/vitest/package.json +0 -35
- package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test-data.ts +0 -85
- package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.test.ts +0 -446
- package/project-skills/tdd-guard/reporters/vitest/src/VitestReporter.ts +0 -110
- package/project-skills/tdd-guard/reporters/vitest/src/index.ts +0 -4
- package/project-skills/tdd-guard/reporters/vitest/src/types.ts +0 -39
- package/project-skills/tdd-guard/reporters/vitest/tsconfig.json +0 -11
- package/project-skills/tdd-guard/src/cli/buildContext.test.ts +0 -200
- package/project-skills/tdd-guard/src/cli/buildContext.ts +0 -48
- package/project-skills/tdd-guard/src/cli/tdd-guard.test.ts +0 -159
- package/project-skills/tdd-guard/src/cli/tdd-guard.ts +0 -48
- package/project-skills/tdd-guard/src/config/Config.test.ts +0 -538
- package/project-skills/tdd-guard/src/config/Config.ts +0 -172
- package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.test.ts +0 -58
- package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.ts +0 -8
- package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.test.ts +0 -347
- package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.ts +0 -61
- package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.test.ts +0 -24
- package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.ts +0 -7
- package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.test.ts +0 -377
- package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.ts +0 -75
- package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.test.ts +0 -563
- package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.ts +0 -140
- package/project-skills/tdd-guard/src/contracts/types/ClientType.ts +0 -1
- package/project-skills/tdd-guard/src/contracts/types/ConfigOptions.ts +0 -12
- package/project-skills/tdd-guard/src/contracts/types/Context.ts +0 -16
- package/project-skills/tdd-guard/src/contracts/types/ModelClient.ts +0 -3
- package/project-skills/tdd-guard/src/contracts/types/ValidationResult.ts +0 -6
- package/project-skills/tdd-guard/src/guard/GuardManager.test.ts +0 -336
- package/project-skills/tdd-guard/src/guard/GuardManager.ts +0 -83
- package/project-skills/tdd-guard/src/hooks/HookEvents.test.ts +0 -107
- package/project-skills/tdd-guard/src/hooks/HookEvents.ts +0 -39
- package/project-skills/tdd-guard/src/hooks/fileTypeDetection.ts +0 -16
- package/project-skills/tdd-guard/src/hooks/postToolLint.test.ts +0 -327
- package/project-skills/tdd-guard/src/hooks/postToolLint.ts +0 -165
- package/project-skills/tdd-guard/src/hooks/processHookData.test.ts +0 -465
- package/project-skills/tdd-guard/src/hooks/processHookData.ts +0 -203
- package/project-skills/tdd-guard/src/hooks/sessionHandler.test.ts +0 -136
- package/project-skills/tdd-guard/src/hooks/sessionHandler.ts +0 -31
- package/project-skills/tdd-guard/src/hooks/userPromptHandler.test.ts +0 -131
- package/project-skills/tdd-guard/src/hooks/userPromptHandler.ts +0 -55
- package/project-skills/tdd-guard/src/index.ts +0 -19
- package/project-skills/tdd-guard/src/linters/Linter.ts +0 -5
- package/project-skills/tdd-guard/src/linters/eslint/ESLint.test.ts +0 -183
- package/project-skills/tdd-guard/src/linters/eslint/ESLint.ts +0 -82
- package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.test.ts +0 -170
- package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.ts +0 -148
- package/project-skills/tdd-guard/src/processors/index.ts +0 -1
- package/project-skills/tdd-guard/src/processors/lintProcessor.ts +0 -77
- package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.test.ts +0 -303
- package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.ts +0 -255
- package/project-skills/tdd-guard/src/providers/LinterProvider.test.ts +0 -43
- package/project-skills/tdd-guard/src/providers/LinterProvider.ts +0 -20
- package/project-skills/tdd-guard/src/providers/ModelClientProvider.test.ts +0 -68
- package/project-skills/tdd-guard/src/providers/ModelClientProvider.ts +0 -22
- package/project-skills/tdd-guard/src/storage/FileStorage.test.ts +0 -76
- package/project-skills/tdd-guard/src/storage/FileStorage.ts +0 -108
- package/project-skills/tdd-guard/src/storage/MemoryStorage.ts +0 -57
- package/project-skills/tdd-guard/src/storage/Storage.test.ts +0 -227
- package/project-skills/tdd-guard/src/storage/Storage.ts +0 -17
- package/project-skills/tdd-guard/src/validation/context/context.test.ts +0 -364
- package/project-skills/tdd-guard/src/validation/context/context.ts +0 -155
- package/project-skills/tdd-guard/src/validation/models/AnthropicApi.test.ts +0 -171
- package/project-skills/tdd-guard/src/validation/models/AnthropicApi.ts +0 -49
- package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.test.ts +0 -167
- package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.ts +0 -54
- package/project-skills/tdd-guard/src/validation/models/ClaudeCli.test.ts +0 -239
- package/project-skills/tdd-guard/src/validation/models/ClaudeCli.ts +0 -57
- package/project-skills/tdd-guard/src/validation/prompts/file-types.ts +0 -52
- package/project-skills/tdd-guard/src/validation/prompts/operations/edit.ts +0 -58
- package/project-skills/tdd-guard/src/validation/prompts/operations/multi-edit.ts +0 -54
- package/project-skills/tdd-guard/src/validation/prompts/operations/write.ts +0 -54
- package/project-skills/tdd-guard/src/validation/prompts/response.ts +0 -40
- package/project-skills/tdd-guard/src/validation/prompts/rules.ts +0 -51
- package/project-skills/tdd-guard/src/validation/prompts/system-prompt.ts +0 -10
- package/project-skills/tdd-guard/src/validation/prompts/tools/lint-results.ts +0 -15
- package/project-skills/tdd-guard/src/validation/prompts/tools/test-output.ts +0 -14
- package/project-skills/tdd-guard/src/validation/prompts/tools/todos.ts +0 -9
- package/project-skills/tdd-guard/src/validation/validator.test.ts +0 -268
- package/project-skills/tdd-guard/src/validation/validator.ts +0 -159
- package/project-skills/tdd-guard/test/artifacts/go/.golangci.yml +0 -6
- package/project-skills/tdd-guard/test/artifacts/go/with-issues/file-with-issues.go +0 -12
- package/project-skills/tdd-guard/test/artifacts/go/with-issues/go.mod +0 -3
- package/project-skills/tdd-guard/test/artifacts/go/without-issues/file-without-issues.go +0 -7
- package/project-skills/tdd-guard/test/artifacts/go/without-issues/go.mod +0 -3
- package/project-skills/tdd-guard/test/artifacts/javascript/eslint.config.js +0 -20
- package/project-skills/tdd-guard/test/artifacts/javascript/file-with-issues.js +0 -12
- package/project-skills/tdd-guard/test/artifacts/javascript/file-without-issues.js +0 -10
- package/project-skills/tdd-guard/test/hooks/fileTypeDetection.test.ts +0 -26
- package/project-skills/tdd-guard/test/hooks/processHookData.fileType.test.ts +0 -46
- package/project-skills/tdd-guard/test/hooks/processHookData.python.test.ts +0 -68
- package/project-skills/tdd-guard/test/integration/test-context.test.ts +0 -66
- package/project-skills/tdd-guard/test/integration/validator.core.test.ts +0 -96
- package/project-skills/tdd-guard/test/integration/validator.scenarios.test.ts +0 -497
- package/project-skills/tdd-guard/test/utils/assertions.ts +0 -29
- package/project-skills/tdd-guard/test/utils/factories/contextFactory.ts +0 -30
- package/project-skills/tdd-guard/test/utils/factories/editFactory.ts +0 -82
- package/project-skills/tdd-guard/test/utils/factories/helpers.test.ts +0 -46
- package/project-skills/tdd-guard/test/utils/factories/helpers.ts +0 -46
- package/project-skills/tdd-guard/test/utils/factories/lintFactory.ts +0 -352
- package/project-skills/tdd-guard/test/utils/factories/modelClientProviderFactory.ts +0 -21
- package/project-skills/tdd-guard/test/utils/factories/multiEditFactory.ts +0 -79
- package/project-skills/tdd-guard/test/utils/factories/operations.ts +0 -57
- package/project-skills/tdd-guard/test/utils/factories/reporterFactory.ts +0 -55
- package/project-skills/tdd-guard/test/utils/factories/scenarios/index.ts +0 -22
- package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/python.ts +0 -745
- package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/typescript.ts +0 -767
- package/project-skills/tdd-guard/test/utils/factories/scenarios/types.ts +0 -77
- package/project-skills/tdd-guard/test/utils/factories/scenarios/utils.ts +0 -15
- package/project-skills/tdd-guard/test/utils/factories/sessionStartFactory.ts +0 -36
- package/project-skills/tdd-guard/test/utils/factories/testDefaults.ts +0 -90
- package/project-skills/tdd-guard/test/utils/factories/testResultsFactory.ts +0 -234
- package/project-skills/tdd-guard/test/utils/factories/todoFactory.ts +0 -99
- package/project-skills/tdd-guard/test/utils/factories/userPromptSubmitFactory.ts +0 -39
- package/project-skills/tdd-guard/test/utils/factories/writeFactory.ts +0 -70
- package/project-skills/tdd-guard/test/utils/index.ts +0 -131
- package/project-skills/tdd-guard/tsconfig.build.json +0 -16
- package/project-skills/tdd-guard/tsconfig.eslint.json +0 -17
- package/project-skills/tdd-guard/tsconfig.json +0 -32
- package/project-skills/tdd-guard/tsconfig.node.json +0 -10
- package/project-skills/tdd-guard/vitest.config.ts +0 -85
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Context } from '../../../src/contracts/types/Context'
|
|
2
|
-
import { TEST_DEFAULTS } from './testDefaults'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Creates a test Context object with sensible defaults
|
|
6
|
-
*/
|
|
7
|
-
export function context(overrides?: Partial<Context>): Context {
|
|
8
|
-
return {
|
|
9
|
-
modifications: TEST_DEFAULTS.modifications,
|
|
10
|
-
todo: JSON.stringify([TEST_DEFAULTS.todo]),
|
|
11
|
-
test: TEST_DEFAULTS.test,
|
|
12
|
-
...overrides,
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Creates a test Context object without specific fields
|
|
18
|
-
*/
|
|
19
|
-
export function contextWithout<K extends keyof Context>(
|
|
20
|
-
...omitFields: K[]
|
|
21
|
-
): Omit<Context, K> {
|
|
22
|
-
const fullContext = context()
|
|
23
|
-
const result = { ...fullContext }
|
|
24
|
-
|
|
25
|
-
for (const field of omitFields) {
|
|
26
|
-
delete result[field]
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return result as Omit<Context, K>
|
|
30
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Factory functions for creating Edit and EditOperation test data
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
Edit,
|
|
7
|
-
EditOperation,
|
|
8
|
-
} from '../../../src/contracts/schemas/toolSchemas'
|
|
9
|
-
import { hookDataDefaults, omit } from './helpers'
|
|
10
|
-
import { TEST_DEFAULTS } from './testDefaults'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates a single edit object
|
|
14
|
-
* @param params - Optional parameters for the edit
|
|
15
|
-
*/
|
|
16
|
-
export const edit = (params?: Partial<Edit>): Edit => {
|
|
17
|
-
const defaults = TEST_DEFAULTS.edit
|
|
18
|
-
const base = params ?? {}
|
|
19
|
-
|
|
20
|
-
const result: Edit = {
|
|
21
|
-
file_path: base.file_path ?? defaults.file_path,
|
|
22
|
-
old_string: base.old_string ?? defaults.old_string,
|
|
23
|
-
new_string: base.new_string ?? defaults.new_string,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (base.replace_all !== undefined) {
|
|
27
|
-
result.replace_all = base.replace_all
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return result
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Creates an edit object with specified properties omitted
|
|
35
|
-
* @param keys - Array of property keys to omit
|
|
36
|
-
* @param params - Optional parameters for the edit
|
|
37
|
-
*/
|
|
38
|
-
export const editWithout = <K extends keyof Edit>(
|
|
39
|
-
keys: K[],
|
|
40
|
-
params?: Partial<Edit>
|
|
41
|
-
): Omit<Edit, K> => {
|
|
42
|
-
const fullEdit = edit(params)
|
|
43
|
-
return omit(fullEdit, keys)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Creates a single edit operation object
|
|
48
|
-
* @param params - Optional parameters for the edit operation
|
|
49
|
-
*/
|
|
50
|
-
export const editOperation = (
|
|
51
|
-
params?: Partial<EditOperation>
|
|
52
|
-
): EditOperation => ({
|
|
53
|
-
...hookDataDefaults(),
|
|
54
|
-
tool_name: 'Edit',
|
|
55
|
-
tool_input: params?.tool_input ?? edit(),
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Creates an edit operation object with specified properties omitted
|
|
60
|
-
* @param keys - Array of property keys to omit
|
|
61
|
-
* @param params - Optional parameters for the edit operation
|
|
62
|
-
*/
|
|
63
|
-
export const editOperationWithout = <K extends keyof EditOperation>(
|
|
64
|
-
keys: K[],
|
|
65
|
-
params?: Partial<EditOperation>
|
|
66
|
-
): Omit<EditOperation, K> => {
|
|
67
|
-
const fullEditOperation = editOperation(params)
|
|
68
|
-
return omit(fullEditOperation, keys)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Creates an invalid edit operation object for testing
|
|
73
|
-
* @param params - Parameters including invalid values
|
|
74
|
-
*/
|
|
75
|
-
export const invalidEditOperation = (params: {
|
|
76
|
-
tool_name?: string
|
|
77
|
-
tool_input?: unknown
|
|
78
|
-
}): Record<string, unknown> => ({
|
|
79
|
-
...hookDataDefaults(),
|
|
80
|
-
tool_name: params.tool_name ?? 'Edit',
|
|
81
|
-
tool_input: params.tool_input ?? edit(),
|
|
82
|
-
})
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { describe, test, expect } from 'vitest'
|
|
2
|
-
import { pick, omit } from './helpers'
|
|
3
|
-
|
|
4
|
-
describe('Helper functions', () => {
|
|
5
|
-
describe('pick', () => {
|
|
6
|
-
const testObject = {
|
|
7
|
-
a: 1,
|
|
8
|
-
b: 'two',
|
|
9
|
-
c: true,
|
|
10
|
-
d: { nested: 'value' },
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
test('picks single property', () => {
|
|
14
|
-
const result = pick(testObject, ['a'])
|
|
15
|
-
|
|
16
|
-
expect(result).toEqual({ a: 1 })
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
test('picks multiple properties', () => {
|
|
20
|
-
const result = pick(testObject, ['a', 'c'])
|
|
21
|
-
|
|
22
|
-
expect(result).toEqual({ a: 1, c: true })
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
describe('omit', () => {
|
|
27
|
-
const testObject = {
|
|
28
|
-
a: 1,
|
|
29
|
-
b: 'two',
|
|
30
|
-
c: true,
|
|
31
|
-
d: { nested: 'value' },
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
test('omits single property', () => {
|
|
35
|
-
const result = omit(testObject, ['a'])
|
|
36
|
-
|
|
37
|
-
expect(result).toEqual({ b: 'two', c: true, d: { nested: 'value' } })
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
test('omits multiple properties', () => {
|
|
41
|
-
const result = omit(testObject, ['a', 'c'])
|
|
42
|
-
|
|
43
|
-
expect(result).toEqual({ b: 'two', d: { nested: 'value' } })
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
})
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper functions for object manipulation in test factories
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { TEST_DEFAULTS } from './testDefaults'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Default hook data fields for all operations
|
|
9
|
-
*/
|
|
10
|
-
export const hookDataDefaults = (): {
|
|
11
|
-
session_id: string
|
|
12
|
-
transcript_path: string
|
|
13
|
-
hook_event_name: string
|
|
14
|
-
} => ({
|
|
15
|
-
session_id: TEST_DEFAULTS.hookData.session_id,
|
|
16
|
-
transcript_path: TEST_DEFAULTS.hookData.transcript_path,
|
|
17
|
-
hook_event_name: TEST_DEFAULTS.hookData.hook_event_name,
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Creates a new object with only the specified properties
|
|
22
|
-
* @param obj - The source object
|
|
23
|
-
* @param keys - Array of property keys to include
|
|
24
|
-
* @returns A new object with only the specified properties
|
|
25
|
-
*/
|
|
26
|
-
export const pick = <T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> => {
|
|
27
|
-
const result = {} as Pick<T, K>
|
|
28
|
-
keys.forEach((key) => {
|
|
29
|
-
result[key] = obj[key]
|
|
30
|
-
})
|
|
31
|
-
return result
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Creates a new object with specified properties omitted
|
|
36
|
-
* @param obj - The source object
|
|
37
|
-
* @param keys - Array of property keys to omit
|
|
38
|
-
* @returns A new object without the specified properties
|
|
39
|
-
*/
|
|
40
|
-
export const omit = <T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> => {
|
|
41
|
-
const result = { ...obj }
|
|
42
|
-
keys.forEach((key) => {
|
|
43
|
-
delete result[key]
|
|
44
|
-
})
|
|
45
|
-
return result as Omit<T, K>
|
|
46
|
-
}
|
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Factory functions for creating Lint test data
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
LintIssue,
|
|
7
|
-
LintData,
|
|
8
|
-
LintResult,
|
|
9
|
-
ESLintMessage,
|
|
10
|
-
ESLintResult,
|
|
11
|
-
GolangciLintPosition,
|
|
12
|
-
GolangciLintIssue,
|
|
13
|
-
GolangciLintResult,
|
|
14
|
-
} from '../../../src/contracts/schemas/lintSchemas'
|
|
15
|
-
import { omit } from './helpers'
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Creates a single lint issue object
|
|
19
|
-
* @param params - Optional parameters for the lint issue
|
|
20
|
-
*/
|
|
21
|
-
export const lintIssue = (params?: Partial<LintIssue>): LintIssue => {
|
|
22
|
-
const defaults: LintIssue = {
|
|
23
|
-
file: '/src/example.ts',
|
|
24
|
-
line: 15,
|
|
25
|
-
column: 5,
|
|
26
|
-
severity: 'error',
|
|
27
|
-
message: 'Function has too high complexity',
|
|
28
|
-
rule: 'complexity',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
...defaults,
|
|
33
|
-
...params,
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Creates a lint issue object with specified properties omitted
|
|
39
|
-
* @param keys - Array of property keys to omit
|
|
40
|
-
* @param params - Optional parameters for the lint issue
|
|
41
|
-
*/
|
|
42
|
-
export const lintIssueWithout = <K extends keyof LintIssue>(
|
|
43
|
-
keys: K[],
|
|
44
|
-
params?: Partial<LintIssue>
|
|
45
|
-
): Omit<LintIssue, K> => {
|
|
46
|
-
const fullLintIssue = lintIssue(params)
|
|
47
|
-
return omit(fullLintIssue, keys)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Creates a lint result object
|
|
52
|
-
* @param params - Optional parameters for the lint result
|
|
53
|
-
*/
|
|
54
|
-
export const lintResult = (params?: Partial<LintResult>): LintResult => {
|
|
55
|
-
const defaults: LintResult = {
|
|
56
|
-
timestamp: '2024-01-01T00:00:00Z',
|
|
57
|
-
files: ['/src/example.ts'],
|
|
58
|
-
issues: [lintIssue()],
|
|
59
|
-
errorCount: 1,
|
|
60
|
-
warningCount: 0,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
...defaults,
|
|
65
|
-
...params,
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Creates a lint result object with specified properties omitted
|
|
71
|
-
* @param keys - Array of property keys to omit
|
|
72
|
-
* @param params - Optional parameters for the lint result
|
|
73
|
-
*/
|
|
74
|
-
export const lintResultWithout = <K extends keyof LintResult>(
|
|
75
|
-
keys: K[],
|
|
76
|
-
params?: Partial<LintResult>
|
|
77
|
-
): Omit<LintResult, K> => {
|
|
78
|
-
const fullLintResult = lintResult(params)
|
|
79
|
-
return omit(fullLintResult, keys)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Creates a lint data object
|
|
84
|
-
* @param params - Optional parameters for the lint data
|
|
85
|
-
*/
|
|
86
|
-
export const lintData = (params?: Partial<LintData>): LintData => {
|
|
87
|
-
const defaults: LintData = {
|
|
88
|
-
timestamp: '2024-01-01T00:00:00Z',
|
|
89
|
-
files: ['/src/example.ts'],
|
|
90
|
-
issues: [lintIssue()],
|
|
91
|
-
errorCount: 1,
|
|
92
|
-
warningCount: 0,
|
|
93
|
-
hasNotifiedAboutLintIssues: false,
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
...defaults,
|
|
98
|
-
...params,
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Creates a lint data object with specified properties omitted
|
|
104
|
-
* @param keys - Array of property keys to omit
|
|
105
|
-
* @param params - Optional parameters for the lint data
|
|
106
|
-
*/
|
|
107
|
-
export const lintDataWithout = <K extends keyof LintData>(
|
|
108
|
-
keys: K[],
|
|
109
|
-
params?: Partial<LintData>
|
|
110
|
-
): Omit<LintData, K> => {
|
|
111
|
-
const fullLintData = lintData(params)
|
|
112
|
-
return omit(fullLintData, keys)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Creates an ESLint message object
|
|
117
|
-
* @param params - Optional parameters for the ESLint message
|
|
118
|
-
*/
|
|
119
|
-
export const eslintMessage = (
|
|
120
|
-
params?: Partial<ESLintMessage>
|
|
121
|
-
): ESLintMessage => {
|
|
122
|
-
const defaults: ESLintMessage = {
|
|
123
|
-
line: 10,
|
|
124
|
-
column: 5,
|
|
125
|
-
severity: 2,
|
|
126
|
-
message: 'Unexpected var, use let or const instead',
|
|
127
|
-
ruleId: 'no-var',
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return {
|
|
131
|
-
...defaults,
|
|
132
|
-
...params,
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Creates an ESLint message object with specified properties omitted
|
|
138
|
-
* @param keys - Array of property keys to omit
|
|
139
|
-
* @param params - Optional parameters for the ESLint message
|
|
140
|
-
*/
|
|
141
|
-
export const eslintMessageWithout = <K extends keyof ESLintMessage>(
|
|
142
|
-
keys: K[],
|
|
143
|
-
params?: Partial<ESLintMessage>
|
|
144
|
-
): Omit<ESLintMessage, K> => {
|
|
145
|
-
const fullMessage = eslintMessage(params)
|
|
146
|
-
return omit(fullMessage, keys)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Creates an ESLint result object
|
|
151
|
-
* @param params - Optional parameters for the ESLint result
|
|
152
|
-
*/
|
|
153
|
-
export const eslintResult = (params?: Partial<ESLintResult>): ESLintResult => {
|
|
154
|
-
const defaults: ESLintResult = {
|
|
155
|
-
filePath: '/src/example.ts',
|
|
156
|
-
messages: [eslintMessage()],
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return {
|
|
160
|
-
...defaults,
|
|
161
|
-
...params,
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Creates an ESLint result object with specified properties omitted
|
|
167
|
-
* @param keys - Array of property keys to omit
|
|
168
|
-
* @param params - Optional parameters for the ESLint result
|
|
169
|
-
*/
|
|
170
|
-
export const eslintResultWithout = <K extends keyof ESLintResult>(
|
|
171
|
-
keys: K[],
|
|
172
|
-
params?: Partial<ESLintResult>
|
|
173
|
-
): Omit<ESLintResult, K> => {
|
|
174
|
-
const fullResult = eslintResult(params)
|
|
175
|
-
return omit(fullResult, keys)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Creates a lint result object with no errors
|
|
180
|
-
* @param params - Optional parameters to override defaults
|
|
181
|
-
*/
|
|
182
|
-
export const lintResultWithoutErrors = (
|
|
183
|
-
params?: Partial<LintResult>
|
|
184
|
-
): LintResult => {
|
|
185
|
-
return {
|
|
186
|
-
timestamp: new Date().toISOString(),
|
|
187
|
-
files: params?.files ?? [],
|
|
188
|
-
issues: [],
|
|
189
|
-
errorCount: 0,
|
|
190
|
-
warningCount: 0,
|
|
191
|
-
...params,
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Creates a lint result object with errors
|
|
197
|
-
* @param params - Optional parameters to override defaults
|
|
198
|
-
*/
|
|
199
|
-
export const lintResultWithError = (
|
|
200
|
-
params?: Partial<LintResult>
|
|
201
|
-
): LintResult => {
|
|
202
|
-
const defaultIssue = lintIssue()
|
|
203
|
-
return {
|
|
204
|
-
timestamp: new Date().toISOString(),
|
|
205
|
-
files: params?.files ?? ['/src/example.ts'],
|
|
206
|
-
issues: params?.issues ?? [defaultIssue],
|
|
207
|
-
errorCount: params?.errorCount ?? 1,
|
|
208
|
-
warningCount: params?.warningCount ?? 0,
|
|
209
|
-
...params,
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Creates a lint data object with notification flag set (for testing notification state)
|
|
215
|
-
* @param params - Optional parameters to override defaults
|
|
216
|
-
*/
|
|
217
|
-
export const lintDataWithNotificationFlag = (
|
|
218
|
-
params?: Partial<LintData>
|
|
219
|
-
): LintData => {
|
|
220
|
-
return {
|
|
221
|
-
timestamp: new Date().toISOString(),
|
|
222
|
-
files: [],
|
|
223
|
-
issues: [],
|
|
224
|
-
errorCount: 0,
|
|
225
|
-
warningCount: 0,
|
|
226
|
-
hasNotifiedAboutLintIssues: true,
|
|
227
|
-
...params,
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Creates a lint data object with errors
|
|
233
|
-
* @param params - Optional parameters to override defaults
|
|
234
|
-
*/
|
|
235
|
-
export const lintDataWithError = (params?: Partial<LintData>): LintData => {
|
|
236
|
-
const baseLintResult = lintResultWithError()
|
|
237
|
-
return {
|
|
238
|
-
...baseLintResult,
|
|
239
|
-
hasNotifiedAboutLintIssues: false,
|
|
240
|
-
...params,
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Creates a lint data object without errors
|
|
246
|
-
* @param params - Optional parameters to override defaults
|
|
247
|
-
*/
|
|
248
|
-
export const lintDataWithoutErrors = (params?: Partial<LintData>): LintData => {
|
|
249
|
-
const baseLintResult = lintResultWithoutErrors()
|
|
250
|
-
return {
|
|
251
|
-
...baseLintResult,
|
|
252
|
-
hasNotifiedAboutLintIssues: false,
|
|
253
|
-
...params,
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Creates a GolangciLint position object
|
|
259
|
-
* @param params - Optional parameters for the position
|
|
260
|
-
*/
|
|
261
|
-
export const golangciLintPosition = (
|
|
262
|
-
params?: Partial<GolangciLintPosition>
|
|
263
|
-
): GolangciLintPosition => {
|
|
264
|
-
const defaults: GolangciLintPosition = {
|
|
265
|
-
Filename: '/path/to/file.go',
|
|
266
|
-
Line: 10,
|
|
267
|
-
Column: 5,
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return {
|
|
271
|
-
...defaults,
|
|
272
|
-
...params,
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Creates a GolangciLint position object with specified properties omitted
|
|
278
|
-
* @param keys - Array of property keys to omit
|
|
279
|
-
* @param params - Optional parameters for the position
|
|
280
|
-
*/
|
|
281
|
-
export const golangciLintPositionWithout = <
|
|
282
|
-
K extends keyof GolangciLintPosition,
|
|
283
|
-
>(
|
|
284
|
-
keys: K[],
|
|
285
|
-
params?: Partial<GolangciLintPosition>
|
|
286
|
-
): Omit<GolangciLintPosition, K> => {
|
|
287
|
-
const fullPosition = golangciLintPosition(params)
|
|
288
|
-
return omit(fullPosition, keys)
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Creates a GolangciLint issue object
|
|
293
|
-
* @param params - Optional parameters for the issue
|
|
294
|
-
*/
|
|
295
|
-
export const golangciLintIssue = (
|
|
296
|
-
params?: Partial<GolangciLintIssue>
|
|
297
|
-
): GolangciLintIssue => {
|
|
298
|
-
const defaults: GolangciLintIssue = {
|
|
299
|
-
FromLinter: 'typecheck',
|
|
300
|
-
Text: 'undefined: variable',
|
|
301
|
-
Severity: 'error',
|
|
302
|
-
Pos: golangciLintPosition(),
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return {
|
|
306
|
-
...defaults,
|
|
307
|
-
...params,
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Creates a GolangciLint issue object with specified properties omitted
|
|
313
|
-
* @param keys - Array of property keys to omit
|
|
314
|
-
* @param params - Optional parameters for the issue
|
|
315
|
-
*/
|
|
316
|
-
export const golangciLintIssueWithout = <K extends keyof GolangciLintIssue>(
|
|
317
|
-
keys: K[],
|
|
318
|
-
params?: Partial<GolangciLintIssue>
|
|
319
|
-
): Omit<GolangciLintIssue, K> => {
|
|
320
|
-
const fullIssue = golangciLintIssue(params)
|
|
321
|
-
return omit(fullIssue, keys)
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Creates a GolangciLint result object
|
|
326
|
-
* @param params - Optional parameters for the result
|
|
327
|
-
*/
|
|
328
|
-
export const golangciLintResult = (
|
|
329
|
-
params?: Partial<GolangciLintResult>
|
|
330
|
-
): GolangciLintResult => {
|
|
331
|
-
const defaults: GolangciLintResult = {
|
|
332
|
-
Issues: [golangciLintIssue()],
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return {
|
|
336
|
-
...defaults,
|
|
337
|
-
...params,
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Creates a GolangciLint result object with specified properties omitted
|
|
343
|
-
* @param keys - Array of property keys to omit
|
|
344
|
-
* @param params - Optional parameters for the result
|
|
345
|
-
*/
|
|
346
|
-
export const golangciLintResultWithout = <K extends keyof GolangciLintResult>(
|
|
347
|
-
keys: K[],
|
|
348
|
-
params?: Partial<GolangciLintResult>
|
|
349
|
-
): Omit<GolangciLintResult, K> => {
|
|
350
|
-
const fullResult = golangciLintResult(params)
|
|
351
|
-
return omit(fullResult, keys)
|
|
352
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ModelClientProvider } from '../../../src/providers/ModelClientProvider'
|
|
2
|
-
import { IModelClient } from '../../../src/contracts/types/ModelClient'
|
|
3
|
-
import { Config } from '../../../src/config/Config'
|
|
4
|
-
|
|
5
|
-
export function modelClientProvider(): ModelClientProvider {
|
|
6
|
-
return new MockModelClientProvider()
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
class MockModelClientProvider extends ModelClientProvider {
|
|
10
|
-
getModelClient(config?: Config): IModelClient {
|
|
11
|
-
const actualConfig = config ?? new Config()
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
ask: async () =>
|
|
15
|
-
JSON.stringify({
|
|
16
|
-
decision: undefined,
|
|
17
|
-
reason: `Using mock model client with modelType: ${actualConfig.modelType}`,
|
|
18
|
-
}),
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Factory functions for creating MultiEdit and MultiEditOperation test data
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
MultiEdit,
|
|
7
|
-
MultiEditOperation,
|
|
8
|
-
} from '../../../src/contracts/schemas/toolSchemas'
|
|
9
|
-
import { hookDataDefaults, omit } from './helpers'
|
|
10
|
-
import { TEST_DEFAULTS } from './testDefaults'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates a single multi-edit object
|
|
14
|
-
* @param params - Optional parameters for the multi-edit
|
|
15
|
-
*/
|
|
16
|
-
export const multiEdit = (params?: Partial<MultiEdit>): MultiEdit => ({
|
|
17
|
-
file_path: params?.file_path ?? TEST_DEFAULTS.multiEdit.file_path,
|
|
18
|
-
edits: params?.edits ?? [
|
|
19
|
-
{
|
|
20
|
-
old_string: TEST_DEFAULTS.multiEdit.edits[0].old_string,
|
|
21
|
-
new_string: TEST_DEFAULTS.multiEdit.edits[0].new_string,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
old_string: TEST_DEFAULTS.multiEdit.edits[1].old_string,
|
|
25
|
-
new_string: TEST_DEFAULTS.multiEdit.edits[1].new_string,
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Creates a multi-edit object with specified properties omitted
|
|
32
|
-
* @param keys - Array of property keys to omit
|
|
33
|
-
* @param params - Optional parameters for the multi-edit
|
|
34
|
-
*/
|
|
35
|
-
export const multiEditWithout = <K extends keyof MultiEdit>(
|
|
36
|
-
keys: K[],
|
|
37
|
-
params?: Partial<MultiEdit>
|
|
38
|
-
): Omit<MultiEdit, K> => {
|
|
39
|
-
const fullMultiEdit = multiEdit(params)
|
|
40
|
-
return omit(fullMultiEdit, keys)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Creates a single multi-edit operation object
|
|
45
|
-
* @param params - Optional parameters for the multi-edit operation
|
|
46
|
-
*/
|
|
47
|
-
export const multiEditOperation = (
|
|
48
|
-
params?: Partial<MultiEditOperation>
|
|
49
|
-
): MultiEditOperation => ({
|
|
50
|
-
...hookDataDefaults(),
|
|
51
|
-
tool_name: 'MultiEdit',
|
|
52
|
-
tool_input: params?.tool_input ?? multiEdit(),
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Creates a multi-edit operation object with specified properties omitted
|
|
57
|
-
* @param keys - Array of property keys to omit
|
|
58
|
-
* @param params - Optional parameters for the multi-edit operation
|
|
59
|
-
*/
|
|
60
|
-
export const multiEditOperationWithout = <K extends keyof MultiEditOperation>(
|
|
61
|
-
keys: K[],
|
|
62
|
-
params?: Partial<MultiEditOperation>
|
|
63
|
-
): Omit<MultiEditOperation, K> => {
|
|
64
|
-
const fullMultiEditOperation = multiEditOperation(params)
|
|
65
|
-
return omit(fullMultiEditOperation, keys)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Creates an invalid multi-edit operation object for testing
|
|
70
|
-
* @param params - Parameters including invalid values
|
|
71
|
-
*/
|
|
72
|
-
export const invalidMultiEditOperation = (params: {
|
|
73
|
-
tool_name?: string
|
|
74
|
-
tool_input?: unknown
|
|
75
|
-
}): Record<string, unknown> => ({
|
|
76
|
-
...hookDataDefaults(),
|
|
77
|
-
tool_name: params.tool_name ?? 'MultiEdit',
|
|
78
|
-
tool_input: params.tool_input ?? multiEdit(),
|
|
79
|
-
})
|